@goondocks/myco 0.6.5 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -5
- package/.claude-plugin/plugin.json +3 -3
- package/CONTRIBUTING.md +37 -30
- package/README.md +81 -28
- package/bin/myco-run +2 -0
- package/dist/agent-run-CGXF5PPC.js +34 -0
- package/dist/agent-run-CGXF5PPC.js.map +1 -0
- package/dist/agent-tasks-T7NVI3R7.js +180 -0
- package/dist/agent-tasks-T7NVI3R7.js.map +1 -0
- package/dist/chunk-5LPERML5.js +486 -0
- package/dist/chunk-5LPERML5.js.map +1 -0
- package/dist/chunk-5PEUFJ6U.js +92 -0
- package/dist/chunk-5PEUFJ6U.js.map +1 -0
- package/dist/chunk-5QERXFH7.js +26 -0
- package/dist/chunk-5QERXFH7.js.map +1 -0
- package/dist/{chunk-4DYD4HHG.js → chunk-5SDH75YC.js} +2 -2
- package/dist/chunk-76ZO5RGT.js +150 -0
- package/dist/chunk-76ZO5RGT.js.map +1 -0
- package/dist/chunk-AEJS57ZK.js +26 -0
- package/dist/chunk-AEJS57ZK.js.map +1 -0
- package/dist/chunk-C3AEZ3BZ.js +22 -0
- package/dist/chunk-C3AEZ3BZ.js.map +1 -0
- package/dist/chunk-CUDM5YJY.js +294 -0
- package/dist/chunk-CUDM5YJY.js.map +1 -0
- package/dist/chunk-D6DXYAFK.js +93 -0
- package/dist/chunk-D6DXYAFK.js.map +1 -0
- package/dist/chunk-D7TYRPRM.js +7312 -0
- package/dist/chunk-D7TYRPRM.js.map +1 -0
- package/dist/chunk-E4VLWIJC.js +2 -0
- package/dist/chunk-ENWBFX7F.js +50 -0
- package/dist/chunk-ENWBFX7F.js.map +1 -0
- package/dist/chunk-FFQES5MC.js +904 -0
- package/dist/chunk-FFQES5MC.js.map +1 -0
- package/dist/chunk-FMIWFRAM.js +41 -0
- package/dist/chunk-FMIWFRAM.js.map +1 -0
- package/dist/chunk-FPMEIN2W.js +66 -0
- package/dist/chunk-FPMEIN2W.js.map +1 -0
- package/dist/chunk-G2LQBFE3.js +35 -0
- package/dist/chunk-G2LQBFE3.js.map +1 -0
- package/dist/chunk-IB76KGBY.js +2 -0
- package/dist/{chunk-AHZN4Z34.js → chunk-J4RVYUH4.js} +2 -2
- package/dist/{chunk-N33KUCFP.js → chunk-JTYZRPX5.js} +1 -9
- package/dist/chunk-JTYZRPX5.js.map +1 -0
- package/dist/{chunk-ERG2IEWX.js → chunk-KH64DHOY.js} +3 -7413
- package/dist/chunk-KH64DHOY.js.map +1 -0
- package/dist/chunk-LPUQPDC2.js +19 -0
- package/dist/chunk-LPUQPDC2.js.map +1 -0
- package/dist/chunk-M5XWW7UI.js +97 -0
- package/dist/chunk-M5XWW7UI.js.map +1 -0
- package/dist/chunk-MAZOVVDU.js +305 -0
- package/dist/chunk-MAZOVVDU.js.map +1 -0
- package/dist/{chunk-54WVLTKD.js → chunk-MKKXCCQ5.js} +33 -17
- package/dist/chunk-MKKXCCQ5.js.map +1 -0
- package/dist/chunk-MSXYUXZR.js +187 -0
- package/dist/chunk-MSXYUXZR.js.map +1 -0
- package/dist/chunk-MYX5NCRH.js +45 -0
- package/dist/chunk-MYX5NCRH.js.map +1 -0
- package/dist/chunk-RJMXDUMA.js +40 -0
- package/dist/chunk-RJMXDUMA.js.map +1 -0
- package/dist/chunk-S6I62FAH.js +92 -0
- package/dist/chunk-S6I62FAH.js.map +1 -0
- package/dist/chunk-U7UUJ4FD.js +180 -0
- package/dist/chunk-U7UUJ4FD.js.map +1 -0
- package/dist/{chunk-HIN3UVOG.js → chunk-V7XG6V6C.js} +20 -11
- package/dist/chunk-V7XG6V6C.js.map +1 -0
- package/dist/chunk-W6HI4CCS.js +162 -0
- package/dist/chunk-W6HI4CCS.js.map +1 -0
- package/dist/{chunk-F7GAYVWF.js → chunk-WXSJKESH.js} +96 -9
- package/dist/chunk-WXSJKESH.js.map +1 -0
- package/dist/chunk-WZZH3YXJ.js +601 -0
- package/dist/chunk-WZZH3YXJ.js.map +1 -0
- package/dist/chunk-XLY3REL3.js +165 -0
- package/dist/chunk-XLY3REL3.js.map +1 -0
- package/dist/{chunk-4B5RO2YV.js → chunk-YZMNEIFI.js} +33 -43
- package/dist/chunk-YZMNEIFI.js.map +1 -0
- package/dist/chunk-ZESTWGJT.js +116 -0
- package/dist/chunk-ZESTWGJT.js.map +1 -0
- package/dist/chunk-ZMW6KQX2.js +103 -0
- package/dist/chunk-ZMW6KQX2.js.map +1 -0
- package/dist/cli-6CPFJGRZ.js +139 -0
- package/dist/cli-6CPFJGRZ.js.map +1 -0
- package/dist/client-B27SN5QG.js +15 -0
- package/dist/client-EYOTW3JU.js +19 -0
- package/dist/{config-IBS6KOLQ.js → config-G3CSGI7P.js} +21 -34
- package/dist/config-G3CSGI7P.js.map +1 -0
- package/dist/detect-H5OPI7GD.js +17 -0
- package/dist/detect-H5OPI7GD.js.map +1 -0
- package/dist/detect-providers-AZ6DEQU7.js +26 -0
- package/dist/detect-providers-AZ6DEQU7.js.map +1 -0
- package/dist/doctor-RHHWJTMB.js +258 -0
- package/dist/doctor-RHHWJTMB.js.map +1 -0
- package/dist/executor-A5C5KDLP.js +1454 -0
- package/dist/executor-A5C5KDLP.js.map +1 -0
- package/dist/init-ARJROOWV.js +198 -0
- package/dist/init-ARJROOWV.js.map +1 -0
- package/dist/init-wizard-XNFOZCEB.js +294 -0
- package/dist/init-wizard-XNFOZCEB.js.map +1 -0
- package/dist/llm-XJFHRFHB.js +17 -0
- package/dist/llm-XJFHRFHB.js.map +1 -0
- package/dist/loader-GKXR5ONU.js +28 -0
- package/dist/loader-GKXR5ONU.js.map +1 -0
- package/dist/loader-PZ7ZRSA4.js +22 -0
- package/dist/loader-PZ7ZRSA4.js.map +1 -0
- package/dist/{chunk-F7PGDD2X.js → logs-LXHPDKUA.js} +74 -5
- package/dist/logs-LXHPDKUA.js.map +1 -0
- package/dist/machine-id-RCM7TXPJ.js +13 -0
- package/dist/machine-id-RCM7TXPJ.js.map +1 -0
- package/dist/main-PVX6R3I6.js +5065 -0
- package/dist/main-PVX6R3I6.js.map +1 -0
- package/dist/openai-embeddings-ST3B6GW7.js +14 -0
- package/dist/openai-embeddings-ST3B6GW7.js.map +1 -0
- package/dist/openrouter-HJHOO3EO.js +14 -0
- package/dist/openrouter-HJHOO3EO.js.map +1 -0
- package/dist/post-compact-LR3DSGT3.js +26 -0
- package/dist/post-compact-LR3DSGT3.js.map +1 -0
- package/dist/post-tool-use-SOFVNFU3.js +56 -0
- package/dist/post-tool-use-SOFVNFU3.js.map +1 -0
- package/dist/post-tool-use-failure-2CZZZASB.js +28 -0
- package/dist/post-tool-use-failure-2CZZZASB.js.map +1 -0
- package/dist/pre-compact-3E3D6565.js +25 -0
- package/dist/pre-compact-3E3D6565.js.map +1 -0
- package/dist/provider-check-SOTDYLJE.js +12 -0
- package/dist/provider-check-SOTDYLJE.js.map +1 -0
- package/dist/registry-WVZG6R2R.js +25 -0
- package/dist/registry-WVZG6R2R.js.map +1 -0
- package/dist/resolution-events-UPHJJLDQ.js +15 -0
- package/dist/resolution-events-UPHJJLDQ.js.map +1 -0
- package/dist/resolve-3FEUV462.js +9 -0
- package/dist/resolve-3FEUV462.js.map +1 -0
- package/dist/{restart-UIP7US4U.js → restart-XIUFVS33.js} +10 -6
- package/dist/{restart-UIP7US4U.js.map → restart-XIUFVS33.js.map} +1 -1
- package/dist/search-VB6Z2ZXV.js +91 -0
- package/dist/search-VB6Z2ZXV.js.map +1 -0
- package/dist/{server-43KSJ65Q.js → server-AKPBRP6Z.js} +267 -524
- package/dist/server-AKPBRP6Z.js.map +1 -0
- package/dist/session-UVZS6CY5.js +69 -0
- package/dist/session-UVZS6CY5.js.map +1 -0
- package/dist/session-end-YMQ44U6Z.js +38 -0
- package/dist/session-end-YMQ44U6Z.js.map +1 -0
- package/dist/session-start-3754HF3N.js +170 -0
- package/dist/session-start-3754HF3N.js.map +1 -0
- package/dist/setup-digest-4KDSXAIV.js +15 -0
- package/dist/setup-digest-4KDSXAIV.js.map +1 -0
- package/dist/setup-llm-NWHOPJUV.js +81 -0
- package/dist/setup-llm-NWHOPJUV.js.map +1 -0
- package/dist/src/agent/definitions/agent.yaml +35 -0
- package/dist/src/agent/definitions/tasks/digest-only.yaml +84 -0
- package/dist/src/agent/definitions/tasks/extract-only.yaml +87 -0
- package/dist/src/agent/definitions/tasks/full-intelligence.yaml +472 -0
- package/dist/src/agent/definitions/tasks/graph-maintenance.yaml +92 -0
- package/dist/src/agent/definitions/tasks/review-session.yaml +132 -0
- package/dist/src/agent/definitions/tasks/supersession-sweep.yaml +86 -0
- package/dist/src/agent/definitions/tasks/title-summary.yaml +88 -0
- package/dist/src/agent/prompts/agent.md +121 -0
- package/dist/src/agent/prompts/orchestrator.md +91 -0
- package/dist/src/cli.js +1 -8
- package/dist/src/cli.js.map +1 -1
- package/dist/src/daemon/main.js +1 -8
- package/dist/src/daemon/main.js.map +1 -1
- package/dist/src/hooks/post-tool-use.js +3 -50
- package/dist/src/hooks/post-tool-use.js.map +1 -1
- package/dist/src/hooks/session-end.js +3 -32
- package/dist/src/hooks/session-end.js.map +1 -1
- package/dist/src/hooks/session-start.js +2 -8
- package/dist/src/hooks/session-start.js.map +1 -1
- package/dist/src/hooks/stop.js +3 -42
- package/dist/src/hooks/stop.js.map +1 -1
- package/dist/src/hooks/user-prompt-submit.js +3 -53
- package/dist/src/hooks/user-prompt-submit.js.map +1 -1
- package/dist/src/mcp/server.js +1 -8
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/prompts/digest-system.md +1 -1
- package/dist/src/symbionts/manifests/claude-code.yaml +16 -0
- package/dist/src/symbionts/manifests/cursor.yaml +14 -0
- package/dist/stats-CDQXOTEC.js +94 -0
- package/dist/stats-CDQXOTEC.js.map +1 -0
- package/dist/stop-WSFGRPXZ.js +42 -0
- package/dist/stop-WSFGRPXZ.js.map +1 -0
- package/dist/stop-failure-4FR7574F.js +26 -0
- package/dist/stop-failure-4FR7574F.js.map +1 -0
- package/dist/subagent-start-7SGBXJYP.js +26 -0
- package/dist/subagent-start-7SGBXJYP.js.map +1 -0
- package/dist/subagent-stop-MRVTNX3V.js +28 -0
- package/dist/subagent-stop-MRVTNX3V.js.map +1 -0
- package/dist/task-completed-XXPYPSRV.js +27 -0
- package/dist/task-completed-XXPYPSRV.js.map +1 -0
- package/dist/team-XMHYCKFF.js +251 -0
- package/dist/team-XMHYCKFF.js.map +1 -0
- package/dist/ui/assets/index-BGbil7f1.css +1 -0
- package/dist/ui/assets/index-CPA_uq_j.js +794 -0
- package/dist/ui/favicon.svg +7 -7
- package/dist/ui/fonts/Inter-Variable.woff2 +0 -0
- package/dist/ui/fonts/JetBrainsMono-Variable.woff2 +0 -0
- package/dist/ui/fonts/Newsreader-Italic-Variable.woff2 +0 -0
- package/dist/ui/fonts/Newsreader-Variable.woff2 +0 -0
- package/dist/ui/index.html +2 -2
- package/dist/update-W3UFZU4G.js +79 -0
- package/dist/update-W3UFZU4G.js.map +1 -0
- package/dist/user-prompt-submit-LSWCYUW3.js +59 -0
- package/dist/user-prompt-submit-LSWCYUW3.js.map +1 -0
- package/dist/{verify-X272WGBD.js → verify-O7TQ5DDY.js} +17 -22
- package/dist/verify-O7TQ5DDY.js.map +1 -0
- package/dist/{version-XE4GYTBV.js → version-VWWY7SPQ.js} +3 -4
- package/dist/version-VWWY7SPQ.js.map +1 -0
- package/hooks/hooks.json +82 -5
- package/package.json +6 -3
- package/skills/myco/SKILL.md +10 -10
- package/skills/myco/references/cli-usage.md +15 -13
- package/skills/myco/references/vault-status.md +3 -3
- package/skills/myco/references/wisdom.md +4 -4
- package/skills/myco-curate/SKILL.md +86 -0
- package/dist/chunk-4B5RO2YV.js.map +0 -1
- package/dist/chunk-4RMSHZE4.js +0 -107
- package/dist/chunk-4RMSHZE4.js.map +0 -1
- package/dist/chunk-54WVLTKD.js.map +0 -1
- package/dist/chunk-5LMRZDH3.js +0 -65
- package/dist/chunk-5LMRZDH3.js.map +0 -1
- package/dist/chunk-6FQISQNA.js +0 -61
- package/dist/chunk-6FQISQNA.js.map +0 -1
- package/dist/chunk-DYDBF5W6.js +0 -147
- package/dist/chunk-DYDBF5W6.js.map +0 -1
- package/dist/chunk-ERG2IEWX.js.map +0 -1
- package/dist/chunk-F7GAYVWF.js.map +0 -1
- package/dist/chunk-F7PGDD2X.js.map +0 -1
- package/dist/chunk-GENQ5QGP.js +0 -37
- package/dist/chunk-GENQ5QGP.js.map +0 -1
- package/dist/chunk-HIN3UVOG.js.map +0 -1
- package/dist/chunk-HYVT345Y.js +0 -159
- package/dist/chunk-HYVT345Y.js.map +0 -1
- package/dist/chunk-LEK6DEAE.js +0 -113
- package/dist/chunk-LEK6DEAE.js.map +0 -1
- package/dist/chunk-MDLSAFPP.js +0 -99
- package/dist/chunk-MDLSAFPP.js.map +0 -1
- package/dist/chunk-N33KUCFP.js.map +0 -1
- package/dist/chunk-O6TBHGVO.js +0 -168
- package/dist/chunk-O6TBHGVO.js.map +0 -1
- package/dist/chunk-OEGZ5YTJ.js +0 -56
- package/dist/chunk-OEGZ5YTJ.js.map +0 -1
- package/dist/chunk-P723N2LP.js +0 -147
- package/dist/chunk-P723N2LP.js.map +0 -1
- package/dist/chunk-RGVBGTD6.js +0 -21
- package/dist/chunk-RGVBGTD6.js.map +0 -1
- package/dist/chunk-TK7A4RX7.js +0 -1085
- package/dist/chunk-TK7A4RX7.js.map +0 -1
- package/dist/chunk-TWSTAVLO.js +0 -132
- package/dist/chunk-TWSTAVLO.js.map +0 -1
- package/dist/chunk-V6BJVYNH.js +0 -4423
- package/dist/chunk-V6BJVYNH.js.map +0 -1
- package/dist/chunk-XH34FX4C.js +0 -43
- package/dist/chunk-XH34FX4C.js.map +0 -1
- package/dist/chunk-YRIIBPJD.js +0 -86
- package/dist/chunk-YRIIBPJD.js.map +0 -1
- package/dist/cli-OJYHLO4Y.js +0 -97
- package/dist/cli-OJYHLO4Y.js.map +0 -1
- package/dist/client-SS3C5MF6.js +0 -12
- package/dist/config-IBS6KOLQ.js.map +0 -1
- package/dist/curate-4CKEMOPV.js +0 -78
- package/dist/curate-4CKEMOPV.js.map +0 -1
- package/dist/detect-providers-LFIVJYQO.js +0 -35
- package/dist/detect-providers-LFIVJYQO.js.map +0 -1
- package/dist/digest-ZLARHLLY.js +0 -85
- package/dist/digest-ZLARHLLY.js.map +0 -1
- package/dist/init-3LVKVQ4L.js +0 -109
- package/dist/init-3LVKVQ4L.js.map +0 -1
- package/dist/logs-6CWVP574.js +0 -84
- package/dist/logs-6CWVP574.js.map +0 -1
- package/dist/main-RB727YRP.js +0 -5836
- package/dist/main-RB727YRP.js.map +0 -1
- package/dist/rebuild-QWVVCBCZ.js +0 -64
- package/dist/rebuild-QWVVCBCZ.js.map +0 -1
- package/dist/reprocess-YG3WLUI2.js +0 -79
- package/dist/reprocess-YG3WLUI2.js.map +0 -1
- package/dist/search-BQLBW5CS.js +0 -120
- package/dist/search-BQLBW5CS.js.map +0 -1
- package/dist/server-43KSJ65Q.js.map +0 -1
- package/dist/session-F326AWCH.js +0 -44
- package/dist/session-F326AWCH.js.map +0 -1
- package/dist/session-start-6SHGT2AW.js +0 -192
- package/dist/session-start-6SHGT2AW.js.map +0 -1
- package/dist/setup-digest-X735EZSD.js +0 -15
- package/dist/setup-llm-QBSTQO7N.js +0 -15
- package/dist/src/prompts/classification.md +0 -43
- package/dist/stats-QBLIEFWL.js +0 -58
- package/dist/stats-QBLIEFWL.js.map +0 -1
- package/dist/templates-XPRBOWCE.js +0 -38
- package/dist/templates-XPRBOWCE.js.map +0 -1
- package/dist/ui/assets/index-CjWGVHhF.css +0 -1
- package/dist/ui/assets/index-Cq-H7wgE.js +0 -369
- package/dist/verify-X272WGBD.js.map +0 -1
- package/skills/setup/SKILL.md +0 -174
- package/skills/setup/references/model-recommendations.md +0 -83
- /package/dist/{chunk-4DYD4HHG.js.map → chunk-5SDH75YC.js.map} +0 -0
- /package/dist/{client-SS3C5MF6.js.map → chunk-E4VLWIJC.js.map} +0 -0
- /package/dist/{setup-digest-X735EZSD.js.map → chunk-IB76KGBY.js.map} +0 -0
- /package/dist/{chunk-AHZN4Z34.js.map → chunk-J4RVYUH4.js.map} +0 -0
- /package/dist/{setup-llm-QBSTQO7N.js.map → client-B27SN5QG.js.map} +0 -0
- /package/dist/{version-XE4GYTBV.js.map → client-EYOTW3JU.js.map} +0 -0
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
var wC=e=>{throw TypeError(e)};var gy=(e,t,n)=>t.has(e)||wC("Cannot "+n);var Z=(e,t,n)=>(gy(e,t,"read from private field"),n?n.call(e):t.get(e)),Je=(e,t,n)=>t.has(e)?wC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(gy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pt=(e,t,n)=>(gy(e,t,"access private method"),n);var Gh=(e,t,n,r)=>({set _(a){_e(e,t,a,n)},get _(){return Z(e,t,r)}});function Y3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function ld(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yy={exports:{}},lf={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var SC;function X3(){if(SC)return lf;SC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var o in a)o!=="key"&&(i[o]=a[o])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return lf.Fragment=t,lf.jsx=n,lf.jsxs=n,lf}var EC;function Q3(){return EC||(EC=1,yy.exports=X3()),yy.exports}var p=Q3(),xy={exports:{}},ct={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var CC;function W3(){if(CC)return ct;CC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),m=Symbol.iterator;function y(q){return q===null||typeof q!="object"?null:(q=m&&q[m]||q["@@iterator"],typeof q=="function"?q:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function b(q,X,U){this.props=q,this.context=X,this.refs=S,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(q,X){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,X,"setState")},b.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function C(){}C.prototype=b.prototype;function T(q,X,U){this.props=q,this.context=X,this.refs=S,this.updater=U||x}var N=T.prototype=new C;N.constructor=T,w(N,b.prototype),N.isPureReactComponent=!0;var A=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function _(q,X,U){var te=U.ref;return{$$typeof:e,type:q,key:X,ref:te!==void 0?te:null,props:U}}function M(q,X){return _(q.type,X,q.props)}function z(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function P(q){var X={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(U){return X[U]})}var G=/\/+/g;function I(q,X){return typeof q=="object"&&q!==null&&q.key!=null?P(""+q.key):X.toString(36)}function F(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(R,R):(q.status="pending",q.then(function(X){q.status==="pending"&&(q.status="fulfilled",q.value=X)},function(X){q.status==="pending"&&(q.status="rejected",q.reason=X)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function B(q,X,U,te,ie){var oe=typeof q;(oe==="undefined"||oe==="boolean")&&(q=null);var ae=!1;if(q===null)ae=!0;else switch(oe){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(q.$$typeof){case e:case t:ae=!0;break;case d:return ae=q._init,B(ae(q._payload),X,U,te,ie)}}if(ae)return ie=ie(q),ae=te===""?"."+I(q,0):te,A(ie)?(U="",ae!=null&&(U=ae.replace(G,"$&/")+"/"),B(ie,X,U,"",function(J){return J})):ie!=null&&(z(ie)&&(ie=M(ie,U+(ie.key==null||q&&q.key===ie.key?"":(""+ie.key).replace(G,"$&/")+"/")+ae)),X.push(ie)),1;ae=0;var we=te===""?".":te+":";if(A(q))for(var fe=0;fe<q.length;fe++)te=q[fe],oe=we+I(te,fe),ae+=B(te,X,U,oe,ie);else if(fe=y(q),typeof fe=="function")for(q=fe.call(q),fe=0;!(te=q.next()).done;)te=te.value,oe=we+I(te,fe++),ae+=B(te,X,U,oe,ie);else if(oe==="object"){if(typeof q.then=="function")return B(F(q),X,U,te,ie);throw X=String(q),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ae}function H(q,X,U){if(q==null)return q;var te=[],ie=0;return B(q,te,"","",function(oe){return X.call(U,oe,ie++)}),te}function Y(q){if(q._status===-1){var X=q._result;X=X(),X.then(function(U){(q._status===0||q._status===-1)&&(q._status=1,q._result=U)},function(U){(q._status===0||q._status===-1)&&(q._status=2,q._result=U)}),q._status===-1&&(q._status=0,q._result=X)}if(q._status===1)return q._result.default;throw q._result}var Q=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},V={map:H,forEach:function(q,X,U){H(q,function(){X.apply(this,arguments)},U)},count:function(q){var X=0;return H(q,function(){X++}),X},toArray:function(q){return H(q,function(X){return X})||[]},only:function(q){if(!z(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return ct.Activity=v,ct.Children=V,ct.Component=b,ct.Fragment=n,ct.Profiler=a,ct.PureComponent=T,ct.StrictMode=r,ct.Suspense=f,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,ct.__COMPILER_RUNTIME={__proto__:null,c:function(q){return D.H.useMemoCache(q)}},ct.cache=function(q){return function(){return q.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(q,X,U){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var te=w({},q.props),ie=q.key;if(X!=null)for(oe in X.key!==void 0&&(ie=""+X.key),X)!L.call(X,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&X.ref===void 0||(te[oe]=X[oe]);var oe=arguments.length-2;if(oe===1)te.children=U;else if(1<oe){for(var ae=Array(oe),we=0;we<oe;we++)ae[we]=arguments[we+2];te.children=ae}return _(q.type,ie,te)},ct.createContext=function(q){return q={$$typeof:l,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:i,_context:q},q},ct.createElement=function(q,X,U){var te,ie={},oe=null;if(X!=null)for(te in X.key!==void 0&&(oe=""+X.key),X)L.call(X,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ie[te]=X[te]);var ae=arguments.length-2;if(ae===1)ie.children=U;else if(1<ae){for(var we=Array(ae),fe=0;fe<ae;fe++)we[fe]=arguments[fe+2];ie.children=we}if(q&&q.defaultProps)for(te in ae=q.defaultProps,ae)ie[te]===void 0&&(ie[te]=ae[te]);return _(q,oe,ie)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(q){return{$$typeof:o,render:q}},ct.isValidElement=z,ct.lazy=function(q){return{$$typeof:d,_payload:{_status:-1,_result:q},_init:Y}},ct.memo=function(q,X){return{$$typeof:c,type:q,compare:X===void 0?null:X}},ct.startTransition=function(q){var X=D.T,U={};D.T=U;try{var te=q(),ie=D.S;ie!==null&&ie(U,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(R,Q)}catch(oe){Q(oe)}finally{X!==null&&U.types!==null&&(X.types=U.types),D.T=X}},ct.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},ct.use=function(q){return D.H.use(q)},ct.useActionState=function(q,X,U){return D.H.useActionState(q,X,U)},ct.useCallback=function(q,X){return D.H.useCallback(q,X)},ct.useContext=function(q){return D.H.useContext(q)},ct.useDebugValue=function(){},ct.useDeferredValue=function(q,X){return D.H.useDeferredValue(q,X)},ct.useEffect=function(q,X){return D.H.useEffect(q,X)},ct.useEffectEvent=function(q){return D.H.useEffectEvent(q)},ct.useId=function(){return D.H.useId()},ct.useImperativeHandle=function(q,X,U){return D.H.useImperativeHandle(q,X,U)},ct.useInsertionEffect=function(q,X){return D.H.useInsertionEffect(q,X)},ct.useLayoutEffect=function(q,X){return D.H.useLayoutEffect(q,X)},ct.useMemo=function(q,X){return D.H.useMemo(q,X)},ct.useOptimistic=function(q,X){return D.H.useOptimistic(q,X)},ct.useReducer=function(q,X,U){return D.H.useReducer(q,X,U)},ct.useRef=function(q){return D.H.useRef(q)},ct.useState=function(q){return D.H.useState(q)},ct.useSyncExternalStore=function(q,X,U){return D.H.useSyncExternalStore(q,X,U)},ct.useTransition=function(){return D.H.useTransition()},ct.version="19.2.4",ct}var TC;function t1(){return TC||(TC=1,xy.exports=W3()),xy.exports}var j=t1();const Bi=ld(j),OR=Y3({__proto__:null,default:Bi},[j]);var by={exports:{}},of={},wy={exports:{}},Sy={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var kC;function Z3(){return kC||(kC=1,(function(e){function t(B,H){var Y=B.length;B.push(H);e:for(;0<Y;){var Q=Y-1>>>1,V=B[Q];if(0<a(V,H))B[Q]=H,B[Y]=V,Y=Q;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var H=B[0],Y=B.pop();if(Y!==H){B[0]=Y;e:for(var Q=0,V=B.length,q=V>>>1;Q<q;){var X=2*(Q+1)-1,U=B[X],te=X+1,ie=B[te];if(0>a(U,Y))te<V&&0>a(ie,U)?(B[Q]=ie,B[te]=Y,Q=te):(B[Q]=U,B[X]=Y,Q=X);else if(te<V&&0>a(ie,Y))B[Q]=ie,B[te]=Y,Q=te;else break e}}return H}function a(B,H){var Y=B.sortIndex-H.sortIndex;return Y!==0?Y:B.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var f=[],c=[],d=1,v=null,m=3,y=!1,x=!1,w=!1,S=!1,b=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function N(B){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=B)r(c),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(c)}}function A(B){if(w=!1,N(B),!x)if(n(f)!==null)x=!0,R||(R=!0,P());else{var H=n(c);H!==null&&F(A,H.startTime-B)}}var R=!1,D=-1,L=5,_=-1;function M(){return S?!0:!(e.unstable_now()-_<L)}function z(){if(S=!1,R){var B=e.unstable_now();_=B;var H=!0;try{e:{x=!1,w&&(w=!1,C(D),D=-1),y=!0;var Y=m;try{t:{for(N(B),v=n(f);v!==null&&!(v.expirationTime>B&&M());){var Q=v.callback;if(typeof Q=="function"){v.callback=null,m=v.priorityLevel;var V=Q(v.expirationTime<=B);if(B=e.unstable_now(),typeof V=="function"){v.callback=V,N(B),H=!0;break t}v===n(f)&&r(f),N(B)}else r(f);v=n(f)}if(v!==null)H=!0;else{var q=n(c);q!==null&&F(A,q.startTime-B),H=!1}}break e}finally{v=null,m=Y,y=!1}H=void 0}}finally{H?P():R=!1}}}var P;if(typeof T=="function")P=function(){T(z)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,I=G.port2;G.port1.onmessage=z,P=function(){I.postMessage(null)}}else P=function(){b(z,0)};function F(B,H){D=b(function(){B(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(B){switch(m){case 1:case 2:case 3:var H=3;break;default:H=m}var Y=m;m=H;try{return B()}finally{m=Y}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(B,H){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Y=m;m=B;try{return H()}finally{m=Y}},e.unstable_scheduleCallback=function(B,H,Y){var Q=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,B){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=Y+V,B={id:d++,callback:H,priorityLevel:B,startTime:Y,expirationTime:V,sortIndex:-1},Y>Q?(B.sortIndex=Y,t(c,B),n(f)===null&&B===n(c)&&(w?(C(D),D=-1):w=!0,F(A,Y-Q))):(B.sortIndex=V,t(f,B),x||y||(x=!0,R||(R=!0,P()))),B},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(B){var H=m;return function(){var Y=m;m=H;try{return B.apply(this,arguments)}finally{m=Y}}}})(Sy)),Sy}var NC;function J3(){return NC||(NC=1,wy.exports=Z3()),wy.exports}var Ey={exports:{}},fr={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var AC;function e4(){if(AC)return fr;AC=1;var e=t1();function t(f){var c="https://react.dev/errors/"+f;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+f+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(f,c,d){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:v==null?null:""+v,children:f,containerInfo:c,implementation:d}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(f,c){if(f==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fr.createPortal=function(f,c){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return i(f,c,null,d)},fr.flushSync=function(f){var c=l.T,d=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=c,r.p=d,r.d.f()}},fr.preconnect=function(f,c){typeof f=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,r.d.C(f,c))},fr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},fr.preinit=function(f,c){if(typeof f=="string"&&c&&typeof c.as=="string"){var d=c.as,v=o(d,c.crossOrigin),m=typeof c.integrity=="string"?c.integrity:void 0,y=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;d==="style"?r.d.S(f,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:v,integrity:m,fetchPriority:y}):d==="script"&&r.d.X(f,{crossOrigin:v,integrity:m,fetchPriority:y,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},fr.preinitModule=function(f,c){if(typeof f=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var d=o(c.as,c.crossOrigin);r.d.M(f,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&r.d.M(f)},fr.preload=function(f,c){if(typeof f=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var d=c.as,v=o(d,c.crossOrigin);r.d.L(f,d,{crossOrigin:v,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},fr.preloadModule=function(f,c){if(typeof f=="string")if(c){var d=o(c.as,c.crossOrigin);r.d.m(f,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else r.d.m(f)},fr.requestFormReset=function(f){r.d.r(f)},fr.unstable_batchedUpdates=function(f,c){return f(c)},fr.useFormState=function(f,c,d){return l.H.useFormState(f,c,d)},fr.useFormStatus=function(){return l.H.useHostTransitionStatus()},fr.version="19.2.4",fr}var RC;function LR(){if(RC)return Ey.exports;RC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ey.exports=e4(),Ey.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var jC;function t4(){if(jC)return of;jC=1;var e=J3(),t=t1(),n=LR();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function i(s){var u=s,h=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(h=u.return),s=u.return;while(s)}return u.tag===3?h:null}function l(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function o(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function f(s){if(i(s)!==s)throw Error(r(188))}function c(s){var u=s.alternate;if(!u){if(u=i(s),u===null)throw Error(r(188));return u!==s?null:s}for(var h=s,g=u;;){var E=h.return;if(E===null)break;var k=E.alternate;if(k===null){if(g=E.return,g!==null){h=g;continue}break}if(E.child===k.child){for(k=E.child;k;){if(k===h)return f(E),s;if(k===g)return f(E),u;k=k.sibling}throw Error(r(188))}if(h.return!==g.return)h=E,g=k;else{for(var O=!1,$=E.child;$;){if($===h){O=!0,h=E,g=k;break}if($===g){O=!0,g=E,h=k;break}$=$.sibling}if(!O){for($=k.child;$;){if($===h){O=!0,h=k,g=E;break}if($===g){O=!0,g=k,h=E;break}$=$.sibling}if(!O)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:u}function d(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=d(s),u!==null)return u;s=s.sibling}return null}var v=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function P(s){return s===null||typeof s!="object"?null:(s=z&&s[z]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function I(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===G?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case b:return"Profiler";case S:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case _:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case T:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case N:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return u=s.displayName||null,u!==null?u:I(s.type)||"Memo";case L:u=s._payload,s=s._init;try{return I(s(u))}catch{}}return null}var F=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Q=[],V=-1;function q(s){return{current:s}}function X(s){0>V||(s.current=Q[V],Q[V]=null,V--)}function U(s,u){V++,Q[V]=s.current,s.current=u}var te=q(null),ie=q(null),oe=q(null),ae=q(null);function we(s,u){switch(U(oe,u),U(ie,s),U(te,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?H2(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=H2(u),s=G2(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}X(te),U(te,s)}function fe(){X(te),X(ie),X(oe)}function J(s){s.memoizedState!==null&&U(ae,s);var u=te.current,h=G2(u,s.type);u!==h&&(U(ie,s),U(te,h))}function ne(s){ie.current===s&&(X(te),X(ie)),ae.current===s&&(X(ae),nf._currentValue=Y)}var re,ge;function ke(s){if(re===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);re=u&&u[1]||"",ge=-1<h.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+re+s+ge}var Be=!1;function lt(s,u){if(!s||Be)return"";Be=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(u){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(me){var ve=me}Reflect.construct(s,[],Ee)}else{try{Ee.call()}catch(me){ve=me}s.call(Ee.prototype)}}else{try{throw Error()}catch(me){ve=me}(Ee=s())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(me){if(me&&ve&&typeof me.stack=="string")return[me.stack,ve.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),O=k[0],$=k[1];if(O&&$){var W=O.split(`
|
|
44
|
+
`),ce=$.split(`
|
|
45
|
+
`);for(E=g=0;g<W.length&&!W[g].includes("DetermineComponentFrameRoot");)g++;for(;E<ce.length&&!ce[E].includes("DetermineComponentFrameRoot");)E++;if(g===W.length||E===ce.length)for(g=W.length-1,E=ce.length-1;1<=g&&0<=E&&W[g]!==ce[E];)E--;for(;1<=g&&0<=E;g--,E--)if(W[g]!==ce[E]){if(g!==1||E!==1)do if(g--,E--,0>E||W[g]!==ce[E]){var be=`
|
|
46
|
+
`+W[g].replace(" at new "," at ");return s.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",s.displayName)),be}while(1<=g&&0<=E);break}}}finally{Be=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?ke(h):""}function Ze(s,u){switch(s.tag){case 26:case 27:case 5:return ke(s.type);case 16:return ke("Lazy");case 13:return s.child!==u&&u!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return lt(s.type,!1);case 11:return lt(s.type.render,!1);case 1:return lt(s.type,!0);case 31:return ke("Activity");default:return""}}function Qe(s){try{var u="",h=null;do u+=Ze(s,h),h=s,s=s.return;while(s);return u}catch(g){return`
|
|
47
|
+
Error generating stack: `+g.message+`
|
|
48
|
+
`+g.stack}}var qe=Object.prototype.hasOwnProperty,je=e.unstable_scheduleCallback,Ge=e.unstable_cancelCallback,Xe=e.unstable_shouldYield,it=e.unstable_requestPaint,Pe=e.unstable_now,ft=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,ze=e.unstable_LowPriority,Me=e.unstable_IdlePriority,Oe=e.log,ye=e.unstable_setDisableYieldValue,K=null,le=null;function pe(s){if(typeof Oe=="function"&&ye(s),le&&typeof le.setStrictMode=="function")try{le.setStrictMode(K,s)}catch{}}var de=Math.clz32?Math.clz32:Te,xe=Math.log,Le=Math.LN2;function Te(s){return s>>>=0,s===0?32:31-(xe(s)/Le|0)|0}var He=256,Ie=262144,We=4194304;function ot(s){var u=s&42;if(u!==0)return u;switch(s&-s){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ut(s,u,h){var g=s.pendingLanes;if(g===0)return 0;var E=0,k=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var $=g&134217727;return $!==0?(g=$&~k,g!==0?E=ot(g):(O&=$,O!==0?E=ot(O):h||(h=$&~s,h!==0&&(E=ot(h))))):($=g&~k,$!==0?E=ot($):O!==0?E=ot(O):h||(h=g&~s,h!==0&&(E=ot(h)))),E===0?0:u!==0&&u!==E&&(u&k)===0&&(k=E&-E,h=u&-u,k>=h||k===32&&(h&4194048)!==0)?u:E}function Ue(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function yt(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ht(){var s=We;return We<<=1,(We&62914560)===0&&(We=4194304),s}function on(s){for(var u=[],h=0;31>h;h++)u.push(s);return u}function Ft(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Jn(s,u,h,g,E,k){var O=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var $=s.entanglements,W=s.expirationTimes,ce=s.hiddenUpdates;for(h=O&~h;0<h;){var be=31-de(h),Ee=1<<be;$[be]=0,W[be]=-1;var ve=ce[be];if(ve!==null)for(ce[be]=null,be=0;be<ve.length;be++){var me=ve[be];me!==null&&(me.lane&=-536870913)}h&=~Ee}g!==0&&un(s,g,0),k!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=k&~(O&~u))}function un(s,u,h){s.pendingLanes|=u,s.suspendedLanes&=~u;var g=31-de(u);s.entangledLanes|=u,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function bn(s,u){var h=s.entangledLanes|=u;for(s=s.entanglements;h;){var g=31-de(h),E=1<<g;E&u|s[g]&u&&(s[g]|=u),h&=~E}}function vn(s,u){var h=u&-u;return h=(h&42)!==0?1:wn(h),(h&(s.suspendedLanes|u))!==0?0:h}function wn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function aa(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function cn(){var s=H.p;return s!==0?s:(s=window.event,s===void 0?32:vC(s.type))}function ia(s,u){var h=H.p;try{return H.p=s,u()}finally{H.p=h}}var Un=Math.random().toString(36).slice(2),an="__reactFiber$"+Un,_n="__reactProps$"+Un,Ar="__reactContainer$"+Un,Vn="__reactEvents$"+Un,Hn="__reactListeners$"+Un,ur="__reactHandles$"+Un,rs="__reactResources$"+Un,Gn="__reactMarker$"+Un;function To(s){delete s[an],delete s[_n],delete s[Vn],delete s[Hn],delete s[ur]}function as(s){var u=s[an];if(u)return u;for(var h=s.parentNode;h;){if(u=h[Ar]||h[an]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(s=Z2(s);s!==null;){if(h=s[an])return h;s=Z2(s)}return u}s=h,h=s.parentNode}return null}function is(s){if(s=s[an]||s[Ar]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function El(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function ss(s){var u=s[rs];return u||(u=s[rs]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function kn(s){s[Gn]=!0}var Dd=new Set,Md={};function Vr(s,u){Ua(s,u),Ua(s+"Capture",u)}function Ua(s,u){for(Md[s]=u,s=0;s<u.length;s++)Dd.add(u[s])}var ko=RegExp("^[: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]*$"),gc={},yc={};function um(s){return qe.call(yc,s)?!0:qe.call(gc,s)?!1:ko.test(s)?yc[s]=!0:(gc[s]=!0,!1)}function cr(s,u,h){if(um(u))if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+h)}}function ls(s,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+h)}}function sa(s,u,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(u,h,""+g)}}function $n(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Rr(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function cm(s,u,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,k=g.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(O){h=""+O,k.call(this,O)}}),Object.defineProperty(s,u,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(O){h=""+O},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Od(s){if(!s._valueTracker){var u=Rr(s)?"checked":"value";s._valueTracker=cm(s,u,""+s[u])}}function Ld(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var h=u.getValue(),g="";return s&&(g=Rr(s)?s.checked?"true":"false":s.value),s=g,s!==h?(u.setValue(s),!0):!1}function _d(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var U_=/[\n"\\]/g;function la(s){return s.replace(U_,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function fm(s,u,h,g,E,k,O,$){s.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.type=O:s.removeAttribute("type"),u!=null?O==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+$n(u)):s.value!==""+$n(u)&&(s.value=""+$n(u)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),u!=null?dm(s,O,$n(u)):h!=null?dm(s,O,$n(h)):g!=null&&s.removeAttribute("value"),E==null&&k!=null&&(s.defaultChecked=!!k),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.name=""+$n($):s.removeAttribute("name")}function zw(s,u,h,g,E,k,O,$){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||h!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){Od(s);return}h=h!=null?""+$n(h):"",u=u!=null?""+$n(u):h,$||u===s.value||(s.value=u),s.defaultValue=u}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=$?s.checked:!!g,s.defaultChecked=!!g,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(s.name=O),Od(s)}function dm(s,u,h){u==="number"&&_d(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function No(s,u,h,g){if(s=s.options,u){u={};for(var E=0;E<h.length;E++)u["$"+h[E]]=!0;for(h=0;h<s.length;h++)E=u.hasOwnProperty("$"+s[h].value),s[h].selected!==E&&(s[h].selected=E),E&&g&&(s[h].defaultSelected=!0)}else{for(h=""+$n(h),u=null,E=0;E<s.length;E++){if(s[E].value===h){s[E].selected=!0,g&&(s[E].defaultSelected=!0);return}u!==null||s[E].disabled||(u=s[E])}u!==null&&(u.selected=!0)}}function Iw(s,u,h){if(u!=null&&(u=""+$n(u),u!==s.value&&(s.value=u),h==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=h!=null?""+$n(h):""}function Fw(s,u,h,g){if(u==null){if(g!=null){if(h!=null)throw Error(r(92));if(F(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),u=h}h=$n(u),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),Od(s)}function Ao(s,u){if(u){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=u;return}}s.textContent=u}var V_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qw(s,u,h){var g=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":g?s.setProperty(u,h):typeof h!="number"||h===0||V_.has(u)?u==="float"?s.cssFloat=h:s[u]=(""+h).trim():s[u]=h+"px"}function Uw(s,u,h){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var E in u)g=u[E],u.hasOwnProperty(E)&&h[E]!==g&&qw(s,E,g)}else for(var k in u)u.hasOwnProperty(k)&&qw(s,k,u[k])}function hm(s){if(s.indexOf("-")===-1)return!1;switch(s){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 H_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),G_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bd(s){return G_.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function pi(){}var vm=null;function pm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ro=null,jo=null;function Vw(s){var u=is(s);if(u&&(s=u.stateNode)){var h=s[_n]||null;e:switch(s=u.stateNode,u.type){case"input":if(fm(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+la(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var g=h[u];if(g!==s&&g.form===s.form){var E=g[_n]||null;if(!E)throw Error(r(90));fm(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<h.length;u++)g=h[u],g.form===s.form&&Ld(g)}break e;case"textarea":Iw(s,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&No(s,!!h.multiple,u,!1)}}}var mm=!1;function Hw(s,u,h){if(mm)return s(u,h);mm=!0;try{var g=s(u);return g}finally{if(mm=!1,(Ro!==null||jo!==null)&&(Eh(),Ro&&(u=Ro,s=jo,jo=Ro=null,Vw(u),s)))for(u=0;u<s.length;u++)Vw(s[u])}}function xc(s,u){var h=s.stateNode;if(h===null)return null;var g=h[_n]||null;if(g===null)return null;h=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var mi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gm=!1;if(mi)try{var bc={};Object.defineProperty(bc,"passive",{get:function(){gm=!0}}),window.addEventListener("test",bc,bc),window.removeEventListener("test",bc,bc)}catch{gm=!1}var os=null,ym=null,Pd=null;function Gw(){if(Pd)return Pd;var s,u=ym,h=u.length,g,E="value"in os?os.value:os.textContent,k=E.length;for(s=0;s<h&&u[s]===E[s];s++);var O=h-s;for(g=1;g<=O&&u[h-g]===E[k-g];g++);return Pd=E.slice(s,1<g?1-g:void 0)}function zd(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function Id(){return!0}function $w(){return!1}function jr(s){function u(h,g,E,k,O){this._reactName=h,this._targetInst=E,this.type=g,this.nativeEvent=k,this.target=O,this.currentTarget=null;for(var $ in s)s.hasOwnProperty($)&&(h=s[$],this[$]=h?h(k):k[$]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Id:$w,this.isPropagationStopped=$w,this}return v(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Id)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Id)},persist:function(){},isPersistent:Id}),u}var Cl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fd=jr(Cl),wc=v({},Cl,{view:0,detail:0}),$_=jr(wc),xm,bm,Sc,qd=v({},wc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sm,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Sc&&(Sc&&s.type==="mousemove"?(xm=s.screenX-Sc.screenX,bm=s.screenY-Sc.screenY):bm=xm=0,Sc=s),xm)},movementY:function(s){return"movementY"in s?s.movementY:bm}}),Kw=jr(qd),K_=v({},qd,{dataTransfer:0}),Y_=jr(K_),X_=v({},wc,{relatedTarget:0}),wm=jr(X_),Q_=v({},Cl,{animationName:0,elapsedTime:0,pseudoElement:0}),W_=jr(Q_),Z_=v({},Cl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),J_=jr(Z_),e5=v({},Cl,{data:0}),Yw=jr(e5),t5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},r5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a5(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=r5[s])?!!u[s]:!1}function Sm(){return a5}var i5=v({},wc,{key:function(s){if(s.key){var u=t5[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=zd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?n5[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sm,charCode:function(s){return s.type==="keypress"?zd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?zd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),s5=jr(i5),l5=v({},qd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xw=jr(l5),o5=v({},wc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sm}),u5=jr(o5),c5=v({},Cl,{propertyName:0,elapsedTime:0,pseudoElement:0}),f5=jr(c5),d5=v({},qd,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),h5=jr(d5),v5=v({},Cl,{newState:0,oldState:0}),p5=jr(v5),m5=[9,13,27,32],Em=mi&&"CompositionEvent"in window,Ec=null;mi&&"documentMode"in document&&(Ec=document.documentMode);var g5=mi&&"TextEvent"in window&&!Ec,Qw=mi&&(!Em||Ec&&8<Ec&&11>=Ec),Ww=" ",Zw=!1;function Jw(s,u){switch(s){case"keyup":return m5.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eS(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Do=!1;function y5(s,u){switch(s){case"compositionend":return eS(u);case"keypress":return u.which!==32?null:(Zw=!0,Ww);case"textInput":return s=u.data,s===Ww&&Zw?null:s;default:return null}}function x5(s,u){if(Do)return s==="compositionend"||!Em&&Jw(s,u)?(s=Gw(),Pd=ym=os=null,Do=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return Qw&&u.locale!=="ko"?null:u.data;default:return null}}var b5={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tS(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!b5[s.type]:u==="textarea"}function nS(s,u,h,g){Ro?jo?jo.push(g):jo=[g]:Ro=g,u=jh(u,"onChange"),0<u.length&&(h=new Fd("onChange","change",null,h,g),s.push({event:h,listeners:u}))}var Cc=null,Tc=null;function w5(s){z2(s,0)}function Ud(s){var u=El(s);if(Ld(u))return s}function rS(s,u){if(s==="change")return u}var aS=!1;if(mi){var Cm;if(mi){var Tm="oninput"in document;if(!Tm){var iS=document.createElement("div");iS.setAttribute("oninput","return;"),Tm=typeof iS.oninput=="function"}Cm=Tm}else Cm=!1;aS=Cm&&(!document.documentMode||9<document.documentMode)}function sS(){Cc&&(Cc.detachEvent("onpropertychange",lS),Tc=Cc=null)}function lS(s){if(s.propertyName==="value"&&Ud(Tc)){var u=[];nS(u,Tc,s,pm(s)),Hw(w5,u)}}function S5(s,u,h){s==="focusin"?(sS(),Cc=u,Tc=h,Cc.attachEvent("onpropertychange",lS)):s==="focusout"&&sS()}function E5(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Ud(Tc)}function C5(s,u){if(s==="click")return Ud(u)}function T5(s,u){if(s==="input"||s==="change")return Ud(u)}function k5(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Hr=typeof Object.is=="function"?Object.is:k5;function kc(s,u){if(Hr(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var h=Object.keys(s),g=Object.keys(u);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var E=h[g];if(!qe.call(u,E)||!Hr(s[E],u[E]))return!1}return!0}function oS(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function uS(s,u){var h=oS(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=u&&g>=u)return{node:h,offset:u-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=oS(h)}}function cS(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?cS(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function fS(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=_d(s.document);u instanceof s.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)s=u.contentWindow;else break;u=_d(s.document)}return u}function km(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var N5=mi&&"documentMode"in document&&11>=document.documentMode,Mo=null,Nm=null,Nc=null,Am=!1;function dS(s,u,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Am||Mo==null||Mo!==_d(g)||(g=Mo,"selectionStart"in g&&km(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Nc&&kc(Nc,g)||(Nc=g,g=jh(Nm,"onSelect"),0<g.length&&(u=new Fd("onSelect","select",null,u,h),s.push({event:u,listeners:g}),u.target=Mo)))}function Tl(s,u){var h={};return h[s.toLowerCase()]=u.toLowerCase(),h["Webkit"+s]="webkit"+u,h["Moz"+s]="moz"+u,h}var Oo={animationend:Tl("Animation","AnimationEnd"),animationiteration:Tl("Animation","AnimationIteration"),animationstart:Tl("Animation","AnimationStart"),transitionrun:Tl("Transition","TransitionRun"),transitionstart:Tl("Transition","TransitionStart"),transitioncancel:Tl("Transition","TransitionCancel"),transitionend:Tl("Transition","TransitionEnd")},Rm={},hS={};mi&&(hS=document.createElement("div").style,"AnimationEvent"in window||(delete Oo.animationend.animation,delete Oo.animationiteration.animation,delete Oo.animationstart.animation),"TransitionEvent"in window||delete Oo.transitionend.transition);function kl(s){if(Rm[s])return Rm[s];if(!Oo[s])return s;var u=Oo[s],h;for(h in u)if(u.hasOwnProperty(h)&&h in hS)return Rm[s]=u[h];return s}var vS=kl("animationend"),pS=kl("animationiteration"),mS=kl("animationstart"),A5=kl("transitionrun"),R5=kl("transitionstart"),j5=kl("transitioncancel"),gS=kl("transitionend"),yS=new Map,jm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jm.push("scrollEnd");function ka(s,u){yS.set(s,u),Vr(u,[s])}var Vd=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},oa=[],Lo=0,Dm=0;function Hd(){for(var s=Lo,u=Dm=Lo=0;u<s;){var h=oa[u];oa[u++]=null;var g=oa[u];oa[u++]=null;var E=oa[u];oa[u++]=null;var k=oa[u];if(oa[u++]=null,g!==null&&E!==null){var O=g.pending;O===null?E.next=E:(E.next=O.next,O.next=E),g.pending=E}k!==0&&xS(h,E,k)}}function Gd(s,u,h,g){oa[Lo++]=s,oa[Lo++]=u,oa[Lo++]=h,oa[Lo++]=g,Dm|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function Mm(s,u,h,g){return Gd(s,u,h,g),$d(s)}function Nl(s,u){return Gd(s,null,null,u),$d(s)}function xS(s,u,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var E=!1,k=s.return;k!==null;)k.childLanes|=h,g=k.alternate,g!==null&&(g.childLanes|=h),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(E=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,E&&u!==null&&(E=31-de(h),s=k.hiddenUpdates,g=s[E],g===null?s[E]=[u]:g.push(u),u.lane=h|536870912),k):null}function $d(s){if(50<Xc)throw Xc=0,qg=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var _o={};function D5(s,u,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(s,u,h,g){return new D5(s,u,h,g)}function Om(s){return s=s.prototype,!(!s||!s.isReactComponent)}function gi(s,u){var h=s.alternate;return h===null?(h=Gr(s.tag,u,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=u,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,u=s.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function bS(s,u){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,u=h.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function Kd(s,u,h,g,E,k){var O=0;if(g=s,typeof s=="function")Om(s)&&(O=1);else if(typeof s=="string")O=B3(s,h,te.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case _:return s=Gr(31,h,u,E),s.elementType=_,s.lanes=k,s;case w:return Al(h.children,E,k,u);case S:O=8,E|=24;break;case b:return s=Gr(12,h,u,E|2),s.elementType=b,s.lanes=k,s;case A:return s=Gr(13,h,u,E),s.elementType=A,s.lanes=k,s;case R:return s=Gr(19,h,u,E),s.elementType=R,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:O=10;break e;case C:O=9;break e;case N:O=11;break e;case D:O=14;break e;case L:O=16,g=null;break e}O=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return u=Gr(O,h,u,E),u.elementType=s,u.type=g,u.lanes=k,u}function Al(s,u,h,g){return s=Gr(7,s,g,u),s.lanes=h,s}function Lm(s,u,h){return s=Gr(6,s,null,u),s.lanes=h,s}function wS(s){var u=Gr(18,null,null,0);return u.stateNode=s,u}function _m(s,u,h){return u=Gr(4,s.children!==null?s.children:[],s.key,u),u.lanes=h,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var SS=new WeakMap;function ua(s,u){if(typeof s=="object"&&s!==null){var h=SS.get(s);return h!==void 0?h:(u={value:s,source:u,stack:Qe(u)},SS.set(s,u),u)}return{value:s,source:u,stack:Qe(u)}}var Bo=[],Po=0,Yd=null,Ac=0,ca=[],fa=0,us=null,Va=1,Ha="";function yi(s,u){Bo[Po++]=Ac,Bo[Po++]=Yd,Yd=s,Ac=u}function ES(s,u,h){ca[fa++]=Va,ca[fa++]=Ha,ca[fa++]=us,us=s;var g=Va;s=Ha;var E=32-de(g)-1;g&=~(1<<E),h+=1;var k=32-de(u)+E;if(30<k){var O=E-E%5;k=(g&(1<<O)-1).toString(32),g>>=O,E-=O,Va=1<<32-de(u)+E|h<<E|g,Ha=k+s}else Va=1<<k|h<<E|g,Ha=s}function Bm(s){s.return!==null&&(yi(s,1),ES(s,1,0))}function Pm(s){for(;s===Yd;)Yd=Bo[--Po],Bo[Po]=null,Ac=Bo[--Po],Bo[Po]=null;for(;s===us;)us=ca[--fa],ca[fa]=null,Ha=ca[--fa],ca[fa]=null,Va=ca[--fa],ca[fa]=null}function CS(s,u){ca[fa++]=Va,ca[fa++]=Ha,ca[fa++]=us,Va=u.id,Ha=u.overflow,us=s}var er=null,en=null,kt=!1,cs=null,da=!1,zm=Error(r(519));function fs(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rc(ua(u,s)),zm}function TS(s){var u=s.stateNode,h=s.type,g=s.memoizedProps;switch(u[an]=s,u[_n]=g,h){case"dialog":St("cancel",u),St("close",u);break;case"iframe":case"object":case"embed":St("load",u);break;case"video":case"audio":for(h=0;h<Wc.length;h++)St(Wc[h],u);break;case"source":St("error",u);break;case"img":case"image":case"link":St("error",u),St("load",u);break;case"details":St("toggle",u);break;case"input":St("invalid",u),zw(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":St("invalid",u);break;case"textarea":St("invalid",u),Fw(u,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||g.suppressHydrationWarning===!0||U2(u.textContent,h)?(g.popover!=null&&(St("beforetoggle",u),St("toggle",u)),g.onScroll!=null&&St("scroll",u),g.onScrollEnd!=null&&St("scrollend",u),g.onClick!=null&&(u.onclick=pi),u=!0):u=!1,u||fs(s,!0)}function kS(s){for(er=s.return;er;)switch(er.tag){case 5:case 31:case 13:da=!1;return;case 27:case 3:da=!0;return;default:er=er.return}}function zo(s){if(s!==er)return!1;if(!kt)return kS(s),kt=!0,!1;var u=s.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||ny(s.type,s.memoizedProps)),h=!h),h&&en&&fs(s),kS(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));en=W2(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));en=W2(s)}else u===27?(u=en,Ts(s.type)?(s=ly,ly=null,en=s):en=u):en=er?va(s.stateNode.nextSibling):null;return!0}function Rl(){en=er=null,kt=!1}function Im(){var s=cs;return s!==null&&(Lr===null?Lr=s:Lr.push.apply(Lr,s),cs=null),s}function Rc(s){cs===null?cs=[s]:cs.push(s)}var Fm=q(null),jl=null,xi=null;function ds(s,u,h){U(Fm,u._currentValue),u._currentValue=h}function bi(s){s._currentValue=Fm.current,X(Fm)}function qm(s,u,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),s===h)break;s=s.return}}function Um(s,u,h,g){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var k=E.dependencies;if(k!==null){var O=E.child;k=k.firstContext;e:for(;k!==null;){var $=k;k=E;for(var W=0;W<u.length;W++)if($.context===u[W]){k.lanes|=h,$=k.alternate,$!==null&&($.lanes|=h),qm(k.return,h,s),g||(O=null);break e}k=$.next}}else if(E.tag===18){if(O=E.return,O===null)throw Error(r(341));O.lanes|=h,k=O.alternate,k!==null&&(k.lanes|=h),qm(O,h,s),O=null}else O=E.child;if(O!==null)O.return=E;else for(O=E;O!==null;){if(O===s){O=null;break}if(E=O.sibling,E!==null){E.return=O.return,O=E;break}O=O.return}E=O}}function Io(s,u,h,g){s=null;for(var E=u,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var O=E.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var $=E.type;Hr(E.pendingProps.value,O.value)||(s!==null?s.push($):s=[$])}}else if(E===ae.current){if(O=E.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push(nf):s=[nf])}E=E.return}s!==null&&Um(u,s,h,g),u.flags|=262144}function Xd(s){for(s=s.firstContext;s!==null;){if(!Hr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Dl(s){jl=s,xi=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function tr(s){return NS(jl,s)}function Qd(s,u){return jl===null&&Dl(s),NS(s,u)}function NS(s,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},xi===null){if(s===null)throw Error(r(308));xi=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else xi=xi.next=u;return h}var M5=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){u.aborted=!0,s.forEach(function(h){return h()})}},O5=e.unstable_scheduleCallback,L5=e.unstable_NormalPriority,Nn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vm(){return{controller:new M5,data:new Map,refCount:0}}function jc(s){s.refCount--,s.refCount===0&&O5(L5,function(){s.controller.abort()})}var Dc=null,Hm=0,Fo=0,qo=null;function _5(s,u){if(Dc===null){var h=Dc=[];Hm=0,Fo=Kg(),qo={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Hm++,u.then(AS,AS),u}function AS(){if(--Hm===0&&Dc!==null){qo!==null&&(qo.status="fulfilled");var s=Dc;Dc=null,Fo=0,qo=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function B5(s,u){var h=[],g={status:"pending",value:null,reason:null,then:function(E){h.push(E)}};return s.then(function(){g.status="fulfilled",g.value=u;for(var E=0;E<h.length;E++)(0,h[E])(u)},function(E){for(g.status="rejected",g.reason=E,E=0;E<h.length;E++)(0,h[E])(void 0)}),g}var RS=B.S;B.S=function(s,u){d2=Pe(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&_5(s,u),RS!==null&&RS(s,u)};var Ml=q(null);function Gm(){var s=Ml.current;return s!==null?s:Gt.pooledCache}function Wd(s,u){u===null?U(Ml,Ml.current):U(Ml,u.pool)}function jS(){var s=Gm();return s===null?null:{parent:Nn._currentValue,pool:s}}var Uo=Error(r(460)),$m=Error(r(474)),Zd=Error(r(542)),Jd={then:function(){}};function DS(s){return s=s.status,s==="fulfilled"||s==="rejected"}function MS(s,u,h){switch(h=s[h],h===void 0?s.push(u):h!==u&&(u.then(pi,pi),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,LS(s),s;default:if(typeof u.status=="string")u.then(pi,pi);else{if(s=Gt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(g){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=g}},function(g){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,LS(s),s}throw Ll=u,Uo}}function Ol(s){try{var u=s._init;return u(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Ll=h,Uo):h}}var Ll=null;function OS(){if(Ll===null)throw Error(r(459));var s=Ll;return Ll=null,s}function LS(s){if(s===Uo||s===Zd)throw Error(r(483))}var Vo=null,Mc=0;function eh(s){var u=Mc;return Mc+=1,Vo===null&&(Vo=[]),MS(Vo,s,u)}function Oc(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function th(s,u){throw u.$$typeof===m?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function _S(s){function u(se,ee){if(s){var ue=se.deletions;ue===null?(se.deletions=[ee],se.flags|=16):ue.push(ee)}}function h(se,ee){if(!s)return null;for(;ee!==null;)u(se,ee),ee=ee.sibling;return null}function g(se){for(var ee=new Map;se!==null;)se.key!==null?ee.set(se.key,se):ee.set(se.index,se),se=se.sibling;return ee}function E(se,ee){return se=gi(se,ee),se.index=0,se.sibling=null,se}function k(se,ee,ue){return se.index=ue,s?(ue=se.alternate,ue!==null?(ue=ue.index,ue<ee?(se.flags|=67108866,ee):ue):(se.flags|=67108866,ee)):(se.flags|=1048576,ee)}function O(se){return s&&se.alternate===null&&(se.flags|=67108866),se}function $(se,ee,ue,Se){return ee===null||ee.tag!==6?(ee=Lm(ue,se.mode,Se),ee.return=se,ee):(ee=E(ee,ue),ee.return=se,ee)}function W(se,ee,ue,Se){var tt=ue.type;return tt===w?be(se,ee,ue.props.children,Se,ue.key):ee!==null&&(ee.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===L&&Ol(tt)===ee.type)?(ee=E(ee,ue.props),Oc(ee,ue),ee.return=se,ee):(ee=Kd(ue.type,ue.key,ue.props,null,se.mode,Se),Oc(ee,ue),ee.return=se,ee)}function ce(se,ee,ue,Se){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ue.containerInfo||ee.stateNode.implementation!==ue.implementation?(ee=_m(ue,se.mode,Se),ee.return=se,ee):(ee=E(ee,ue.children||[]),ee.return=se,ee)}function be(se,ee,ue,Se,tt){return ee===null||ee.tag!==7?(ee=Al(ue,se.mode,Se,tt),ee.return=se,ee):(ee=E(ee,ue),ee.return=se,ee)}function Ee(se,ee,ue){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Lm(""+ee,se.mode,ue),ee.return=se,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ue=Kd(ee.type,ee.key,ee.props,null,se.mode,ue),Oc(ue,ee),ue.return=se,ue;case x:return ee=_m(ee,se.mode,ue),ee.return=se,ee;case L:return ee=Ol(ee),Ee(se,ee,ue)}if(F(ee)||P(ee))return ee=Al(ee,se.mode,ue,null),ee.return=se,ee;if(typeof ee.then=="function")return Ee(se,eh(ee),ue);if(ee.$$typeof===T)return Ee(se,Qd(se,ee),ue);th(se,ee)}return null}function ve(se,ee,ue,Se){var tt=ee!==null?ee.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return tt!==null?null:$(se,ee,""+ue,Se);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===tt?W(se,ee,ue,Se):null;case x:return ue.key===tt?ce(se,ee,ue,Se):null;case L:return ue=Ol(ue),ve(se,ee,ue,Se)}if(F(ue)||P(ue))return tt!==null?null:be(se,ee,ue,Se,null);if(typeof ue.then=="function")return ve(se,ee,eh(ue),Se);if(ue.$$typeof===T)return ve(se,ee,Qd(se,ue),Se);th(se,ue)}return null}function me(se,ee,ue,Se,tt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return se=se.get(ue)||null,$(ee,se,""+Se,tt);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case y:return se=se.get(Se.key===null?ue:Se.key)||null,W(ee,se,Se,tt);case x:return se=se.get(Se.key===null?ue:Se.key)||null,ce(ee,se,Se,tt);case L:return Se=Ol(Se),me(se,ee,ue,Se,tt)}if(F(Se)||P(Se))return se=se.get(ue)||null,be(ee,se,Se,tt,null);if(typeof Se.then=="function")return me(se,ee,ue,eh(Se),tt);if(Se.$$typeof===T)return me(se,ee,ue,Qd(ee,Se),tt);th(ee,Se)}return null}function Ve(se,ee,ue,Se){for(var tt=null,Dt=null,$e=ee,vt=ee=0,Tt=null;$e!==null&&vt<ue.length;vt++){$e.index>vt?(Tt=$e,$e=null):Tt=$e.sibling;var Mt=ve(se,$e,ue[vt],Se);if(Mt===null){$e===null&&($e=Tt);break}s&&$e&&Mt.alternate===null&&u(se,$e),ee=k(Mt,ee,vt),Dt===null?tt=Mt:Dt.sibling=Mt,Dt=Mt,$e=Tt}if(vt===ue.length)return h(se,$e),kt&&yi(se,vt),tt;if($e===null){for(;vt<ue.length;vt++)$e=Ee(se,ue[vt],Se),$e!==null&&(ee=k($e,ee,vt),Dt===null?tt=$e:Dt.sibling=$e,Dt=$e);return kt&&yi(se,vt),tt}for($e=g($e);vt<ue.length;vt++)Tt=me($e,se,vt,ue[vt],Se),Tt!==null&&(s&&Tt.alternate!==null&&$e.delete(Tt.key===null?vt:Tt.key),ee=k(Tt,ee,vt),Dt===null?tt=Tt:Dt.sibling=Tt,Dt=Tt);return s&&$e.forEach(function(js){return u(se,js)}),kt&&yi(se,vt),tt}function at(se,ee,ue,Se){if(ue==null)throw Error(r(151));for(var tt=null,Dt=null,$e=ee,vt=ee=0,Tt=null,Mt=ue.next();$e!==null&&!Mt.done;vt++,Mt=ue.next()){$e.index>vt?(Tt=$e,$e=null):Tt=$e.sibling;var js=ve(se,$e,Mt.value,Se);if(js===null){$e===null&&($e=Tt);break}s&&$e&&js.alternate===null&&u(se,$e),ee=k(js,ee,vt),Dt===null?tt=js:Dt.sibling=js,Dt=js,$e=Tt}if(Mt.done)return h(se,$e),kt&&yi(se,vt),tt;if($e===null){for(;!Mt.done;vt++,Mt=ue.next())Mt=Ee(se,Mt.value,Se),Mt!==null&&(ee=k(Mt,ee,vt),Dt===null?tt=Mt:Dt.sibling=Mt,Dt=Mt);return kt&&yi(se,vt),tt}for($e=g($e);!Mt.done;vt++,Mt=ue.next())Mt=me($e,se,vt,Mt.value,Se),Mt!==null&&(s&&Mt.alternate!==null&&$e.delete(Mt.key===null?vt:Mt.key),ee=k(Mt,ee,vt),Dt===null?tt=Mt:Dt.sibling=Mt,Dt=Mt);return s&&$e.forEach(function(K3){return u(se,K3)}),kt&&yi(se,vt),tt}function Vt(se,ee,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var tt=ue.key;ee!==null;){if(ee.key===tt){if(tt=ue.type,tt===w){if(ee.tag===7){h(se,ee.sibling),Se=E(ee,ue.props.children),Se.return=se,se=Se;break e}}else if(ee.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===L&&Ol(tt)===ee.type){h(se,ee.sibling),Se=E(ee,ue.props),Oc(Se,ue),Se.return=se,se=Se;break e}h(se,ee);break}else u(se,ee);ee=ee.sibling}ue.type===w?(Se=Al(ue.props.children,se.mode,Se,ue.key),Se.return=se,se=Se):(Se=Kd(ue.type,ue.key,ue.props,null,se.mode,Se),Oc(Se,ue),Se.return=se,se=Se)}return O(se);case x:e:{for(tt=ue.key;ee!==null;){if(ee.key===tt)if(ee.tag===4&&ee.stateNode.containerInfo===ue.containerInfo&&ee.stateNode.implementation===ue.implementation){h(se,ee.sibling),Se=E(ee,ue.children||[]),Se.return=se,se=Se;break e}else{h(se,ee);break}else u(se,ee);ee=ee.sibling}Se=_m(ue,se.mode,Se),Se.return=se,se=Se}return O(se);case L:return ue=Ol(ue),Vt(se,ee,ue,Se)}if(F(ue))return Ve(se,ee,ue,Se);if(P(ue)){if(tt=P(ue),typeof tt!="function")throw Error(r(150));return ue=tt.call(ue),at(se,ee,ue,Se)}if(typeof ue.then=="function")return Vt(se,ee,eh(ue),Se);if(ue.$$typeof===T)return Vt(se,ee,Qd(se,ue),Se);th(se,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ee!==null&&ee.tag===6?(h(se,ee.sibling),Se=E(ee,ue),Se.return=se,se=Se):(h(se,ee),Se=Lm(ue,se.mode,Se),Se.return=se,se=Se),O(se)):h(se,ee)}return function(se,ee,ue,Se){try{Mc=0;var tt=Vt(se,ee,ue,Se);return Vo=null,tt}catch($e){if($e===Uo||$e===Zd)throw $e;var Dt=Gr(29,$e,null,se.mode);return Dt.lanes=Se,Dt.return=se,Dt}finally{}}}var _l=_S(!0),BS=_S(!1),hs=!1;function Km(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ym(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function vs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ps(s,u,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Lt&2)!==0){var E=g.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),g.pending=u,u=$d(s),xS(s,null,h),u}return Gd(s,g,u,h),$d(s)}function Lc(s,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var g=u.lanes;g&=s.pendingLanes,h|=g,u.lanes=h,bn(s,h)}}function Xm(s,u){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var E=null,k=null;if(h=h.firstBaseUpdate,h!==null){do{var O={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};k===null?E=k=O:k=k.next=O,h=h.next}while(h!==null);k===null?E=k=u:k=k.next=u}else E=k=u;h={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=u}var Qm=!1;function _c(){if(Qm){var s=qo;if(s!==null)throw s}}function Bc(s,u,h,g){Qm=!1;var E=s.updateQueue;hs=!1;var k=E.firstBaseUpdate,O=E.lastBaseUpdate,$=E.shared.pending;if($!==null){E.shared.pending=null;var W=$,ce=W.next;W.next=null,O===null?k=ce:O.next=ce,O=W;var be=s.alternate;be!==null&&(be=be.updateQueue,$=be.lastBaseUpdate,$!==O&&($===null?be.firstBaseUpdate=ce:$.next=ce,be.lastBaseUpdate=W))}if(k!==null){var Ee=E.baseState;O=0,be=ce=W=null,$=k;do{var ve=$.lane&-536870913,me=ve!==$.lane;if(me?(Ct&ve)===ve:(g&ve)===ve){ve!==0&&ve===Fo&&(Qm=!0),be!==null&&(be=be.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ve=s,at=$;ve=u;var Vt=h;switch(at.tag){case 1:if(Ve=at.payload,typeof Ve=="function"){Ee=Ve.call(Vt,Ee,ve);break e}Ee=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=at.payload,ve=typeof Ve=="function"?Ve.call(Vt,Ee,ve):Ve,ve==null)break e;Ee=v({},Ee,ve);break e;case 2:hs=!0}}ve=$.callback,ve!==null&&(s.flags|=64,me&&(s.flags|=8192),me=E.callbacks,me===null?E.callbacks=[ve]:me.push(ve))}else me={lane:ve,tag:$.tag,payload:$.payload,callback:$.callback,next:null},be===null?(ce=be=me,W=Ee):be=be.next=me,O|=ve;if($=$.next,$===null){if($=E.shared.pending,$===null)break;me=$,$=me.next,me.next=null,E.lastBaseUpdate=me,E.shared.pending=null}}while(!0);be===null&&(W=Ee),E.baseState=W,E.firstBaseUpdate=ce,E.lastBaseUpdate=be,k===null&&(E.shared.lanes=0),bs|=O,s.lanes=O,s.memoizedState=Ee}}function PS(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function zS(s,u){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)PS(h[s],u)}var Ho=q(null),nh=q(0);function IS(s,u){s=Ri,U(nh,s),U(Ho,u),Ri=s|u.baseLanes}function Wm(){U(nh,Ri),U(Ho,Ho.current)}function Zm(){Ri=nh.current,X(Ho),X(nh)}var $r=q(null),ha=null;function ms(s){var u=s.alternate;U(Sn,Sn.current&1),U($r,s),ha===null&&(u===null||Ho.current!==null||u.memoizedState!==null)&&(ha=s)}function Jm(s){U(Sn,Sn.current),U($r,s),ha===null&&(ha=s)}function FS(s){s.tag===22?(U(Sn,Sn.current),U($r,s),ha===null&&(ha=s)):gs()}function gs(){U(Sn,Sn.current),U($r,$r.current)}function Kr(s){X($r),ha===s&&(ha=null),X(Sn)}var Sn=q(0);function rh(s){for(var u=s;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||iy(h)||sy(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var wi=0,dt=null,qt=null,An=null,ah=!1,Go=!1,Bl=!1,ih=0,Pc=0,$o=null,P5=0;function pn(){throw Error(r(321))}function eg(s,u){if(u===null)return!1;for(var h=0;h<u.length&&h<s.length;h++)if(!Hr(s[h],u[h]))return!1;return!0}function tg(s,u,h,g,E,k){return wi=k,dt=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,B.H=s===null||s.memoizedState===null?EE:mg,Bl=!1,k=h(g,E),Bl=!1,Go&&(k=US(u,h,g,E)),qS(s),k}function qS(s){B.H=Fc;var u=qt!==null&&qt.next!==null;if(wi=0,An=qt=dt=null,ah=!1,Pc=0,$o=null,u)throw Error(r(300));s===null||Rn||(s=s.dependencies,s!==null&&Xd(s)&&(Rn=!0))}function US(s,u,h,g){dt=s;var E=0;do{if(Go&&($o=null),Pc=0,Go=!1,25<=E)throw Error(r(301));if(E+=1,An=qt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}B.H=CE,k=u(h,g)}while(Go);return k}function z5(){var s=B.H,u=s.useState()[0];return u=typeof u.then=="function"?zc(u):u,s=s.useState()[0],(qt!==null?qt.memoizedState:null)!==s&&(dt.flags|=1024),u}function ng(){var s=ih!==0;return ih=0,s}function rg(s,u,h){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~h}function ag(s){if(ah){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}ah=!1}wi=0,An=qt=dt=null,Go=!1,Pc=ih=0,$o=null}function xr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?dt.memoizedState=An=s:An=An.next=s,An}function En(){if(qt===null){var s=dt.alternate;s=s!==null?s.memoizedState:null}else s=qt.next;var u=An===null?dt.memoizedState:An.next;if(u!==null)An=u,qt=s;else{if(s===null)throw dt.alternate===null?Error(r(467)):Error(r(310));qt=s,s={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},An===null?dt.memoizedState=An=s:An=An.next=s}return An}function sh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zc(s){var u=Pc;return Pc+=1,$o===null&&($o=[]),s=MS($o,s,u),u=dt,(An===null?u.memoizedState:An.next)===null&&(u=u.alternate,B.H=u===null||u.memoizedState===null?EE:mg),s}function lh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return zc(s);if(s.$$typeof===T)return tr(s)}throw Error(r(438,String(s)))}function ig(s){var u=null,h=dt.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var g=dt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=sh(),dt.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(s),g=0;g<s;g++)h[g]=M;return u.index++,h}function Si(s,u){return typeof u=="function"?u(s):u}function oh(s){var u=En();return sg(u,qt,s)}function sg(s,u,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var E=s.baseQueue,k=g.pending;if(k!==null){if(E!==null){var O=E.next;E.next=k.next,k.next=O}u.baseQueue=E=k,g.pending=null}if(k=s.baseState,E===null)s.memoizedState=k;else{u=E.next;var $=O=null,W=null,ce=u,be=!1;do{var Ee=ce.lane&-536870913;if(Ee!==ce.lane?(Ct&Ee)===Ee:(wi&Ee)===Ee){var ve=ce.revertLane;if(ve===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),Ee===Fo&&(be=!0);else if((wi&ve)===ve){ce=ce.next,ve===Fo&&(be=!0);continue}else Ee={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},W===null?($=W=Ee,O=k):W=W.next=Ee,dt.lanes|=ve,bs|=ve;Ee=ce.action,Bl&&h(k,Ee),k=ce.hasEagerState?ce.eagerState:h(k,Ee)}else ve={lane:Ee,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},W===null?($=W=ve,O=k):W=W.next=ve,dt.lanes|=Ee,bs|=Ee;ce=ce.next}while(ce!==null&&ce!==u);if(W===null?O=k:W.next=$,!Hr(k,s.memoizedState)&&(Rn=!0,be&&(h=qo,h!==null)))throw h;s.memoizedState=k,s.baseState=O,s.baseQueue=W,g.lastRenderedState=k}return E===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function lg(s){var u=En(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,E=h.pending,k=u.memoizedState;if(E!==null){h.pending=null;var O=E=E.next;do k=s(k,O.action),O=O.next;while(O!==E);Hr(k,u.memoizedState)||(Rn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),h.lastRenderedState=k}return[k,g]}function VS(s,u,h){var g=dt,E=En(),k=kt;if(k){if(h===void 0)throw Error(r(407));h=h()}else h=u();var O=!Hr((qt||E).memoizedState,h);if(O&&(E.memoizedState=h,Rn=!0),E=E.queue,cg($S.bind(null,g,E,s),[s]),E.getSnapshot!==u||O||An!==null&&An.memoizedState.tag&1){if(g.flags|=2048,Ko(9,{destroy:void 0},GS.bind(null,g,E,h,u),null),Gt===null)throw Error(r(349));k||(wi&127)!==0||HS(g,u,h)}return h}function HS(s,u,h){s.flags|=16384,s={getSnapshot:u,value:h},u=dt.updateQueue,u===null?(u=sh(),dt.updateQueue=u,u.stores=[s]):(h=u.stores,h===null?u.stores=[s]:h.push(s))}function GS(s,u,h,g){u.value=h,u.getSnapshot=g,KS(u)&&YS(s)}function $S(s,u,h){return h(function(){KS(u)&&YS(s)})}function KS(s){var u=s.getSnapshot;s=s.value;try{var h=u();return!Hr(s,h)}catch{return!0}}function YS(s){var u=Nl(s,2);u!==null&&_r(u,s,2)}function og(s){var u=xr();if(typeof s=="function"){var h=s;if(s=h(),Bl){pe(!0);try{h()}finally{pe(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:s},u}function XS(s,u,h,g){return s.baseState=h,sg(s,qt,typeof g=="function"?g:Si)}function I5(s,u,h,g,E){if(fh(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){k.listeners.push(O)}};B.T!==null?h(!0):k.isTransition=!1,g(k),h=u.pending,h===null?(k.next=u.pending=k,QS(u,k)):(k.next=h.next,u.pending=h.next=k)}}function QS(s,u){var h=u.action,g=u.payload,E=s.state;if(u.isTransition){var k=B.T,O={};B.T=O;try{var $=h(E,g),W=B.S;W!==null&&W(O,$),WS(s,u,$)}catch(ce){ug(s,u,ce)}finally{k!==null&&O.types!==null&&(k.types=O.types),B.T=k}}else try{k=h(E,g),WS(s,u,k)}catch(ce){ug(s,u,ce)}}function WS(s,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){ZS(s,u,g)},function(g){return ug(s,u,g)}):ZS(s,u,h)}function ZS(s,u,h){u.status="fulfilled",u.value=h,JS(u),s.state=h,u=s.pending,u!==null&&(h=u.next,h===u?s.pending=null:(h=h.next,u.next=h,QS(s,h)))}function ug(s,u,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=h,JS(u),u=u.next;while(u!==g)}s.action=null}function JS(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function eE(s,u){return u}function tE(s,u){if(kt){var h=Gt.formState;if(h!==null){e:{var g=dt;if(kt){if(en){t:{for(var E=en,k=da;E.nodeType!==8;){if(!k){E=null;break t}if(E=va(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){en=va(E.nextSibling),g=E.data==="F!";break e}}fs(g)}g=!1}g&&(u=h[0])}}return h=xr(),h.memoizedState=h.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:eE,lastRenderedState:u},h.queue=g,h=bE.bind(null,dt,g),g.dispatch=h,g=og(!1),k=pg.bind(null,dt,!1,g.queue),g=xr(),E={state:u,dispatch:null,action:s,pending:null},g.queue=E,h=I5.bind(null,dt,E,k,h),E.dispatch=h,g.memoizedState=s,[u,h,!1]}function nE(s){var u=En();return rE(u,qt,s)}function rE(s,u,h){if(u=sg(s,u,eE)[0],s=oh(Si)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=zc(u)}catch(O){throw O===Uo?Zd:O}else g=u;u=En();var E=u.queue,k=E.dispatch;return h!==u.memoizedState&&(dt.flags|=2048,Ko(9,{destroy:void 0},F5.bind(null,E,h),null)),[g,k,s]}function F5(s,u){s.action=u}function aE(s){var u=En(),h=qt;if(h!==null)return rE(u,h,s);En(),u=u.memoizedState,h=En();var g=h.queue.dispatch;return h.memoizedState=s,[u,g,!1]}function Ko(s,u,h,g){return s={tag:s,create:h,deps:g,inst:u,next:null},u=dt.updateQueue,u===null&&(u=sh(),dt.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,u.lastEffect=s),s}function iE(){return En().memoizedState}function uh(s,u,h,g){var E=xr();dt.flags|=s,E.memoizedState=Ko(1|u,{destroy:void 0},h,g===void 0?null:g)}function ch(s,u,h,g){var E=En();g=g===void 0?null:g;var k=E.memoizedState.inst;qt!==null&&g!==null&&eg(g,qt.memoizedState.deps)?E.memoizedState=Ko(u,k,h,g):(dt.flags|=s,E.memoizedState=Ko(1|u,k,h,g))}function sE(s,u){uh(8390656,8,s,u)}function cg(s,u){ch(2048,8,s,u)}function q5(s){dt.flags|=4;var u=dt.updateQueue;if(u===null)u=sh(),dt.updateQueue=u,u.events=[s];else{var h=u.events;h===null?u.events=[s]:h.push(s)}}function lE(s){var u=En().memoizedState;return q5({ref:u,nextImpl:s}),function(){if((Lt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function oE(s,u){return ch(4,2,s,u)}function uE(s,u){return ch(4,4,s,u)}function cE(s,u){if(typeof u=="function"){s=s();var h=u(s);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function fE(s,u,h){h=h!=null?h.concat([s]):null,ch(4,4,cE.bind(null,u,s),h)}function fg(){}function dE(s,u){var h=En();u=u===void 0?null:u;var g=h.memoizedState;return u!==null&&eg(u,g[1])?g[0]:(h.memoizedState=[s,u],s)}function hE(s,u){var h=En();u=u===void 0?null:u;var g=h.memoizedState;if(u!==null&&eg(u,g[1]))return g[0];if(g=s(),Bl){pe(!0);try{s()}finally{pe(!1)}}return h.memoizedState=[g,u],g}function dg(s,u,h){return h===void 0||(wi&1073741824)!==0&&(Ct&261930)===0?s.memoizedState=u:(s.memoizedState=h,s=v2(),dt.lanes|=s,bs|=s,h)}function vE(s,u,h,g){return Hr(h,u)?h:Ho.current!==null?(s=dg(s,h,g),Hr(s,u)||(Rn=!0),s):(wi&42)===0||(wi&1073741824)!==0&&(Ct&261930)===0?(Rn=!0,s.memoizedState=h):(s=v2(),dt.lanes|=s,bs|=s,u)}function pE(s,u,h,g,E){var k=H.p;H.p=k!==0&&8>k?k:8;var O=B.T,$={};B.T=$,pg(s,!1,u,h);try{var W=E(),ce=B.S;if(ce!==null&&ce($,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var be=B5(W,g);Ic(s,u,be,Qr(s))}else Ic(s,u,g,Qr(s))}catch(Ee){Ic(s,u,{then:function(){},status:"rejected",reason:Ee},Qr())}finally{H.p=k,O!==null&&$.types!==null&&(O.types=$.types),B.T=O}}function U5(){}function hg(s,u,h,g){if(s.tag!==5)throw Error(r(476));var E=mE(s).queue;pE(s,E,u,Y,h===null?U5:function(){return gE(s),h(g)})}function mE(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:Y},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:h},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function gE(s){var u=mE(s);u.next===null&&(u=s.alternate.memoizedState),Ic(s,u.next.queue,{},Qr())}function vg(){return tr(nf)}function yE(){return En().memoizedState}function xE(){return En().memoizedState}function V5(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var h=Qr();s=vs(h);var g=ps(u,s,h);g!==null&&(_r(g,u,h),Lc(g,u,h)),u={cache:Vm()},s.payload=u;return}u=u.return}}function H5(s,u,h){var g=Qr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},fh(s)?wE(u,h):(h=Mm(s,u,h,g),h!==null&&(_r(h,s,g),SE(h,u,g)))}function bE(s,u,h){var g=Qr();Ic(s,u,h,g)}function Ic(s,u,h,g){var E={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(fh(s))wE(u,E);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var O=u.lastRenderedState,$=k(O,h);if(E.hasEagerState=!0,E.eagerState=$,Hr($,O))return Gd(s,u,E,0),Gt===null&&Hd(),!1}catch{}finally{}if(h=Mm(s,u,E,g),h!==null)return _r(h,s,g),SE(h,u,g),!0}return!1}function pg(s,u,h,g){if(g={lane:2,revertLane:Kg(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},fh(s)){if(u)throw Error(r(479))}else u=Mm(s,h,g,2),u!==null&&_r(u,s,2)}function fh(s){var u=s.alternate;return s===dt||u!==null&&u===dt}function wE(s,u){Go=ah=!0;var h=s.pending;h===null?u.next=u:(u.next=h.next,h.next=u),s.pending=u}function SE(s,u,h){if((h&4194048)!==0){var g=u.lanes;g&=s.pendingLanes,h|=g,u.lanes=h,bn(s,h)}}var Fc={readContext:tr,use:lh,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn};Fc.useEffectEvent=pn;var EE={readContext:tr,use:lh,useCallback:function(s,u){return xr().memoizedState=[s,u===void 0?null:u],s},useContext:tr,useEffect:sE,useImperativeHandle:function(s,u,h){h=h!=null?h.concat([s]):null,uh(4194308,4,cE.bind(null,u,s),h)},useLayoutEffect:function(s,u){return uh(4194308,4,s,u)},useInsertionEffect:function(s,u){uh(4,2,s,u)},useMemo:function(s,u){var h=xr();u=u===void 0?null:u;var g=s();if(Bl){pe(!0);try{s()}finally{pe(!1)}}return h.memoizedState=[g,u],g},useReducer:function(s,u,h){var g=xr();if(h!==void 0){var E=h(u);if(Bl){pe(!0);try{h(u)}finally{pe(!1)}}}else E=u;return g.memoizedState=g.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},g.queue=s,s=s.dispatch=H5.bind(null,dt,s),[g.memoizedState,s]},useRef:function(s){var u=xr();return s={current:s},u.memoizedState=s},useState:function(s){s=og(s);var u=s.queue,h=bE.bind(null,dt,u);return u.dispatch=h,[s.memoizedState,h]},useDebugValue:fg,useDeferredValue:function(s,u){var h=xr();return dg(h,s,u)},useTransition:function(){var s=og(!1);return s=pE.bind(null,dt,s.queue,!0,!1),xr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,h){var g=dt,E=xr();if(kt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),Gt===null)throw Error(r(349));(Ct&127)!==0||HS(g,u,h)}E.memoizedState=h;var k={value:h,getSnapshot:u};return E.queue=k,sE($S.bind(null,g,k,s),[s]),g.flags|=2048,Ko(9,{destroy:void 0},GS.bind(null,g,k,h,u),null),h},useId:function(){var s=xr(),u=Gt.identifierPrefix;if(kt){var h=Ha,g=Va;h=(g&~(1<<32-de(g)-1)).toString(32)+h,u="_"+u+"R_"+h,h=ih++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=P5++,u="_"+u+"r_"+h.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:vg,useFormState:tE,useActionState:tE,useOptimistic:function(s){var u=xr();u.memoizedState=u.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=pg.bind(null,dt,!0,h),h.dispatch=u,[s,u]},useMemoCache:ig,useCacheRefresh:function(){return xr().memoizedState=V5.bind(null,dt)},useEffectEvent:function(s){var u=xr(),h={impl:s};return u.memoizedState=h,function(){if((Lt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},mg={readContext:tr,use:lh,useCallback:dE,useContext:tr,useEffect:cg,useImperativeHandle:fE,useInsertionEffect:oE,useLayoutEffect:uE,useMemo:hE,useReducer:oh,useRef:iE,useState:function(){return oh(Si)},useDebugValue:fg,useDeferredValue:function(s,u){var h=En();return vE(h,qt.memoizedState,s,u)},useTransition:function(){var s=oh(Si)[0],u=En().memoizedState;return[typeof s=="boolean"?s:zc(s),u]},useSyncExternalStore:VS,useId:yE,useHostTransitionStatus:vg,useFormState:nE,useActionState:nE,useOptimistic:function(s,u){var h=En();return XS(h,qt,s,u)},useMemoCache:ig,useCacheRefresh:xE};mg.useEffectEvent=lE;var CE={readContext:tr,use:lh,useCallback:dE,useContext:tr,useEffect:cg,useImperativeHandle:fE,useInsertionEffect:oE,useLayoutEffect:uE,useMemo:hE,useReducer:lg,useRef:iE,useState:function(){return lg(Si)},useDebugValue:fg,useDeferredValue:function(s,u){var h=En();return qt===null?dg(h,s,u):vE(h,qt.memoizedState,s,u)},useTransition:function(){var s=lg(Si)[0],u=En().memoizedState;return[typeof s=="boolean"?s:zc(s),u]},useSyncExternalStore:VS,useId:yE,useHostTransitionStatus:vg,useFormState:aE,useActionState:aE,useOptimistic:function(s,u){var h=En();return qt!==null?XS(h,qt,s,u):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:ig,useCacheRefresh:xE};CE.useEffectEvent=lE;function gg(s,u,h,g){u=s.memoizedState,h=h(g,u),h=h==null?u:v({},u,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var yg={enqueueSetState:function(s,u,h){s=s._reactInternals;var g=Qr(),E=vs(g);E.payload=u,h!=null&&(E.callback=h),u=ps(s,E,g),u!==null&&(_r(u,s,g),Lc(u,s,g))},enqueueReplaceState:function(s,u,h){s=s._reactInternals;var g=Qr(),E=vs(g);E.tag=1,E.payload=u,h!=null&&(E.callback=h),u=ps(s,E,g),u!==null&&(_r(u,s,g),Lc(u,s,g))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var h=Qr(),g=vs(h);g.tag=2,u!=null&&(g.callback=u),u=ps(s,g,h),u!==null&&(_r(u,s,h),Lc(u,s,h))}};function TE(s,u,h,g,E,k,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,k,O):u.prototype&&u.prototype.isPureReactComponent?!kc(h,g)||!kc(E,k):!0}function kE(s,u,h,g){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,g),u.state!==s&&yg.enqueueReplaceState(u,u.state,null)}function Pl(s,u){var h=u;if("ref"in u){h={};for(var g in u)g!=="ref"&&(h[g]=u[g])}if(s=s.defaultProps){h===u&&(h=v({},h));for(var E in s)h[E]===void 0&&(h[E]=s[E])}return h}function NE(s){Vd(s)}function AE(s){console.error(s)}function RE(s){Vd(s)}function dh(s,u){try{var h=s.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function jE(s,u,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function xg(s,u,h){return h=vs(h),h.tag=3,h.payload={element:null},h.callback=function(){dh(s,u)},h}function DE(s){return s=vs(s),s.tag=3,s}function ME(s,u,h,g){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var k=g.value;s.payload=function(){return E(k)},s.callback=function(){jE(u,h,g)}}var O=h.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){jE(u,h,g),typeof E!="function"&&(ws===null?ws=new Set([this]):ws.add(this));var $=g.stack;this.componentDidCatch(g.value,{componentStack:$!==null?$:""})})}function G5(s,u,h,g,E){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=h.alternate,u!==null&&Io(u,h,E,!0),h=$r.current,h!==null){switch(h.tag){case 31:case 13:return ha===null?Ch():h.alternate===null&&mn===0&&(mn=3),h.flags&=-257,h.flags|=65536,h.lanes=E,g===Jd?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([g]):u.add(g),Hg(s,g,E)),!1;case 22:return h.flags|=65536,g===Jd?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([g]):h.add(g)),Hg(s,g,E)),!1}throw Error(r(435,h.tag))}return Hg(s,g,E),Ch(),!1}if(kt)return u=$r.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,g!==zm&&(s=Error(r(422),{cause:g}),Rc(ua(s,h)))):(g!==zm&&(u=Error(r(423),{cause:g}),Rc(ua(u,h))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,g=ua(g,h),E=xg(s.stateNode,g,E),Xm(s,E),mn!==4&&(mn=2)),!1;var k=Error(r(520),{cause:g});if(k=ua(k,h),Yc===null?Yc=[k]:Yc.push(k),mn!==4&&(mn=2),u===null)return!0;g=ua(g,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,s=E&-E,h.lanes|=s,s=xg(h.stateNode,g,s),Xm(h,s),!1;case 1:if(u=h.type,k=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(ws===null||!ws.has(k))))return h.flags|=65536,E&=-E,h.lanes|=E,E=DE(E),ME(E,s,h,g),Xm(h,E),!1}h=h.return}while(h!==null);return!1}var bg=Error(r(461)),Rn=!1;function nr(s,u,h,g){u.child=s===null?BS(u,null,h,g):_l(u,s.child,h,g)}function OE(s,u,h,g,E){h=h.render;var k=u.ref;if("ref"in g){var O={};for(var $ in g)$!=="ref"&&(O[$]=g[$])}else O=g;return Dl(u),g=tg(s,u,h,O,k,E),$=ng(),s!==null&&!Rn?(rg(s,u,E),Ei(s,u,E)):(kt&&$&&Bm(u),u.flags|=1,nr(s,u,g,E),u.child)}function LE(s,u,h,g,E){if(s===null){var k=h.type;return typeof k=="function"&&!Om(k)&&k.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=k,_E(s,u,k,g,E)):(s=Kd(h.type,null,g,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!Ag(s,E)){var O=k.memoizedProps;if(h=h.compare,h=h!==null?h:kc,h(O,g)&&s.ref===u.ref)return Ei(s,u,E)}return u.flags|=1,s=gi(k,g),s.ref=u.ref,s.return=u,u.child=s}function _E(s,u,h,g,E){if(s!==null){var k=s.memoizedProps;if(kc(k,g)&&s.ref===u.ref)if(Rn=!1,u.pendingProps=g=k,Ag(s,E))(s.flags&131072)!==0&&(Rn=!0);else return u.lanes=s.lanes,Ei(s,u,E)}return wg(s,u,h,g,E)}function BE(s,u,h,g){var E=g.children,k=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(k=k!==null?k.baseLanes|h:h,s!==null){for(g=u.child=s.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~k}else g=0,u.child=null;return PE(s,u,k,h,g)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Wd(u,k!==null?k.cachePool:null),k!==null?IS(u,k):Wm(),FS(u);else return g=u.lanes=536870912,PE(s,u,k!==null?k.baseLanes|h:h,h,g)}else k!==null?(Wd(u,k.cachePool),IS(u,k),gs(),u.memoizedState=null):(s!==null&&Wd(u,null),Wm(),gs());return nr(s,u,E,h),u.child}function qc(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function PE(s,u,h,g,E){var k=Gm();return k=k===null?null:{parent:Nn._currentValue,pool:k},u.memoizedState={baseLanes:h,cachePool:k},s!==null&&Wd(u,null),Wm(),FS(u),s!==null&&Io(s,u,g,!0),u.childLanes=E,null}function hh(s,u){return u=ph({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function zE(s,u,h){return _l(u,s.child,null,h),s=hh(u,u.pendingProps),s.flags|=2,Kr(u),u.memoizedState=null,s}function $5(s,u,h){var g=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(kt){if(g.mode==="hidden")return s=hh(u,g),u.lanes=536870912,qc(null,s);if(Jm(u),(s=en)?(s=Q2(s,da),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:us!==null?{id:Va,overflow:Ha}:null,retryLane:536870912,hydrationErrors:null},h=wS(s),h.return=u,u.child=h,er=u,en=null)):s=null,s===null)throw fs(u);return u.lanes=536870912,null}return hh(u,g)}var k=s.memoizedState;if(k!==null){var O=k.dehydrated;if(Jm(u),E)if(u.flags&256)u.flags&=-257,u=zE(s,u,h);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Rn||Io(s,u,h,!1),E=(h&s.childLanes)!==0,Rn||E){if(g=Gt,g!==null&&(O=vn(g,h),O!==0&&O!==k.retryLane))throw k.retryLane=O,Nl(s,O),_r(g,s,O),bg;Ch(),u=zE(s,u,h)}else s=k.treeContext,en=va(O.nextSibling),er=u,kt=!0,cs=null,da=!1,s!==null&&CS(u,s),u=hh(u,g),u.flags|=4096;return u}return s=gi(s.child,{mode:g.mode,children:g.children}),s.ref=u.ref,u.child=s,s.return=u,s}function vh(s,u){var h=u.ref;if(h===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(u.flags|=4194816)}}function wg(s,u,h,g,E){return Dl(u),h=tg(s,u,h,g,void 0,E),g=ng(),s!==null&&!Rn?(rg(s,u,E),Ei(s,u,E)):(kt&&g&&Bm(u),u.flags|=1,nr(s,u,h,E),u.child)}function IE(s,u,h,g,E,k){return Dl(u),u.updateQueue=null,h=US(u,g,h,E),qS(s),g=ng(),s!==null&&!Rn?(rg(s,u,k),Ei(s,u,k)):(kt&&g&&Bm(u),u.flags|=1,nr(s,u,h,k),u.child)}function FE(s,u,h,g,E){if(Dl(u),u.stateNode===null){var k=_o,O=h.contextType;typeof O=="object"&&O!==null&&(k=tr(O)),k=new h(g,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=yg,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=g,k.state=u.memoizedState,k.refs={},Km(u),O=h.contextType,k.context=typeof O=="object"&&O!==null?tr(O):_o,k.state=u.memoizedState,O=h.getDerivedStateFromProps,typeof O=="function"&&(gg(u,h,O,g),k.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(O=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),O!==k.state&&yg.enqueueReplaceState(k,k.state,null),Bc(u,g,k,E),_c(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(s===null){k=u.stateNode;var $=u.memoizedProps,W=Pl(h,$);k.props=W;var ce=k.context,be=h.contextType;O=_o,typeof be=="object"&&be!==null&&(O=tr(be));var Ee=h.getDerivedStateFromProps;be=typeof Ee=="function"||typeof k.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,be||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||($||ce!==O)&&kE(u,k,g,O),hs=!1;var ve=u.memoizedState;k.state=ve,Bc(u,g,k,E),_c(),ce=u.memoizedState,$||ve!==ce||hs?(typeof Ee=="function"&&(gg(u,h,Ee,g),ce=u.memoizedState),(W=hs||TE(u,h,W,g,ve,ce,O))?(be||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=ce),k.props=g,k.state=ce,k.context=O,g=W):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{k=u.stateNode,Ym(s,u),O=u.memoizedProps,be=Pl(h,O),k.props=be,Ee=u.pendingProps,ve=k.context,ce=h.contextType,W=_o,typeof ce=="object"&&ce!==null&&(W=tr(ce)),$=h.getDerivedStateFromProps,(ce=typeof $=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(O!==Ee||ve!==W)&&kE(u,k,g,W),hs=!1,ve=u.memoizedState,k.state=ve,Bc(u,g,k,E),_c();var me=u.memoizedState;O!==Ee||ve!==me||hs||s!==null&&s.dependencies!==null&&Xd(s.dependencies)?(typeof $=="function"&&(gg(u,h,$,g),me=u.memoizedState),(be=hs||TE(u,h,be,g,ve,me,W)||s!==null&&s.dependencies!==null&&Xd(s.dependencies))?(ce||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,me,W),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,me,W)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=me),k.props=g,k.state=me,k.context=W,g=be):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),g=!1)}return k=g,vh(s,u),g=(u.flags&128)!==0,k||g?(k=u.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&g?(u.child=_l(u,s.child,null,E),u.child=_l(u,null,h,E)):nr(s,u,h,E),u.memoizedState=k.state,s=u.child):s=Ei(s,u,E),s}function qE(s,u,h,g){return Rl(),u.flags|=256,nr(s,u,h,g),u.child}var Sg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Eg(s){return{baseLanes:s,cachePool:jS()}}function Cg(s,u,h){return s=s!==null?s.childLanes&~h:0,u&&(s|=Xr),s}function UE(s,u,h){var g=u.pendingProps,E=!1,k=(u.flags&128)!==0,O;if((O=k)||(O=s!==null&&s.memoizedState===null?!1:(Sn.current&2)!==0),O&&(E=!0,u.flags&=-129),O=(u.flags&32)!==0,u.flags&=-33,s===null){if(kt){if(E?ms(u):gs(),(s=en)?(s=Q2(s,da),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:us!==null?{id:Va,overflow:Ha}:null,retryLane:536870912,hydrationErrors:null},h=wS(s),h.return=u,u.child=h,er=u,en=null)):s=null,s===null)throw fs(u);return sy(s)?u.lanes=32:u.lanes=536870912,null}var $=g.children;return g=g.fallback,E?(gs(),E=u.mode,$=ph({mode:"hidden",children:$},E),g=Al(g,E,h,null),$.return=u,g.return=u,$.sibling=g,u.child=$,g=u.child,g.memoizedState=Eg(h),g.childLanes=Cg(s,O,h),u.memoizedState=Sg,qc(null,g)):(ms(u),Tg(u,$))}var W=s.memoizedState;if(W!==null&&($=W.dehydrated,$!==null)){if(k)u.flags&256?(ms(u),u.flags&=-257,u=kg(s,u,h)):u.memoizedState!==null?(gs(),u.child=s.child,u.flags|=128,u=null):(gs(),$=g.fallback,E=u.mode,g=ph({mode:"visible",children:g.children},E),$=Al($,E,h,null),$.flags|=2,g.return=u,$.return=u,g.sibling=$,u.child=g,_l(u,s.child,null,h),g=u.child,g.memoizedState=Eg(h),g.childLanes=Cg(s,O,h),u.memoizedState=Sg,u=qc(null,g));else if(ms(u),sy($)){if(O=$.nextSibling&&$.nextSibling.dataset,O)var ce=O.dgst;O=ce,g=Error(r(419)),g.stack="",g.digest=O,Rc({value:g,source:null,stack:null}),u=kg(s,u,h)}else if(Rn||Io(s,u,h,!1),O=(h&s.childLanes)!==0,Rn||O){if(O=Gt,O!==null&&(g=vn(O,h),g!==0&&g!==W.retryLane))throw W.retryLane=g,Nl(s,g),_r(O,s,g),bg;iy($)||Ch(),u=kg(s,u,h)}else iy($)?(u.flags|=192,u.child=s.child,u=null):(s=W.treeContext,en=va($.nextSibling),er=u,kt=!0,cs=null,da=!1,s!==null&&CS(u,s),u=Tg(u,g.children),u.flags|=4096);return u}return E?(gs(),$=g.fallback,E=u.mode,W=s.child,ce=W.sibling,g=gi(W,{mode:"hidden",children:g.children}),g.subtreeFlags=W.subtreeFlags&65011712,ce!==null?$=gi(ce,$):($=Al($,E,h,null),$.flags|=2),$.return=u,g.return=u,g.sibling=$,u.child=g,qc(null,g),g=u.child,$=s.child.memoizedState,$===null?$=Eg(h):(E=$.cachePool,E!==null?(W=Nn._currentValue,E=E.parent!==W?{parent:W,pool:W}:E):E=jS(),$={baseLanes:$.baseLanes|h,cachePool:E}),g.memoizedState=$,g.childLanes=Cg(s,O,h),u.memoizedState=Sg,qc(s.child,g)):(ms(u),h=s.child,s=h.sibling,h=gi(h,{mode:"visible",children:g.children}),h.return=u,h.sibling=null,s!==null&&(O=u.deletions,O===null?(u.deletions=[s],u.flags|=16):O.push(s)),u.child=h,u.memoizedState=null,h)}function Tg(s,u){return u=ph({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function ph(s,u){return s=Gr(22,s,null,u),s.lanes=0,s}function kg(s,u,h){return _l(u,s.child,null,h),s=Tg(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function VE(s,u,h){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u),qm(s.return,u,h)}function Ng(s,u,h,g,E,k){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:E,treeForkCount:k}:(O.isBackwards=u,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=h,O.tailMode=E,O.treeForkCount=k)}function HE(s,u,h){var g=u.pendingProps,E=g.revealOrder,k=g.tail;g=g.children;var O=Sn.current,$=(O&2)!==0;if($?(O=O&1|2,u.flags|=128):O&=1,U(Sn,O),nr(s,u,g,h),g=kt?Ac:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&VE(s,h,u);else if(s.tag===19)VE(s,h,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(h=u.child,E=null;h!==null;)s=h.alternate,s!==null&&rh(s)===null&&(E=h),h=h.sibling;h=E,h===null?(E=u.child,u.child=null):(E=h.sibling,h.sibling=null),Ng(u,!1,E,h,k,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,E=u.child,u.child=null;E!==null;){if(s=E.alternate,s!==null&&rh(s)===null){u.child=E;break}s=E.sibling,E.sibling=h,h=E,E=s}Ng(u,!0,h,null,k,g);break;case"together":Ng(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function Ei(s,u,h){if(s!==null&&(u.dependencies=s.dependencies),bs|=u.lanes,(h&u.childLanes)===0)if(s!==null){if(Io(s,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,h=gi(s,s.pendingProps),u.child=h,h.return=u;s.sibling!==null;)s=s.sibling,h=h.sibling=gi(s,s.pendingProps),h.return=u;h.sibling=null}return u.child}function Ag(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Xd(s)))}function K5(s,u,h){switch(u.tag){case 3:we(u,u.stateNode.containerInfo),ds(u,Nn,s.memoizedState.cache),Rl();break;case 27:case 5:J(u);break;case 4:we(u,u.stateNode.containerInfo);break;case 10:ds(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Jm(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(ms(u),u.flags|=128,null):(h&u.child.childLanes)!==0?UE(s,u,h):(ms(u),s=Ei(s,u,h),s!==null?s.sibling:null);ms(u);break;case 19:var E=(s.flags&128)!==0;if(g=(h&u.childLanes)!==0,g||(Io(s,u,h,!1),g=(h&u.childLanes)!==0),E){if(g)return HE(s,u,h);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),U(Sn,Sn.current),g)break;return null;case 22:return u.lanes=0,BE(s,u,h,u.pendingProps);case 24:ds(u,Nn,s.memoizedState.cache)}return Ei(s,u,h)}function GE(s,u,h){if(s!==null)if(s.memoizedProps!==u.pendingProps)Rn=!0;else{if(!Ag(s,h)&&(u.flags&128)===0)return Rn=!1,K5(s,u,h);Rn=(s.flags&131072)!==0}else Rn=!1,kt&&(u.flags&1048576)!==0&&ES(u,Ac,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(s=Ol(u.elementType),u.type=s,typeof s=="function")Om(s)?(g=Pl(s,g),u.tag=1,u=FE(null,u,s,g,h)):(u.tag=0,u=wg(null,u,s,g,h));else{if(s!=null){var E=s.$$typeof;if(E===N){u.tag=11,u=OE(null,u,s,g,h);break e}else if(E===D){u.tag=14,u=LE(null,u,s,g,h);break e}}throw u=I(s)||s,Error(r(306,u,""))}}return u;case 0:return wg(s,u,u.type,u.pendingProps,h);case 1:return g=u.type,E=Pl(g,u.pendingProps),FE(s,u,g,E,h);case 3:e:{if(we(u,u.stateNode.containerInfo),s===null)throw Error(r(387));g=u.pendingProps;var k=u.memoizedState;E=k.element,Ym(s,u),Bc(u,g,null,h);var O=u.memoizedState;if(g=O.cache,ds(u,Nn,g),g!==k.cache&&Um(u,[Nn],h,!0),_c(),g=O.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:O.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=qE(s,u,g,h);break e}else if(g!==E){E=ua(Error(r(424)),u),Rc(E),u=qE(s,u,g,h);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(en=va(s.firstChild),er=u,kt=!0,cs=null,da=!0,h=BS(u,null,g,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Rl(),g===E){u=Ei(s,u,h);break e}nr(s,u,g,h)}u=u.child}return u;case 26:return vh(s,u),s===null?(h=nC(u.type,null,u.pendingProps,null))?u.memoizedState=h:kt||(h=u.type,s=u.pendingProps,g=Dh(oe.current).createElement(h),g[an]=u,g[_n]=s,rr(g,h,s),kn(g),u.stateNode=g):u.memoizedState=nC(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return J(u),s===null&&kt&&(g=u.stateNode=J2(u.type,u.pendingProps,oe.current),er=u,da=!0,E=en,Ts(u.type)?(ly=E,en=va(g.firstChild)):en=E),nr(s,u,u.pendingProps.children,h),vh(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&kt&&((E=g=en)&&(g=E3(g,u.type,u.pendingProps,da),g!==null?(u.stateNode=g,er=u,en=va(g.firstChild),da=!1,E=!0):E=!1),E||fs(u)),J(u),E=u.type,k=u.pendingProps,O=s!==null?s.memoizedProps:null,g=k.children,ny(E,k)?g=null:O!==null&&ny(E,O)&&(u.flags|=32),u.memoizedState!==null&&(E=tg(s,u,z5,null,null,h),nf._currentValue=E),vh(s,u),nr(s,u,g,h),u.child;case 6:return s===null&&kt&&((s=h=en)&&(h=C3(h,u.pendingProps,da),h!==null?(u.stateNode=h,er=u,en=null,s=!0):s=!1),s||fs(u)),null;case 13:return UE(s,u,h);case 4:return we(u,u.stateNode.containerInfo),g=u.pendingProps,s===null?u.child=_l(u,null,g,h):nr(s,u,g,h),u.child;case 11:return OE(s,u,u.type,u.pendingProps,h);case 7:return nr(s,u,u.pendingProps,h),u.child;case 8:return nr(s,u,u.pendingProps.children,h),u.child;case 12:return nr(s,u,u.pendingProps.children,h),u.child;case 10:return g=u.pendingProps,ds(u,u.type,g.value),nr(s,u,g.children,h),u.child;case 9:return E=u.type._context,g=u.pendingProps.children,Dl(u),E=tr(E),g=g(E),u.flags|=1,nr(s,u,g,h),u.child;case 14:return LE(s,u,u.type,u.pendingProps,h);case 15:return _E(s,u,u.type,u.pendingProps,h);case 19:return HE(s,u,h);case 31:return $5(s,u,h);case 22:return BE(s,u,h,u.pendingProps);case 24:return Dl(u),g=tr(Nn),s===null?(E=Gm(),E===null&&(E=Gt,k=Vm(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=h),E=k),u.memoizedState={parent:g,cache:E},Km(u),ds(u,Nn,E)):((s.lanes&h)!==0&&(Ym(s,u),Bc(u,null,null,h),_c()),E=s.memoizedState,k=u.memoizedState,E.parent!==g?(E={parent:g,cache:g},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),ds(u,Nn,g)):(g=k.cache,ds(u,Nn,g),g!==E.cache&&Um(u,[Nn],h,!0))),nr(s,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Ci(s){s.flags|=4}function Rg(s,u,h,g,E){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(y2())s.flags|=8192;else throw Ll=Jd,$m}else s.flags&=-16777217}function $E(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!lC(u))if(y2())s.flags|=8192;else throw Ll=Jd,$m}function mh(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?ht():536870912,s.lanes|=u,Wo|=u)}function Uc(s,u){if(!kt)switch(s.tailMode){case"hidden":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function tn(s){var u=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(u)for(var E=s.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=g,s.childLanes=h,u}function Y5(s,u,h){var g=u.pendingProps;switch(Pm(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(u),null;case 1:return tn(u),null;case 3:return h=u.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),bi(Nn),fe(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(zo(u)?Ci(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Im())),tn(u),null;case 26:var E=u.type,k=u.memoizedState;return s===null?(Ci(u),k!==null?(tn(u),$E(u,k)):(tn(u),Rg(u,E,null,g,h))):k?k!==s.memoizedState?(Ci(u),tn(u),$E(u,k)):(tn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==g&&Ci(u),tn(u),Rg(u,E,s,g,h)),null;case 27:if(ne(u),h=oe.current,E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&Ci(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return tn(u),null}s=te.current,zo(u)?TS(u):(s=J2(E,g,h),u.stateNode=s,Ci(u))}return tn(u),null;case 5:if(ne(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&Ci(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return tn(u),null}if(k=te.current,zo(u))TS(u);else{var O=Dh(oe.current);switch(k){case 1:k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=O.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=O.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?O.createElement(E,{is:g.is}):O.createElement(E)}}k[an]=u,k[_n]=g;e:for(O=u.child;O!==null;){if(O.tag===5||O.tag===6)k.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===u)break e;for(;O.sibling===null;){if(O.return===null||O.return===u)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}u.stateNode=k;e:switch(rr(k,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ci(u)}}return tn(u),Rg(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,h),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==g&&Ci(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(s=oe.current,zo(u)){if(s=u.stateNode,h=u.memoizedProps,g=null,E=er,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}s[an]=u,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||U2(s.nodeValue,h)),s||fs(u,!0)}else s=Dh(s).createTextNode(g),s[an]=u,u.stateNode=s}return tn(u),null;case 31:if(h=u.memoizedState,s===null||s.memoizedState!==null){if(g=zo(u),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[an]=u}else Rl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;tn(u),s=!1}else h=Im(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return u.flags&256?(Kr(u),u):(Kr(u),null);if((u.flags&128)!==0)throw Error(r(558))}return tn(u),null;case 13:if(g=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=zo(u),g!==null&&g.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[an]=u}else Rl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;tn(u),E=!1}else E=Im(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(Kr(u),u):(Kr(u),null)}return Kr(u),(u.flags&128)!==0?(u.lanes=h,u):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=u.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==E&&(g.flags|=2048)),h!==s&&h&&(u.child.flags|=8192),mh(u,u.updateQueue),tn(u),null);case 4:return fe(),s===null&&Wg(u.stateNode.containerInfo),tn(u),null;case 10:return bi(u.type),tn(u),null;case 19:if(X(Sn),g=u.memoizedState,g===null)return tn(u),null;if(E=(u.flags&128)!==0,k=g.rendering,k===null)if(E)Uc(g,!1);else{if(mn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=rh(s),k!==null){for(u.flags|=128,Uc(g,!1),s=k.updateQueue,u.updateQueue=s,mh(u,s),u.subtreeFlags=0,s=h,h=u.child;h!==null;)bS(h,s),h=h.sibling;return U(Sn,Sn.current&1|2),kt&&yi(u,g.treeForkCount),u.child}s=s.sibling}g.tail!==null&&Pe()>wh&&(u.flags|=128,E=!0,Uc(g,!1),u.lanes=4194304)}else{if(!E)if(s=rh(k),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,mh(u,s),Uc(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!kt)return tn(u),null}else 2*Pe()-g.renderingStartTime>wh&&h!==536870912&&(u.flags|=128,E=!0,Uc(g,!1),u.lanes=4194304);g.isBackwards?(k.sibling=u.child,u.child=k):(s=g.last,s!==null?s.sibling=k:u.child=k,g.last=k)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Pe(),s.sibling=null,h=Sn.current,U(Sn,E?h&1|2:h&1),kt&&yi(u,g.treeForkCount),s):(tn(u),null);case 22:case 23:return Kr(u),Zm(),g=u.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(h&536870912)!==0&&(u.flags&128)===0&&(tn(u),u.subtreeFlags&6&&(u.flags|=8192)):tn(u),h=u.updateQueue,h!==null&&mh(u,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048),s!==null&&X(Ml),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),bi(Nn),tn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function X5(s,u){switch(Pm(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return bi(Nn),fe(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return ne(u),null;case 31:if(u.memoizedState!==null){if(Kr(u),u.alternate===null)throw Error(r(340));Rl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(Kr(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Rl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return X(Sn),null;case 4:return fe(),null;case 10:return bi(u.type),null;case 22:case 23:return Kr(u),Zm(),s!==null&&X(Ml),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return bi(Nn),null;case 25:return null;default:return null}}function KE(s,u){switch(Pm(u),u.tag){case 3:bi(Nn),fe();break;case 26:case 27:case 5:ne(u);break;case 4:fe();break;case 31:u.memoizedState!==null&&Kr(u);break;case 13:Kr(u);break;case 19:X(Sn);break;case 10:bi(u.type);break;case 22:case 23:Kr(u),Zm(),s!==null&&X(Ml);break;case 24:bi(Nn)}}function Vc(s,u){try{var h=u.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var E=g.next;h=E;do{if((h.tag&s)===s){g=void 0;var k=h.create,O=h.inst;g=k(),O.destroy=g}h=h.next}while(h!==E)}}catch($){It(u,u.return,$)}}function ys(s,u,h){try{var g=u.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var k=E.next;g=k;do{if((g.tag&s)===s){var O=g.inst,$=O.destroy;if($!==void 0){O.destroy=void 0,E=u;var W=h,ce=$;try{ce()}catch(be){It(E,W,be)}}}g=g.next}while(g!==k)}}catch(be){It(u,u.return,be)}}function YE(s){var u=s.updateQueue;if(u!==null){var h=s.stateNode;try{zS(u,h)}catch(g){It(s,s.return,g)}}}function XE(s,u,h){h.props=Pl(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){It(s,u,g)}}function Hc(s,u){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(E){It(s,u,E)}}function Ga(s,u){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(E){It(s,u,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(E){It(s,u,E)}else h.current=null}function QE(s){var u=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(E){It(s,s.return,E)}}function jg(s,u,h){try{var g=s.stateNode;g3(g,s.type,h,u),g[_n]=u}catch(E){It(s,s.return,E)}}function WE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ts(s.type)||s.tag===4}function Dg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||WE(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ts(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Mg(s,u,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(s),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=pi));else if(g!==4&&(g===27&&Ts(s.type)&&(h=s.stateNode,u=null),s=s.child,s!==null))for(Mg(s,u,h),s=s.sibling;s!==null;)Mg(s,u,h),s=s.sibling}function gh(s,u,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?h.insertBefore(s,u):h.appendChild(s);else if(g!==4&&(g===27&&Ts(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(gh(s,u,h),s=s.sibling;s!==null;)gh(s,u,h),s=s.sibling}function ZE(s){var u=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);rr(u,g,h),u[an]=s,u[_n]=h}catch(k){It(s,s.return,k)}}var Ti=!1,jn=!1,Og=!1,JE=typeof WeakSet=="function"?WeakSet:Set,Kn=null;function Q5(s,u){if(s=s.containerInfo,ey=zh,s=fS(s),km(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var E=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var O=0,$=-1,W=-1,ce=0,be=0,Ee=s,ve=null;t:for(;;){for(var me;Ee!==h||E!==0&&Ee.nodeType!==3||($=O+E),Ee!==k||g!==0&&Ee.nodeType!==3||(W=O+g),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)ve=Ee,Ee=me;for(;;){if(Ee===s)break t;if(ve===h&&++ce===E&&($=O),ve===k&&++be===g&&(W=O),(me=Ee.nextSibling)!==null)break;Ee=ve,ve=Ee.parentNode}Ee=me}h=$===-1||W===-1?null:{start:$,end:W}}else h=null}h=h||{start:0,end:0}}else h=null;for(ty={focusedElem:s,selectionRange:h},zh=!1,Kn=u;Kn!==null;)if(u=Kn,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Kn=s;else for(;Kn!==null;){switch(u=Kn,k=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)E=s[h],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,h=u,E=k.memoizedProps,k=k.memoizedState,g=h.stateNode;try{var Ve=Pl(h.type,E);s=g.getSnapshotBeforeUpdate(Ve,k),g.__reactInternalSnapshotBeforeUpdate=s}catch(at){It(h,h.return,at)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,h=s.nodeType,h===9)ay(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":ay(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,Kn=s;break}Kn=u.return}}function e2(s,u,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Ni(s,h),g&4&&Vc(5,h);break;case 1:if(Ni(s,h),g&4)if(s=h.stateNode,u===null)try{s.componentDidMount()}catch(O){It(h,h.return,O)}else{var E=Pl(h.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(O){It(h,h.return,O)}}g&64&&YE(h),g&512&&Hc(h,h.return);break;case 3:if(Ni(s,h),g&64&&(s=h.updateQueue,s!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{zS(s,u)}catch(O){It(h,h.return,O)}}break;case 27:u===null&&g&4&&ZE(h);case 26:case 5:Ni(s,h),u===null&&g&4&&QE(h),g&512&&Hc(h,h.return);break;case 12:Ni(s,h);break;case 31:Ni(s,h),g&4&&r2(s,h);break;case 13:Ni(s,h),g&4&&a2(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=i3.bind(null,h),T3(s,h))));break;case 22:if(g=h.memoizedState!==null||Ti,!g){u=u!==null&&u.memoizedState!==null||jn,E=Ti;var k=jn;Ti=g,(jn=u)&&!k?Ai(s,h,(h.subtreeFlags&8772)!==0):Ni(s,h),Ti=E,jn=k}break;case 30:break;default:Ni(s,h)}}function t2(s){var u=s.alternate;u!==null&&(s.alternate=null,t2(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&To(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var sn=null,Dr=!1;function ki(s,u,h){for(h=h.child;h!==null;)n2(s,u,h),h=h.sibling}function n2(s,u,h){if(le&&typeof le.onCommitFiberUnmount=="function")try{le.onCommitFiberUnmount(K,h)}catch{}switch(h.tag){case 26:jn||Ga(h,u),ki(s,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:jn||Ga(h,u);var g=sn,E=Dr;Ts(h.type)&&(sn=h.stateNode,Dr=!1),ki(s,u,h),Jc(h.stateNode),sn=g,Dr=E;break;case 5:jn||Ga(h,u);case 6:if(g=sn,E=Dr,sn=null,ki(s,u,h),sn=g,Dr=E,sn!==null)if(Dr)try{(sn.nodeType===9?sn.body:sn.nodeName==="HTML"?sn.ownerDocument.body:sn).removeChild(h.stateNode)}catch(k){It(h,u,k)}else try{sn.removeChild(h.stateNode)}catch(k){It(h,u,k)}break;case 18:sn!==null&&(Dr?(s=sn,Y2(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),iu(s)):Y2(sn,h.stateNode));break;case 4:g=sn,E=Dr,sn=h.stateNode.containerInfo,Dr=!0,ki(s,u,h),sn=g,Dr=E;break;case 0:case 11:case 14:case 15:ys(2,h,u),jn||ys(4,h,u),ki(s,u,h);break;case 1:jn||(Ga(h,u),g=h.stateNode,typeof g.componentWillUnmount=="function"&&XE(h,u,g)),ki(s,u,h);break;case 21:ki(s,u,h);break;case 22:jn=(g=jn)||h.memoizedState!==null,ki(s,u,h),jn=g;break;default:ki(s,u,h)}}function r2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{iu(s)}catch(h){It(u,u.return,h)}}}function a2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{iu(s)}catch(h){It(u,u.return,h)}}function W5(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new JE),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new JE),u;default:throw Error(r(435,s.tag))}}function yh(s,u){var h=W5(s);u.forEach(function(g){if(!h.has(g)){h.add(g);var E=s3.bind(null,s,g);g.then(E,E)}})}function Mr(s,u){var h=u.deletions;if(h!==null)for(var g=0;g<h.length;g++){var E=h[g],k=s,O=u,$=O;e:for(;$!==null;){switch($.tag){case 27:if(Ts($.type)){sn=$.stateNode,Dr=!1;break e}break;case 5:sn=$.stateNode,Dr=!1;break e;case 3:case 4:sn=$.stateNode.containerInfo,Dr=!0;break e}$=$.return}if(sn===null)throw Error(r(160));n2(k,O,E),sn=null,Dr=!1,k=E.alternate,k!==null&&(k.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)i2(u,s),u=u.sibling}var Na=null;function i2(s,u){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Mr(u,s),Or(s),g&4&&(ys(3,s,s.return),Vc(3,s),ys(5,s,s.return));break;case 1:Mr(u,s),Or(s),g&512&&(jn||h===null||Ga(h,h.return)),g&64&&Ti&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var E=Na;if(Mr(u,s),Or(s),g&512&&(jn||h===null||Ga(h,h.return)),g&4){var k=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":k=E.getElementsByTagName("title")[0],(!k||k[Gn]||k[an]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=E.createElement(g),E.head.insertBefore(k,E.querySelector("head > title"))),rr(k,g,h),k[an]=s,kn(k),g=k;break e;case"link":var O=iC("link","href",E).get(g+(h.href||""));if(O){for(var $=0;$<O.length;$++)if(k=O[$],k.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&k.getAttribute("rel")===(h.rel==null?null:h.rel)&&k.getAttribute("title")===(h.title==null?null:h.title)&&k.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){O.splice($,1);break t}}k=E.createElement(g),rr(k,g,h),E.head.appendChild(k);break;case"meta":if(O=iC("meta","content",E).get(g+(h.content||""))){for($=0;$<O.length;$++)if(k=O[$],k.getAttribute("content")===(h.content==null?null:""+h.content)&&k.getAttribute("name")===(h.name==null?null:h.name)&&k.getAttribute("property")===(h.property==null?null:h.property)&&k.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&k.getAttribute("charset")===(h.charSet==null?null:h.charSet)){O.splice($,1);break t}}k=E.createElement(g),rr(k,g,h),E.head.appendChild(k);break;default:throw Error(r(468,g))}k[an]=s,kn(k),g=k}s.stateNode=g}else sC(E,s.type,s.stateNode);else s.stateNode=aC(E,g,s.memoizedProps);else k!==g?(k===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):k.count--,g===null?sC(E,s.type,s.stateNode):aC(E,g,s.memoizedProps)):g===null&&s.stateNode!==null&&jg(s,s.memoizedProps,h.memoizedProps)}break;case 27:Mr(u,s),Or(s),g&512&&(jn||h===null||Ga(h,h.return)),h!==null&&g&4&&jg(s,s.memoizedProps,h.memoizedProps);break;case 5:if(Mr(u,s),Or(s),g&512&&(jn||h===null||Ga(h,h.return)),s.flags&32){E=s.stateNode;try{Ao(E,"")}catch(Ve){It(s,s.return,Ve)}}g&4&&s.stateNode!=null&&(E=s.memoizedProps,jg(s,E,h!==null?h.memoizedProps:E)),g&1024&&(Og=!0);break;case 6:if(Mr(u,s),Or(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Ve){It(s,s.return,Ve)}}break;case 3:if(Lh=null,E=Na,Na=Mh(u.containerInfo),Mr(u,s),Na=E,Or(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{iu(u.containerInfo)}catch(Ve){It(s,s.return,Ve)}Og&&(Og=!1,s2(s));break;case 4:g=Na,Na=Mh(s.stateNode.containerInfo),Mr(u,s),Or(s),Na=g;break;case 12:Mr(u,s),Or(s);break;case 31:Mr(u,s),Or(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,yh(s,g)));break;case 13:Mr(u,s),Or(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(bh=Pe()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,yh(s,g)));break;case 22:E=s.memoizedState!==null;var W=h!==null&&h.memoizedState!==null,ce=Ti,be=jn;if(Ti=ce||E,jn=be||W,Mr(u,s),jn=be,Ti=ce,Or(s),g&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(h===null||W||Ti||jn||zl(s)),h=null,u=s;;){if(u.tag===5||u.tag===26){if(h===null){W=h=u;try{if(k=W.stateNode,E)O=k.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{$=W.stateNode;var Ee=W.memoizedProps.style,ve=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;$.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Ve){It(W,W.return,Ve)}}}else if(u.tag===6){if(h===null){W=u;try{W.stateNode.nodeValue=E?"":W.memoizedProps}catch(Ve){It(W,W.return,Ve)}}}else if(u.tag===18){if(h===null){W=u;try{var me=W.stateNode;E?X2(me,!0):X2(W.stateNode,!1)}catch(Ve){It(W,W.return,Ve)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,yh(s,h))));break;case 19:Mr(u,s),Or(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,yh(s,g)));break;case 30:break;case 21:break;default:Mr(u,s),Or(s)}}function Or(s){var u=s.flags;if(u&2){try{for(var h,g=s.return;g!==null;){if(WE(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var E=h.stateNode,k=Dg(s);gh(s,k,E);break;case 5:var O=h.stateNode;h.flags&32&&(Ao(O,""),h.flags&=-33);var $=Dg(s);gh(s,$,O);break;case 3:case 4:var W=h.stateNode.containerInfo,ce=Dg(s);Mg(s,ce,W);break;default:throw Error(r(161))}}catch(be){It(s,s.return,be)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function s2(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;s2(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Ni(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)e2(s,u.alternate,u),u=u.sibling}function zl(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:ys(4,u,u.return),zl(u);break;case 1:Ga(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&XE(u,u.return,h),zl(u);break;case 27:Jc(u.stateNode);case 26:case 5:Ga(u,u.return),zl(u);break;case 22:u.memoizedState===null&&zl(u);break;case 30:zl(u);break;default:zl(u)}s=s.sibling}}function Ai(s,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,E=s,k=u,O=k.flags;switch(k.tag){case 0:case 11:case 15:Ai(E,k,h),Vc(4,k);break;case 1:if(Ai(E,k,h),g=k,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(ce){It(g,g.return,ce)}if(g=k,E=g.updateQueue,E!==null){var $=g.stateNode;try{var W=E.shared.hiddenCallbacks;if(W!==null)for(E.shared.hiddenCallbacks=null,E=0;E<W.length;E++)PS(W[E],$)}catch(ce){It(g,g.return,ce)}}h&&O&64&&YE(k),Hc(k,k.return);break;case 27:ZE(k);case 26:case 5:Ai(E,k,h),h&&g===null&&O&4&&QE(k),Hc(k,k.return);break;case 12:Ai(E,k,h);break;case 31:Ai(E,k,h),h&&O&4&&r2(E,k);break;case 13:Ai(E,k,h),h&&O&4&&a2(E,k);break;case 22:k.memoizedState===null&&Ai(E,k,h),Hc(k,k.return);break;case 30:break;default:Ai(E,k,h)}u=u.sibling}}function Lg(s,u){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&jc(h))}function _g(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&jc(s))}function Aa(s,u,h,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)l2(s,u,h,g),u=u.sibling}function l2(s,u,h,g){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Aa(s,u,h,g),E&2048&&Vc(9,u);break;case 1:Aa(s,u,h,g);break;case 3:Aa(s,u,h,g),E&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&jc(s)));break;case 12:if(E&2048){Aa(s,u,h,g),s=u.stateNode;try{var k=u.memoizedProps,O=k.id,$=k.onPostCommit;typeof $=="function"&&$(O,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(W){It(u,u.return,W)}}else Aa(s,u,h,g);break;case 31:Aa(s,u,h,g);break;case 13:Aa(s,u,h,g);break;case 23:break;case 22:k=u.stateNode,O=u.alternate,u.memoizedState!==null?k._visibility&2?Aa(s,u,h,g):Gc(s,u):k._visibility&2?Aa(s,u,h,g):(k._visibility|=2,Yo(s,u,h,g,(u.subtreeFlags&10256)!==0||!1)),E&2048&&Lg(O,u);break;case 24:Aa(s,u,h,g),E&2048&&_g(u.alternate,u);break;default:Aa(s,u,h,g)}}function Yo(s,u,h,g,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,O=u,$=h,W=g,ce=O.flags;switch(O.tag){case 0:case 11:case 15:Yo(k,O,$,W,E),Vc(8,O);break;case 23:break;case 22:var be=O.stateNode;O.memoizedState!==null?be._visibility&2?Yo(k,O,$,W,E):Gc(k,O):(be._visibility|=2,Yo(k,O,$,W,E)),E&&ce&2048&&Lg(O.alternate,O);break;case 24:Yo(k,O,$,W,E),E&&ce&2048&&_g(O.alternate,O);break;default:Yo(k,O,$,W,E)}u=u.sibling}}function Gc(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=s,g=u,E=g.flags;switch(g.tag){case 22:Gc(h,g),E&2048&&Lg(g.alternate,g);break;case 24:Gc(h,g),E&2048&&_g(g.alternate,g);break;default:Gc(h,g)}u=u.sibling}}var $c=8192;function Xo(s,u,h){if(s.subtreeFlags&$c)for(s=s.child;s!==null;)o2(s,u,h),s=s.sibling}function o2(s,u,h){switch(s.tag){case 26:Xo(s,u,h),s.flags&$c&&s.memoizedState!==null&&P3(h,Na,s.memoizedState,s.memoizedProps);break;case 5:Xo(s,u,h);break;case 3:case 4:var g=Na;Na=Mh(s.stateNode.containerInfo),Xo(s,u,h),Na=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=$c,$c=16777216,Xo(s,u,h),$c=g):Xo(s,u,h));break;default:Xo(s,u,h)}}function u2(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function Kc(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];Kn=g,f2(g,s)}u2(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)c2(s),s=s.sibling}function c2(s){switch(s.tag){case 0:case 11:case 15:Kc(s),s.flags&2048&&ys(9,s,s.return);break;case 3:Kc(s);break;case 12:Kc(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,xh(s)):Kc(s);break;default:Kc(s)}}function xh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];Kn=g,f2(g,s)}u2(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:ys(8,u,u.return),xh(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,xh(u));break;default:xh(u)}s=s.sibling}}function f2(s,u){for(;Kn!==null;){var h=Kn;switch(h.tag){case 0:case 11:case 15:ys(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:jc(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Kn=g;else e:for(h=s;Kn!==null;){g=Kn;var E=g.sibling,k=g.return;if(t2(g),g===h){Kn=null;break e}if(E!==null){E.return=k,Kn=E;break e}Kn=k}}}var Z5={getCacheForType:function(s){var u=tr(Nn),h=u.data.get(s);return h===void 0&&(h=s(),u.data.set(s,h)),h},cacheSignal:function(){return tr(Nn).controller.signal}},J5=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Gt=null,wt=null,Ct=0,zt=0,Yr=null,xs=!1,Qo=!1,Bg=!1,Ri=0,mn=0,bs=0,Il=0,Pg=0,Xr=0,Wo=0,Yc=null,Lr=null,zg=!1,bh=0,d2=0,wh=1/0,Sh=null,ws=null,Bn=0,Ss=null,Zo=null,ji=0,Ig=0,Fg=null,h2=null,Xc=0,qg=null;function Qr(){return(Lt&2)!==0&&Ct!==0?Ct&-Ct:B.T!==null?Kg():cn()}function v2(){if(Xr===0)if((Ct&536870912)===0||kt){var s=Ie;Ie<<=1,(Ie&3932160)===0&&(Ie=262144),Xr=s}else Xr=536870912;return s=$r.current,s!==null&&(s.flags|=32),Xr}function _r(s,u,h){(s===Gt&&(zt===2||zt===9)||s.cancelPendingCommit!==null)&&(Jo(s,0),Es(s,Ct,Xr,!1)),Ft(s,h),((Lt&2)===0||s!==Gt)&&(s===Gt&&((Lt&2)===0&&(Il|=h),mn===4&&Es(s,Ct,Xr,!1)),$a(s))}function p2(s,u,h){if((Lt&6)!==0)throw Error(r(327));var g=!h&&(u&127)===0&&(u&s.expiredLanes)===0||Ue(s,u),E=g?n3(s,u):Vg(s,u,!0),k=g;do{if(E===0){Qo&&!g&&Es(s,u,0,!1);break}else{if(h=s.current.alternate,k&&!e3(h)){E=Vg(s,u,!1),k=!1;continue}if(E===2){if(k=u,s.errorRecoveryDisabledLanes&k)var O=0;else O=s.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){u=O;e:{var $=s;E=Yc;var W=$.current.memoizedState.isDehydrated;if(W&&(Jo($,O).flags|=256),O=Vg($,O,!1),O!==2){if(Bg&&!W){$.errorRecoveryDisabledLanes|=k,Il|=k,E=4;break e}k=Lr,Lr=E,k!==null&&(Lr===null?Lr=k:Lr.push.apply(Lr,k))}E=O}if(k=!1,E!==2)continue}}if(E===1){Jo(s,0),Es(s,u,0,!0);break}e:{switch(g=s,k=E,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Es(g,u,Xr,!xs);break e;case 2:Lr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=bh+300-Pe(),10<E)){if(Es(g,u,Xr,!xs),ut(g,0,!0)!==0)break e;ji=u,g.timeoutHandle=$2(m2.bind(null,g,h,Lr,Sh,zg,u,Xr,Il,Wo,xs,k,"Throttled",-0,0),E);break e}m2(g,h,Lr,Sh,zg,u,Xr,Il,Wo,xs,k,null,-0,0)}}break}while(!0);$a(s)}function m2(s,u,h,g,E,k,O,$,W,ce,be,Ee,ve,me){if(s.timeoutHandle=-1,Ee=u.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pi},o2(u,k,Ee);var Ve=(k&62914560)===k?bh-Pe():(k&4194048)===k?d2-Pe():0;if(Ve=z3(Ee,Ve),Ve!==null){ji=k,s.cancelPendingCommit=Ve(C2.bind(null,s,u,k,h,g,E,O,$,W,be,Ee,null,ve,me)),Es(s,k,O,!ce);return}}C2(s,u,k,h,g,E,O,$,W)}function e3(s){for(var u=s;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var E=h[g],k=E.getSnapshot;E=E.value;try{if(!Hr(k(),E))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Es(s,u,h,g){u&=~Pg,u&=~Il,s.suspendedLanes|=u,s.pingedLanes&=~u,g&&(s.warmLanes|=u),g=s.expirationTimes;for(var E=u;0<E;){var k=31-de(E),O=1<<k;g[k]=-1,E&=~O}h!==0&&un(s,h,u)}function Eh(){return(Lt&6)===0?(Qc(0),!1):!0}function Ug(){if(wt!==null){if(zt===0)var s=wt.return;else s=wt,xi=jl=null,ag(s),Vo=null,Mc=0,s=wt;for(;s!==null;)KE(s.alternate,s),s=s.return;wt=null}}function Jo(s,u){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,b3(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),ji=0,Ug(),Gt=s,wt=h=gi(s.current,null),Ct=u,zt=0,Yr=null,xs=!1,Qo=Ue(s,u),Bg=!1,Wo=Xr=Pg=Il=bs=mn=0,Lr=Yc=null,zg=!1,(u&8)!==0&&(u|=u&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=u;0<g;){var E=31-de(g),k=1<<E;u|=s[E],g&=~k}return Ri=u,Hd(),h}function g2(s,u){dt=null,B.H=Fc,u===Uo||u===Zd?(u=OS(),zt=3):u===$m?(u=OS(),zt=4):zt=u===bg?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Yr=u,wt===null&&(mn=1,dh(s,ua(u,s.current)))}function y2(){var s=$r.current;return s===null?!0:(Ct&4194048)===Ct?ha===null:(Ct&62914560)===Ct||(Ct&536870912)!==0?s===ha:!1}function x2(){var s=B.H;return B.H=Fc,s===null?Fc:s}function b2(){var s=B.A;return B.A=Z5,s}function Ch(){mn=4,xs||(Ct&4194048)!==Ct&&$r.current!==null||(Qo=!0),(bs&134217727)===0&&(Il&134217727)===0||Gt===null||Es(Gt,Ct,Xr,!1)}function Vg(s,u,h){var g=Lt;Lt|=2;var E=x2(),k=b2();(Gt!==s||Ct!==u)&&(Sh=null,Jo(s,u)),u=!1;var O=mn;e:do try{if(zt!==0&&wt!==null){var $=wt,W=Yr;switch(zt){case 8:Ug(),O=6;break e;case 3:case 2:case 9:case 6:$r.current===null&&(u=!0);var ce=zt;if(zt=0,Yr=null,eu(s,$,W,ce),h&&Qo){O=0;break e}break;default:ce=zt,zt=0,Yr=null,eu(s,$,W,ce)}}t3(),O=mn;break}catch(be){g2(s,be)}while(!0);return u&&s.shellSuspendCounter++,xi=jl=null,Lt=g,B.H=E,B.A=k,wt===null&&(Gt=null,Ct=0,Hd()),O}function t3(){for(;wt!==null;)w2(wt)}function n3(s,u){var h=Lt;Lt|=2;var g=x2(),E=b2();Gt!==s||Ct!==u?(Sh=null,wh=Pe()+500,Jo(s,u)):Qo=Ue(s,u);e:do try{if(zt!==0&&wt!==null){u=wt;var k=Yr;t:switch(zt){case 1:zt=0,Yr=null,eu(s,u,k,1);break;case 2:case 9:if(DS(k)){zt=0,Yr=null,S2(u);break}u=function(){zt!==2&&zt!==9||Gt!==s||(zt=7),$a(s)},k.then(u,u);break e;case 3:zt=7;break e;case 4:zt=5;break e;case 7:DS(k)?(zt=0,Yr=null,S2(u)):(zt=0,Yr=null,eu(s,u,k,7));break;case 5:var O=null;switch(wt.tag){case 26:O=wt.memoizedState;case 5:case 27:var $=wt;if(O?lC(O):$.stateNode.complete){zt=0,Yr=null;var W=$.sibling;if(W!==null)wt=W;else{var ce=$.return;ce!==null?(wt=ce,Th(ce)):wt=null}break t}}zt=0,Yr=null,eu(s,u,k,5);break;case 6:zt=0,Yr=null,eu(s,u,k,6);break;case 8:Ug(),mn=6;break e;default:throw Error(r(462))}}r3();break}catch(be){g2(s,be)}while(!0);return xi=jl=null,B.H=g,B.A=E,Lt=h,wt!==null?0:(Gt=null,Ct=0,Hd(),mn)}function r3(){for(;wt!==null&&!Xe();)w2(wt)}function w2(s){var u=GE(s.alternate,s,Ri);s.memoizedProps=s.pendingProps,u===null?Th(s):wt=u}function S2(s){var u=s,h=u.alternate;switch(u.tag){case 15:case 0:u=IE(h,u,u.pendingProps,u.type,void 0,Ct);break;case 11:u=IE(h,u,u.pendingProps,u.type.render,u.ref,Ct);break;case 5:ag(u);default:KE(h,u),u=wt=bS(u,Ri),u=GE(h,u,Ri)}s.memoizedProps=s.pendingProps,u===null?Th(s):wt=u}function eu(s,u,h,g){xi=jl=null,ag(u),Vo=null,Mc=0;var E=u.return;try{if(G5(s,E,u,h,Ct)){mn=1,dh(s,ua(h,s.current)),wt=null;return}}catch(k){if(E!==null)throw wt=E,k;mn=1,dh(s,ua(h,s.current)),wt=null;return}u.flags&32768?(kt||g===1?s=!0:Qo||(Ct&536870912)!==0?s=!1:(xs=s=!0,(g===2||g===9||g===3||g===6)&&(g=$r.current,g!==null&&g.tag===13&&(g.flags|=16384))),E2(u,s)):Th(u)}function Th(s){var u=s;do{if((u.flags&32768)!==0){E2(u,xs);return}s=u.return;var h=Y5(u.alternate,u,Ri);if(h!==null){wt=h;return}if(u=u.sibling,u!==null){wt=u;return}wt=u=s}while(u!==null);mn===0&&(mn=5)}function E2(s,u){do{var h=X5(s.alternate,s);if(h!==null){h.flags&=32767,wt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(s=s.sibling,s!==null)){wt=s;return}wt=s=h}while(s!==null);mn=6,wt=null}function C2(s,u,h,g,E,k,O,$,W){s.cancelPendingCommit=null;do kh();while(Bn!==0);if((Lt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=Dm,Jn(s,h,k,O,$,W),s===Gt&&(wt=Gt=null,Ct=0),Zo=u,Ss=s,ji=h,Ig=k,Fg=E,h2=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,l3(De,function(){return R2(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=B.T,B.T=null,E=H.p,H.p=2,O=Lt,Lt|=4;try{Q5(s,u,h)}finally{Lt=O,H.p=E,B.T=g}}Bn=1,T2(),k2(),N2()}}function T2(){if(Bn===1){Bn=0;var s=Ss,u=Zo,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=B.T,B.T=null;var g=H.p;H.p=2;var E=Lt;Lt|=4;try{i2(u,s);var k=ty,O=fS(s.containerInfo),$=k.focusedElem,W=k.selectionRange;if(O!==$&&$&&$.ownerDocument&&cS($.ownerDocument.documentElement,$)){if(W!==null&&km($)){var ce=W.start,be=W.end;if(be===void 0&&(be=ce),"selectionStart"in $)$.selectionStart=ce,$.selectionEnd=Math.min(be,$.value.length);else{var Ee=$.ownerDocument||document,ve=Ee&&Ee.defaultView||window;if(ve.getSelection){var me=ve.getSelection(),Ve=$.textContent.length,at=Math.min(W.start,Ve),Vt=W.end===void 0?at:Math.min(W.end,Ve);!me.extend&&at>Vt&&(O=Vt,Vt=at,at=O);var se=uS($,at),ee=uS($,Vt);if(se&&ee&&(me.rangeCount!==1||me.anchorNode!==se.node||me.anchorOffset!==se.offset||me.focusNode!==ee.node||me.focusOffset!==ee.offset)){var ue=Ee.createRange();ue.setStart(se.node,se.offset),me.removeAllRanges(),at>Vt?(me.addRange(ue),me.extend(ee.node,ee.offset)):(ue.setEnd(ee.node,ee.offset),me.addRange(ue))}}}}for(Ee=[],me=$;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<Ee.length;$++){var Se=Ee[$];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}zh=!!ey,ty=ey=null}finally{Lt=E,H.p=g,B.T=h}}s.current=u,Bn=2}}function k2(){if(Bn===2){Bn=0;var s=Ss,u=Zo,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=B.T,B.T=null;var g=H.p;H.p=2;var E=Lt;Lt|=4;try{e2(s,u.alternate,u)}finally{Lt=E,H.p=g,B.T=h}}Bn=3}}function N2(){if(Bn===4||Bn===3){Bn=0,it();var s=Ss,u=Zo,h=ji,g=h2;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Bn=5:(Bn=0,Zo=Ss=null,A2(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(ws=null),aa(h),u=u.stateNode,le&&typeof le.onCommitFiberRoot=="function")try{le.onCommitFiberRoot(K,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=B.T,E=H.p,H.p=2,B.T=null;try{for(var k=s.onRecoverableError,O=0;O<g.length;O++){var $=g[O];k($.value,{componentStack:$.stack})}}finally{B.T=u,H.p=E}}(ji&3)!==0&&kh(),$a(s),E=s.pendingLanes,(h&261930)!==0&&(E&42)!==0?s===qg?Xc++:(Xc=0,qg=s):Xc=0,Qc(0)}}function A2(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,jc(u)))}function kh(){return T2(),k2(),N2(),R2()}function R2(){if(Bn!==5)return!1;var s=Ss,u=Ig;Ig=0;var h=aa(ji),g=B.T,E=H.p;try{H.p=32>h?32:h,B.T=null,h=Fg,Fg=null;var k=Ss,O=ji;if(Bn=0,Zo=Ss=null,ji=0,(Lt&6)!==0)throw Error(r(331));var $=Lt;if(Lt|=4,c2(k.current),l2(k,k.current,O,h),Lt=$,Qc(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(K,k)}catch{}return!0}finally{H.p=E,B.T=g,A2(s,u)}}function j2(s,u,h){u=ua(h,u),u=xg(s.stateNode,u,2),s=ps(s,u,2),s!==null&&(Ft(s,2),$a(s))}function It(s,u,h){if(s.tag===3)j2(s,s,h);else for(;u!==null;){if(u.tag===3){j2(u,s,h);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ws===null||!ws.has(g))){s=ua(h,s),h=DE(2),g=ps(u,h,2),g!==null&&(ME(h,g,u,s),Ft(g,2),$a(g));break}}u=u.return}}function Hg(s,u,h){var g=s.pingCache;if(g===null){g=s.pingCache=new J5;var E=new Set;g.set(u,E)}else E=g.get(u),E===void 0&&(E=new Set,g.set(u,E));E.has(h)||(Bg=!0,E.add(h),s=a3.bind(null,s,u,h),u.then(s,s))}function a3(s,u,h){var g=s.pingCache;g!==null&&g.delete(u),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Gt===s&&(Ct&h)===h&&(mn===4||mn===3&&(Ct&62914560)===Ct&&300>Pe()-bh?(Lt&2)===0&&Jo(s,0):Pg|=h,Wo===Ct&&(Wo=0)),$a(s)}function D2(s,u){u===0&&(u=ht()),s=Nl(s,u),s!==null&&(Ft(s,u),$a(s))}function i3(s){var u=s.memoizedState,h=0;u!==null&&(h=u.retryLane),D2(s,h)}function s3(s,u){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,E=s.memoizedState;E!==null&&(h=E.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),D2(s,h)}function l3(s,u){return je(s,u)}var Nh=null,tu=null,Gg=!1,Ah=!1,$g=!1,Cs=0;function $a(s){s!==tu&&s.next===null&&(tu===null?Nh=tu=s:tu=tu.next=s),Ah=!0,Gg||(Gg=!0,u3())}function Qc(s,u){if(!$g&&Ah){$g=!0;do for(var h=!1,g=Nh;g!==null;){if(s!==0){var E=g.pendingLanes;if(E===0)var k=0;else{var O=g.suspendedLanes,$=g.pingedLanes;k=(1<<31-de(42|s)+1)-1,k&=E&~(O&~$),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(h=!0,_2(g,k))}else k=Ct,k=ut(g,g===Gt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||Ue(g,k)||(h=!0,_2(g,k));g=g.next}while(h);$g=!1}}function o3(){M2()}function M2(){Ah=Gg=!1;var s=0;Cs!==0&&x3()&&(s=Cs);for(var u=Pe(),h=null,g=Nh;g!==null;){var E=g.next,k=O2(g,u);k===0?(g.next=null,h===null?Nh=E:h.next=E,E===null&&(tu=h)):(h=g,(s!==0||(k&3)!==0)&&(Ah=!0)),g=E}Bn!==0&&Bn!==5||Qc(s),Cs!==0&&(Cs=0)}function O2(s,u){for(var h=s.suspendedLanes,g=s.pingedLanes,E=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var O=31-de(k),$=1<<O,W=E[O];W===-1?(($&h)===0||($&g)!==0)&&(E[O]=yt($,u)):W<=u&&(s.expiredLanes|=$),k&=~$}if(u=Gt,h=Ct,h=ut(s,s===u?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===u&&(zt===2||zt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ge(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||Ue(s,h)){if(u=h&-h,u===s.callbackPriority)return u;switch(g!==null&&Ge(g),aa(h)){case 2:case 8:h=Ce;break;case 32:h=De;break;case 268435456:h=Me;break;default:h=De}return g=L2.bind(null,s),h=je(h,g),s.callbackPriority=u,s.callbackNode=h,u}return g!==null&&g!==null&&Ge(g),s.callbackPriority=2,s.callbackNode=null,2}function L2(s,u){if(Bn!==0&&Bn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(kh()&&s.callbackNode!==h)return null;var g=Ct;return g=ut(s,s===Gt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(p2(s,g,u),O2(s,Pe()),s.callbackNode!=null&&s.callbackNode===h?L2.bind(null,s):null)}function _2(s,u){if(kh())return null;p2(s,u,!0)}function u3(){w3(function(){(Lt&6)!==0?je(he,o3):M2()})}function Kg(){if(Cs===0){var s=Fo;s===0&&(s=He,He<<=1,(He&261888)===0&&(He=256)),Cs=s}return Cs}function B2(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Bd(""+s)}function P2(s,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,s.id&&h.setAttribute("form",s.id),u.parentNode.insertBefore(h,u),s=new FormData(s),h.parentNode.removeChild(h),s}function c3(s,u,h,g,E){if(u==="submit"&&h&&h.stateNode===E){var k=B2((E[_n]||null).action),O=g.submitter;O&&(u=(u=O[_n]||null)?B2(u.formAction):O.getAttribute("formAction"),u!==null&&(k=u,O=null));var $=new Fd("action","action",null,g,E);s.push({event:$,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Cs!==0){var W=O?P2(E,O):new FormData(E);hg(h,{pending:!0,data:W,method:E.method,action:k},null,W)}}else typeof k=="function"&&($.preventDefault(),W=O?P2(E,O):new FormData(E),hg(h,{pending:!0,data:W,method:E.method,action:k},k,W))},currentTarget:E}]})}}for(var Yg=0;Yg<jm.length;Yg++){var Xg=jm[Yg],f3=Xg.toLowerCase(),d3=Xg[0].toUpperCase()+Xg.slice(1);ka(f3,"on"+d3)}ka(vS,"onAnimationEnd"),ka(pS,"onAnimationIteration"),ka(mS,"onAnimationStart"),ka("dblclick","onDoubleClick"),ka("focusin","onFocus"),ka("focusout","onBlur"),ka(A5,"onTransitionRun"),ka(R5,"onTransitionStart"),ka(j5,"onTransitionCancel"),ka(gS,"onTransitionEnd"),Ua("onMouseEnter",["mouseout","mouseover"]),Ua("onMouseLeave",["mouseout","mouseover"]),Ua("onPointerEnter",["pointerout","pointerover"]),Ua("onPointerLeave",["pointerout","pointerover"]),Vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),h3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wc));function z2(s,u){u=(u&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],E=g.event;g=g.listeners;e:{var k=void 0;if(u)for(var O=g.length-1;0<=O;O--){var $=g[O],W=$.instance,ce=$.currentTarget;if($=$.listener,W!==k&&E.isPropagationStopped())break e;k=$,E.currentTarget=ce;try{k(E)}catch(be){Vd(be)}E.currentTarget=null,k=W}else for(O=0;O<g.length;O++){if($=g[O],W=$.instance,ce=$.currentTarget,$=$.listener,W!==k&&E.isPropagationStopped())break e;k=$,E.currentTarget=ce;try{k(E)}catch(be){Vd(be)}E.currentTarget=null,k=W}}}}function St(s,u){var h=u[Vn];h===void 0&&(h=u[Vn]=new Set);var g=s+"__bubble";h.has(g)||(I2(u,s,2,!1),h.add(g))}function Qg(s,u,h){var g=0;u&&(g|=4),I2(h,s,g,u)}var Rh="_reactListening"+Math.random().toString(36).slice(2);function Wg(s){if(!s[Rh]){s[Rh]=!0,Dd.forEach(function(h){h!=="selectionchange"&&(h3.has(h)||Qg(h,!1,s),Qg(h,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Rh]||(u[Rh]=!0,Qg("selectionchange",!1,u))}}function I2(s,u,h,g){switch(vC(u)){case 2:var E=q3;break;case 8:E=U3;break;default:E=dy}h=E.bind(null,u,h,s),E=void 0,!gm||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),g?E!==void 0?s.addEventListener(u,h,{capture:!0,passive:E}):s.addEventListener(u,h,!0):E!==void 0?s.addEventListener(u,h,{passive:E}):s.addEventListener(u,h,!1)}function Zg(s,u,h,g,E){var k=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var O=g.tag;if(O===3||O===4){var $=g.stateNode.containerInfo;if($===E)break;if(O===4)for(O=g.return;O!==null;){var W=O.tag;if((W===3||W===4)&&O.stateNode.containerInfo===E)return;O=O.return}for(;$!==null;){if(O=as($),O===null)return;if(W=O.tag,W===5||W===6||W===26||W===27){g=k=O;continue e}$=$.parentNode}}g=g.return}Hw(function(){var ce=k,be=pm(h),Ee=[];e:{var ve=yS.get(s);if(ve!==void 0){var me=Fd,Ve=s;switch(s){case"keypress":if(zd(h)===0)break e;case"keydown":case"keyup":me=s5;break;case"focusin":Ve="focus",me=wm;break;case"focusout":Ve="blur",me=wm;break;case"beforeblur":case"afterblur":me=wm;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Kw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Y_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=u5;break;case vS:case pS:case mS:me=W_;break;case gS:me=f5;break;case"scroll":case"scrollend":me=$_;break;case"wheel":me=h5;break;case"copy":case"cut":case"paste":me=J_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Xw;break;case"toggle":case"beforetoggle":me=p5}var at=(u&4)!==0,Vt=!at&&(s==="scroll"||s==="scrollend"),se=at?ve!==null?ve+"Capture":null:ve;at=[];for(var ee=ce,ue;ee!==null;){var Se=ee;if(ue=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ue===null||se===null||(Se=xc(ee,se),Se!=null&&at.push(Zc(ee,Se,ue))),Vt)break;ee=ee.return}0<at.length&&(ve=new me(ve,Ve,null,h,be),Ee.push({event:ve,listeners:at}))}}if((u&7)===0){e:{if(ve=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",ve&&h!==vm&&(Ve=h.relatedTarget||h.fromElement)&&(as(Ve)||Ve[Ar]))break e;if((me||ve)&&(ve=be.window===be?be:(ve=be.ownerDocument)?ve.defaultView||ve.parentWindow:window,me?(Ve=h.relatedTarget||h.toElement,me=ce,Ve=Ve?as(Ve):null,Ve!==null&&(Vt=i(Ve),at=Ve.tag,Ve!==Vt||at!==5&&at!==27&&at!==6)&&(Ve=null)):(me=null,Ve=ce),me!==Ve)){if(at=Kw,Se="onMouseLeave",se="onMouseEnter",ee="mouse",(s==="pointerout"||s==="pointerover")&&(at=Xw,Se="onPointerLeave",se="onPointerEnter",ee="pointer"),Vt=me==null?ve:El(me),ue=Ve==null?ve:El(Ve),ve=new at(Se,ee+"leave",me,h,be),ve.target=Vt,ve.relatedTarget=ue,Se=null,as(be)===ce&&(at=new at(se,ee+"enter",Ve,h,be),at.target=ue,at.relatedTarget=Vt,Se=at),Vt=Se,me&&Ve)t:{for(at=v3,se=me,ee=Ve,ue=0,Se=se;Se;Se=at(Se))ue++;Se=0;for(var tt=ee;tt;tt=at(tt))Se++;for(;0<ue-Se;)se=at(se),ue--;for(;0<Se-ue;)ee=at(ee),Se--;for(;ue--;){if(se===ee||ee!==null&&se===ee.alternate){at=se;break t}se=at(se),ee=at(ee)}at=null}else at=null;me!==null&&F2(Ee,ve,me,at,!1),Ve!==null&&Vt!==null&&F2(Ee,Vt,Ve,at,!0)}}e:{if(ve=ce?El(ce):window,me=ve.nodeName&&ve.nodeName.toLowerCase(),me==="select"||me==="input"&&ve.type==="file")var Dt=rS;else if(tS(ve))if(aS)Dt=T5;else{Dt=E5;var $e=S5}else me=ve.nodeName,!me||me.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?ce&&hm(ce.elementType)&&(Dt=rS):Dt=C5;if(Dt&&(Dt=Dt(s,ce))){nS(Ee,Dt,h,be);break e}$e&&$e(s,ve,ce),s==="focusout"&&ce&&ve.type==="number"&&ce.memoizedProps.value!=null&&dm(ve,"number",ve.value)}switch($e=ce?El(ce):window,s){case"focusin":(tS($e)||$e.contentEditable==="true")&&(Mo=$e,Nm=ce,Nc=null);break;case"focusout":Nc=Nm=Mo=null;break;case"mousedown":Am=!0;break;case"contextmenu":case"mouseup":case"dragend":Am=!1,dS(Ee,h,be);break;case"selectionchange":if(N5)break;case"keydown":case"keyup":dS(Ee,h,be)}var vt;if(Em)e:{switch(s){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else Do?Jw(s,h)&&(Tt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(Tt="onCompositionStart");Tt&&(Qw&&h.locale!=="ko"&&(Do||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&Do&&(vt=Gw()):(os=be,ym="value"in os?os.value:os.textContent,Do=!0)),$e=jh(ce,Tt),0<$e.length&&(Tt=new Yw(Tt,s,null,h,be),Ee.push({event:Tt,listeners:$e}),vt?Tt.data=vt:(vt=eS(h),vt!==null&&(Tt.data=vt)))),(vt=g5?y5(s,h):x5(s,h))&&(Tt=jh(ce,"onBeforeInput"),0<Tt.length&&($e=new Yw("onBeforeInput","beforeinput",null,h,be),Ee.push({event:$e,listeners:Tt}),$e.data=vt)),c3(Ee,s,ce,h,be)}z2(Ee,u)})}function Zc(s,u,h){return{instance:s,listener:u,currentTarget:h}}function jh(s,u){for(var h=u+"Capture",g=[];s!==null;){var E=s,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=xc(s,h),E!=null&&g.unshift(Zc(s,E,k)),E=xc(s,u),E!=null&&g.push(Zc(s,E,k))),s.tag===3)return g;s=s.return}return[]}function v3(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function F2(s,u,h,g,E){for(var k=u._reactName,O=[];h!==null&&h!==g;){var $=h,W=$.alternate,ce=$.stateNode;if($=$.tag,W!==null&&W===g)break;$!==5&&$!==26&&$!==27||ce===null||(W=ce,E?(ce=xc(h,k),ce!=null&&O.unshift(Zc(h,ce,W))):E||(ce=xc(h,k),ce!=null&&O.push(Zc(h,ce,W)))),h=h.return}O.length!==0&&s.push({event:u,listeners:O})}var p3=/\r\n?/g,m3=/\u0000|\uFFFD/g;function q2(s){return(typeof s=="string"?s:""+s).replace(p3,`
|
|
49
|
+
`).replace(m3,"")}function U2(s,u){return u=q2(u),q2(s)===u}function Ut(s,u,h,g,E,k){switch(h){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Ao(s,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Ao(s,""+g);break;case"className":ls(s,"class",g);break;case"tabIndex":ls(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":ls(s,h,g);break;case"style":Uw(s,g,k);break;case"data":if(u!=="object"){ls(s,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Bd(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(h==="formAction"?(u!=="input"&&Ut(s,u,"name",E.name,E,null),Ut(s,u,"formEncType",E.formEncType,E,null),Ut(s,u,"formMethod",E.formMethod,E,null),Ut(s,u,"formTarget",E.formTarget,E,null)):(Ut(s,u,"encType",E.encType,E,null),Ut(s,u,"method",E.method,E,null),Ut(s,u,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Bd(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=pi);break;case"onScroll":g!=null&&St("scroll",s);break;case"onScrollEnd":g!=null&&St("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=Bd(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):s.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":St("beforetoggle",s),St("toggle",s),cr(s,"popover",g);break;case"xlinkActuate":sa(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":sa(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":sa(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":sa(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":sa(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":sa(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":sa(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":sa(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":sa(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":cr(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=H_.get(h)||h,cr(s,h,g))}}function Jg(s,u,h,g,E,k){switch(h){case"style":Uw(s,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?Ao(s,g):(typeof g=="number"||typeof g=="bigint")&&Ao(s,""+g);break;case"onScroll":g!=null&&St("scroll",s);break;case"onScrollEnd":g!=null&&St("scrollend",s);break;case"onClick":g!=null&&(s.onclick=pi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Md.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(E=h.endsWith("Capture"),u=h.slice(2,E?h.length-7:void 0),k=s[_n]||null,k=k!=null?k[h]:null,typeof k=="function"&&s.removeEventListener(u,k,E),typeof g=="function")){typeof k!="function"&&k!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(u,g,E);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):cr(s,h,g)}}}function rr(s,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",s),St("load",s);var g=!1,E=!1,k;for(k in h)if(h.hasOwnProperty(k)){var O=h[k];if(O!=null)switch(k){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ut(s,u,k,O,h,null)}}E&&Ut(s,u,"srcSet",h.srcSet,h,null),g&&Ut(s,u,"src",h.src,h,null);return;case"input":St("invalid",s);var $=k=O=E=null,W=null,ce=null;for(g in h)if(h.hasOwnProperty(g)){var be=h[g];if(be!=null)switch(g){case"name":E=be;break;case"type":O=be;break;case"checked":W=be;break;case"defaultChecked":ce=be;break;case"value":k=be;break;case"defaultValue":$=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,u));break;default:Ut(s,u,g,be,h,null)}}zw(s,k,$,W,ce,O,E,!1);return;case"select":St("invalid",s),g=O=k=null;for(E in h)if(h.hasOwnProperty(E)&&($=h[E],$!=null))switch(E){case"value":k=$;break;case"defaultValue":O=$;break;case"multiple":g=$;default:Ut(s,u,E,$,h,null)}u=k,h=O,s.multiple=!!g,u!=null?No(s,!!g,u,!1):h!=null&&No(s,!!g,h,!0);return;case"textarea":St("invalid",s),k=E=g=null;for(O in h)if(h.hasOwnProperty(O)&&($=h[O],$!=null))switch(O){case"value":g=$;break;case"defaultValue":E=$;break;case"children":k=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:Ut(s,u,O,$,h,null)}Fw(s,g,E,k);return;case"option":for(W in h)if(h.hasOwnProperty(W)&&(g=h[W],g!=null))switch(W){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Ut(s,u,W,g,h,null)}return;case"dialog":St("beforetoggle",s),St("toggle",s),St("cancel",s),St("close",s);break;case"iframe":case"object":St("load",s);break;case"video":case"audio":for(g=0;g<Wc.length;g++)St(Wc[g],s);break;case"image":St("error",s),St("load",s);break;case"details":St("toggle",s);break;case"embed":case"source":case"link":St("error",s),St("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in h)if(h.hasOwnProperty(ce)&&(g=h[ce],g!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ut(s,u,ce,g,h,null)}return;default:if(hm(u)){for(be in h)h.hasOwnProperty(be)&&(g=h[be],g!==void 0&&Jg(s,u,be,g,h,void 0));return}}for($ in h)h.hasOwnProperty($)&&(g=h[$],g!=null&&Ut(s,u,$,g,h,null))}function g3(s,u,h,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,k=null,O=null,$=null,W=null,ce=null,be=null;for(me in h){var Ee=h[me];if(h.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":W=Ee;default:g.hasOwnProperty(me)||Ut(s,u,me,null,g,Ee)}}for(var ve in g){var me=g[ve];if(Ee=h[ve],g.hasOwnProperty(ve)&&(me!=null||Ee!=null))switch(ve){case"type":k=me;break;case"name":E=me;break;case"checked":ce=me;break;case"defaultChecked":be=me;break;case"value":O=me;break;case"defaultValue":$=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==Ee&&Ut(s,u,ve,me,g,Ee)}}fm(s,O,$,W,ce,be,k,E);return;case"select":me=O=$=ve=null;for(k in h)if(W=h[k],h.hasOwnProperty(k)&&W!=null)switch(k){case"value":break;case"multiple":me=W;default:g.hasOwnProperty(k)||Ut(s,u,k,null,g,W)}for(E in g)if(k=g[E],W=h[E],g.hasOwnProperty(E)&&(k!=null||W!=null))switch(E){case"value":ve=k;break;case"defaultValue":$=k;break;case"multiple":O=k;default:k!==W&&Ut(s,u,E,k,g,W)}u=$,h=O,g=me,ve!=null?No(s,!!h,ve,!1):!!g!=!!h&&(u!=null?No(s,!!h,u,!0):No(s,!!h,h?[]:"",!1));return;case"textarea":me=ve=null;for($ in h)if(E=h[$],h.hasOwnProperty($)&&E!=null&&!g.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Ut(s,u,$,null,g,E)}for(O in g)if(E=g[O],k=h[O],g.hasOwnProperty(O)&&(E!=null||k!=null))switch(O){case"value":ve=E;break;case"defaultValue":me=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==k&&Ut(s,u,O,E,g,k)}Iw(s,ve,me);return;case"option":for(var Ve in h)if(ve=h[Ve],h.hasOwnProperty(Ve)&&ve!=null&&!g.hasOwnProperty(Ve))switch(Ve){case"selected":s.selected=!1;break;default:Ut(s,u,Ve,null,g,ve)}for(W in g)if(ve=g[W],me=h[W],g.hasOwnProperty(W)&&ve!==me&&(ve!=null||me!=null))switch(W){case"selected":s.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Ut(s,u,W,ve,g,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var at in h)ve=h[at],h.hasOwnProperty(at)&&ve!=null&&!g.hasOwnProperty(at)&&Ut(s,u,at,null,g,ve);for(ce in g)if(ve=g[ce],me=h[ce],g.hasOwnProperty(ce)&&ve!==me&&(ve!=null||me!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:Ut(s,u,ce,ve,g,me)}return;default:if(hm(u)){for(var Vt in h)ve=h[Vt],h.hasOwnProperty(Vt)&&ve!==void 0&&!g.hasOwnProperty(Vt)&&Jg(s,u,Vt,void 0,g,ve);for(be in g)ve=g[be],me=h[be],!g.hasOwnProperty(be)||ve===me||ve===void 0&&me===void 0||Jg(s,u,be,ve,g,me);return}}for(var se in h)ve=h[se],h.hasOwnProperty(se)&&ve!=null&&!g.hasOwnProperty(se)&&Ut(s,u,se,null,g,ve);for(Ee in g)ve=g[Ee],me=h[Ee],!g.hasOwnProperty(Ee)||ve===me||ve==null&&me==null||Ut(s,u,Ee,ve,g,me)}function V2(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y3(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var E=h[g],k=E.transferSize,O=E.initiatorType,$=E.duration;if(k&&$&&V2(O)){for(O=0,$=E.responseEnd,g+=1;g<h.length;g++){var W=h[g],ce=W.startTime;if(ce>$)break;var be=W.transferSize,Ee=W.initiatorType;be&&V2(Ee)&&(W=W.responseEnd,O+=be*(W<$?1:($-ce)/(W-ce)))}if(--g,u+=8*(k+O)/(E.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var ey=null,ty=null;function Dh(s){return s.nodeType===9?s:s.ownerDocument}function H2(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function G2(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function ny(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var ry=null;function x3(){var s=window.event;return s&&s.type==="popstate"?s===ry?!1:(ry=s,!0):(ry=null,!1)}var $2=typeof setTimeout=="function"?setTimeout:void 0,b3=typeof clearTimeout=="function"?clearTimeout:void 0,K2=typeof Promise=="function"?Promise:void 0,w3=typeof queueMicrotask=="function"?queueMicrotask:typeof K2<"u"?function(s){return K2.resolve(null).then(s).catch(S3)}:$2;function S3(s){setTimeout(function(){throw s})}function Ts(s){return s==="head"}function Y2(s,u){var h=u,g=0;do{var E=h.nextSibling;if(s.removeChild(h),E&&E.nodeType===8)if(h=E.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(E),iu(u);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Jc(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,Jc(h);for(var k=h.firstChild;k;){var O=k.nextSibling,$=k.nodeName;k[Gn]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&k.rel.toLowerCase()==="stylesheet"||h.removeChild(k),k=O}}else h==="body"&&Jc(s.ownerDocument.body);h=E}while(h);iu(u)}function X2(s,u){var h=s;s=0;do{var g=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function ay(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":ay(h),To(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function E3(s,u,h,g){for(;s.nodeType===1;){var E=h;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Gn])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=va(s.nextSibling),s===null)break}return null}function C3(s,u,h){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=va(s.nextSibling),s===null))return null;return s}function Q2(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=va(s.nextSibling),s===null))return null;return s}function iy(s){return s.data==="$?"||s.data==="$~"}function sy(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function T3(s,u){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||h.readyState!=="loading")u();else{var g=function(){u(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function va(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var ly=null;function W2(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(u===0)return va(s.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}s=s.nextSibling}return null}function Z2(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return s;u--}else h!=="/$"&&h!=="/&"||u++}s=s.previousSibling}return null}function J2(s,u,h){switch(u=Dh(h),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Jc(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);To(s)}var pa=new Map,eC=new Set;function Mh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Di=H.d;H.d={f:k3,r:N3,D:A3,C:R3,L:j3,m:D3,X:O3,S:M3,M:L3};function k3(){var s=Di.f(),u=Eh();return s||u}function N3(s){var u=is(s);u!==null&&u.tag===5&&u.type==="form"?gE(u):Di.r(s)}var nu=typeof document>"u"?null:document;function tC(s,u,h){var g=nu;if(g&&typeof u=="string"&&u){var E=la(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof h=="string"&&(E+='[crossorigin="'+h+'"]'),eC.has(E)||(eC.add(E),s={rel:s,crossOrigin:h,href:u},g.querySelector(E)===null&&(u=g.createElement("link"),rr(u,"link",s),kn(u),g.head.appendChild(u)))}}function A3(s){Di.D(s),tC("dns-prefetch",s,null)}function R3(s,u){Di.C(s,u),tC("preconnect",s,u)}function j3(s,u,h){Di.L(s,u,h);var g=nu;if(g&&s&&u){var E='link[rel="preload"][as="'+la(u)+'"]';u==="image"&&h&&h.imageSrcSet?(E+='[imagesrcset="'+la(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(E+='[imagesizes="'+la(h.imageSizes)+'"]')):E+='[href="'+la(s)+'"]';var k=E;switch(u){case"style":k=ru(s);break;case"script":k=au(s)}pa.has(k)||(s=v({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:s,as:u},h),pa.set(k,s),g.querySelector(E)!==null||u==="style"&&g.querySelector(ef(k))||u==="script"&&g.querySelector(tf(k))||(u=g.createElement("link"),rr(u,"link",s),kn(u),g.head.appendChild(u)))}}function D3(s,u){Di.m(s,u);var h=nu;if(h&&s){var g=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+la(g)+'"][href="'+la(s)+'"]',k=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=au(s)}if(!pa.has(k)&&(s=v({rel:"modulepreload",href:s},u),pa.set(k,s),h.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(tf(k)))return}g=h.createElement("link"),rr(g,"link",s),kn(g),h.head.appendChild(g)}}}function M3(s,u,h){Di.S(s,u,h);var g=nu;if(g&&s){var E=ss(g).hoistableStyles,k=ru(s);u=u||"default";var O=E.get(k);if(!O){var $={loading:0,preload:null};if(O=g.querySelector(ef(k)))$.loading=5;else{s=v({rel:"stylesheet",href:s,"data-precedence":u},h),(h=pa.get(k))&&oy(s,h);var W=O=g.createElement("link");kn(W),rr(W,"link",s),W._p=new Promise(function(ce,be){W.onload=ce,W.onerror=be}),W.addEventListener("load",function(){$.loading|=1}),W.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Oh(O,u,g)}O={type:"stylesheet",instance:O,count:1,state:$},E.set(k,O)}}}function O3(s,u){Di.X(s,u);var h=nu;if(h&&s){var g=ss(h).hoistableScripts,E=au(s),k=g.get(E);k||(k=h.querySelector(tf(E)),k||(s=v({src:s,async:!0},u),(u=pa.get(E))&&uy(s,u),k=h.createElement("script"),kn(k),rr(k,"link",s),h.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function L3(s,u){Di.M(s,u);var h=nu;if(h&&s){var g=ss(h).hoistableScripts,E=au(s),k=g.get(E);k||(k=h.querySelector(tf(E)),k||(s=v({src:s,async:!0,type:"module"},u),(u=pa.get(E))&&uy(s,u),k=h.createElement("script"),kn(k),rr(k,"link",s),h.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(E,k))}}function nC(s,u,h,g){var E=(E=oe.current)?Mh(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=ru(h.href),h=ss(E).hoistableStyles,g=h.get(u),g||(g={type:"style",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=ru(h.href);var k=ss(E).hoistableStyles,O=k.get(s);if(O||(E=E.ownerDocument||E,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,O),(k=E.querySelector(ef(s)))&&!k._p&&(O.instance=k,O.state.loading=5),pa.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},pa.set(s,h),k||_3(E,s,h,O.state))),u&&g===null)throw Error(r(528,""));return O}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=au(h),h=ss(E).hoistableScripts,g=h.get(u),g||(g={type:"script",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function ru(s){return'href="'+la(s)+'"'}function ef(s){return'link[rel="stylesheet"]['+s+"]"}function rC(s){return v({},s,{"data-precedence":s.precedence,precedence:null})}function _3(s,u,h,g){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=s.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),rr(u,"link",h),kn(u),s.head.appendChild(u))}function au(s){return'[src="'+la(s)+'"]'}function tf(s){return"script[async]"+s}function aC(s,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var g=s.querySelector('style[data-href~="'+la(h.href)+'"]');if(g)return u.instance=g,kn(g),g;var E=v({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),kn(g),rr(g,"style",E),Oh(g,h.precedence,s),u.instance=g;case"stylesheet":E=ru(h.href);var k=s.querySelector(ef(E));if(k)return u.state.loading|=4,u.instance=k,kn(k),k;g=rC(h),(E=pa.get(E))&&oy(g,E),k=(s.ownerDocument||s).createElement("link"),kn(k);var O=k;return O._p=new Promise(function($,W){O.onload=$,O.onerror=W}),rr(k,"link",g),u.state.loading|=4,Oh(k,h.precedence,s),u.instance=k;case"script":return k=au(h.src),(E=s.querySelector(tf(k)))?(u.instance=E,kn(E),E):(g=h,(E=pa.get(k))&&(g=v({},h),uy(g,E)),s=s.ownerDocument||s,E=s.createElement("script"),kn(E),rr(E,"link",g),s.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,Oh(g,h.precedence,s));return u.instance}function Oh(s,u,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,k=E,O=0;O<g.length;O++){var $=g[O];if($.dataset.precedence===u)k=$;else if(k!==E)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(s,u.firstChild))}function oy(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function uy(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Lh=null;function iC(s,u,h){if(Lh===null){var g=new Map,E=Lh=new Map;E.set(h,g)}else E=Lh,g=E.get(h),g||(g=new Map,E.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),E=0;E<h.length;E++){var k=h[E];if(!(k[Gn]||k[an]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var O=k.getAttribute(u)||"";O=s+O;var $=g.get(O);$?$.push(k):g.set(O,[k])}}return g}function sC(s,u,h){s=s.ownerDocument||s,s.head.insertBefore(h,u==="title"?s.querySelector("head > title"):null)}function B3(s,u,h){if(h===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function lC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function P3(s,u,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var E=ru(g.href),k=u.querySelector(ef(E));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=_h.bind(s),u.then(s,s)),h.state.loading|=4,h.instance=k,kn(k);return}k=u.ownerDocument||u,g=rC(g),(E=pa.get(E))&&oy(g,E),k=k.createElement("link"),kn(k);var O=k;O._p=new Promise(function($,W){O.onload=$,O.onerror=W}),rr(k,"link",g),h.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=_h.bind(s),u.addEventListener("load",h),u.addEventListener("error",h))}}var cy=0;function z3(s,u){return s.stylesheets&&s.count===0&&Ph(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&Ph(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&cy===0&&(cy=62500*y3());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Ph(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>cy?50:800)+u);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function _h(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ph(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Bh=null;function Ph(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Bh=new Map,u.forEach(I3,s),Bh=null,_h.call(s))}function I3(s,u){if(!(u.state.loading&4)){var h=Bh.get(s);if(h)var g=h.get(null);else{h=new Map,Bh.set(s,h);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var O=E[k];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(h.set(O.dataset.precedence,O),g=O)}g&&h.set(null,g)}E=u.instance,O=E.getAttribute("data-precedence"),k=h.get(O)||g,k===g&&h.set(null,E),h.set(O,E),this.count++,g=_h.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),k?k.parentNode.insertBefore(E,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var nf={$$typeof:T,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function F3(s,u,h,g,E,k,O,$,W){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=on(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=on(0),this.hiddenUpdates=on(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=k,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function oC(s,u,h,g,E,k,O,$,W,ce,be,Ee){return s=new F3(s,u,h,O,W,ce,be,Ee,$),u=1,k===!0&&(u|=24),k=Gr(3,null,null,u),s.current=k,k.stateNode=s,u=Vm(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:g,isDehydrated:h,cache:u},Km(k),s}function uC(s){return s?(s=_o,s):_o}function cC(s,u,h,g,E,k){E=uC(E),g.context===null?g.context=E:g.pendingContext=E,g=vs(u),g.payload={element:h},k=k===void 0?null:k,k!==null&&(g.callback=k),h=ps(s,g,u),h!==null&&(_r(h,s,u),Lc(h,s,u))}function fC(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<u?h:u}}function fy(s,u){fC(s,u),(s=s.alternate)&&fC(s,u)}function dC(s){if(s.tag===13||s.tag===31){var u=Nl(s,67108864);u!==null&&_r(u,s,67108864),fy(s,67108864)}}function hC(s){if(s.tag===13||s.tag===31){var u=Qr();u=wn(u);var h=Nl(s,u);h!==null&&_r(h,s,u),fy(s,u)}}var zh=!0;function q3(s,u,h,g){var E=B.T;B.T=null;var k=H.p;try{H.p=2,dy(s,u,h,g)}finally{H.p=k,B.T=E}}function U3(s,u,h,g){var E=B.T;B.T=null;var k=H.p;try{H.p=8,dy(s,u,h,g)}finally{H.p=k,B.T=E}}function dy(s,u,h,g){if(zh){var E=hy(g);if(E===null)Zg(s,u,g,Ih,h),pC(s,g);else if(H3(E,s,u,h,g))g.stopPropagation();else if(pC(s,g),u&4&&-1<V3.indexOf(s)){for(;E!==null;){var k=is(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var O=ot(k.pendingLanes);if(O!==0){var $=k;for($.pendingLanes|=2,$.entangledLanes|=2;O;){var W=1<<31-de(O);$.entanglements[1]|=W,O&=~W}$a(k),(Lt&6)===0&&(wh=Pe()+500,Qc(0))}}break;case 31:case 13:$=Nl(k,2),$!==null&&_r($,k,2),Eh(),fy(k,2)}if(k=hy(g),k===null&&Zg(s,u,g,Ih,h),k===E)break;E=k}E!==null&&g.stopPropagation()}else Zg(s,u,g,null,h)}}function hy(s){return s=pm(s),vy(s)}var Ih=null;function vy(s){if(Ih=null,s=as(s),s!==null){var u=i(s);if(u===null)s=null;else{var h=u.tag;if(h===13){if(s=l(u),s!==null)return s;s=null}else if(h===31){if(s=o(u),s!==null)return s;s=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return Ih=s,null}function vC(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ft()){case he:return 2;case Ce:return 8;case De:case ze:return 32;case Me:return 268435456;default:return 32}default:return 32}}var py=!1,ks=null,Ns=null,As=null,rf=new Map,af=new Map,Rs=[],V3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function pC(s,u){switch(s){case"focusin":case"focusout":ks=null;break;case"dragenter":case"dragleave":Ns=null;break;case"mouseover":case"mouseout":As=null;break;case"pointerover":case"pointerout":rf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":af.delete(u.pointerId)}}function sf(s,u,h,g,E,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:h,eventSystemFlags:g,nativeEvent:k,targetContainers:[E]},u!==null&&(u=is(u),u!==null&&dC(u)),s):(s.eventSystemFlags|=g,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function H3(s,u,h,g,E){switch(u){case"focusin":return ks=sf(ks,s,u,h,g,E),!0;case"dragenter":return Ns=sf(Ns,s,u,h,g,E),!0;case"mouseover":return As=sf(As,s,u,h,g,E),!0;case"pointerover":var k=E.pointerId;return rf.set(k,sf(rf.get(k)||null,s,u,h,g,E)),!0;case"gotpointercapture":return k=E.pointerId,af.set(k,sf(af.get(k)||null,s,u,h,g,E)),!0}return!1}function mC(s){var u=as(s.target);if(u!==null){var h=i(u);if(h!==null){if(u=h.tag,u===13){if(u=l(h),u!==null){s.blockedOn=u,ia(s.priority,function(){hC(h)});return}}else if(u===31){if(u=o(h),u!==null){s.blockedOn=u,ia(s.priority,function(){hC(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Fh(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var h=hy(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);vm=g,h.target.dispatchEvent(g),vm=null}else return u=is(h),u!==null&&dC(u),s.blockedOn=h,!1;u.shift()}return!0}function gC(s,u,h){Fh(s)&&h.delete(u)}function G3(){py=!1,ks!==null&&Fh(ks)&&(ks=null),Ns!==null&&Fh(Ns)&&(Ns=null),As!==null&&Fh(As)&&(As=null),rf.forEach(gC),af.forEach(gC)}function qh(s,u){s.blockedOn===u&&(s.blockedOn=null,py||(py=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,G3)))}var Uh=null;function yC(s){Uh!==s&&(Uh=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Uh===s&&(Uh=null);for(var u=0;u<s.length;u+=3){var h=s[u],g=s[u+1],E=s[u+2];if(typeof g!="function"){if(vy(g||h)===null)continue;break}var k=is(h);k!==null&&(s.splice(u,3),u-=3,hg(k,{pending:!0,data:E,method:h.method,action:g},g,E))}}))}function iu(s){function u(W){return qh(W,s)}ks!==null&&qh(ks,s),Ns!==null&&qh(Ns,s),As!==null&&qh(As,s),rf.forEach(u),af.forEach(u);for(var h=0;h<Rs.length;h++){var g=Rs[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Rs.length&&(h=Rs[0],h.blockedOn===null);)mC(h),h.blockedOn===null&&Rs.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var E=h[g],k=h[g+1],O=E[_n]||null;if(typeof k=="function")O||yC(h);else if(O){var $=null;if(k&&k.hasAttribute("formAction")){if(E=k,O=k[_n]||null)$=O.formAction;else if(vy(E)!==null)continue}else $=O.action;typeof $=="function"?h[g+1]=$:(h.splice(g,3),g-=3),yC(h)}}}function xC(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(O){return E=O})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function my(s){this._internalRoot=s}Vh.prototype.render=my.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,g=Qr();cC(h,g,s,u,null,null)},Vh.prototype.unmount=my.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;cC(s.current,2,null,s,null,null),Eh(),u[Ar]=null}};function Vh(s){this._internalRoot=s}Vh.prototype.unstable_scheduleHydration=function(s){if(s){var u=cn();s={blockedOn:null,target:s,priority:u};for(var h=0;h<Rs.length&&u!==0&&u<Rs[h].priority;h++);Rs.splice(h,0,s),h===0&&mC(s)}};var bC=t.version;if(bC!=="19.2.4")throw Error(r(527,bC,"19.2.4"));H.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=c(u),s=s!==null?d(s):null,s=s===null?null:s.stateNode,s};var $3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hh.isDisabled&&Hh.supportsFiber)try{K=Hh.inject($3),le=Hh}catch{}}return of.createRoot=function(s,u){if(!a(s))throw Error(r(299));var h=!1,g="",E=NE,k=AE,O=RE;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),u=oC(s,1,!1,null,null,h,g,null,E,k,O,xC),s[Ar]=u.current,Wg(s),new my(u)},of.hydrateRoot=function(s,u,h){if(!a(s))throw Error(r(299));var g=!1,E="",k=NE,O=AE,$=RE,W=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onUncaughtError!==void 0&&(k=h.onUncaughtError),h.onCaughtError!==void 0&&(O=h.onCaughtError),h.onRecoverableError!==void 0&&($=h.onRecoverableError),h.formState!==void 0&&(W=h.formState)),u=oC(s,1,!0,u,h??null,g,E,W,k,O,$,xC),u.context=uC(null),h=u.current,g=Qr(),g=wn(g),E=vs(g),E.callback=null,ps(h,E,g),h=g,u.current.lanes=h,Ft(u,h),$a(u),s[Ar]=u.current,Wg(s),new Vh(u)},of.version="19.2.4",of}var DC;function n4(){if(DC)return by.exports;DC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),by.exports=t4(),by.exports}var r4=n4();const a4=ld(r4);var Ju=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ql,Fs,_u,SR,i4=(SR=class extends Ju{constructor(){super();Je(this,Ql);Je(this,Fs);Je(this,_u);_e(this,_u,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,Fs)||this.setEventListener(Z(this,_u))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Fs))==null||t.call(this),_e(this,Fs,void 0))}setEventListener(t){var n;_e(this,_u,t),(n=Z(this,Fs))==null||n.call(this),_e(this,Fs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Ql)!==t&&(_e(this,Ql,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Z(this,Ql)=="boolean"?Z(this,Ql):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ql=new WeakMap,Fs=new WeakMap,_u=new WeakMap,SR),n1=new i4,s4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},qs,e1,ER,l4=(ER=class{constructor(){Je(this,qs,s4);Je(this,e1,!1)}setTimeoutProvider(e){_e(this,qs,e)}setTimeout(e,t){return Z(this,qs).setTimeout(e,t)}clearTimeout(e){Z(this,qs).clearTimeout(e)}setInterval(e,t){return Z(this,qs).setInterval(e,t)}clearInterval(e){Z(this,qs).clearInterval(e)}},qs=new WeakMap,e1=new WeakMap,ER),Yl=new l4;function o4(e){setTimeout(e,0)}var u4=typeof window>"u"||"Deno"in globalThis;function Sr(){}function c4(e,t){return typeof e=="function"?e(t):e}function q0(e){return typeof e=="number"&&e>=0&&e!==1/0}function _R(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zs(e,t){return typeof e=="function"?e(t):e}function ya(e,t){return typeof e=="function"?e(t):e}function MC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==r1(l,t.options))return!1}else if(!zf(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function OC(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(oo(t.options.mutationKey)!==oo(i))return!1}else if(!zf(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function r1(e,t){return((t==null?void 0:t.queryKeyHashFn)||oo)(e)}function oo(e){return JSON.stringify(e,(t,n)=>U0(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function zf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>zf(e[n],t[n])):!1}var f4=Object.prototype.hasOwnProperty;function BR(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=LC(e)&&LC(t);if(!r&&!(U0(e)&&U0(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,f=r?new Array(o):{};let c=0;for(let d=0;d<o;d++){const v=r?d:l[d],m=e[v],y=t[v];if(m===y){f[v]=m,(r?d<i:f4.call(e,v))&&c++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[v]=y;continue}const x=BR(m,y,n+1);f[v]=x,x===m&&c++}return i===o&&c===i?e:f}function zv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function LC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function U0(e){if(!_C(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_C(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _C(e){return Object.prototype.toString.call(e)==="[object Object]"}function d4(e){return new Promise(t=>{Yl.setTimeout(t,e)})}function V0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BR(e,t):t}function h4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function v4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var a1=Symbol();function PR(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===a1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function i1(e,t){return typeof e=="function"?e(...t):!!e}function p4(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var If=(()=>{let e=()=>u4;return{isServer(){return e()},setIsServer(t){e=t}}})();function H0(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var m4=o4;function g4(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=m4;const i=o=>{t?e.push(o):a(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(f=>{n(f)})})})};return{batch:o=>{let f;t++;try{f=o()}finally{t--,t||l()}return f},batchCalls:o=>(...f)=>{i(()=>{o(...f)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var zn=g4(),Bu,Us,Pu,CR,y4=(CR=class extends Ju{constructor(){super();Je(this,Bu,!0);Je(this,Us);Je(this,Pu);_e(this,Pu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,Us)||this.setEventListener(Z(this,Pu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Us))==null||t.call(this),_e(this,Us,void 0))}setEventListener(t){var n;_e(this,Pu,t),(n=Z(this,Us))==null||n.call(this),_e(this,Us,t(this.setOnline.bind(this)))}setOnline(t){Z(this,Bu)!==t&&(_e(this,Bu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,Bu)}},Bu=new WeakMap,Us=new WeakMap,Pu=new WeakMap,CR),Iv=new y4;function x4(e){return Math.min(1e3*2**e,3e4)}function zR(e){return(e??"online")==="online"?Iv.isOnline():!0}var G0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function IR(e){let t=!1,n=0,r;const a=H0(),i=()=>a.status!=="pending",l=w=>{var S;if(!i()){const b=new G0(w);m(b),(S=e.onCancel)==null||S.call(e,b)}},o=()=>{t=!0},f=()=>{t=!1},c=()=>n1.isFocused()&&(e.networkMode==="always"||Iv.isOnline())&&e.canRun(),d=()=>zR(e.networkMode)&&e.canRun(),v=w=>{i()||(r==null||r(),a.resolve(w))},m=w=>{i()||(r==null||r(),a.reject(w))},y=()=>new Promise(w=>{var S;r=b=>{(i()||c())&&w(b)},(S=e.onPause)==null||S.call(e)}).then(()=>{var w;r=void 0,i()||(w=e.onContinue)==null||w.call(e)}),x=()=>{if(i())return;let w;const S=n===0?e.initialPromise:void 0;try{w=S??e.fn()}catch(b){w=Promise.reject(b)}Promise.resolve(w).then(v).catch(b=>{var R;if(i())return;const C=e.retry??(If.isServer()?0:3),T=e.retryDelay??x4,N=typeof T=="function"?T(n,b):T,A=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,b);if(t||!A){m(b);return}n++,(R=e.onFail)==null||R.call(e,n,b),d4(N).then(()=>c()?void 0:y()).then(()=>{t?m(b):x()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:f,canStart:d,start:()=>(d()?x():y().then(x),a)}}var Wl,TR,FR=(TR=class{constructor(){Je(this,Wl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),q0(this.gcTime)&&_e(this,Wl,Yl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(If.isServer()?1/0:300*1e3))}clearGcTimeout(){Z(this,Wl)&&(Yl.clearTimeout(Z(this,Wl)),_e(this,Wl,void 0))}},Wl=new WeakMap,TR),Zl,zu,ga,Jl,Yn,nd,eo,Zr,qR,_i,kR,b4=(kR=class extends FR{constructor(t){super();Je(this,Zr);Je(this,Zl);Je(this,zu);Je(this,ga);Je(this,Jl);Je(this,Yn);Je(this,nd);Je(this,eo);_e(this,eo,!1),_e(this,nd,t.defaultOptions),this.setOptions(t.options),this.observers=[],_e(this,Jl,t.client),_e(this,ga,Z(this,Jl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,_e(this,Zl,PC(this.options)),this.state=t.state??Z(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Z(this,Yn))==null?void 0:t.promise}setOptions(t){if(this.options={...Z(this,nd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=PC(this.options);n.data!==void 0&&(this.setState(BC(n.data,n.dataUpdatedAt)),_e(this,Zl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,ga).remove(this)}setData(t,n){const r=V0(this.state.data,t,this.options);return pt(this,Zr,_i).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){pt(this,Zr,_i).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=Z(this,Yn))==null?void 0:r.promise;return(a=Z(this,Yn))==null||a.cancel(t),n?n.then(Sr).catch(Sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Z(this,Zl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>ya(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===a1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Zs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!_R(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Yn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Yn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Z(this,ga).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Z(this,Yn)&&(Z(this,eo)||pt(this,Zr,qR).call(this)?Z(this,Yn).cancel({revert:!0}):Z(this,Yn).cancelRetry()),this.scheduleGc()),Z(this,ga).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pt(this,Zr,_i).call(this,{type:"invalidate"})}async fetch(t,n){var f,c,d,v,m,y,x,w,S,b,C,T;if(this.state.fetchStatus!=="idle"&&((f=Z(this,Yn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Yn))return Z(this,Yn).continueRetry(),Z(this,Yn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const N=this.observers.find(A=>A.options.queryFn);N&&this.setOptions(N.options)}const r=new AbortController,a=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(_e(this,eo,!0),r.signal)})},i=()=>{const N=PR(this.options,n),R=(()=>{const D={client:Z(this,Jl),queryKey:this.queryKey,meta:this.meta};return a(D),D})();return _e(this,eo,!1),this.options.persister?this.options.persister(N,R,this):N(R)},o=(()=>{const N={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Z(this,Jl),state:this.state,fetchFn:i};return a(N),N})();(c=this.options.behavior)==null||c.onFetch(o,this),_e(this,zu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&pt(this,Zr,_i).call(this,{type:"fetch",meta:(v=o.fetchOptions)==null?void 0:v.meta}),_e(this,Yn,IR({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:N=>{N instanceof G0&&N.revert&&this.setState({...Z(this,zu),fetchStatus:"idle"}),r.abort()},onFail:(N,A)=>{pt(this,Zr,_i).call(this,{type:"failed",failureCount:N,error:A})},onPause:()=>{pt(this,Zr,_i).call(this,{type:"pause"})},onContinue:()=>{pt(this,Zr,_i).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const N=await Z(this,Yn).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(y=(m=Z(this,ga).config).onSuccess)==null||y.call(m,N,this),(w=(x=Z(this,ga).config).onSettled)==null||w.call(x,N,this.state.error,this),N}catch(N){if(N instanceof G0){if(N.silent)return Z(this,Yn).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw pt(this,Zr,_i).call(this,{type:"error",error:N}),(b=(S=Z(this,ga).config).onError)==null||b.call(S,N,this),(T=(C=Z(this,ga).config).onSettled)==null||T.call(C,this.state.data,N,this),N}finally{this.scheduleGc()}}},Zl=new WeakMap,zu=new WeakMap,ga=new WeakMap,Jl=new WeakMap,Yn=new WeakMap,nd=new WeakMap,eo=new WeakMap,Zr=new WeakSet,qR=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},_i=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...UR(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...BC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return _e(this,zu,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),zn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Z(this,ga).notify({query:this,type:"updated",action:t})})},kR);function UR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function PC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Pr,Nt,rd,br,to,Iu,zi,Vs,ad,Fu,qu,no,ro,Hs,Uu,Pt,kf,$0,K0,Y0,X0,Q0,W0,Z0,VR,NR,w4=(NR=class extends Ju{constructor(t,n){super();Je(this,Pt);Je(this,Pr);Je(this,Nt);Je(this,rd);Je(this,br);Je(this,to);Je(this,Iu);Je(this,zi);Je(this,Vs);Je(this,ad);Je(this,Fu);Je(this,qu);Je(this,no);Je(this,ro);Je(this,Hs);Je(this,Uu,new Set);this.options=n,_e(this,Pr,t),_e(this,Vs,null),_e(this,zi,H0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,Nt).addObserver(this),zC(Z(this,Nt),this.options)?pt(this,Pt,kf).call(this):this.updateResult(),pt(this,Pt,X0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J0(Z(this,Nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J0(Z(this,Nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pt(this,Pt,Q0).call(this),pt(this,Pt,W0).call(this),Z(this,Nt).removeObserver(this)}setOptions(t){const n=this.options,r=Z(this,Nt);if(this.options=Z(this,Pr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ya(this.options.enabled,Z(this,Nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pt(this,Pt,Z0).call(this),Z(this,Nt).setOptions(this.options),n._defaulted&&!zv(this.options,n)&&Z(this,Pr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,Nt),observer:this});const a=this.hasListeners();a&&IC(Z(this,Nt),r,this.options,n)&&pt(this,Pt,kf).call(this),this.updateResult(),a&&(Z(this,Nt)!==r||ya(this.options.enabled,Z(this,Nt))!==ya(n.enabled,Z(this,Nt))||Zs(this.options.staleTime,Z(this,Nt))!==Zs(n.staleTime,Z(this,Nt)))&&pt(this,Pt,$0).call(this);const i=pt(this,Pt,K0).call(this);a&&(Z(this,Nt)!==r||ya(this.options.enabled,Z(this,Nt))!==ya(n.enabled,Z(this,Nt))||i!==Z(this,Hs))&&pt(this,Pt,Y0).call(this,i)}getOptimisticResult(t){const n=Z(this,Pr).getQueryCache().build(Z(this,Pr),t),r=this.createResult(n,t);return E4(this,r)&&(_e(this,br,r),_e(this,Iu,this.options),_e(this,to,Z(this,Nt).state)),r}getCurrentResult(){return Z(this,br)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Z(this,zi).status==="pending"&&Z(this,zi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){Z(this,Uu).add(t)}getCurrentQuery(){return Z(this,Nt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,Pr).defaultQueryOptions(t),r=Z(this,Pr).getQueryCache().build(Z(this,Pr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return pt(this,Pt,kf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,br)))}createResult(t,n){var _;const r=Z(this,Nt),a=this.options,i=Z(this,br),l=Z(this,to),o=Z(this,Iu),c=t!==r?t.state:Z(this,rd),{state:d}=t;let v={...d},m=!1,y;if(n._optimisticResults){const M=this.hasListeners(),z=!M&&zC(t,n),P=M&&IC(t,r,n,a);(z||P)&&(v={...v,...UR(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:S}=v;y=v.data;let b=!1;if(n.placeholderData!==void 0&&y===void 0&&S==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(M=i.data,b=!0):M=typeof n.placeholderData=="function"?n.placeholderData((_=Z(this,qu))==null?void 0:_.state.data,Z(this,qu)):n.placeholderData,M!==void 0&&(S="success",y=V0(i==null?void 0:i.data,M,n),m=!0)}if(n.select&&y!==void 0&&!b)if(i&&y===(l==null?void 0:l.data)&&n.select===Z(this,ad))y=Z(this,Fu);else try{_e(this,ad,n.select),y=n.select(y),y=V0(i==null?void 0:i.data,y,n),_e(this,Fu,y),_e(this,Vs,null)}catch(M){_e(this,Vs,M)}Z(this,Vs)&&(x=Z(this,Vs),y=Z(this,Fu),w=Date.now(),S="error");const C=v.fetchStatus==="fetching",T=S==="pending",N=S==="error",A=T&&C,R=y!==void 0,L={status:S,fetchStatus:v.fetchStatus,isPending:T,isSuccess:S==="success",isError:N,isInitialLoading:A,isLoading:A,data:y,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:v.dataUpdateCount>c.dataUpdateCount||v.errorUpdateCount>c.errorUpdateCount,isFetching:C,isRefetching:C&&!T,isLoadingError:N&&!R,isPaused:v.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:N&&R,isStale:s1(t,n),refetch:this.refetch,promise:Z(this,zi),isEnabled:ya(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=L.data!==void 0,z=L.status==="error"&&!M,P=F=>{z?F.reject(L.error):M&&F.resolve(L.data)},G=()=>{const F=_e(this,zi,L.promise=H0());P(F)},I=Z(this,zi);switch(I.status){case"pending":t.queryHash===r.queryHash&&P(I);break;case"fulfilled":(z||L.data!==I.value)&&G();break;case"rejected":(!z||L.error!==I.reason)&&G();break}}return L}updateResult(){const t=Z(this,br),n=this.createResult(Z(this,Nt),this.options);if(_e(this,to,Z(this,Nt).state),_e(this,Iu,this.options),Z(this,to).data!==void 0&&_e(this,qu,Z(this,Nt)),zv(n,t))return;_e(this,br,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!Z(this,Uu).size)return!0;const l=new Set(i??Z(this,Uu));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,br)).some(o=>{const f=o;return Z(this,br)[f]!==t[f]&&l.has(f)})};pt(this,Pt,VR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pt(this,Pt,X0).call(this)}},Pr=new WeakMap,Nt=new WeakMap,rd=new WeakMap,br=new WeakMap,to=new WeakMap,Iu=new WeakMap,zi=new WeakMap,Vs=new WeakMap,ad=new WeakMap,Fu=new WeakMap,qu=new WeakMap,no=new WeakMap,ro=new WeakMap,Hs=new WeakMap,Uu=new WeakMap,Pt=new WeakSet,kf=function(t){pt(this,Pt,Z0).call(this);let n=Z(this,Nt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Sr)),n},$0=function(){pt(this,Pt,Q0).call(this);const t=Zs(this.options.staleTime,Z(this,Nt));if(If.isServer()||Z(this,br).isStale||!q0(t))return;const r=_R(Z(this,br).dataUpdatedAt,t)+1;_e(this,no,Yl.setTimeout(()=>{Z(this,br).isStale||this.updateResult()},r))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,Nt)):this.options.refetchInterval)??!1},Y0=function(t){pt(this,Pt,W0).call(this),_e(this,Hs,t),!(If.isServer()||ya(this.options.enabled,Z(this,Nt))===!1||!q0(Z(this,Hs))||Z(this,Hs)===0)&&_e(this,ro,Yl.setInterval(()=>{(this.options.refetchIntervalInBackground||n1.isFocused())&&pt(this,Pt,kf).call(this)},Z(this,Hs)))},X0=function(){pt(this,Pt,$0).call(this),pt(this,Pt,Y0).call(this,pt(this,Pt,K0).call(this))},Q0=function(){Z(this,no)&&(Yl.clearTimeout(Z(this,no)),_e(this,no,void 0))},W0=function(){Z(this,ro)&&(Yl.clearInterval(Z(this,ro)),_e(this,ro,void 0))},Z0=function(){const t=Z(this,Pr).getQueryCache().build(Z(this,Pr),this.options);if(t===Z(this,Nt))return;const n=Z(this,Nt);_e(this,Nt,t),_e(this,rd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},VR=function(t){zn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,br))}),Z(this,Pr).getQueryCache().notify({query:Z(this,Nt),type:"observerResultsUpdated"})})},NR);function S4(e,t){return ya(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zC(e,t){return S4(e,t)||e.state.data!==void 0&&J0(e,t,t.refetchOnMount)}function J0(e,t,n){if(ya(t.enabled,e)!==!1&&Zs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&s1(e,t)}return!1}function IC(e,t,n,r){return(e!==t||ya(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&s1(e,n)}function s1(e,t){return ya(t.enabled,e)!==!1&&e.isStaleByTime(Zs(t.staleTime,e))}function E4(e,t){return!zv(e.getCurrentResult(),t)}function FC(e){return{onFetch:(t,n)=>{var d,v,m,y,x;const r=t.options,a=(m=(v=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:v.fetchMore)==null?void 0:m.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},f=0;const c=async()=>{let w=!1;const S=T=>{p4(T,()=>t.signal,()=>w=!0)},b=PR(t.options,t.fetchOptions),C=async(T,N,A)=>{if(w)return Promise.reject();if(N==null&&T.pages.length)return Promise.resolve(T);const D=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:N,direction:A?"backward":"forward",meta:t.options.meta};return S(z),z})(),L=await b(D),{maxPages:_}=t.options,M=A?v4:h4;return{pages:M(T.pages,L,_),pageParams:M(T.pageParams,N,_)}};if(a&&i.length){const T=a==="backward",N=T?C4:qC,A={pages:i,pageParams:l},R=N(r,A);o=await C(A,R,T)}else{const T=e??i.length;do{const N=f===0?l[0]??r.initialPageParam:qC(r,o);if(f>0&&N==null)break;o=await C(o,N),f++}while(f<T)}return o};t.options.persister?t.fetchFn=()=>{var w,S;return(S=(w=t.options).persister)==null?void 0:S.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function qC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function C4(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var id,Za,dr,ao,Ja,Ps,AR,T4=(AR=class extends FR{constructor(t){super();Je(this,Ja);Je(this,id);Je(this,Za);Je(this,dr);Je(this,ao);_e(this,id,t.client),this.mutationId=t.mutationId,_e(this,dr,t.mutationCache),_e(this,Za,[]),this.state=t.state||HR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,Za).includes(t)||(Z(this,Za).push(t),this.clearGcTimeout(),Z(this,dr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){_e(this,Za,Z(this,Za).filter(n=>n!==t)),this.scheduleGc(),Z(this,dr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,Za).length||(this.state.status==="pending"?this.scheduleGc():Z(this,dr).remove(this))}continue(){var t;return((t=Z(this,ao))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,f,c,d,v,m,y,x,w,S,b,C,T,N,A,R,D;const n=()=>{pt(this,Ja,Ps).call(this,{type:"continue"})},r={client:Z(this,id),meta:this.options.meta,mutationKey:this.options.mutationKey};_e(this,ao,IR({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,_)=>{pt(this,Ja,Ps).call(this,{type:"failed",failureCount:L,error:_})},onPause:()=>{pt(this,Ja,Ps).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,dr).canRun(this)}));const a=this.state.status==="pending",i=!Z(this,ao).canStart();try{if(a)n();else{pt(this,Ja,Ps).call(this,{type:"pending",variables:t,isPaused:i}),Z(this,dr).config.onMutate&&await Z(this,dr).config.onMutate(t,this,r);const _=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));_!==this.state.context&&pt(this,Ja,Ps).call(this,{type:"pending",context:_,variables:t,isPaused:i})}const L=await Z(this,ao).start();return await((c=(f=Z(this,dr).config).onSuccess)==null?void 0:c.call(f,L,t,this.state.context,this,r)),await((v=(d=this.options).onSuccess)==null?void 0:v.call(d,L,t,this.state.context,r)),await((y=(m=Z(this,dr).config).onSettled)==null?void 0:y.call(m,L,null,this.state.variables,this.state.context,this,r)),await((w=(x=this.options).onSettled)==null?void 0:w.call(x,L,null,t,this.state.context,r)),pt(this,Ja,Ps).call(this,{type:"success",data:L}),L}catch(L){try{await((b=(S=Z(this,dr).config).onError)==null?void 0:b.call(S,L,t,this.state.context,this,r))}catch(_){Promise.reject(_)}try{await((T=(C=this.options).onError)==null?void 0:T.call(C,L,t,this.state.context,r))}catch(_){Promise.reject(_)}try{await((A=(N=Z(this,dr).config).onSettled)==null?void 0:A.call(N,void 0,L,this.state.variables,this.state.context,this,r))}catch(_){Promise.reject(_)}try{await((D=(R=this.options).onSettled)==null?void 0:D.call(R,void 0,L,t,this.state.context,r))}catch(_){Promise.reject(_)}throw pt(this,Ja,Ps).call(this,{type:"error",error:L}),L}finally{Z(this,dr).runNext(this)}}},id=new WeakMap,Za=new WeakMap,dr=new WeakMap,ao=new WeakMap,Ja=new WeakSet,Ps=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),zn.batch(()=>{Z(this,Za).forEach(r=>{r.onMutationUpdate(t)}),Z(this,dr).notify({mutation:this,type:"updated",action:t})})},AR);function HR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ii,Da,sd,RR,k4=(RR=class extends Ju{constructor(t={}){super();Je(this,Ii);Je(this,Da);Je(this,sd);this.config=t,_e(this,Ii,new Set),_e(this,Da,new Map),_e(this,sd,0)}build(t,n,r){const a=new T4({client:t,mutationCache:this,mutationId:++Gh(this,sd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){Z(this,Ii).add(t);const n=$h(t);if(typeof n=="string"){const r=Z(this,Da).get(n);r?r.push(t):Z(this,Da).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Z(this,Ii).delete(t)){const n=$h(t);if(typeof n=="string"){const r=Z(this,Da).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&Z(this,Da).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=$h(t);if(typeof n=="string"){const r=Z(this,Da).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=$h(t);if(typeof n=="string"){const a=(r=Z(this,Da).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zn.batch(()=>{Z(this,Ii).forEach(t=>{this.notify({type:"removed",mutation:t})}),Z(this,Ii).clear(),Z(this,Da).clear()})}getAll(){return Array.from(Z(this,Ii))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>OC(n,r))}findAll(t={}){return this.getAll().filter(n=>OC(t,n))}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Sr))))}},Ii=new WeakMap,Da=new WeakMap,sd=new WeakMap,RR);function $h(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fi,Gs,zr,qi,Vi,bv,eb,jR,N4=(jR=class extends Ju{constructor(n,r){super();Je(this,Vi);Je(this,Fi);Je(this,Gs);Je(this,zr);Je(this,qi);_e(this,Fi,n),this.setOptions(r),this.bindMethods(),pt(this,Vi,bv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=Z(this,Fi).defaultMutationOptions(n),zv(this.options,r)||Z(this,Fi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Z(this,zr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&oo(r.mutationKey)!==oo(this.options.mutationKey)?this.reset():((a=Z(this,zr))==null?void 0:a.state.status)==="pending"&&Z(this,zr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Z(this,zr))==null||n.removeObserver(this)}onMutationUpdate(n){pt(this,Vi,bv).call(this),pt(this,Vi,eb).call(this,n)}getCurrentResult(){return Z(this,Gs)}reset(){var n;(n=Z(this,zr))==null||n.removeObserver(this),_e(this,zr,void 0),pt(this,Vi,bv).call(this),pt(this,Vi,eb).call(this)}mutate(n,r){var a;return _e(this,qi,r),(a=Z(this,zr))==null||a.removeObserver(this),_e(this,zr,Z(this,Fi).getMutationCache().build(Z(this,Fi),this.options)),Z(this,zr).addObserver(this),Z(this,zr).execute(n)}},Fi=new WeakMap,Gs=new WeakMap,zr=new WeakMap,qi=new WeakMap,Vi=new WeakSet,bv=function(){var r;const n=((r=Z(this,zr))==null?void 0:r.state)??HR();_e(this,Gs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},eb=function(n){zn.batch(()=>{var r,a,i,l,o,f,c,d;if(Z(this,qi)&&this.hasListeners()){const v=Z(this,Gs).variables,m=Z(this,Gs).context,y={client:Z(this,Fi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=Z(this,qi)).onSuccess)==null||a.call(r,n.data,v,m,y)}catch(x){Promise.reject(x)}try{(l=(i=Z(this,qi)).onSettled)==null||l.call(i,n.data,null,v,m,y)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(o=Z(this,qi)).onError)==null||f.call(o,n.error,v,m,y)}catch(x){Promise.reject(x)}try{(d=(c=Z(this,qi)).onSettled)==null||d.call(c,void 0,n.error,v,m,y)}catch(x){Promise.reject(x)}}}this.listeners.forEach(v=>{v(Z(this,Gs))})})},jR),ei,DR,A4=(DR=class extends Ju{constructor(t={}){super();Je(this,ei);this.config=t,_e(this,ei,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??r1(a,n);let l=this.get(i);return l||(l=new b4({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){Z(this,ei).has(t.queryHash)||(Z(this,ei).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,ei).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,ei).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,ei).get(t)}getAll(){return[...Z(this,ei).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>MC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>MC(t,r)):n}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ei=new WeakMap,DR),gn,$s,Ks,Vu,Hu,Ys,Gu,$u,MR,R4=(MR=class{constructor(e={}){Je(this,gn);Je(this,$s);Je(this,Ks);Je(this,Vu);Je(this,Hu);Je(this,Ys);Je(this,Gu);Je(this,$u);_e(this,gn,e.queryCache||new A4),_e(this,$s,e.mutationCache||new k4),_e(this,Ks,e.defaultOptions||{}),_e(this,Vu,new Map),_e(this,Hu,new Map),_e(this,Ys,0)}mount(){Gh(this,Ys)._++,Z(this,Ys)===1&&(_e(this,Gu,n1.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,gn).onFocus())})),_e(this,$u,Iv.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,gn).onOnline())})))}unmount(){var e,t;Gh(this,Ys)._--,Z(this,Ys)===0&&((e=Z(this,Gu))==null||e.call(this),_e(this,Gu,void 0),(t=Z(this,$u))==null||t.call(this),_e(this,$u,void 0))}isFetching(e){return Z(this,gn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,$s).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,gn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Z(this,gn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Zs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Z(this,gn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=Z(this,gn).get(r.queryHash),i=a==null?void 0:a.state.data,l=c4(t,i);if(l!==void 0)return Z(this,gn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return zn.batch(()=>Z(this,gn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,gn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Z(this,gn);zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,gn);return zn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zn.batch(()=>Z(this,gn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Sr).catch(Sr)}invalidateQueries(e,t={}){return zn.batch(()=>(Z(this,gn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=zn.batch(()=>Z(this,gn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Sr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,gn).build(this,t);return n.isStaleByTime(Zs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sr).catch(Sr)}fetchInfiniteQuery(e){return e.behavior=FC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sr).catch(Sr)}ensureInfiniteQueryData(e){return e.behavior=FC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Iv.isOnline()?Z(this,$s).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,gn)}getMutationCache(){return Z(this,$s)}getDefaultOptions(){return Z(this,Ks)}setDefaultOptions(e){_e(this,Ks,e)}setQueryDefaults(e,t){Z(this,Vu).set(oo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,Vu).values()],n={};return t.forEach(r=>{zf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Z(this,Hu).set(oo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,Hu).values()],n={};return t.forEach(r=>{zf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Z(this,Ks).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=r1(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===a1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,Ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,gn).clear(),Z(this,$s).clear()}},gn=new WeakMap,$s=new WeakMap,Ks=new WeakMap,Vu=new WeakMap,Hu=new WeakMap,Ys=new WeakMap,Gu=new WeakMap,$u=new WeakMap,MR),GR=j.createContext(void 0),Ca=e=>{const t=j.useContext(GR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},j4=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(GR.Provider,{value:e,children:t})),$R=j.createContext(!1),D4=()=>j.useContext($R);$R.Provider;function M4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var O4=j.createContext(M4()),L4=()=>j.useContext(O4),_4=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?i1(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},B4=e=>{j.useEffect(()=>{e.clearReset()},[e])},P4=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||i1(n,[e.error,r])),z4=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},I4=(e,t)=>e.isLoading&&e.isFetching&&!t,F4=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,UC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function q4(e,t,n){var m,y,x,w;const r=D4(),a=L4(),i=Ca(),l=i.defaultQueryOptions(e);(y=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||y.call(m,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",z4(l),_4(l,a,o),B4(a);const f=!i.getQueryCache().get(l.queryHash),[c]=j.useState(()=>new t(i,l)),d=c.getOptimisticResult(l),v=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(S=>{const b=v?c.subscribe(zn.batchCalls(S)):Sr;return c.updateResult(),b},[c,v]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),j.useEffect(()=>{c.setOptions(l)},[l,c]),F4(l,d))throw UC(l,c,a);if(P4({result:d,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw d.error;if((w=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||w.call(x,l,d),l.experimental_prefetchInRender&&!If.isServer()&&I4(d,r)){const S=f?UC(l,c,a):o==null?void 0:o.promise;S==null||S.catch(Sr).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?d:c.trackResult(d)}function Tn(e,t){return q4(e,w4)}function vl(e,t){const n=Ca(),[r]=j.useState(()=>new N4(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);const a=j.useSyncExternalStore(j.useCallback(l=>r.subscribe(zn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=j.useCallback((l,o)=>{r.mutate(l,o).catch(Sr)},[r]);if(a.error&&i1(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
|
|
50
|
+
* react-router v7.13.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var VC="popstate";function HC(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function U4(e={}){function t(r,a){var c;let i=(c=a.state)==null?void 0:c.masked,{pathname:l,search:o,hash:f}=i||r.location;return tb("",{pathname:l,search:o,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:Ff(a)}return H4(t,n,null,e)}function dn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function li(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function V4(){return Math.random().toString(36).substring(2,10)}function GC(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function tb(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ec(t):t,state:n,key:t&&t.key||r||V4(),unstable_mask:a}}function Ff({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ec(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function H4(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,o="POP",f=null,c=d();c==null&&(c=0,l.replaceState({...l.state,idx:c},""));function d(){return(l.state||{idx:null}).idx}function v(){o="POP";let S=d(),b=S==null?null:S-c;c=S,f&&f({action:o,location:w.location,delta:b})}function m(S,b){o="PUSH";let C=HC(S)?S:tb(w.location,S,b);c=d()+1;let T=GC(C,c),N=w.createHref(C.unstable_mask||C);try{l.pushState(T,"",N)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(N)}i&&f&&f({action:o,location:w.location,delta:1})}function y(S,b){o="REPLACE";let C=HC(S)?S:tb(w.location,S,b);c=d();let T=GC(C,c),N=w.createHref(C.unstable_mask||C);l.replaceState(T,"",N),i&&f&&f({action:o,location:w.location,delta:0})}function x(S){return G4(S)}let w={get action(){return o},get location(){return e(a,l)},listen(S){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(VC,v),f=S,()=>{a.removeEventListener(VC,v),f=null}},createHref(S){return t(a,S)},createURL:x,encodeLocation(S){let b=x(S);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:m,replace:y,go(S){return l.go(S)}};return w}function G4(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),dn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ff(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function KR(e,t,n="/"){return $4(e,t,n,!1)}function $4(e,t,n,r){let a=typeof t=="string"?ec(t):t,i=Hi(a.pathname||"/",n);if(i==null)return null;let l=YR(e);K4(l);let o=null;for(let f=0;o==null&&f<l.length;++f){let c=aB(i);o=nB(l[f],c,r)}return o}function YR(e,t=[],n=[],r="",a=!1){let i=(l,o,f=a,c)=>{let d={relativePath:c===void 0?l.path||"":c,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&f)return;dn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let v=ii([r,d.relativePath]),m=n.concat(d);l.children&&l.children.length>0&&(dn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),YR(l.children,t,m,v,f)),!(l.path==null&&!l.index)&&t.push({path:v,score:eB(v,l.index),routesMeta:m})};return e.forEach((l,o)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,o);else for(let c of XR(l.path))i(l,o,!0,c)}),t}function XR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=XR(r.join("/")),o=[];return o.push(...l.map(f=>f===""?i:[i,f].join("/"))),a&&o.push(...l),o.map(f=>e.startsWith("/")&&f===""?"/":f)}function K4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:tB(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Y4=/^:[\w-]+$/,X4=3,Q4=2,W4=1,Z4=10,J4=-2,$C=e=>e==="*";function eB(e,t){let n=e.split("/"),r=n.length;return n.some($C)&&(r+=J4),t&&(r+=Q4),n.filter(a=>!$C(a)).reduce((a,i)=>a+(Y4.test(i)?X4:i===""?W4:Z4),r)}function tB(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function nB(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",l=[];for(let o=0;o<r.length;++o){let f=r[o],c=o===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",v=Fv({path:f.relativePath,caseSensitive:f.caseSensitive,end:c},d),m=f.route;if(!v&&c&&n&&!r[r.length-1].route.index&&(v=Fv({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},d)),!v)return null;Object.assign(a,v.params),l.push({params:a,pathname:ii([i,v.pathname]),pathnameBase:oB(ii([i,v.pathnameBase])),route:m}),v.pathnameBase!=="/"&&(i=ii([i,v.pathnameBase]))}return l}function Fv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=rB(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((c,{paramName:d,isOptional:v},m)=>{if(d==="*"){let x=o[m]||"";l=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const y=o[m];return v&&!y?c[d]=void 0:c[d]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:l,pattern:e}}function rB(e,t=!1,n=!0){li(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,f,c,d)=>{if(r.push({paramName:o,isOptional:f!=null}),f){let v=d.charAt(c+l.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function aB(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return li(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Hi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var iB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function sB(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?ec(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=KC(n.substring(1),"/"):i=KC(n,t)):i=t,{pathname:i,search:uB(r),hash:cB(a)}}function KC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Cy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function lB(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function QR(e){let t=lB(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function l1(e,t,n,r=!1){let a;typeof e=="string"?a=ec(e):(a={...e},dn(!a.pathname||!a.pathname.includes("?"),Cy("?","pathname","search",a)),dn(!a.pathname||!a.pathname.includes("#"),Cy("#","pathname","hash",a)),dn(!a.search||!a.search.includes("#"),Cy("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,o;if(l==null)o=n;else{let v=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),v-=1;a.pathname=m.join("/")}o=v>=0?t[v]:"/"}let f=sB(a,o),c=l&&l!=="/"&&l.endsWith("/"),d=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(c||d)&&(f.pathname+="/"),f}var ii=e=>e.join("/").replace(/\/\/+/g,"/"),oB=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uB=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cB=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,fB=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function dB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function hB(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var WR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ZR(e,t){let n=e;if(typeof n!="string"||!iB.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(WR)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),o=Hi(l.pathname,t);l.origin===i.origin&&o!=null?n=o+l.search+l.hash:a=!0}catch{li(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var JR=["POST","PUT","PATCH","DELETE"];new Set(JR);var vB=["GET",...JR];new Set(vB);var tc=j.createContext(null);tc.displayName="DataRouter";var vp=j.createContext(null);vp.displayName="DataRouterState";var pB=j.createContext(!1),ej=j.createContext({isTransitioning:!1});ej.displayName="ViewTransition";var mB=j.createContext(new Map);mB.displayName="Fetchers";var gB=j.createContext(null);gB.displayName="Await";var Ta=j.createContext(null);Ta.displayName="Navigation";var od=j.createContext(null);od.displayName="Location";var Ia=j.createContext({outlet:null,matches:[],isDataRoute:!1});Ia.displayName="Route";var o1=j.createContext(null);o1.displayName="RouteError";var tj="REACT_ROUTER_ERROR",yB="REDIRECT",xB="ROUTE_ERROR_RESPONSE";function bB(e){if(e.startsWith(`${tj}:${yB}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function wB(e){if(e.startsWith(`${tj}:${xB}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new fB(t.status,t.statusText,t.data)}catch{}}function SB(e,{relative:t}={}){dn(ud(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=j.useContext(Ta),{hash:a,pathname:i,search:l}=cd(e,{relative:t}),o=i;return n!=="/"&&(o=i==="/"?n:ii([n,i])),r.createHref({pathname:o,search:l,hash:a})}function ud(){return j.useContext(od)!=null}function Qi(){return dn(ud(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(od).location}var nj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rj(e){j.useContext(Ta).static||j.useLayoutEffect(e)}function Wi(){let{isDataRoute:e}=j.useContext(Ia);return e?zB():EB()}function EB(){dn(ud(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(tc),{basename:t,navigator:n}=j.useContext(Ta),{matches:r}=j.useContext(Ia),{pathname:a}=Qi(),i=JSON.stringify(QR(r)),l=j.useRef(!1);return rj(()=>{l.current=!0}),j.useCallback((f,c={})=>{if(li(l.current,nj),!l.current)return;if(typeof f=="number"){n.go(f);return}let d=l1(f,JSON.parse(i),a,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:ii([t,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[t,n,i,a,e])}var CB=j.createContext(null);function TB(e){let t=j.useContext(Ia).outlet;return j.useMemo(()=>t&&j.createElement(CB.Provider,{value:e},t),[t,e])}function kB(){let{matches:e}=j.useContext(Ia),t=e[e.length-1];return t?t.params:{}}function cd(e,{relative:t}={}){let{matches:n}=j.useContext(Ia),{pathname:r}=Qi(),a=JSON.stringify(QR(n));return j.useMemo(()=>l1(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function NB(e,t){return aj(e,t)}function aj(e,t,n){var S;dn(ud(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=j.useContext(Ta),{matches:a}=j.useContext(Ia),i=a[a.length-1],l=i?i.params:{},o=i?i.pathname:"/",f=i?i.pathnameBase:"/",c=i&&i.route;{let b=c&&c.path||"";sj(o,!c||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let d=Qi(),v;if(t){let b=typeof t=="string"?ec(t):t;dn(f==="/"||((S=b.pathname)==null?void 0:S.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${b.pathname}" was given in the \`location\` prop.`),v=b}else v=d;let m=v.pathname||"/",y=m;if(f!=="/"){let b=f.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=KR(e,{pathname:y});li(c||x!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),li(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=MB(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:ii([f,r.encodeLocation?r.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?f:ii([f,r.encodeLocation?r.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),a,n);return t&&w?j.createElement(od.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},w):w}function AB(){let e=PB(),t=dB(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:i},"ErrorBoundary")," or"," ",j.createElement("code",{style:i},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:a},n):null,l)}var RB=j.createElement(AB,null),ij=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=wB(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Ia.Provider,{value:this.props.routeContext},j.createElement(o1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(jB,{error:e},t):t}};ij.contextType=pB;var Ty=new WeakMap;function jB({children:e,error:t}){let{basename:n}=j.useContext(Ta);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=bB(t.digest);if(r){let a=Ty.get(t);if(a)throw a;let i=ZR(r.location,n);if(WR&&!Ty.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw Ty.set(t,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function DB({routeContext:e,match:t,children:n}){let r=j.useContext(tc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Ia.Provider,{value:e},n)}function MB(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let d=a.findIndex(v=>v.route.id&&(i==null?void 0:i[v.route.id])!==void 0);dn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,o=-1;if(n&&r){l=r.renderFallback;for(let d=0;d<a.length;d++){let v=a[d];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(o=d),v.route.id){let{loaderData:m,errors:y}=r,x=v.route.loader&&!m.hasOwnProperty(v.route.id)&&(!y||y[v.route.id]===void 0);if(v.route.lazy||x){n.isStatic&&(l=!0),o>=0?a=a.slice(0,o+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,c=r&&f?(d,v)=>{var m,y;f(d,{location:r.location,params:((y=(m=r.matches)==null?void 0:m[0])==null?void 0:y.params)??{},unstable_pattern:hB(r.matches),errorInfo:v})}:void 0;return a.reduceRight((d,v,m)=>{let y,x=!1,w=null,S=null;r&&(y=i&&v.route.id?i[v.route.id]:void 0,w=v.route.errorElement||RB,l&&(o<0&&m===0?(sj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):o===m&&(x=!0,S=v.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,m+1)),C=()=>{let T;return y?T=w:x?T=S:v.route.Component?T=j.createElement(v.route.Component,null):v.route.element?T=v.route.element:T=d,j.createElement(DB,{match:v,routeContext:{outlet:d,matches:b,isDataRoute:r!=null},children:T})};return r&&(v.route.ErrorBoundary||v.route.errorElement||m===0)?j.createElement(ij,{location:r.location,revalidation:r.revalidation,component:w,error:y,children:C(),routeContext:{outlet:null,matches:b,isDataRoute:!0},onError:c}):C()},null)}function u1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function OB(e){let t=j.useContext(tc);return dn(t,u1(e)),t}function LB(e){let t=j.useContext(vp);return dn(t,u1(e)),t}function _B(e){let t=j.useContext(Ia);return dn(t,u1(e)),t}function c1(e){let t=_B(e),n=t.matches[t.matches.length-1];return dn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function BB(){return c1("useRouteId")}function PB(){var r;let e=j.useContext(o1),t=LB("useRouteError"),n=c1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function zB(){let{router:e}=OB("useNavigate"),t=c1("useNavigate"),n=j.useRef(!1);return rj(()=>{n.current=!0}),j.useCallback(async(a,i={})=>{li(n.current,nj),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var YC={};function sj(e,t,n){!t&&!YC[e]&&(YC[e]=!0,li(!1,n))}j.memo(IB);function IB({routes:e,future:t,state:n,isStatic:r,onError:a}){return aj(e,void 0,{state:n,isStatic:r,onError:a})}function FB(e){return TB(e.context)}function Ra(e){dn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function qB({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:l}){dn(!ud(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),f=j.useMemo(()=>({basename:o,navigator:a,static:i,unstable_useTransitions:l,future:{}}),[o,a,i,l]);typeof n=="string"&&(n=ec(n));let{pathname:c="/",search:d="",hash:v="",state:m=null,key:y="default",unstable_mask:x}=n,w=j.useMemo(()=>{let S=Hi(c,o);return S==null?null:{location:{pathname:S,search:d,hash:v,state:m,key:y,unstable_mask:x},navigationType:r}},[o,c,d,v,m,y,r,x]);return li(w!=null,`<Router basename="${o}"> is not able to match the URL "${c}${d}${v}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:j.createElement(Ta.Provider,{value:f},j.createElement(od.Provider,{children:t,value:w}))}function UB({children:e,location:t}){return NB(nb(e),t)}function nb(e,t=[]){let n=[];return j.Children.forEach(e,(r,a)=>{if(!j.isValidElement(r))return;let i=[...t,a];if(r.type===j.Fragment){n.push.apply(n,nb(r.props.children,i));return}dn(r.type===Ra,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),dn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=nb(r.props.children,i)),n.push(l)}),n}var wv="get",Sv="application/x-www-form-urlencoded";function pp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function VB(e){return pp(e)&&e.tagName.toLowerCase()==="button"}function HB(e){return pp(e)&&e.tagName.toLowerCase()==="form"}function GB(e){return pp(e)&&e.tagName.toLowerCase()==="input"}function $B(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KB(e,t){return e.button===0&&(!t||t==="_self")&&!$B(e)}var Kh=null;function YB(){if(Kh===null)try{new FormData(document.createElement("form"),0),Kh=!1}catch{Kh=!0}return Kh}var XB=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ky(e){return e!=null&&!XB.has(e)?(li(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sv}"`),null):e}function QB(e,t){let n,r,a,i,l;if(HB(e)){let o=e.getAttribute("action");r=o?Hi(o,t):null,n=e.getAttribute("method")||wv,a=ky(e.getAttribute("enctype"))||Sv,i=new FormData(e)}else if(VB(e)||GB(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||o.getAttribute("action");if(r=f?Hi(f,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||wv,a=ky(e.getAttribute("formenctype"))||ky(o.getAttribute("enctype"))||Sv,i=new FormData(o,e),!YB()){let{name:c,type:d,value:v}=e;if(d==="image"){let m=c?`${c}.`:"";i.append(`${m}x`,"0"),i.append(`${m}y`,"0")}else c&&i.append(c,v)}}else{if(pp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wv,r=null,a=Sv,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function f1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function WB(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Hi(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function ZB(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function JB(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function eP(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await ZB(i,n);return l.links?l.links():[]}return[]}));return aP(r.flat(1).filter(JB).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function XC(e,t,n,r,a,i){let l=(f,c)=>n[c]?f.route.id!==n[c].route.id:!0,o=(f,c)=>{var d;return n[c].pathname!==f.pathname||((d=n[c].route.path)==null?void 0:d.endsWith("*"))&&n[c].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,c)=>l(f,c)||o(f,c)):i==="data"?t.filter((f,c)=>{var v;let d=r.routes[f.route.id];if(!d||!d.hasLoader)return!1;if(l(f,c)||o(f,c))return!0;if(f.route.shouldRevalidate){let m=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((v=n[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function tP(e,t,{includeHydrateFallback:n}={}){return nP(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function nP(e){return[...new Set(e)]}function rP(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function aP(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(rP(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function lj(){let e=j.useContext(tc);return f1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function iP(){let e=j.useContext(vp);return f1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var d1=j.createContext(void 0);d1.displayName="FrameworkContext";function oj(){let e=j.useContext(d1);return f1(e,"You must render this element inside a <HydratedRouter> element"),e}function sP(e,t){let n=j.useContext(d1),[r,a]=j.useState(!1),[i,l]=j.useState(!1),{onFocus:o,onBlur:f,onMouseEnter:c,onMouseLeave:d,onTouchStart:v}=t,m=j.useRef(null);j.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=b=>{b.forEach(C=>{l(C.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return m.current&&S.observe(m.current),()=>{S.disconnect()}}},[e]),j.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let y=()=>{a(!0)},x=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,m,{}]:[i,m,{onFocus:uf(o,y),onBlur:uf(f,x),onMouseEnter:uf(c,y),onMouseLeave:uf(d,x),onTouchStart:uf(v,y)}]:[!1,m,{}]}function uf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function lP({page:e,...t}){let{router:n}=lj(),r=j.useMemo(()=>KR(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?j.createElement(uP,{page:e,matches:r,...t}):null}function oP(e){let{manifest:t,routeModules:n}=oj(),[r,a]=j.useState([]);return j.useEffect(()=>{let i=!1;return eP(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function uP({page:e,matches:t,...n}){let r=Qi(),{future:a,manifest:i,routeModules:l}=oj(),{basename:o}=lj(),{loaderData:f,matches:c}=iP(),d=j.useMemo(()=>XC(e,t,c,i,r,"data"),[e,t,c,i,r]),v=j.useMemo(()=>XC(e,t,c,i,r,"assets"),[e,t,c,i,r]),m=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(C=>{var N;let T=i.routes[C.route.id];!T||!T.hasLoader||(!d.some(A=>A.route.id===C.route.id)&&C.route.id in f&&((N=l[C.route.id])!=null&&N.shouldRevalidate)||T.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let b=WB(e,o,a.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&b.searchParams.set("_routes",t.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[b.pathname+b.search]},[o,a.unstable_trailingSlashAwareDataRequests,f,r,i,d,t,e,l]),y=j.useMemo(()=>tP(v,i),[v,i]),x=oP(v);return j.createElement(j.Fragment,null,m.map(w=>j.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),y.map(w=>j.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),x.map(({key:w,link:S})=>j.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function cP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var fP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fP&&(window.__reactRouterVersion="7.13.1")}catch{}function dP({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=j.useRef();a.current==null&&(a.current=U4({window:r,v5Compat:!0}));let i=a.current,[l,o]=j.useState({action:i.action,location:i.location}),f=j.useCallback(c=>{n===!1?o(c):j.startTransition(()=>o(c))},[n]);return j.useLayoutEffect(()=>i.listen(f),[i,f]),j.createElement(qB,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var uj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mp=j.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,unstable_mask:o,state:f,target:c,to:d,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:y,...x},w){let{basename:S,navigator:b,unstable_useTransitions:C}=j.useContext(Ta),T=typeof d=="string"&&uj.test(d),N=ZR(d,S);d=N.to;let A=SB(d,{relative:a}),R=Qi(),D=null;if(o){let F=l1(o,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);S!=="/"&&(F.pathname=F.pathname==="/"?S:ii([S,F.pathname])),D=b.createHref(F)}let[L,_,M]=sP(r,x),z=pP(d,{replace:l,unstable_mask:o,state:f,target:c,preventScrollReset:v,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:y,unstable_useTransitions:C});function P(F){t&&t(F),F.defaultPrevented||z(F)}let G=!(N.isExternal||i),I=j.createElement("a",{...x,...M,href:(G?D:void 0)||N.absoluteURL||A,onClick:G?P:t,ref:cP(w,_),target:c,"data-discover":!T&&n==="render"?"true":void 0});return L&&!T?j.createElement(j.Fragment,null,I,j.createElement(lP,{page:A})):I});mp.displayName="Link";var cj=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:o,children:f,...c},d){let v=cd(l,{relative:c.relative}),m=Qi(),y=j.useContext(vp),{navigator:x,basename:w}=j.useContext(Ta),S=y!=null&&bP(v)&&o===!0,b=x.encodeLocation?x.encodeLocation(v).pathname:v.pathname,C=m.pathname,T=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(C=C.toLowerCase(),T=T?T.toLowerCase():null,b=b.toLowerCase()),T&&w&&(T=Hi(T,w)||T);const N=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let A=C===b||!a&&C.startsWith(b)&&C.charAt(N)==="/",R=T!=null&&(T===b||!a&&T.startsWith(b)&&T.charAt(b.length)==="/"),D={isActive:A,isPending:R,isTransitioning:S},L=A?t:void 0,_;typeof r=="function"?_=r(D):_=[r,A?"active":null,R?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(D):i;return j.createElement(mp,{...c,"aria-current":L,className:_,ref:d,style:M,to:l,viewTransition:o},typeof f=="function"?f(D):f)});cj.displayName="NavLink";var hP=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=wv,action:o,onSubmit:f,relative:c,preventScrollReset:d,viewTransition:v,unstable_defaultShouldRevalidate:m,...y},x)=>{let{unstable_useTransitions:w}=j.useContext(Ta),S=yP(),b=xP(o,{relative:c}),C=l.toLowerCase()==="get"?"get":"post",T=typeof o=="string"&&uj.test(o),N=A=>{if(f&&f(A),A.defaultPrevented)return;A.preventDefault();let R=A.nativeEvent.submitter,D=(R==null?void 0:R.getAttribute("formmethod"))||l,L=()=>S(R||A.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:a,state:i,relative:c,preventScrollReset:d,viewTransition:v,unstable_defaultShouldRevalidate:m});w&&n!==!1?j.startTransition(()=>L()):L()};return j.createElement("form",{ref:x,method:C,action:b,onSubmit:r?f:N,...y,"data-discover":!T&&e==="render"?"true":void 0})});hP.displayName="Form";function vP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fj(e){let t=j.useContext(tc);return dn(t,vP(e)),t}function pP(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f,unstable_useTransitions:c}={}){let d=Wi(),v=Qi(),m=cd(e,{relative:l});return j.useCallback(y=>{if(KB(y,t)){y.preventDefault();let x=n!==void 0?n:Ff(v)===Ff(m),w=()=>d(e,{replace:x,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f});c?j.startTransition(()=>w()):w()}},[v,d,m,n,r,a,t,e,i,l,o,f,c])}var mP=0,gP=()=>`__${String(++mP)}__`;function yP(){let{router:e}=fj("useSubmit"),{basename:t}=j.useContext(Ta),n=BB(),r=e.fetch,a=e.navigate;return j.useCallback(async(i,l={})=>{let{action:o,method:f,encType:c,formData:d,body:v}=QB(i,t);if(l.navigate===!1){let m=l.fetcherKey||gP();await r(m,n,l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:v,formMethod:l.method||f,formEncType:l.encType||c,flushSync:l.flushSync})}else await a(l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:v,formMethod:l.method||f,formEncType:l.encType||c,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function xP(e,{relative:t}={}){let{basename:n}=j.useContext(Ta),r=j.useContext(Ia);dn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...cd(e||".",{relative:t})},l=Qi();if(e==null){i.search=l.search;let o=new URLSearchParams(i.search),f=o.getAll("index");if(f.some(d=>d==="")){o.delete("index"),f.filter(v=>v).forEach(v=>o.append("index",v));let d=o.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:ii([n,i.pathname])),Ff(i)}function bP(e,{relative:t}={}){let n=j.useContext(ej);dn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=fj("useViewTransitionState"),a=cd(e,{relative:t});if(!n.isTransitioning)return!1;let i=Hi(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Hi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Fv(a.pathname,l)!=null||Fv(a.pathname,i)!=null}var fd=LR();const wP=ld(fd),dj="myco-ui-theme",SP="system",QC="light",hj="(prefers-color-scheme: dark)",vj=j.createContext(void 0);function EP(){const e=localStorage.getItem(dj);return e==="light"||e==="dark"||e==="system"?e:SP}function WC(e){const t=document.documentElement;e==="light"||e==="system"&&!window.matchMedia(hj).matches?t.classList.add(QC):t.classList.remove(QC)}function CP({children:e}){const[t,n]=j.useState(EP),r=a=>{localStorage.setItem(dj,a),n(a)};return j.useEffect(()=>{WC(t)},[t]),j.useEffect(()=>{if(t!=="system")return;const a=window.matchMedia(hj),i=()=>WC("system");return a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[t]),p.jsx(vj.Provider,{value:{theme:t,setTheme:r},children:e})}function TP(){const e=j.useContext(vj);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}const pj="myco-ui-font",kP="default",mj={default:{heading:"'Newsreader', Georgia, serif",ui:"'Inter', system-ui, sans-serif",data:"'JetBrains Mono', 'Fira Code', monospace"},"geist-mono":{heading:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",ui:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",data:"'Geist Mono', 'SF Mono', 'Fira Code', monospace"},system:{heading:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",ui:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",data:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace"},"sf-mono":{heading:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",ui:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",data:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace"},"fira-code":{heading:"'Fira Code', 'Fira Mono', ui-monospace, monospace",ui:"'Fira Code', 'Fira Mono', ui-monospace, monospace",data:"'Fira Code', 'Fira Mono', ui-monospace, monospace"},"jetbrains-mono":{heading:"'JetBrains Mono', ui-monospace, monospace",ui:"'JetBrains Mono', ui-monospace, monospace",data:"'JetBrains Mono', ui-monospace, monospace"}},NP=new Set(Object.keys(mj)),gj=j.createContext(void 0);function AP(){const e=localStorage.getItem(pj);return e&&NP.has(e)?e:kP}function RP(e){const t=mj[e],n=document.documentElement.style;n.setProperty("--font-heading",t.heading),n.setProperty("--font-ui",t.ui),n.setProperty("--font-data",t.data)}function jP({children:e}){const[t,n]=j.useState(AP),r=a=>{localStorage.setItem(pj,a),n(a)};return j.useEffect(()=>{RP(t)},[t]),p.jsx(gj.Provider,{value:{font:t,setFont:r},children:e})}function DP(){const e=j.useContext(gj);if(!e)throw new Error("useFont must be used within a FontProvider");return e}const ZC=6e4,MP=3e5,OP=200,JC={active:1,idle:2,deep_sleep:5,hidden:10},eT=["mousemove","mousedown","keydown","scroll","touchstart"],yj=j.createContext(void 0);function LP({children:e}){const[t,n]=j.useState("active"),r=j.useRef(null),a=j.useRef(null),i=j.useRef(Date.now()),l=j.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),o=j.useCallback(()=>{l(),r.current=setTimeout(()=>{n("idle"),a.current=setTimeout(()=>{n("deep_sleep")},MP-ZC)},ZC)},[l]),f=j.useCallback(()=>{const d=Date.now();d-i.current<OP||(i.current=d,n("active"),o())},[o]),c=j.useCallback(()=>{document.hidden?(l(),n("hidden")):(n("active"),i.current=Date.now(),o())},[l,o]);return j.useEffect(()=>{o();for(const d of eT)document.addEventListener(d,f,{passive:!0});return document.addEventListener("visibilitychange",c),()=>{l();for(const d of eT)document.removeEventListener(d,f);document.removeEventListener("visibilitychange",c)}},[f,c,o,l]),p.jsx(yj.Provider,{value:{powerState:t},children:e})}function _P(){const e=j.useContext(yj);if(!e)throw new Error("usePowerState must be used within a PowerProvider");return e.powerState}/**
|
|
61
|
+
* @license lucide-react v0.460.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const BP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xj=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.460.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var PP={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
+
* @license lucide-react v0.460.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const zP=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...o},f)=>j.createElement("svg",{ref:f,...PP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xj("lucide",a),...o},[...l.map(([c,d])=>j.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
|
|
76
|
+
* @license lucide-react v0.460.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Ye=(e,t)=>{const n=j.forwardRef(({className:r,...a},i)=>j.createElement(zP,{ref:i,iconNode:t,className:xj(`lucide-${BP(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
|
|
81
|
+
* @license lucide-react v0.460.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const rb=Ye("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
86
|
+
* @license lucide-react v0.460.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const IP=Ye("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
91
|
+
* @license lucide-react v0.460.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const Js=Ye("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
96
|
+
* @license lucide-react v0.460.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const ab=Ye("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
101
|
+
* @license lucide-react v0.460.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const dd=Ye("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
106
|
+
* @license lucide-react v0.460.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const gp=Ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
111
|
+
* @license lucide-react v0.460.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const _a=Ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
116
|
+
* @license lucide-react v0.460.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const h1=Ye("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
121
|
+
* @license lucide-react v0.460.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const Ea=Ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
126
|
+
* @license lucide-react v0.460.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const FP=Ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
131
|
+
* @license lucide-react v0.460.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const Zi=Ye("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
136
|
+
* @license lucide-react v0.460.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const bj=Ye("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
141
|
+
* @license lucide-react v0.460.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const wj=Ye("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
146
|
+
* @license lucide-react v0.460.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const yp=Ye("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
151
|
+
* @license lucide-react v0.460.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const qP=Ye("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
156
|
+
* @license lucide-react v0.460.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const UP=Ye("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
161
|
+
* @license lucide-react v0.460.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const VP=Ye("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
166
|
+
* @license lucide-react v0.460.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const Sj=Ye("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
171
|
+
* @license lucide-react v0.460.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const v1=Ye("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
176
|
+
* @license lucide-react v0.460.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const HP=Ye("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
181
|
+
* @license lucide-react v0.460.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const p1=Ye("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
186
|
+
* @license lucide-react v0.460.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const GP=Ye("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
191
|
+
* @license lucide-react v0.460.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const $P=Ye("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
196
|
+
* @license lucide-react v0.460.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const KP=Ye("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
201
|
+
* @license lucide-react v0.460.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const YP=Ye("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
206
|
+
* @license lucide-react v0.460.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const XP=Ye("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
211
|
+
* @license lucide-react v0.460.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const QP=Ye("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
216
|
+
* @license lucide-react v0.460.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const WP=Ye("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
221
|
+
* @license lucide-react v0.460.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const ZP=Ye("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
226
|
+
* @license lucide-react v0.460.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const JP=Ye("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
231
|
+
* @license lucide-react v0.460.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const Qn=Ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
236
|
+
* @license lucide-react v0.460.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const ez=Ye("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
241
|
+
* @license lucide-react v0.460.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const xp=Ye("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
246
|
+
* @license lucide-react v0.460.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const tz=Ye("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
251
|
+
* @license lucide-react v0.460.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const Ej=Ye("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
256
|
+
* @license lucide-react v0.460.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const nz=Ye("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
261
|
+
* @license lucide-react v0.460.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const rz=Ye("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
266
|
+
* @license lucide-react v0.460.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const az=Ye("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
271
|
+
* @license lucide-react v0.460.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const Ku=Ye("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
276
|
+
* @license lucide-react v0.460.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const iz=Ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
281
|
+
* @license lucide-react v0.460.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const Cj=Ye("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
286
|
+
* @license lucide-react v0.460.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const bp=Ye("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
291
|
+
* @license lucide-react v0.460.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const m1=Ye("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
296
|
+
* @license lucide-react v0.460.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const Tj=Ye("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
301
|
+
* @license lucide-react v0.460.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const nc=Ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
306
|
+
* @license lucide-react v0.460.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const sz=Ye("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
311
|
+
* @license lucide-react v0.460.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const lz=Ye("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
316
|
+
* @license lucide-react v0.460.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const oz=Ye("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
321
|
+
* @license lucide-react v0.460.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const kj=Ye("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
326
|
+
* @license lucide-react v0.460.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const uz=Ye("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);/**
|
|
331
|
+
* @license lucide-react v0.460.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const cz=Ye("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
336
|
+
* @license lucide-react v0.460.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const fz=Ye("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
341
|
+
* @license lucide-react v0.460.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const qf=Ye("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
346
|
+
* @license lucide-react v0.460.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const dz=Ye("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
|
|
351
|
+
* @license lucide-react v0.460.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const hz=Ye("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
356
|
+
* @license lucide-react v0.460.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const vz=Ye("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
361
|
+
* @license lucide-react v0.460.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const Nj=Ye("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
366
|
+
* @license lucide-react v0.460.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const pz=Ye("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
371
|
+
* @license lucide-react v0.460.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const mz=Ye("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
376
|
+
* @license lucide-react v0.460.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const rc=Ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
381
|
+
* @license lucide-react v0.460.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const gz=Ye("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),yz=6e4,xz=3e4;function bz(e,t,n){if(t==="heartbeat"){const r=e*JC[n];return n==="hidden"?Math.min(r,yz):n==="deep_sleep"?Math.min(r,xz):r}return n==="deep_sleep"||n==="hidden"?!1:e*JC[n]}function Fa(e){const t=_P(),{pollCategory:n,refetchInterval:r,...a}=e,i=bz(r,n,t);return Tn({...a,refetchInterval:i})}const wz="/api";async function bt(e,t){var l;const n=(l=t==null?void 0:t.method)==null?void 0:l.toUpperCase(),a=n==="POST"||n==="PUT"?{"Content-Type":"application/json",...t==null?void 0:t.headers}:t==null?void 0:t.headers,i=await fetch(`${wz}${e}`,{...t,headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Sz(i.status,o)}return i.json()}async function Cr(e,t){return bt(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function wp(e,t){return bt(e,{method:"PUT",body:JSON.stringify(t)})}async function Aj(e){return bt(e,{method:"DELETE"})}class Sz extends Error{constructor(t,n){super(`API error ${t}`),this.status=t,this.body=n}}const ra={HEALTH:5e3,STATS:1e4,LOGS:3e3},Ez=1e4,Cz=["debug","info","warn","error"],qv={debug:0,info:1,warn:2,error:3},Tz="built-in",g1="user",ni=50,ib=300,sb=5,Rj=5e3,jj=3;function Dj(e){switch(e){case"info":return"default";case"warn":return"warning";case"error":return"destructive";default:return"secondary"}}function y1(e){switch(e){case"info":return"bg-primary";case"debug":return"bg-outline";case"warn":return"bg-secondary";case"error":return"bg-tertiary";default:return"bg-outline"}}function Sp(){return Fa({queryKey:["daemon-stats"],queryFn:({signal:e})=>bt("/stats",{signal:e}),refetchInterval:ra.STATS,pollCategory:"standard"})}const Ny=500,kz=3e4;function x1(){const[e,t]=j.useState(!1),n=j.useRef(null);return{restart:j.useCallback(async(a=!1)=>{t(!0);try{const i=await Cr("/restart",{force:a});if(i.status==="busy")return t(!1),i;const l=Date.now()+kz;n.current=new AbortController,await new Promise((o,f)=>{const c=async()=>{if(Date.now()>l){f(new Error("Restart timeout"));return}try{if((await fetch("/health",{signal:n.current.signal})).ok){o();return}setTimeout(c,Ny)}catch{setTimeout(c,Ny)}};setTimeout(c,Ny)}),window.location.reload()}catch(i){throw t(!1),i}},[]),isRestarting:e}}function Mj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Mj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Oj(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Mj(e))&&(r&&(r+=" "),r+=t);return r}const tT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nT=Oj,Ep=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(c=>{const d=n==null?void 0:n[c],v=i==null?void 0:i[c];if(d===null)return null;const m=tT(d)||tT(v);return a[c][m]}),o=n&&Object.entries(n).reduce((c,d)=>{let[v,m]=d;return m===void 0||(c[v]=m),c},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:v,className:m,...y}=d;return Object.entries(y).every(x=>{let[w,S]=x;return Array.isArray(S)?S.includes({...i,...o}[w]):{...i,...o}[w]===S})?[...c,v,m]:c},[]);return nT(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},b1="-",Nz=e=>{const t=Rz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const o=l.split(b1);return o[0]===""&&o.length!==1&&o.shift(),Lj(o,t)||Az(l)},getConflictingClassGroupIds:(l,o)=>{const f=n[l]||[];return o&&r[l]?[...f,...r[l]]:f}}},Lj=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Lj(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(b1);return(l=t.validators.find(({validator:o})=>o(i)))==null?void 0:l.classGroupId},rT=/^\[(.+)\]$/,Az=e=>{if(rT.test(e)){const t=rT.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Rz=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Dz(Object.entries(e.classGroups),n).forEach(([i,l])=>{lb(l,r,i,t)}),r},lb=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:aT(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(jz(a)){lb(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{lb(l,aT(t,i),n,r)})})},aT=(e,t)=>{let n=e;return t.split(b1).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},jz=e=>e.isThemeGetter,Dz=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,o])=>[t+l,o])):i);return[n,a]}):e,Mz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},_j="!",Oz=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,l=o=>{const f=[];let c=0,d=0,v;for(let S=0;S<o.length;S++){let b=o[S];if(c===0){if(b===a&&(r||o.slice(S,S+i)===t)){f.push(o.slice(d,S)),d=S+i;continue}if(b==="/"){v=S;continue}}b==="["?c++:b==="]"&&c--}const m=f.length===0?o:o.substring(d),y=m.startsWith(_j),x=y?m.substring(1):m,w=v&&v>d?v-d:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:w}};return n?o=>n({className:o,parseClassName:l}):l},Lz=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},_z=e=>({cache:Mz(e.cacheSize),parseClassName:Oz(e),...Nz(e)}),Bz=/\s+/,Pz=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],l=e.trim().split(Bz);let o="";for(let f=l.length-1;f>=0;f-=1){const c=l[f],{modifiers:d,hasImportantModifier:v,baseClassName:m,maybePostfixModifierPosition:y}=n(c);let x=!!y,w=r(x?m.substring(0,y):m);if(!w){if(!x){o=c+(o.length>0?" "+o:o);continue}if(w=r(m),!w){o=c+(o.length>0?" "+o:o);continue}x=!1}const S=Lz(d).join(":"),b=v?S+_j:S,C=b+w;if(i.includes(C))continue;i.push(C);const T=a(w,x);for(let N=0;N<T.length;++N){const A=T[N];i.push(b+A)}o=c+(o.length>0?" "+o:o)}return o};function zz(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Bj(t))&&(r&&(r+=" "),r+=n);return r}const Bj=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Bj(e[r]))&&(n&&(n+=" "),n+=t);return n};function Iz(e,...t){let n,r,a,i=l;function l(f){const c=t.reduce((d,v)=>v(d),e());return n=_z(c),r=n.cache.get,a=n.cache.set,i=o,o(f)}function o(f){const c=r(f);if(c)return c;const d=Pz(f,n);return a(f,d),d}return function(){return i(zz.apply(null,arguments))}}const nn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pj=/^\[(?:([a-z-]+):)?(.+)\]$/i,Fz=/^\d+\/\d+$/,qz=new Set(["px","full","screen"]),Uz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Gz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$z=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mi=e=>ku(e)||qz.has(e)||Fz.test(e),Ds=e=>ac(e,"length",eI),ku=e=>!!e&&!Number.isNaN(Number(e)),Ay=e=>ac(e,"number",ku),cf=e=>!!e&&Number.isInteger(Number(e)),Kz=e=>e.endsWith("%")&&ku(e.slice(0,-1)),mt=e=>Pj.test(e),Ms=e=>Uz.test(e),Yz=new Set(["length","size","percentage"]),Xz=e=>ac(e,Yz,zj),Qz=e=>ac(e,"position",zj),Wz=new Set(["image","url"]),Zz=e=>ac(e,Wz,nI),Jz=e=>ac(e,"",tI),ff=()=>!0,ac=(e,t,n)=>{const r=Pj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},eI=e=>Vz.test(e)&&!Hz.test(e),zj=()=>!1,tI=e=>Gz.test(e),nI=e=>$z.test(e),rI=()=>{const e=nn("colors"),t=nn("spacing"),n=nn("blur"),r=nn("brightness"),a=nn("borderColor"),i=nn("borderRadius"),l=nn("borderSpacing"),o=nn("borderWidth"),f=nn("contrast"),c=nn("grayscale"),d=nn("hueRotate"),v=nn("invert"),m=nn("gap"),y=nn("gradientColorStops"),x=nn("gradientColorStopPositions"),w=nn("inset"),S=nn("margin"),b=nn("opacity"),C=nn("padding"),T=nn("saturate"),N=nn("scale"),A=nn("sepia"),R=nn("skew"),D=nn("space"),L=nn("translate"),_=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",mt,t],P=()=>[mt,t],G=()=>["",Mi,Ds],I=()=>["auto",ku,mt],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",mt],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[ku,mt];return{cacheSize:500,separator:":",theme:{colors:[ff],spacing:[Mi,Ds],blur:["none","",Ms,mt],brightness:q(),borderColor:[e],borderRadius:["none","","full",Ms,mt],borderSpacing:P(),borderWidth:G(),contrast:q(),grayscale:Q(),hueRotate:q(),invert:Q(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Kz,Ds],inset:z(),margin:z(),opacity:q(),padding:P(),saturate:q(),scale:q(),sepia:Q(),skew:q(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",mt]}],container:["container"],columns:[{columns:[Ms]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),mt]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",cf,mt]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",mt]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",cf,mt]}],"grid-cols":[{"grid-cols":[ff]}],"col-start-end":[{col:["auto",{span:["full",cf,mt]},mt]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[ff]}],"row-start-end":[{row:["auto",{span:[cf,mt]},mt]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",mt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",mt]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",mt,t]}],"min-w":[{"min-w":[mt,t,"min","max","fit"]}],"max-w":[{"max-w":[mt,t,"none","full","min","max","fit","prose",{screen:[Ms]},Ms]}],h:[{h:[mt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[mt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[mt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[mt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ms,Ds]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ay]}],"font-family":[{font:[ff]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",mt]}],"line-clamp":[{"line-clamp":["none",ku,Ay]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Mi,mt]}],"list-image":[{"list-image":["none",mt]}],"list-style-type":[{list:["none","disc","decimal",mt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Mi,Ds]}],"underline-offset":[{"underline-offset":["auto",Mi,mt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",mt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),Qz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Zz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:B()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Mi,mt]}],"outline-w":[{outline:[Mi,Ds]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Mi,Ds]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ms,Jz]}],"shadow-color":[{shadow:[ff]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Ms,mt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[v]}],saturate:[{saturate:[T]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",mt]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",mt]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",mt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[cf,mt]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",mt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",mt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",mt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Mi,Ds,Ay]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},aI=Iz(rI);function Ae(...e){return aI(Oj(e))}const iI=Ep("inline-flex items-center justify-center whitespace-nowrap rounded-md font-sans text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-gradient-to-br from-primary to-primary-container text-on-primary shadow-sm hover:shadow-[0_0_0_1px_rgba(171,207,184,0.4)]",destructive:"bg-gradient-to-br from-tertiary to-tertiary-container text-on-surface shadow-sm hover:shadow-[0_0_0_1px_rgba(255,180,161,0.4)]",outline:"border border-[var(--ghost-border)] bg-transparent shadow-sm hover:bg-surface-container-high hover:text-on-surface",secondary:"border border-outline-variant/20 bg-transparent hover:bg-surface-container-high text-on-surface",ghost:"hover:bg-surface-container-high text-on-surface-variant hover:text-on-surface",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ke=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>p.jsx("button",{className:Ae(iI({variant:t,size:n,className:e})),ref:a,...r}));Ke.displayName="Button";function Wt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function iT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ij(...e){return t=>{let n=!1;const r=e.map(a=>{const i=iT(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():iT(e[a],null)}}}}function Cn(...e){return j.useCallback(Ij(...e),e)}function sI(e,t){const n=j.createContext(t),r=i=>{const{children:l,...o}=i,f=j.useMemo(()=>o,Object.values(o));return p.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function a(i){const l=j.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function Cp(e,t=[]){let n=[];function r(i,l){const o=j.createContext(l),f=n.length;n=[...n,l];const c=v=>{var b;const{scope:m,children:y,...x}=v,w=((b=m==null?void 0:m[e])==null?void 0:b[f])||o,S=j.useMemo(()=>x,Object.values(x));return p.jsx(w.Provider,{value:S,children:y})};c.displayName=i+"Provider";function d(v,m){var w;const y=((w=m==null?void 0:m[e])==null?void 0:w[f])||o,x=j.useContext(y);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${v}\` must be used within \`${i}\``)}return[c,d]}const a=()=>{const i=n.map(l=>j.createContext(l));return function(o){const f=(o==null?void 0:o[e])||i;return j.useMemo(()=>({[`__scope${e}`]:{...o,[e]:f}}),[o,f])}};return a.scopeName=e,[r,lI(a,...t)]}function lI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((o,{useScope:f,scopeName:c})=>{const v=f(i)[`__scope${c}`];return{...o,...v}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var vr=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},oI=OR[" useId ".trim().toString()]||(()=>{}),uI=0;function Nu(e){const[t,n]=j.useState(oI());return vr(()=>{n(r=>r??String(uI++))},[e]),t?`radix-${t}`:""}var cI=OR[" useInsertionEffect ".trim().toString()]||vr;function Uv({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,l]=fI({defaultProp:t,onChange:n}),o=e!==void 0,f=o?e:a;{const d=j.useRef(e!==void 0);j.useEffect(()=>{const v=d.current;v!==o&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const c=j.useCallback(d=>{var v;if(o){const m=dI(d)?d(e):d;m!==e&&((v=l.current)==null||v.call(l,m))}else i(d)},[o,e,i,l]);return[f,c]}function fI({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),a=j.useRef(n),i=j.useRef(t);return cI(()=>{i.current=t},[t]),j.useEffect(()=>{var l;a.current!==n&&((l=i.current)==null||l.call(i,n),a.current=n)},[n,a]),[n,r,i]}function dI(e){return typeof e=="function"}function Uf(e){const t=hI(e),n=j.forwardRef((r,a)=>{const{children:i,...l}=r,o=j.Children.toArray(i),f=o.find(pI);if(f){const c=f.props.children,d=o.map(v=>v===f?j.Children.count(c)>1?j.Children.only(null):j.isValidElement(c)?c.props.children:null:v);return p.jsx(t,{...l,ref:a,children:j.isValidElement(c)?j.cloneElement(c,void 0,d):null})}return p.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function hI(e){const t=j.forwardRef((n,r)=>{const{children:a,...i}=n;if(j.isValidElement(a)){const l=gI(a),o=mI(i,a.props);return a.type!==j.Fragment&&(o.ref=r?Ij(r,l):l),j.cloneElement(a,o)}return j.Children.count(a)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vI=Symbol("radix.slottable");function pI(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vI}function mI(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...o)=>{const f=i(...o);return a(...o),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function gI(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yt=yI.reduce((e,t)=>{const n=Uf(`Primitive.${t}`),r=j.forwardRef((a,i)=>{const{asChild:l,...o}=a,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(f,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xI(e,t){e&&fd.flushSync(()=>e.dispatchEvent(t))}function uo(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function bI(e,t=globalThis==null?void 0:globalThis.document){const n=uo(e);j.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var wI="DismissableLayer",ob="dismissableLayer.update",SI="dismissableLayer.pointerDownOutside",EI="dismissableLayer.focusOutside",sT,Fj=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),w1=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:o,...f}=e,c=j.useContext(Fj),[d,v]=j.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=j.useState({}),x=Cn(t,D=>v(D)),w=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(S),C=d?w.indexOf(d):-1,T=c.layersWithOutsidePointerEventsDisabled.size>0,N=C>=b,A=kI(D=>{const L=D.target,_=[...c.branches].some(M=>M.contains(L));!N||_||(a==null||a(D),l==null||l(D),D.defaultPrevented||o==null||o())},m),R=NI(D=>{const L=D.target;[...c.branches].some(M=>M.contains(L))||(i==null||i(D),l==null||l(D),D.defaultPrevented||o==null||o())},m);return bI(D=>{C===c.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&o&&(D.preventDefault(),o()))},m),j.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(sT=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),lT(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=sT)}},[d,m,n,c]),j.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),lT())},[d,c]),j.useEffect(()=>{const D=()=>y({});return document.addEventListener(ob,D),()=>document.removeEventListener(ob,D)},[]),p.jsx(Yt.div,{...f,ref:x,style:{pointerEvents:T?N?"auto":"none":void 0,...e.style},onFocusCapture:Wt(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Wt(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Wt(e.onPointerDownCapture,A.onPointerDownCapture)})});w1.displayName=wI;var CI="DismissableLayerBranch",TI=j.forwardRef((e,t)=>{const n=j.useContext(Fj),r=j.useRef(null),a=Cn(t,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),p.jsx(Yt.div,{...e,ref:a})});TI.displayName=CI;function kI(e,t=globalThis==null?void 0:globalThis.document){const n=uo(e),r=j.useRef(!1),a=j.useRef(()=>{});return j.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let f=function(){qj(SI,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function NI(e,t=globalThis==null?void 0:globalThis.document){const n=uo(e),r=j.useRef(!1);return j.useEffect(()=>{const a=i=>{i.target&&!r.current&&qj(EI,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lT(){const e=new CustomEvent(ob);document.dispatchEvent(e)}function qj(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?xI(a,i):a.dispatchEvent(i)}var Ry="focusScope.autoFocusOnMount",jy="focusScope.autoFocusOnUnmount",oT={bubbles:!1,cancelable:!0},AI="FocusScope",S1=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[o,f]=j.useState(null),c=uo(a),d=uo(i),v=j.useRef(null),m=Cn(t,w=>f(w)),y=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let w=function(T){if(y.paused||!o)return;const N=T.target;o.contains(N)?v.current=N:zs(v.current,{select:!0})},S=function(T){if(y.paused||!o)return;const N=T.relatedTarget;N!==null&&(o.contains(N)||zs(v.current,{select:!0}))},b=function(T){if(document.activeElement===document.body)for(const A of T)A.removedNodes.length>0&&zs(o)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const C=new MutationObserver(b);return o&&C.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),C.disconnect()}}},[r,o,y.paused]),j.useEffect(()=>{if(o){cT.add(y);const w=document.activeElement;if(!o.contains(w)){const b=new CustomEvent(Ry,oT);o.addEventListener(Ry,c),o.dispatchEvent(b),b.defaultPrevented||(RI(LI(Uj(o)),{select:!0}),document.activeElement===w&&zs(o))}return()=>{o.removeEventListener(Ry,c),setTimeout(()=>{const b=new CustomEvent(jy,oT);o.addEventListener(jy,d),o.dispatchEvent(b),b.defaultPrevented||zs(w??document.body,{select:!0}),o.removeEventListener(jy,d),cT.remove(y)},0)}}},[o,c,d,y]);const x=j.useCallback(w=>{if(!n&&!r||y.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,b=document.activeElement;if(S&&b){const C=w.currentTarget,[T,N]=jI(C);T&&N?!w.shiftKey&&b===N?(w.preventDefault(),n&&zs(T,{select:!0})):w.shiftKey&&b===T&&(w.preventDefault(),n&&zs(N,{select:!0})):b===C&&w.preventDefault()}},[n,r,y.paused]);return p.jsx(Yt.div,{tabIndex:-1,...l,ref:m,onKeyDown:x})});S1.displayName=AI;function RI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zs(r,{select:t}),document.activeElement!==n)return}function jI(e){const t=Uj(e),n=uT(t,e),r=uT(t.reverse(),e);return[n,r]}function Uj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function uT(e,t){for(const n of e)if(!DI(n,{upTo:t}))return n}function DI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function MI(e){return e instanceof HTMLInputElement&&"select"in e}function zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MI(e)&&t&&e.select()}}var cT=OI();function OI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=fT(e,t),e.unshift(t)},remove(t){var n;e=fT(e,t),(n=e[0])==null||n.resume()}}}function fT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function LI(e){return e.filter(t=>t.tagName!=="A")}var _I="Portal",E1=j.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[a,i]=j.useState(!1);vr(()=>i(!0),[]);const l=n||a&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return l?wP.createPortal(p.jsx(Yt.div,{...r,ref:t}),l):null});E1.displayName=_I;function BI(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Tp=e=>{const{present:t,children:n}=e,r=PI(t),a=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=Cn(r.ref,zI(a));return typeof n=="function"||r.isPresent?j.cloneElement(a,{ref:i}):null};Tp.displayName="Presence";function PI(e){const[t,n]=j.useState(),r=j.useRef(null),a=j.useRef(e),i=j.useRef("none"),l=e?"mounted":"unmounted",[o,f]=BI(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const c=Yh(r.current);i.current=o==="mounted"?c:"none"},[o]),vr(()=>{const c=r.current,d=a.current;if(d!==e){const m=i.current,y=Yh(c);e?f("MOUNT"):y==="none"||(c==null?void 0:c.display)==="none"?f("UNMOUNT"):f(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),vr(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,v=y=>{const w=Yh(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(f("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},m=y=>{y.target===t&&(i.current=Yh(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:j.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Yh(e){return(e==null?void 0:e.animationName)||"none"}function zI(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dy=0;function Vj(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??dT()),document.body.insertAdjacentElement("beforeend",e[1]??dT()),Dy++,()=>{Dy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dy--}},[])}function dT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ti=function(){return ti=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ti.apply(this,arguments)};function Hj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function II(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ev="right-scroll-bar-position",Cv="width-before-scroll-bar",FI="with-scroll-bars-hidden",qI="--removed-body-scroll-bar-size";function My(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function UI(e,t){var n=j.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var VI=typeof window<"u"?j.useLayoutEffect:j.useEffect,hT=new WeakMap;function HI(e,t){var n=UI(null,function(r){return e.forEach(function(a){return My(a,r)})});return VI(function(){var r=hT.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(o){i.has(o)||My(o,null)}),i.forEach(function(o){a.has(o)||My(o,l)})}hT.set(n,e)},[e]),n}function GI(e){return e}function $I(e,t){t===void 0&&(t=GI);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(o){return o!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var o=n;n=[],o.forEach(i),l=n}var f=function(){var d=l;l=[],d.forEach(i)},c=function(){return Promise.resolve().then(f)};c(),n={push:function(d){l.push(d),c()},filter:function(d){return l=l.filter(d),n}}}};return a}function KI(e){e===void 0&&(e={});var t=$I(null);return t.options=ti({async:!0,ssr:!1},e),t}var Gj=function(e){var t=e.sideCar,n=Hj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,ti({},n))};Gj.isSideCarExport=!0;function YI(e,t){return e.useMedium(t),Gj}var $j=KI(),Oy=function(){},kp=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Oy,onWheelCapture:Oy,onTouchMoveCapture:Oy}),a=r[0],i=r[1],l=e.forwardProps,o=e.children,f=e.className,c=e.removeScrollBar,d=e.enabled,v=e.shards,m=e.sideCar,y=e.noRelative,x=e.noIsolation,w=e.inert,S=e.allowPinchZoom,b=e.as,C=b===void 0?"div":b,T=e.gapMode,N=Hj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=m,R=HI([n,t]),D=ti(ti({},N),a);return j.createElement(j.Fragment,null,d&&j.createElement(A,{sideCar:$j,removeScrollBar:c,shards:v,noRelative:y,noIsolation:x,inert:w,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:T}),l?j.cloneElement(j.Children.only(o),ti(ti({},D),{ref:R})):j.createElement(C,ti({},D,{className:f,ref:R}),o))});kp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kp.classNames={fullWidth:Cv,zeroRight:Ev};var XI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=XI();return t&&e.setAttribute("nonce",t),e}function WI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ZI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var JI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=QI())&&(WI(t,n),ZI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},e6=function(){var e=JI();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Kj=function(){var e=e6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},t6={left:0,top:0,right:0,gap:0},Ly=function(e){return parseInt(e||"",10)||0},n6=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Ly(n),Ly(r),Ly(a)]},r6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return t6;var t=n6(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},a6=Kj(),Au="data-scroll-locked",i6=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
386
|
+
.`.concat(FI,` {
|
|
387
|
+
overflow: hidden `).concat(r,`;
|
|
388
|
+
padding-right: `).concat(o,"px ").concat(r,`;
|
|
389
|
+
}
|
|
390
|
+
body[`).concat(Au,`] {
|
|
391
|
+
overflow: hidden `).concat(r,`;
|
|
392
|
+
overscroll-behavior: contain;
|
|
393
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
394
|
+
padding-left: `.concat(a,`px;
|
|
395
|
+
padding-top: `).concat(i,`px;
|
|
396
|
+
padding-right: `).concat(l,`px;
|
|
397
|
+
margin-left:0;
|
|
398
|
+
margin-top:0;
|
|
399
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
400
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.`).concat(Ev,` {
|
|
404
|
+
right: `).concat(o,"px ").concat(r,`;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.`).concat(Cv,` {
|
|
408
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.`).concat(Ev," .").concat(Ev,` {
|
|
412
|
+
right: 0 `).concat(r,`;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.`).concat(Cv," .").concat(Cv,` {
|
|
416
|
+
margin-right: 0 `).concat(r,`;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
body[`).concat(Au,`] {
|
|
420
|
+
`).concat(qI,": ").concat(o,`px;
|
|
421
|
+
}
|
|
422
|
+
`)},vT=function(){var e=parseInt(document.body.getAttribute(Au)||"0",10);return isFinite(e)?e:0},s6=function(){j.useEffect(function(){return document.body.setAttribute(Au,(vT()+1).toString()),function(){var e=vT()-1;e<=0?document.body.removeAttribute(Au):document.body.setAttribute(Au,e.toString())}},[])},l6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;s6();var i=j.useMemo(function(){return r6(a)},[a]);return j.createElement(a6,{styles:i6(i,!t,a,n?"":"!important")})},ub=!1;if(typeof window<"u")try{var Xh=Object.defineProperty({},"passive",{get:function(){return ub=!0,!0}});window.addEventListener("test",Xh,Xh),window.removeEventListener("test",Xh,Xh)}catch{ub=!1}var su=ub?{passive:!1}:!1,o6=function(e){return e.tagName==="TEXTAREA"},Yj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!o6(e)&&n[t]==="visible")},u6=function(e){return Yj(e,"overflowY")},c6=function(e){return Yj(e,"overflowX")},pT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Xj(e,r);if(a){var i=Qj(e,r),l=i[1],o=i[2];if(l>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},f6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},d6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Xj=function(e,t){return e==="v"?u6(t):c6(t)},Qj=function(e,t){return e==="v"?f6(t):d6(t)},h6=function(e,t){return e==="h"&&t==="rtl"?-1:1},v6=function(e,t,n,r,a){var i=h6(e,window.getComputedStyle(t).direction),l=i*r,o=n.target,f=t.contains(o),c=!1,d=l>0,v=0,m=0;do{if(!o)break;var y=Qj(e,o),x=y[0],w=y[1],S=y[2],b=w-S-i*x;(x||b)&&Xj(e,o)&&(v+=b,m+=x);var C=o.parentNode;o=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&o!==document.body||f&&(t.contains(o)||t===o));return(d&&Math.abs(v)<1||!d&&Math.abs(m)<1)&&(c=!0),c},Qh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mT=function(e){return[e.deltaX,e.deltaY]},gT=function(e){return e&&"current"in e?e.current:e},p6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},m6=function(e){return`
|
|
423
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
424
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
425
|
+
`)},g6=0,lu=[];function y6(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),a=j.useState(g6++)[0],i=j.useState(Kj)[0],l=j.useRef(e);j.useEffect(function(){l.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var w=II([e.lockRef.current],(e.shards||[]).map(gT),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=j.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var b=Qh(w),C=n.current,T="deltaX"in w?w.deltaX:C[0]-b[0],N="deltaY"in w?w.deltaY:C[1]-b[1],A,R=w.target,D=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in w&&D==="h"&&R.type==="range")return!1;var L=window.getSelection(),_=L&&L.anchorNode,M=_?_===R||_.contains(R):!1;if(M)return!1;var z=pT(D,R);if(!z)return!0;if(z?A=D:(A=D==="v"?"h":"v",z=pT(D,R)),!z)return!1;if(!r.current&&"changedTouches"in w&&(T||N)&&(r.current=A),!A)return!0;var P=r.current||A;return v6(P,S,w,P==="h"?T:N)},[]),f=j.useCallback(function(w){var S=w;if(!(!lu.length||lu[lu.length-1]!==i)){var b="deltaY"in S?mT(S):Qh(S),C=t.current.filter(function(A){return A.name===S.type&&(A.target===S.target||S.target===A.shadowParent)&&p6(A.delta,b)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var T=(l.current.shards||[]).map(gT).filter(Boolean).filter(function(A){return A.contains(S.target)}),N=T.length>0?o(S,T[0]):!l.current.noIsolation;N&&S.cancelable&&S.preventDefault()}}},[]),c=j.useCallback(function(w,S,b,C){var T={name:w,delta:S,target:b,should:C,shadowParent:x6(b)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(N){return N!==T})},1)},[]),d=j.useCallback(function(w){n.current=Qh(w),r.current=void 0},[]),v=j.useCallback(function(w){c(w.type,mT(w),w.target,o(w,e.lockRef.current))},[]),m=j.useCallback(function(w){c(w.type,Qh(w),w.target,o(w,e.lockRef.current))},[]);j.useEffect(function(){return lu.push(i),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:m}),document.addEventListener("wheel",f,su),document.addEventListener("touchmove",f,su),document.addEventListener("touchstart",d,su),function(){lu=lu.filter(function(w){return w!==i}),document.removeEventListener("wheel",f,su),document.removeEventListener("touchmove",f,su),document.removeEventListener("touchstart",d,su)}},[]);var y=e.removeScrollBar,x=e.inert;return j.createElement(j.Fragment,null,x?j.createElement(i,{styles:m6(a)}):null,y?j.createElement(l6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function x6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const b6=YI($j,y6);var C1=j.forwardRef(function(e,t){return j.createElement(kp,ti({},e,{ref:t,sideCar:b6}))});C1.classNames=kp.classNames;var w6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ou=new WeakMap,Wh=new WeakMap,Zh={},_y=0,Wj=function(e){return e&&(e.host||Wj(e.parentNode))},S6=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Wj(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},E6=function(e,t,n,r){var a=S6(t,Array.isArray(e)?e:[e]);Zh[n]||(Zh[n]=new WeakMap);var i=Zh[n],l=[],o=new Set,f=new Set(a),c=function(v){!v||o.has(v)||(o.add(v),c(v.parentNode))};a.forEach(c);var d=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(m){if(o.has(m))d(m);else try{var y=m.getAttribute(r),x=y!==null&&y!=="false",w=(ou.get(m)||0)+1,S=(i.get(m)||0)+1;ou.set(m,w),i.set(m,S),l.push(m),w===1&&x&&Wh.set(m,!0),S===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return d(t),o.clear(),_y++,function(){l.forEach(function(v){var m=ou.get(v)-1,y=i.get(v)-1;ou.set(v,m),i.set(v,y),m||(Wh.has(v)||v.removeAttribute(r),Wh.delete(v)),y||v.removeAttribute(n)}),_y--,_y||(ou=new WeakMap,ou=new WeakMap,Wh=new WeakMap,Zh={})}},Zj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=w6(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),E6(r,a,n,"aria-hidden")):function(){return null}},Np="Dialog",[Jj]=Cp(Np),[C6,qa]=Jj(Np),eD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,o=j.useRef(null),f=j.useRef(null),[c,d]=Uv({prop:r,defaultProp:a??!1,onChange:i,caller:Np});return p.jsx(C6,{scope:t,triggerRef:o,contentRef:f,contentId:Nu(),titleId:Nu(),descriptionId:Nu(),open:c,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(v=>!v),[d]),modal:l,children:n})};eD.displayName=Np;var tD="DialogTrigger",T6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=qa(tD,n),i=Cn(t,a.triggerRef);return p.jsx(Yt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":N1(a.open),...r,ref:i,onClick:Wt(e.onClick,a.onOpenToggle)})});T6.displayName=tD;var T1="DialogPortal",[k6,nD]=Jj(T1,{forceMount:void 0}),rD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=qa(T1,t);return p.jsx(k6,{scope:t,forceMount:n,children:j.Children.map(r,l=>p.jsx(Tp,{present:n||i.open,children:p.jsx(E1,{asChild:!0,container:a,children:l})}))})};rD.displayName=T1;var Vv="DialogOverlay",aD=j.forwardRef((e,t)=>{const n=nD(Vv,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=qa(Vv,e.__scopeDialog);return i.modal?p.jsx(Tp,{present:r||i.open,children:p.jsx(A6,{...a,ref:t})}):null});aD.displayName=Vv;var N6=Uf("DialogOverlay.RemoveScroll"),A6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=qa(Vv,n);return p.jsx(C1,{as:N6,allowPinchZoom:!0,shards:[a.contentRef],children:p.jsx(Yt.div,{"data-state":N1(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),co="DialogContent",iD=j.forwardRef((e,t)=>{const n=nD(co,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=qa(co,e.__scopeDialog);return p.jsx(Tp,{present:r||i.open,children:i.modal?p.jsx(R6,{...a,ref:t}):p.jsx(j6,{...a,ref:t})})});iD.displayName=co;var R6=j.forwardRef((e,t)=>{const n=qa(co,e.__scopeDialog),r=j.useRef(null),a=Cn(t,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return Zj(i)},[]),p.jsx(sD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Wt(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Wt(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,o=l.button===0&&l.ctrlKey===!0;(l.button===2||o)&&i.preventDefault()}),onFocusOutside:Wt(e.onFocusOutside,i=>i.preventDefault())})}),j6=j.forwardRef((e,t)=>{const n=qa(co,e.__scopeDialog),r=j.useRef(!1),a=j.useRef(!1);return p.jsx(sD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,o;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var f,c;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),sD=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,o=qa(co,n),f=j.useRef(null),c=Cn(t,f);return Vj(),p.jsxs(p.Fragment,{children:[p.jsx(S1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:p.jsx(w1,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":N1(o.open),...l,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(D6,{titleId:o.titleId}),p.jsx(O6,{contentRef:f,descriptionId:o.descriptionId})]})]})}),k1="DialogTitle",lD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=qa(k1,n);return p.jsx(Yt.h2,{id:a.titleId,...r,ref:t})});lD.displayName=k1;var oD="DialogDescription",uD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=qa(oD,n);return p.jsx(Yt.p,{id:a.descriptionId,...r,ref:t})});uD.displayName=oD;var cD="DialogClose",fD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=qa(cD,n);return p.jsx(Yt.button,{type:"button",...r,ref:t,onClick:Wt(e.onClick,()=>a.onOpenChange(!1))})});fD.displayName=cD;function N1(e){return e?"open":"closed"}var dD="DialogTitleWarning",[nre,hD]=sI(dD,{contentName:co,titleName:k1,docsSlug:"dialog"}),D6=({titleId:e})=>{const t=hD(dD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
426
|
+
|
|
427
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
428
|
+
|
|
429
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},M6="DialogDescriptionWarning",O6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hD(M6).contentName}}.`;return j.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},L6=eD,_6=rD,vD=aD,pD=iD,mD=lD,gD=uD,B6=fD;const Ap=L6,P6=_6,yD=j.forwardRef(({className:e,...t},n)=>p.jsx(vD,{ref:n,className:Ae("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));yD.displayName=vD.displayName;const hd=j.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(P6,{children:[p.jsx(yD,{}),p.jsxs(pD,{ref:r,className:Ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 [&>*]:min-w-0 border-0 bg-surface-container-highest p-6 shadow-ambient duration-200 sm:rounded-lg",e),...n,children:[t,p.jsxs(B6,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[p.jsx(rc,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hd.displayName=pD.displayName;function Rp({className:e,...t}){return p.jsx("div",{className:Ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}Rp.displayName="DialogHeader";function jp({className:e,...t}){return p.jsx("div",{className:Ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}jp.displayName="DialogFooter";const vd=j.forwardRef(({className:e,...t},n)=>p.jsx(mD,{ref:n,className:Ae("text-lg font-serif font-semibold leading-none tracking-tight",e),...t}));vd.displayName=mD.displayName;const A1=j.forwardRef(({className:e,...t},n)=>p.jsx(gD,{ref:n,className:Ae("text-sm text-on-surface-variant",e),...t}));A1.displayName=gD.displayName;const fn=j.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:Ae("flex h-9 w-full rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-3 py-1 font-sans text-sm text-on-surface shadow-none transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-on-surface","placeholder:text-on-surface-variant/50","focus-visible:outline-none focus-visible:border-primary/40","disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));fn.displayName="Input";var xD="Toggle",bD=j.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:a,...i}=e,[l,o]=Uv({prop:n,onChange:a,defaultProp:r??!1,caller:xD});return p.jsx(Yt.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Wt(e.onClick,()=>{e.disabled||o(!l)})})});bD.displayName=xD;var wD=bD;const z6=Ep("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-surface-container-high/80 hover:text-on-surface-variant focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-on-primary",{variants:{variant:{default:"bg-surface-container-high text-on-surface-variant",outline:"border border-input bg-surface-container-high text-on-surface-variant shadow-sm hover:bg-surface-container-high/80 hover:text-on-surface-variant"},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),cb=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>p.jsx(wD,{ref:a,className:Ae(z6({variant:t,size:n,className:e})),...r}));cb.displayName=wD.displayName;const I6=Ep("inline-flex items-center rounded-sm px-2 py-0.5 font-sans text-xs font-medium transition-colors",{variants:{variant:{default:"bg-primary/15 text-primary",secondary:"bg-surface-container-high text-on-surface-variant",destructive:"bg-tertiary/15 text-tertiary",warning:"bg-secondary/15 text-secondary",outline:"border border-[var(--ghost-border)] text-on-surface-variant"}},defaultVariants:{variant:"default"}});function Ln({className:e,variant:t,...n}){return p.jsx("div",{className:Ae(I6({variant:t}),e),...n})}const F6=120,q6={session:{label:"Sessions",icon:xp},spore:{label:"Spores",icon:kj},plan:{label:"Plans",icon:qP},prompt_batch:{label:"Prompt Batches",icon:rb},activity:{label:"Activities",icon:rb}};function SD(e){return q6[e]??{label:e,icon:KP}}function U6(e,t){return e.length<=t?e:e.slice(0,t)+"…"}function V6({score:e}){const t=Math.round(e*100);return p.jsxs(Ln,{variant:"outline",className:"shrink-0 text-xs tabular-nums text-on-surface-variant",children:[t,"%"]})}function H6({result:e,onSelect:t,isHighlighted:n}){const{icon:r}=SD(e.type);return p.jsxs("button",{type:"button",onClick:()=>t(e),className:["w-full flex items-start gap-3 px-3 py-2 text-left rounded-md transition-colors",n?"bg-surface-container-high text-on-surface":"hover:bg-surface-container-high hover:text-on-surface"].join(" "),children:[p.jsx(r,{className:"h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("span",{className:"text-sm font-medium truncate",children:e.title})}),e.preview&&p.jsx("p",{className:"text-xs text-on-surface-variant mt-0.5 line-clamp-2",children:U6(e.preview,F6)})]}),p.jsx(V6,{score:e.score})]})}function G6({results:e,onSelect:t,highlightedIndex:n}){const r=e.reduce((i,l)=>{const o=l.type??"unknown";return(i[o]??(i[o]=[])).push(l),i},{});let a=0;return p.jsx("div",{className:"py-2 space-y-1",children:Object.entries(r).map(([i,l])=>{const{label:o}=SD(i),f=a;return a+=l.length,p.jsxs("div",{children:[p.jsx("div",{className:"px-3 py-1",children:p.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-on-surface-variant",children:o})}),l.map((c,d)=>p.jsx(H6,{result:c,onSelect:t,isHighlighted:n===f+d},c.id))]},i)})})}const $6=2,K6=3e4;function Y6(e,t="semantic"){return Tn({queryKey:["search",e,t],queryFn:({signal:n})=>bt(`/search?q=${encodeURIComponent(e)}&mode=${t}`,{signal:n}),enabled:e.length>$6,staleTime:K6})}const X6=300,Q6=20;function W6(e){switch(e.type){case"session":return`/sessions/${e.id}`;case"spore":return`/mycelium?spore=${encodeURIComponent(e.id)}`;case"plan":return e.session_id?`/sessions/${e.session_id}`:"/sessions";case"prompt_batch":return e.session_id?`/sessions/${e.session_id}`:"/sessions";case"activity":return e.session_id?`/sessions/${e.session_id}`:"/sessions";default:return"/"}}function Z6({open:e,onOpenChange:t}){const n=Wi(),[r,a]=j.useState(""),[i,l]=j.useState(""),[o,f]=j.useState("semantic"),[c,d]=j.useState(0),v=j.useRef(null);j.useEffect(()=>{const T=setTimeout(()=>{l(r.trim())},X6);return()=>clearTimeout(T)},[r]),j.useEffect(()=>{e&&(a(""),l(""),d(0),setTimeout(()=>{var T;return(T=v.current)==null?void 0:T.focus()},50))},[e]);const{data:m,isLoading:y}=Y6(i,o),x=((m==null?void 0:m.results)??[]).slice(0,Q6);j.useEffect(()=>{d(0)},[x.length,i]);const w=j.useCallback(T=>{const N=W6(T);t(!1),n(N)},[n,t]),S=j.useCallback(T=>{if(x.length!==0){if(T.key==="ArrowDown")T.preventDefault(),d(N=>Math.min(N+1,x.length-1));else if(T.key==="ArrowUp")T.preventDefault(),d(N=>Math.max(N-1,0));else if(T.key==="Enter"){T.preventDefault();const N=x[c];N&&w(N)}}},[x,c,w]),b=i.length>2&&!y&&x.length===0,C=i.length<=2&&!y;return p.jsx(Ap,{open:e,onOpenChange:t,children:p.jsxs(hd,{className:"max-w-2xl p-0 gap-0 overflow-hidden",onKeyDown:S,children:[p.jsx(vd,{className:"sr-only",children:"Search vault"}),p.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--ghost-border)] pl-4 pr-12 py-3",children:[p.jsx(nc,{className:"h-4 w-4 shrink-0 text-on-surface-variant"}),p.jsx(fn,{ref:v,value:r,onChange:T=>a(T.target.value),placeholder:"Search sessions, spores, plans…",className:"border-0 shadow-none focus-visible:ring-0 px-0 h-auto text-base bg-surface-bright font-mono"}),p.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p.jsx(cb,{size:"sm",pressed:o==="semantic",onPressedChange:()=>f("semantic"),"aria-label":"Semantic search",title:"Semantic (embedded knowledge)",children:"Semantic"}),p.jsx(cb,{size:"sm",pressed:o==="fts",onPressedChange:()=>f("fts"),"aria-label":"Full-text search",title:"Full text (raw data)",children:"Full Text"})]})]}),p.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[y&&i.length>2&&p.jsx("div",{className:"px-4 py-8 text-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-on-surface-variant",children:[p.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),p.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"}),p.jsx("div",{className:"h-3 w-28 rounded bg-muted animate-pulse"})]})}),C&&p.jsx("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:"Type to search your vault…"}),b&&p.jsxs("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:["No results for ",p.jsxs("span",{className:"font-medium text-on-surface",children:['"',i,'"']})]}),x.length>0&&!y&&p.jsx(G6,{results:x,onSelect:w,highlightedIndex:c})]}),p.jsxs("div",{className:"border-t border-[var(--ghost-border)] px-4 py-2 flex items-center gap-4 text-xs text-on-surface-variant",children:[p.jsxs("span",{children:[p.jsx("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),p.jsxs("span",{children:[p.jsx("kbd",{className:"font-mono",children:"↵"})," open"]}),p.jsxs("span",{children:[p.jsx("kbd",{className:"font-mono",children:"Esc"})," close"]}),p.jsx("span",{className:"ml-auto",children:(m==null?void 0:m.mode)&&x.length>0&&`${x.length} result${x.length!==1?"s":""} · ${m.mode}`})]})]})})}const J6=[{to:"/",label:"Dashboard",icon:JP},{to:"/sessions",label:"Sessions",icon:xp},{to:"/mycelium",label:"Mycelium",icon:rz},{to:"/agent",label:"Agent",icon:dd},{to:"/settings",label:"Settings",icon:oz},{to:"/operations",label:"Operations",icon:mz},{to:"/team",label:"Team",icon:vz},{to:"/logs",label:"Logs",icon:Tj}],eF=[{value:"default",label:"Default"},{value:"geist-mono",label:"Geist Mono"},{value:"system",label:"System"},{value:"sf-mono",label:"SF Mono"},{value:"fira-code",label:"Fira Code"},{value:"jetbrains-mono",label:"JetBrains"}],ED={compact:.85,normal:1,comfy:1.15},tF={compact:"Compact",normal:"Normal",comfy:"Comfy"},df=["compact","normal","comfy"],yT="myco-ui-sidebar-collapsed",xT=768,CD="myco-ui-density",nF="--density",rF="normal";function aF(){const e=localStorage.getItem(CD);return e&&e in ED?e:rF}function iF(e){const t=ED[e];document.documentElement.style.setProperty(nF,String(t)),document.documentElement.style.fontSize=`calc(14px * ${t})`}function sF(){const[e,t]=j.useState(aF),n=j.useCallback(r=>{localStorage.setItem(CD,r),t(r)},[]);return j.useEffect(()=>{iF(e)},[e]),{density:e,setDensity:n}}function lF(){const[e,t]=j.useState(()=>localStorage.getItem(yT)==="true"),n=j.useCallback(()=>{t(r=>{const a=!r;return localStorage.setItem(yT,String(a)),a})},[]);return{collapsed:e,toggle:n}}function oF(){const[e,t]=j.useState(!1),[n,r]=j.useState(()=>typeof window<"u"&&window.innerWidth<xT);j.useEffect(()=>{const o=window.matchMedia(`(max-width: ${xT-1}px)`),f=c=>{r(c.matches),c.matches||t(!1)};return o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[]);const a=Qi();j.useEffect(()=>{t(!1)},[a.pathname]),j.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]);const i=j.useCallback(()=>t(o=>!o),[]),l=j.useCallback(()=>t(!1),[]);return{open:e,isMobile:n,toggle:i,close:l}}const By=["light","dark","system"],uF={light:fz,dark:nz,system:Ej},cF={light:"Light",dark:"Dark",system:"System"};function fF({collapsed:e=!1}){const{theme:t,setTheme:n}=TP(),r=()=>{const l=By.indexOf(t),o=By[(l+1)%By.length];n(o)},a=uF[t]??Ej,i=cF[t]??"System";return p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:r,title:e?`${i} mode`:void 0,className:Ae("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[p.jsx(a,{className:"h-4 w-4"}),!e&&p.jsx("span",{children:i})]})}function dF({collapsed:e=!1}){const{restart:t,isRestarting:n}=x1();return p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>t(),disabled:n,title:e?n?"Restarting...":"Restart Daemon":void 0,className:Ae("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[p.jsx(m1,{className:Ae("h-4 w-4",n&&"animate-spin")}),!e&&p.jsx("span",{children:n?"Restarting...":"Restart Daemon"})]})}function hF(){const{font:e,setFont:t}=DP();return p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1 text-sm text-on-surface-variant hover:text-on-surface cursor-pointer",children:[p.jsx(dz,{className:"h-4 w-4 shrink-0"}),p.jsx("select",{value:e,onChange:n=>t(n.target.value),className:"w-full bg-transparent border-none outline-none cursor-pointer text-sm appearance-none",children:eF.map(n=>p.jsx("option",{value:n.value,children:n.label},n.value))})]})}function vF({density:e,setDensity:t}){const n=df.indexOf(e),r=()=>{const i=df[n-1];n>0&&i!==void 0&&t(i)},a=()=>{const i=df[n+1];n<df.length-1&&i!==void 0&&t(i)};return p.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[p.jsx("button",{onClick:r,disabled:n===0,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Decrease density",children:p.jsx(tz,{className:"h-3 w-3"})}),p.jsx("div",{className:"flex flex-1 justify-center",children:p.jsx("span",{className:"text-xs text-on-surface-variant select-none",children:tF[e]})}),p.jsx("button",{onClick:a,disabled:n===df.length-1,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Increase density",children:p.jsx(iz,{className:"h-3 w-3"})})]})}function bT({collapsed:e,vaultName:t,density:n,setDensity:r,onSearchOpen:a,onCollapseToggle:i,showCollapseToggle:l}){return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:Ae("px-4 py-5",e&&"px-2 py-4 flex justify-center"),children:e?p.jsxs("div",{className:"relative flex items-center",children:[p.jsx("span",{className:"font-serif text-base text-primary",children:"m"}),p.jsx("span",{className:"ml-1 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}):p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),p.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}),t&&p.jsx("span",{className:"font-mono text-xs text-outline uppercase tracking-widest mt-0.5",children:t})]})}),p.jsx("div",{className:"px-2 pt-2 pb-1",children:p.jsxs("button",{type:"button",onClick:a,title:e?"Search (⌘K)":void 0,className:Ae("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[p.jsx(nc,{className:"h-4 w-4 shrink-0"}),!e&&p.jsx("span",{className:"flex-1 text-left",children:"Search"}),!e&&p.jsxs("kbd",{className:"text-xs text-on-surface-variant/60 font-mono",children:["⌘","K"]})]})}),p.jsx("nav",{className:"flex-1 space-y-1 px-2 py-2","aria-label":"Main navigation",children:J6.map(o=>p.jsxs(cj,{to:o.to,end:o.to==="/",title:e?o.label:void 0,className:({isActive:f})=>Ae("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",f?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[p.jsx(o.icon,{className:"h-4 w-4 shrink-0"}),!e&&o.label]},o.to))}),p.jsxs("div",{className:Ae("py-3 space-y-1 mt-auto",e?"px-1 flex flex-col items-center":"px-2"),children:[p.jsx(dF,{collapsed:e}),!e&&p.jsx(hF,{}),!e&&p.jsx(vF,{density:n,setDensity:r}),p.jsx(fF,{collapsed:e})]}),l&&i&&p.jsx("div",{className:Ae("px-2 py-2",e&&"flex justify-center"),children:p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:i,className:Ae("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),title:e?"Expand sidebar":"Collapse sidebar",children:[e?p.jsx(Ea,{className:"h-4 w-4"}):p.jsx(h1,{className:"h-4 w-4"}),!e&&p.jsx("span",{children:"Collapse"})]})})]})}function pF(){const{collapsed:e,toggle:t}=lF(),{density:n,setDensity:r}=sF(),{data:a}=Sp(),i=a==null?void 0:a.vault.name,[l,o]=j.useState(!1),f=oF();j.useEffect(()=>{const d=v=>{(v.metaKey||v.ctrlKey)&&v.key==="k"&&(v.preventDefault(),o(m=>!m))};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),j.useEffect(()=>{if(!f.open)return;const d=v=>{v.key==="Escape"&&(v.preventDefault(),f.close())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[f.open,f.close]);const c=j.useCallback(()=>o(!0),[]);return p.jsxs("div",{className:"flex h-screen bg-background",children:[p.jsx(Z6,{open:l,onOpenChange:o}),f.isMobile&&p.jsxs("div",{className:"fixed top-0 left-0 right-0 z-40 flex h-12 items-center gap-3 border-b border-outline-variant/20 bg-surface-container px-3",children:[p.jsx("button",{type:"button",onClick:f.toggle,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":f.open?"Close navigation":"Open navigation",children:f.open?p.jsx(rc,{className:"h-5 w-5"}):p.jsx(ez,{className:"h-5 w-5"})}),p.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),i&&p.jsx("span",{className:"font-mono text-[10px] text-outline uppercase tracking-widest",children:i}),p.jsx("button",{type:"button",onClick:c,className:"ml-auto rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Search",children:p.jsx(nc,{className:"h-4 w-4"})})]}),f.isMobile&&f.open&&p.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/60 backdrop-blur-sm transition-opacity",onClick:f.close,"aria-hidden":"true"}),f.isMobile&&p.jsx("aside",{className:Ae("fixed top-12 left-0 bottom-0 z-50 w-64 flex flex-col bg-surface-container transition-transform duration-200 ease-out",f.open?"translate-x-0":"-translate-x-full"),children:p.jsx(bT,{collapsed:!1,vaultName:i,density:n,setDensity:r,onSearchOpen:c,showCollapseToggle:!1})}),!f.isMobile&&p.jsx("aside",{className:Ae("flex flex-col bg-surface-container transition-[width] duration-200",e?"w-14":"w-56"),children:p.jsx(bT,{collapsed:e,vaultName:i,density:n,setDensity:r,onSearchOpen:c,onCollapseToggle:t,showCollapseToggle:!0})}),p.jsx("main",{className:Ae("flex-1 overflow-auto bg-surface",f.isMobile&&"pt-12"),"aria-label":"Page content",children:p.jsx(FB,{})})]})}function R1({isLoading:e,error:t,loadingText:n="Loading...",children:r}){return e?p.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[p.jsx(Qn,{className:"h-5 w-5 animate-spin"}),p.jsx("span",{className:"font-sans text-sm",children:n})]}):t?p.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-2 text-tertiary",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Failed to connect to daemon"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:t.message})]}):p.jsx(p.Fragment,{children:r})}const el=60,Su=3600,Df=86400,xa=1e3;function j1(e){if(e<el)return`${Math.floor(e)}s`;if(e<Su)return`${Math.floor(e/el)}m`;if(e<Df){const r=Math.floor(e/Su),a=Math.floor(e%Su/el);return`${r}h ${a}m`}const t=Math.floor(e/Df),n=Math.floor(e%Df/Su);return`${t}d ${n}h`}function D1(e){const t=(Date.now()-new Date(e).getTime())/xa;return t<el?"just now":t<Su?`${Math.floor(t/el)}m ago`:t<Df?`${Math.floor(t/Su)}h ago`:`${Math.floor(t/Df)}d ago`}function oi(e){return D1(new Date(e*xa).toISOString())}function fb(e){return new Date(e*xa).toLocaleString()}function db(e,t){return e?e.length>t?e.slice(0,t)+"…":e:""}function M1(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Dp(e,t){if(e===null||t===null)return"—";const n=(t-e)*xa;if(n<xa)return`${n}ms`;if(n<el*xa)return`${(n/xa).toFixed(1)}s`;const r=Math.floor(n/(el*xa)),a=Math.floor(n%(el*xa)/xa);return`${r}m ${a}s`}function mF(e){return e===null?"—":e<xa?`${e}ms`:`${(e/xa).toFixed(1)}s`}function Hv(e,t){if(e.trim()==="")return t;const n=Number(e);return Number.isFinite(n)?n:t}function TD(e){return e!==null?oi(e):"—"}const wT=100,gF=1;function yF(e){const{embedded_count:t,total_embeddable:n}=e.embedding;return n===0?wT:Number((t/n*wT).toFixed(gF))}function xF(e){const t=e.agent.last_run_status==="error",n=e.embedding.queue_depth>0||e.unprocessed_batches>0;return t?"Issues detected in the network":n?"Work in progress across the network":"Network Topology Active"}function bF(e){return e.embedding.queue_depth>0||e.unprocessed_batches>0}function wF({active:e}){const t=e?"animate-pulse-slow":"";return p.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-20 pointer-events-none",viewBox:"0 0 400 300",preserveAspectRatio:"xMidYMid slice",children:[p.jsx("path",{d:"M200,280 Q200,220 200,160",fill:"none",stroke:"var(--primary)",strokeWidth:"2",className:t}),p.jsx("path",{d:"M200,200 Q240,170 280,180",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),p.jsx("path",{d:"M200,170 Q160,140 120,155",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),p.jsx("path",{d:"M200,160 Q230,110 270,90",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),p.jsx("path",{d:"M200,160 Q170,110 130,80",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),p.jsx("path",{d:"M280,180 Q310,170 340,190",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),p.jsx("path",{d:"M120,155 Q90,145 60,160",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),p.jsx("circle",{cx:"280",cy:"180",r:"3",fill:"var(--primary)",opacity:"0.7"}),p.jsx("circle",{cx:"120",cy:"155",r:"3",fill:"var(--secondary)",opacity:"0.7"}),p.jsx("circle",{cx:"270",cy:"90",r:"2.5",fill:"var(--tertiary)",opacity:"0.6"}),p.jsx("circle",{cx:"130",cy:"80",r:"2.5",fill:"var(--secondary)",opacity:"0.6"}),p.jsx("circle",{cx:"340",cy:"190",r:"2",fill:"var(--tertiary)",opacity:"0.4"}),p.jsx("circle",{cx:"60",cy:"160",r:"2",fill:"var(--primary)",opacity:"0.4"}),p.jsx("circle",{cx:"200",cy:"160",r:"4",fill:"var(--primary)",className:e?"animate-pulse":""})]})}function SF({stats:e}){const t=yF(e),n=xF(e),r=bF(e),a=e.daemon.active_sessions.length,i=j1(e.daemon.uptime_seconds);return p.jsxs("section",{className:"relative flex items-center justify-center rounded-xl overflow-hidden glass-panel border border-outline-variant/10 min-h-[320px]",children:[p.jsx(wF,{active:r}),p.jsxs("div",{className:"text-center relative z-20 space-y-3 py-12",children:[p.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-on-surface-variant/80",children:n}),p.jsx("h1",{className:"font-serif text-5xl italic text-on-surface drop-shadow-sm",children:"Myco"}),p.jsxs("p",{className:"font-mono text-sm text-outline",children:["Node connectivity at ",t,"% capacity"]}),p.jsxs("div",{className:"flex items-center justify-center gap-6 pt-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"h-2 w-2 rounded-full bg-sage shadow-sage-glow animate-pulse"}),p.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[a," active ",a===1?"session":"sessions"]})]}),p.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),p.jsx("div",{className:"flex items-center gap-2",children:p.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[e.vault.spore_count," spores"]})}),p.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),p.jsx("div",{className:"flex items-center gap-2",children:p.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:["uptime ",i]})})]})]})]})}function EF({data:e,width:t=120,height:n=40,className:r}){if(e.length<2)return null;const a=Math.min(...e),l=Math.max(...e)-a||1,o=e.map((d,v)=>({x:v/(e.length-1)*t,y:n-(d-a)/l*n}));let f=`M ${o[0].x} ${o[0].y}`;for(let d=0;d<o.length-1;d++){const v=o[Math.max(0,d-1)],m=o[d],y=o[d+1],x=o[Math.min(o.length-1,d+2)],w=m.x+(y.x-v.x)/6,S=m.y+(y.y-v.y)/6,b=y.x-(x.x-m.x)/6,C=y.y-(x.y-m.y)/6;f+=` C ${w} ${S}, ${b} ${C}, ${y.x} ${y.y}`}const c=`${f} L ${t} ${n} L 0 ${n} Z`;return p.jsxs("svg",{width:t,height:n,className:r,viewBox:`0 0 ${t} ${n}`,children:[p.jsx("defs",{children:p.jsxs("linearGradient",{id:"sparkline-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[p.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:"0.2"}),p.jsx("stop",{offset:"100%",stopColor:"var(--primary)",stopOpacity:"0"})]})}),p.jsx("path",{d:c,fill:"url(#sparkline-fill)"}),p.jsx("path",{d:f,fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",strokeOpacity:"0.8"})]})}const CF={sage:"border-t-sage",ochre:"border-t-ochre",terracotta:"border-t-terracotta",outline:"border-t-outline"},TF={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta",outline:"text-on-surface"};function yn({label:e,value:t,sublabel:n,accent:r,sparklineData:a,className:i,href:l}){const o=Ae("rounded-lg border border-outline-variant/10 bg-surface-container/60 p-4 border-t-2 transition-[border-color,background-color] duration-200 hover:border-outline-variant/25 hover:bg-surface-container/80",l&&"cursor-pointer",CF[r],i),f=p.jsxs(p.Fragment,{children:[p.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-outline mb-2",children:e}),p.jsxs("div",{className:"flex items-end justify-between gap-2",children:[p.jsx("p",{className:Ae("font-serif text-2xl font-bold",TF[r]),children:t}),a&&a.length>=2&&p.jsx(EF,{data:a,width:80,height:28,className:"opacity-60"})]}),n&&p.jsx("p",{className:"font-mono text-[10px] text-outline mt-1",children:n})]});return l?p.jsx(mp,{to:l,className:Ae(o,"block no-underline"),children:f}):p.jsx("div",{className:o,children:f})}function kF({stats:e}){const t=e.embedding.total_embeddable>0?Math.round(e.embedding.embedded_count/e.embedding.total_embeddable*100):0,n=e.digest.tiers_available.length>0?`${e.digest.tiers_available.length} tiers`:"None",r=e.agent.last_run_at?oi(e.agent.last_run_at):"Never";return p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[p.jsx(yn,{label:"Sessions",value:String(e.vault.session_count),sublabel:`${e.daemon.active_sessions.length} active`,accent:"sage",href:"/sessions"}),p.jsx(yn,{label:"Spores",value:String(e.vault.spore_count),sublabel:`${e.vault.entity_count} entities`,accent:"sage",href:"/mycelium?tab=spores"}),p.jsx(yn,{label:"Embedding",value:`${t}%`,sublabel:`${e.embedding.embedded_count}/${e.embedding.total_embeddable}`,accent:e.embedding.queue_depth>0?"ochre":"sage",href:"/operations"}),p.jsx(yn,{label:"Agent",value:`${e.agent.total_runs}`,sublabel:`last: ${r}`,accent:e.agent.last_run_status==="error"?"terracotta":"outline",href:"/agent"}),p.jsx(yn,{label:"Digest",value:n,sublabel:e.digest.generated_at?oi(e.digest.generated_at):void 0,accent:"outline",href:"/mycelium?tab=digest"}),p.jsx(yn,{label:"Uptime",value:j1(e.daemon.uptime_seconds),sublabel:`v${e.daemon.version}`,accent:"outline"})]})}function kD(e=20){return Fa({queryKey:["activity",e],queryFn:({signal:t})=>bt(`/activity?limit=${e}`,{signal:t}),refetchInterval:ra.STATS,pollCategory:"standard"})}function NF(e){return e==="agent_run"?"ochre":e==="spore"?"sage":e.includes("error")||e.includes("fail")?"terracotta":"sage"}function AF(e){switch(e){case"sage":return{label:"STABLE",dotClass:"bg-sage shadow-sage-glow"};case"ochre":return{label:"ACTIVE",dotClass:"bg-ochre shadow-ochre-glow"};case"terracotta":return{label:"WARNING",dotClass:"bg-terracotta shadow-terracotta-glow"}}}const RF={sage:"border-l-sage",ochre:"border-l-ochre",terracotta:"border-l-terracotta"},jF={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},DF={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},MF={sage:"border-sage/20",ochre:"border-ochre/20",terracotta:"border-terracotta/20"};function OF(e){return`#${e.slice(-6).toUpperCase()}`}function ST(e){return e.summary}function LF({event:e}){const t=Wi(),n=NF(e.type),r=AF(n),a=oi(e.timestamp),i=e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?"/mycelium":null;return p.jsxs("div",{className:Ae("p-5 rounded-lg border-l-4 bg-surface-container/60 hover:bg-surface-container-high group hover-lift transition-colors",i&&"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",RF[n]),onClick:()=>i&&t(i),onKeyDown:l=>{i&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t(i))},tabIndex:i?0:void 0,role:i?"link":void 0,"aria-label":`${ST(e)} - ${r.label} - ${a}`,children:[p.jsxs("div",{className:"flex justify-between items-start mb-3",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:Ae("font-mono text-xs font-bold",jF[n]),children:OF(e.id)}),p.jsx("h4",{className:"font-serif text-lg text-on-surface leading-tight mt-0.5 truncate",children:ST(e)})]}),p.jsx("div",{className:Ae("w-8 h-8 rounded-full border-2 flex items-center justify-center shrink-0 ml-3",MF[n]),children:p.jsx("div",{className:Ae("w-3.5 h-3.5 rounded-full",r.dotClass)})})]}),p.jsxs("p",{className:"text-xs text-on-surface/60 line-clamp-2 leading-relaxed italic mb-3",children:["> ",e.type.replace(/_/g," ")," event recorded ",a]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("span",{className:Ae("px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono rounded",DF[n]),children:r.label}),p.jsx("span",{className:"px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono text-outline rounded",children:a})]})]})}const ET=6,_F=3;function BF(){return p.jsxs("div",{className:"p-5 rounded-lg border-l-4 border-l-outline-variant/30 bg-surface-container/40 animate-pulse",children:[p.jsxs("div",{className:"flex justify-between items-start mb-3",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high"}),p.jsx("div",{className:"h-5 w-40 rounded bg-surface-container-high"})]}),p.jsx("div",{className:"w-8 h-8 rounded-full bg-surface-container-high"})]}),p.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high/60 mb-3"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("div",{className:"h-5 w-16 rounded bg-surface-container-high/60"}),p.jsx("div",{className:"h-5 w-12 rounded bg-surface-container-high/60"})]})]})}function PF(){const{data:e,isLoading:t}=kD(ET*2),n=(e??[]).filter(r=>r.type!=="agent_run").slice(0,ET);return p.jsxs("section",{className:"space-y-5",children:[p.jsx("div",{className:"flex items-end justify-between border-b border-outline-variant/10 pb-4",children:p.jsxs("div",{children:[p.jsx("h3",{className:"font-serif text-3xl text-on-surface",children:"Session Pods"}),p.jsx("p",{className:"font-mono text-[10px] uppercase text-outline mt-1",children:"Monitoring concurrent thread activity"})]})}),t?p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:_F}).map((r,a)=>p.jsx(BF,{},a))}):n.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Cj,{className:"h-10 w-10 text-outline/30"}),p.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3 w-3 rounded-full bg-surface-container border-2 border-surface"})]}),p.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No recent activity"}),p.jsx("p",{className:"font-mono text-[10px] uppercase text-outline tracking-wider",children:"Pods appear as sessions and spores are captured"})]}):p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map(r=>p.jsx(LF,{event:r},r.id))})]})}const zF=ra.STATS,IF=ra.HEALTH,FF=ra.STATS,O1=new Set(["completed","failed","skipped"]),qF=ra.STATS,L1=6e4,UF=50;function ND(e){const t=(e==null?void 0:e.limit)??UF,n=new URLSearchParams;n.set("limit",String(t)),(e==null?void 0:e.offset)!==void 0&&n.set("offset",String(e.offset)),e!=null&&e.search&&n.set("search",e.search),e!=null&&e.status&&n.set("status",e.status),e!=null&&e.task&&n.set("task",e.task);const r=n.toString();return Fa({queryKey:["agent-runs",e],queryFn:({signal:a})=>bt(`/agent/runs?${r}`,{signal:a}),pollCategory:"standard",refetchInterval:zF})}function VF(e){return Tn({queryKey:["agent-run",e],queryFn:({signal:n})=>bt(`/agent/runs/${e}`,{signal:n}),enabled:e!==void 0,refetchInterval:n=>{var a,i;const r=(i=(a=n.state.data)==null?void 0:a.run)==null?void 0:i.status;return r&&O1.has(r)?!1:IF}})}function HF(e,t){const n=t?O1.has(t):!1;return Fa({queryKey:["agent-reports",e],queryFn:({signal:r})=>bt(`/agent/runs/${e}/reports`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:FF})}function GF(e,t){const n=t?O1.has(t):!1;return Fa({queryKey:["agent-turns",e],queryFn:({signal:r})=>bt(`/agent/runs/${e}/turns`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:qF})}function ic(){return Tn({queryKey:["agent-tasks"],queryFn:({signal:e})=>bt("/agent/tasks",{signal:e}),staleTime:L1})}function $F(e){return Tn({queryKey:["agent-task",e],queryFn:({signal:t})=>bt(`/agent/tasks/${e}`,{signal:t}),enabled:e!==void 0,staleTime:L1})}function KF(){const e=Ca();return vl({mutationFn:({taskId:t,name:n})=>Cr(`/agent/tasks/${t}/copy`,n?{name:n}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function YF(){const e=Ca();return vl({mutationFn:t=>Aj(`/agent/tasks/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function XF(e){return Tn({queryKey:["agent-task-yaml",e],queryFn:({signal:t})=>bt(`/agent/tasks/${e}/yaml`,{signal:t}),enabled:e!==void 0,staleTime:L1})}function QF(){const e=Ca();return vl({mutationFn:({taskId:t,yaml:n})=>wp(`/agent/tasks/${t}`,{yaml:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]}),e.invalidateQueries({queryKey:["agent-task"]}),e.invalidateQueries({queryKey:["agent-task-yaml"]})}})}function _1(){const e=Ca();return vl({mutationFn:t=>Cr("/agent/run",t),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-runs"]})}})}function B1(e){return e===null?"—":`$${e.toFixed(4)}`}function P1(e){return e===null?"—":e.toLocaleString()}function AD(e){switch(e){case"completed":return"default";case"running":return"warning";case"failed":return"destructive";default:return"secondary"}}function RD(e){return e===g1?"warning":"secondary"}const jD="Default task";function DD(e,t){if(!e)return jD;const n=t.find(r=>r.name===e);return(n==null?void 0:n.displayName)??e}const WF=5,CT={running:"bg-sage animate-pulse",completed:"bg-sage",failed:"bg-terracotta",skipped:"bg-outline/40",pending:"bg-outline/40"};function ZF({run:e,taskName:t,onClick:n}){const r=CT[e.status]??CT.pending;return p.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-outline-variant/5 last:border-0 cursor-pointer hover:bg-surface-container-high/50 -mx-2 px-2 rounded transition-colors",onClick:n,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n())},role:"link",tabIndex:0,"aria-label":`View run: ${t}`,children:[p.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[p.jsx("span",{className:Ae("h-2 w-2 shrink-0 rounded-full",r)}),p.jsx("span",{className:"text-sm text-on-surface truncate",children:t})]}),p.jsxs("div",{className:"flex items-center gap-3 shrink-0 font-mono text-[11px] text-outline",children:[p.jsx("span",{children:e.started_at!==null?oi(e.started_at):"—"}),p.jsx("span",{children:Dp(e.started_at,e.completed_at)})]})]})}function JF(){const{data:e,isLoading:t}=ND({limit:WF}),{data:n}=ic(),r=Wi(),a=(n==null?void 0:n.tasks)??[],i=(e==null?void 0:e.runs)??[];return p.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10",children:[p.jsxs("div",{className:"flex justify-between items-center mb-6",children:[p.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"Agent Runs"}),p.jsx(dd,{className:"h-5 w-5 text-outline"})]}),t?p.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"Loading runs..."}):i.length===0?p.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"No agent runs yet"}):p.jsx("div",{children:i.map(l=>p.jsx(ZF,{run:l,taskName:DD(l.task,a),onClick:()=>r("/agent")},l.id))})]})}const eq=12,tq=8;function nq(e){return e.includes("error")||e.includes("fail")?"error":e==="agent_run"?"warn":"ok"}const rq={ok:"[OK]",warn:"[WRN]",error:"[ERR]"},aq={ok:"text-sage",warn:"text-ochre",error:"text-terracotta"};function iq(e){return new Date(e*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function sq(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?"/mycelium":null}function lq({event:e,onClick:t}){const n=nq(e.type);return p.jsxs("div",{className:Ae("flex gap-4 items-start border-b border-outline-variant/5 pb-2 font-mono text-[11px] transition-all duration-150",t&&"cursor-pointer hover:bg-surface-container-high/50 hover:translate-x-1 -mx-2 px-2 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"),onClick:t,onKeyDown:t?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())}:void 0,tabIndex:t?0:void 0,role:t?"link":void 0,"aria-label":t?`${e.type.replace(/_/g," ")}: ${e.summary}`:void 0,children:[p.jsx("span",{className:"text-outline shrink-0 tabular-nums",children:iq(e.timestamp)}),p.jsx("span",{className:Ae("shrink-0 font-bold",aq[n]),children:rq[n]}),p.jsx("span",{className:"text-on-surface/70 truncate",children:e.summary})]})}function oq(){const{data:e,isLoading:t}=kD(eq),n=Wi(),r=(e==null?void 0:e.slice(0,tq))??[];return p.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10 transition-[border-color] duration-200 hover:border-outline-variant/25",children:[p.jsxs("div",{className:"flex justify-between items-center mb-6",children:[p.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"System Integrity Logs"}),p.jsx("span",{className:"text-[10px] font-mono text-sage px-2 py-1 bg-sage-muted rounded",children:"LIVE"})]}),t?p.jsx("div",{className:"space-y-3",children:[1,2,3].map(a=>p.jsxs("div",{className:"flex gap-4 items-start pb-2 animate-pulse",children:[p.jsx("div",{className:"h-3 w-14 rounded bg-surface-container-high/50"}),p.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high/50"}),p.jsx("div",{className:"h-3 flex-1 rounded bg-surface-container-high/40"})]},a))}):r.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[p.jsx(Tj,{className:"h-8 w-8 text-outline/20"}),p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"No log entries yet"})]}):p.jsx("div",{className:"space-y-3",children:r.map(a=>{const i=sq(a);return p.jsx(lq,{event:a,onClick:i?()=>n(i):void 0},a.id)})})]})}function uq(e){const{embedded_count:t,total_embeddable:n}=e.embedding;if(n===0)return"Initializing";const r=t/n;return r>=.95?"Optimal":r>=.7?"Good":"Degraded"}function cq({stats:e}){const t=uq(e);return p.jsxs("div",{className:"flex items-center justify-between px-2 py-3 border-t border-outline-variant/10",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("span",{className:"font-mono text-[10px] uppercase text-sage",children:["System Connectivity: ",t]}),p.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sage animate-pulse"})]}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:e.vault.name}),p.jsxs("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:["v",e.daemon.version]})]})]})}function fq(){const{data:e,isLoading:t,isError:n,error:r}=Sp();return p.jsx(R1,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Connecting to daemon...",children:e&&p.jsxs("div",{className:"relative min-h-full",children:[p.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.04]",children:p.jsxs("svg",{height:"100%",width:"100%",viewBox:"0 0 800 800",preserveAspectRatio:"none",children:[p.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 300 500 200 400C100 300 0 400 0 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),p.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 500 500 600 400C700 300 800 400 800 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),p.jsx("path",{className:"mycelial-connector",d:"M400 800C400 500 450 300 400 100",fill:"none",stroke:"#abcfb8",strokeWidth:"1"})]})}),p.jsxs("div",{className:"relative z-10 p-6 lg:p-8 max-w-7xl mx-auto space-y-10",children:[p.jsx(SF,{stats:e}),p.jsx(kF,{stats:e}),p.jsx(PF,{}),p.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsx(JF,{}),p.jsx(oq,{})]}),p.jsx(cq,{stats:e})]})]})})}const dq=Ep("rounded-md transition-colors",{variants:{level:{lowest:"bg-surface-container-lowest",low:"bg-surface-container-low",default:"bg-surface-container",high:"bg-surface-container-high",highest:"bg-surface-container-highest",bright:"bg-surface-bright"},interactive:{true:"cursor-pointer hover-lift hover:brightness-[1.08]",false:""},ghostBorder:{true:"border border-[var(--ghost-border)]",false:""},glass:{true:"backdrop-blur-xl bg-surface-variant/60",false:""},glow:{true:"shadow-[inset_0_0_12px_rgba(171,207,184,0.2)]",false:""}},defaultVariants:{level:"low",interactive:!1,ghostBorder:!1,glass:!1,glow:!1}}),st=j.forwardRef(({className:e,level:t,interactive:n,ghostBorder:r,glass:a,glow:i,...l},o)=>p.jsx("div",{ref:o,className:Ae(dq({level:t,interactive:n,ghostBorder:r,glass:a,glow:i}),e),...l}));st.displayName="Surface";function hq({tabs:e,activeTab:t,onTabChange:n,className:r}){return p.jsx("div",{className:Ae("flex items-center gap-6",r),children:e.map(a=>p.jsx("button",{onClick:()=>n(a.id),className:Ae("pb-2 font-sans text-sm font-medium transition-colors border-b-2",t===a.id?"text-primary border-primary":"text-on-surface-variant border-transparent hover:text-on-surface"),children:a.label},a.id))})}function Gi({title:e,subtitle:t,tabs:n,activeTab:r,onTabChange:a,actions:i,className:l}){return p.jsxs("div",{className:Ae("pb-6",l),children:[p.jsxs("div",{className:"flex items-start justify-between",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:e}),t&&p.jsx("p",{className:"mt-1 font-sans text-sm text-on-surface-variant",children:t})]}),i&&p.jsx("div",{className:"flex items-center gap-2",children:i})]}),n&&r&&a&&p.jsx(hq,{tabs:n,activeTab:r,onTabChange:a,className:"mt-4"})]})}function MD({open:e,onOpenChange:t,title:n,description:r,icon:a,meta:i,impact:l,confirmLabel:o="Confirm",variant:f="destructive",onConfirm:c,isPending:d=!1}){var v,m;return p.jsx(Ap,{open:e,onOpenChange:t,children:p.jsxs(hd,{className:"sm:max-w-md border border-outline-variant/20 [&>button:last-child]:hidden",children:[p.jsxs(Rp,{children:[p.jsxs("div",{className:"flex items-center gap-3",children:[a&&p.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-tertiary/15",children:a}),p.jsx(vd,{children:n})]}),p.jsx(A1,{children:r})]}),i&&i.length>0&&p.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-outline-variant/20 px-4 py-3",children:[p.jsx("span",{className:"font-mono text-xs text-on-surface-variant bg-surface-container px-1.5 py-0.5 rounded shrink-0",children:(v=i[0])==null?void 0:v.value}),i.length>1&&p.jsx("span",{className:"text-sm font-medium text-on-surface truncate",children:(m=i[1])==null?void 0:m.value})]}),l&&l.length>0&&p.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.map(y=>p.jsxs("div",{className:"rounded-md border border-outline-variant/20 px-3 py-2",children:[p.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-wider text-on-surface-variant",children:y.label}),p.jsx("div",{className:"font-sans text-base font-medium text-on-surface",children:y.value})]},y.label))}),p.jsxs(jp,{children:[p.jsx(Ke,{variant:"secondary",size:"sm",onClick:()=>t(!1),disabled:d,children:"Cancel"}),p.jsxs(Ke,{variant:f,size:"sm",onClick:c,disabled:d,className:"gap-2",children:[d&&p.jsx(Qn,{className:"h-4 w-4 animate-spin"}),o]})]})]})})}function TT(e,[t,n]){return Math.min(n,Math.max(t,e))}function vq(e){const t=e+"CollectionProvider",[n,r]=Cp(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:S,children:b}=w,C=Bi.useRef(null),T=Bi.useRef(new Map).current;return p.jsx(a,{scope:S,itemMap:T,collectionRef:C,children:b})};l.displayName=t;const o=e+"CollectionSlot",f=Uf(o),c=Bi.forwardRef((w,S)=>{const{scope:b,children:C}=w,T=i(o,b),N=Cn(S,T.collectionRef);return p.jsx(f,{ref:N,children:C})});c.displayName=o;const d=e+"CollectionItemSlot",v="data-radix-collection-item",m=Uf(d),y=Bi.forwardRef((w,S)=>{const{scope:b,children:C,...T}=w,N=Bi.useRef(null),A=Cn(S,N),R=i(d,b);return Bi.useEffect(()=>(R.itemMap.set(N,{ref:N,...T}),()=>void R.itemMap.delete(N))),p.jsx(m,{[v]:"",ref:A,children:C})});y.displayName=d;function x(w){const S=i(e+"CollectionConsumer",w);return Bi.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const T=Array.from(C.querySelectorAll(`[${v}]`));return Array.from(S.itemMap.values()).sort((R,D)=>T.indexOf(R.ref.current)-T.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:y},x,r]}var pq=j.createContext(void 0);function mq(e){const t=j.useContext(pq);return e||t||"ltr"}const gq=["top","right","bottom","left"],sl=Math.min,Jr=Math.max,Gv=Math.round,Jh=Math.floor,si=e=>({x:e,y:e}),yq={left:"right",right:"left",bottom:"top",top:"bottom"};function hb(e,t,n){return Jr(e,sl(t,n))}function $i(e,t){return typeof e=="function"?e(t):e}function Ki(e){return e.split("-")[0]}function sc(e){return e.split("-")[1]}function z1(e){return e==="x"?"y":"x"}function I1(e){return e==="y"?"height":"width"}function ri(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function F1(e){return z1(ri(e))}function xq(e,t,n){n===void 0&&(n=!1);const r=sc(e),a=F1(e),i=I1(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=$v(l)),[l,$v(l)]}function bq(e){const t=$v(e);return[vb(e),t,vb(t)]}function vb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const kT=["left","right"],NT=["right","left"],wq=["top","bottom"],Sq=["bottom","top"];function Eq(e,t,n){switch(e){case"top":case"bottom":return n?t?NT:kT:t?kT:NT;case"left":case"right":return t?wq:Sq;default:return[]}}function Cq(e,t,n,r){const a=sc(e);let i=Eq(Ki(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(vb)))),i}function $v(e){const t=Ki(e);return yq[t]+e.slice(t.length)}function Tq(e){return{top:0,right:0,bottom:0,left:0,...e}}function OD(e){return typeof e!="number"?Tq(e):{top:e,right:e,bottom:e,left:e}}function Kv(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function AT(e,t,n){let{reference:r,floating:a}=e;const i=ri(t),l=F1(t),o=I1(l),f=Ki(t),c=i==="y",d=r.x+r.width/2-a.width/2,v=r.y+r.height/2-a.height/2,m=r[o]/2-a[o]/2;let y;switch(f){case"top":y={x:d,y:r.y-a.height};break;case"bottom":y={x:d,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:v};break;case"left":y={x:r.x-a.width,y:v};break;default:y={x:r.x,y:r.y}}switch(sc(t)){case"start":y[l]-=m*(n&&c?-1:1);break;case"end":y[l]+=m*(n&&c?-1:1);break}return y}async function kq(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:o,strategy:f}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:v="floating",altBoundary:m=!1,padding:y=0}=$i(t,e),x=OD(y),S=o[m?v==="floating"?"reference":"floating":v],b=Kv(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:f})),C=v==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),N=await(i.isElement==null?void 0:i.isElement(T))?await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1}:{x:1,y:1},A=Kv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:C,offsetParent:T,strategy:f}):C);return{top:(b.top-A.top+x.top)/N.y,bottom:(A.bottom-b.bottom+x.bottom)/N.y,left:(b.left-A.left+x.left)/N.x,right:(A.right-b.right+x.right)/N.x}}const Nq=50,Aq=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,o=l.detectOverflow?l:{...l,detectOverflow:kq},f=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:v}=AT(c,r,f),m=r,y=0;const x={};for(let w=0;w<i.length;w++){const S=i[w];if(!S)continue;const{name:b,fn:C}=S,{x:T,y:N,data:A,reset:R}=await C({x:d,y:v,initialPlacement:r,placement:m,strategy:a,middlewareData:x,rects:c,platform:o,elements:{reference:e,floating:t}});d=T??d,v=N??v,x[b]={...x[b],...A},R&&y<Nq&&(y++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(c=R.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):R.rects),{x:d,y:v}=AT(c,m,f)),w=-1)}return{x:d,y:v,placement:m,strategy:a,middlewareData:x}},Rq=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:o,middlewareData:f}=t,{element:c,padding:d=0}=$i(e,t)||{};if(c==null)return{};const v=OD(d),m={x:n,y:r},y=F1(a),x=I1(y),w=await l.getDimensions(c),S=y==="y",b=S?"top":"left",C=S?"bottom":"right",T=S?"clientHeight":"clientWidth",N=i.reference[x]+i.reference[y]-m[y]-i.floating[x],A=m[y]-i.reference[y],R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=R?R[T]:0;(!D||!await(l.isElement==null?void 0:l.isElement(R)))&&(D=o.floating[T]||i.floating[x]);const L=N/2-A/2,_=D/2-w[x]/2-1,M=sl(v[b],_),z=sl(v[C],_),P=M,G=D-w[x]-z,I=D/2-w[x]/2+L,F=hb(P,I,G),B=!f.arrow&&sc(a)!=null&&I!==F&&i.reference[x]/2-(I<P?M:z)-w[x]/2<0,H=B?I<P?I-P:I-G:0;return{[y]:m[y]+H,data:{[y]:F,centerOffset:I-F-H,...B&&{alignmentOffset:H}},reset:B}}}),jq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:o,platform:f,elements:c}=t,{mainAxis:d=!0,crossAxis:v=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...S}=$i(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Ki(a),C=ri(o),T=Ki(o)===o,N=await(f.isRTL==null?void 0:f.isRTL(c.floating)),A=m||(T||!w?[$v(o)]:bq(o)),R=x!=="none";!m&&R&&A.push(...Cq(o,w,x,N));const D=[o,...A],L=await f.detectOverflow(t,S),_=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push(L[b]),v){const I=xq(a,l,N);_.push(L[I[0]],L[I[1]])}if(M=[...M,{placement:a,overflows:_}],!_.every(I=>I<=0)){var z,P;const I=(((z=i.flip)==null?void 0:z.index)||0)+1,F=D[I];if(F&&(!(v==="alignment"?C!==ri(F):!1)||M.every(Y=>ri(Y.placement)===C?Y.overflows[0]>0:!0)))return{data:{index:I,overflows:M},reset:{placement:F}};let B=(P=M.filter(H=>H.overflows[0]<=0).sort((H,Y)=>H.overflows[1]-Y.overflows[1])[0])==null?void 0:P.placement;if(!B)switch(y){case"bestFit":{var G;const H=(G=M.filter(Y=>{if(R){const Q=ri(Y.placement);return Q===C||Q==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(Q=>Q>0).reduce((Q,V)=>Q+V,0)]).sort((Y,Q)=>Y[1]-Q[1])[0])==null?void 0:G[0];H&&(B=H);break}case"initialPlacement":B=o;break}if(a!==B)return{reset:{placement:B}}}return{}}}};function RT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jT(e){return gq.some(t=>e[t]>=0)}const Dq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=$i(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),o=RT(l,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:jT(o)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),o=RT(l,n.floating);return{data:{escapedOffsets:o,escaped:jT(o)}}}default:return{}}}}},LD=new Set(["left","top"]);async function Mq(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ki(n),o=sc(n),f=ri(n)==="y",c=LD.has(l)?-1:1,d=i&&f?-1:1,v=$i(t,e);let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return o&&typeof x=="number"&&(y=o==="end"?x*-1:x),f?{x:y*d,y:m*c}:{x:m*c,y:y*d}}const Oq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:o}=t,f=await Mq(t,e);return l===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},Lq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:o=!1,limiter:f={fn:b=>{let{x:C,y:T}=b;return{x:C,y:T}}},...c}=$i(e,t),d={x:n,y:r},v=await i.detectOverflow(t,c),m=ri(Ki(a)),y=z1(m);let x=d[y],w=d[m];if(l){const b=y==="y"?"top":"left",C=y==="y"?"bottom":"right",T=x+v[b],N=x-v[C];x=hb(T,x,N)}if(o){const b=m==="y"?"top":"left",C=m==="y"?"bottom":"right",T=w+v[b],N=w-v[C];w=hb(T,w,N)}const S=f.fn({...t,[y]:x,[m]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[y]:l,[m]:o}}}}}},_q=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:o=0,mainAxis:f=!0,crossAxis:c=!0}=$i(e,t),d={x:n,y:r},v=ri(a),m=z1(v);let y=d[m],x=d[v];const w=$i(o,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const T=m==="y"?"height":"width",N=i.reference[m]-i.floating[T]+S.mainAxis,A=i.reference[m]+i.reference[T]-S.mainAxis;y<N?y=N:y>A&&(y=A)}if(c){var b,C;const T=m==="y"?"width":"height",N=LD.has(Ki(a)),A=i.reference[v]-i.floating[T]+(N&&((b=l.offset)==null?void 0:b[v])||0)+(N?0:S.crossAxis),R=i.reference[v]+i.reference[T]+(N?0:((C=l.offset)==null?void 0:C[v])||0)-(N?S.crossAxis:0);x<A?x=A:x>R&&(x=R)}return{[m]:y,[v]:x}}}},Bq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:o}=t,{apply:f=()=>{},...c}=$i(e,t),d=await l.detectOverflow(t,c),v=Ki(a),m=sc(a),y=ri(a)==="y",{width:x,height:w}=i.floating;let S,b;v==="top"||v==="bottom"?(S=v,b=m===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(b=v,S=m==="end"?"top":"bottom");const C=w-d.top-d.bottom,T=x-d.left-d.right,N=sl(w-d[S],C),A=sl(x-d[b],T),R=!t.middlewareData.shift;let D=N,L=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=C),R&&!m){const M=Jr(d.left,0),z=Jr(d.right,0),P=Jr(d.top,0),G=Jr(d.bottom,0);y?L=x-2*(M!==0||z!==0?M+z:Jr(d.left,d.right)):D=w-2*(P!==0||G!==0?P+G:Jr(d.top,d.bottom))}await f({...t,availableWidth:L,availableHeight:D});const _=await l.getDimensions(o.floating);return x!==_.width||w!==_.height?{reset:{rects:!0}}:{}}}};function Mp(){return typeof window<"u"}function lc(e){return _D(e)?(e.nodeName||"").toLowerCase():"#document"}function ea(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fi(e){var t;return(t=(_D(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _D(e){return Mp()?e instanceof Node||e instanceof ea(e).Node:!1}function Ba(e){return Mp()?e instanceof Element||e instanceof ea(e).Element:!1}function Ji(e){return Mp()?e instanceof HTMLElement||e instanceof ea(e).HTMLElement:!1}function DT(e){return!Mp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ea(e).ShadowRoot}function pd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Pa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function Pq(e){return/^(table|td|th)$/.test(lc(e))}function Op(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const zq=/transform|translate|scale|rotate|perspective|filter/,Iq=/paint|layout|strict|content/,Fl=e=>!!e&&e!=="none";let Py;function q1(e){const t=Ba(e)?Pa(e):e;return Fl(t.transform)||Fl(t.translate)||Fl(t.scale)||Fl(t.rotate)||Fl(t.perspective)||!U1()&&(Fl(t.backdropFilter)||Fl(t.filter))||zq.test(t.willChange||"")||Iq.test(t.contain||"")}function Fq(e){let t=ll(e);for(;Ji(t)&&!Yu(t);){if(q1(t))return t;if(Op(t))return null;t=ll(t)}return null}function U1(){return Py==null&&(Py=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Py}function Yu(e){return/^(html|body|#document)$/.test(lc(e))}function Pa(e){return ea(e).getComputedStyle(e)}function Lp(e){return Ba(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ll(e){if(lc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||DT(e)&&e.host||fi(e);return DT(t)?t.host:t}function BD(e){const t=ll(e);return Yu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ji(t)&&pd(t)?t:BD(t)}function Vf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=BD(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ea(a);if(i){const o=pb(l);return t.concat(l,l.visualViewport||[],pd(a)?a:[],o&&n?Vf(o):[])}else return t.concat(a,Vf(a,[],n))}function pb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function PD(e){const t=Pa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ji(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,o=Gv(n)!==i||Gv(r)!==l;return o&&(n=i,r=l),{width:n,height:r,$:o}}function V1(e){return Ba(e)?e:e.contextElement}function Ru(e){const t=V1(e);if(!Ji(t))return si(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=PD(t);let l=(i?Gv(n.width):n.width)/r,o=(i?Gv(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const qq=si(0);function zD(e){const t=ea(e);return!U1()||!t.visualViewport?qq:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Uq(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ea(e)?!1:t}function fo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=V1(e);let l=si(1);t&&(r?Ba(r)&&(l=Ru(r)):l=Ru(e));const o=Uq(i,n,r)?zD(i):si(0);let f=(a.left+o.x)/l.x,c=(a.top+o.y)/l.y,d=a.width/l.x,v=a.height/l.y;if(i){const m=ea(i),y=r&&Ba(r)?ea(r):r;let x=m,w=pb(x);for(;w&&r&&y!==x;){const S=Ru(w),b=w.getBoundingClientRect(),C=Pa(w),T=b.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,N=b.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;f*=S.x,c*=S.y,d*=S.x,v*=S.y,f+=T,c+=N,x=ea(w),w=pb(x)}}return Kv({width:d,height:v,x:f,y:c})}function _p(e,t){const n=Lp(e).scrollLeft;return t?t.left+n:fo(fi(e)).left+n}function ID(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-_p(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function Vq(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=fi(r),o=t?Op(t.floating):!1;if(r===l||o&&i)return n;let f={scrollLeft:0,scrollTop:0},c=si(1);const d=si(0),v=Ji(r);if((v||!v&&!i)&&((lc(r)!=="body"||pd(l))&&(f=Lp(r)),v)){const y=fo(r);c=Ru(r),d.x=y.x+r.clientLeft,d.y=y.y+r.clientTop}const m=l&&!v&&!i?ID(l,f):si(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-f.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-f.scrollTop*c.y+d.y+m.y}}function Hq(e){return Array.from(e.getClientRects())}function Gq(e){const t=fi(e),n=Lp(e),r=e.ownerDocument.body,a=Jr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Jr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+_p(e);const o=-n.scrollTop;return Pa(r).direction==="rtl"&&(l+=Jr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:o}}const MT=25;function $q(e,t){const n=ea(e),r=fi(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,o=0,f=0;if(a){i=a.width,l=a.height;const d=U1();(!d||d&&t==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}const c=_p(r);if(c<=0){const d=r.ownerDocument,v=d.body,m=getComputedStyle(v),y=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-v.clientWidth-y);x<=MT&&(i-=x)}else c<=MT&&(i+=c);return{width:i,height:l,x:o,y:f}}function Kq(e,t){const n=fo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Ji(e)?Ru(e):si(1),l=e.clientWidth*i.x,o=e.clientHeight*i.y,f=a*i.x,c=r*i.y;return{width:l,height:o,x:f,y:c}}function OT(e,t,n){let r;if(t==="viewport")r=$q(e,n);else if(t==="document")r=Gq(fi(e));else if(Ba(t))r=Kq(t,n);else{const a=zD(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Kv(r)}function FD(e,t){const n=ll(e);return n===t||!Ba(n)||Yu(n)?!1:Pa(n).position==="fixed"||FD(n,t)}function Yq(e,t){const n=t.get(e);if(n)return n;let r=Vf(e,[],!1).filter(o=>Ba(o)&&lc(o)!=="body"),a=null;const i=Pa(e).position==="fixed";let l=i?ll(e):e;for(;Ba(l)&&!Yu(l);){const o=Pa(l),f=q1(l);!f&&o.position==="fixed"&&(a=null),(i?!f&&!a:!f&&o.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||pd(l)&&!f&&FD(e,l))?r=r.filter(d=>d!==l):a=o,l=ll(l)}return t.set(e,r),r}function Xq(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Op(t)?[]:Yq(t,this._c):[].concat(n),r],o=OT(t,l[0],a);let f=o.top,c=o.right,d=o.bottom,v=o.left;for(let m=1;m<l.length;m++){const y=OT(t,l[m],a);f=Jr(y.top,f),c=sl(y.right,c),d=sl(y.bottom,d),v=Jr(y.left,v)}return{width:c-v,height:d-f,x:v,y:f}}function Qq(e){const{width:t,height:n}=PD(e);return{width:t,height:n}}function Wq(e,t,n){const r=Ji(t),a=fi(t),i=n==="fixed",l=fo(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const f=si(0);function c(){f.x=_p(a)}if(r||!r&&!i)if((lc(t)!=="body"||pd(a))&&(o=Lp(t)),r){const y=fo(t,!0,i,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&c();i&&!r&&a&&c();const d=a&&!r&&!i?ID(a,o):si(0),v=l.left+o.scrollLeft-f.x-d.x,m=l.top+o.scrollTop-f.y-d.y;return{x:v,y:m,width:l.width,height:l.height}}function zy(e){return Pa(e).position==="static"}function LT(e,t){if(!Ji(e)||Pa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return fi(e)===n&&(n=n.ownerDocument.body),n}function qD(e,t){const n=ea(e);if(Op(e))return n;if(!Ji(e)){let a=ll(e);for(;a&&!Yu(a);){if(Ba(a)&&!zy(a))return a;a=ll(a)}return n}let r=LT(e,t);for(;r&&Pq(r)&&zy(r);)r=LT(r,t);return r&&Yu(r)&&zy(r)&&!q1(r)?n:r||Fq(e)||n}const Zq=async function(e){const t=this.getOffsetParent||qD,n=this.getDimensions,r=await n(e.floating);return{reference:Wq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jq(e){return Pa(e).direction==="rtl"}const eU={convertOffsetParentRelativeRectToViewportRelativeRect:Vq,getDocumentElement:fi,getClippingRect:Xq,getOffsetParent:qD,getElementRects:Zq,getClientRects:Hq,getDimensions:Qq,getScale:Ru,isElement:Ba,isRTL:Jq};function UD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tU(e,t){let n=null,r;const a=fi(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function l(o,f){o===void 0&&(o=!1),f===void 0&&(f=1),i();const c=e.getBoundingClientRect(),{left:d,top:v,width:m,height:y}=c;if(o||t(),!m||!y)return;const x=Jh(v),w=Jh(a.clientWidth-(d+m)),S=Jh(a.clientHeight-(v+y)),b=Jh(d),T={rootMargin:-x+"px "+-w+"px "+-S+"px "+-b+"px",threshold:Jr(0,sl(1,f))||1};let N=!0;function A(R){const D=R[0].intersectionRatio;if(D!==f){if(!N)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!UD(c,e.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(A,{...T,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,T)}n.observe(e)}return l(!0),i}function nU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,c=V1(e),d=a||i?[...c?Vf(c):[],...t?Vf(t):[]]:[];d.forEach(b=>{a&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const v=c&&o?tU(c,n):null;let m=-1,y=null;l&&(y=new ResizeObserver(b=>{let[C]=b;C&&C.target===c&&y&&t&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(t)})),n()}),c&&!f&&y.observe(c),t&&y.observe(t));let x,w=f?fo(e):null;f&&S();function S(){const b=fo(e);w&&!UD(w,b)&&n(),w=b,x=requestAnimationFrame(S)}return n(),()=>{var b;d.forEach(C=>{a&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),v==null||v(),(b=y)==null||b.disconnect(),y=null,f&&cancelAnimationFrame(x)}}const rU=Oq,aU=Lq,iU=jq,sU=Bq,lU=Dq,_T=Rq,oU=_q,uU=(e,t,n)=>{const r=new Map,a={platform:eU,...n},i={...a.platform,_c:r};return Aq(e,t,{...a,platform:i})};var cU=typeof document<"u",fU=function(){},Tv=cU?j.useLayoutEffect:fU;function Yv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yv(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Yv(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function VD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BT(e,t){const n=VD(e);return Math.round(t*n)/n}function Iy(e){const t=j.useRef(e);return Tv(()=>{t.current=e}),t}function dU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:o=!0,whileElementsMounted:f,open:c}=e,[d,v]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,y]=j.useState(r);Yv(m,r)||y(r);const[x,w]=j.useState(null),[S,b]=j.useState(null),C=j.useCallback(Y=>{Y!==R.current&&(R.current=Y,w(Y))},[]),T=j.useCallback(Y=>{Y!==D.current&&(D.current=Y,b(Y))},[]),N=i||x,A=l||S,R=j.useRef(null),D=j.useRef(null),L=j.useRef(d),_=f!=null,M=Iy(f),z=Iy(a),P=Iy(c),G=j.useCallback(()=>{if(!R.current||!D.current)return;const Y={placement:t,strategy:n,middleware:m};z.current&&(Y.platform=z.current),uU(R.current,D.current,Y).then(Q=>{const V={...Q,isPositioned:P.current!==!1};I.current&&!Yv(L.current,V)&&(L.current=V,fd.flushSync(()=>{v(V)}))})},[m,t,n,z,P]);Tv(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(Y=>({...Y,isPositioned:!1})))},[c]);const I=j.useRef(!1);Tv(()=>(I.current=!0,()=>{I.current=!1}),[]),Tv(()=>{if(N&&(R.current=N),A&&(D.current=A),N&&A){if(M.current)return M.current(N,A,G);G()}},[N,A,G,M,_]);const F=j.useMemo(()=>({reference:R,floating:D,setReference:C,setFloating:T}),[C,T]),B=j.useMemo(()=>({reference:N,floating:A}),[N,A]),H=j.useMemo(()=>{const Y={position:n,left:0,top:0};if(!B.floating)return Y;const Q=BT(B.floating,d.x),V=BT(B.floating,d.y);return o?{...Y,transform:"translate("+Q+"px, "+V+"px)",...VD(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:V}},[n,o,B.floating,d.x,d.y]);return j.useMemo(()=>({...d,update:G,refs:F,elements:B,floatingStyles:H}),[d,G,F,B,H])}const hU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?_T({element:r.current,padding:a}).fn(n):{}:r?_T({element:r,padding:a}).fn(n):{}}}},vU=(e,t)=>{const n=rU(e);return{name:n.name,fn:n.fn,options:[e,t]}},pU=(e,t)=>{const n=aU(e);return{name:n.name,fn:n.fn,options:[e,t]}},mU=(e,t)=>({fn:oU(e).fn,options:[e,t]}),gU=(e,t)=>{const n=iU(e);return{name:n.name,fn:n.fn,options:[e,t]}},yU=(e,t)=>{const n=sU(e);return{name:n.name,fn:n.fn,options:[e,t]}},xU=(e,t)=>{const n=lU(e);return{name:n.name,fn:n.fn,options:[e,t]}},bU=(e,t)=>{const n=hU(e);return{name:n.name,fn:n.fn,options:[e,t]}};var wU="Arrow",HD=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return p.jsx(Yt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});HD.displayName=wU;var SU=HD;function EU(e){const[t,n]=j.useState(void 0);return vr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,o;if("borderBoxSize"in i){const f=i.borderBoxSize,c=Array.isArray(f)?f[0]:f;l=c.inlineSize,o=c.blockSize}else l=e.offsetWidth,o=e.offsetHeight;n({width:l,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var H1="Popper",[GD,$D]=Cp(H1),[CU,KD]=GD(H1),YD=e=>{const{__scopePopper:t,children:n}=e,[r,a]=j.useState(null);return p.jsx(CU,{scope:t,anchor:r,onAnchorChange:a,children:n})};YD.displayName=H1;var XD="PopperAnchor",QD=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=KD(XD,n),l=j.useRef(null),o=Cn(t,l),f=j.useRef(null);return j.useEffect(()=>{const c=f.current;f.current=(r==null?void 0:r.current)||l.current,c!==f.current&&i.onAnchorChange(f.current)}),r?null:p.jsx(Yt.div,{...a,ref:o})});QD.displayName=XD;var G1="PopperContent",[TU,kU]=GD(G1),WD=j.forwardRef((e,t)=>{var ae,we,fe,J,ne,re;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:o=0,avoidCollisions:f=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:v="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:x,...w}=e,S=KD(G1,n),[b,C]=j.useState(null),T=Cn(t,ge=>C(ge)),[N,A]=j.useState(null),R=EU(N),D=(R==null?void 0:R.width)??0,L=(R==null?void 0:R.height)??0,_=r+(i!=="center"?"-"+i:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},z=Array.isArray(c)?c:[c],P=z.length>0,G={padding:M,boundary:z.filter(AU),altBoundary:P},{refs:I,floatingStyles:F,placement:B,isPositioned:H,middlewareData:Y}=dU({strategy:"fixed",placement:_,whileElementsMounted:(...ge)=>nU(...ge,{animationFrame:y==="always"}),elements:{reference:S.anchor},middleware:[vU({mainAxis:a+L,alignmentAxis:l}),f&&pU({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?mU():void 0,...G}),f&&gU({...G}),yU({...G,apply:({elements:ge,rects:ke,availableWidth:Be,availableHeight:lt})=>{const{width:Ze,height:Qe}=ke.reference,qe=ge.floating.style;qe.setProperty("--radix-popper-available-width",`${Be}px`),qe.setProperty("--radix-popper-available-height",`${lt}px`),qe.setProperty("--radix-popper-anchor-width",`${Ze}px`),qe.setProperty("--radix-popper-anchor-height",`${Qe}px`)}}),N&&bU({element:N,padding:o}),RU({arrowWidth:D,arrowHeight:L}),m&&xU({strategy:"referenceHidden",...G})]}),[Q,V]=eM(B),q=uo(x);vr(()=>{H&&(q==null||q())},[H,q]);const X=(ae=Y.arrow)==null?void 0:ae.x,U=(we=Y.arrow)==null?void 0:we.y,te=((fe=Y.arrow)==null?void 0:fe.centerOffset)!==0,[ie,oe]=j.useState();return vr(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:H?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(J=Y.transformOrigin)==null?void 0:J.x,(ne=Y.transformOrigin)==null?void 0:ne.y].join(" "),...((re=Y.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(TU,{scope:n,placedSide:Q,onArrowChange:A,arrowX:X,arrowY:U,shouldHideArrow:te,children:p.jsx(Yt.div,{"data-side":Q,"data-align":V,...w,ref:T,style:{...w.style,animation:H?void 0:"none"}})})})});WD.displayName=G1;var ZD="PopperArrow",NU={top:"bottom",right:"left",bottom:"top",left:"right"},JD=j.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=kU(ZD,r),l=NU[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(SU,{...a,ref:n,style:{...a.style,display:"block"}})})});JD.displayName=ZD;function AU(e){return e!==null}var RU=e=>({name:"transformOrigin",options:e,fn(t){var S,b,C;const{placement:n,rects:r,middlewareData:a}=t,l=((S=a.arrow)==null?void 0:S.centerOffset)!==0,o=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[c,d]=eM(n),v={start:"0%",center:"50%",end:"100%"}[d],m=(((b=a.arrow)==null?void 0:b.x)??0)+o/2,y=(((C=a.arrow)==null?void 0:C.y)??0)+f/2;let x="",w="";return c==="bottom"?(x=l?v:`${m}px`,w=`${-f}px`):c==="top"?(x=l?v:`${m}px`,w=`${r.floating.height+f}px`):c==="right"?(x=`${-f}px`,w=l?v:`${y}px`):c==="left"&&(x=`${r.floating.width+f}px`,w=l?v:`${y}px`),{data:{x,y:w}}}});function eM(e){const[t,n="center"]=e.split("-");return[t,n]}var jU=YD,DU=QD,MU=WD,OU=JD;function LU(e){const t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var tM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),_U="VisuallyHidden",BU=j.forwardRef((e,t)=>p.jsx(Yt.span,{...e,ref:t,style:{...tM,...e.style}}));BU.displayName=_U;var PU=[" ","Enter","ArrowUp","ArrowDown"],zU=[" ","Enter"],ho="Select",[Bp,Pp,IU]=vq(ho),[oc]=Cp(ho,[IU,$D]),zp=$D(),[FU,pl]=oc(ho),[qU,UU]=oc(ho),nM=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:o,onValueChange:f,dir:c,name:d,autoComplete:v,disabled:m,required:y,form:x}=e,w=zp(t),[S,b]=j.useState(null),[C,T]=j.useState(null),[N,A]=j.useState(!1),R=mq(c),[D,L]=Uv({prop:r,defaultProp:a??!1,onChange:i,caller:ho}),[_,M]=Uv({prop:l,defaultProp:o,onChange:f,caller:ho}),z=j.useRef(null),P=S?x||!!S.closest("form"):!0,[G,I]=j.useState(new Set),F=Array.from(G).map(B=>B.props.value).join(";");return p.jsx(jU,{...w,children:p.jsxs(FU,{required:y,scope:t,trigger:S,onTriggerChange:b,valueNode:C,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:A,contentId:Nu(),value:_,onValueChange:M,open:D,onOpenChange:L,dir:R,triggerPointerDownPosRef:z,disabled:m,children:[p.jsx(Bp.Provider,{scope:t,children:p.jsx(qU,{scope:e.__scopeSelect,onNativeOptionAdd:j.useCallback(B=>{I(H=>new Set(H).add(B))},[]),onNativeOptionRemove:j.useCallback(B=>{I(H=>{const Y=new Set(H);return Y.delete(B),Y})},[]),children:n})}),P?p.jsxs(SM,{"aria-hidden":!0,required:y,tabIndex:-1,name:d,autoComplete:v,value:_,onChange:B=>M(B.target.value),disabled:m,form:x,children:[_===void 0?p.jsx("option",{value:""}):null,Array.from(G)]},F):null]})})};nM.displayName=ho;var rM="SelectTrigger",aM=j.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=zp(n),l=pl(rM,n),o=l.disabled||r,f=Cn(t,l.onTriggerChange),c=Pp(n),d=j.useRef("touch"),[v,m,y]=CM(w=>{const S=c().filter(T=>!T.disabled),b=S.find(T=>T.value===l.value),C=TM(S,w,b);C!==void 0&&l.onValueChange(C.value)}),x=w=>{o||(l.onOpenChange(!0),y()),w&&(l.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return p.jsx(DU,{asChild:!0,...i,children:p.jsx(Yt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":EM(l.value)?"":void 0,...a,ref:f,onClick:Wt(a.onClick,w=>{w.currentTarget.focus(),d.current!=="mouse"&&x(w)}),onPointerDown:Wt(a.onPointerDown,w=>{d.current=w.pointerType;const S=w.target;S.hasPointerCapture(w.pointerId)&&S.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(x(w),w.preventDefault())}),onKeyDown:Wt(a.onKeyDown,w=>{const S=v.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&m(w.key),!(S&&w.key===" ")&&PU.includes(w.key)&&(x(),w.preventDefault())})})})});aM.displayName=rM;var iM="SelectValue",sM=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...o}=e,f=pl(iM,n),{onValueNodeHasChildrenChange:c}=f,d=i!==void 0,v=Cn(t,f.onValueNodeChange);return vr(()=>{c(d)},[c,d]),p.jsx(Yt.span,{...o,ref:v,style:{pointerEvents:"none"},children:EM(f.value)?p.jsx(p.Fragment,{children:l}):i})});sM.displayName=iM;var VU="SelectIcon",lM=j.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return p.jsx(Yt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});lM.displayName=VU;var HU="SelectPortal",oM=e=>p.jsx(E1,{asChild:!0,...e});oM.displayName=HU;var vo="SelectContent",uM=j.forwardRef((e,t)=>{const n=pl(vo,e.__scopeSelect),[r,a]=j.useState();if(vr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?fd.createPortal(p.jsx(cM,{scope:e.__scopeSelect,children:p.jsx(Bp.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(fM,{...e,ref:t})});uM.displayName=vo;var ja=10,[cM,ml]=oc(vo),GU="SelectContentImpl",$U=Uf("SelectContent.RemoveScroll"),fM=j.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:o,sideOffset:f,align:c,alignOffset:d,arrowPadding:v,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:w,avoidCollisions:S,...b}=e,C=pl(vo,n),[T,N]=j.useState(null),[A,R]=j.useState(null),D=Cn(t,ae=>N(ae)),[L,_]=j.useState(null),[M,z]=j.useState(null),P=Pp(n),[G,I]=j.useState(!1),F=j.useRef(!1);j.useEffect(()=>{if(T)return Zj(T)},[T]),Vj();const B=j.useCallback(ae=>{const[we,...fe]=P().map(re=>re.ref.current),[J]=fe.slice(-1),ne=document.activeElement;for(const re of ae)if(re===ne||(re==null||re.scrollIntoView({block:"nearest"}),re===we&&A&&(A.scrollTop=0),re===J&&A&&(A.scrollTop=A.scrollHeight),re==null||re.focus(),document.activeElement!==ne))return},[P,A]),H=j.useCallback(()=>B([L,T]),[B,L,T]);j.useEffect(()=>{G&&H()},[G,H]);const{onOpenChange:Y,triggerPointerDownPosRef:Q}=C;j.useEffect(()=>{if(T){let ae={x:0,y:0};const we=J=>{var ne,re;ae={x:Math.abs(Math.round(J.pageX)-(((ne=Q.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(J.pageY)-(((re=Q.current)==null?void 0:re.y)??0))}},fe=J=>{ae.x<=10&&ae.y<=10?J.preventDefault():T.contains(J.target)||Y(!1),document.removeEventListener("pointermove",we),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",fe,{capture:!0})}}},[T,Y,Q]),j.useEffect(()=>{const ae=()=>Y(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[Y]);const[V,q]=CM(ae=>{const we=P().filter(ne=>!ne.disabled),fe=we.find(ne=>ne.ref.current===document.activeElement),J=TM(we,ae,fe);J&&setTimeout(()=>J.ref.current.focus())}),X=j.useCallback((ae,we,fe)=>{const J=!F.current&&!fe;(C.value!==void 0&&C.value===we||J)&&(_(ae),J&&(F.current=!0))},[C.value]),U=j.useCallback(()=>T==null?void 0:T.focus(),[T]),te=j.useCallback((ae,we,fe)=>{const J=!F.current&&!fe;(C.value!==void 0&&C.value===we||J)&&z(ae)},[C.value]),ie=r==="popper"?mb:dM,oe=ie===mb?{side:o,sideOffset:f,align:c,alignOffset:d,arrowPadding:v,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:w,avoidCollisions:S}:{};return p.jsx(cM,{scope:n,content:T,viewport:A,onViewportChange:R,itemRefCallback:X,selectedItem:L,onItemLeave:U,itemTextRefCallback:te,focusSelectedItem:H,selectedItemText:M,position:r,isPositioned:G,searchRef:V,children:p.jsx(C1,{as:$U,allowPinchZoom:!0,children:p.jsx(S1,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Wt(a,ae=>{var we;(we=C.trigger)==null||we.focus({preventScroll:!0}),ae.preventDefault()}),children:p.jsx(w1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:p.jsx(ie,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...b,...oe,onPlaced:()=>I(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Wt(b.onKeyDown,ae=>{const we=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!we&&ae.key.length===1&&q(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let J=P().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ne=ae.target,re=J.indexOf(ne);J=J.slice(re+1)}setTimeout(()=>B(J)),ae.preventDefault()}})})})})})})});fM.displayName=GU;var KU="SelectItemAlignedPosition",dM=j.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=pl(vo,n),l=ml(vo,n),[o,f]=j.useState(null),[c,d]=j.useState(null),v=Cn(t,D=>d(D)),m=Pp(n),y=j.useRef(!1),x=j.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:b,focusSelectedItem:C}=l,T=j.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&c&&w&&S&&b){const D=i.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),_=i.valueNode.getBoundingClientRect(),M=b.getBoundingClientRect();if(i.dir!=="rtl"){const ne=M.left-L.left,re=_.left-ne,ge=D.left-re,ke=D.width+ge,Be=Math.max(ke,L.width),lt=window.innerWidth-ja,Ze=TT(re,[ja,Math.max(ja,lt-Be)]);o.style.minWidth=ke+"px",o.style.left=Ze+"px"}else{const ne=L.right-M.right,re=window.innerWidth-_.right-ne,ge=window.innerWidth-D.right-re,ke=D.width+ge,Be=Math.max(ke,L.width),lt=window.innerWidth-ja,Ze=TT(re,[ja,Math.max(ja,lt-Be)]);o.style.minWidth=ke+"px",o.style.right=Ze+"px"}const z=m(),P=window.innerHeight-ja*2,G=w.scrollHeight,I=window.getComputedStyle(c),F=parseInt(I.borderTopWidth,10),B=parseInt(I.paddingTop,10),H=parseInt(I.borderBottomWidth,10),Y=parseInt(I.paddingBottom,10),Q=F+B+G+Y+H,V=Math.min(S.offsetHeight*5,Q),q=window.getComputedStyle(w),X=parseInt(q.paddingTop,10),U=parseInt(q.paddingBottom,10),te=D.top+D.height/2-ja,ie=P-te,oe=S.offsetHeight/2,ae=S.offsetTop+oe,we=F+B+ae,fe=Q-we;if(we<=te){const ne=z.length>0&&S===z[z.length-1].ref.current;o.style.bottom="0px";const re=c.clientHeight-w.offsetTop-w.offsetHeight,ge=Math.max(ie,oe+(ne?U:0)+re+H),ke=we+ge;o.style.height=ke+"px"}else{const ne=z.length>0&&S===z[0].ref.current;o.style.top="0px";const ge=Math.max(te,F+w.offsetTop+(ne?X:0)+oe)+fe;o.style.height=ge+"px",w.scrollTop=we-te+w.offsetTop}o.style.margin=`${ja}px 0`,o.style.minHeight=V+"px",o.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,o,c,w,S,b,i.dir,r]);vr(()=>T(),[T]);const[N,A]=j.useState();vr(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const R=j.useCallback(D=>{D&&x.current===!0&&(T(),C==null||C(),x.current=!1)},[T,C]);return p.jsx(XU,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:R,children:p.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:p.jsx(Yt.div,{...a,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});dM.displayName=KU;var YU="SelectPopperPosition",mb=j.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=ja,...i}=e,l=zp(n);return p.jsx(MU,{...l,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mb.displayName=YU;var[XU,$1]=oc(vo,{}),gb="SelectViewport",hM=j.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=ml(gb,n),l=$1(gb,n),o=Cn(t,i.onViewportChange),f=j.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(Bp.Slot,{scope:n,children:p.jsx(Yt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Wt(a.onScroll,c=>{const d=c.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:m}=l;if(m!=null&&m.current&&v){const y=Math.abs(f.current-d.scrollTop);if(y>0){const x=window.innerHeight-ja*2,w=parseFloat(v.style.minHeight),S=parseFloat(v.style.height),b=Math.max(w,S);if(b<x){const C=b+y,T=Math.min(x,C),N=C-T;v.style.height=T+"px",v.style.bottom==="0px"&&(d.scrollTop=N>0?N:0,v.style.justifyContent="flex-end")}}}f.current=d.scrollTop})})})]})});hM.displayName=gb;var vM="SelectGroup",[QU,WU]=oc(vM),ZU=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Nu();return p.jsx(QU,{scope:n,id:a,children:p.jsx(Yt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});ZU.displayName=vM;var pM="SelectLabel",JU=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=WU(pM,n);return p.jsx(Yt.div,{id:a.id,...r,ref:t})});JU.displayName=pM;var Xv="SelectItem",[e8,mM]=oc(Xv),gM=j.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,o=pl(Xv,n),f=ml(Xv,n),c=o.value===r,[d,v]=j.useState(i??""),[m,y]=j.useState(!1),x=Cn(t,C=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,C,r,a)}),w=Nu(),S=j.useRef("touch"),b=()=>{a||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(e8,{scope:n,value:r,disabled:a,textId:w,isSelected:c,onItemTextChange:j.useCallback(C=>{v(T=>T||((C==null?void 0:C.textContent)??"").trim())},[]),children:p.jsx(Bp.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:p.jsx(Yt.div,{role:"option","aria-labelledby":w,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:x,onFocus:Wt(l.onFocus,()=>y(!0)),onBlur:Wt(l.onBlur,()=>y(!1)),onClick:Wt(l.onClick,()=>{S.current!=="mouse"&&b()}),onPointerUp:Wt(l.onPointerUp,()=>{S.current==="mouse"&&b()}),onPointerDown:Wt(l.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Wt(l.onPointerMove,C=>{var T;S.current=C.pointerType,a?(T=f.onItemLeave)==null||T.call(f):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Wt(l.onPointerLeave,C=>{var T;C.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:Wt(l.onKeyDown,C=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&C.key===" "||(zU.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})});gM.displayName=Xv;var Nf="SelectItemText",yM=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=pl(Nf,n),o=ml(Nf,n),f=mM(Nf,n),c=UU(Nf,n),[d,v]=j.useState(null),m=Cn(t,b=>v(b),f.onItemTextChange,b=>{var C;return(C=o.itemTextRefCallback)==null?void 0:C.call(o,b,f.value,f.disabled)}),y=d==null?void 0:d.textContent,x=j.useMemo(()=>p.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=c;return vr(()=>(w(x),()=>S(x)),[w,S,x]),p.jsxs(p.Fragment,{children:[p.jsx(Yt.span,{id:f.textId,...i,ref:m}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?fd.createPortal(i.children,l.valueNode):null]})});yM.displayName=Nf;var xM="SelectItemIndicator",bM=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return mM(xM,n).isSelected?p.jsx(Yt.span,{"aria-hidden":!0,...r,ref:t}):null});bM.displayName=xM;var yb="SelectScrollUpButton",t8=j.forwardRef((e,t)=>{const n=ml(yb,e.__scopeSelect),r=$1(yb,e.__scopeSelect),[a,i]=j.useState(!1),l=Cn(t,r.onScrollButtonChange);return vr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollTop>0;i(c)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?p.jsx(wM,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop-f.offsetHeight)}}):null});t8.displayName=yb;var xb="SelectScrollDownButton",n8=j.forwardRef((e,t)=>{const n=ml(xb,e.__scopeSelect),r=$1(xb,e.__scopeSelect),[a,i]=j.useState(!1),l=Cn(t,r.onScrollButtonChange);return vr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollHeight-f.clientHeight,d=Math.ceil(f.scrollTop)<c;i(d)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?p.jsx(wM,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop+f.offsetHeight)}}):null});n8.displayName=xb;var wM=j.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=ml("SelectScrollButton",n),l=j.useRef(null),o=Pp(n),f=j.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return j.useEffect(()=>()=>f(),[f]),vr(()=>{var d;const c=o().find(v=>v.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),p.jsx(Yt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Wt(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Wt(a.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Wt(a.onPointerLeave,()=>{f()})})}),r8="SelectSeparator",a8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(Yt.div,{"aria-hidden":!0,...r,ref:t})});a8.displayName=r8;var bb="SelectArrow",i8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=zp(n),i=pl(bb,n),l=ml(bb,n);return i.open&&l.position==="popper"?p.jsx(OU,{...a,...r,ref:t}):null});i8.displayName=bb;var s8="SelectBubbleInput",SM=j.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=j.useRef(null),i=Cn(r,a),l=LU(t);return j.useEffect(()=>{const o=a.current;if(!o)return;const f=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&d){const v=new Event("change",{bubbles:!0});d.call(o,t),o.dispatchEvent(v)}},[l,t]),p.jsx(Yt.select,{...n,style:{...tM,...n.style},ref:i,defaultValue:t})});SM.displayName=s8;function EM(e){return e===""||e===void 0}function CM(e){const t=uo(e),n=j.useRef(""),r=j.useRef(0),a=j.useCallback(l=>{const o=n.current+l;t(o),(function f(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(o)},[t]),i=j.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function TM(e,t,n){const a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=l8(e,Math.max(i,0));a.length===1&&(l=l.filter(c=>c!==n));const f=l.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function l8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var o8=nM,kM=aM,u8=sM,c8=lM,f8=oM,NM=uM,d8=hM,AM=gM,h8=yM,v8=bM;const io=o8,so=u8,tl=j.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(kM,{ref:r,className:Ae("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,p.jsx(c8,{asChild:!0,children:p.jsx(_a,{className:"h-4 w-4 opacity-50"})})]}));tl.displayName=kM.displayName;const nl=j.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>p.jsx(f8,{children:p.jsx(NM,{ref:a,className:Ae("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border-0 bg-surface-container-highest text-card-foreground shadow-ambient",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:p.jsx(d8,{className:Ae("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));nl.displayName=NM.displayName;const rl=j.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(AM,{ref:r,className:Ae("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-surface-bright focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(v8,{children:p.jsx(gp,{className:"h-4 w-4"})})}),p.jsx(h8,{children:t})]}));rl.displayName=AM.displayName;function K1({searchPlaceholder:e="Search...",searchValue:t,onSearchChange:n,filters:r=[],filterValues:a={},onFilterChange:i}){return p.jsxs(st,{level:"bright",className:"flex items-center gap-3 px-4 py-2 rounded-md",children:[p.jsx(nc,{className:"h-3.5 w-3.5 text-on-surface-variant shrink-0"}),p.jsx(fn,{placeholder:e,value:t,onChange:l=>n(l.target.value),className:"bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1","aria-label":e}),r.map(l=>p.jsx("div",{className:"w-40 shrink-0",children:p.jsxs(io,{value:a[l.key]??"all",onValueChange:o=>i==null?void 0:i(l.key,o),children:[p.jsx(tl,{children:p.jsx(so,{placeholder:l.label})}),p.jsx(nl,{children:l.options.map(o=>p.jsx(rl,{value:o.value,children:o.label},o.value))})]})},l.key))]})}function Ip({total:e,offset:t,limit:n,onPageChange:r}){if(Math.ceil(e/n)<=1)return null;const i=t>0,l=t+n<e,o=t+1,f=Math.min(t+n,e);return p.jsxs("div",{className:"flex items-center justify-center gap-3 pt-1",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",disabled:!i,onClick:()=>r(Math.max(0,t-n)),className:"gap-1 text-on-surface-variant",children:[p.jsx(h1,{className:"h-4 w-4"}),"Prev"]}),p.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:[o,"–",f," of ",e]}),p.jsxs(Ke,{variant:"ghost",size:"sm",disabled:!l,onClick:()=>r(t+n),className:"gap-1 text-on-surface-variant",children:["Next",p.jsx(Ea,{className:"h-4 w-4"})]})]})}const p8=ra.STATS,m8=ra.STATS,g8=ra.STATS,y8=3e4,x8=6e4,b8=1e4,w8=6e4;function S8(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.agent&&t.set("agent",e.agent),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/sessions?${n}`:"/sessions";return Fa({queryKey:["sessions",e],queryFn:({signal:a})=>bt(r,{signal:a}),pollCategory:"standard",refetchInterval:p8})}function E8(e){return Fa({queryKey:["session",e],queryFn:({signal:t})=>bt(`/sessions/${e}`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:m8})}function C8(e){return Fa({queryKey:["session-batches",e],queryFn:({signal:t})=>bt(`/sessions/${e}/batches`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:g8})}function T8(e){return Tn({queryKey:["batch-activities",e],queryFn:({signal:t})=>bt(`/batches/${e}/activities`,{signal:t}),enabled:e!==void 0,staleTime:y8})}function k8(e){return Tn({queryKey:["session-attachments",e],queryFn:({signal:t})=>bt(`/sessions/${e}/attachments`,{signal:t}),enabled:e!==void 0,staleTime:x8})}function RM(){const e=Ca();return vl({mutationFn:t=>Aj(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function jM(e){return Tn({queryKey:["session-impact",e],queryFn:({signal:t})=>bt(`/sessions/${e}/impact`,{signal:t}),enabled:e!==null,staleTime:b8})}function DM(e){return Tn({queryKey:["session-plans",e],queryFn:({signal:t})=>bt(`/sessions/${e}/plans`,{signal:t}),enabled:!!e,staleTime:w8})}const N8=300;function A8(e,t=N8){const[n,r]=j.useState(e);return j.useEffect(()=>{const a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}const Tr="all";function Y1({initialFilters:e}){const[t,n]=j.useState(""),r=A8(t),[a,i]=j.useState(e),[l,o]=j.useState(0),f=j.useCallback((v,m)=>{i(y=>({...y,[v]:m})),o(0)},[]),c=j.useCallback(v=>{n(v),o(0)},[]),d=j.useCallback(v=>{const m=a[v];return m&&m!==Tr?m:void 0},[a]);return{searchInput:t,debouncedSearch:r.length>0?r:void 0,filterValues:a,offset:l,setOffset:o,handleSearchChange:c,handleFilterChange:f,activeFilter:d}}function MM(e){return e==="active"?"active":e==="completed"?"completed":"error"}const R8={active:"bg-primary",completed:"bg-secondary",error:"bg-tertiary"},j8={active:"bg-primary/15 text-primary",completed:"bg-surface-container-high text-on-surface-variant",error:"bg-tertiary/15 text-tertiary"};function D8({status:e}){const t=MM(e);return p.jsx("span",{className:Ae("inline-block h-2 w-2 rounded-full shrink-0",R8[t])})}function OM({status:e}){const t=MM(e),n=e.charAt(0).toUpperCase()+e.slice(1);return p.jsxs("span",{className:Ae("inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-sans text-xs font-medium",j8[t]),children:[p.jsx(D8,{status:e}),n]})}const M8=5,wb=8,O8=12,L8=[{key:"status",label:"Status",options:[{value:Tr,label:"All statuses"},{value:"active",label:"Active"},{value:"completed",label:"Completed"}]},{key:"agent",label:"Agent",options:[{value:Tr,label:"All agents"},{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"}]}];function _8({session:e,onClick:t,onDelete:n}){const r=e.title||e.id.slice(0,wb);return p.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Session: ${r}`,children:[p.jsx("td",{className:"px-4 py-3",children:p.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.id.slice(0,O8)})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate block max-w-xs",children:r})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx(Ln,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:e.agent||"unknown"})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx(OM,{status:e.status})}),p.jsx("td",{className:"px-4 py-3 text-center",children:p.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.prompt_count})}),p.jsx("td",{className:"px-4 py-3",children:p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.date}),p.jsx("button",{onClick:a=>{a.stopPropagation(),n()},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.stopPropagation()},className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 p-1 rounded hover:bg-tertiary/10 hover:text-tertiary transition-all shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tertiary/40","aria-label":`Delete session ${r}`,title:"Delete session",children:p.jsx(qf,{className:"h-3.5 w-3.5"})})]})})]})}function B8(){return p.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[p.jsx("td",{className:"px-4 py-3",children:p.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high animate-pulse mx-auto"})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function uu({children:e,className:t}){return p.jsx("th",{className:Ae("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function P8(){const e=Wi(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Y1({initialFilters:{status:Tr,agent:Tr}}),[c,d]=j.useState(null),v=RM(),{data:m}=jM((c==null?void 0:c.id)??null),y=f("status"),x=f("agent"),{data:w,isLoading:S,isError:b,error:C}=S8({limit:ni,offset:a,status:y,agent:x,search:n});function T(){c&&v.mutate(c.id,{onSuccess:()=>d(null)})}const N=(w==null?void 0:w.sessions)??[],A=(w==null?void 0:w.total)??0,R=p.jsx(K1,{searchPlaceholder:"Search sessions...",searchValue:t,onSearchChange:l,filters:L8,filterValues:r,onFilterChange:o}),D=p.jsx("thead",{children:p.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[p.jsx(uu,{children:"Session ID"}),p.jsx(uu,{children:"Title"}),p.jsx(uu,{children:"Agent"}),p.jsx(uu,{children:"Status"}),p.jsx(uu,{className:"text-center",children:"Turns"}),p.jsx(uu,{children:"Date"})]})});return b?p.jsxs("div",{children:[p.jsx(Gi,{title:"Session Archive"}),R,p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Failed to load sessions"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:C instanceof Error?C.message:"Unknown error"})]})]}):p.jsxs("div",{children:[p.jsx(Gi,{title:"Session Archive",subtitle:S?"Loading...":`${A} session${A!==1?"s":""} captured`}),R,S?p.jsx(st,{level:"low",className:"rounded-md overflow-hidden mt-4",children:p.jsxs("table",{className:"w-full",children:[D,p.jsx("tbody",{children:Array.from({length:M8}).map((L,_)=>p.jsx(B8,{},_))})]})}):N.length===0?p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant mt-4",children:[p.jsx(xp,{className:"h-8 w-8 opacity-30"}),p.jsx("span",{className:"font-sans text-sm",children:A===0&&!n&&!y&&!x?"No sessions yet":"No matching sessions"}),A===0&&!n&&!y&&!x&&p.jsx("span",{className:"font-sans text-xs",children:"Sessions appear here as you work with your agent"})]}):p.jsx(st,{level:"low",className:"rounded-md overflow-hidden mt-4",children:p.jsxs("table",{className:"w-full","aria-label":"Session archive",children:[D,p.jsx("tbody",{children:N.map(L=>p.jsx(_8,{session:L,onClick:()=>e(`/sessions/${L.id}`),onDelete:()=>d(L)},L.id))})]})}),p.jsx(Ip,{total:A,offset:a,limit:ni,onPageChange:i}),p.jsx(MD,{open:c!==null,onOpenChange:L=>{L||d(null)},title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:p.jsx(qf,{className:"h-4 w-4 text-tertiary"}),meta:c?[{label:"ID",value:c.id.slice(0,wb)},{label:"Title",value:c.title||c.id.slice(0,wb)}]:[],impact:m?[{label:"Prompts",value:m.promptCount},{label:"Spores",value:m.sporeCount},{label:"Attachments",value:m.attachmentCount},{label:"Graph Edges",value:m.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:T,isPending:v.isPending})]})}function Zt({children:e,className:t}){return p.jsx("div",{className:Ae("font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}const z8=3e5;function I8(){return Tn({queryKey:["symbionts"],queryFn:({signal:e})=>bt("/symbionts",{signal:e}),staleTime:z8})}function F8(e,t,n){const r=e.find(a=>a.name===t);return r?`${r.binary} --resume ${n}`:null}function q8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const U8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,V8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H8={};function PT(e,t){return(H8.jsx?V8:U8).test(e)}const G8=/[ \t\n\f\r]/g;function $8(e){return typeof e=="object"?e.type==="text"?zT(e.value):!1:zT(e)}function zT(e){return e.replace(G8,"")===""}class md{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}md.prototype.normal={};md.prototype.property={};md.prototype.space=void 0;function LM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new md(n,r,t)}function Sb(e){return e.toLowerCase()}class Ur{constructor(t,n){this.attribute=n,this.property=t}}Ur.prototype.attribute="";Ur.prototype.booleanish=!1;Ur.prototype.boolean=!1;Ur.prototype.commaOrSpaceSeparated=!1;Ur.prototype.commaSeparated=!1;Ur.prototype.defined=!1;Ur.prototype.mustUseProperty=!1;Ur.prototype.number=!1;Ur.prototype.overloadedBoolean=!1;Ur.prototype.property="";Ur.prototype.spaceSeparated=!1;Ur.prototype.space=void 0;let K8=0;const gt=So(),Dn=So(),Eb=So(),Ne=So(),Qt=So(),ju=So(),Wr=So();function So(){return 2**++K8}const Cb=Object.freeze(Object.defineProperty({__proto__:null,boolean:gt,booleanish:Dn,commaOrSpaceSeparated:Wr,commaSeparated:ju,number:Ne,overloadedBoolean:Eb,spaceSeparated:Qt},Symbol.toStringTag,{value:"Module"})),Fy=Object.keys(Cb);class X1 extends Ur{constructor(t,n,r,a){let i=-1;if(super(t,n),IT(this,"space",a),typeof r=="number")for(;++i<Fy.length;){const l=Fy[i];IT(this,Fy[i],(r&Cb[l])===Cb[l])}}}X1.prototype.defined=!0;function IT(e,t,n){n&&(e[t]=n)}function uc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new X1(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Sb(r)]=r,n[Sb(i.attribute)]=r}return new md(t,n,e.space)}const _M=uc({properties:{ariaActiveDescendant:null,ariaAtomic:Dn,ariaAutoComplete:null,ariaBusy:Dn,ariaChecked:Dn,ariaColCount:Ne,ariaColIndex:Ne,ariaColSpan:Ne,ariaControls:Qt,ariaCurrent:null,ariaDescribedBy:Qt,ariaDetails:null,ariaDisabled:Dn,ariaDropEffect:Qt,ariaErrorMessage:null,ariaExpanded:Dn,ariaFlowTo:Qt,ariaGrabbed:Dn,ariaHasPopup:null,ariaHidden:Dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qt,ariaLevel:Ne,ariaLive:null,ariaModal:Dn,ariaMultiLine:Dn,ariaMultiSelectable:Dn,ariaOrientation:null,ariaOwns:Qt,ariaPlaceholder:null,ariaPosInSet:Ne,ariaPressed:Dn,ariaReadOnly:Dn,ariaRelevant:null,ariaRequired:Dn,ariaRoleDescription:Qt,ariaRowCount:Ne,ariaRowIndex:Ne,ariaRowSpan:Ne,ariaSelected:Dn,ariaSetSize:Ne,ariaSort:null,ariaValueMax:Ne,ariaValueMin:Ne,ariaValueNow:Ne,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function BM(e,t){return t in e?e[t]:t}function PM(e,t){return BM(e,t.toLowerCase())}const Y8=uc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ju,acceptCharset:Qt,accessKey:Qt,action:null,allow:null,allowFullScreen:gt,allowPaymentRequest:gt,allowUserMedia:gt,alt:null,as:null,async:gt,autoCapitalize:null,autoComplete:Qt,autoFocus:gt,autoPlay:gt,blocking:Qt,capture:null,charSet:null,checked:gt,cite:null,className:Qt,cols:Ne,colSpan:null,content:null,contentEditable:Dn,controls:gt,controlsList:Qt,coords:Ne|ju,crossOrigin:null,data:null,dateTime:null,decoding:null,default:gt,defer:gt,dir:null,dirName:null,disabled:gt,download:Eb,draggable:Dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:gt,formTarget:null,headers:Qt,height:Ne,hidden:Eb,high:Ne,href:null,hrefLang:null,htmlFor:Qt,httpEquiv:Qt,id:null,imageSizes:null,imageSrcSet:null,inert:gt,inputMode:null,integrity:null,is:null,isMap:gt,itemId:null,itemProp:Qt,itemRef:Qt,itemScope:gt,itemType:Qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:gt,low:Ne,manifest:null,max:null,maxLength:Ne,media:null,method:null,min:null,minLength:Ne,multiple:gt,muted:gt,name:null,nonce:null,noModule:gt,noValidate:gt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:gt,optimum:Ne,pattern:null,ping:Qt,placeholder:null,playsInline:gt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:gt,referrerPolicy:null,rel:Qt,required:gt,reversed:gt,rows:Ne,rowSpan:Ne,sandbox:Qt,scope:null,scoped:gt,seamless:gt,selected:gt,shadowRootClonable:gt,shadowRootDelegatesFocus:gt,shadowRootMode:null,shape:null,size:Ne,sizes:null,slot:null,span:Ne,spellCheck:Dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ne,step:null,style:null,tabIndex:Ne,target:null,title:null,translate:null,type:null,typeMustMatch:gt,useMap:null,value:Dn,width:Ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qt,axis:null,background:null,bgColor:null,border:Ne,borderColor:null,bottomMargin:Ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:gt,declare:gt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ne,leftMargin:Ne,link:null,longDesc:null,lowSrc:null,marginHeight:Ne,marginWidth:Ne,noResize:gt,noHref:gt,noShade:gt,noWrap:gt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ne,rules:null,scheme:null,scrolling:Dn,standby:null,summary:null,text:null,topMargin:Ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ne,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:gt,disableRemotePlayback:gt,prefix:null,property:null,results:Ne,security:null,unselectable:null},space:"html",transform:PM}),X8=uc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Wr,accentHeight:Ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ne,amplitude:Ne,arabicForm:null,ascent:Ne,attributeName:null,attributeType:null,azimuth:Ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ne,by:null,calcMode:null,capHeight:Ne,className:Qt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ne,diffuseConstant:Ne,direction:null,display:null,dur:null,divisor:Ne,dominantBaseline:null,download:gt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ne,enableBackground:null,end:null,event:null,exponent:Ne,externalResourcesRequired:null,fill:null,fillOpacity:Ne,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ju,g2:ju,glyphName:ju,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ne,horizOriginX:Ne,horizOriginY:Ne,id:null,ideographic:Ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ne,k:Ne,k1:Ne,k2:Ne,k3:Ne,k4:Ne,kernelMatrix:Wr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ne,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ne,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ne,overlineThickness:Ne,paintOrder:null,panose1:null,path:null,pathLength:Ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ne,pointsAtY:Ne,pointsAtZ:Ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wr,rev:Wr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wr,requiredFeatures:Wr,requiredFonts:Wr,requiredFormats:Wr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ne,specularExponent:Ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ne,strikethroughThickness:Ne,string:null,stroke:null,strokeDashArray:Wr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ne,strokeOpacity:Ne,strokeWidth:null,style:null,surfaceScale:Ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wr,tabIndex:Ne,tableValues:null,target:null,targetX:Ne,targetY:Ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ne,underlineThickness:Ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ne,values:null,vAlphabetic:Ne,vMathematical:Ne,vectorEffect:null,vHanging:Ne,vIdeographic:Ne,version:null,vertAdvY:Ne,vertOriginX:Ne,vertOriginY:Ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:BM}),zM=uc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),IM=uc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:PM}),FM=uc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Q8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},W8=/[A-Z]/g,FT=/-[a-z]/g,Z8=/^data[-\w.:]+$/i;function J8(e,t){const n=Sb(t);let r=t,a=Ur;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Z8.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(FT,tV);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!FT.test(i)){let l=i.replace(W8,eV);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=X1}return new a(r,t)}function eV(e){return"-"+e.toLowerCase()}function tV(e){return e.charAt(1).toUpperCase()}const nV=LM([_M,Y8,zM,IM,FM],"html"),Q1=LM([_M,X8,zM,IM,FM],"svg");function rV(e){return e.join(" ").trim()}var cu={},qy,qT;function aV(){if(qT)return qy;qT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,f=`
|
|
430
|
+
`,c="/",d="*",v="",m="comment",y="declaration";function x(S,b){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];b=b||{};var C=1,T=1;function N(I){var F=I.match(t);F&&(C+=F.length);var B=I.lastIndexOf(f);T=~B?I.length-B:T+I.length}function A(){var I={line:C,column:T};return function(F){return F.position=new R(I),_(),F}}function R(I){this.start=I,this.end={line:C,column:T},this.source=b.source}R.prototype.content=S;function D(I){var F=new Error(b.source+":"+C+":"+T+": "+I);if(F.reason=I,F.filename=b.source,F.line=C,F.column=T,F.source=S,!b.silent)throw F}function L(I){var F=I.exec(S);if(F){var B=F[0];return N(B),S=S.slice(B.length),F}}function _(){L(n)}function M(I){var F;for(I=I||[];F=z();)F!==!1&&I.push(F);return I}function z(){var I=A();if(!(c!=S.charAt(0)||d!=S.charAt(1))){for(var F=2;v!=S.charAt(F)&&(d!=S.charAt(F)||c!=S.charAt(F+1));)++F;if(F+=2,v===S.charAt(F-1))return D("End of comment missing");var B=S.slice(2,F-2);return T+=2,N(B),S=S.slice(F),T+=2,I({type:m,comment:B})}}function P(){var I=A(),F=L(r);if(F){if(z(),!L(a))return D("property missing ':'");var B=L(i),H=I({type:y,property:w(F[0].replace(e,v)),value:B?w(B[0].replace(e,v)):v});return L(l),H}}function G(){var I=[];M(I);for(var F;F=P();)F!==!1&&(I.push(F),M(I));return I}return _(),G()}function w(S){return S?S.replace(o,v):v}return qy=x,qy}var UT;function iV(){if(UT)return cu;UT=1;var e=cu&&cu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cu,"__esModule",{value:!0}),cu.default=n;const t=e(aV());function n(r,a){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),o=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:c,value:d}=f;o?a(c,d,f):d&&(i=i||{},i[c]=d)}),i}return cu}var hf={},VT;function sV(){if(VT)return hf;VT=1,Object.defineProperty(hf,"__esModule",{value:!0}),hf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},l=function(c,d){return d.toUpperCase()},o=function(c,d){return"".concat(d,"-")},f=function(c,d){return d===void 0&&(d={}),i(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(a,o):c=c.replace(r,o),c.replace(t,l))};return hf.camelCase=f,hf}var vf,HT;function lV(){if(HT)return vf;HT=1;var e=vf&&vf.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(iV()),n=sV();function r(a,i){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(o,f){o&&f&&(l[(0,n.camelCase)(o,i)]=f)}),l}return r.default=r,vf=r,vf}var oV=lV();const uV=ld(oV),qM=UM("end"),W1=UM("start");function UM(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function cV(e){const t=W1(e),n=qM(e);if(t&&n)return{start:t,end:n}}function Mf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?GT(e.position):"start"in e||"end"in e?GT(e):"line"in e||"column"in e?Tb(e):""}function Tb(e){return $T(e&&e.line)+":"+$T(e&&e.column)}function GT(e){return Tb(e&&e.start)+"-"+Tb(e&&e.end)}function $T(e){return e&&typeof e=="number"?e:1}class gr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(l=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?i.ruleId=r:(i.source=r.slice(0,f),i.ruleId=r.slice(f+1))}if(!i.place&&i.ancestors&&i.ancestors){const f=i.ancestors[i.ancestors.length-1];f&&(i.place=f.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Mf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}gr.prototype.file="";gr.prototype.name="";gr.prototype.reason="";gr.prototype.message="";gr.prototype.stack="";gr.prototype.column=void 0;gr.prototype.line=void 0;gr.prototype.ancestors=void 0;gr.prototype.cause=void 0;gr.prototype.fatal=void 0;gr.prototype.place=void 0;gr.prototype.ruleId=void 0;gr.prototype.source=void 0;const Z1={}.hasOwnProperty,fV=new Map,dV=/[A-Z]/g,hV=new Set(["table","tbody","thead","tfoot","tr"]),vV=new Set(["td","th"]),VM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pV(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=EV(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=SV(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Q1:nV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=HM(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function HM(e,t,n){if(t.type==="element")return mV(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return gV(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return xV(e,t,n);if(t.type==="mdxjsEsm")return yV(e,t);if(t.type==="root")return bV(e,t,n);if(t.type==="text")return wV(e,t)}function mV(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Q1,e.schema=a),e.ancestors.push(t);const i=$M(e,t.tagName,!1),l=CV(e,t);let o=ew(e,t);return hV.has(t.tagName)&&(o=o.filter(function(f){return typeof f=="string"?!$8(f):!0})),GM(e,l,i,t),J1(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function gV(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Hf(e,t.position)}function yV(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Hf(e,t.position)}function xV(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=Q1,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:$M(e,t.name,!0),l=TV(e,t),o=ew(e,t);return GM(e,l,i,t),J1(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function bV(e,t,n){const r={};return J1(r,ew(e,t)),e.create(t,e.Fragment,r,n)}function wV(e,t){return t.value}function GM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function J1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function SV(e,t,n){return r;function r(a,i,l,o){const c=Array.isArray(l.children)?n:t;return o?c(i,l,o):c(i,l)}}function EV(e,t){return n;function n(r,a,i,l){const o=Array.isArray(i.children),f=W1(r);return t(a,i,l,o,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function CV(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Z1.call(t.properties,a)){const i=kV(e,a,t.properties[a]);if(i){const[l,o]=i;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&vV.has(t.tagName)?r=o:n[l]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function TV(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Hf(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else Hf(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function ew(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:fV;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const f=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(f){const c=a.get(f)||0;l=f+"-"+c,a.set(f,c+1)}}const o=HM(e,i,l);o!==void 0&&n.push(o)}return n}function kV(e,t,n){const r=J8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?q8(n):rV(n)),r.property==="style"){let a=typeof n=="object"?n:NV(e,String(n));return e.stylePropertyNameCase==="css"&&(a=AV(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?Q8[r.property]||r.property:r.attribute,n]}}function NV(e,t){try{return uV(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new gr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=VM+"#cannot-parse-style-attribute",a}}function $M(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,l;for(;++i<a.length;){const o=PT(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=l}else r=PT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Z1.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Hf(e)}function Hf(e,t){const n=new gr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=VM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function AV(e){const t={};let n;for(n in e)Z1.call(e,n)&&(t[RV(n)]=e[n]);return t}function RV(e){let t=e.replace(dV,jV);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jV(e){return"-"+e.toLowerCase()}const Uy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},DV={};function tw(e,t){const n=DV,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return KM(e,r,a)}function KM(e,t,n){if(MV(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return KT(e.children,t,n)}return Array.isArray(e)?KT(e,t,n):""}function KT(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=KM(e[a],t,n);return r.join("")}function MV(e){return!!(e&&typeof e=="object")}const YT=document.createElement("i");function nw(e){const t="&"+e+";";YT.innerHTML=t;const n=YT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ta(e,t,n,r){const a=e.length;let i=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function ba(e,t){return e.length>0?(ta(e,e.length,0,t),e):t}const XT={}.hasOwnProperty;function YM(e){const t={};let n=-1;for(;++n<e.length;)OV(t,e[n]);return t}function OV(e,t){let n;for(n in t){const a=(XT.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){XT.call(a,l)||(a[l]=[]);const o=i[l];LV(a[l],Array.isArray(o)?o:o?[o]:[])}}}function LV(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ta(e,0,0,r)}function XM(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Oa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Er=gl(/[A-Za-z]/),hr=gl(/[\dA-Za-z]/),_V=gl(/[#-'*+\--9=?A-Z^-~]/);function Qv(e){return e!==null&&(e<32||e===127)}const kb=gl(/\d/),BV=gl(/[\dA-Fa-f]/),PV=gl(/[!-/:-@[-`{-~]/);function nt(e){return e!==null&&e<-2}function Kt(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const Fp=gl(new RegExp("\\p{P}|\\p{S}","u")),po=gl(/\s/);function gl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function cc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&hr(e.charCodeAt(n+1))&&hr(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(l=String.fromCharCode(i,o),a=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function At(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return Et(f)?(e.enter(n),o(f)):t(f)}function o(f){return Et(f)&&i++<a?(e.consume(f),o):(e.exit(n),t(f))}}const zV={tokenize:IV};function IV(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),At(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return nt(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),l)}}const FV={tokenize:qV},QT={tokenize:UV};function qV(e){const t=this,n=[];let r=0,a,i,l;return o;function o(T){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,f,c)(T)}return c(T)}function f(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const N=t.events.length;let A=N,R;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){R=t.events[A][1].end;break}b(r);let D=N;for(;D<t.events.length;)t.events[D][1].end={...R},D++;return ta(t.events,A+1,0,t.events.slice(N)),t.events.length=D,c(T)}return o(T)}function c(T){if(r===n.length){if(!a)return m(T);if(a.currentConstruct&&a.currentConstruct.concrete)return x(T);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(QT,d,v)(T)}function d(T){return a&&C(),b(r),m(T)}function v(T){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(T)}function m(T){return t.containerState={},e.attempt(QT,y,x)(T)}function y(T){return r++,n.push([t.currentConstruct,t.containerState]),m(T)}function x(T){if(T===null){a&&C(),b(0),e.consume(T);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),w(T)}function w(T){if(T===null){S(e.exit("chunkFlow"),!0),b(0),e.consume(T);return}return nt(T)?(e.consume(T),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(T),w)}function S(T,N){const A=t.sliceStream(T);if(N&&A.push(null),T.previous=i,i&&(i.next=T),i=T,a.defineSkip(T.start),a.write(A),t.parser.lazy[T.start.line]){let R=a.events.length;for(;R--;)if(a.events[R][1].start.offset<l&&(!a.events[R][1].end||a.events[R][1].end.offset>l))return;const D=t.events.length;let L=D,_,M;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(_){M=t.events[L][1].end;break}_=!0}for(b(r),R=D;R<t.events.length;)t.events[R][1].end={...M},R++;ta(t.events,L+1,0,t.events.slice(D)),t.events.length=R}}function b(T){let N=n.length;for(;N-- >T;){const A=n[N];t.containerState=A[1],A[0].exit.call(t,e)}n.length=T}function C(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function UV(e,t,n){return At(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xu(e){if(e===null||Kt(e)||po(e))return 1;if(Fp(e))return 2}function qp(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Nb={name:"attention",resolveAll:VV,tokenize:HV};function VV(e,t){let n=-1,r,a,i,l,o,f,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const v={...e[r][1].end},m={...e[n][1].start};WT(v,-f),WT(m,f),l={type:f>1?"strongSequence":"emphasisSequence",start:v,end:{...e[r][1].end}},o={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},i={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ba(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ba(c,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",i,t]]),c=ba(c,qp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ba(c,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=ba(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ta(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function HV(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Xu(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),o(f)}function o(f){if(f===i)return e.consume(f),o;const c=e.exit("attentionSequence"),d=Xu(f),v=!d||d===2&&a||n.includes(f),m=!a||a===2&&d||n.includes(r);return c._open=!!(i===42?v:v&&(a||!m)),c._close=!!(i===42?m:m&&(d||!v)),t(f)}}function WT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const GV={name:"autolink",tokenize:$V};function $V(e,t,n){let r=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(y){return Er(y)?(e.consume(y),l):y===64?n(y):c(y)}function l(y){return y===43||y===45||y===46||hr(y)?(r=1,o(y)):c(y)}function o(y){return y===58?(e.consume(y),r=0,f):(y===43||y===45||y===46||hr(y))&&r++<32?(e.consume(y),o):(r=0,c(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Qv(y)?n(y):(e.consume(y),f)}function c(y){return y===64?(e.consume(y),d):_V(y)?(e.consume(y),c):n(y)}function d(y){return hr(y)?v(y):n(y)}function v(y){return y===46?(e.consume(y),r=0,d):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):m(y)}function m(y){if((y===45||hr(y))&&r++<63){const x=y===45?m:v;return e.consume(y),x}return n(y)}}const gd={partial:!0,tokenize:KV};function KV(e,t,n){return r;function r(i){return Et(i)?At(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||nt(i)?t(i):n(i)}}const QM={continuation:{tokenize:XV},exit:QV,name:"blockQuote",tokenize:YV};function YV(e,t,n){const r=this;return a;function a(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return Et(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function XV(e,t,n){const r=this;return a;function a(l){return Et(l)?At(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(QM,t,n)(l)}}function QV(e){e.exit("blockQuote")}const WM={name:"characterEscape",tokenize:WV};function WV(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return PV(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const ZM={name:"characterReference",tokenize:ZV};function ZV(e,t,n){const r=this;let a=0,i,l;return o;function o(v){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),f}function f(v){return v===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(v),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,l=hr,d(v))}function c(v){return v===88||v===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(v),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=BV,d):(e.enter("characterReferenceValue"),i=7,l=kb,d(v))}function d(v){if(v===59&&a){const m=e.exit("characterReferenceValue");return l===hr&&!nw(r.sliceSerialize(m))?n(v):(e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(v)&&a++<i?(e.consume(v),d):n(v)}}const ZT={partial:!0,tokenize:e9},JT={concrete:!0,name:"codeFenced",tokenize:JV};function JV(e,t,n){const r=this,a={partial:!0,tokenize:A};let i=0,l=0,o;return f;function f(R){return c(R)}function c(R){const D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(R)}function d(R){return R===o?(l++,e.consume(R),d):l<3?n(R):(e.exit("codeFencedFenceSequence"),Et(R)?At(e,v,"whitespace")(R):v(R))}function v(R){return R===null||nt(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(ZT,w,N)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(R))}function m(R){return R===null||nt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),v(R)):Et(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,y,"whitespace")(R)):R===96&&R===o?n(R):(e.consume(R),m)}function y(R){return R===null||nt(R)?v(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(R))}function x(R){return R===null||nt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),v(R)):R===96&&R===o?n(R):(e.consume(R),x)}function w(R){return e.attempt(a,N,S)(R)}function S(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),b}function b(R){return i>0&&Et(R)?At(e,C,"linePrefix",i+1)(R):C(R)}function C(R){return R===null||nt(R)?e.check(ZT,w,N)(R):(e.enter("codeFlowValue"),T(R))}function T(R){return R===null||nt(R)?(e.exit("codeFlowValue"),C(R)):(e.consume(R),T)}function N(R){return e.exit("codeFenced"),t(R)}function A(R,D,L){let _=0;return M;function M(F){return R.enter("lineEnding"),R.consume(F),R.exit("lineEnding"),z}function z(F){return R.enter("codeFencedFence"),Et(F)?At(R,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):P(F)}function P(F){return F===o?(R.enter("codeFencedFenceSequence"),G(F)):L(F)}function G(F){return F===o?(_++,R.consume(F),G):_>=l?(R.exit("codeFencedFenceSequence"),Et(F)?At(R,I,"whitespace")(F):I(F)):L(F)}function I(F){return F===null||nt(F)?(R.exit("codeFencedFence"),D(F)):L(F)}}}function e9(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Vy={name:"codeIndented",tokenize:n9},t9={partial:!0,tokenize:r9};function n9(e,t,n){const r=this;return a;function a(c){return e.enter("codeIndented"),At(e,i,"linePrefix",5)(c)}function i(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?f(c):nt(c)?e.attempt(t9,l,f)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||nt(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function f(c){return e.exit("codeIndented"),t(c)}}function r9(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):nt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):At(e,i,"linePrefix",5)(l)}function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):nt(l)?a(l):n(l)}}const a9={name:"codeText",previous:s9,resolve:i9,tokenize:l9};function i9(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function s9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function l9(e,t,n){let r=0,a,i;return l;function l(v){return e.enter("codeText"),e.enter("codeTextSequence"),o(v)}function o(v){return v===96?(e.consume(v),r++,o):(e.exit("codeTextSequence"),f(v))}function f(v){return v===null?n(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),f):v===96?(i=e.enter("codeTextSequence"),a=0,d(v)):nt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),f):(e.enter("codeTextData"),c(v))}function c(v){return v===null||v===32||v===96||nt(v)?(e.exit("codeTextData"),f(v)):(e.consume(v),c)}function d(v){return v===96?(e.consume(v),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(i.type="codeTextData",c(v))}}class o9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&pf(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),pf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),pf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);pf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);pf(this.left,n.reverse())}}}function pf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function JM(e){const t={};let n=-1,r,a,i,l,o,f,c;const d=new o9(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,u9(d,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(l=d.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},o=d.slice(a,n),o.unshift(r),d.splice(a,n-a+1,o))}}return ta(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function u9(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,f=[],c={};let d,v,m=-1,y=n,x=0,w=0;const S=[w];for(;y;){for(;e.get(++a)[1]!==y;);i.push(a),y._tokenizer||(d=r.sliceStream(y),y.next||d.push(null),v&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(d),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),v=y,y=y.next}for(y=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(w=m+1,S.push(w),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),m=S.length;m--;){const b=o.slice(S[m],S[m+1]),C=i.pop();f.push([C,C+b.length-1]),e.splice(C,2,b)}for(f.reverse(),m=-1;++m<f.length;)c[x+f[m][0]]=x+f[m][1],x+=f[m][1]-f[m][0]-1;return c}const c9={resolve:d9,tokenize:h9},f9={partial:!0,tokenize:v9};function d9(e){return JM(e),e}function h9(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):nt(o)?e.check(f9,l,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function v9(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),At(e,i,"linePrefix")}function i(l){if(l===null||nt(l))return n(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function eO(e,t,n,r,a,i,l,o,f){const c=f||Number.POSITIVE_INFINITY;let d=0;return v;function v(b){return b===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(b),e.exit(i),m):b===null||b===32||b===41||Qv(b)?n(b):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(b))}function m(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===62?(e.exit("chunkString"),e.exit(o),m(b)):b===null||b===60||nt(b)?n(b):(e.consume(b),b===92?x:y)}function x(b){return b===60||b===62||b===92?(e.consume(b),y):y(b)}function w(b){return!d&&(b===null||b===41||Kt(b))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(b)):d<c&&b===40?(e.consume(b),d++,w):b===41?(e.consume(b),d--,w):b===null||b===32||b===40||Qv(b)?n(b):(e.consume(b),b===92?S:w)}function S(b){return b===40||b===41||b===92?(e.consume(b),w):w(b)}}function tO(e,t,n,r,a,i){const l=this;let o=0,f;return c;function c(y){return e.enter(r),e.enter(a),e.consume(y),e.exit(a),e.enter(i),d}function d(y){return o>999||y===null||y===91||y===93&&!f||y===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(i),e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):nt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),v(y))}function v(y){return y===null||y===91||y===93||nt(y)||o++>999?(e.exit("chunkString"),d(y)):(e.consume(y),f||(f=!Et(y)),y===92?m:v)}function m(y){return y===91||y===92||y===93?(e.consume(y),o++,v):v(y)}}function nO(e,t,n,r,a,i){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),l=m===40?41:m,f):n(m)}function f(m){return m===l?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),c(m))}function c(m){return m===l?(e.exit(i),f(l)):m===null?n(m):nt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),At(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===l||m===null||nt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?v:d)}function v(m){return m===l||m===92?(e.consume(m),d):d(m)}}function Of(e,t){let n;return r;function r(a){return nt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Et(a)?At(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const p9={name:"definition",tokenize:g9},m9={partial:!0,tokenize:y9};function g9(e,t,n){const r=this;let a;return i;function i(y){return e.enter("definition"),l(y)}function l(y){return tO.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return a=Oa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return Kt(y)?Of(e,c)(y):c(y)}function c(y){return eO(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function d(y){return e.attempt(m9,v,v)(y)}function v(y){return Et(y)?At(e,m,"whitespace")(y):m(y)}function m(y){return y===null||nt(y)?(e.exit("definition"),r.parser.defined.push(a),t(y)):n(y)}}function y9(e,t,n){return r;function r(o){return Kt(o)?Of(e,a)(o):n(o)}function a(o){return nO(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Et(o)?At(e,l,"whitespace")(o):l(o)}function l(o){return o===null||nt(o)?t(o):n(o)}}const x9={name:"hardBreakEscape",tokenize:b9};function b9(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return nt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const w9={name:"headingAtx",resolve:S9,tokenize:E9};function S9(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ta(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function E9(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||Kt(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),f(d)):d===null||nt(d)?(e.exit("atxHeading"),t(d)):Et(d)?At(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function f(d){return d===35?(e.consume(d),f):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Kt(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const C9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ek=["pre","script","style","textarea"],T9={concrete:!0,name:"htmlFlow",resolveTo:A9,tokenize:R9},k9={partial:!0,tokenize:D9},N9={partial:!0,tokenize:j9};function A9(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function R9(e,t,n){const r=this;let a,i,l,o,f;return c;function c(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),v}function v(U){return U===33?(e.consume(U),m):U===47?(e.consume(U),i=!0,w):U===63?(e.consume(U),a=3,r.interrupt?t:V):Er(U)?(e.consume(U),l=String.fromCharCode(U),S):n(U)}function m(U){return U===45?(e.consume(U),a=2,y):U===91?(e.consume(U),a=5,o=0,x):Er(U)?(e.consume(U),a=4,r.interrupt?t:V):n(U)}function y(U){return U===45?(e.consume(U),r.interrupt?t:V):n(U)}function x(U){const te="CDATA[";return U===te.charCodeAt(o++)?(e.consume(U),o===te.length?r.interrupt?t:P:x):n(U)}function w(U){return Er(U)?(e.consume(U),l=String.fromCharCode(U),S):n(U)}function S(U){if(U===null||U===47||U===62||Kt(U)){const te=U===47,ie=l.toLowerCase();return!te&&!i&&ek.includes(ie)?(a=1,r.interrupt?t(U):P(U)):C9.includes(l.toLowerCase())?(a=6,te?(e.consume(U),b):r.interrupt?t(U):P(U)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(U):i?C(U):T(U))}return U===45||hr(U)?(e.consume(U),l+=String.fromCharCode(U),S):n(U)}function b(U){return U===62?(e.consume(U),r.interrupt?t:P):n(U)}function C(U){return Et(U)?(e.consume(U),C):M(U)}function T(U){return U===47?(e.consume(U),M):U===58||U===95||Er(U)?(e.consume(U),N):Et(U)?(e.consume(U),T):M(U)}function N(U){return U===45||U===46||U===58||U===95||hr(U)?(e.consume(U),N):A(U)}function A(U){return U===61?(e.consume(U),R):Et(U)?(e.consume(U),A):T(U)}function R(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),f=U,D):Et(U)?(e.consume(U),R):L(U)}function D(U){return U===f?(e.consume(U),f=null,_):U===null||nt(U)?n(U):(e.consume(U),D)}function L(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Kt(U)?A(U):(e.consume(U),L)}function _(U){return U===47||U===62||Et(U)?T(U):n(U)}function M(U){return U===62?(e.consume(U),z):n(U)}function z(U){return U===null||nt(U)?P(U):Et(U)?(e.consume(U),z):n(U)}function P(U){return U===45&&a===2?(e.consume(U),B):U===60&&a===1?(e.consume(U),H):U===62&&a===4?(e.consume(U),q):U===63&&a===3?(e.consume(U),V):U===93&&a===5?(e.consume(U),Q):nt(U)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(k9,X,G)(U)):U===null||nt(U)?(e.exit("htmlFlowData"),G(U)):(e.consume(U),P)}function G(U){return e.check(N9,I,X)(U)}function I(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),F}function F(U){return U===null||nt(U)?G(U):(e.enter("htmlFlowData"),P(U))}function B(U){return U===45?(e.consume(U),V):P(U)}function H(U){return U===47?(e.consume(U),l="",Y):P(U)}function Y(U){if(U===62){const te=l.toLowerCase();return ek.includes(te)?(e.consume(U),q):P(U)}return Er(U)&&l.length<8?(e.consume(U),l+=String.fromCharCode(U),Y):P(U)}function Q(U){return U===93?(e.consume(U),V):P(U)}function V(U){return U===62?(e.consume(U),q):U===45&&a===2?(e.consume(U),V):P(U)}function q(U){return U===null||nt(U)?(e.exit("htmlFlowData"),X(U)):(e.consume(U),q)}function X(U){return e.exit("htmlFlow"),t(U)}}function j9(e,t,n){const r=this;return a;function a(l){return nt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function D9(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(gd,t,n)}}const M9={name:"htmlText",tokenize:O9};function O9(e,t,n){const r=this;let a,i,l;return o;function o(V){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(V),f}function f(V){return V===33?(e.consume(V),c):V===47?(e.consume(V),A):V===63?(e.consume(V),T):Er(V)?(e.consume(V),L):n(V)}function c(V){return V===45?(e.consume(V),d):V===91?(e.consume(V),i=0,x):Er(V)?(e.consume(V),C):n(V)}function d(V){return V===45?(e.consume(V),y):n(V)}function v(V){return V===null?n(V):V===45?(e.consume(V),m):nt(V)?(l=v,H(V)):(e.consume(V),v)}function m(V){return V===45?(e.consume(V),y):v(V)}function y(V){return V===62?B(V):V===45?m(V):v(V)}function x(V){const q="CDATA[";return V===q.charCodeAt(i++)?(e.consume(V),i===q.length?w:x):n(V)}function w(V){return V===null?n(V):V===93?(e.consume(V),S):nt(V)?(l=w,H(V)):(e.consume(V),w)}function S(V){return V===93?(e.consume(V),b):w(V)}function b(V){return V===62?B(V):V===93?(e.consume(V),b):w(V)}function C(V){return V===null||V===62?B(V):nt(V)?(l=C,H(V)):(e.consume(V),C)}function T(V){return V===null?n(V):V===63?(e.consume(V),N):nt(V)?(l=T,H(V)):(e.consume(V),T)}function N(V){return V===62?B(V):T(V)}function A(V){return Er(V)?(e.consume(V),R):n(V)}function R(V){return V===45||hr(V)?(e.consume(V),R):D(V)}function D(V){return nt(V)?(l=D,H(V)):Et(V)?(e.consume(V),D):B(V)}function L(V){return V===45||hr(V)?(e.consume(V),L):V===47||V===62||Kt(V)?_(V):n(V)}function _(V){return V===47?(e.consume(V),B):V===58||V===95||Er(V)?(e.consume(V),M):nt(V)?(l=_,H(V)):Et(V)?(e.consume(V),_):B(V)}function M(V){return V===45||V===46||V===58||V===95||hr(V)?(e.consume(V),M):z(V)}function z(V){return V===61?(e.consume(V),P):nt(V)?(l=z,H(V)):Et(V)?(e.consume(V),z):_(V)}function P(V){return V===null||V===60||V===61||V===62||V===96?n(V):V===34||V===39?(e.consume(V),a=V,G):nt(V)?(l=P,H(V)):Et(V)?(e.consume(V),P):(e.consume(V),I)}function G(V){return V===a?(e.consume(V),a=void 0,F):V===null?n(V):nt(V)?(l=G,H(V)):(e.consume(V),G)}function I(V){return V===null||V===34||V===39||V===60||V===61||V===96?n(V):V===47||V===62||Kt(V)?_(V):(e.consume(V),I)}function F(V){return V===47||V===62||Kt(V)?_(V):n(V)}function B(V){return V===62?(e.consume(V),e.exit("htmlTextData"),e.exit("htmlText"),t):n(V)}function H(V){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(V),e.exit("lineEnding"),Y}function Y(V){return Et(V)?At(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):Q(V)}function Q(V){return e.enter("htmlTextData"),l(V)}}const rw={name:"labelEnd",resolveAll:P9,resolveTo:z9,tokenize:I9},L9={tokenize:F9},_9={tokenize:q9},B9={tokenize:U9};function P9(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ta(e,0,e.length,n),e}function z9(e,t){let n=e.length,r=0,a,i,l,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",f,t],["enter",c,t]],o=ba(o,e.slice(i+1,i+r+3)),o=ba(o,[["enter",d,t]]),o=ba(o,qp(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),o=ba(o,[["exit",d,t],e[l-2],e[l-1],["exit",c,t]]),o=ba(o,e.slice(l+1)),o=ba(o,[["exit",f,t]]),ta(e,i,e.length,o),e}function I9(e,t,n){const r=this;let a=r.events.length,i,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(m){return i?i._inactive?v(m):(l=r.parser.defined.includes(Oa(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),f):n(m)}function f(m){return m===40?e.attempt(L9,d,l?d:v)(m):m===91?e.attempt(_9,d,l?c:v)(m):l?d(m):v(m)}function c(m){return e.attempt(B9,d,v)(m)}function d(m){return t(m)}function v(m){return i._balanced=!0,n(m)}}function F9(e,t,n){return r;function r(v){return e.enter("resource"),e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),a}function a(v){return Kt(v)?Of(e,i)(v):i(v)}function i(v){return v===41?d(v):eO(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function l(v){return Kt(v)?Of(e,f)(v):d(v)}function o(v){return n(v)}function f(v){return v===34||v===39||v===40?nO(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):d(v)}function c(v){return Kt(v)?Of(e,d)(v):d(v)}function d(v){return v===41?(e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),e.exit("resource"),t):n(v)}}function q9(e,t,n){const r=this;return a;function a(o){return tO.call(r,e,i,l,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Oa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function U9(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const V9={name:"labelStartImage",resolveAll:rw.resolveAll,tokenize:H9};function H9(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),l):n(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const G9={name:"labelStartLink",resolveAll:rw.resolveAll,tokenize:$9};function $9(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Hy={name:"lineEnding",tokenize:K9};function K9(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}const kv={name:"thematicBreak",tokenize:Y9};function Y9(e,t,n){let r=0,a;return i;function i(c){return e.enter("thematicBreak"),l(c)}function l(c){return a=c,o(c)}function o(c){return c===a?(e.enter("thematicBreakSequence"),f(c)):r>=3&&(c===null||nt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function f(c){return c===a?(e.consume(c),r++,f):(e.exit("thematicBreakSequence"),Et(c)?At(e,o,"whitespace")(c):o(c))}}const Br={continuation:{tokenize:Z9},exit:eH,name:"list",tokenize:W9},X9={partial:!0,tokenize:tH},Q9={partial:!0,tokenize:J9};function W9(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return o;function o(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:kb(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(kv,n,c)(y):c(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return kb(y)&&++l<10?(e.consume(y),f):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),c(y)):n(y)}function c(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(gd,r.interrupt?n:d,e.attempt(X9,m,v))}function d(y){return r.containerState.initialBlankLine=!0,i++,m(y)}function v(y){return Et(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),m):n(y)}function m(y){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function Z9(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(gd,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,At(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Et(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Q9,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(Br,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function J9(e,t,n){const r=this;return At(e,a,"listItemIndent",r.containerState.size+1);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function eH(e){e.exit(this.containerState.type)}function tH(e,t,n){const r=this;return At(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const l=r.events[r.events.length-1];return!Et(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const tk={name:"setextUnderline",resolveTo:nH,tokenize:rH};function nH(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function rH(e,t,n){const r=this;let a;return i;function i(c){let d=r.events.length,v;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){v=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||v)?(e.enter("setextHeadingLine"),a=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===a?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Et(c)?At(e,f,"lineSuffix")(c):f(c))}function f(c){return c===null||nt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const aH={tokenize:iH};function iH(e){const t=this,n=e.attempt(gd,r,e.attempt(this.parser.constructs.flowInitial,a,At(e,e.attempt(this.parser.constructs.flow,a,e.attempt(c9,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sH={resolveAll:aO()},lH=rO("string"),oH=rO("text");function rO(e){return{resolveAll:aO(e==="text"?uH:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,l,o);return l;function l(d){return c(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),f}function f(d){return c(d)?(n.exit("data"),i(d)):(n.consume(d),f)}function c(d){if(d===null)return!0;const v=a[d];let m=-1;if(v)for(;++m<v.length;){const y=v[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function aO(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function uH(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,l=-1,o=0,f;for(;i--;){const c=a[i];if(typeof c=="string"){for(l=c.length;c.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(c===-2)f=!0,o++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||f||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const cH={42:Br,43:Br,45:Br,48:Br,49:Br,50:Br,51:Br,52:Br,53:Br,54:Br,55:Br,56:Br,57:Br,62:QM},fH={91:p9},dH={[-2]:Vy,[-1]:Vy,32:Vy},hH={35:w9,42:kv,45:[tk,kv],60:T9,61:tk,95:kv,96:JT,126:JT},vH={38:ZM,92:WM},pH={[-5]:Hy,[-4]:Hy,[-3]:Hy,33:V9,38:ZM,42:Nb,60:[GV,M9],91:G9,92:[x9,WM],93:rw,95:Nb,96:a9},mH={null:[Nb,sH]},gH={null:[42,95]},yH={null:[]},xH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gH,contentInitial:fH,disable:yH,document:cH,flow:hH,flowInitial:dH,insideSpan:mH,string:vH,text:pH},Symbol.toStringTag,{value:"Module"}));function bH(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},i=[];let l=[],o=[];const f={attempt:D(A),check:D(R),consume:C,enter:T,exit:N,interrupt:D(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:y,write:v};let d=t.tokenize.call(c,f);return t.resolveAll&&i.push(t),c;function v(z){return l=ba(l,z),S(),l[l.length-1]!==null?[]:(L(t,0),c.events=qp(i,c.events,c),c.events)}function m(z,P){return SH(y(z),P)}function y(z){return wH(l,z)}function x(){const{_bufferIndex:z,_index:P,line:G,column:I,offset:F}=r;return{_bufferIndex:z,_index:P,line:G,column:I,offset:F}}function w(z){a[z.line]=z.column,M()}function S(){let z;for(;r._index<l.length;){const P=l[r._index];if(typeof P=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<P.length;)b(P.charCodeAt(r._bufferIndex));else b(P)}}function b(z){d=d(z)}function C(z){nt(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,M()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function T(z,P){const G=P||{};return G.type=z,G.start=x(),c.events.push(["enter",G,c]),o.push(G),G}function N(z){const P=o.pop();return P.end=x(),c.events.push(["exit",P,c]),P}function A(z,P){L(z,P.from)}function R(z,P){P.restore()}function D(z,P){return G;function G(I,F,B){let H,Y,Q,V;return Array.isArray(I)?X(I):"tokenize"in I?X([I]):q(I);function q(oe){return ae;function ae(we){const fe=we!==null&&oe[we],J=we!==null&&oe.null,ne=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(J)?J:J?[J]:[]];return X(ne)(we)}}function X(oe){return H=oe,Y=0,oe.length===0?B:U(oe[Y])}function U(oe){return ae;function ae(we){return V=_(),Q=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?ie():oe.tokenize.call(P?Object.assign(Object.create(c),P):c,f,te,ie)(we)}}function te(oe){return z(Q,V),F}function ie(oe){return V.restore(),++Y<H.length?U(H[Y]):B}}}function L(z,P){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&ta(c.events,P,c.events.length-P,z.resolve(c.events.slice(P),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function _(){const z=x(),P=c.previous,G=c.currentConstruct,I=c.events.length,F=Array.from(o);return{from:I,restore:B};function B(){r=z,c.previous=P,c.currentConstruct=G,c.events.length=I,o=F,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function wH(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,i)];else{if(l=e.slice(n,a),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}i>0&&l.push(e[a].slice(0,i))}return l}function SH(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
|
431
|
+
`;break}case-3:{l=`\r
|
|
432
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(i)}a=i===-2,r.push(l)}return r.join("")}function EH(e){const r={constructs:YM([xH,...(e||{}).extensions||[]]),content:a(zV),defined:[],document:a(FV),flow:a(aH),lazy:{},string:a(lH),text:a(oH)};return r;function a(i){return l;function l(o){return bH(r,i,o)}}}function CH(e){for(;!JM(e););return e}const nk=/[\0\t\n\r]/g;function TH(){let e=1,t="",n=!0,r;return a;function a(i,l,o){const f=[];let c,d,v,m,y;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),v=0,t="",n&&(i.charCodeAt(0)===65279&&v++,n=void 0);v<i.length;){if(nk.lastIndex=v,c=nk.exec(i),m=c&&c.index!==void 0?c.index:i.length,y=i.charCodeAt(m),!c){t=i.slice(v);break}if(y===10&&v===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),v<m&&(f.push(i.slice(v,m)),e+=m-v),y){case 0:{f.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,f.push(-2);e++<d;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}v=m+1}return o&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const kH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NH(e){return e.replace(kH,AH)}function AH(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return XM(n.slice(i?2:1),i?16:10)}return nw(n)||e}const iO={}.hasOwnProperty;function RH(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),jH(n)(CH(EH(n).document().write(TH()(e,t,!0))))}function jH(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(qe),autolinkProtocol:_,autolinkEmail:_,atxHeading:i(Be),blockQuote:i(J),characterEscape:_,characterReference:_,codeFenced:i(ne),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ne,l),codeText:i(re,l),codeTextData:_,data:_,codeFlowValue:_,definition:i(ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(ke),hardBreakEscape:i(lt),hardBreakTrailing:i(lt),htmlFlow:i(Ze,l),htmlFlowData:_,htmlText:i(Ze,l),htmlTextData:_,image:i(Qe),label:l,link:i(qe),listItem:i(Ge),listItemValue:m,listOrdered:i(je,v),listUnordered:i(je),paragraph:i(Xe),reference:U,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Be),strong:i(it),thematicBreak:i(ft)},exit:{atxHeading:f(),atxHeadingSequence:A,autolink:f(),autolinkEmail:fe,autolinkProtocol:we,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:oe,characterReference:ae,codeFenced:f(S),codeFencedFence:w,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:f(b),codeText:f(F),codeTextData:M,data:M,definition:f(),definitionDestinationString:N,definitionLabelString:C,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(P),hardBreakTrailing:f(P),htmlFlow:f(G),htmlFlowData:M,htmlText:f(I),htmlTextData:M,image:f(H),label:Q,labelText:Y,lineEnding:z,link:f(B),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:te,resourceDestinationString:V,resourceTitleString:q,resource:X,setextHeading:f(L),setextHeadingLineSequence:D,setextHeadingText:R,strong:f(),thematicBreak:f()}};sO(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ce={type:"root",children:[]};const De={stack:[Ce],tokenStack:[],config:t,enter:o,exit:c,buffer:l,resume:d,data:n},ze=[];let Me=-1;for(;++Me<he.length;)if(he[Me][1].type==="listOrdered"||he[Me][1].type==="listUnordered")if(he[Me][0]==="enter")ze.push(Me);else{const Oe=ze.pop();Me=a(he,Oe,Me)}for(Me=-1;++Me<he.length;){const Oe=t[he[Me][0]];iO.call(Oe,he[Me][1].type)&&Oe[he[Me][1].type].call(Object.assign({sliceSerialize:he[Me][2].sliceSerialize},De),he[Me][1])}if(De.tokenStack.length>0){const Oe=De.tokenStack[De.tokenStack.length-1];(Oe[1]||rk).call(De,void 0,Oe[0])}for(Ce.position={start:Os(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Os(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<t.transforms.length;)Ce=t.transforms[Me](Ce)||Ce;return Ce}function a(he,Ce,De){let ze=Ce-1,Me=-1,Oe=!1,ye,K,le,pe;for(;++ze<=De;){const de=he[ze];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?Me++:Me--,pe=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(ye&&!pe&&!Me&&!le&&(le=ze),pe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pe=void 0}if(!Me&&de[0]==="enter"&&de[1].type==="listItemPrefix"||Me===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(ye){let xe=ze;for(K=void 0;xe--;){const Le=he[xe];if(Le[1].type==="lineEnding"||Le[1].type==="lineEndingBlank"){if(Le[0]==="exit")continue;K&&(he[K][1].type="lineEndingBlank",Oe=!0),Le[1].type="lineEnding",K=xe}else if(!(Le[1].type==="linePrefix"||Le[1].type==="blockQuotePrefix"||Le[1].type==="blockQuotePrefixWhitespace"||Le[1].type==="blockQuoteMarker"||Le[1].type==="listItemIndent"))break}le&&(!K||le<K)&&(ye._spread=!0),ye.end=Object.assign({},K?he[K][1].start:de[1].end),he.splice(K||ze,0,["exit",ye,de[2]]),ze++,De++}if(de[1].type==="listItemPrefix"){const xe={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};ye=xe,he.splice(ze,0,["enter",xe,de[2]]),ze++,De++,le=void 0,pe=!0}}}return he[Ce][1]._spread=Oe,De}function i(he,Ce){return De;function De(ze){o.call(this,he(ze),ze),Ce&&Ce.call(this,ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(he,Ce,De){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,De||void 0]),he.position={start:Os(Ce.start),end:void 0}}function f(he){return Ce;function Ce(De){he&&he.call(this,De),c.call(this,De)}}function c(he,Ce){const De=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==he.type&&(Ce?Ce.call(this,he,ze[0]):(ze[1]||rk).call(this,he,ze[0]));else throw new Error("Cannot close `"+he.type+"` ("+Mf({start:he.start,end:he.end})+"): it’s not open");De.position.end=Os(he.end)}function d(){return tw(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function m(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function y(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function x(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function C(he){const Ce=this.resume(),De=this.stack[this.stack.length-1];De.label=Ce,De.identifier=Oa(this.sliceSerialize(he)).toLowerCase()}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function N(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function A(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const De=this.sliceSerialize(he).length;Ce.depth=De}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function _(he){const De=this.stack[this.stack.length-1].children;let ze=De[De.length-1];(!ze||ze.type!=="text")&&(ze=Pe(),ze.position={start:Os(he.start),end:void 0},De.push(ze)),this.stack.push(ze)}function M(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=Os(he.end)}function z(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=Ce.children[Ce.children.length-1];De.position.end=Os(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(_.call(this,he),M.call(this,he))}function P(){this.data.atHardBreak=!0}function G(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function I(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function F(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function B(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function H(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Y(he){const Ce=this.sliceSerialize(he),De=this.stack[this.stack.length-2];De.label=NH(Ce),De.identifier=Oa(Ce).toLowerCase()}function Q(){const he=this.stack[this.stack.length-1],Ce=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const ze=he.children;De.children=ze}else De.alt=Ce}function V(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function q(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function X(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function te(he){const Ce=this.resume(),De=this.stack[this.stack.length-1];De.label=Ce,De.identifier=Oa(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function ie(he){this.data.characterReferenceType=he.type}function oe(he){const Ce=this.sliceSerialize(he),De=this.data.characterReferenceType;let ze;De?(ze=XM(Ce,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=nw(Ce);const Me=this.stack[this.stack.length-1];Me.value+=ze}function ae(he){const Ce=this.stack.pop();Ce.position.end=Os(he.end)}function we(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function fe(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function J(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function Ze(){return{type:"html",value:""}}function Qe(){return{type:"image",title:null,url:"",alt:null}}function qe(){return{type:"link",title:null,url:"",children:[]}}function je(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ge(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Xe(){return{type:"paragraph",children:[]}}function it(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function ft(){return{type:"thematicBreak"}}}function Os(e){return{line:e.line,column:e.column,offset:e.offset}}function sO(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?sO(e,r):DH(e,r)}}function DH(e,t){let n;for(n in t)if(iO.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function rk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Mf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Mf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Mf({start:t.start,end:t.end})+") is still open")}function MH(e){const t=this;t.parser=n;function n(r){return RH(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function OH(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function LH(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
433
|
+
`}]}function _H(e,t){const n=t.value?t.value+`
|
|
434
|
+
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function BH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=cc(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,o+=1,e.footnoteCounts.set(r,o);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const c={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,c),e.applyData(t,c)}function IH(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FH(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lO(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function qH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lO(e,t);const a={src:cc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function UH(e,t){const n={src:cc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function VH(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function HH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lO(e,t);const a={href:cc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function GH(e,t){const n={href:cc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $H(e,t,n){const r=e.all(t),a=n?KH(n):oO(t),i={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let v;d&&d.type==="element"&&d.tagName==="p"?v=d:(v={type:"element",tagName:"p",properties:{},children:[]},r.unshift(v)),v.children.length>0&&v.children.unshift({type:"text",value:" "}),v.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(a||o!==0||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
435
|
+
`}),d.type==="element"&&d.tagName==="p"&&!a?l.push(...d.children):l.push(d)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
436
|
+
`});const c={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,c),e.applyData(t,c)}function KH(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=oO(n[r])}return t}function oO(e){const t=e.spread;return t??e.children.length>1}function YH(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function XH(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QH(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function WH(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZH(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=W1(t.children[1]),f=qM(t.children[t.children.length-1]);o&&f&&(l.position={start:o,end:f}),a.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function JH(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let f=-1;const c=[];for(;++f<o;){const v=t.children[f],m={},y=l?l[f]:void 0;y&&(m.align=y);let x={type:"element",tagName:i,properties:m,children:[]};v&&(x.children=e.all(v),e.patch(v,x),x=e.applyData(v,x)),c.push(x)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function e7(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ak=9,ik=32;function t7(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(sk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(sk(t.slice(a),a>0,!1)),i.join("")}function sk(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===ak||i===ik;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===ak||i===ik;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function n7(e,t){const n={type:"text",value:t7(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function r7(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const a7={blockquote:OH,break:LH,code:_H,delete:BH,emphasis:PH,footnoteReference:zH,heading:IH,html:FH,imageReference:qH,image:UH,inlineCode:VH,linkReference:HH,link:GH,listItem:$H,list:YH,paragraph:XH,root:QH,strong:WH,table:ZH,tableCell:e7,tableRow:JH,text:n7,thematicBreak:r7,toml:ev,yaml:ev,definition:ev,footnoteDefinition:ev};function ev(){}const uO=-1,Up=0,Lf=1,Wv=2,aw=3,iw=4,sw=5,lw=6,cO=7,fO=8,lk=typeof self=="object"?self:globalThis,i7=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,l]=t[a];switch(i){case Up:case uO:return n(l,a);case Lf:{const o=n([],a);for(const f of l)o.push(r(f));return o}case Wv:{const o=n({},a);for(const[f,c]of l)o[r(f)]=r(c);return o}case aw:return n(new Date(l),a);case iw:{const{source:o,flags:f}=l;return n(new RegExp(o,f),a)}case sw:{const o=n(new Map,a);for(const[f,c]of l)o.set(r(f),r(c));return o}case lw:{const o=n(new Set,a);for(const f of l)o.add(r(f));return o}case cO:{const{name:o,message:f}=l;return n(new lk[o](f),a)}case fO:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}}return n(new lk[i](l),a)};return r},ok=e=>i7(new Map,e)(0),fu="",{toString:s7}={},{keys:l7}=Object,mf=e=>{const t=typeof e;if(t!=="object"||!e)return[Up,t];const n=s7.call(e).slice(8,-1);switch(n){case"Array":return[Lf,fu];case"Object":return[Wv,fu];case"Date":return[aw,fu];case"RegExp":return[iw,fu];case"Map":return[sw,fu];case"Set":return[lw,fu];case"DataView":return[Lf,n]}return n.includes("Array")?[Lf,n]:n.includes("Error")?[cO,n]:[Wv,n]},tv=([e,t])=>e===Up&&(t==="function"||t==="symbol"),o7=(e,t,n,r)=>{const a=(l,o)=>{const f=r.push(l)-1;return n.set(o,f),f},i=l=>{if(n.has(l))return n.get(l);let[o,f]=mf(l);switch(o){case Up:{let d=l;switch(f){case"bigint":o=fO,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);d=null;break;case"undefined":return a([uO],l)}return a([o,d],l)}case Lf:{if(f){let m=l;return f==="DataView"?m=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(m=new Uint8Array(l)),a([f,[...m]],l)}const d=[],v=a([o,d],l);for(const m of l)d.push(i(m));return v}case Wv:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const d=[],v=a([o,d],l);for(const m of l7(l))(e||!tv(mf(l[m])))&&d.push([i(m),i(l[m])]);return v}case aw:return a([o,l.toISOString()],l);case iw:{const{source:d,flags:v}=l;return a([o,{source:d,flags:v}],l)}case sw:{const d=[],v=a([o,d],l);for(const[m,y]of l)(e||!(tv(mf(m))||tv(mf(y))))&&d.push([i(m),i(y)]);return v}case lw:{const d=[],v=a([o,d],l);for(const m of l)(e||!tv(mf(m)))&&d.push(i(m));return v}}const{message:c}=l;return a([o,{name:f,message:c}],l)};return i},uk=(e,{json:t,lossy:n}={})=>{const r=[];return o7(!(t||n),!!t,new Map,r)(e),r},Zv=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ok(uk(e,t)):structuredClone(e):(e,t)=>ok(uk(e,t));function u7(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function c7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function f7(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||u7,r=e.options.footnoteBackLabel||c7,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let f=-1;for(;++f<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[f]);if(!c)continue;const d=e.all(c),v=String(c.identifier).toUpperCase(),m=cc(v.toLowerCase());let y=0;const x=[],w=e.footnoteCounts.get(v);for(;w!==void 0&&++y<=w;){x.length>0&&x.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,y);typeof C=="string"&&(C={type:"text",value:C}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,y),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...x)}else d.push(...x);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Zv(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
437
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
438
|
+
`}]}}const Vp=(function(e){if(e==null)return p7;if(typeof e=="function")return Hp(e);if(typeof e=="object")return Array.isArray(e)?d7(e):h7(e);if(typeof e=="string")return v7(e);throw new Error("Expected function, string, or object as test")});function d7(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Vp(e[n]);return Hp(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function h7(e){const t=e;return Hp(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function v7(e){return Hp(t);function t(n){return n&&n.type===e}}function Hp(e){return t;function t(n,r,a){return!!(m7(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function p7(){return!0}function m7(e){return e!==null&&typeof e=="object"&&"type"in e}const dO=[],g7=!0,Ab=!1,y7="skip";function hO(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=Vp(a),l=r?-1:1;o(e,void 0,[])();function o(f,c,d){const v=f&&typeof f=="object"?f:{};if(typeof v.type=="string"){const y=typeof v.tagName=="string"?v.tagName:typeof v.name=="string"?v.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return m;function m(){let y=dO,x,w,S;if((!t||i(f,c,d[d.length-1]||void 0))&&(y=x7(n(f,d)),y[0]===Ab))return y;if("children"in f&&f.children){const b=f;if(b.children&&y[0]!==y7)for(w=(r?b.children.length:-1)+l,S=d.concat(b);w>-1&&w<b.children.length;){const C=b.children[w];if(x=o(C,w,S)(),x[0]===Ab)return x;w=typeof x[1]=="number"?x[1]:w+l}}return y}}}function x7(e){return Array.isArray(e)?e:typeof e=="number"?[g7,e]:e==null?dO:[e]}function ow(e,t,n,r){let a,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,a=n):(i=t,l=n,a=r),hO(e,i,o,a);function o(f,c){const d=c[c.length-1],v=d?d.children.indexOf(f):void 0;return l(f,v,d)}}const Rb={}.hasOwnProperty,b7={};function w7(e,t){const n=t||b7,r=new Map,a=new Map,i=new Map,l={...a7,...n.handlers},o={all:c,applyData:E7,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:S7,wrap:T7};return ow(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const v=d.type==="definition"?r:a,m=String(d.identifier).toUpperCase();v.has(m)||v.set(m,d)}}),o;function f(d,v){const m=d.type,y=o.handlers[m];if(Rb.call(o.handlers,m)&&y)return y(o,d,v);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in d){const{children:w,...S}=d,b=Zv(S);return b.children=o.all(d),b}return Zv(d)}return(o.options.unknownHandler||C7)(o,d,v)}function c(d){const v=[];if("children"in d){const m=d.children;let y=-1;for(;++y<m.length;){const x=o.one(m[y],d);if(x){if(y&&m[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=ck(x.value)),!Array.isArray(x)&&x.type==="element")){const w=x.children[0];w&&w.type==="text"&&(w.value=ck(w.value))}Array.isArray(x)?v.push(...x):v.push(x)}}}return v}}function S7(e,t){e.position&&(t.position=cV(e))}function E7(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,Zv(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function C7(e,t){const n=t.data||{},r="value"in t&&!(Rb.call(n,"hProperties")||Rb.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function T7(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
439
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
440
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
441
|
+
`}),n}function ck(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fk(e,t){const n=w7(e,t),r=n.one(e,void 0),a=f7(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
|
|
442
|
+
`},a),i}function k7(e,t){return e&&"run"in e?async function(n,r){const a=fk(n,{file:r,...t});await e.run(a,r)}:function(n,r){return fk(n,{file:r,...e||t})}}function dk(e){if(e)throw e}var Gy,hk;function N7(){if(hk)return Gy;hk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),v=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!v)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},l=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},o=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Gy=function f(){var c,d,v,m,y,x,w=arguments[0],S=1,b=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<b;++S)if(c=arguments[S],c!=null)for(d in c)v=o(w,d),m=o(c,d),w!==m&&(C&&m&&(i(m)||(y=a(m)))?(y?(y=!1,x=v&&a(v)?v:[]):x=v&&i(v)?v:{},l(w,{name:d,newValue:f(C,x,m)})):typeof m<"u"&&l(w,{name:d,newValue:m}));return w},Gy}var A7=N7();const $y=ld(A7);function jb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function R7(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...a);function o(f,...c){const d=e[++i];let v=-1;if(f){l(f);return}for(;++v<a.length;)(c[v]===null||c[v]===void 0)&&(c[v]=a[v]);a=c,d?j7(d,o)(...c):l(null,...c)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function j7(e,t){let n;return r;function r(...l){const o=e.length>l.length;let f;o&&l.push(a);try{f=e.apply(this,l)}catch(c){const d=c;if(o&&n)throw d;return a(d)}o||(f&&f.then&&typeof f.then=="function"?f.then(i,a):f instanceof Error?a(f):i(f))}function a(l,...o){n||(n=!0,t(l,...o))}function i(l){a(null,l)}}const Wa={basename:D7,dirname:M7,extname:O7,join:L7,sep:"/"};function D7(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yd(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else l<0&&(i=!0,l=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function M7(e){if(yd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function O7(e){yd(e);let t=e.length,n=-1,r=0,a=-1,i=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function L7(...e){let t=-1,n;for(;++t<e.length;)yd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_7(n)}function _7(e){yd(e);const t=e.codePointAt(0)===47;let n=B7(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function B7(e,t){let n="",r=0,a=-1,i=0,l=-1,o,f;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(a===l-1||i===1))if(a!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,i=0;continue}}else if(n.length>0){n="",r=0,a=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,i=0}else o===46&&i>-1?i++:i=-1}return n}function yd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const P7={cwd:z7};function z7(){return"/"}function Db(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function I7(e){if(typeof e=="string")e=new URL(e);else if(!Db(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return F7(e)}function F7(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Ky=["history","path","basename","stem","extname","dirname"];class vO{constructor(t){let n;t?Db(t)?n={path:t}:typeof t=="string"||q7(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":P7.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ky.length;){const i=Ky[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)Ky.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Wa.basename(this.path):void 0}set basename(t){Xy(t,"basename"),Yy(t,"basename"),this.path=Wa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wa.dirname(this.path):void 0}set dirname(t){vk(this.basename,"dirname"),this.path=Wa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wa.extname(this.path):void 0}set extname(t){if(Yy(t,"extname"),vk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Db(t)&&(t=I7(t)),Xy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wa.basename(this.path,this.extname):void 0}set stem(t){Xy(t,"stem"),Yy(t,"stem"),this.path=Wa.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new gr(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Yy(e,t){if(e&&e.includes(Wa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wa.sep+"`")}function Xy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function q7(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const U7=(function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),V7={}.hasOwnProperty;class uw extends U7{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=R7()}copy(){const t=new uw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($y(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Zy("data",this.frozen),this.namespace[t]=n,this):V7.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Zy("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=nv(t),r=this.parser||this.Parser;return Qy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Qy("process",this.parser||this.Parser),Wy("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,l){const o=nv(t),f=r.parse(o);r.run(f,o,function(d,v,m){if(d||!v||!m)return c(d);const y=v,x=r.stringify(y,m);$7(x)?m.value=x:m.result=x,c(d,m)});function c(d,v){d||!v?l(d):i?i(v):n(void 0,v)}}}processSync(t){let n=!1,r;return this.freeze(),Qy("processSync",this.parser||this.Parser),Wy("processSync",this.compiler||this.Compiler),this.process(t,a),mk("processSync","process",n),r;function a(i,l){n=!0,dk(i),r=l}}run(t,n,r){pk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,o){const f=nv(n);a.run(t,f,c);function c(d,v,m){const y=v||t;d?o(d):l?l(y):r(void 0,y,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),mk("runSync","run",r),a;function i(l,o){dk(l),a=o,r=!0}}stringify(t,n){this.freeze();const r=nv(n),a=this.compiler||this.Compiler;return Wy("stringify",a),pk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Zy("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")f(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...v]=c;f(d,v)}else l(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function l(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(a.settings=$y(!0,a.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const v=c[d];i(v)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,d){let v=-1,m=-1;for(;++v<r.length;)if(r[v][0]===c){m=v;break}if(m===-1)r.push([c,...d]);else if(d.length>0){let[y,...x]=d;const w=r[m][1];jb(w)&&jb(y)&&(y=$y(!0,w,y)),r[m]=[c,y,...x]}}}}const H7=new uw().freeze();function Qy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zy(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function pk(e){if(!jb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function mk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function nv(e){return G7(e)?e:new vO(e)}function G7(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $7(e){return typeof e=="string"||K7(e)}function K7(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Y7="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gk=[],yk={allowDangerousHtml:!0},X7=/^(https?|ircs?|mailto|xmpp)$/i,Q7=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function W7(e){const t=Z7(e),n=J7(e);return eG(t.runSync(t.parse(n),n),e)}function Z7(e){const t=e.rehypePlugins||gk,n=e.remarkPlugins||gk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yk}:yk;return H7().use(MH).use(n).use(k7,r).use(t)}function J7(e){const t=e.children||"",n=new vO;return typeof t=="string"&&(n.value=t),n}function eG(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,f=t.urlTransform||tG;for(const d of Q7)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Y7+d.id,void 0);return ow(e,c),pV(e,{Fragment:p.Fragment,components:a,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function c(d,v,m){if(d.type==="raw"&&m&&typeof v=="number")return l?m.children.splice(v,1):m.children[v]={type:"text",value:d.value},v;if(d.type==="element"){let y;for(y in Uy)if(Object.hasOwn(Uy,y)&&Object.hasOwn(d.properties,y)){const x=d.properties[y],w=Uy[y];(w===null||w.includes(d.tagName))&&(d.properties[y]=f(String(x||""),y,d))}}if(d.type==="element"){let y=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!y&&r&&typeof v=="number"&&(y=!r(d,v,m)),y&&m&&typeof v=="number")return o&&d.children?m.children.splice(v,1,...d.children):m.children.splice(v,1),v}}}function tG(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||X7.test(e.slice(0,t))?e:""}function xk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function nG(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function rG(e,t,n){const a=Vp((n||{}).ignore||[]),i=aG(t);let l=-1;for(;++l<i.length;)hO(e,"text",o);function o(c,d){let v=-1,m;for(;++v<d.length;){const y=d[v],x=m?m.children:void 0;if(a(y,x?x.indexOf(y):void 0,m))return;m=y}if(m)return f(c,d)}function f(c,d){const v=d[d.length-1],m=i[l][0],y=i[l][1];let x=0;const S=v.children.indexOf(c);let b=!1,C=[];m.lastIndex=0;let T=m.exec(c.value);for(;T;){const N=T.index,A={index:T.index,input:T.input,stack:[...d,c]};let R=y(...T,A);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?m.lastIndex=N+1:(x!==N&&C.push({type:"text",value:c.value.slice(x,N)}),Array.isArray(R)?C.push(...R):R&&C.push(R),x=N+T[0].length,b=!0),!m.global)break;T=m.exec(c.value)}return b?(x<c.value.length&&C.push({type:"text",value:c.value.slice(x)}),v.children.splice(S,1,...C)):C=[c],S+C.length}}function aG(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([iG(a[0]),sG(a[1])])}return t}function iG(e){return typeof e=="string"?new RegExp(nG(e),"g"):e}function sG(e){return typeof e=="function"?e:function(){return e}}const Jy="phrasing",ex=["autolink","link","image","label"];function lG(){return{transforms:[vG],enter:{literalAutolink:uG,literalAutolinkEmail:tx,literalAutolinkHttp:tx,literalAutolinkWww:tx},exit:{literalAutolink:hG,literalAutolinkEmail:dG,literalAutolinkHttp:cG,literalAutolinkWww:fG}}}function oG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Jy,notInConstruct:ex},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Jy,notInConstruct:ex},{character:":",before:"[ps]",after:"\\/",inConstruct:Jy,notInConstruct:ex}]}}function uG(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function tx(e){this.config.enter.autolinkProtocol.call(this,e)}function cG(e){this.config.exit.autolinkProtocol.call(this,e)}function fG(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function dG(e){this.config.exit.autolinkEmail.call(this,e)}function hG(e){this.exit(e)}function vG(e){rG(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),mG]],{ignore:["link","linkReference"]})}function pG(e,t,n,r,a){let i="";if(!pO(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!gG(n)))return!1;const l=yG(n+r);if(!l[0])return!1;const o={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function mG(e,t,n,r){return!pO(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function gG(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function yG(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=xk(e,"(");let i=xk(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function pO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||po(n)||Fp(n))&&(!t||n!==47)}mO.peek=NG;function xG(){this.buffer()}function bG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function wG(){this.buffer()}function SG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function EG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function CG(e){this.exit(e)}function TG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kG(e){this.exit(e)}function NG(){return"["}function mO(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const l=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),l(),i+=a.move("]"),i}function AG(){return{enter:{gfmFootnoteCallString:xG,gfmFootnoteCall:bG,gfmFootnoteDefinitionLabelString:wG,gfmFootnoteDefinition:SG},exit:{gfmFootnoteCallString:EG,gfmFootnoteCall:CG,gfmFootnoteDefinitionLabelString:TG,gfmFootnoteDefinition:kG}}}function RG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:mO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,i,l){const o=i.createTracker(l);let f=o.move("[^");const c=i.enter("footnoteDefinition"),d=i.enter("label");return f+=o.move(i.safe(i.associationId(r),{before:f,after:"]"})),d(),f+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),f+=o.move((t?`
|
|
443
|
+
`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?gO:jG))),c(),f}}function jG(e,t,n){return t===0?e:gO(e,t,n)}function gO(e,t,n){return(n?"":" ")+e}const DG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yO.peek=BG;function MG(){return{canContainEols:["delete"],enter:{strikethrough:LG},exit:{strikethrough:_G}}}function OG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:DG}],handlers:{delete:yO}}}function LG(e){this.enter({type:"delete",children:[]},e)}function _G(e){this.exit(e)}function yO(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),i(),l}function BG(){return"~"}function PG(e){return e.length}function zG(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||PG,i=[],l=[],o=[],f=[];let c=0,d=-1;for(;++d<e.length;){const w=[],S=[];let b=-1;for(e[d].length>c&&(c=e[d].length);++b<e[d].length;){const C=IG(e[d][b]);if(n.alignDelimiters!==!1){const T=a(C);S[b]=T,(f[b]===void 0||T>f[b])&&(f[b]=T)}w.push(C)}l[d]=w,o[d]=S}let v=-1;if(typeof r=="object"&&"length"in r)for(;++v<c;)i[v]=bk(r[v]);else{const w=bk(r);for(;++v<c;)i[v]=w}v=-1;const m=[],y=[];for(;++v<c;){const w=i[v];let S="",b="";w===99?(S=":",b=":"):w===108?S=":":w===114&&(b=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[v]-S.length-b.length);const T=S+"-".repeat(C)+b;n.alignDelimiters!==!1&&(C=S.length+C+b.length,C>f[v]&&(f[v]=C),y[v]=C),m[v]=T}l.splice(1,0,m),o.splice(1,0,y),d=-1;const x=[];for(;++d<l.length;){const w=l[d],S=o[d];v=-1;const b=[];for(;++v<c;){const C=w[v]||"";let T="",N="";if(n.alignDelimiters!==!1){const A=f[v]-(S[v]||0),R=i[v];R===114?T=" ".repeat(A):R===99?A%2?(T=" ".repeat(A/2+.5),N=" ".repeat(A/2-.5)):(T=" ".repeat(A/2),N=T):N=" ".repeat(A)}n.delimiterStart!==!1&&!v&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||v)&&b.push(" "),n.alignDelimiters!==!1&&b.push(T),b.push(C),n.alignDelimiters!==!1&&b.push(N),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||v!==c-1)&&b.push("|")}x.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return x.join(`
|
|
444
|
+
`)}function IG(e){return e==null?"":String(e)}function bk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function FG(e,t,n,r){const a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),qG);return a(),l}function qG(e,t,n){return">"+(n?"":" ")+e}function UG(e,t){return wk(e,t.inConstruct,!0)&&!wk(e,t.notInConstruct,!1)}function wk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Sk(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
445
|
+
`&&UG(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
446
|
+
`}function VG(e,t){const n=String(e);let r=n.indexOf(t),a=r,i=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++i>l&&(l=i):i=1,a=r+t.length,r=n.indexOf(t,a);return l}function HG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function GG(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function $G(e,t,n,r){const a=GG(n),i=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(HG(e,n)){const v=n.enter("codeIndented"),m=n.indentLines(i,KG);return v(),m}const o=n.createTracker(r),f=a.repeat(Math.max(VG(i,a)+1,3)),c=n.enter("codeFenced");let d=o.move(f);if(e.lang){const v=n.enter(`codeFencedLang${l}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),v()}if(e.lang&&e.meta){const v=n.enter(`codeFencedMeta${l}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
|
|
447
|
+
`,encode:["`"],...o.current()})),v()}return d+=o.move(`
|
|
448
|
+
`),i&&(d+=o.move(i+`
|
|
449
|
+
`)),d+=o.move(f),c(),d}function KG(e,t,n){return(n?"":" ")+e}function cw(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function YG(e,t,n,r){const a=cw(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let o=n.enter("label");const f=n.createTracker(r);let c=f.move("[");return c+=f.move(n.safe(n.associationId(e),{before:c,after:"]",...f.current()})),c+=f.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(e.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(o=n.enter("destinationRaw"),c+=f.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
450
|
+
`,...f.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=f.move(" "+a),c+=f.move(n.safe(e.title,{before:c,after:a,...f.current()})),c+=f.move(a),o()),l(),c}function XG(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Gf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Jv(e,t,n){const r=Xu(e),a=Xu(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}xO.peek=QG;function xO(e,t,n,r){const a=XG(n),i=n.enter("emphasis"),l=n.createTracker(r),o=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:o,...l.current()}));const c=f.charCodeAt(0),d=Jv(r.before.charCodeAt(r.before.length-1),c,a);d.inside&&(f=Gf(c)+f.slice(1));const v=f.charCodeAt(f.length-1),m=Jv(r.after.charCodeAt(0),v,a);m.inside&&(f=f.slice(0,-1)+Gf(v));const y=l.move(a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+f+y}function QG(e,t,n){return n.options.emphasis||"*"}function WG(e,t){let n=!1;return ow(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ab}),!!((!e.depth||e.depth<3)&&tw(e)&&(t.options.setext||n))}function ZG(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(WG(e,n)){const d=n.enter("headingSetext"),v=n.enter("phrasing"),m=n.containerPhrasing(e,{...i.current(),before:`
|
|
451
|
+
`,after:`
|
|
452
|
+
`});return v(),d(),m+`
|
|
453
|
+
`+(a===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
|
|
454
|
+
`))+1))}const l="#".repeat(a),o=n.enter("headingAtx"),f=n.enter("phrasing");i.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
455
|
+
`,...i.current()});return/^[\t ]/.test(c)&&(c=Gf(c.charCodeAt(0))+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),f(),o(),c}bO.peek=JG;function bO(e){return e.value||""}function JG(){return"<"}wO.peek=e$;function wO(e,t,n,r){const a=cw(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let o=n.enter("label");const f=n.createTracker(r);let c=f.move("![");return c+=f.move(n.safe(e.alt,{before:c,after:"]",...f.current()})),c+=f.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(e.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(o=n.enter("destinationRaw"),c+=f.move(n.safe(e.url,{before:c,after:e.title?" ":")",...f.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=f.move(" "+a),c+=f.move(n.safe(e.title,{before:c,after:a,...f.current()})),c+=f.move(a),o()),c+=f.move(")"),l(),c}function e$(){return"!"}SO.peek=t$;function SO(e,t,n,r){const a=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("![");const c=n.safe(e.alt,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const d=n.stack;n.stack=[],l=n.enter("reference");const v=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=d,i(),a==="full"||!c||c!==v?f+=o.move(v+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function t$(){return"!"}EO.peek=n$;function EO(e,t,n){let r=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const l=n.unsafe[i],o=n.compilePattern(l);let f;if(l.atBreak)for(;f=o.exec(r);){let c=f.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(f.index+1)}}return a+r+a}function n$(){return"`"}function CO(e,t){const n=tw(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}TO.peek=r$;function TO(e,t,n,r){const a=cw(n),i=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let o,f;if(CO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let v=l.move("<");return v+=l.move(n.containerPhrasing(e,{before:v,after:">",...l.current()})),v+=l.move(">"),o(),n.stack=d,v}o=n.enter("link"),f=n.enter("label");let c=l.move("[");return c+=l.move(n.containerPhrasing(e,{before:c,after:"](",...l.current()})),c+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(f=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(n.safe(e.title,{before:c,after:a,...l.current()})),c+=l.move(a),f()),c+=l.move(")"),o(),c}function r$(e,t,n){return CO(e,n)?"<":"["}kO.peek=a$;function kO(e,t,n,r){const a=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("[");const c=n.containerPhrasing(e,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const d=n.stack;n.stack=[],l=n.enter("reference");const v=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=d,i(),a==="full"||!c||c!==v?f+=o.move(v+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function a$(){return"["}function fw(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function i$(e){const t=fw(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function s$(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function NO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function l$(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?s$(n):fw(n);const o=e.ordered?l==="."?")":".":i$(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),NO(n)===l&&d){let v=-1;for(;++v<e.children.length;){const m=e.children[v];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=o),n.bulletCurrent=l;const c=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=i,a(),c}function o$(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function u$(e,t,n,r){const a=o$(n);let i=n.bulletCurrent||fw(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let l=i.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(l-i.length)),o.shift(l);const f=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),d);return f(),c;function d(v,m,y){return m?(y?"":" ".repeat(l))+v:(y?i:i+" ".repeat(l-i.length))+v}}function c$(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),a(),l}const f$=Vp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function d$(e,t,n,r){return(e.children.some(function(l){return f$(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function h$(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}AO.peek=v$;function AO(e,t,n,r){const a=h$(n),i=n.enter("strong"),l=n.createTracker(r),o=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:o,...l.current()}));const c=f.charCodeAt(0),d=Jv(r.before.charCodeAt(r.before.length-1),c,a);d.inside&&(f=Gf(c)+f.slice(1));const v=f.charCodeAt(f.length-1),m=Jv(r.after.charCodeAt(0),v,a);m.inside&&(f=f.slice(0,-1)+Gf(v));const y=l.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+f+y}function v$(e,t,n){return n.options.strong||"*"}function p$(e,t,n,r){return n.safe(e.value,r)}function m$(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function g$(e,t,n){const r=(NO(n)+(n.options.ruleSpaces?" ":"")).repeat(m$(n));return n.options.ruleSpaces?r.slice(0,-1):r}const RO={blockquote:FG,break:Sk,code:$G,definition:YG,emphasis:xO,hardBreak:Sk,heading:ZG,html:bO,image:wO,imageReference:SO,inlineCode:EO,link:TO,linkReference:kO,list:l$,listItem:u$,paragraph:c$,root:d$,strong:AO,text:p$,thematicBreak:g$};function y$(){return{enter:{table:x$,tableData:Ek,tableHeader:Ek,tableRow:w$},exit:{codeText:S$,table:b$,tableData:nx,tableHeader:nx,tableRow:nx}}}function x$(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function b$(e){this.exit(e),this.data.inTable=void 0}function w$(e){this.enter({type:"tableRow",children:[]},e)}function nx(e){this.exit(e)}function Ek(e){this.enter({type:"tableCell",children:[]},e)}function S$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,E$));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function E$(e,t){return t==="|"?t:e}function C$(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
456
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:l,tableCell:f,tableRow:o}};function l(y,x,w,S){return c(d(y,w,S),y.align)}function o(y,x,w,S){const b=v(y,w,S),C=c([b]);return C.slice(0,C.indexOf(`
|
|
457
|
+
`))}function f(y,x,w,S){const b=w.enter("tableCell"),C=w.enter("phrasing"),T=w.containerPhrasing(y,{...S,before:i,after:i});return C(),b(),T}function c(y,x){return zG(y,{align:x,alignDelimiters:r,padding:n,stringLength:a})}function d(y,x,w){const S=y.children;let b=-1;const C=[],T=x.enter("table");for(;++b<S.length;)C[b]=v(S[b],x,w);return T(),C}function v(y,x,w){const S=y.children;let b=-1;const C=[],T=x.enter("tableRow");for(;++b<S.length;)C[b]=f(S[b],y,x,w);return T(),C}function m(y,x,w){let S=RO.inlineCode(y,x,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function T$(){return{exit:{taskListCheckValueChecked:Ck,taskListCheckValueUnchecked:Ck,paragraph:N$}}}function k$(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:A$}}}function Ck(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function N$(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let i=-1,l;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){l=o;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function A$(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(l);let f=RO.listItem(e,t,n,{...r,...o.current()});return i&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),f;function c(d){return d+l}}function R$(){return[lG(),AG(),MG(),y$(),T$()]}function j$(e){return{extensions:[oG(),RG(e),OG(),C$(e),k$()]}}const D$={tokenize:P$,partial:!0},jO={tokenize:z$,partial:!0},DO={tokenize:I$,partial:!0},MO={tokenize:F$,partial:!0},M$={tokenize:q$,partial:!0},OO={name:"wwwAutolink",tokenize:_$,previous:_O},LO={name:"protocolAutolink",tokenize:B$,previous:BO},es={name:"emailAutolink",tokenize:L$,previous:PO},di={};function O$(){return{text:di}}let ql=48;for(;ql<123;)di[ql]=es,ql++,ql===58?ql=65:ql===91&&(ql=97);di[43]=es;di[45]=es;di[46]=es;di[95]=es;di[72]=[es,LO];di[104]=[es,LO];di[87]=[es,OO];di[119]=[es,OO];function L$(e,t,n){const r=this;let a,i;return l;function l(v){return!Mb(v)||!PO.call(r,r.previous)||dw(r.events)?n(v):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(v))}function o(v){return Mb(v)?(e.consume(v),o):v===64?(e.consume(v),f):n(v)}function f(v){return v===46?e.check(M$,d,c)(v):v===45||v===95||hr(v)?(i=!0,e.consume(v),f):d(v)}function c(v){return e.consume(v),a=!0,f}function d(v){return i&&a&&Er(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(v)):n(v)}}function _$(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!_O.call(r,r.previous)||dw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(D$,e.attempt(jO,e.attempt(DO,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function B$(e,t,n){const r=this;let a="",i=!1;return l;function l(v){return(v===72||v===104)&&BO.call(r,r.previous)&&!dw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(v),e.consume(v),o):n(v)}function o(v){if(Er(v)&&a.length<5)return a+=String.fromCodePoint(v),e.consume(v),o;if(v===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(v),f}return n(v)}function f(v){return v===47?(e.consume(v),i?c:(i=!0,f)):n(v)}function c(v){return v===null||Qv(v)||Kt(v)||po(v)||Fp(v)?n(v):e.attempt(jO,e.attempt(DO,d),n)(v)}function d(v){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(v)}}function P$(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function z$(e,t,n){let r,a,i;return l;function l(c){return c===46||c===95?e.check(MO,f,o)(c):c===null||Kt(c)||po(c)||c!==45&&Fp(c)?f(c):(i=!0,e.consume(c),l)}function o(c){return c===95?r=!0:(a=r,r=void 0),e.consume(c),l}function f(c){return a||r||!i?n(c):t(c)}}function I$(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?i(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(MO,t,i)(l):l===null||Kt(l)||po(l)?t(l):(e.consume(l),a)}function i(l){return l===41&&r++,e.consume(l),a}}function F$(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),i):o===93?(e.consume(o),a):o===60||o===null||Kt(o)||po(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||Kt(o)||po(o)?t(o):r(o)}function i(o){return Er(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):Er(o)?(e.consume(o),l):n(o)}}function q$(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return hr(i)?n(i):t(i)}}function _O(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Kt(e)}function BO(e){return!Er(e)}function PO(e){return!(e===47||Mb(e))}function Mb(e){return e===43||e===45||e===46||e===95||hr(e)}function dw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const U$={tokenize:Q$,partial:!0};function V$(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:K$,continuation:{tokenize:Y$},exit:X$}},text:{91:{name:"gfmFootnoteCall",tokenize:$$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:H$,resolveTo:G$}}}}function H$(e,t,n){const r=this;let a=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return o;function o(f){if(!l||!l._balanced)return n(f);const c=Oa(r.sliceSerialize({start:l.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function G$(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function $$(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return o;function o(v){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),f}function f(v){return v!==94?n(v):(e.enter("gfmFootnoteCallMarker"),e.consume(v),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(v){if(i>999||v===93&&!l||v===null||v===91||Kt(v))return n(v);if(v===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(Oa(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(v)}return Kt(v)||(l=!0),i++,e.consume(v),v===92?d:c}function d(v){return v===91||v===92||v===93?(e.consume(v),i++,c):c(v)}}function K$(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,o;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(x)}function d(x){if(l>999||x===93&&!o||x===null||x===91||Kt(x))return n(x);if(x===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return i=Oa(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Kt(x)||(o=!0),l++,e.consume(x),x===92?v:d}function v(x){return x===91||x===92||x===93?(e.consume(x),l++,d):d(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(i)||a.push(i),At(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function Y$(e,t,n){return e.check(gd,t,e.attempt(U$,t,n))}function X$(e){e.exit("gfmFootnoteDefinition")}function Q$(e,t,n){const r=this;return At(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function W$(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,o){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let c=f;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[f][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[f][1].end)},v={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[f][1].start)},m=[["enter",d,o],["enter",l[c][1],o],["exit",l[c][1],o],["enter",v,o]],y=o.parser.constructs.insideSpan.null;y&&ta(m,m.length,0,qp(y,l.slice(c+1,f),o)),ta(m,m.length,0,[["exit",v,o],["enter",l[f][1],o],["exit",l[f][1],o],["exit",d,o]]),ta(l,c-1,f-c+3,m),f=c+m.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function i(l,o,f){const c=this.previous,d=this.events;let v=0;return m;function m(x){return c===126&&d[d.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const w=Xu(c);if(x===126)return v>1?f(x):(l.consume(x),v++,y);if(v<2&&!n)return f(x);const S=l.exit("strikethroughSequenceTemporary"),b=Xu(x);return S._open=!b||b===2&&!!w,S._close=!w||w===2&&!!b,o(x)}}}class Z${constructor(){this.map=[]}add(t,n,r){J$(this,t,n,r)}consume(t){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const i of a)t.push(i);a=r.pop()}this.map.length=0}}function J$(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function eK(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function tK(){return{flow:{null:{name:"table",tokenize:nK,resolveAll:rK}}}}function nK(e,t,n){const r=this;let a=0,i=0,l;return o;function o(M){let z=r.events.length-1;for(;z>-1;){const I=r.events[z][1].type;if(I==="lineEnding"||I==="linePrefix")z--;else break}const P=z>-1?r.events[z][1].type:null,G=P==="tableHead"||P==="tableRow"?R:f;return G===R&&r.parser.lazy[r.now().line]?n(M):G(M)}function f(M){return e.enter("tableHead"),e.enter("tableRow"),c(M)}function c(M){return M===124||(l=!0,i+=1),d(M)}function d(M){return M===null?n(M):nt(M)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),y):n(M):Et(M)?At(e,d,"whitespace")(M):(i+=1,l&&(l=!1,a+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,d):(e.enter("data"),v(M)))}function v(M){return M===null||M===124||Kt(M)?(e.exit("data"),d(M)):(e.consume(M),M===92?m:v)}function m(M){return M===92||M===124?(e.consume(M),v):v(M)}function y(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,Et(M)?At(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?S(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),w):A(M)}function w(M){return Et(M)?At(e,S,"whitespace")(M):S(M)}function S(M){return M===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),b):M===45?(i+=1,b(M)):M===null||nt(M)?N(M):A(M)}function b(M){return M===45?(e.enter("tableDelimiterFiller"),C(M)):A(M)}function C(M){return M===45?(e.consume(M),C):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(M))}function T(M){return Et(M)?At(e,N,"whitespace")(M):N(M)}function N(M){return M===124?x(M):M===null||nt(M)?!l||a!==i?A(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):A(M)}function A(M){return n(M)}function R(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||nt(M)?(e.exit("tableRow"),t(M)):Et(M)?At(e,D,"whitespace")(M):(e.enter("data"),L(M))}function L(M){return M===null||M===124||Kt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?_:L)}function _(M){return M===92||M===124?(e.consume(M),L):L(M)}}function rK(e,t){let n=-1,r=!0,a=0,i=[0,0,0,0],l=[0,0,0,0],o=!1,f=0,c,d,v;const m=new Z$;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(o=!1,f!==0&&(Tk(m,t,f,c,d),d=void 0,f=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,v=void 0,i=[0,0,0,0],l=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",d,t]])),a=x.type==="tableDelimiterRow"?2:d?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],v=rv(m,t,i,a,void 0,v),i=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],v=rv(m,t,i,a,void 0,v)),i=l,l=[i[1],n,0,0])):x.type==="tableHead"?(o=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,i[1]!==0?(l[0]=l[1],v=rv(m,t,i,a,n,v)):l[1]!==0&&(v=rv(m,t,l,a,n,v)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Tk(m,t,f,c,d),m.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=eK(t.events,n))}return e}function rv(e,t,n,r,a,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},bu(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const f=bu(t.events,n[1]);if(i={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=bu(t.events,n[2]),d=bu(t.events,n[3]),v={type:o,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",v,t]]),r!==2){const m=t.events[n[2]],y=t.events[n[3]];if(m[1].end=Object.assign({},y[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,w=n[3]-n[2]-1;e.add(x,w,[])}}e.add(n[3]+1,0,[["exit",v,t]])}return a!==void 0&&(i.end=Object.assign({},bu(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function Tk(e,t,n,r,a){const i=[],l=bu(t.events,n);a&&(a.end=Object.assign({},l),i.push(["exit",a,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function bu(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const aK={name:"tasklistCheck",tokenize:sK};function iK(){return{text:{91:aK}}}function sK(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),i)}function i(f){return Kt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(f)}function o(f){return nt(f)?t(f):Et(f)?e.check({tokenize:lK},t,n)(f):n(f)}}function lK(e,t,n){return At(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function oK(e){return YM([O$(),V$(),W$(e),tK(),iK()])}const uK={};function cK(e){const t=this,n=e||uK,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(oK(n)),i.push(R$()),l.push(j$(n))}function ui({content:e,className:t}){return p.jsx("div",{className:Ae("prose-myco",t),children:p.jsx(W7,{remarkPlugins:[cK],children:e})})}function fK({images:e,index:t,onClose:n,onNavigate:r}){const a=e[t],i=t>0,l=t<e.length-1;j.useEffect(()=>{const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[]);const o=j.useCallback(f=>{f.key==="Escape"&&n(),f.key==="ArrowLeft"&&i&&r(t-1),f.key==="ArrowRight"&&l&&r(t+1)},[n,r,t,i,l]);return j.useEffect(()=>(document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)),[o]),a?p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-surface-dim/90 backdrop-blur-sm",onClick:n,children:[p.jsx("button",{onClick:n,className:"absolute top-4 right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:p.jsx(rc,{className:"h-5 w-5"})}),e.length>1&&p.jsxs("span",{className:"absolute top-4 left-1/2 -translate-x-1/2 font-mono text-xs text-on-surface/60 z-10",children:[t+1," / ",e.length]}),i&&p.jsx("button",{onClick:f=>{f.stopPropagation(),r(t-1)},className:"absolute left-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:p.jsx(h1,{className:"h-6 w-6"})}),l&&p.jsx("button",{onClick:f=>{f.stopPropagation(),r(t+1)},className:"absolute right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:p.jsx(Ea,{className:"h-6 w-6"})}),p.jsx("img",{src:a.src,alt:a.alt,className:"max-h-[90vh] max-w-[90vw] rounded-lg shadow-ambient object-contain",onClick:f=>f.stopPropagation()})]}):null}const dK=3;function hK({activity:e}){const[t,n]=j.useState(!1),r=e.success===1,a=!!(e.tool_input||e.tool_output_summary||e.error_message);return p.jsxs("div",{className:Ae("border-l-2 transition-colors",t?"border-l-primary/30":"border-transparent hover:border-l-primary/20"),children:[p.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-container/30 transition-all",onClick:()=>n(i=>!i),"aria-expanded":t,children:[t?p.jsx(_a,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):p.jsx(Ea,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),p.jsx("span",{className:"font-mono text-xs font-medium text-on-surface",children:e.tool_name}),e.file_path&&p.jsx("span",{className:"truncate font-sans text-xs text-on-surface-variant flex-1",children:e.file_path}),p.jsx("span",{className:"shrink-0 ml-auto"}),p.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:mF(e.duration_ms)}),r?p.jsx(wj,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):p.jsx(yp,{className:"h-3.5 w-3.5 shrink-0 text-tertiary"})]}),p.jsx("div",{className:"grid transition-[grid-template-rows] duration-150 ease-out",style:{gridTemplateRows:t?"1fr":"0fr"},children:p.jsx("div",{className:"overflow-hidden",children:p.jsxs("div",{className:"px-8 pb-3 space-y-2",children:[!a&&p.jsx("p",{className:"font-sans text-xs text-on-surface-variant/60 italic py-1",children:"No input/output details captured"}),e.tool_input&&p.jsxs("div",{children:[p.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Input"}),p.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_input})]}),e.tool_output_summary&&p.jsxs("div",{children:[p.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Output"}),p.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_output_summary})]}),e.error_message&&p.jsxs("div",{children:[p.jsx("div",{className:"font-sans text-xs font-medium text-tertiary mb-1",children:"Error"}),p.jsx("pre",{className:"font-mono text-xs bg-tertiary/10 text-tertiary rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all",children:e.error_message})]})]})})})]})}function vK({batchId:e,activityCount:t}){const[n,r]=j.useState(!1),{data:a,isLoading:i}=T8(n?e:void 0);if(t===0)return null;const l=a??[];return p.jsxs("div",{className:"border-t border-[var(--ghost-border)]",children:[p.jsxs("button",{type:"button",className:Ae("w-full flex items-center gap-2 px-4 py-2 text-left transition-colors","hover:bg-surface-container/30"),onClick:()=>r(o=>!o),children:[n?p.jsx(_a,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):p.jsx(Ea,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),p.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Tool Calls"}),p.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:t})]}),p.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:n?"1fr":"0fr"},children:p.jsxs("div",{className:"overflow-hidden",children:[i&&p.jsx("div",{className:"px-3 py-2 space-y-1",children:Array.from({length:Math.min(t,dK)}).map((o,f)=>p.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container-high w-full"},f))}),!i&&l.length>0&&p.jsx("div",{className:"space-y-0",children:l.map(o=>p.jsx(hK,{activity:o},o.id))})]})})]})}const Ob=120,pK="h-7 w-7",mK=3;function gK(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function yK(e){return e?e.length>Ob?e.slice(0,Ob)+"…":e:"(no prompt)"}function xK({batch:e,batchAttachments:t,defaultOpen:n=!1,promptIndex:r,isLast:a}){const[i,l]=j.useState(n),[o,f]=j.useState(null);return p.jsxs("div",{className:"relative flex gap-4",children:[p.jsxs("div",{className:"relative flex flex-col items-center shrink-0",style:{width:"28px"},children:[r>0&&p.jsx("div",{className:"absolute top-0 w-px bg-outline-variant/40",style:{height:"14px"}}),p.jsx("div",{className:Ae(pK,"rounded-full flex items-center justify-center shrink-0 text-[10px] font-mono font-bold transition-colors z-10",i?"bg-primary text-on-primary":"bg-surface-container-high text-on-surface-variant border border-outline-variant/40"),children:r+1}),!a&&p.jsx("div",{className:"flex-1 w-px bg-outline-variant/40"})]}),p.jsxs(st,{level:"low",className:"flex-1 overflow-hidden rounded-md max-w-full border border-outline-variant/10 mb-2",children:[p.jsxs("button",{type:"button",className:Ae("flex w-full items-start gap-3 px-4 py-3 text-left transition-colors overflow-hidden","hover:bg-surface-container/40",i&&"bg-surface-container/20"),onClick:()=>l(c=>!c),"aria-expanded":i,children:[i?p.jsx(_a,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}):p.jsx(Ea,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}),p.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[p.jsxs("div",{className:"flex items-baseline justify-between gap-2 mb-0.5",children:[p.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0",children:"Prompt"}),e.activity_count>0&&p.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/70 shrink-0",children:[e.activity_count," tool call",e.activity_count!==1?"s":""]}),e.started_at&&p.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:gK(e.started_at)})]}),p.jsx("p",{className:"font-sans text-sm text-on-surface truncate",children:i?e.user_prompt??"(no prompt)":yK(e.user_prompt)})]})]}),p.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:i?"1fr":"0fr"},children:p.jsxs("div",{className:"overflow-hidden",children:[p.jsxs("div",{className:"px-4 pt-0 pb-3 overflow-hidden",children:[e.user_prompt&&e.user_prompt.length>Ob&&p.jsx(ui,{content:e.user_prompt}),t.length>0&&p.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:t.map((c,d)=>p.jsx("button",{type:"button",className:"rounded-md overflow-hidden hover:ring-2 hover:ring-primary/40 transition-all",onClick:()=>f(d),children:p.jsx("img",{src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??"",className:"max-w-[200px] max-h-[140px] object-cover rounded-md",loading:"lazy"})},c.id))}),o!==null&&p.jsx(fK,{images:t.map(c=>({src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??""})),index:o,onNavigate:f,onClose:()=>f(null)})]}),e.activity_count>0&&p.jsx(vK,{batchId:e.id,activityCount:e.activity_count}),e.response_summary&&p.jsx("div",{className:"border-t border-[var(--ghost-border)] overflow-hidden",children:p.jsxs("div",{className:"flex gap-3 px-4 py-3",children:[p.jsx("div",{className:"w-0.5 shrink-0 rounded-full bg-primary/30"}),p.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[p.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[p.jsx(dd,{className:"h-3 w-3 text-primary/60"}),p.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Response"})]}),p.jsx(ui,{content:e.response_summary})]})]})})]})})]})]})}function bK({sessionId:e}){const{data:t,isLoading:n}=C8(e),{data:r}=k8(e),a=r??[],{byBatchId:i,byTurnNumber:l}=j.useMemo(()=>{var d;const f=new Map,c=new Map;for(const v of a){if(v.prompt_batch_id!=null){const y=f.get(v.prompt_batch_id)??[];y.push(v),f.set(v.prompt_batch_id,y)}const m=(d=v.file_path)==null?void 0:d.match(/-t(\d+)-/);if(m!=null&&m[1]){const y=parseInt(m[1]),x=c.get(y)??[];x.push(v),c.set(y,x)}}return{byBatchId:f,byTurnNumber:c}},[a]);if(n)return p.jsx("div",{className:"space-y-3 pl-11",children:Array.from({length:mK}).map((f,c)=>p.jsx("div",{className:"h-16 animate-pulse rounded-md bg-surface-container-low"},c))});const o=[...t??[]].sort((f,c)=>(f.started_at??0)-(c.started_at??0));return o.length===0?p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[p.jsx(xp,{className:"h-8 w-8 opacity-30"}),p.jsx("span",{className:"font-sans text-sm",children:"No prompts recorded"})]}):p.jsx("div",{children:o.map((f,c)=>{const d=i.get(f.id)??(f.prompt_number!==null?l.get(f.prompt_number)??[]:[]);return p.jsx(xK,{batch:f,batchAttachments:d,defaultOpen:c===0,promptIndex:c,isLast:c===o.length-1},f.id)})})}const wK="▲",SK="▼";function EK(e){const t=(e.match(/- \[x\]/gi)??[]).length,n=(e.match(/- \[ \]/g)??[]).length;return{total:t+n,checked:t}}const CK={active:"bg-green-500/10 text-green-500",completed:"bg-blue-500/10 text-blue-500"},TK="bg-muted text-muted-foreground";function kK({status:e}){const t=Ae("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",CK[e]??TK);return p.jsx("span",{className:t,children:e})}function NK({plan:e}){const[t,n]=j.useState(!1),r=j.useMemo(()=>e.content?EK(e.content):null,[e.content]),a=r!==null&&r.total>0,i=a?Math.round(r.checked/r.total*100):0;return p.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 overflow-hidden",children:[p.jsxs("div",{className:"flex items-start gap-3 p-4",children:[p.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[p.jsx(kK,{status:e.status}),e.title&&p.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.title})]}),e.source_path&&p.jsx("p",{className:"font-mono text-xs text-muted-foreground truncate",title:e.source_path,children:e.source_path}),p.jsxs("div",{className:"flex gap-3 font-sans text-xs text-muted-foreground",children:[p.jsxs("span",{children:["Created ",oi(e.created_at)]}),e.updated_at&&e.updated_at!==e.created_at&&p.jsxs("span",{title:fb(e.updated_at),children:["Updated ",oi(e.updated_at)]})]}),a&&p.jsxs("div",{className:"space-y-1 pt-0.5",children:[p.jsxs("div",{className:"flex items-center justify-between font-sans text-xs text-muted-foreground",children:[p.jsxs("span",{children:[r.checked,"/",r.total," items"]}),p.jsxs("span",{children:[i,"%"]})]}),p.jsx("div",{className:"h-1.5 rounded-full bg-border overflow-hidden",children:p.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${i}%`}})})]})]}),e.content&&p.jsx("button",{onClick:()=>n(l=>!l),className:"shrink-0 mt-0.5 text-xs text-muted-foreground hover:text-on-surface transition-colors cursor-pointer","aria-label":t?"Collapse plan":"Expand plan",children:t?wK:SK})]}),t&&e.content&&p.jsx("div",{className:"border-t border-border px-4 py-3",children:p.jsx(ui,{content:e.content,className:"text-sm"})})]})}function AK({sessionId:e}){const{data:t,isLoading:n,isError:r}=DM(e);return n?p.jsx("div",{className:"flex h-32 items-center justify-center",children:p.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Loading plans..."})}):r?p.jsx("div",{className:"flex h-32 items-center justify-center",children:p.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Failed to load plans."})}):!t||t.length===0?p.jsx("div",{className:"flex h-32 items-center justify-center rounded-lg border border-border bg-muted/30",children:p.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"No plans captured for this session"})}):p.jsx("div",{className:"space-y-3",children:t.map(a=>p.jsx(NK,{plan:a},a.id))})}const rx=8;function RK(e){return e===null?"—":D1(new Date(e*1e3).toISOString())}const jK=1500;function gf({label:e,value:t,mono:n=!0,copyable:r=!1,code:a=!1}){const[i,l]=j.useState(!1),o=j.useCallback(()=>{navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),jK)},[t]),f=a?p.jsx("code",{className:"text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5",children:t}):p.jsx("span",{className:Ae("text-xs text-on-surface",n&&"font-mono"),children:t});return p.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0",children:[p.jsx("span",{className:"shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant",children:e}),r?p.jsxs("button",{onClick:o,title:"Click to copy",className:"flex items-center gap-1.5 min-w-0 hover:text-primary transition-colors cursor-pointer",children:[f,i&&p.jsx(gp,{className:"h-3 w-3 text-primary shrink-0"})]}):p.jsx("span",{className:"min-w-0",children:f})]})}function kk({label:e,value:t,activeTab:n,onClick:r}){return p.jsx("button",{onClick:()=>r(t),className:Ae("px-4 py-2 font-sans text-sm font-medium transition-colors cursor-pointer",n===t?"border-b-2 border-primary text-on-surface":"text-muted-foreground hover:text-on-surface"),children:e})}function DK({id:e}){const t=Wi(),{data:n,isLoading:r,isError:a,error:i}=E8(e),{data:l}=I8(),o=_1(),[f,c]=j.useState("idle"),[d,v]=j.useState(!1),[m,y]=j.useState("conversation"),x=RM(),{data:w}=jM(d?e:null),{data:S}=DM(e);if(r)return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),p.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),p.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[p.jsx(Qn,{className:"h-5 w-5 animate-spin"}),p.jsx("span",{className:"font-sans text-sm",children:"Loading session..."})]})]});if(a||!n)return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),p.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Session not found"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:i instanceof Error?i.message:"Unknown error"})]})]});const b=l?F8(l.symbionts,n.agent,e):null;return p.jsxs("div",{className:"p-6 space-y-6 overflow-hidden",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),p.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[p.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:n.title??n.id.slice(0,rx)}),p.jsx(OM,{status:n.status}),n.agent&&p.jsx(Ln,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:n.agent}),p.jsxs(Ke,{variant:"secondary",size:"sm",className:"ml-auto gap-2",disabled:f==="running",onClick:async()=>{c("running");try{await o.mutateAsync({task:"title-summary",instruction:`Process session ${e} only`}),c("done")}catch{c("error")}},children:[f==="running"?p.jsx(Qn,{className:"h-4 w-4 animate-spin"}):p.jsx(kj,{className:"h-4 w-4"}),f==="done"?"Summary Requested":"Generate Summary"]}),p.jsxs(Ke,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>v(!0),children:[p.jsx(qf,{className:"h-4 w-4"}),"Delete"]})]}),p.jsxs("div",{className:"flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant",children:[n.user&&p.jsxs("span",{children:["User: ",p.jsx("span",{className:"text-on-surface",children:n.user})]}),n.branch&&p.jsxs("span",{children:["Branch: ",p.jsx("span",{className:"font-mono text-on-surface",children:n.branch})]}),p.jsxs("span",{children:["Started ",RK(n.started_at)]}),n.ended_at&&p.jsxs("span",{children:["Duration: ",Dp(n.started_at,n.ended_at)]})]})]}),p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(yn,{label:"Prompts",value:String(n.prompt_count),accent:"sage"}),p.jsx(yn,{label:"Tool Calls",value:String(n.tool_count),accent:"sage"}),p.jsx(yn,{label:"Plans",value:String((S==null?void 0:S.length)??0),accent:"outline"})]}),p.jsxs(st,{level:"low",className:"p-4 overflow-hidden",children:[p.jsx(Zt,{className:"mb-3",children:"Metadata"}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6",children:[p.jsx(gf,{label:"Session ID",value:e,copyable:!0}),b&&p.jsx(gf,{label:"Resume",value:b,copyable:!0,code:!0}),n.parent_session_id&&p.jsx(gf,{label:"Parent",value:n.parent_session_id}),n.parent_session_reason&&p.jsx(gf,{label:"Reason",value:n.parent_session_reason,mono:!1}),n.project_root&&p.jsx(gf,{label:"Project",value:n.project_root})]})]}),n.summary&&p.jsxs(st,{level:"low",className:"p-4 overflow-hidden",children:[p.jsx(Zt,{className:"mb-2",children:"Summary"}),p.jsx("p",{className:"font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words",children:n.summary})]}),p.jsxs("div",{className:"min-w-0 overflow-hidden",children:[p.jsxs("div",{className:"flex gap-0 border-b border-border mb-4",children:[p.jsx(kk,{label:"Conversation",value:"conversation",activeTab:m,onClick:y}),p.jsx(kk,{label:"Plans",value:"plans",activeTab:m,onClick:y})]}),m==="conversation"&&p.jsx(bK,{sessionId:e}),m==="plans"&&p.jsx(AK,{sessionId:e})]}),p.jsx(MD,{open:d,onOpenChange:v,title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:p.jsx(qf,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"ID",value:n.id.slice(0,rx)},{label:"Title",value:n.title||n.id.slice(0,rx)}]:[],impact:w?[{label:"Prompts",value:w.promptCount},{label:"Spores",value:w.sporeCount},{label:"Attachments",value:w.attachmentCount},{label:"Graph Edges",value:w.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:()=>{x.mutate(n.id,{onSuccess:()=>{v(!1),t("/sessions")}})},isPending:x.isPending})]})}function Nk(){const{id:e}=kB();return e?p.jsx(DK,{id:e}):p.jsx("div",{className:"p-6",children:p.jsx(P8,{})})}function Lb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MK(e){if(Array.isArray(e))return e}function OK(e){if(Array.isArray(e))return Lb(e)}function yl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LK(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,IO(r.key),r)}}function xl(e,t,n){return t&&LK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=hw(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
458
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,l=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return l=f.done,f},e:function(f){o=!0,i=f},f:function(){try{l||n.return==null||n.return()}finally{if(o)throw i}}}}function zO(e,t,n){return(t=IO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _K(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,l,o=[],f=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=i.call(n)).done)&&(o.push(r.value),o.length!==t);f=!0);}catch(d){c=!0,a=d}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw a}}return o}}function PK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
459
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
460
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function On(e,t){return MK(e)||BK(e,t)||hw(e,t)||PK()}function ep(e){return OK(e)||_K(e)||hw(e)||zK()}function IK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function IO(e){var t=IK(e,"string");return typeof t=="symbol"?t:t+""}function Fn(e){"@babel/helpers - typeof";return Fn=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},Fn(e)}function hw(e,t){if(e){if(typeof e=="string")return Lb(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lb(e,t):void 0}}var Pn=typeof window>"u"?null:window,Ak=Pn?Pn.navigator:null;Pn&&Pn.document;var FK=Fn(""),FO=Fn({}),qK=Fn(function(){}),UK=typeof HTMLElement>"u"?"undefined":Fn(HTMLElement),xd=function(t){return t&&t.instanceString&&hn(t.instanceString)?t.instanceString():null},et=function(t){return t!=null&&Fn(t)==FK},hn=function(t){return t!=null&&Fn(t)===qK},$t=function(t){return!na(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)},jt=function(t){return t!=null&&Fn(t)===FO&&!$t(t)&&t.constructor===Object},VK=function(t){return t!=null&&Fn(t)===FO},Re=function(t){return t!=null&&Fn(t)===Fn(1)&&!isNaN(t)},HK=function(t){return Re(t)&&Math.floor(t)===t},tp=function(t){if(UK!=="undefined")return t!=null&&t instanceof HTMLElement},na=function(t){return bd(t)||qO(t)},bd=function(t){return xd(t)==="collection"&&t._private.single},qO=function(t){return xd(t)==="collection"&&!t._private.single},vw=function(t){return xd(t)==="core"},UO=function(t){return xd(t)==="stylesheet"},GK=function(t){return xd(t)==="event"},ol=function(t){return t==null?!0:!!(t===""||t.match(/^\s+$/))},$K=function(t){return typeof HTMLElement>"u"?!1:t instanceof HTMLElement},KK=function(t){return jt(t)&&Re(t.x1)&&Re(t.x2)&&Re(t.y1)&&Re(t.y2)},YK=function(t){return VK(t)&&hn(t.then)},XK=function(){return Ak&&Ak.userAgent.match(/msie|trident|edge/i)},Qu=function(t,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],l=0;l<arguments.length;l++)i.push(arguments[l]);return i.join("$")});var r=function(){var i=this,l=arguments,o,f=n.apply(i,l),c=r.cache;return(o=c[f])||(o=c[f]=t.apply(i,l)),o};return r.cache={},r},pw=Qu(function(e){return e.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}),Gp=Qu(function(e){return e.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}),VO=Qu(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),Rk=function(t){return ol(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},Xs=function(t,n){return t.slice(-1*n.length)===n},In="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",QK="rgb[a]?\\(("+In+"[%]?)\\s*,\\s*("+In+"[%]?)\\s*,\\s*("+In+"[%]?)(?:\\s*,\\s*("+In+"))?\\)",WK="rgb[a]?\\((?:"+In+"[%]?)\\s*,\\s*(?:"+In+"[%]?)\\s*,\\s*(?:"+In+"[%]?)(?:\\s*,\\s*(?:"+In+"))?\\)",ZK="hsl[a]?\\(("+In+")\\s*,\\s*("+In+"[%])\\s*,\\s*("+In+"[%])(?:\\s*,\\s*("+In+"))?\\)",JK="hsl[a]?\\((?:"+In+")\\s*,\\s*(?:"+In+"[%])\\s*,\\s*(?:"+In+"[%])(?:\\s*,\\s*(?:"+In+"))?\\)",eY="\\#[0-9a-fA-F]{3}",tY="\\#[0-9a-fA-F]{6}",HO=function(t,n){return t<n?-1:t>n?1:0},nY=function(t,n){return-1*HO(t,n)},rt=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var l=a[i];e[l]=r[l]}}return e},rY=function(t){if(!(!(t.length===4||t.length===7)||t[0]!=="#")){var n=t.length===4,r,a,i,l=16;return n?(r=parseInt(t[1]+t[1],l),a=parseInt(t[2]+t[2],l),i=parseInt(t[3]+t[3],l)):(r=parseInt(t[1]+t[2],l),a=parseInt(t[3]+t[4],l),i=parseInt(t[5]+t[6],l)),[r,a,i]}},aY=function(t){var n,r,a,i,l,o,f,c;function d(x,w,S){return S<0&&(S+=1),S>1&&(S-=1),S<1/6?x+(w-x)*6*S:S<1/2?w:S<2/3?x+(w-x)*(2/3-S)*6:x}var v=new RegExp("^"+ZK+"$").exec(t);if(v){if(r=parseInt(v[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(v[2]),a<0||a>100||(a=a/100,i=parseFloat(v[3]),i<0||i>100)||(i=i/100,l=v[4],l!==void 0&&(l=parseFloat(l),l<0||l>1)))return;if(a===0)o=f=c=Math.round(i*255);else{var m=i<.5?i*(1+a):i+a-i*a,y=2*i-m;o=Math.round(255*d(y,m,r+1/3)),f=Math.round(255*d(y,m,r)),c=Math.round(255*d(y,m,r-1/3))}n=[o,f,c,l]}return n},iY=function(t){var n,r=new RegExp("^"+QK+"$").exec(t);if(r){n=[];for(var a=[],i=1;i<=3;i++){var l=r[i];if(l[l.length-1]==="%"&&(a[i]=!0),l=parseFloat(l),a[i]&&(l=l/100*255),l<0||l>255)return;n.push(Math.floor(l))}var o=a[1]||a[2]||a[3],f=a[1]&&a[2]&&a[3];if(o&&!f)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},sY=function(t){return lY[t.toLowerCase()]},GO=function(t){return($t(t)?t:null)||sY(t)||rY(t)||iY(t)||aY(t)},lY={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},$O=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(jt(l))throw Error("Tried to set map with object key");i<r.length-1?(n[l]==null&&(n[l]={}),n=n[l]):n[l]=t.value}},KO=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(jt(l))throw Error("Tried to get map with object key");if(n=n[l],n==null)return n}return n},av=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ax,jk;function Sd(){if(jk)return ax;jk=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return ax=e,ax}var ix,Dk;function oY(){if(Dk)return ix;Dk=1;var e=typeof av=="object"&&av&&av.Object===Object&&av;return ix=e,ix}var sx,Mk;function $p(){if(Mk)return sx;Mk=1;var e=oY(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return sx=n,sx}var lx,Ok;function uY(){if(Ok)return lx;Ok=1;var e=$p(),t=function(){return e.Date.now()};return lx=t,lx}var ox,Lk;function cY(){if(Lk)return ox;Lk=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return ox=t,ox}var ux,_k;function fY(){if(_k)return ux;_k=1;var e=cY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return ux=n,ux}var cx,Bk;function mw(){if(Bk)return cx;Bk=1;var e=$p(),t=e.Symbol;return cx=t,cx}var fx,Pk;function dY(){if(Pk)return fx;Pk=1;var e=mw(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(l){var o=n.call(l,a),f=l[a];try{l[a]=void 0;var c=!0}catch{}var d=r.call(l);return c&&(o?l[a]=f:delete l[a]),d}return fx=i,fx}var dx,zk;function hY(){if(zk)return dx;zk=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return dx=n,dx}var hx,Ik;function YO(){if(Ik)return hx;Ik=1;var e=mw(),t=dY(),n=hY(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function l(o){return o==null?o===void 0?a:r:i&&i in Object(o)?t(o):n(o)}return hx=l,hx}var vx,Fk;function vY(){if(Fk)return vx;Fk=1;function e(t){return t!=null&&typeof t=="object"}return vx=e,vx}var px,qk;function Ed(){if(qk)return px;qk=1;var e=YO(),t=vY(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return px=r,px}var mx,Uk;function pY(){if(Uk)return mx;Uk=1;var e=fY(),t=Sd(),n=Ed(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,o=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=t(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var v=i.test(c);return v||l.test(c)?o(c.slice(2),v?2:8):a.test(c)?r:+c}return mx=f,mx}var gx,Vk;function mY(){if(Vk)return gx;Vk=1;var e=Sd(),t=uY(),n=pY(),r="Expected a function",a=Math.max,i=Math.min;function l(o,f,c){var d,v,m,y,x,w,S=0,b=!1,C=!1,T=!0;if(typeof o!="function")throw new TypeError(r);f=n(f)||0,e(c)&&(b=!!c.leading,C="maxWait"in c,m=C?a(n(c.maxWait)||0,f):m,T="trailing"in c?!!c.trailing:T);function N(G){var I=d,F=v;return d=v=void 0,S=G,y=o.apply(F,I),y}function A(G){return S=G,x=setTimeout(L,f),b?N(G):y}function R(G){var I=G-w,F=G-S,B=f-I;return C?i(B,m-F):B}function D(G){var I=G-w,F=G-S;return w===void 0||I>=f||I<0||C&&F>=m}function L(){var G=t();if(D(G))return _(G);x=setTimeout(L,R(G))}function _(G){return x=void 0,T&&d?N(G):(d=v=void 0,y)}function M(){x!==void 0&&clearTimeout(x),S=0,d=w=v=x=void 0}function z(){return x===void 0?y:_(t())}function P(){var G=t(),I=D(G);if(d=arguments,v=this,w=G,I){if(x===void 0)return A(w);if(C)return clearTimeout(x),x=setTimeout(L,f),N(w)}return x===void 0&&(x=setTimeout(L,f)),y}return P.cancel=M,P.flush=z,P}return gx=l,gx}var gY=mY(),Cd=wd(gY),yx=Pn?Pn.performance:null,XO=yx&&yx.now?function(){return yx.now()}:function(){return Date.now()},yY=(function(){if(Pn){if(Pn.requestAnimationFrame)return function(e){Pn.requestAnimationFrame(e)};if(Pn.mozRequestAnimationFrame)return function(e){Pn.mozRequestAnimationFrame(e)};if(Pn.webkitRequestAnimationFrame)return function(e){Pn.webkitRequestAnimationFrame(e)};if(Pn.msRequestAnimationFrame)return function(e){Pn.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(XO())},1e3/60)}})(),np=function(t){return yY(t)},Yi=XO,$l=9261,QO=65599,wu=5381,WO=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$l,r=n,a;a=t.next(),!a.done;)r=r*QO+a.value|0;return r},$f=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$l;return n*QO+t|0},Kf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wu;return(n<<5)+n+t|0},xY=function(t,n){return t*2097152+n},Ls=function(t){return t[0]*2097152+t[1]},iv=function(t,n){return[$f(t[0],n[0]),Kf(t[1],n[1])]},Hk=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t[a++]:r.done=!0,r}};return WO(l,n)},mo=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t.charCodeAt(a++):r.done=!0,r}};return WO(l,n)},ZO=function(){return bY(arguments)},bY=function(t){for(var n,r=0;r<t.length;r++){var a=t[r];r===0?n=mo(a):n=mo(a,n)}return n};function wY(e,t,n,r,a){var i=a*Math.PI/180,l=Math.cos(i)*(e-n)-Math.sin(i)*(t-r)+n,o=Math.sin(i)*(e-n)+Math.cos(i)*(t-r)+r;return{x:l,y:o}}var SY=function(t,n,r,a,i,l){return{x:(t-r)*i+r,y:(n-a)*l+a}};function EY(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2,a=(t.y1+t.y2)/2,i=t.w/t.h,l=1/i,o=wY(e.x,e.y,r,a,n),f=SY(o.x,o.y,r,a,i,l);return{x:f.x,y:f.y}}var Gk=!0,CY=console.warn!=null,TY=console.trace!=null,gw=Number.MAX_SAFE_INTEGER||9007199254740991,JO=function(){return!0},rp=function(){return!1},$k=function(){return 0},yw=function(){},ln=function(t){throw new Error(t)},eL=function(t){if(t!==void 0)Gk=!!t;else return Gk},Bt=function(t){eL()&&(CY?console.warn(t):(console.log(t),TY&&console.trace()))},kY=function(t){return rt({},t)},ai=function(t){return t==null?t:$t(t)?t.slice():jt(t)?kY(t):t},NY=function(t){return t.slice()},tL=function(t,n){for(n=t="";t++<36;n+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-");return n},AY={},nL=function(){return AY},lr=function(t){var n=Object.keys(t);return function(r){for(var a={},i=0;i<n.length;i++){var l=n[i],o=r==null?void 0:r[l];a[l]=o===void 0?t[l]:o}return a}},ul=function(t,n,r){for(var a=t.length-1;a>=0;a--)t[a]===n&&t.splice(a,1)},xw=function(t){t.splice(0,t.length)},RY=function(t,n){for(var r=0;r<n.length;r++){var a=n[r];t.push(a)}},Ir=function(t,n,r){return r&&(n=VO(r,n)),t[n]},Pi=function(t,n,r,a){r&&(n=VO(r,n)),t[n]=a},jY=(function(){function e(){yl(this,e),this._obj={}}return xl(e,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}])})(),Ui=typeof Map<"u"?Map:jY,DY="undefined",MY=(function(){function e(t){if(yl(this,e),this._obj=Object.create(null),this.size=0,t!=null){var n;t.instanceString!=null&&t.instanceString()===this.instanceString()?n=t.toArray():n=t;for(var r=0;r<n.length;r++)this.add(n[r])}}return xl(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}])})(),fc=(typeof Set>"u"?"undefined":Fn(Set))!==DY?Set:MY,Kp=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(t===void 0||n===void 0||!vw(t)){ln("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){ln("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:t,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new fc,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),n.renderedPosition){var l=n.renderedPosition,o=t.pan(),f=t.zoom();i.position={x:(l.x-o.x)/f,y:(l.y-o.y)/f}}var c=[];$t(n.classes)?c=n.classes:et(n.classes)&&(c=n.classes.split(/\s+/));for(var d=0,v=c.length;d<v;d++){var m=c[d];!m||m===""||i.classes.add(m)}this.createEmitter(),(r===void 0||r)&&this.restore();var y=n.style||n.css;y&&(Bt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(y))},Kk=function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},function(r,a,i){var l;jt(r)&&!na(r)&&(l=r,r=l.roots||l.root,a=l.visit,i=l.directed),i=arguments.length===2&&!hn(a)?a:i,a=hn(a)?a:function(){};for(var o=this._private.cy,f=r=et(r)?this.filter(r):r,c=[],d=[],v={},m={},y={},x=0,w,S=this.byGroup(),b=S.nodes,C=S.edges,T=0;T<f.length;T++){var N=f[T],A=N.id();N.isNode()&&(c.unshift(N),t.bfs&&(y[A]=!0,d.push(N)),m[A]=0)}for(var R=function(){var G=t.bfs?c.shift():c.pop(),I=G.id();if(t.dfs){if(y[I])return 0;y[I]=!0,d.push(G)}var F=m[I],B=v[I],H=B!=null?B.source():null,Y=B!=null?B.target():null,Q=B==null?void 0:G.same(H)?Y[0]:H[0],V;if(V=a(G,B,Q,x++,F),V===!0)return w=G,1;if(V===!1)return 1;for(var q=G.connectedEdges().filter(function(oe){return(!i||oe.source().same(G))&&C.has(oe)}),X=0;X<q.length;X++){var U=q[X],te=U.connectedNodes().filter(function(oe){return!oe.same(G)&&b.has(oe)}),ie=te.id();te.length!==0&&!y[ie]&&(te=te[0],c.push(te),t.bfs&&(y[ie]=!0,d.push(te)),v[ie]=U,m[ie]=m[I]+1)}},D;c.length!==0&&(D=R(),!(D!==0&&D===1)););for(var L=o.collection(),_=0;_<d.length;_++){var M=d[_],z=v[M.id()];z!=null&&L.push(z),L.push(M)}return{path:o.collection(L),found:o.collection(w)}}},Yf={breadthFirstSearch:Kk({bfs:!0}),depthFirstSearch:Kk({dfs:!0})};Yf.bfs=Yf.breadthFirstSearch;Yf.dfs=Yf.depthFirstSearch;var Nv={exports:{}},OY=Nv.exports,Yk;function LY(){return Yk||(Yk=1,(function(e,t){(function(){var n,r,a,i,l,o,f,c,d,v,m,y,x,w,S;a=Math.floor,v=Math.min,r=function(b,C){return b<C?-1:b>C?1:0},d=function(b,C,T,N,A){var R;if(T==null&&(T=0),A==null&&(A=r),T<0)throw new Error("lo must be non-negative");for(N==null&&(N=b.length);T<N;)R=a((T+N)/2),A(C,b[R])<0?N=R:T=R+1;return[].splice.apply(b,[T,T-T].concat(C)),C},o=function(b,C,T){return T==null&&(T=r),b.push(C),w(b,0,b.length-1,T)},l=function(b,C){var T,N;return C==null&&(C=r),T=b.pop(),b.length?(N=b[0],b[0]=T,S(b,0,C)):N=T,N},c=function(b,C,T){var N;return T==null&&(T=r),N=b[0],b[0]=C,S(b,0,T),N},f=function(b,C,T){var N;return T==null&&(T=r),b.length&&T(b[0],C)<0&&(N=[b[0],C],C=N[0],b[0]=N[1],S(b,0,T)),C},i=function(b,C){var T,N,A,R,D,L;for(C==null&&(C=r),R=(function(){L=[];for(var _=0,M=a(b.length/2);0<=M?_<M:_>M;0<=M?_++:_--)L.push(_);return L}).apply(this).reverse(),D=[],N=0,A=R.length;N<A;N++)T=R[N],D.push(S(b,T,C));return D},x=function(b,C,T){var N;if(T==null&&(T=r),N=b.indexOf(C),N!==-1)return w(b,0,N,T),S(b,N,T)},m=function(b,C,T){var N,A,R,D,L;if(T==null&&(T=r),A=b.slice(0,C),!A.length)return A;for(i(A,T),L=b.slice(C),R=0,D=L.length;R<D;R++)N=L[R],f(A,N,T);return A.sort(T).reverse()},y=function(b,C,T){var N,A,R,D,L,_,M,z,P;if(T==null&&(T=r),C*10<=b.length){if(R=b.slice(0,C).sort(T),!R.length)return R;for(A=R[R.length-1],M=b.slice(C),D=0,_=M.length;D<_;D++)N=M[D],T(N,A)<0&&(d(R,N,0,null,T),R.pop(),A=R[R.length-1]);return R}for(i(b,T),P=[],L=0,z=v(C,b.length);0<=z?L<z:L>z;0<=z?++L:--L)P.push(l(b,T));return P},w=function(b,C,T,N){var A,R,D;for(N==null&&(N=r),A=b[T];T>C;){if(D=T-1>>1,R=b[D],N(A,R)<0){b[T]=R,T=D;continue}break}return b[T]=A},S=function(b,C,T){var N,A,R,D,L;for(T==null&&(T=r),A=b.length,L=C,R=b[C],N=2*C+1;N<A;)D=N+1,D<A&&!(T(b[N],b[D])<0)&&(N=D),b[C]=b[N],C=N,N=2*C+1;return b[C]=R,w(b,L,C,T)},n=(function(){b.push=o,b.pop=l,b.replace=c,b.pushpop=f,b.heapify=i,b.updateItem=x,b.nlargest=m,b.nsmallest=y;function b(C){this.cmp=C??r,this.nodes=[]}return b.prototype.push=function(C){return o(this.nodes,C,this.cmp)},b.prototype.pop=function(){return l(this.nodes,this.cmp)},b.prototype.peek=function(){return this.nodes[0]},b.prototype.contains=function(C){return this.nodes.indexOf(C)!==-1},b.prototype.replace=function(C){return c(this.nodes,C,this.cmp)},b.prototype.pushpop=function(C){return f(this.nodes,C,this.cmp)},b.prototype.heapify=function(){return i(this.nodes,this.cmp)},b.prototype.updateItem=function(C){return x(this.nodes,C,this.cmp)},b.prototype.clear=function(){return this.nodes=[]},b.prototype.empty=function(){return this.nodes.length===0},b.prototype.size=function(){return this.nodes.length},b.prototype.clone=function(){var C;return C=new b,C.nodes=this.nodes.slice(0),C},b.prototype.toArray=function(){return this.nodes.slice(0)},b.prototype.insert=b.prototype.push,b.prototype.top=b.prototype.peek,b.prototype.front=b.prototype.peek,b.prototype.has=b.prototype.contains,b.prototype.copy=b.prototype.clone,b})(),(function(b,C){return e.exports=C()})(this,function(){return n})}).call(OY)})(Nv)),Nv.exports}var xx,Xk;function _Y(){return Xk||(Xk=1,xx=LY()),xx}var BY=_Y(),Td=wd(BY),PY=lr({root:null,weight:function(t){return 1},directed:!1}),zY={dijkstra:function(t){if(!jt(t)){var n=arguments;t={root:n[0],weight:n[1],directed:n[2]}}var r=PY(t),a=r.root,i=r.weight,l=r.directed,o=this,f=i,c=et(a)?this.filter(a)[0]:a[0],d={},v={},m={},y=this.byGroup(),x=y.nodes,w=y.edges;w.unmergeBy(function(F){return F.isLoop()});for(var S=function(B){return d[B.id()]},b=function(B,H){d[B.id()]=H,C.updateItem(B)},C=new Td(function(F,B){return S(F)-S(B)}),T=0;T<x.length;T++){var N=x[T];d[N.id()]=N.same(c)?0:1/0,C.push(N)}for(var A=function(B,H){for(var Y=(l?B.edgesTo(H):B.edgesWith(H)).intersect(w),Q=1/0,V,q=0;q<Y.length;q++){var X=Y[q],U=f(X);(U<Q||!V)&&(Q=U,V=X)}return{edge:V,dist:Q}};C.size()>0;){var R=C.pop(),D=S(R),L=R.id();if(m[L]=D,D!==1/0)for(var _=R.neighborhood().intersect(x),M=0;M<_.length;M++){var z=_[M],P=z.id(),G=A(R,z),I=D+G.dist;I<S(z)&&(b(z,I),v[P]={node:R,edge:G.edge})}}return{distanceTo:function(B){var H=et(B)?x.filter(B)[0]:B[0];return m[H.id()]},pathTo:function(B){var H=et(B)?x.filter(B)[0]:B[0],Y=[],Q=H,V=Q.id();if(H.length>0)for(Y.unshift(H);v[V];){var q=v[V];Y.unshift(q.edge),Y.unshift(q.node),Q=q.node,V=Q.id()}return o.spawn(Y)}}}},IY={kruskal:function(t){t=t||function(T){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,l=new Array(i),o=r,f=function(N){for(var A=0;A<l.length;A++){var R=l[A];if(R.has(N))return A}},c=0;c<i;c++)l[c]=this.spawn(r[c]);for(var d=a.sort(function(T,N){return t(T)-t(N)}),v=0;v<d.length;v++){var m=d[v],y=m.source()[0],x=m.target()[0],w=f(y),S=f(x),b=l[w],C=l[S];w!==S&&(o.merge(m),b.merge(C),l.splice(S,1))}return o}},FY=lr({root:null,goal:null,weight:function(t){return 1},heuristic:function(t){return 0},directed:!1}),qY={aStar:function(t){var n=this.cy(),r=FY(t),a=r.root,i=r.goal,l=r.heuristic,o=r.directed,f=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var c=a.id(),d=i.id(),v={},m={},y={},x=new Td(function(V,q){return m[V.id()]-m[q.id()]}),w=new fc,S={},b={},C=function(q,X){x.push(q),w.add(X)},T,N,A=function(){T=x.pop(),N=T.id(),w.delete(N)},R=function(q){return w.has(q)};C(a,c),v[c]=0,m[c]=l(a);for(var D=0;x.size()>0;){if(A(),D++,N===d){for(var L=[],_=i,M=d,z=b[M];L.unshift(_),z!=null&&L.unshift(z),_=S[M],_!=null;)M=_.id(),z=b[M];return{found:!0,distance:v[N],path:this.spawn(L),steps:D}}y[N]=!0;for(var P=T._private.edges,G=0;G<P.length;G++){var I=P[G];if(this.hasElementWithId(I.id())&&!(o&&I.data("source")!==N)){var F=I.source(),B=I.target(),H=F.id()!==N?F:B,Y=H.id();if(this.hasElementWithId(Y)&&!y[Y]){var Q=v[N]+f(I);if(!R(Y)){v[Y]=Q,m[Y]=Q+l(H),C(H,Y),S[Y]=T,b[Y]=I;continue}Q<v[Y]&&(v[Y]=Q,m[Y]=Q+l(H),S[Y]=T,b[Y]=I)}}}}return{found:!1,distance:void 0,path:void 0,steps:D}}},UY=lr({weight:function(t){return 1},directed:!1}),VY={floydWarshall:function(t){for(var n=this.cy(),r=UY(t),a=r.weight,i=r.directed,l=a,o=this.byGroup(),f=o.nodes,c=o.edges,d=f.length,v=d*d,m=function(U){return f.indexOf(U)},y=function(U){return f[U]},x=new Array(v),w=0;w<v;w++){var S=w%d,b=(w-S)/d;b===S?x[w]=0:x[w]=1/0}for(var C=new Array(v),T=new Array(v),N=0;N<c.length;N++){var A=c[N],R=A.source()[0],D=A.target()[0];if(R!==D){var L=m(R),_=m(D),M=L*d+_,z=l(A);if(x[M]>z&&(x[M]=z,C[M]=_,T[M]=A),!i){var P=_*d+L;!i&&x[P]>z&&(x[P]=z,C[P]=L,T[P]=A)}}}for(var G=0;G<d;G++)for(var I=0;I<d;I++)for(var F=I*d+G,B=0;B<d;B++){var H=I*d+B,Y=G*d+B;x[F]+x[Y]<x[H]&&(x[H]=x[F]+x[Y],C[H]=C[F])}var Q=function(U){return(et(U)?n.filter(U):U)[0]},V=function(U){return m(Q(U))},q={distance:function(U,te){var ie=V(U),oe=V(te);return x[ie*d+oe]},path:function(U,te){var ie=V(U),oe=V(te),ae=y(ie);if(ie===oe)return ae.collection();if(C[ie*d+oe]==null)return n.collection();var we=n.collection(),fe=ie,J;for(we.merge(ae);ie!==oe;)fe=ie,ie=C[ie*d+oe],J=T[fe*d+ie],we.merge(J),we.merge(y(ie));return we}};return q}},HY=lr({weight:function(t){return 1},directed:!1,root:null}),GY={bellmanFord:function(t){var n=this,r=HY(t),a=r.weight,i=r.directed,l=r.root,o=a,f=this,c=this.cy(),d=this.byGroup(),v=d.edges,m=d.nodes,y=m.length,x=new Ui,w=!1,S=[];l=c.collection(l)[0],v.unmergeBy(function(Ze){return Ze.isLoop()});for(var b=v.length,C=function(Qe){var qe=x.get(Qe.id());return qe||(qe={},x.set(Qe.id(),qe)),qe},T=function(Qe){return(et(Qe)?c.$(Qe):Qe)[0]},N=function(Qe){return C(T(Qe)).dist},A=function(Qe){for(var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,je=T(Qe),Ge=[],Xe=je;;){if(Xe==null)return n.spawn();var it=C(Xe),Pe=it.edge,ft=it.pred;if(Ge.unshift(Xe[0]),Xe.same(qe)&&Ge.length>0)break;Pe!=null&&Ge.unshift(Pe),Xe=ft}return f.spawn(Ge)},R=0;R<y;R++){var D=m[R],L=C(D);D.same(l)?L.dist=0:L.dist=1/0,L.pred=null,L.edge=null}for(var _=!1,M=function(Qe,qe,je,Ge,Xe,it){var Pe=Ge.dist+it;Pe<Xe.dist&&!je.same(Ge.edge)&&(Xe.dist=Pe,Xe.pred=Qe,Xe.edge=je,_=!0)},z=1;z<y;z++){_=!1;for(var P=0;P<b;P++){var G=v[P],I=G.source(),F=G.target(),B=o(G),H=C(I),Y=C(F);M(I,F,G,H,Y,B),i||M(F,I,G,Y,H,B)}if(!_)break}if(_)for(var Q=[],V=0;V<b;V++){var q=v[V],X=q.source(),U=q.target(),te=o(q),ie=C(X).dist,oe=C(U).dist;if(ie+te<oe||!i&&oe+te<ie)if(w||(Bt("Graph contains a negative weight cycle for Bellman-Ford"),w=!0),t.findNegativeWeightCycles!==!1){var ae=[];ie+te<oe&&ae.push(X),!i&&oe+te<ie&&ae.push(U);for(var we=ae.length,fe=0;fe<we;fe++){var J=ae[fe],ne=[J];ne.push(C(J).edge);for(var re=C(J).pred;ne.indexOf(re)===-1;)ne.push(re),ne.push(C(re).edge),re=C(re).pred;ne=ne.slice(ne.indexOf(re));for(var ge=ne[0].id(),ke=0,Be=2;Be<ne.length;Be+=2)ne[Be].id()<ge&&(ge=ne[Be].id(),ke=Be);ne=ne.slice(ke).concat(ne.slice(0,ke)),ne.push(ne[0]);var lt=ne.map(function(Ze){return Ze.id()}).join(",");Q.indexOf(lt)===-1&&(S.push(f.spawn(ne)),Q.push(lt))}}else break}return{distanceTo:N,pathTo:A,hasNegativeWeightCycle:w,negativeWeightCycles:S}}},$Y=Math.sqrt(2),KY=function(t,n,r){r.length===0&&ln("Karger-Stein must be run on a connected (sub)graph");for(var a=r[t],i=a[1],l=a[2],o=n[i],f=n[l],c=r,d=c.length-1;d>=0;d--){var v=c[d],m=v[1],y=v[2];(n[m]===o&&n[y]===f||n[m]===f&&n[y]===o)&&c.splice(d,1)}for(var x=0;x<c.length;x++){var w=c[x];w[1]===f?(c[x]=w.slice(),c[x][1]=o):w[2]===f&&(c[x]=w.slice(),c[x][2]=o)}for(var S=0;S<n.length;S++)n[S]===f&&(n[S]=o);return c},bx=function(t,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=KY(i,t,n),r--}return n},YY={kargerStein:function(){var t=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(Y){return Y.isLoop()});var i=r.length,l=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),f=Math.floor(i/$Y);if(i<2){ln("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],d=0;d<l;d++){var v=a[d];c.push([d,r.indexOf(v.source()),r.indexOf(v.target())])}for(var m=1/0,y=[],x=new Array(i),w=new Array(i),S=new Array(i),b=function(Q,V){for(var q=0;q<i;q++)V[q]=Q[q]},C=0;C<=o;C++){for(var T=0;T<i;T++)w[T]=T;var N=bx(w,c.slice(),i,f),A=N.slice();b(w,S);var R=bx(w,N,f,2),D=bx(S,A,f,2);R.length<=D.length&&R.length<m?(m=R.length,y=R,b(w,x)):D.length<=R.length&&D.length<m&&(m=D.length,y=D,b(S,x))}for(var L=this.spawn(y.map(function(Y){return a[Y[0]]})),_=this.spawn(),M=this.spawn(),z=x[0],P=0;P<x.length;P++){var G=x[P],I=r[P];G===z?_.merge(I):M.merge(I)}var F=function(Q){var V=t.spawn();return Q.forEach(function(q){V.merge(q),q.connectedEdges().forEach(function(X){t.contains(X)&&!L.contains(X)&&V.merge(X)})}),V},B=[F(_),F(M)],H={cut:L,components:B,partition1:_,partition2:M};return H}},wx,XY=function(t){return{x:t.x,y:t.y}},Yp=function(t,n,r){return{x:t.x*n+r.x,y:t.y*n+r.y}},rL=function(t,n,r){return{x:(t.x-r.x)/n,y:(t.y-r.y)/n}},Eu=function(t){return{x:t[0],y:t[1]}},QY=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.min(l,a))}return a},WY=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=-1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.max(l,a))}return a},ZY=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=0,i=0,l=n;l<r;l++){var o=t[l];isFinite(o)&&(a+=o,i++)}return a/i},JY=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?t=t.slice(n,r):(r<t.length&&t.splice(r,t.length-r),n>0&&t.splice(0,n));for(var o=0,f=t.length-1;f>=0;f--){var c=t[f];l?isFinite(c)||(t[f]=-1/0,o++):t.splice(f,1)}i&&t.sort(function(m,y){return m-y});var d=t.length,v=Math.floor(d/2);return d%2!==0?t[v+1+o]:(t[v-1+o]+t[v+o])/2},eX=function(t){return Math.PI*t/180},sv=function(t,n){return Math.atan2(n,t)-Math.PI/2},bw=Math.log2||function(e){return Math.log(e)/Math.log(2)},ww=function(t){return t>0?1:t<0?-1:0},go=function(t,n){return Math.sqrt(Hl(t,n))},Hl=function(t,n){var r=n.x-t.x,a=n.y-t.y;return r*r+a*a},tX=function(t){for(var n=t.length,r=0,a=0;a<n;a++)r+=t[a];for(var i=0;i<n;i++)t[i]=t[i]/r;return t},Xn=function(t,n,r,a){return(1-a)*(1-a)*t+2*(1-a)*a*n+a*a*r},Du=function(t,n,r,a){return{x:Xn(t.x,n.x,r.x,a),y:Xn(t.y,n.y,r.y,a)}},nX=function(t,n,r,a){var i={x:n.x-t.x,y:n.y-t.y},l=go(t,n),o={x:i.x/l,y:i.y/l};return r=r??0,a=a??r*l,{x:t.x+o.x*a,y:t.y+o.y*a}},Xf=function(t,n,r){return Math.max(t,Math.min(r,n))},kr=function(t){if(t==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(t.x1!=null&&t.y1!=null){if(t.x2!=null&&t.y2!=null&&t.x2>=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}},rX=function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}},aX=function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0},iX=function(t,n){t.x1=Math.min(t.x1,n.x1),t.x2=Math.max(t.x2,n.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,n.y1),t.y2=Math.max(t.y2,n.y2),t.h=t.y2-t.y1},aL=function(t,n,r){t.x1=Math.min(t.x1,n),t.x2=Math.max(t.x2,n),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,r),t.y2=Math.max(t.y2,r),t.h=t.y2-t.y1},Av=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.x1-=n,t.x2+=n,t.y1-=n,t.y2+=n,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},Rv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,l;if(n.length===1)r=a=i=l=n[0];else if(n.length===2)r=i=n[0],l=a=n[1];else if(n.length===4){var o=On(n,4);r=o[0],a=o[1],i=o[2],l=o[3]}return t.x1-=l,t.x2+=a,t.y1-=r,t.y2+=i,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},Qk=function(t,n){t.x1=n.x1,t.y1=n.y1,t.x2=n.x2,t.y2=n.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1},Sw=function(t,n){return!(t.x1>n.x2||n.x1>t.x2||t.x2<n.x1||n.x2<t.x1||t.y2<n.y1||n.y2<t.y1||t.y1>n.y2||n.y1>t.y2)},Qs=function(t,n,r){return t.x1<=n&&n<=t.x2&&t.y1<=r&&r<=t.y2},Wk=function(t,n){return Qs(t,n.x,n.y)},iL=function(t,n){return Qs(t,n.x1,n.y1)&&Qs(t,n.x2,n.y2)},sX=(wx=Math.hypot)!==null&&wx!==void 0?wx:function(e,t){return Math.sqrt(e*e+t*t)};function lX(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(L,_){return{x:L.x+_.x,y:L.y+_.y}},r=function(L,_){return{x:L.x-_.x,y:L.y-_.y}},a=function(L,_){return{x:L.x*_,y:L.y*_}},i=function(L,_){return L.x*_.y-L.y*_.x},l=function(L){var _=sX(L.x,L.y);return _===0?{x:0,y:0}:{x:L.x/_,y:L.y/_}},o=function(L){for(var _=0,M=0;M<L.length;M++){var z=L[M],P=L[(M+1)%L.length];_+=z.x*P.y-P.x*z.y}return _/2},f=function(L,_,M,z){var P=r(_,L),G=r(z,M),I=i(P,G);if(Math.abs(I)<1e-9)return n(L,a(P,.5));var F=i(r(M,L),G)/I;return n(L,a(P,F))},c=e.map(function(D){return{x:D.x,y:D.y}});o(c)<0&&c.reverse();for(var d=c.length,v=[],m=0;m<d;m++){var y=c[m],x=c[(m+1)%d],w=r(x,y),S=l({x:w.y,y:-w.x});v.push(S)}for(var b=v.map(function(D,L){var _=n(c[L],a(D,t)),M=n(c[(L+1)%d],a(D,t));return{p1:_,p2:M}}),C=[],T=0;T<d;T++){var N=b[(T-1+d)%d],A=b[T],R=f(N.p1,N.p2,A.p1,A.p2);C.push(R)}return C}function oX(e,t,n,r,a,i){var l=gX(e,t,n,r,a),o=lX(l,i),f=kr();return o.forEach(function(c){return aL(f,c.x,c.y)}),f}var sL=function(t,n,r,a,i,l,o){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?cl(i,l):f,d=i/2,v=l/2;c=Math.min(c,d,v);var m=c!==d,y=c!==v,x;if(m){var w=r-d+c-o,S=a-v-o,b=r+d-c+o,C=S;if(x=Ws(t,n,r,a,w,S,b,C,!1),x.length>0)return x}if(y){var T=r+d+o,N=a-v+c-o,A=T,R=a+v-c+o;if(x=Ws(t,n,r,a,T,N,A,R,!1),x.length>0)return x}if(m){var D=r-d+c-o,L=a+v+o,_=r+d-c+o,M=L;if(x=Ws(t,n,r,a,D,L,_,M,!1),x.length>0)return x}if(y){var z=r-d-o,P=a-v+c-o,G=z,I=a+v-c+o;if(x=Ws(t,n,r,a,z,P,G,I,!1),x.length>0)return x}var F;{var B=r-d+c,H=a-v+c;if(F=Af(t,n,r,a,B,H,c+o),F.length>0&&F[0]<=B&&F[1]<=H)return[F[0],F[1]]}{var Y=r+d-c,Q=a-v+c;if(F=Af(t,n,r,a,Y,Q,c+o),F.length>0&&F[0]>=Y&&F[1]<=Q)return[F[0],F[1]]}{var V=r+d-c,q=a+v-c;if(F=Af(t,n,r,a,V,q,c+o),F.length>0&&F[0]>=V&&F[1]>=q)return[F[0],F[1]]}{var X=r-d+c,U=a+v-c;if(F=Af(t,n,r,a,X,U,c+o),F.length>0&&F[0]<=X&&F[1]>=U)return[F[0],F[1]]}return[]},uX=function(t,n,r,a,i,l,o){var f=o,c=Math.min(r,i),d=Math.max(r,i),v=Math.min(a,l),m=Math.max(a,l);return c-f<=t&&t<=d+f&&v-f<=n&&n<=m+f},cX=function(t,n,r,a,i,l,o,f,c){var d={x1:Math.min(r,o,i)-c,x2:Math.max(r,o,i)+c,y1:Math.min(a,f,l)-c,y2:Math.max(a,f,l)+c};return!(t<d.x1||t>d.x2||n<d.y1||n>d.y2)},fX=function(t,n,r,a){r-=a;var i=n*n-4*t*r;if(i<0)return[];var l=Math.sqrt(i),o=2*t,f=(-n+l)/o,c=(-n-l)/o;return[f,c]},dX=function(t,n,r,a,i){var l=1e-5;t===0&&(t=l),n/=t,r/=t,a/=t;var o,f,c,d,v,m,y,x;if(f=(3*r-n*n)/9,c=-(27*a)+n*(9*r-2*(n*n)),c/=54,o=f*f*f+c*c,i[1]=0,y=n/3,o>0){v=c+Math.sqrt(o),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),m=c-Math.sqrt(o),m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),i[0]=-y+v+m,y+=(v+m)/2,i[4]=i[2]=-y,y=Math.sqrt(3)*(-m+v)/2,i[3]=y,i[5]=-y;return}if(i[5]=i[3]=0,o===0){x=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-y+2*x,i[4]=i[2]=-(x+y);return}f=-f,d=f*f*f,d=Math.acos(c/Math.sqrt(d)),x=2*Math.sqrt(f),i[0]=-y+x*Math.cos(d/3),i[2]=-y+x*Math.cos((d+2*Math.PI)/3),i[4]=-y+x*Math.cos((d+4*Math.PI)/3)},hX=function(t,n,r,a,i,l,o,f){var c=1*r*r-4*r*i+2*r*o+4*i*i-4*i*o+o*o+a*a-4*a*l+2*a*f+4*l*l-4*l*f+f*f,d=9*r*i-3*r*r-3*r*o-6*i*i+3*i*o+9*a*l-3*a*a-3*a*f-6*l*l+3*l*f,v=3*r*r-6*r*i+r*o-r*t+2*i*i+2*i*t-o*t+3*a*a-6*a*l+a*f-a*n+2*l*l+2*l*n-f*n,m=1*r*i-r*r+r*t-i*t+a*l-a*a+a*n-l*n,y=[];dX(c,d,v,m,y);for(var x=1e-7,w=[],S=0;S<6;S+=2)Math.abs(y[S+1])<x&&y[S]>=0&&y[S]<=1&&w.push(y[S]);w.push(1),w.push(0);for(var b=-1,C,T,N,A=0;A<w.length;A++)C=Math.pow(1-w[A],2)*r+2*(1-w[A])*w[A]*i+w[A]*w[A]*o,T=Math.pow(1-w[A],2)*a+2*(1-w[A])*w[A]*l+w[A]*w[A]*f,N=Math.pow(C-t,2)+Math.pow(T-n,2),b>=0?N<b&&(b=N):b=N;return b},vX=function(t,n,r,a,i,l){var o=[t-r,n-a],f=[i-r,l-a],c=f[0]*f[0]+f[1]*f[1],d=o[0]*o[0]+o[1]*o[1],v=o[0]*f[0]+o[1]*f[1],m=v*v/c;return v<0?d:m>c?(t-i)*(t-i)+(n-l)*(n-l):d-m},Fr=function(t,n,r){for(var a,i,l,o,f,c=0,d=0;d<r.length/2;d++)if(a=r[d*2],i=r[d*2+1],d+1<r.length/2?(l=r[(d+1)*2],o=r[(d+1)*2+1]):(l=r[(d+1-r.length/2)*2],o=r[(d+1-r.length/2)*2+1]),!(a==t&&l==t))if(a>=t&&t>=l||a<=t&&t<=l)f=(t-a)/(l-a)*(o-i)+i,f>n&&c++;else continue;return c%2!==0},Xi=function(t,n,r,a,i,l,o,f,c){var d=new Array(r.length),v;f[0]!=null?(v=Math.atan(f[1]/f[0]),f[0]<0?v=v+Math.PI/2:v=-v-Math.PI/2):v=f;for(var m=Math.cos(-v),y=Math.sin(-v),x=0;x<d.length/2;x++)d[x*2]=l/2*(r[x*2]*m-r[x*2+1]*y),d[x*2+1]=o/2*(r[x*2+1]*m+r[x*2]*y),d[x*2]+=a,d[x*2+1]+=i;var w;if(c>0){var S=ip(d,-c);w=ap(S)}else w=d;return Fr(t,n,w)},pX=function(t,n,r,a,i,l,o,f){for(var c=new Array(r.length*2),d=0;d<f.length;d++){var v=f[d];c[d*4+0]=v.startX,c[d*4+1]=v.startY,c[d*4+2]=v.stopX,c[d*4+3]=v.stopY;var m=Math.pow(v.cx-t,2)+Math.pow(v.cy-n,2);if(m<=Math.pow(v.radius,2))return!0}return Fr(t,n,c)},ap=function(t){for(var n=new Array(t.length/2),r,a,i,l,o,f,c,d,v=0;v<t.length/4;v++){r=t[v*4],a=t[v*4+1],i=t[v*4+2],l=t[v*4+3],v<t.length/4-1?(o=t[(v+1)*4],f=t[(v+1)*4+1],c=t[(v+1)*4+2],d=t[(v+1)*4+3]):(o=t[0],f=t[1],c=t[2],d=t[3]);var m=Ws(r,a,i,l,o,f,c,d,!0);n[v*2]=m[0],n[v*2+1]=m[1]}return n},ip=function(t,n){for(var r=new Array(t.length*2),a,i,l,o,f=0;f<t.length/2;f++){a=t[f*2],i=t[f*2+1],f<t.length/2-1?(l=t[(f+1)*2],o=t[(f+1)*2+1]):(l=t[0],o=t[1]);var c=o-i,d=-(l-a),v=Math.sqrt(c*c+d*d),m=c/v,y=d/v;r[f*4]=a+m*n,r[f*4+1]=i+y*n,r[f*4+2]=l+m*n,r[f*4+3]=o+y*n}return r},mX=function(t,n,r,a,i,l){var o=r-t,f=a-n;o/=i,f/=l;var c=Math.sqrt(o*o+f*f),d=c-1;if(d<0)return[];var v=d/c;return[(r-t)*v+t,(a-n)*v+n]},Xl=function(t,n,r,a,i,l,o){return t-=i,n-=l,t/=r/2+o,n/=a/2+o,t*t+n*n<=1},Af=function(t,n,r,a,i,l,o){var f=[r-t,a-n],c=[t-i,n-l],d=f[0]*f[0]+f[1]*f[1],v=2*(c[0]*f[0]+c[1]*f[1]),m=c[0]*c[0]+c[1]*c[1]-o*o,y=v*v-4*d*m;if(y<0)return[];var x=(-v+Math.sqrt(y))/(2*d),w=(-v-Math.sqrt(y))/(2*d),S=Math.min(x,w),b=Math.max(x,w),C=[];if(S>=0&&S<=1&&C.push(S),b>=0&&b<=1&&C.push(b),C.length===0)return[];var T=C[0]*f[0]+t,N=C[0]*f[1]+n;if(C.length>1){if(C[0]==C[1])return[T,N];var A=C[1]*f[0]+t,R=C[1]*f[1]+n;return[T,N,A,R]}else return[T,N]},Sx=function(t,n,r){return n<=t&&t<=r||r<=t&&t<=n?t:t<=n&&n<=r||r<=n&&n<=t?n:r},Ws=function(t,n,r,a,i,l,o,f,c){var d=t-i,v=r-t,m=o-i,y=n-l,x=a-n,w=f-l,S=m*y-w*d,b=v*y-x*d,C=w*v-m*x;if(C!==0){var T=S/C,N=b/C,A=.001,R=0-A,D=1+A;return R<=T&&T<=D&&R<=N&&N<=D?[t+T*v,n+T*x]:c?[t+T*v,n+T*x]:[]}else return S===0||b===0?Sx(t,r,o)===o?[o,f]:Sx(t,r,i)===i?[i,l]:Sx(i,o,r)===r?[r,a]:[]:[]},gX=function(t,n,r,a,i){var l=[],o=a/2,f=i/2,c=n,d=r;l.push({x:c+o*t[0],y:d+f*t[1]});for(var v=1;v<t.length/2;v++)l.push({x:c+o*t[v*2],y:d+f*t[v*2+1]});return l},Qf=function(t,n,r,a,i,l,o,f){var c=[],d,v=new Array(r.length),m=!0;l==null&&(m=!1);var y;if(m){for(var x=0;x<v.length/2;x++)v[x*2]=r[x*2]*l+a,v[x*2+1]=r[x*2+1]*o+i;if(f>0){var w=ip(v,-f);y=ap(w)}else y=v}else y=r;for(var S,b,C,T,N=0;N<y.length/2;N++)S=y[N*2],b=y[N*2+1],N<y.length/2-1?(C=y[(N+1)*2],T=y[(N+1)*2+1]):(C=y[0],T=y[1]),d=Ws(t,n,a,i,S,b,C,T),d.length!==0&&c.push(d[0],d[1]);return c},yX=function(t,n,r,a,i,l,o,f,c){var d=[],v,m=new Array(r.length*2);c.forEach(function(C,T){T===0?(m[m.length-2]=C.startX,m[m.length-1]=C.startY):(m[T*4-2]=C.startX,m[T*4-1]=C.startY),m[T*4]=C.stopX,m[T*4+1]=C.stopY,v=Af(t,n,a,i,C.cx,C.cy,C.radius),v.length!==0&&d.push(v[0],v[1])});for(var y=0;y<m.length/4;y++)v=Ws(t,n,a,i,m[y*4],m[y*4+1],m[y*4+2],m[y*4+3],!1),v.length!==0&&d.push(v[0],v[1]);if(d.length>2){for(var x=[d[0],d[1]],w=Math.pow(x[0]-t,2)+Math.pow(x[1]-n,2),S=1;S<d.length/2;S++){var b=Math.pow(d[S*2]-t,2)+Math.pow(d[S*2+1]-n,2);b<=w&&(x[0]=d[S*2],x[1]=d[S*2+1],w=b)}return x}return d},lv=function(t,n,r){var a=[t[0]-n[0],t[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=(i-r)/i;return l<0&&(l=1e-5),[n[0]+l*a[0],n[1]+l*a[1]]},wr=function(t,n){var r=_b(t,n);return r=lL(r),r},lL=function(t){for(var n,r,a=t.length/2,i=1/0,l=1/0,o=-1/0,f=-1/0,c=0;c<a;c++)n=t[2*c],r=t[2*c+1],i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);for(var d=2/(o-i),v=2/(f-l),m=0;m<a;m++)n=t[2*m]=t[2*m]*d,r=t[2*m+1]=t[2*m+1]*v,i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);if(l<-1)for(var y=0;y<a;y++)r=t[2*y+1]=t[2*y+1]+(-1-l);return t},_b=function(t,n){var r=1/t*2*Math.PI,a=t%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(t*2),l,o=0;o<t;o++)l=o*r+a,i[2*o]=Math.cos(l),i[2*o+1]=Math.sin(-l);return i},cl=function(t,n){return Math.min(t/4,n/4,8)},oL=function(t,n){return Math.min(t/10,n/10,8)},Ew=function(){return 8},xX=function(t,n,r){return[t-2*n+r,2*(n-t),t]},Bb=function(t,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}};function Ex(e,t){function n(v){for(var m=[],y=0;y<v.length;y++){var x=v[y],w=v[(y+1)%v.length],S={x:w.x-x.x,y:w.y-x.y},b={x:-S.y,y:S.x},C=Math.sqrt(b.x*b.x+b.y*b.y);m.push({x:b.x/C,y:b.y/C})}return m}function r(v,m){var y=1/0,x=-1/0,w=qr(v),S;try{for(w.s();!(S=w.n()).done;){var b=S.value,C=b.x*m.x+b.y*m.y;y=Math.min(y,C),x=Math.max(x,C)}}catch(T){w.e(T)}finally{w.f()}return{min:y,max:x}}function a(v,m){return!(v.max<m.min||m.max<v.min)}var i=[].concat(ep(n(e)),ep(n(t))),l=qr(i),o;try{for(l.s();!(o=l.n()).done;){var f=o.value,c=r(e,f),d=r(t,f);if(!a(c,d))return!1}}catch(v){l.e(v)}finally{l.f()}return!0}var bX=lr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(t){return 1}}),wX={pageRank:function(t){for(var n=bX(t),r=n.dampingFactor,a=n.precision,i=n.iterations,l=n.weight,o=this._private.cy,f=this.byGroup(),c=f.nodes,d=f.edges,v=c.length,m=v*v,y=d.length,x=new Array(m),w=new Array(v),S=(1-r)/v,b=0;b<v;b++){for(var C=0;C<v;C++){var T=b*v+C;x[T]=0}w[b]=0}for(var N=0;N<y;N++){var A=d[N],R=A.data("source"),D=A.data("target");if(R!==D){var L=c.indexOfId(R),_=c.indexOfId(D),M=l(A),z=_*v+L;x[z]+=M,w[L]+=M}}for(var P=1/v+S,G=0;G<v;G++)if(w[G]===0)for(var I=0;I<v;I++){var F=I*v+G;x[F]=P}else for(var B=0;B<v;B++){var H=B*v+G;x[H]=x[H]/w[G]+S}for(var Y=new Array(v),Q=new Array(v),V,q=0;q<v;q++)Y[q]=1;for(var X=0;X<i;X++){for(var U=0;U<v;U++)Q[U]=0;for(var te=0;te<v;te++)for(var ie=0;ie<v;ie++){var oe=te*v+ie;Q[te]+=x[oe]*Y[ie]}tX(Q),V=Y,Y=Q,Q=V;for(var ae=0,we=0;we<v;we++){var fe=V[we]-Y[we];ae+=fe*fe}if(ae<a)break}var J={rank:function(re){return re=o.collection(re)[0],Y[c.indexOf(re)]}};return J}},Zk=lr({root:null,weight:function(t){return 1},directed:!1,alpha:0}),Mu={degreeCentralityNormalized:function(t){t=Zk(t);var n=this.cy(),r=this.nodes(),a=r.length;if(t.directed){for(var d={},v={},m=0,y=0,x=0;x<a;x++){var w=r[x],S=w.id();t.root=w;var b=this.degreeCentrality(t);m<b.indegree&&(m=b.indegree),y<b.outdegree&&(y=b.outdegree),d[S]=b.indegree,v[S]=b.outdegree}return{indegree:function(T){return m==0?0:(et(T)&&(T=n.filter(T)),d[T.id()]/m)},outdegree:function(T){return y===0?0:(et(T)&&(T=n.filter(T)),v[T.id()]/y)}}}else{for(var i={},l=0,o=0;o<a;o++){var f=r[o];t.root=f;var c=this.degreeCentrality(t);l<c.degree&&(l=c.degree),i[f.id()]=c.degree}return{degree:function(T){return l===0?0:(et(T)&&(T=n.filter(T)),i[T.id()]/l)}}}},degreeCentrality:function(t){t=Zk(t);var n=this.cy(),r=this,a=t,i=a.root,l=a.weight,o=a.directed,f=a.alpha;if(i=n.collection(i)[0],o){for(var y=i.connectedEdges(),x=y.filter(function(R){return R.target().same(i)&&r.has(R)}),w=y.filter(function(R){return R.source().same(i)&&r.has(R)}),S=x.length,b=w.length,C=0,T=0,N=0;N<x.length;N++)C+=l(x[N]);for(var A=0;A<w.length;A++)T+=l(w[A]);return{indegree:Math.pow(S,1-f)*Math.pow(C,f),outdegree:Math.pow(b,1-f)*Math.pow(T,f)}}else{for(var c=i.connectedEdges().intersection(r),d=c.length,v=0,m=0;m<c.length;m++)v+=l(c[m]);return{degree:Math.pow(d,1-f)*Math.pow(v,f)}}}};Mu.dc=Mu.degreeCentrality;Mu.dcn=Mu.degreeCentralityNormalised=Mu.degreeCentralityNormalized;var Jk=lr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ou={closenessCentralityNormalized:function(t){for(var n=Jk(t),r=n.harmonic,a=n.weight,i=n.directed,l=this.cy(),o={},f=0,c=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),v=0;v<c.length;v++){for(var m=0,y=c[v],x=0;x<c.length;x++)if(v!==x){var w=d.distance(y,c[x]);r?m+=1/w:m+=w}r||(m=1/m),f<m&&(f=m),o[y.id()]=m}return{closeness:function(b){return f==0?0:(et(b)?b=l.filter(b)[0].id():b=b.id(),o[b]/f)}}},closenessCentrality:function(t){var n=Jk(t),r=n.root,a=n.weight,i=n.directed,l=n.harmonic;r=this.filter(r)[0];for(var o=this.dijkstra({root:r,weight:a,directed:i}),f=0,c=this.nodes(),d=0;d<c.length;d++){var v=c[d];if(!v.same(r)){var m=o.distanceTo(v);l?f+=1/m:f+=m}}return l?f:1/f}};Ou.cc=Ou.closenessCentrality;Ou.ccn=Ou.closenessCentralityNormalised=Ou.closenessCentralityNormalized;var SX=lr({weight:null,directed:!1}),Pb={betweennessCentrality:function(t){for(var n=SX(t),r=n.directed,a=n.weight,i=a!=null,l=this.cy(),o=this.nodes(),f={},c={},d=0,v={set:function(T,N){c[T]=N,N>d&&(d=N)},get:function(T){return c[T]}},m=0;m<o.length;m++){var y=o[m],x=y.id();r?f[x]=y.outgoers().nodes():f[x]=y.openNeighborhood().nodes(),v.set(x,0)}for(var w=function(){for(var T=o[S].id(),N=[],A={},R={},D={},L=new Td(function(te,ie){return D[te]-D[ie]}),_=0;_<o.length;_++){var M=o[_].id();A[M]=[],R[M]=0,D[M]=1/0}for(R[T]=1,D[T]=0,L.push(T);!L.empty();){var z=L.pop();if(N.push(z),i)for(var P=0;P<f[z].length;P++){var G=f[z][P],I=l.getElementById(z),F=void 0;I.edgesTo(G).length>0?F=I.edgesTo(G)[0]:F=G.edgesTo(I)[0];var B=a(F);G=G.id(),D[G]>D[z]+B&&(D[G]=D[z]+B,L.nodes.indexOf(G)<0?L.push(G):L.updateItem(G),R[G]=0,A[G]=[]),D[G]==D[z]+B&&(R[G]=R[G]+R[z],A[G].push(z))}else for(var H=0;H<f[z].length;H++){var Y=f[z][H].id();D[Y]==1/0&&(L.push(Y),D[Y]=D[z]+1),D[Y]==D[z]+1&&(R[Y]=R[Y]+R[z],A[Y].push(z))}}for(var Q={},V=0;V<o.length;V++)Q[o[V].id()]=0;for(;N.length>0;){for(var q=N.pop(),X=0;X<A[q].length;X++){var U=A[q][X];Q[U]=Q[U]+R[U]/R[q]*(1+Q[q])}q!=o[S].id()&&v.set(q,v.get(q)+Q[q])}},S=0;S<o.length;S++)w();var b={betweenness:function(T){var N=l.collection(T).id();return v.get(N)},betweennessNormalized:function(T){if(d==0)return 0;var N=l.collection(T).id();return v.get(N)/d}};return b.betweennessNormalised=b.betweennessNormalized,b}};Pb.bc=Pb.betweennessCentrality;var EX=lr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),CX=function(t){return EX(t)},TX=function(t,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](t);return r},kX=function(t,n,r){for(var a=0;a<n;a++)t[a*n+a]=r},uL=function(t,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=t[i*n+a];for(var l=0;l<n;l++)t[l*n+a]=t[l*n+a]/r}},NX=function(t,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var l=0;l<r;l++)a[i*r+l]=0;for(var o=0;o<r;o++)for(var f=0;f<r;f++)a[i*r+f]+=t[i*r+o]*n[o*r+f]}return a},AX=function(t,n,r){for(var a=t.slice(0),i=1;i<r;i++)t=NX(t,a,n);return t},RX=function(t,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(t[i],r);return uL(a,n),a},jX=function(t,n,r,a){for(var i=0;i<r;i++){var l=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a),o=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(l!==o)return!1}return!0},DX=function(t,n,r,a){for(var i=[],l=0;l<n;l++){for(var o=[],f=0;f<n;f++)Math.round(t[l*n+f]*1e3)/1e3>0&&o.push(r[f]);o.length!==0&&i.push(a.collection(o))}return i},MX=function(t,n){for(var r=0;r<t.length;r++)if(!n[r]||t[r].id()!==n[r].id())return!1;return!0},OX=function(t){for(var n=0;n<t.length;n++)for(var r=0;r<t.length;r++)n!=r&&MX(t[n],t[r])&&t.splice(r,1);return t},eN=function(t){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=CX(t),l={},o=0;o<n.length;o++)l[n[o].id()]=o;for(var f=n.length,c=f*f,d=new Array(c),v,m=0;m<c;m++)d[m]=0;for(var y=0;y<r.length;y++){var x=r[y],w=l[x.source().id()],S=l[x.target().id()],b=TX(x,i.attributes);d[w*f+S]+=b,d[S*f+w]+=b}kX(d,f,i.multFactor),uL(d,f);for(var C=!0,T=0;C&&T<i.maxIterations;)C=!1,v=AX(d,f,i.expandFactor),d=RX(v,f,i.inflateFactor),jX(d,v,c,4)||(C=!0),T++;var N=DX(d,f,n,a);return N=OX(N),N},LX={markovClustering:eN,mcl:eN},_X=function(t){return t},cL=function(t,n){return Math.abs(n-t)},tN=function(t,n,r){return t+cL(n,r)},nN=function(t,n,r){return t+Math.pow(r-n,2)},BX=function(t){return Math.sqrt(t)},PX=function(t,n,r){return Math.max(t,cL(n,r))},yf=function(t,n,r,a,i){for(var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:_X,o=a,f,c,d=0;d<t;d++)f=n(d),c=r(d),o=i(o,f,c);return l(o)},Wu={euclidean:function(t,n,r){return t>=2?yf(t,n,r,0,nN,BX):yf(t,n,r,0,tN)},squaredEuclidean:function(t,n,r){return yf(t,n,r,0,nN)},manhattan:function(t,n,r){return yf(t,n,r,0,tN)},max:function(t,n,r){return yf(t,n,r,-1/0,PX)}};Wu["squared-euclidean"]=Wu.squaredEuclidean;Wu.squaredeuclidean=Wu.squaredEuclidean;function Xp(e,t,n,r,a,i){var l;return hn(e)?l=e:l=Wu[e]||Wu.euclidean,t===0&&hn(e)?l(a,i):l(t,n,r,a,i)}var zX=lr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Cw=function(t){return zX(t)},sp=function(t,n,r,a,i){var l=i!=="kMedoids",o=l?function(v){return r[v]}:function(v){return a[v](r)},f=function(m){return a[m](n)},c=r,d=n;return Xp(t,a.length,o,f,c,d)},Cx=function(t,n,r){for(var a=r.length,i=new Array(a),l=new Array(a),o=new Array(n),f=null,c=0;c<a;c++)i[c]=t.min(r[c]).value,l[c]=t.max(r[c]).value;for(var d=0;d<n;d++){f=[];for(var v=0;v<a;v++)f[v]=Math.random()*(l[v]-i[v])+i[v];o[d]=f}return o},fL=function(t,n,r,a,i){for(var l=1/0,o=0,f=0;f<n.length;f++){var c=sp(r,t,n[f],a,i);c<l&&(l=c,o=f)}return o},dL=function(t,n,r){for(var a=[],i=null,l=0;l<n.length;l++)i=n[l],r[i.id()]===t&&a.push(i);return a},IX=function(t,n,r){return Math.abs(n-t)<=r},FX=function(t,n,r){for(var a=0;a<t.length;a++)for(var i=0;i<t[a].length;i++){var l=Math.abs(t[a][i]-n[a][i]);if(l>r)return!1}return!0},qX=function(t,n,r){for(var a=0;a<r;a++)if(t===n[a])return!0;return!1},rN=function(t,n){var r=new Array(n);if(t.length<50)for(var a=0;a<n;a++){for(var i=t[Math.floor(Math.random()*t.length)];qX(i,r,a);)i=t[Math.floor(Math.random()*t.length)];r[a]=i}else for(var l=0;l<n;l++)r[l]=t[Math.floor(Math.random()*t.length)];return r},aN=function(t,n,r){for(var a=0,i=0;i<n.length;i++)a+=sp("manhattan",n[i],t,r,"kMedoids");return a},UX=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Cw(t),l=new Array(i.k),o={},f;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,f=Cx(r,i.k,i.attributes)):Fn(i.testCentroids)==="object"?f=i.testCentroids:f=Cx(r,i.k,i.attributes):f=Cx(r,i.k,i.attributes);for(var c=!0,d=0;c&&d<i.maxIterations;){for(var v=0;v<r.length;v++)a=r[v],o[a.id()]=fL(a,f,i.distance,i.attributes,"kMeans");c=!1;for(var m=0;m<i.k;m++){var y=dL(m,r,o);if(y.length!==0){for(var x=i.attributes.length,w=f[m],S=new Array(x),b=new Array(x),C=0;C<x;C++){b[C]=0;for(var T=0;T<y.length;T++)a=y[T],b[C]+=i.attributes[C](a);S[C]=b[C]/y.length,IX(S[C],w[C],i.sensitivityThreshold)||(c=!0)}f[m]=S,l[m]=n.collection(y)}}d++}return l},VX=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Cw(t),l=new Array(i.k),o,f={},c,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Fn(i.testCentroids)==="object"?o=i.testCentroids:o=rN(r,i.k)):o=rN(r,i.k);for(var v=!0,m=0;v&&m<i.maxIterations;){for(var y=0;y<r.length;y++)a=r[y],f[a.id()]=fL(a,o,i.distance,i.attributes,"kMedoids");v=!1;for(var x=0;x<o.length;x++){var w=dL(x,r,f);if(w.length!==0){d[x]=aN(o[x],w,i.attributes);for(var S=0;S<w.length;S++)c=aN(w[S],w,i.attributes),c<d[x]&&(d[x]=c,o[x]=w[S],v=!0);l[x]=n.collection(w)}}m++}return l},HX=function(t,n,r,a,i){for(var l,o,f=0;f<n.length;f++)for(var c=0;c<t.length;c++)a[f][c]=Math.pow(r[f][c],i.m);for(var d=0;d<t.length;d++)for(var v=0;v<i.attributes.length;v++){l=0,o=0;for(var m=0;m<n.length;m++)l+=a[m][d]*i.attributes[v](n[m]),o+=a[m][d];t[d][v]=l/o}},GX=function(t,n,r,a,i){for(var l=0;l<t.length;l++)n[l]=t[l].slice();for(var o,f,c,d=2/(i.m-1),v=0;v<r.length;v++)for(var m=0;m<a.length;m++){o=0;for(var y=0;y<r.length;y++)f=sp(i.distance,a[m],r[v],i.attributes,"cmeans"),c=sp(i.distance,a[m],r[y],i.attributes,"cmeans"),o+=Math.pow(f/c,d);t[m][v]=1/o}},$X=function(t,n,r,a){for(var i=new Array(r.k),l=0;l<i.length;l++)i[l]=[];for(var o,f,c=0;c<n.length;c++){o=-1/0,f=-1;for(var d=0;d<n[0].length;d++)n[c][d]>o&&(o=n[c][d],f=d);i[f].push(t[c])}for(var v=0;v<i.length;v++)i[v]=a.collection(i[v]);return i},iN=function(t){var n=this.cy(),r=this.nodes(),a=Cw(t),i,l,o,f,c;f=new Array(r.length);for(var d=0;d<r.length;d++)f[d]=new Array(a.k);o=new Array(r.length);for(var v=0;v<r.length;v++)o[v]=new Array(a.k);for(var m=0;m<r.length;m++){for(var y=0,x=0;x<a.k;x++)o[m][x]=Math.random(),y+=o[m][x];for(var w=0;w<a.k;w++)o[m][w]=o[m][w]/y}l=new Array(a.k);for(var S=0;S<a.k;S++)l[S]=new Array(a.attributes.length);c=new Array(r.length);for(var b=0;b<r.length;b++)c[b]=new Array(a.k);for(var C=!0,T=0;C&&T<a.maxIterations;)C=!1,HX(l,r,o,c,a),GX(o,f,l,r,a),FX(o,f,a.sensitivityThreshold)||(C=!0),T++;return i=$X(r,o,a,n),{clusters:i,degreeOfMembership:o}},KX={kMeans:UX,kMedoids:VX,fuzzyCMeans:iN,fcm:iN},YX=lr({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),XX={single:"min",complete:"max"},QX=function(t){var n=YX(t),r=XX[n.linkage];return r!=null&&(n.linkage=r),n},sN=function(t,n,r,a,i){for(var l=0,o=1/0,f,c=i.attributes,d=function(_,M){return Xp(i.distance,c.length,function(z){return c[z](_)},function(z){return c[z](M)},_,M)},v=0;v<t.length;v++){var m=t[v].key,y=r[m][a[m]];y<o&&(l=m,o=y)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&t.length===1)return!1;var x=n[l],w=n[a[l]],S;i.mode==="dendrogram"?S={left:x,right:w,key:x.key}:S={value:x.value.concat(w.value),key:x.key},t[x.index]=S,t.splice(w.index,1),n[x.key]=S;for(var b=0;b<t.length;b++){var C=t[b];x.key===C.key?f=1/0:i.linkage==="min"?(f=r[x.key][C.key],r[x.key][C.key]>r[w.key][C.key]&&(f=r[w.key][C.key])):i.linkage==="max"?(f=r[x.key][C.key],r[x.key][C.key]<r[w.key][C.key]&&(f=r[w.key][C.key])):i.linkage==="mean"?f=(r[x.key][C.key]*x.size+r[w.key][C.key]*w.size)/(x.size+w.size):i.mode==="dendrogram"?f=d(C.value,x.value):f=d(C.value[0],x.value[0]),r[x.key][C.key]=r[C.key][x.key]=f}for(var T=0;T<t.length;T++){var N=t[T].key;if(a[N]===x.key||a[N]===w.key){for(var A=N,R=0;R<t.length;R++){var D=t[R].key;r[N][D]<r[N][A]&&(A=D)}a[N]=A}t[T].index=T}return x.key=w.key=x.index=w.index=null,!0},Cu=function(t,n,r){t&&(t.value?n.push(t.value):(t.left&&Cu(t.left,n),t.right&&Cu(t.right,n)))},zb=function(t,n){if(!t)return"";if(t.left&&t.right){var r=zb(t.left,n),a=zb(t.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(t.value)return t.value.id()},Ib=function(t,n,r){if(!t)return[];var a=[],i=[],l=[];return n===0?(t.left&&Cu(t.left,a),t.right&&Cu(t.right,i),l=a.concat(i),[r.collection(l)]):n===1?t.value?[r.collection(t.value)]:(t.left&&Cu(t.left,a),t.right&&Cu(t.right,i),[r.collection(a),r.collection(i)]):t.value?[r.collection(t.value)]:(t.left&&(a=Ib(t.left,n-1,r)),t.right&&(i=Ib(t.right,n-1,r)),a.concat(i))},lN=function(t){for(var n=this.cy(),r=this.nodes(),a=QX(t),i=a.attributes,l=function(T,N){return Xp(a.distance,i.length,function(A){return i[A](T)},function(A){return i[A](N)},T,N)},o=[],f=[],c=[],d=[],v=0;v<r.length;v++){var m={value:a.mode==="dendrogram"?r[v]:[r[v]],key:v,index:v};o[v]=m,d[v]=m,f[v]=[],c[v]=0}for(var y=0;y<o.length;y++)for(var x=0;x<=y;x++){var w=void 0;a.mode==="dendrogram"?w=y===x?1/0:l(o[y].value,o[x].value):w=y===x?1/0:l(o[y].value[0],o[x].value[0]),f[y][x]=w,f[x][y]=w,w<f[y][c[y]]&&(c[y]=x)}for(var S=sN(o,d,f,c,a);S;)S=sN(o,d,f,c,a);var b;return a.mode==="dendrogram"?(b=Ib(o[0],a.dendrogramDepth,n),a.addDendrogram&&zb(o[0],n)):(b=new Array(o.length),o.forEach(function(C,T){C.key=C.index=null,b[T]=n.collection(C.value)})),b},WX={hierarchicalClustering:lN,hca:lN},ZX=lr({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),JX=function(t){var n=t.damping,r=t.preference;.5<=n&&n<1||ln("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||Re(r)||ln("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),ZX(t)},eQ=function(t,n,r,a){var i=function(o,f){return a[f](o)};return-Xp(t,a.length,function(l){return i(n,l)},function(l){return i(r,l)},n,r)},tQ=function(t,n){var r=null;return n==="median"?r=JY(t):n==="mean"?r=ZY(t):n==="min"?r=QY(t):n==="max"?r=WY(t):r=n,r},nQ=function(t,n,r){for(var a=[],i=0;i<t;i++)n[i*t+i]+r[i*t+i]>0&&a.push(i);return a},oN=function(t,n,r){for(var a=[],i=0;i<t;i++){for(var l=-1,o=-1/0,f=0;f<r.length;f++){var c=r[f];n[i*t+c]>o&&(l=c,o=n[i*t+c])}l>0&&a.push(l)}for(var d=0;d<r.length;d++)a[r[d]]=r[d];return a},rQ=function(t,n,r){for(var a=oN(t,n,r),i=0;i<r.length;i++){for(var l=[],o=0;o<a.length;o++)a[o]===r[i]&&l.push(o);for(var f=-1,c=-1/0,d=0;d<l.length;d++){for(var v=0,m=0;m<l.length;m++)v+=n[l[m]*t+l[d]];v>c&&(f=d,c=v)}r[i]=l[f]}return a=oN(t,n,r),a},uN=function(t){for(var n=this.cy(),r=this.nodes(),a=JX(t),i={},l=0;l<r.length;l++)i[r[l].id()]=l;var o,f,c,d,v,m;o=r.length,f=o*o,c=new Array(f);for(var y=0;y<f;y++)c[y]=-1/0;for(var x=0;x<o;x++)for(var w=0;w<o;w++)x!==w&&(c[x*o+w]=eQ(a.distance,r[x],r[w],a.attributes));d=tQ(c,a.preference);for(var S=0;S<o;S++)c[S*o+S]=d;v=new Array(f);for(var b=0;b<f;b++)v[b]=0;m=new Array(f);for(var C=0;C<f;C++)m[C]=0;for(var T=new Array(o),N=new Array(o),A=new Array(o),R=0;R<o;R++)T[R]=0,N[R]=0,A[R]=0;for(var D=new Array(o*a.minIterations),L=0;L<D.length;L++)D[L]=0;var _;for(_=0;_<a.maxIterations;_++){for(var M=0;M<o;M++){for(var z=-1/0,P=-1/0,G=-1,I=0,F=0;F<o;F++)T[F]=v[M*o+F],I=m[M*o+F]+c[M*o+F],I>=z?(P=z,z=I,G=F):I>P&&(P=I);for(var B=0;B<o;B++)v[M*o+B]=(1-a.damping)*(c[M*o+B]-z)+a.damping*T[B];v[M*o+G]=(1-a.damping)*(c[M*o+G]-P)+a.damping*T[G]}for(var H=0;H<o;H++){for(var Y=0,Q=0;Q<o;Q++)T[Q]=m[Q*o+H],N[Q]=Math.max(0,v[Q*o+H]),Y+=N[Q];Y-=N[H],N[H]=v[H*o+H],Y+=N[H];for(var V=0;V<o;V++)m[V*o+H]=(1-a.damping)*Math.min(0,Y-N[V])+a.damping*T[V];m[H*o+H]=(1-a.damping)*(Y-N[H])+a.damping*T[H]}for(var q=0,X=0;X<o;X++){var U=m[X*o+X]+v[X*o+X]>0?1:0;D[_%a.minIterations*o+X]=U,q+=U}if(q>0&&(_>=a.minIterations-1||_==a.maxIterations-1)){for(var te=0,ie=0;ie<o;ie++){A[ie]=0;for(var oe=0;oe<a.minIterations;oe++)A[ie]+=D[oe*o+ie];(A[ie]===0||A[ie]===a.minIterations)&&te++}if(te===o)break}}for(var ae=nQ(o,v,m),we=rQ(o,c,ae),fe={},J=0;J<ae.length;J++)fe[ae[J]]=[];for(var ne=0;ne<r.length;ne++){var re=i[r[ne].id()],ge=we[re];ge!=null&&fe[ge].push(r[ne])}for(var ke=new Array(ae.length),Be=0;Be<ae.length;Be++)ke[Be]=n.collection(fe[ae[Be]]);return ke},aQ={affinityPropagation:uN,ap:uN},iQ=lr({root:void 0,directed:!1}),sQ={hierholzer:function(t){if(!jt(t)){var n=arguments;t={root:n[0],directed:n[1]}}var r=iQ(t),a=r.root,i=r.directed,l=this,o=!1,f,c,d;a&&(d=et(a)?this.filter(a)[0].id():a[0].id());var v={},m={};i?l.forEach(function(C){var T=C.id();if(C.isNode()){var N=C.indegree(!0),A=C.outdegree(!0),R=N-A,D=A-N;R==1?f?o=!0:f=T:D==1?c?o=!0:c=T:(D>1||R>1)&&(o=!0),v[T]=[],C.outgoers().forEach(function(L){L.isEdge()&&v[T].push(L.id())})}else m[T]=[void 0,C.target().id()]}):l.forEach(function(C){var T=C.id();if(C.isNode()){var N=C.degree(!0);N%2&&(f?c?o=!0:c=T:f=T),v[T]=[],C.connectedEdges().forEach(function(A){return v[T].push(A.id())})}else m[T]=[C.source().id(),C.target().id()]});var y={found:!1,trail:void 0};if(o)return y;if(c&&f)if(i){if(d&&c!=d)return y;d=c}else{if(d&&c!=d&&f!=d)return y;d||(d=c)}else d||(d=l[0].id());var x=function(T){for(var N=T,A=[T],R,D,L;v[N].length;)R=v[N].shift(),D=m[R][0],L=m[R][1],N!=L?(v[L]=v[L].filter(function(_){return _!=R}),N=L):!i&&N!=D&&(v[D]=v[D].filter(function(_){return _!=R}),N=D),A.unshift(R),A.unshift(N);return A},w=[],S=[];for(S=x(d);S.length!=1;)v[S[0]].length==0?(w.unshift(l.getElementById(S.shift())),w.unshift(l.getElementById(S.shift()))):S=x(S.shift()).concat(S);w.unshift(l.getElementById(S.shift()));for(var b in v)if(v[b].length)return y;return y.found=!0,y.trail=this.spawn(w,!0),y}},ov=function(){var t=this,n={},r=0,a=0,i=[],l=[],o={},f=function(m,y){for(var x=l.length-1,w=[],S=t.spawn();l[x].x!=m||l[x].y!=y;)w.push(l.pop().edge),x--;w.push(l.pop().edge),w.forEach(function(b){var C=b.connectedNodes().intersection(t);S.merge(b),C.forEach(function(T){var N=T.id(),A=T.connectedEdges().intersection(t);S.merge(T),n[N].cutVertex?S.merge(A.filter(function(R){return R.isLoop()})):S.merge(A)})}),i.push(S)},c=function(m,y,x){m===x&&(a+=1),n[y]={id:r,low:r++,cutVertex:!1};var w=t.getElementById(y).connectedEdges().intersection(t);if(w.size()===0)i.push(t.spawn(t.getElementById(y)));else{var S,b,C,T;w.forEach(function(N){S=N.source().id(),b=N.target().id(),C=S===y?b:S,C!==x&&(T=N.id(),o[T]||(o[T]=!0,l.push({x:y,y:C,edge:N})),C in n?n[y].low=Math.min(n[y].low,n[C].id):(c(m,C,y),n[y].low=Math.min(n[y].low,n[C].low),n[y].id<=n[C].low&&(n[y].cutVertex=!0,f(y,C))))})}};t.forEach(function(v){if(v.isNode()){var m=v.id();m in n||(a=0,c(m,m),n[m].cutVertex=a>1)}});var d=Object.keys(n).filter(function(v){return n[v].cutVertex}).map(function(v){return t.getElementById(v)});return{cut:t.spawn(d),components:i}},lQ={hopcroftTarjanBiconnected:ov,htbc:ov,htb:ov,hopcroftTarjanBiconnectedComponents:ov},uv=function(){var t=this,n={},r=0,a=[],i=[],l=t.spawn(t),o=function(c){i.push(c),n[c]={index:r,low:r++,explored:!1};var d=t.getElementById(c).connectedEdges().intersection(t);if(d.forEach(function(w){var S=w.target().id();S!==c&&(S in n||o(S),n[S].explored||(n[c].low=Math.min(n[c].low,n[S].low)))}),n[c].index===n[c].low){for(var v=t.spawn();;){var m=i.pop();if(v.merge(t.getElementById(m)),n[m].low=n[c].index,n[m].explored=!0,m===c)break}var y=v.edgesWith(v),x=v.merge(y);a.push(x),l=l.difference(x)}};return t.forEach(function(f){if(f.isNode()){var c=f.id();c in n||o(c)}}),{cut:l,components:a}},oQ={tarjanStronglyConnected:uv,tsc:uv,tscc:uv,tarjanStronglyConnectedComponents:uv},hL={};[Yf,zY,IY,qY,VY,GY,YY,wX,Mu,Ou,Pb,LX,KX,WX,aQ,sQ,lQ,oQ].forEach(function(e){rt(hL,e)});/*!
|
|
461
|
+
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
462
|
+
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
463
|
+
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
464
|
+
*/var vL=0,pL=1,mL=2,za=function(t){if(!(this instanceof za))return new za(t);this.id="Thenable/1.0.7",this.state=vL,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof t=="function"&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};za.prototype={fulfill:function(t){return cN(this,pL,"fulfillValue",t)},reject:function(t){return cN(this,mL,"rejectReason",t)},then:function(t,n){var r=this,a=new za;return r.onFulfilled.push(dN(t,a,"fulfill")),r.onRejected.push(dN(n,a,"reject")),gL(r),a.proxy}};var cN=function(t,n,r,a){return t.state===vL&&(t.state=n,t[r]=a,gL(t)),t},gL=function(t){t.state===pL?fN(t,"onFulfilled",t.fulfillValue):t.state===mL&&fN(t,"onRejected",t.rejectReason)},fN=function(t,n,r){if(t[n].length!==0){var a=t[n];t[n]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](r)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},dN=function(t,n,r){return function(a){if(typeof t!="function")n[r].call(n,a);else{var i;try{i=t(a)}catch(l){n.reject(l);return}yL(n,i)}}},yL=function(t,n){if(t===n||t.proxy===n){t.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(Fn(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(i){t.reject(i);return}if(typeof r=="function"){var a=!1;try{r.call(n,function(i){a||(a=!0,i===n?t.reject(new TypeError("circular thenable chain")):yL(t,i))},function(i){a||(a=!0,t.reject(i))})}catch(i){a||t.reject(i)}return}t.fulfill(n)};za.all=function(e){return new za(function(t,n){for(var r=new Array(e.length),a=0,i=function(f,c){r[f]=c,a++,a===e.length&&t(r)},l=0;l<e.length;l++)(function(o){var f=e[o],c=f!=null&&f.then!=null;if(c)f.then(function(v){i(o,v)},function(v){n(v)});else{var d=f;i(o,d)}})(l)})};za.resolve=function(e){return new za(function(t,n){t(e)})};za.reject=function(e){return new za(function(t,n){n(e)})};var dc=typeof Promise<"u"?Promise:za,Fb=function(t,n,r){var a=vw(t),i=!a,l=this._private=rt({duration:1e3},n,r);if(l.target=t,l.style=l.style||l.css,l.started=!1,l.playing=!1,l.hooked=!1,l.applying=!1,l.progress=0,l.completes=[],l.frames=[],l.complete&&hn(l.complete)&&l.completes.push(l.complete),i){var o=t.position();l.startPosition=l.startPosition||{x:o.x,y:o.y},l.startStyle=l.startStyle||t.cy().style().getAnimationStartStyle(t,l.style)}if(a){var f=t.pan();l.startPan={x:f.x,y:f.y},l.startZoom=t.zoom()}this.length=1,this[0]=this},yo=Fb.prototype;rt(yo,{instanceString:function(){return"animation"},hook:function(){var t=this._private;if(!t.hooked){var n,r=t.target._private.animation;t.queue?n=r.queue:n=r.current,n.push(this),na(t.target)&&t.target.cy().addToAnimationPool(t.target),t.hooked=!0}return this},play:function(){var t=this._private;return t.progress===1&&(t.progress=0),t.playing=!0,t.started=!1,t.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var t=this._private;return t.applying=!0,t.started=!1,t.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var t=this._private;return t.playing=!1,t.started=!1,this},stop:function(){var t=this._private;return t.playing=!1,t.started=!1,t.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(t){var n=this._private;return t===void 0?n.progress*n.duration:this.progress(t/n.duration)},progress:function(t){var n=this._private,r=n.playing;return t===void 0?n.progress:(r&&this.pause(),n.progress=t,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var t=this._private,n=t.playing;n&&this.pause(),t.progress=1-t.progress,t.started=!1;var r=function(c,d){var v=t[c];v!=null&&(t[c]=t[d],t[d]=v)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),t.style)for(var a=0;a<t.style.length;a++){var i=t.style[a],l=i.name,o=t.startStyle[l];t.startStyle[l]=i,t.style[a]=o}return n&&this.play(),this},promise:function(t){var n=this._private,r;switch(t){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new dc(function(a,i){r.push(function(){a()})})}});yo.complete=yo.completed;yo.run=yo.play;yo.running=yo.playing;var uQ={animated:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return!1;var l=a[0];if(l)return l._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var l=0;l<a.length;l++){var o=a[l];o._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this,f=!i,c=!f;if(!o.styleEnabled())return this;var d=o.style();n=rt({},n,r);var v=Object.keys(n).length===0;if(v)return new Fb(l[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(c&&(n.style=d.getPropsList(n.style||n.css),n.css=void 0),c&&n.renderedPosition!=null){var m=n.renderedPosition,y=o.pan(),x=o.zoom();n.position=rL(m,x,y)}if(f&&n.panBy!=null){var w=n.panBy,S=o.pan();n.pan={x:S.x+w.x,y:S.y+w.y}}var b=n.center||n.centre;if(f&&b!=null){var C=o.getCenterPan(b.eles,n.zoom);C!=null&&(n.pan=C)}if(f&&n.fit!=null){var T=n.fit,N=o.getFitViewport(T.eles||T.boundingBox,T.padding);N!=null&&(n.pan=N.pan,n.zoom=N.zoom)}if(f&&jt(n.zoom)){var A=o.getZoomedViewport(n.zoom);A!=null?(A.zoomed&&(n.zoom=A.zoom),A.panned&&(n.pan=A.pan)):n.zoom=null}return new Fb(l[0],n)}},animate:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;r&&(n=rt({},n,r));for(var f=0;f<l.length;f++){var c=l[f],d=c.animated()&&(n.queue===void 0||n.queue),v=c.animation(n,d?{queue:!0}:void 0);v.play()}return this}},stop:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var f=0;f<l.length;f++){for(var c=l[f],d=c._private,v=d.animation.current,m=0;m<v.length;m++){var y=v[m],x=y._private;r&&(x.duration=0)}n&&(d.animation.queue=[]),r||(d.animation.current=[])}return o.notify("draw"),this}}},Tx,hN;function Qp(){if(hN)return Tx;hN=1;var e=Array.isArray;return Tx=e,Tx}var kx,vN;function cQ(){if(vN)return kx;vN=1;var e=Qp(),t=Ed(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,l){if(e(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||l!=null&&i in Object(l)}return kx=a,kx}var Nx,pN;function fQ(){if(pN)return Nx;pN=1;var e=YO(),t=Sd(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function l(o){if(!t(o))return!1;var f=e(o);return f==r||f==a||f==n||f==i}return Nx=l,Nx}var Ax,mN;function dQ(){if(mN)return Ax;mN=1;var e=$p(),t=e["__core-js_shared__"];return Ax=t,Ax}var Rx,gN;function hQ(){if(gN)return Rx;gN=1;var e=dQ(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Rx=n,Rx}var jx,yN;function vQ(){if(yN)return jx;yN=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return jx=n,jx}var Dx,xN;function pQ(){if(xN)return Dx;xN=1;var e=fQ(),t=hQ(),n=Sd(),r=vQ(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,l=Function.prototype,o=Object.prototype,f=l.toString,c=o.hasOwnProperty,d=RegExp("^"+f.call(c).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(m){if(!n(m)||t(m))return!1;var y=e(m)?d:i;return y.test(r(m))}return Dx=v,Dx}var Mx,bN;function mQ(){if(bN)return Mx;bN=1;function e(t,n){return t==null?void 0:t[n]}return Mx=e,Mx}var Ox,wN;function Tw(){if(wN)return Ox;wN=1;var e=pQ(),t=mQ();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Ox=n,Ox}var Lx,SN;function Wp(){if(SN)return Lx;SN=1;var e=Tw(),t=e(Object,"create");return Lx=t,Lx}var _x,EN;function gQ(){if(EN)return _x;EN=1;var e=Wp();function t(){this.__data__=e?e(null):{},this.size=0}return _x=t,_x}var Bx,CN;function yQ(){if(CN)return Bx;CN=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Bx=e,Bx}var Px,TN;function xQ(){if(TN)return Px;TN=1;var e=Wp(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var l=this.__data__;if(e){var o=l[i];return o===t?void 0:o}return r.call(l,i)?l[i]:void 0}return Px=a,Px}var zx,kN;function bQ(){if(kN)return zx;kN=1;var e=Wp(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return zx=r,zx}var Ix,NN;function wQ(){if(NN)return Ix;NN=1;var e=Wp(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return Ix=n,Ix}var Fx,AN;function SQ(){if(AN)return Fx;AN=1;var e=gQ(),t=yQ(),n=xQ(),r=bQ(),a=wQ();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Fx=i,Fx}var qx,RN;function EQ(){if(RN)return qx;RN=1;function e(){this.__data__=[],this.size=0}return qx=e,qx}var Ux,jN;function xL(){if(jN)return Ux;jN=1;function e(t,n){return t===n||t!==t&&n!==n}return Ux=e,Ux}var Vx,DN;function Zp(){if(DN)return Vx;DN=1;var e=xL();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Vx=t,Vx}var Hx,MN;function CQ(){if(MN)return Hx;MN=1;var e=Zp(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,l=e(i,a);if(l<0)return!1;var o=i.length-1;return l==o?i.pop():n.call(i,l,1),--this.size,!0}return Hx=r,Hx}var Gx,ON;function TQ(){if(ON)return Gx;ON=1;var e=Zp();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Gx=t,Gx}var $x,LN;function kQ(){if(LN)return $x;LN=1;var e=Zp();function t(n){return e(this.__data__,n)>-1}return $x=t,$x}var Kx,_N;function NQ(){if(_N)return Kx;_N=1;var e=Zp();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return Kx=t,Kx}var Yx,BN;function AQ(){if(BN)return Yx;BN=1;var e=EQ(),t=CQ(),n=TQ(),r=kQ(),a=NQ();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Yx=i,Yx}var Xx,PN;function RQ(){if(PN)return Xx;PN=1;var e=Tw(),t=$p(),n=e(t,"Map");return Xx=n,Xx}var Qx,zN;function jQ(){if(zN)return Qx;zN=1;var e=SQ(),t=AQ(),n=RQ();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Qx=r,Qx}var Wx,IN;function DQ(){if(IN)return Wx;IN=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Wx=e,Wx}var Zx,FN;function Jp(){if(FN)return Zx;FN=1;var e=DQ();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Zx=t,Zx}var Jx,qN;function MQ(){if(qN)return Jx;qN=1;var e=Jp();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Jx=t,Jx}var e0,UN;function OQ(){if(UN)return e0;UN=1;var e=Jp();function t(n){return e(this,n).get(n)}return e0=t,e0}var t0,VN;function LQ(){if(VN)return t0;VN=1;var e=Jp();function t(n){return e(this,n).has(n)}return t0=t,t0}var n0,HN;function _Q(){if(HN)return n0;HN=1;var e=Jp();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return n0=t,n0}var r0,GN;function BQ(){if(GN)return r0;GN=1;var e=jQ(),t=MQ(),n=OQ(),r=LQ(),a=_Q();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,r0=i,r0}var a0,$N;function PQ(){if($N)return a0;$N=1;var e=BQ(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var l=arguments,o=a?a.apply(this,l):l[0],f=i.cache;if(f.has(o))return f.get(o);var c=r.apply(this,l);return i.cache=f.set(o,c)||f,c};return i.cache=new(n.Cache||e),i}return n.Cache=e,a0=n,a0}var i0,KN;function zQ(){if(KN)return i0;KN=1;var e=PQ(),t=500;function n(r){var a=e(r,function(l){return i.size===t&&i.clear(),l}),i=a.cache;return a}return i0=n,i0}var s0,YN;function bL(){if(YN)return s0;YN=1;var e=zQ(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(l,o,f,c){i.push(f?c.replace(n,"$1"):o||l)}),i});return s0=r,s0}var l0,XN;function wL(){if(XN)return l0;XN=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=Array(a);++r<a;)i[r]=n(t[r],r,t);return i}return l0=e,l0}var o0,QN;function IQ(){if(QN)return o0;QN=1;var e=mw(),t=wL(),n=Qp(),r=Ed(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function l(o){if(typeof o=="string")return o;if(n(o))return t(o,l)+"";if(r(o))return i?i.call(o):"";var f=o+"";return f=="0"&&1/o==-1/0?"-0":f}return o0=l,o0}var u0,WN;function SL(){if(WN)return u0;WN=1;var e=IQ();function t(n){return n==null?"":e(n)}return u0=t,u0}var c0,ZN;function EL(){if(ZN)return c0;ZN=1;var e=Qp(),t=cQ(),n=bL(),r=SL();function a(i,l){return e(i)?i:t(i,l)?[i]:n(r(i))}return c0=a,c0}var f0,JN;function kw(){if(JN)return f0;JN=1;var e=Ed();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return f0=t,f0}var d0,eA;function FQ(){if(eA)return d0;eA=1;var e=EL(),t=kw();function n(r,a){a=e(a,r);for(var i=0,l=a.length;r!=null&&i<l;)r=r[t(a[i++])];return i&&i==l?r:void 0}return d0=n,d0}var h0,tA;function qQ(){if(tA)return h0;tA=1;var e=FQ();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return h0=t,h0}var UQ=qQ(),VQ=wd(UQ),v0,nA;function HQ(){if(nA)return v0;nA=1;var e=Tw(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return v0=t,v0}var p0,rA;function GQ(){if(rA)return p0;rA=1;var e=HQ();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return p0=t,p0}var m0,aA;function $Q(){if(aA)return m0;aA=1;var e=GQ(),t=xL(),n=Object.prototype,r=n.hasOwnProperty;function a(i,l,o){var f=i[l];(!(r.call(i,l)&&t(f,o))||o===void 0&&!(l in i))&&e(i,l,o)}return m0=a,m0}var g0,iA;function KQ(){if(iA)return g0;iA=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var i=typeof r;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return g0=n,g0}var y0,sA;function YQ(){if(sA)return y0;sA=1;var e=$Q(),t=EL(),n=KQ(),r=Sd(),a=kw();function i(l,o,f,c){if(!r(l))return l;o=t(o,l);for(var d=-1,v=o.length,m=v-1,y=l;y!=null&&++d<v;){var x=a(o[d]),w=f;if(x==="__proto__"||x==="constructor"||x==="prototype")return l;if(d!=m){var S=y[x];w=c?c(S,x,y):void 0,w===void 0&&(w=r(S)?S:n(o[d+1])?[]:{})}e(y,x,w),y=y[x]}return l}return y0=i,y0}var x0,lA;function XQ(){if(lA)return x0;lA=1;var e=YQ();function t(n,r,a){return n==null?n:e(n,r,a)}return x0=t,x0}var QQ=XQ(),WQ=wd(QQ),b0,oA;function ZQ(){if(oA)return b0;oA=1;function e(t,n){var r=-1,a=t.length;for(n||(n=Array(a));++r<a;)n[r]=t[r];return n}return b0=e,b0}var w0,uA;function JQ(){if(uA)return w0;uA=1;var e=wL(),t=ZQ(),n=Qp(),r=Ed(),a=bL(),i=kw(),l=SL();function o(f){return n(f)?e(f,i):r(f)?[f]:t(a(l(f)))}return w0=o,w0}var eW=JQ(),tW=wd(eW),nW={data:function(t){var n={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return t=rt({},n,t),function(a,i){var l=t,o=this,f=o.length!==void 0,c=f?o:[o],d=f?o[0]:o;if(et(a)){var v=a.indexOf(".")!==-1,m=v&&tW(a);if(l.allowGetting&&i===void 0){var y;return d&&(l.beforeGet(d),m&&d._private[l.field][a]===void 0?y=VQ(d._private[l.field],m):y=d._private[l.field][a]),y}else if(l.allowSetting&&i!==void 0){var x=!l.immutableKeys[a];if(x){var w=zO({},a,i);l.beforeSet(o,w);for(var S=0,b=c.length;S<b;S++){var C=c[S];l.canSet(C)&&(m&&d._private[l.field][a]===void 0?WQ(C._private[l.field],m,i):C._private[l.field][a]=i)}l.updateStyle&&o.updateStyle(),l.onSet(o),l.settingTriggersEvent&&o[l.triggerFnName](l.settingEvent)}}}else if(l.allowSetting&&jt(a)){var T=a,N,A,R=Object.keys(T);l.beforeSet(o,T);for(var D=0;D<R.length;D++){N=R[D],A=T[N];var L=!l.immutableKeys[N];if(L)for(var _=0;_<c.length;_++){var M=c[_];l.canSet(M)&&(M._private[l.field][N]=A)}}l.updateStyle&&o.updateStyle(),l.onSet(o),l.settingTriggersEvent&&o[l.triggerFnName](l.settingEvent)}else if(l.allowBinding&&hn(a)){var z=a;o.on(l.bindingEvent,z)}else if(l.allowGetting&&a===void 0){var P;return d&&(l.beforeGet(d),P=d._private[l.field]),P}return o}},removeData:function(t){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=rt({},n,t),function(a){var i=t,l=this,o=l.length!==void 0,f=o?l:[l];if(et(a)){for(var c=a.split(/\s+/),d=c.length,v=0;v<d;v++){var m=c[v];if(!ol(m)){var y=!i.immutableKeys[m];if(y)for(var x=0,w=f.length;x<w;x++)f[x]._private[i.field][m]=void 0}}i.triggerEvent&&l[i.triggerFnName](i.event)}else if(a===void 0){for(var S=0,b=f.length;S<b;S++)for(var C=f[S]._private[i.field],T=Object.keys(C),N=0;N<T.length;N++){var A=T[N],R=!i.immutableKeys[A];R&&(C[A]=void 0)}i.triggerEvent&&l[i.triggerFnName](i.event)}return l}}},rW={eventAliasesOn:function(t){var n=t;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,a){var i=this,l=Array.prototype.slice.call(arguments,0);return new dc(function(o,f){var c=function(y){i.off.apply(i,v),o(y)},d=l.concat([c]),v=d.concat([]);i.on.apply(i,d)})}}},_t={};[uQ,nW,rW].forEach(function(e){rt(_t,e)});var aW={animate:_t.animate(),animation:_t.animation(),animated:_t.animated(),clearQueue:_t.clearQueue(),delay:_t.delay(),delayAnimation:_t.delayAnimation(),stop:_t.stop()},jv={classes:function(t){var n=this;if(t===void 0){var r=[];return n[0]._private.classes.forEach(function(x){return r.push(x)}),r}else $t(t)||(t=(t||"").match(/\S+/g)||[]);for(var a=[],i=new fc(t),l=0;l<n.length;l++){for(var o=n[l],f=o._private,c=f.classes,d=!1,v=0;v<t.length;v++){var m=t[v],y=c.has(m);if(!y){d=!0;break}}d||(d=c.size!==t.length),d&&(f.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},addClass:function(t){return this.toggleClass(t,!0)},hasClass:function(t){var n=this[0];return n!=null&&n._private.classes.has(t)},toggleClass:function(t,n){$t(t)||(t=t.match(/\S+/g)||[]);for(var r=this,a=n===void 0,i=[],l=0,o=r.length;l<o;l++)for(var f=r[l],c=f._private.classes,d=!1,v=0;v<t.length;v++){var m=t[v],y=c.has(m),x=!1;n||a&&!y?(c.add(m),x=!0):(!n||a&&y)&&(c.delete(m),x=!0),!d&&x&&(i.push(f),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(t){return this.toggleClass(t,!1)},flashClass:function(t,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(t),setTimeout(function(){r.removeClass(t)},n),r}};jv.className=jv.classNames=jv.classes;var Rt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:In,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Rt.variable="(?:[\\w-.]|(?:\\\\"+Rt.metaChar+"))+";Rt.className="(?:[\\w-]|(?:\\\\"+Rt.metaChar+"))+";Rt.value=Rt.string+"|"+Rt.number;Rt.id=Rt.variable;(function(){var e,t,n;for(e=Rt.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],Rt.comparatorOp+="|@"+t;for(e=Rt.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],!(t.indexOf("!")>=0)&&t!=="="&&(Rt.comparatorOp+="|\\!"+t)})();var Ht=function(){return{checks:[]}},Fe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},qb=[{selector:":selected",matches:function(t){return t.selected()}},{selector:":unselected",matches:function(t){return!t.selected()}},{selector:":selectable",matches:function(t){return t.selectable()}},{selector:":unselectable",matches:function(t){return!t.selectable()}},{selector:":locked",matches:function(t){return t.locked()}},{selector:":unlocked",matches:function(t){return!t.locked()}},{selector:":visible",matches:function(t){return t.visible()}},{selector:":hidden",matches:function(t){return!t.visible()}},{selector:":transparent",matches:function(t){return t.transparent()}},{selector:":grabbed",matches:function(t){return t.grabbed()}},{selector:":free",matches:function(t){return!t.grabbed()}},{selector:":removed",matches:function(t){return t.removed()}},{selector:":inside",matches:function(t){return!t.removed()}},{selector:":grabbable",matches:function(t){return t.grabbable()}},{selector:":ungrabbable",matches:function(t){return!t.grabbable()}},{selector:":animated",matches:function(t){return t.animated()}},{selector:":unanimated",matches:function(t){return!t.animated()}},{selector:":parent",matches:function(t){return t.isParent()}},{selector:":childless",matches:function(t){return t.isChildless()}},{selector:":child",matches:function(t){return t.isChild()}},{selector:":orphan",matches:function(t){return t.isOrphan()}},{selector:":nonorphan",matches:function(t){return t.isChild()}},{selector:":compound",matches:function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}},{selector:":loop",matches:function(t){return t.isLoop()}},{selector:":simple",matches:function(t){return t.isSimple()}},{selector:":active",matches:function(t){return t.active()}},{selector:":inactive",matches:function(t){return!t.active()}},{selector:":backgrounding",matches:function(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function(t){return!t.backgrounding()}}].sort(function(e,t){return nY(e.selector,t.selector)}),iW=(function(){for(var e={},t,n=0;n<qb.length;n++)t=qb[n],e[t.selector]=t.matches;return e})(),sW=function(t,n){return iW[t](n)},lW="("+qb.map(function(e){return e.selector}).join("|")+")",du=function(t){return t.replace(new RegExp("\\\\("+Rt.metaChar+")","g"),function(n,r){return r})},_s=function(t,n,r){t[t.length-1]=r},Ub=[{name:"group",query:!0,regex:"("+Rt.group+")",populate:function(t,n,r){var a=On(r,1),i=a[0];n.checks.push({type:Fe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:lW,populate:function(t,n,r){var a=On(r,1),i=a[0];n.checks.push({type:Fe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Rt.id+")",populate:function(t,n,r){var a=On(r,1),i=a[0];n.checks.push({type:Fe.ID,value:du(i)})}},{name:"className",query:!0,regex:"\\.("+Rt.className+")",populate:function(t,n,r){var a=On(r,1),i=a[0];n.checks.push({type:Fe.CLASS,value:du(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Rt.variable+")\\s*\\]",populate:function(t,n,r){var a=On(r,1),i=a[0];n.checks.push({type:Fe.DATA_EXIST,field:du(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Rt.variable+")\\s*("+Rt.comparatorOp+")\\s*("+Rt.value+")\\s*\\]",populate:function(t,n,r){var a=On(r,3),i=a[0],l=a[1],o=a[2],f=new RegExp("^"+Rt.string+"$").exec(o)!=null;f?o=o.substring(1,o.length-1):o=parseFloat(o),n.checks.push({type:Fe.DATA_COMPARE,field:du(i),operator:l,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Rt.boolOp+")\\s*("+Rt.variable+")\\s*\\]",populate:function(t,n,r){var a=On(r,2),i=a[0],l=a[1];n.checks.push({type:Fe.DATA_BOOL,field:du(l),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Rt.meta+")\\s*("+Rt.comparatorOp+")\\s*("+Rt.number+")\\s*\\]\\]",populate:function(t,n,r){var a=On(r,3),i=a[0],l=a[1],o=a[2];n.checks.push({type:Fe.META_COMPARE,field:du(i),operator:l,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Rt.separator,populate:function(t,n){var r=t.currentSubject,a=t.edgeCount,i=t.compoundCount,l=t[t.length-1];r!=null&&(l.subject=r,t.currentSubject=null),l.edgeCount=a,l.compoundCount=i,t.edgeCount=0,t.compoundCount=0;var o=t[t.length++]=Ht();return o}},{name:"directedEdge",separator:!0,regex:Rt.directedEdge,populate:function(t,n){if(t.currentSubject==null){var r=Ht(),a=n,i=Ht();return r.checks.push({type:Fe.DIRECTED_EDGE,source:a,target:i}),_s(t,n,r),t.edgeCount++,i}else{var l=Ht(),o=n,f=Ht();return l.checks.push({type:Fe.NODE_SOURCE,source:o,target:f}),_s(t,n,l),t.edgeCount++,f}}},{name:"undirectedEdge",separator:!0,regex:Rt.undirectedEdge,populate:function(t,n){if(t.currentSubject==null){var r=Ht(),a=n,i=Ht();return r.checks.push({type:Fe.UNDIRECTED_EDGE,nodes:[a,i]}),_s(t,n,r),t.edgeCount++,i}else{var l=Ht(),o=n,f=Ht();return l.checks.push({type:Fe.NODE_NEIGHBOR,node:o,neighbor:f}),_s(t,n,l),f}}},{name:"child",separator:!0,regex:Rt.child,populate:function(t,n){if(t.currentSubject==null){var r=Ht(),a=Ht(),i=t[t.length-1];return r.checks.push({type:Fe.CHILD,parent:i,child:a}),_s(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=Ht(),o=t[t.length-1],f=Ht(),c=Ht(),d=Ht(),v=Ht();return l.checks.push({type:Fe.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:Fe.TRUE}],v.checks.push({type:Fe.TRUE}),f.checks.push({type:Fe.PARENT,parent:v,child:d}),_s(t,o,l),t.currentSubject=c,t.compoundCount++,d}else{var m=Ht(),y=Ht(),x=[{type:Fe.PARENT,parent:m,child:y}];return m.checks=n.checks,n.checks=x,t.compoundCount++,y}}},{name:"descendant",separator:!0,regex:Rt.descendant,populate:function(t,n){if(t.currentSubject==null){var r=Ht(),a=Ht(),i=t[t.length-1];return r.checks.push({type:Fe.DESCENDANT,ancestor:i,descendant:a}),_s(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=Ht(),o=t[t.length-1],f=Ht(),c=Ht(),d=Ht(),v=Ht();return l.checks.push({type:Fe.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:Fe.TRUE}],v.checks.push({type:Fe.TRUE}),f.checks.push({type:Fe.ANCESTOR,ancestor:v,descendant:d}),_s(t,o,l),t.currentSubject=c,t.compoundCount++,d}else{var m=Ht(),y=Ht(),x=[{type:Fe.ANCESTOR,ancestor:m,descendant:y}];return m.checks=n.checks,n.checks=x,t.compoundCount++,y}}},{name:"subject",modifier:!0,regex:Rt.subject,populate:function(t,n){if(t.currentSubject!=null&&t.currentSubject!==n)return Bt("Redefinition of subject in selector `"+t.toString()+"`"),!1;t.currentSubject=n;var r=t[t.length-1],a=r.checks[0],i=a==null?null:a.type;i===Fe.DIRECTED_EDGE?a.type=Fe.NODE_TARGET:i===Fe.UNDIRECTED_EDGE&&(a.type=Fe.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];Ub.forEach(function(e){return e.regexObj=new RegExp("^"+e.regex)});var oW=function(t){for(var n,r,a,i=0;i<Ub.length;i++){var l=Ub[i],o=l.name,f=t.match(l.regexObj);if(f!=null){r=f,n=l,a=o;var c=f[0];t=t.substring(c.length);break}}return{expr:n,match:r,name:a,remaining:t}},uW=function(t){var n=t.match(/^\s+/);if(n){var r=n[0];t=t.substring(r.length)}return t},cW=function(t){var n=this,r=n.inputText=t,a=n[0]=Ht();for(n.length=1,r=uW(r);;){var i=oW(r);if(i.expr==null)return Bt("The selector `"+t+"`is invalid"),!1;var l=i.match.slice(1),o=i.expr.populate(n,a,l);if(o===!1)return!1;if(o!=null&&(a=o),r=i.remaining,r.match(/^\s*$/))break}var f=n[n.length-1];n.currentSubject!=null&&(f.subject=n.currentSubject),f.edgeCount=n.edgeCount,f.compoundCount=n.compoundCount;for(var c=0;c<n.length;c++){var d=n[c];if(d.compoundCount>0&&d.edgeCount>0)return Bt("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Bt("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Bt("The selector `"+t+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},fW=function(){if(this.toStringCache!=null)return this.toStringCache;for(var t=function(d){return d??""},n=function(d){return et(d)?'"'+d+'"':t(d)},r=function(d){return" "+d+" "},a=function(d,v){var m=d.type,y=d.value;switch(m){case Fe.GROUP:{var x=t(y);return x.substring(0,x.length-1)}case Fe.DATA_COMPARE:{var w=d.field,S=d.operator;return"["+w+r(t(S))+n(y)+"]"}case Fe.DATA_BOOL:{var b=d.operator,C=d.field;return"["+t(b)+C+"]"}case Fe.DATA_EXIST:{var T=d.field;return"["+T+"]"}case Fe.META_COMPARE:{var N=d.operator,A=d.field;return"[["+A+r(t(N))+n(y)+"]]"}case Fe.STATE:return y;case Fe.ID:return"#"+y;case Fe.CLASS:return"."+y;case Fe.PARENT:case Fe.CHILD:return i(d.parent,v)+r(">")+i(d.child,v);case Fe.ANCESTOR:case Fe.DESCENDANT:return i(d.ancestor,v)+" "+i(d.descendant,v);case Fe.COMPOUND_SPLIT:{var R=i(d.left,v),D=i(d.subject,v),L=i(d.right,v);return R+(R.length>0?" ":"")+D+L}case Fe.TRUE:return""}},i=function(d,v){return d.checks.reduce(function(m,y,x){return m+(v===d&&x===0?"$":"")+a(y,v)},"")},l="",o=0;o<this.length;o++){var f=this[o];l+=i(f,f.subject),this.length>1&&o<this.length-1&&(l+=", ")}return this.toStringCache=l,l},dW={parse:cW,toString:fW},CL=function(t,n,r){var a,i=et(t),l=Re(t),o=et(r),f,c,d=!1,v=!1,m=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),v=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),d=!0),(i||o||d)&&(f=!i&&!l?"":""+t,c=""+r),d&&(t=f=f.toLowerCase(),r=c=c.toLowerCase()),n){case"*=":a=f.indexOf(c)>=0;break;case"$=":a=f.indexOf(c,f.length-c.length)>=0;break;case"^=":a=f.indexOf(c)===0;break;case"=":a=t===r;break;case">":m=!0,a=t>r;break;case">=":m=!0,a=t>=r;break;case"<":m=!0,a=t<r;break;case"<=":m=!0,a=t<=r;break;default:a=!1;break}return v&&(t!=null||!m)&&(a=!a),a},hW=function(t,n){switch(n){case"?":return!!t;case"!":return!t;case"^":return t===void 0}},vW=function(t){return t!==void 0},Nw=function(t,n){return t.data(n)},pW=function(t,n){return t[n]()},xn=[],rn=function(t,n){return t.checks.every(function(r){return xn[r.type](r,n)})};xn[Fe.GROUP]=function(e,t){var n=e.value;return n==="*"||n===t.group()};xn[Fe.STATE]=function(e,t){var n=e.value;return sW(n,t)};xn[Fe.ID]=function(e,t){var n=e.value;return t.id()===n};xn[Fe.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)};xn[Fe.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return CL(pW(t,n),r,a)};xn[Fe.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return CL(Nw(t,n),r,a)};xn[Fe.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return hW(Nw(t,n),r)};xn[Fe.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,vW(Nw(t,n))};xn[Fe.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],a=t.source(),i=t.target();return rn(n,a)&&rn(r,i)||rn(r,a)&&rn(n,i)};xn[Fe.NODE_NEIGHBOR]=function(e,t){return rn(e.node,t)&&t.neighborhood().some(function(n){return n.isNode()&&rn(e.neighbor,n)})};xn[Fe.DIRECTED_EDGE]=function(e,t){return rn(e.source,t.source())&&rn(e.target,t.target())};xn[Fe.NODE_SOURCE]=function(e,t){return rn(e.source,t)&&t.outgoers().some(function(n){return n.isNode()&&rn(e.target,n)})};xn[Fe.NODE_TARGET]=function(e,t){return rn(e.target,t)&&t.incomers().some(function(n){return n.isNode()&&rn(e.source,n)})};xn[Fe.CHILD]=function(e,t){return rn(e.child,t)&&rn(e.parent,t.parent())};xn[Fe.PARENT]=function(e,t){return rn(e.parent,t)&&t.children().some(function(n){return rn(e.child,n)})};xn[Fe.DESCENDANT]=function(e,t){return rn(e.descendant,t)&&t.ancestors().some(function(n){return rn(e.ancestor,n)})};xn[Fe.ANCESTOR]=function(e,t){return rn(e.ancestor,t)&&t.descendants().some(function(n){return rn(e.descendant,n)})};xn[Fe.COMPOUND_SPLIT]=function(e,t){return rn(e.subject,t)&&rn(e.left,t)&&rn(e.right,t)};xn[Fe.TRUE]=function(){return!0};xn[Fe.COLLECTION]=function(e,t){var n=e.value;return n.has(t)};xn[Fe.FILTER]=function(e,t){var n=e.value;return n(t)};var mW=function(t){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===Fe.ID)return t.getElementById(n[0].checks[0].value).collection();var r=function(i){for(var l=0;l<n.length;l++){var o=n[l];if(rn(o,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),t.filter(r)},gW=function(t){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(rn(a,t))return!0}return!1},yW={matches:gW,filter:mW},fl=function(t){this.inputText=t,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,t==null||et(t)&&t.match(/^\s*$/)||(na(t)?this.addQuery({checks:[{type:Fe.COLLECTION,value:t.collection()}]}):hn(t)?this.addQuery({checks:[{type:Fe.FILTER,value:t}]}):et(t)?this.parse(t)||(this.invalid=!0):ln("A selector must be created from a string; found "))},dl=fl.prototype;[dW,yW].forEach(function(e){return rt(dl,e)});dl.text=function(){return this.inputText};dl.size=function(){return this.length};dl.eq=function(e){return this[e]};dl.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()};dl.addQuery=function(e){this[this.length++]=e};dl.selector=dl.toString;var al={allAre:function(t){var n=new fl(t);return this.every(function(r){return n.matches(r)})},is:function(t){var n=new fl(t);return this.some(function(r){return n.matches(r)})},some:function(t,n){for(var r=0;r<this.length;r++){var a=n?t.apply(n,[this[r],r,this]):t(this[r],r,this);if(a)return!0}return!1},every:function(t,n){for(var r=0;r<this.length;r++){var a=n?t.apply(n,[this[r],r,this]):t(this[r],r,this);if(!a)return!1}return!0},same:function(t){if(this===t)return!0;t=this.cy().collection(t);var n=this.length,r=t.length;return n!==r?!1:n===1?this[0]===t[0]:this.every(function(a){return t.hasElementWithId(a.id())})},anySame:function(t){return t=this.cy().collection(t),this.some(function(n){return t.hasElementWithId(n.id())})},allAreNeighbors:function(t){t=this.cy().collection(t);var n=this.neighborhood();return t.every(function(r){return n.hasElementWithId(r.id())})},contains:function(t){t=this.cy().collection(t);var n=this;return t.every(function(r){return n.hasElementWithId(r.id())})}};al.allAreNeighbours=al.allAreNeighbors;al.has=al.contains;al.equal=al.equals=al.same;var Sa=function(t,n){return function(a,i,l,o){var f=a,c=this,d;if(f==null?d="":na(f)&&f.length===1&&(d=f.id()),c.length===1&&d){var v=c[0]._private,m=v.traversalCache=v.traversalCache||{},y=m[n]=m[n]||[],x=mo(d),w=y[x];return w||(y[x]=t.call(c,a,i,l,o))}else return t.call(c,a,i,l,o)}},Zu={parent:function(t){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var a=0;a<this.length;a++){var i=this[a],l=i._private.parent;l&&n.push(l)}return this.spawn(n,!0).filter(t)},parents:function(t){for(var n=[],r=this.parent();r.nonempty();){for(var a=0;a<r.length;a++){var i=r[a];n.push(i)}r=r.parent()}return this.spawn(n,!0).filter(t)},commonAncestors:function(t){for(var n,r=0;r<this.length;r++){var a=this[r],i=a.parents();n=n||i,n=n.intersect(i)}return n.filter(t)},orphans:function(t){return this.stdFilter(function(n){return n.isOrphan()}).filter(t)},nonorphans:function(t){return this.stdFilter(function(n){return n.isChild()}).filter(t)},children:Sa(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n],a=r._private.children,i=0;i<a.length;i++)t.push(a[i]);return this.spawn(t,!0).filter(e)},"children"),siblings:function(t){return this.parent().children().not(this).filter(t)},isParent:function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length!==0},isChildless:function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length===0},isChild:function(){var t=this[0];if(t)return t.isNode()&&t._private.parent!=null},isOrphan:function(){var t=this[0];if(t)return t.isNode()&&t._private.parent==null},descendants:function(t){var n=[];function r(a){for(var i=0;i<a.length;i++){var l=a[i];n.push(l),l.children().nonempty()&&r(l.children())}}return r(this.children()),this.spawn(n,!0).filter(t)}};function Aw(e,t,n,r){for(var a=[],i=new fc,l=e.cy(),o=l.hasCompoundNodes(),f=0;f<e.length;f++){var c=e[f];n?a.push(c):o&&r(a,i,c)}for(;a.length>0;){var d=a.shift();t(d),i.add(d.id()),o&&r(a,i,d)}return e}function TL(e,t,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var i=r[a];t.has(i.id())||e.push(i)}}Zu.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Aw(this,e,t,TL)};function kL(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}Zu.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Aw(this,e,t,kL)};function xW(e,t,n){kL(e,t,n),TL(e,t,n)}Zu.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Aw(this,e,t,xW)};Zu.ancestors=Zu.parents;var Wf,NL;Wf=NL={data:_t.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_t.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_t.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_t.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_t.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_t.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var t=this[0];if(t)return t._private.data.id}};Wf.attr=Wf.data;Wf.removeAttr=Wf.removeData;var bW=NL,em={};function S0(e){return function(t){var n=this;if(t===void 0&&(t=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,a=n[0],i=a._private.edges,l=0;l<i.length;l++){var o=i[l];!t&&o.isLoop()||(r+=e(a,o))}return r}else return}}rt(em,{degree:S0(function(e,t){return t.source().same(t.target())?2:1}),indegree:S0(function(e,t){return t.target().same(e)?1:0}),outdegree:S0(function(e,t){return t.source().same(e)?1:0})});function hu(e,t){return function(n){for(var r,a=this.nodes(),i=0;i<a.length;i++){var l=a[i],o=l[e](n);o!==void 0&&(r===void 0||t(o,r))&&(r=o)}return r}}rt(em,{minDegree:hu("degree",function(e,t){return e<t}),maxDegree:hu("degree",function(e,t){return e>t}),minIndegree:hu("indegree",function(e,t){return e<t}),maxIndegree:hu("indegree",function(e,t){return e>t}),minOutdegree:hu("outdegree",function(e,t){return e<t}),maxOutdegree:hu("outdegree",function(e,t){return e>t})});rt(em,{totalDegree:function(t){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(t);return n}});var La,AL,RL=function(t,n,r){for(var a=0;a<t.length;a++){var i=t[a];if(!i.locked()){var l=i._private.position,o={x:n.x!=null?n.x-l.x:0,y:n.y!=null?n.y-l.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,r),i.dirtyBoundingBoxCache()}}},cA={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(t){t.updateCompoundBounds()},beforeSet:function(t,n){RL(t,n,!1)},onSet:function(t){t.dirtyCompoundBoundsCache()},canSet:function(t){return!t.locked()}};La=AL={position:_t.data(cA),silentPosition:_t.data(rt({},cA,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(t,n){RL(t,n,!0)},onSet:function(t){t.dirtyCompoundBoundsCache()}})),positions:function(t,n){if(jt(t))n?this.silentPosition(t):this.position(t);else if(hn(t)){var r=t,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var l=this[i],o=void 0;(o=r(l,i))&&(n?l.silentPosition(o):l.position(o))}a.endBatch()}return this},silentPositions:function(t){return this.positions(t,!0)},shift:function(t,n,r){var a;if(jt(t)?(a={x:Re(t.x)?t.x:0,y:Re(t.y)?t.y:0},r=n):et(t)&&Re(n)&&(a={x:0,y:0},a[t]=n),a!=null){var i=this.cy();i.startBatch();for(var l=0;l<this.length;l++){var o=this[l];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var f=o.position(),c={x:f.x+a.x,y:f.y+a.y};r?o.silentPosition(c):o.position(c)}}i.endBatch()}return this},silentShift:function(t,n){return jt(t)?this.shift(t,!0):et(t)&&Re(n)&&this.shift(t,n,!0),this},renderedPosition:function(t,n){var r=this[0],a=this.cy(),i=a.zoom(),l=a.pan(),o=jt(t)?t:void 0,f=o!==void 0||n!==void 0&&et(t);if(r&&r.isNode())if(f)for(var c=0;c<this.length;c++){var d=this[c];n!==void 0?d.position(t,(n-l[t])/i):o!==void 0&&d.position(rL(o,i,l))}else{var v=r.position();return o=Yp(v,i,l),t===void 0?o:o[t]}else if(!f)return;return this},relativePosition:function(t,n){var r=this[0],a=this.cy(),i=jt(t)?t:void 0,l=i!==void 0||n!==void 0&&et(t),o=a.hasCompoundNodes();if(r&&r.isNode())if(l)for(var f=0;f<this.length;f++){var c=this[f],d=o?c.parent():null,v=d&&d.length>0,m=v;v&&(d=d[0]);var y=m?d.position():{x:0,y:0};n!==void 0?c.position(t,n+y[t]):i!==void 0&&c.position({x:i.x+y.x,y:i.y+y.y})}else{var x=r.position(),w=o?r.parent():null,S=w&&w.length>0,b=S;S&&(w=w[0]);var C=b?w.position():{x:0,y:0};return i={x:x.x-C.x,y:x.y-C.y},t===void 0?i:i[t]}else if(!l)return;return this}};La.modelPosition=La.point=La.position;La.modelPositions=La.points=La.positions;La.renderedPoint=La.renderedPosition;La.relativePoint=La.relativePosition;var wW=AL,Lu,bl;Lu=bl={};bl.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),a=n.pan(),i=t.x1*r+a.x,l=t.x2*r+a.x,o=t.y1*r+a.y,f=t.y2*r+a.y;return{x1:i,x2:l,y1:o,y2:f,w:l-i,h:f-o}};bl.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,e||n.emitAndNotify("bounds")}}),this)};bl.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(l){if(!l.isParent())return;var o=l._private,f=l.children(),c=l.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:l.pstyle("min-width").pfValue,left:l.pstyle("min-width-bias-left"),right:l.pstyle("min-width-bias-right")},height:{val:l.pstyle("min-height").pfValue,top:l.pstyle("min-height-bias-top"),bottom:l.pstyle("min-height-bias-bottom")}},v=f.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),m=o.position;(v.w===0||v.h===0)&&(v={w:l.pstyle("width").pfValue,h:l.pstyle("height").pfValue},v.x1=m.x-v.w/2,v.x2=m.x+v.w/2,v.y1=m.y-v.h/2,v.y2=m.y+v.h/2);function y(_,M,z){var P=0,G=0,I=M+z;return _>0&&I>0&&(P=M/I*_,G=z/I*_),{biasDiff:P,biasComplementDiff:G}}function x(_,M,z,P){if(z.units==="%")switch(P){case"width":return _>0?z.pfValue*_:0;case"height":return M>0?z.pfValue*M:0;case"average":return _>0&&M>0?z.pfValue*(_+M)/2:0;case"min":return _>0&&M>0?_>M?z.pfValue*M:z.pfValue*_:0;case"max":return _>0&&M>0?_>M?z.pfValue*_:z.pfValue*M:0;default:return 0}else return z.units==="px"?z.pfValue:0}var w=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(w=w*100/d.width.val);var S=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(S=S*100/d.width.val);var b=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var C=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(C=C*100/d.height.val);var T=y(d.width.val-v.w,w,S),N=T.biasDiff,A=T.biasComplementDiff,R=y(d.height.val-v.h,b,C),D=R.biasDiff,L=R.biasComplementDiff;o.autoPadding=x(v.w,v.h,l.pstyle("padding"),l.pstyle("padding-relative-to").value),o.autoWidth=Math.max(v.w,d.width.val),m.x=(-N+v.x1+v.x2+A)/2,o.autoHeight=Math.max(v.h,d.height.val),m.y=(-D+v.y1+v.y2+L)/2}for(var r=0;r<this.length;r++){var a=this[r],i=a._private;(!i.compoundBoundsClean||e)&&(n(a),t.batching()||(i.compoundBoundsClean=!0))}return this};var wa=function(t){return t===1/0||t===-1/0?0:t},Ma=function(t,n,r,a,i){a-n===0||i-r===0||n==null||r==null||a==null||i==null||(t.x1=n<t.x1?n:t.x1,t.x2=a>t.x2?a:t.x2,t.y1=r<t.y1?r:t.y1,t.y2=i>t.y2?i:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)},Is=function(t,n){return n==null?t:Ma(t,n.x1,n.y1,n.x2,n.y2)},xf=function(t,n,r){return Ir(t,n,r)},cv=function(t,n,r){if(!n.cy().headless()){var a=n._private,i=a.rstyle,l=i.arrowWidth/2,o=n.pstyle(r+"-arrow-shape").value,f,c;if(o!=="none"){r==="source"?(f=i.srcX,c=i.srcY):r==="target"?(f=i.tgtX,c=i.tgtY):(f=i.midX,c=i.midY);var d=a.arrowBounds=a.arrowBounds||{},v=d[r]=d[r]||{};v.x1=f-l,v.y1=c-l,v.x2=f+l,v.y2=c+l,v.w=v.x2-v.x1,v.h=v.y2-v.y1,Av(v,1),Ma(t,v.x1,v.y1,v.x2,v.y2)}}},E0=function(t,n,r){if(!n.cy().headless()){var a;r?a=r+"-":a="";var i=n._private,l=i.rstyle,o=n.pstyle(a+"label").strValue;if(o){var f=n.pstyle("text-halign"),c=n.pstyle("text-valign"),d=xf(l,"labelWidth",r),v=xf(l,"labelHeight",r),m=xf(l,"labelX",r),y=xf(l,"labelY",r),x=n.pstyle(a+"text-margin-x").pfValue,w=n.pstyle(a+"text-margin-y").pfValue,S=n.isEdge(),b=n.pstyle(a+"text-rotation"),C=n.pstyle("text-outline-width").pfValue,T=n.pstyle("text-border-width").pfValue,N=T/2,A=n.pstyle("text-background-padding").pfValue,R=2,D=v,L=d,_=L/2,M=D/2,z,P,G,I;if(S)z=m-_,P=m+_,G=y-M,I=y+M;else{switch(f.value){case"left":z=m-L,P=m;break;case"center":z=m-_,P=m+_;break;case"right":z=m,P=m+L;break}switch(c.value){case"top":G=y-D,I=y;break;case"center":G=y-M,I=y+M;break;case"bottom":G=y,I=y+D;break}}var F=x-Math.max(C,N)-A-R,B=x+Math.max(C,N)+A+R,H=w-Math.max(C,N)-A-R,Y=w+Math.max(C,N)+A+R;z+=F,P+=B,G+=H,I+=Y;var Q=r||"main",V=i.labelBounds,q=V[Q]=V[Q]||{};q.x1=z,q.y1=G,q.x2=P,q.y2=I,q.w=P-z,q.h=I-G,q.leftPad=F,q.rightPad=B,q.topPad=H,q.botPad=Y;var X=S&&b.strValue==="autorotate",U=b.pfValue!=null&&b.pfValue!==0;if(X||U){var te=X?xf(i.rstyle,"labelAngle",r):b.pfValue,ie=Math.cos(te),oe=Math.sin(te),ae=(z+P)/2,we=(G+I)/2;if(!S){switch(f.value){case"left":ae=P;break;case"right":ae=z;break}switch(c.value){case"top":we=I;break;case"bottom":we=G;break}}var fe=function(Ze,Qe){return Ze=Ze-ae,Qe=Qe-we,{x:Ze*ie-Qe*oe+ae,y:Ze*oe+Qe*ie+we}},J=fe(z,G),ne=fe(z,I),re=fe(P,G),ge=fe(P,I);z=Math.min(J.x,ne.x,re.x,ge.x),P=Math.max(J.x,ne.x,re.x,ge.x),G=Math.min(J.y,ne.y,re.y,ge.y),I=Math.max(J.y,ne.y,re.y,ge.y)}var ke=Q+"Rot",Be=V[ke]=V[ke]||{};Be.x1=z,Be.y1=G,Be.x2=P,Be.y2=I,Be.w=P-z,Be.h=I-G,Ma(t,z,G,P,I),Ma(i.labelBounds.all,z,G,P,I)}return t}},fA=function(t,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,a=n.pstyle("outline-width").value,i=n.pstyle("outline-offset").value,l=a+i;jL(t,n,r,l,"outside",l/2)}},jL=function(t,n,r,a,i,l){if(!(r===0||a<=0||i==="inside")){var o=n.cy(),f=n.pstyle("shape").value,c=o.renderer().nodeShapes[f],d=n.position(),v=d.x,m=d.y,y=n.width(),x=n.height();if(c.hasMiterBounds){i==="center"&&(a/=2);var w=c.miterBounds(v,m,y,x,a);Is(t,w)}else l!=null&&l>0&&Rv(t,[l,l,l,l])}},SW=function(t,n){if(!n.cy().headless()){var r=n.pstyle("border-opacity").value,a=n.pstyle("border-width").pfValue,i=n.pstyle("border-position").value;jL(t,n,r,a,i)}},EW=function(t,n){var r=t._private.cy,a=r.styleEnabled(),i=r.headless(),l=kr(),o=t._private,f=t.isNode(),c=t.isEdge(),d,v,m,y,x,w,S=o.rstyle,b=f&&a?t.pstyle("bounds-expansion").pfValue:[0],C=function(lt){return lt.pstyle("display").value!=="none"},T=!a||C(t)&&(!c||C(t.source())&&C(t.target()));if(T){var N=0,A=0;a&&n.includeOverlays&&(N=t.pstyle("overlay-opacity").value,N!==0&&(A=t.pstyle("overlay-padding").value));var R=0,D=0;a&&n.includeUnderlays&&(R=t.pstyle("underlay-opacity").value,R!==0&&(D=t.pstyle("underlay-padding").value));var L=Math.max(A,D),_=0,M=0;if(a&&(_=t.pstyle("width").pfValue,M=_/2),f&&n.includeNodes){var z=t.position();x=z.x,w=z.y;var P=t.outerWidth(),G=P/2,I=t.outerHeight(),F=I/2;d=x-G,v=x+G,m=w-F,y=w+F,Ma(l,d,m,v,y),a&&fA(l,t),a&&n.includeOutlines&&!i&&fA(l,t),a&&SW(l,t)}else if(c&&n.includeEdges)if(a&&!i){var B=t.pstyle("curve-style").strValue;if(d=Math.min(S.srcX,S.midX,S.tgtX),v=Math.max(S.srcX,S.midX,S.tgtX),m=Math.min(S.srcY,S.midY,S.tgtY),y=Math.max(S.srcY,S.midY,S.tgtY),d-=M,v+=M,m-=M,y+=M,Ma(l,d,m,v,y),B==="haystack"){var H=S.haystackPts;if(H&&H.length===2){if(d=H[0].x,m=H[0].y,v=H[1].x,y=H[1].y,d>v){var Y=d;d=v,v=Y}if(m>y){var Q=m;m=y,y=Q}Ma(l,d-M,m-M,v+M,y+M)}}else if(B==="bezier"||B==="unbundled-bezier"||Xs(B,"segments")||Xs(B,"taxi")){var V;switch(B){case"bezier":case"unbundled-bezier":V=S.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":V=S.linePts;break}if(V!=null)for(var q=0;q<V.length;q++){var X=V[q];d=X.x-M,v=X.x+M,m=X.y-M,y=X.y+M,Ma(l,d,m,v,y)}}}else{var U=t.source(),te=U.position(),ie=t.target(),oe=ie.position();if(d=te.x,v=oe.x,m=te.y,y=oe.y,d>v){var ae=d;d=v,v=ae}if(m>y){var we=m;m=y,y=we}d-=M,v+=M,m-=M,y+=M,Ma(l,d,m,v,y)}if(a&&n.includeEdges&&c&&(cv(l,t,"mid-source"),cv(l,t,"mid-target"),cv(l,t,"source"),cv(l,t,"target")),a){var fe=t.pstyle("ghost").value==="yes";if(fe){var J=t.pstyle("ghost-offset-x").pfValue,ne=t.pstyle("ghost-offset-y").pfValue;Ma(l,l.x1+J,l.y1+ne,l.x2+J,l.y2+ne)}}var re=o.bodyBounds=o.bodyBounds||{};Qk(re,l),Rv(re,b),Av(re,1),a&&(d=l.x1,v=l.x2,m=l.y1,y=l.y2,Ma(l,d-L,m-L,v+L,y+L));var ge=o.overlayBounds=o.overlayBounds||{};Qk(ge,l),Rv(ge,b),Av(ge,1);var ke=o.labelBounds=o.labelBounds||{};ke.all!=null?aX(ke.all):ke.all=kr(),a&&n.includeLabels&&(n.includeMainLabels&&E0(l,t,null),c&&(n.includeSourceLabels&&E0(l,t,"source"),n.includeTargetLabels&&E0(l,t,"target")))}return l.x1=wa(l.x1),l.y1=wa(l.y1),l.x2=wa(l.x2),l.y2=wa(l.y2),l.w=wa(l.x2-l.x1),l.h=wa(l.y2-l.y1),l.w>0&&l.h>0&&T&&(Rv(l,b),Av(l,1)),l},DL=function(t){var n=0,r=function(l){return(l?1:0)<<n++},a=0;return a+=r(t.incudeNodes),a+=r(t.includeEdges),a+=r(t.includeLabels),a+=r(t.includeMainLabels),a+=r(t.includeSourceLabels),a+=r(t.includeTargetLabels),a+=r(t.includeOverlays),a+=r(t.includeOutlines),a},ML=function(t){var n=function(o){return Math.round(o)};if(t.isEdge()){var r=t.source().position(),a=t.target().position();return Hk([n(r.x),n(r.y),n(a.x),n(a.y)])}else{var i=t.position();return Hk([n(i.x),n(i.y)])}},dA=function(t,n){var r=t._private,a,i=t.isEdge(),l=n==null?hA:DL(n),o=l===hA;if(r.bbCache==null?(a=EW(t,Zf),r.bbCache=a,r.bbCachePosKey=ML(t)):a=r.bbCache,!o){var f=t.isNode();a=kr(),(n.includeNodes&&f||n.includeEdges&&!f)&&(n.includeOverlays?Is(a,r.overlayBounds):Is(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?Is(a,r.labelBounds.all):(n.includeMainLabels&&Is(a,r.labelBounds.mainRot),n.includeSourceLabels&&Is(a,r.labelBounds.sourceRot),n.includeTargetLabels&&Is(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Zf={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},hA=DL(Zf),vA=lr(Zf);bl.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=Qu(function(d){var v=d._private;return v.bbCache==null||v.styleDirty||v.bbCachePosKey!==ML(d)},function(d){return d.id()});if(n&&this.length===1&&!r(this[0]))e===void 0?e=Zf:e=vA(e),t=dA(this[0],e);else{t=kr(),e=e||Zf;var a=vA(e),i=this,l=i.cy(),o=l.styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),o&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var f=0;f<i.length;f++){var c=i[f];r(c)&&c.dirtyBoundingBoxCache(),Is(t,dA(c,a))}}return t.x1=wa(t.x1),t.y1=wa(t.y1),t.x2=wa(t.x2),t.y2=wa(t.y2),t.w=wa(t.x2-t.x1),t.h=wa(t.y2-t.y1),t};bl.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};bl.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=t.filter(function(c){return c.isParent()}),t=t.not(a)),jt(e)){var i=e;e=function(){return i}}var l=function(d,v){return d._private.bbAtOldPos=e(d,v)},o=function(d){return d._private.bbAtOldPos};n.startBatch(),t.forEach(l).silentPositions(e),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var f=rX(this.boundingBox({useCache:!1}));return t.silentPositions(o),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),f};Lu.boundingbox=Lu.bb=Lu.boundingBox;Lu.renderedBoundingbox=Lu.renderedBoundingBox;var CW=bl,Rf,kd;Rf=kd={};var OL=function(t){t.uppercaseName=Rk(t.name),t.autoName="auto"+t.uppercaseName,t.labelName="label"+t.uppercaseName,t.outerName="outer"+t.uppercaseName,t.uppercaseOuterName=Rk(t.outerName),Rf[t.name]=function(){var r=this[0],a=r._private,i=a.cy,l=i._private.styleEnabled;if(r)if(l){if(r.isParent())return r.updateCompoundBounds(),a[t.autoName]||0;var o=r.pstyle(t.name);switch(o.strValue){case"label":return r.recalculateRenderedStyle(),a.rstyle[t.labelName]||0;default:return o.pfValue}}else return 1},Rf["outer"+t.uppercaseName]=function(){var r=this[0],a=r._private,i=a.cy,l=i._private.styleEnabled;if(r)if(l){var o=r[t.name](),f=r.pstyle("border-position").value,c;f==="center"?c=r.pstyle("border-width").pfValue:f==="outside"?c=2*r.pstyle("border-width").pfValue:c=0;var d=2*r.padding();return o+c+d}else return 1},Rf["rendered"+t.uppercaseName]=function(){var r=this[0];if(r){var a=r[t.name]();return a*this.cy().zoom()}},Rf["rendered"+t.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[t.outerName]();return a*this.cy().zoom()}}};OL({name:"width"});OL({name:"height"});kd.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding!==void 0?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue};kd.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()};kd.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var TW=kd,kW=function(t,n){if(t.isEdge()&&t.takesUpSpace())return n(t)},NW=function(t,n){if(t.isEdge()&&t.takesUpSpace()){var r=t.cy();return Yp(n(t),r.zoom(),r.pan())}},AW=function(t,n){if(t.isEdge()&&t.takesUpSpace()){var r=t.cy(),a=r.pan(),i=r.zoom();return n(t).map(function(l){return Yp(l,i,a)})}},RW=function(t){return t.renderer().getControlPoints(t)},jW=function(t){return t.renderer().getSegmentPoints(t)},DW=function(t){return t.renderer().getSourceEndpoint(t)},MW=function(t){return t.renderer().getTargetEndpoint(t)},OW=function(t){return t.renderer().getEdgeMidpoint(t)},pA={controlPoints:{get:RW,mult:!0},segmentPoints:{get:jW,mult:!0},sourceEndpoint:{get:DW},targetEndpoint:{get:MW},midpoint:{get:OW}},LW=function(t){return"rendered"+t[0].toUpperCase()+t.substr(1)},_W=Object.keys(pA).reduce(function(e,t){var n=pA[t],r=LW(t);return e[t]=function(){return kW(this,n.get)},n.mult?e[r]=function(){return AW(this,n.get)}:e[r]=function(){return NW(this,n.get)},e},{}),BW=rt({},wW,CW,TW,_W);/*!
|
|
465
|
+
Event object based on jQuery events, MIT license
|
|
466
|
+
|
|
467
|
+
https://jquery.org/license/
|
|
468
|
+
https://tldrlegal.com/license/mit-license
|
|
469
|
+
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
470
|
+
*/var LL=function(t,n){this.recycle(t,n)};function bf(){return!1}function fv(){return!0}LL.prototype={instanceString:function(){return"event"},recycle:function(t,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=bf,t!=null&&t.preventDefault?(this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?fv:bf):t!=null&&t.type?n=t:this.type=t,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*a+i.x,y:r.y*a+i.y}}this.timeStamp=t&&t.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=fv;var t=this.originalEvent;t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){this.isPropagationStopped=fv;var t=this.originalEvent;t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=fv,this.stopPropagation()},isDefaultPrevented:bf,isPropagationStopped:bf,isImmediatePropagationStopped:bf};var _L=/^([^.]+)(\.(?:[^.]+))?$/,PW=".*",BL={qualifierCompare:function(t,n){return t===n},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(t){return t},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},mA=Object.keys(BL),zW={};function tm(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zW,t=arguments.length>1?arguments[1]:void 0,n=0;n<mA.length;n++){var r=mA[n];this[r]=e[r]||BL[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var hl=tm.prototype,PL=function(t,n,r,a,i,l,o){hn(a)&&(i=a,a=null),o&&(l==null?l=o:l=rt({},l,o));for(var f=$t(r)?r:r.split(/\s+/),c=0;c<f.length;c++){var d=f[c];if(!ol(d)){var v=d.match(_L);if(v){var m=v[1],y=v[2]?v[2]:null,x=n(t,d,m,y,a,i,l);if(x===!1)break}}}},gA=function(t,n){return t.addEventFields(t.context,n),new LL(n.type,n)},IW=function(t,n,r){if(GK(r)){n(t,r);return}else if(jt(r)){n(t,gA(t,r));return}for(var a=$t(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var l=a[i];if(!ol(l)){var o=l.match(_L);if(o){var f=o[1],c=o[2]?o[2]:null,d=gA(t,{type:f,namespace:c,target:t.context});n(t,d)}}}};hl.on=hl.addListener=function(e,t,n,r,a){return PL(this,function(i,l,o,f,c,d,v){hn(d)&&i.listeners.push({event:l,callback:d,type:o,namespace:f,qualifier:c,conf:v})},e,t,n,r,a),this};hl.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})};hl.removeListener=hl.off=function(e,t,n,r){var a=this;this.emitting!==0&&(this.listeners=NY(this.listeners));for(var i=this.listeners,l=function(c){var d=i[c];PL(a,function(v,m,y,x,w,S){if((d.type===y||e==="*")&&(!x&&d.namespace!==".*"||d.namespace===x)&&(!w||v.qualifierCompare(d.qualifier,w))&&(!S||d.callback===S))return i.splice(c,1),!1},e,t,n,r)},o=i.length-1;o>=0;o--)l(o);return this};hl.removeAllListeners=function(){return this.removeListener("*")};hl.emit=hl.trigger=function(e,t,n){var r=this.listeners,a=r.length;return this.emitting++,$t(t)||(t=[t]),IW(this,function(i,l){n!=null&&(r=[{event:l.event,type:l.type,namespace:l.namespace,callback:n}],a=r.length);for(var o=function(){var d=r[f];if(d.type===l.type&&(!d.namespace||d.namespace===l.namespace||d.namespace===PW)&&i.eventMatches(i.context,d,l)){var v=[l];t!=null&&RY(v,t),i.beforeEmit(i.context,d,l),d.conf&&d.conf.one&&(i.listeners=i.listeners.filter(function(x){return x!==d}));var m=i.callbackContext(i.context,d,l),y=d.callback.apply(m,v);i.afterEmit(i.context,d,l),y===!1&&(l.stopPropagation(),l.preventDefault())}},f=0;f<a;f++)o();i.bubble(i.context)&&!l.isPropagationStopped()&&i.parent(i.context).emit(l,t)},e),this.emitting--,this};var FW={qualifierCompare:function(t,n){return t==null||n==null?t==null&&n==null:t.sameText(n)},eventMatches:function(t,n,r){var a=n.qualifier;return a!=null?t!==r.target&&bd(r.target)&&a.matches(r.target):!0},addEventFields:function(t,n){n.cy=t.cy(),n.target=t},callbackContext:function(t,n,r){return n.qualifier!=null?r.target:t},beforeEmit:function(t,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(t){return t.isChild()?t.parent():t.cy()}},dv=function(t){return et(t)?new fl(t):t},zL={createEmitter:function(){for(var t=0;t<this.length;t++){var n=this[t],r=n._private;r.emitter||(r.emitter=new tm(FW,n))}return this},emitter:function(){return this._private.emitter},on:function(t,n,r){for(var a=dv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().on(t,a,r)}return this},removeListener:function(t,n,r){for(var a=dv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().removeListener(t,a,r)}return this},removeAllListeners:function(){for(var t=0;t<this.length;t++){var n=this[t];n.emitter().removeAllListeners()}return this},one:function(t,n,r){for(var a=dv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().one(t,a,r)}return this},once:function(t,n,r){for(var a=dv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().on(t,a,r,{once:!0,onceCollection:this})}},emit:function(t,n){for(var r=0;r<this.length;r++){var a=this[r];a.emitter().emit(t,n)}return this},emitAndNotify:function(t,n){if(this.length!==0)return this.cy().notify(t,this),this.emit(t,n),this}};_t.eventAliasesOn(zL);var IL={nodes:function(t){return this.filter(function(n){return n.isNode()}).filter(t)},edges:function(t){return this.filter(function(n){return n.isEdge()}).filter(t)},byGroup:function(){for(var t=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var a=this[r];a.isNode()?t.push(a):n.push(a)}return{nodes:t,edges:n}},filter:function(t,n){if(t===void 0)return this;if(et(t)||na(t))return new fl(t).filter(this);if(hn(t)){for(var r=this.spawn(),a=this,i=0;i<a.length;i++){var l=a[i],o=n?t.apply(n,[l,i,a]):t(l,i,a);o&&r.push(l)}return r}return this.spawn()},not:function(t){if(t){et(t)&&(t=this.filter(t));for(var n=this.spawn(),r=0;r<this.length;r++){var a=this[r],i=t.has(a);i||n.push(a)}return n}else return this},absoluteComplement:function(){var t=this.cy();return t.mutableElements().not(this)},intersect:function(t){if(et(t)){var n=t;return this.filter(n)}for(var r=this.spawn(),a=this,i=t,l=this.length<t.length,o=l?a:i,f=l?i:a,c=0;c<o.length;c++){var d=o[c];f.has(d)&&r.push(d)}return r},xor:function(t){var n=this._private.cy;et(t)&&(t=n.$(t));var r=this.spawn(),a=this,i=t,l=function(f,c){for(var d=0;d<f.length;d++){var v=f[d],m=v._private.data.id,y=c.hasElementWithId(m);y||r.push(v)}};return l(a,i),l(i,a),r},diff:function(t){var n=this._private.cy;et(t)&&(t=n.$(t));var r=this.spawn(),a=this.spawn(),i=this.spawn(),l=this,o=t,f=function(d,v,m){for(var y=0;y<d.length;y++){var x=d[y],w=x._private.data.id,S=v.hasElementWithId(w);S?i.merge(x):m.push(x)}};return f(l,o,r),f(o,l,a),{left:r,right:a,both:i}},add:function(t){var n=this._private.cy;if(!t)return this;if(et(t)){var r=t;t=n.mutableElements().filter(r)}for(var a=this.spawnSelf(),i=0;i<t.length;i++){var l=t[i],o=!this.has(l);o&&a.push(l)}return a},merge:function(t){var n=this._private,r=n.cy;if(!t)return this;if(t&&et(t)){var a=t;t=r.mutableElements().filter(a)}for(var i=n.map,l=0;l<t.length;l++){var o=t[l],f=o._private.data.id,c=!i.has(f);if(c){var d=this.length++;this[d]=o,i.set(f,{ele:o,index:d})}}return this},unmergeAt:function(t){var n=this[t],r=n.id(),a=this._private,i=a.map;this[t]=void 0,i.delete(r);var l=t===this.length-1;if(this.length>1&&!l){var o=this.length-1,f=this[o],c=f._private.data.id;this[o]=void 0,this[t]=f,i.set(c,{ele:f,index:t})}return this.length--,this},unmergeOne:function(t){t=t[0];var n=this._private,r=t._private.data.id,a=n.map,i=a.get(r);if(!i)return this;var l=i.index;return this.unmergeAt(l),this},unmerge:function(t){var n=this._private.cy;if(!t)return this;if(t&&et(t)){var r=t;t=n.mutableElements().filter(r)}for(var a=0;a<t.length;a++)this.unmergeOne(t[a]);return this},unmergeBy:function(t){for(var n=this.length-1;n>=0;n--){var r=this[n];t(r)&&this.unmergeAt(n)}return this},map:function(t,n){for(var r=[],a=this,i=0;i<a.length;i++){var l=a[i],o=n?t.apply(n,[l,i,a]):t(l,i,a);r.push(o)}return r},reduce:function(t,n){for(var r=n,a=this,i=0;i<a.length;i++)r=t(r,a[i],i,a);return r},max:function(t,n){for(var r=-1/0,a,i=this,l=0;l<i.length;l++){var o=i[l],f=n?t.apply(n,[o,l,i]):t(o,l,i);f>r&&(r=f,a=o)}return{value:r,ele:a}},min:function(t,n){for(var r=1/0,a,i=this,l=0;l<i.length;l++){var o=i[l],f=n?t.apply(n,[o,l,i]):t(o,l,i);f<r&&(r=f,a=o)}return{value:r,ele:a}}},Ot=IL;Ot.u=Ot["|"]=Ot["+"]=Ot.union=Ot.or=Ot.add;Ot["\\"]=Ot["!"]=Ot["-"]=Ot.difference=Ot.relativeComplement=Ot.subtract=Ot.not;Ot.n=Ot["&"]=Ot["."]=Ot.and=Ot.intersection=Ot.intersect;Ot["^"]=Ot["(+)"]=Ot["(-)"]=Ot.symmetricDifference=Ot.symdiff=Ot.xor;Ot.fnFilter=Ot.filterFn=Ot.stdFilter=Ot.filter;Ot.complement=Ot.abscomp=Ot.absoluteComplement;var qW={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var t=this[0];if(t)return t._private.group}},FL=function(t,n){var r=t.cy(),a=r.hasCompoundNodes();function i(d){var v=d.pstyle("z-compound-depth");return v.value==="auto"?a?d.zDepth():0:v.value==="bottom"?-1:v.value==="top"?gw:0}var l=i(t)-i(n);if(l!==0)return l;function o(d){var v=d.pstyle("z-index-compare");return v.value==="auto"&&d.isNode()?1:0}var f=o(t)-o(n);if(f!==0)return f;var c=t.pstyle("z-index").value-n.pstyle("z-index").value;return c!==0?c:t.poolIndex()-n.poolIndex()},lp={forEach:function(t,n){if(hn(t))for(var r=this.length,a=0;a<r;a++){var i=this[a],l=n?t.apply(n,[i,a,this]):t(i,a,this);if(l===!1)break}return this},toArray:function(){for(var t=[],n=0;n<this.length;n++)t.push(this[n]);return t},slice:function(t,n){var r=[],a=this.length;n==null&&(n=a),t==null&&(t=0),t<0&&(t=a+t),n<0&&(n=a+n);for(var i=t;i>=0&&i<n&&i<a;i++)r.push(this[i]);return this.spawn(r)},size:function(){return this.length},eq:function(t){return this[t]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(t){if(!hn(t))return this;var n=this.toArray().sort(t);return this.spawn(n)},sortByZIndex:function(){return this.sort(FL)},zDepth:function(){var t=this[0];if(t){var n=t._private,r=n.group;if(r==="nodes"){var a=n.data.parent?t.parents().size():0;return t.isParent()?a:gw-1}else{var i=n.source,l=n.target,o=i.zDepth(),f=l.zDepth();return Math.max(o,f,0)}}}};lp.each=lp.forEach;var UW=function(){var t="undefined",n=(typeof Symbol>"u"?"undefined":Fn(Symbol))!=t&&Fn(Symbol.iterator)!=t;n&&(lp[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,l=this.length;return zO({next:function(){return i<l?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};UW();var VW=lr({nodeDimensionsIncludeLabels:!1}),Dv={layoutDimensions:function(t){t=VW(t);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(t.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(t,n,r){var a=this.nodes().filter(function(A){return!A.isParent()}),i=this.cy(),l=n.eles,o=function(R){return R.id()},f=Qu(r,o);t.emit({type:"layoutstart",layout:t}),t.animations=[];var c=function(R,D,L){var _={x:D.x1+D.w/2,y:D.y1+D.h/2},M={x:(L.x-_.x)*R,y:(L.y-_.y)*R};return{x:_.x+M.x,y:_.y+M.y}},d=n.spacingFactor&&n.spacingFactor!==1,v=function(){if(!d)return null;for(var R=kr(),D=0;D<a.length;D++){var L=a[D],_=f(L,D);aL(R,_.x,_.y)}return R},m=v(),y=Qu(function(A,R){var D=f(A,R);if(d){var L=Math.abs(n.spacingFactor);D=c(L,m,D)}return n.transform!=null&&(D=n.transform(A,D)),D},o);if(n.animate){for(var x=0;x<a.length;x++){var w=a[x],S=y(w,x),b=n.animateFilter==null||n.animateFilter(w,x);if(b){var C=w.animation({position:S,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(C)}else w.position(S)}if(n.fit){var T=i.animation({fit:{boundingBox:l.boundingBoxAt(y),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});t.animations.push(T)}else if(n.zoom!==void 0&&n.pan!==void 0){var N=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(N)}t.animations.forEach(function(A){return A.play()}),t.one("layoutready",n.ready),t.emit({type:"layoutready",layout:t}),dc.all(t.animations.map(function(A){return A.promise()})).then(function(){t.one("layoutstop",n.stop),t.emit({type:"layoutstop",layout:t})})}else a.positions(y),n.fit&&i.fit(n.eles,n.padding),n.zoom!=null&&i.zoom(n.zoom),n.pan&&i.pan(n.pan),t.one("layoutready",n.ready),t.emit({type:"layoutready",layout:t}),t.one("layoutstop",n.stop),t.emit({type:"layoutstop",layout:t});return this},layout:function(t){var n=this.cy();return n.makeLayout(rt({},t,{eles:this}))}};Dv.createLayout=Dv.makeLayout=Dv.layout;function qL(e,t,n){var r=n._private,a=r.styleCache=r.styleCache||[],i;return(i=a[e])!=null||(i=a[e]=t(n)),i}function nm(e,t){return e=mo(e),function(r){return qL(e,t,r)}}function rm(e,t){e=mo(e);var n=function(a){return t.call(a)};return function(){var a=this[0];if(a)return qL(e,n,a)}}var ir={recalculateRenderedStyle:function(t){var n=this.cy(),r=n.renderer(),a=n.styleEnabled();return r&&a&&r.recalculateRenderedStyle(this,t),this},dirtyStyleCache:function(){var t=this.cy(),n=function(i){return i._private.styleCache=null};if(t.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(a){n(a),a.connectedEdges().forEach(n)});return this},updateStyle:function(t){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var a=n.hasCompoundNodes(),i=this;t=!!(t||t===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var l=i;return t?l.emitAndNotify("style"):l.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var t=this.cy();if(t.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,t.style().apply(r))}},parsedStyle:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],a=r.cy();if(a.styleEnabled()&&r){r._private.styleDirty&&(r._private.styleDirty=!1,a.style().apply(r));var i=r._private.style[t];return i??(n?a.style().getDefaultProperty(t):null)}},numericStyle:function(t){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(t);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(t){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(t).units},renderedStyle:function(t){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,t)},style:function(t,n){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,i=r.style();if(jt(t)){var l=t;i.applyBypass(this,l,a),this.emitAndNotify("style")}else if(et(t))if(n===void 0){var o=this[0];return o?i.getStylePropertyValue(o,t):void 0}else i.applyBypass(this,t,n,a),this.emitAndNotify("style");else if(t===void 0){var f=this[0];return f?i.getRawStyle(f):void 0}return this},removeStyle:function(t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,a=n.style(),i=this;if(t===void 0)for(var l=0;l<i.length;l++){var o=i[l];a.removeAllBypasses(o,r)}else{t=t.split(/\s+/);for(var f=0;f<i.length;f++){var c=i[f];a.removeBypasses(c,t,r)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var t=this.cy();if(!t.styleEnabled())return 1;var n=t.hasCompoundNodes(),r=this[0];if(r){var a=r._private,i=r.pstyle("opacity").value;if(!n)return i;var l=a.data.parent?r.parents():null;if(l)for(var o=0;o<l.length;o++){var f=l[o],c=f.pstyle("opacity").value;i=c*i}return i}},transparent:function(){var t=this.cy();if(!t.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var t=this.cy();if(!t.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function C0(e,t){var n=e._private,r=n.data.parent?e.parents():null;if(r)for(var a=0;a<r.length;a++){var i=r[a];if(!t(i))return!1}return!0}function Rw(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],l=a.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!l||C0(i,r);var f=o.source,c=o.target;return n(f)&&(!l||C0(f,n))&&(f===c||n(c)&&(!l||C0(c,n)))}}}var hc=nm("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});ir.takesUpSpace=rm("takesUpSpace",Rw({ok:hc}));var HW=nm("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&hc(e)}),GW=nm("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&hc(e)});ir.interactive=rm("interactive",Rw({ok:HW,parentOk:GW,edgeOkViaNode:hc}));ir.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var $W=nm("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&hc(e)}),KW=hc;ir.visible=rm("visible",Rw({ok:$W,edgeOkViaNode:KW}));ir.hidden=function(){var e=this[0];if(e)return!e.visible()};ir.isBundledBezier=rm("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});ir.bypass=ir.css=ir.style;ir.renderedCss=ir.renderedStyle;ir.removeBypass=ir.removeCss=ir.removeStyle;ir.pstyle=ir.parsedStyle;var il={};function yA(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],a=t[1];this.on(e.event,r,a)}else if(t.length===1&&hn(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&$t(t[0])){for(var l=t.length===1?t[0]:null,o=0;o<this.length;o++){var f=this[o],c=!e.ableField||f._private[e.ableField],d=f._private[e.field]!=e.value;if(e.overrideAble){var v=e.overrideAble(f);if(v!==void 0&&(c=v,!v))return this}c&&(f._private[e.field]=e.value,d&&n.push(f))}var m=this.spawn(n);m.updateStyle(),m.emit(e.event),l&&m.emit(l)}return this}}function vc(e){il[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},il[e.on]=yA({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),il[e.off]=yA({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}vc({field:"locked",overrideField:function(t){return t.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});vc({field:"grabbable",overrideField:function(t){return t.cy().autoungrabify()||t.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});vc({field:"selected",ableField:"selectable",overrideAble:function(t){return t.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});vc({field:"selectable",overrideField:function(t){return t.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});il.deselect=il.unselect;il.grabbed=function(){var e=this[0];if(e)return e._private.grabbed};vc({field:"active",on:"activate",off:"unactivate"});vc({field:"pannable",on:"panify",off:"unpanify"});il.inactive=function(){var e=this[0];if(e)return!e._private.active};var pr={},xA=function(t){return function(r){for(var a=this,i=[],l=0;l<a.length;l++){var o=a[l];if(o.isNode()){for(var f=!1,c=o.connectedEdges(),d=0;d<c.length;d++){var v=c[d],m=v.source(),y=v.target();if(t.noIncomingEdges&&y===o&&m!==o||t.noOutgoingEdges&&m===o&&y!==o){f=!0;break}}f||i.push(o)}}return this.spawn(i,!0).filter(r)}},bA=function(t){return function(n){for(var r=this,a=[],i=0;i<r.length;i++){var l=r[i];if(l.isNode())for(var o=l.connectedEdges(),f=0;f<o.length;f++){var c=o[f],d=c.source(),v=c.target();t.outgoing&&d===l?(a.push(c),a.push(v)):t.incoming&&v===l&&(a.push(c),a.push(d))}}return this.spawn(a,!0).filter(n)}},wA=function(t){return function(n){for(var r=this,a=[],i={};;){var l=t.outgoing?r.outgoers():r.incomers();if(l.length===0)break;for(var o=!1,f=0;f<l.length;f++){var c=l[f],d=c.id();i[d]||(i[d]=!0,a.push(c),o=!0)}if(!o)break;r=l}return this.spawn(a,!0).filter(n)}};pr.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null};rt(pr,{roots:xA({noIncomingEdges:!0}),leaves:xA({noOutgoingEdges:!0}),outgoers:Sa(bA({outgoing:!0}),"outgoers"),successors:wA({outgoing:!0}),incomers:Sa(bA({incoming:!0}),"incomers"),predecessors:wA({})});rt(pr,{neighborhood:Sa(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],i=a.connectedEdges(),l=0;l<i.length;l++){var o=i[l],f=o.source(),c=o.target(),d=a===f?c:f;d.length>0&&t.push(d[0]),t.push(o[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function(t){return this.neighborhood(t)}});pr.neighbourhood=pr.neighborhood;pr.closedNeighbourhood=pr.closedNeighborhood;pr.openNeighbourhood=pr.openNeighborhood;rt(pr,{source:Sa(function(t){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&t?r.filter(t):r},"source"),target:Sa(function(t){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&t?r.filter(t):r},"target"),sources:SA({attr:"source"}),targets:SA({attr:"target"})});function SA(e){return function(n){for(var r=[],a=0;a<this.length;a++){var i=this[a],l=i._private[e.attr];l&&r.push(l)}return this.spawn(r,!0).filter(n)}}rt(pr,{edgesWith:Sa(EA(),"edgesWith"),edgesTo:Sa(EA({thisIsSrc:!0}),"edgesTo")});function EA(e){return function(n){var r=[],a=this._private.cy,i=e||{};et(n)&&(n=a.$(n));for(var l=0;l<n.length;l++)for(var o=n[l]._private.edges,f=0;f<o.length;f++){var c=o[f],d=c._private.data,v=this.hasElementWithId(d.source)&&n.hasElementWithId(d.target),m=n.hasElementWithId(d.source)&&this.hasElementWithId(d.target),y=v||m;y&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!v||i.thisIsTgt&&!m)||r.push(c))}return this.spawn(r,!0)}}rt(pr,{connectedEdges:Sa(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var a=n[r];if(a.isNode())for(var i=a._private.edges,l=0;l<i.length;l++){var o=i[l];t.push(o)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:Sa(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var a=n[r];a.isEdge()&&(t.push(a.source()[0]),t.push(a.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:Sa(CA(),"parallelEdges"),codirectedEdges:Sa(CA({codirected:!0}),"codirectedEdges")});function CA(e){var t={codirected:!1};return e=rt({},t,e),function(r){for(var a=[],i=this.edges(),l=e,o=0;o<i.length;o++)for(var f=i[o],c=f._private,d=c.source,v=d._private.data.id,m=c.data.target,y=d._private.edges,x=0;x<y.length;x++){var w=y[x],S=w._private.data,b=S.target,C=S.source,T=b===m&&C===v,N=v===b&&m===C;(l.codirected&&T||!l.codirected&&(T||N))&&a.push(w)}return this.spawn(a,!0).filter(r)}}rt(pr,{components:function(t){var n=this,r=n.cy(),a=r.collection(),i=t==null?n.nodes():t.nodes(),l=[];t!=null&&i.empty()&&(i=t.sources());var o=function(d,v){a.merge(d),i.unmerge(d),v.merge(d)};if(i.empty())return n.spawn();var f=function(){var d=r.collection();l.push(d);var v=i[0];o(v,d),n.bfs({directed:!1,roots:v,visit:function(y){return o(y,d)}}),d.forEach(function(m){m.connectedEdges().forEach(function(y){n.has(y)&&d.has(y.source())&&d.has(y.target())&&d.merge(y)})})};do f();while(i.length>0);return l},component:function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});pr.componentsOf=pr.components;var sr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t===void 0){ln("A collection must have a reference to the core");return}var i=new Ui,l=!1;if(!n)n=[];else if(n.length>0&&jt(n[0])&&!bd(n[0])){l=!0;for(var o=[],f=new fc,c=0,d=n.length;c<d;c++){var v=n[c];v.data==null&&(v.data={});var m=v.data;if(m.id==null)m.id=tL();else if(t.hasElementWithId(m.id)||f.has(m.id))continue;var y=new Kp(t,v,!1);o.push(y),f.add(m.id)}n=o}this.length=0;for(var x=0,w=n.length;x<w;x++){var S=n[x][0];if(S!=null){var b=S._private.data.id;(!r||!i.has(b))&&(r&&i.set(b,{index:this.length,ele:S}),this[this.length]=S,this.length++)}}this._private={eles:this,cy:t,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(C){this.lazyMap=C},rebuildMap:function(){for(var T=this.lazyMap=new Ui,N=this.eles,A=0;A<N.length;A++){var R=N[A];T.set(R.id(),{index:A,ele:R})}}},r&&(this._private.map=i),l&&!a&&this.restore()},Jt=Kp.prototype=sr.prototype=Object.create(Array.prototype);Jt.instanceString=function(){return"collection"};Jt.spawn=function(e,t){return new sr(this.cy(),e,t)};Jt.spawnSelf=function(){return this.spawn(this)};Jt.cy=function(){return this._private.cy};Jt.renderer=function(){return this._private.cy.renderer()};Jt.element=function(){return this[0]};Jt.collection=function(){return qO(this)?this:new sr(this._private.cy,[this])};Jt.unique=function(){return new sr(this._private.cy,this,!0)};Jt.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)};Jt.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new sr(t)};Jt.$id=Jt.getElementById;Jt.poolIndex=function(){var e=this._private.cy,t=e._private.elements,n=this[0]._private.data.id;return t._private.map.get(n).index};Jt.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index};Jt.indexOfId=function(e){return e=""+e,this._private.map.get(e).index};Jt.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(jt(e)){if(n.startBatch(),e.data){t.data(e.data);var a=r.data;if(t.isEdge()){var i=!1,l={},o=e.data.source,f=e.data.target;o!=null&&o!=a.source&&(l.source=""+o,i=!0),f!=null&&f!=a.target&&(l.target=""+f,i=!0),i&&(t=t.move(l))}else{var c="parent"in e.data,d=e.data.parent;c&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),t=t.move({parent:d}))}}e.position&&t.position(e.position);var v=function(w,S,b){var C=e[w];C!=null&&C!==r[w]&&(C?t[S]():t[b]())};return v("removed","remove","restore"),v("selected","select","unselect"),v("selectable","selectify","unselectify"),v("locked","lock","unlock"),v("grabbable","grabify","ungrabify"),v("pannable","panify","unpanify"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var m={data:ai(r.data),position:ai(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};m.classes="";var y=0;return r.classes.forEach(function(x){return m.classes+=y++===0?x:" "+x}),m}}};Jt.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t],r=n.json();e.push(r)}return e};Jt.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new Kp(e,a,!1);t.push(i)}return new sr(e,t)};Jt.copy=Jt.clone;Jt.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),a=r._private,i=[],l=[],o,f=0,c=n.length;f<c;f++){var d=n[f];t&&!d.removed()||(d.isNode()?i.push(d):l.push(d))}o=i.concat(l);var v,m=function(){o.splice(v,1),v--};for(v=0;v<o.length;v++){var y=o[v],x=y._private,w=x.data;if(y.clearTraversalCache(),!(!t&&!x.removed)){if(w.id===void 0)w.id=tL();else if(Re(w.id))w.id=""+w.id;else if(ol(w.id)||!et(w.id)){ln("Can not create element with invalid string ID `"+w.id+"`"),m();continue}else if(r.hasElementWithId(w.id)){ln("Can not create second element with ID `"+w.id+"`"),m();continue}}var S=w.id;if(y.isNode()){var b=x.position;b.x==null&&(b.x=0),b.y==null&&(b.y=0)}if(y.isEdge()){for(var C=y,T=["source","target"],N=T.length,A=!1,R=0;R<N;R++){var D=T[R],L=w[D];Re(L)&&(L=w[D]=""+w[D]),L==null||L===""?(ln("Can not create edge `"+S+"` with unspecified "+D),A=!0):r.hasElementWithId(L)||(ln("Can not create edge `"+S+"` with nonexistant "+D+" `"+L+"`"),A=!0)}if(A){m();continue}var _=r.getElementById(w.source),M=r.getElementById(w.target);_.same(M)?_._private.edges.push(C):(_._private.edges.push(C),M._private.edges.push(C)),C._private.source=_,C._private.target=M}x.map=new Ui,x.map.set(S,{ele:y,index:0}),x.removed=!1,t&&r.addToPool(y)}for(var z=0;z<i.length;z++){var P=i[z],G=P._private.data;Re(G.parent)&&(G.parent=""+G.parent);var I=G.parent,F=I!=null;if(F||P._private.parent){var B=P._private.parent?r.collection().merge(P._private.parent):r.getElementById(I);if(B.empty())G.parent=void 0;else if(B[0].removed())Bt("Node added with missing parent, reference to parent removed"),G.parent=void 0,P._private.parent=null;else{for(var H=!1,Y=B;!Y.empty();){if(P.same(Y)){H=!0,G.parent=void 0;break}Y=Y.parent()}H||(B[0]._private.children.push(P),P._private.parent=B[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var Q=o.length===n.length?n:new sr(r,o),V=0;V<Q.length;V++){var q=Q[V];q.isNode()||(q.parallelEdges().clearTraversalCache(),q.source().clearTraversalCache(),q.target().clearTraversalCache())}var X;a.hasCompoundNodes?X=r.collection().merge(Q).merge(Q.connectedNodes()).merge(Q.parent()):X=Q,X.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?Q.emitAndNotify("add"):t&&Q.emit("add")}return n};Jt.removed=function(){var e=this[0];return e&&e._private.removed};Jt.inside=function(){var e=this[0];return e&&!e._private.removed};Jt.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],a={},i=n._private.cy;function l(I){for(var F=I._private.edges,B=0;B<F.length;B++)f(F[B])}function o(I){for(var F=I._private.children,B=0;B<F.length;B++)f(F[B])}function f(I){var F=a[I.id()];t&&I.removed()||F||(a[I.id()]=!0,I.isNode()?(r.push(I),l(I),o(I)):r.unshift(I))}for(var c=0,d=n.length;c<d;c++){var v=n[c];f(v)}function m(I,F){var B=I._private.edges;ul(B,F),I.clearTraversalCache()}function y(I){I.clearTraversalCache()}var x=[];x.ids={};function w(I,F){F=F[0],I=I[0];var B=I._private.children,H=I.id();ul(B,F),F._private.parent=null,x.ids[H]||(x.ids[H]=!0,x.push(I))}n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(r);for(var S=0;S<r.length;S++){var b=r[S];if(b.isEdge()){var C=b.source()[0],T=b.target()[0];m(C,b),m(T,b);for(var N=b.parallelEdges(),A=0;A<N.length;A++){var R=N[A];y(R),R.isBundledBezier()&&R.dirtyBoundingBoxCache()}}else{var D=b.parent();D.length!==0&&w(D,b)}t&&(b._private.removed=!0)}var L=i._private.elements;i._private.hasCompoundNodes=!1;for(var _=0;_<L.length;_++){var M=L[_];if(M.isParent()){i._private.hasCompoundNodes=!0;break}}var z=new sr(this.cy(),r);z.size()>0&&(e?z.emitAndNotify("remove"):t&&z.emit("remove"));for(var P=0;P<x.length;P++){var G=x[P];(!t||!G.removed())&&G.updateStyle()}return z};Jt.move=function(e){var t=this._private.cy,n=this,r=!1,a=!1,i=function(x){return x==null?x:""+x};if(e.source!==void 0||e.target!==void 0){var l=i(e.source),o=i(e.target),f=l!=null&&t.hasElementWithId(l),c=o!=null&&t.hasElementWithId(o);(f||c)&&(t.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var y=0;y<n.length;y++){var x=n[y],w=x._private.data;x.isEdge()&&(f&&(w.source=l),c&&(w.target=o))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var d=i(e.parent),v=d===null||t.hasElementWithId(d);if(v){var m=d===null?void 0:d;t.batch(function(){var y=n.remove(r,a);y.emitAndNotify("moveout");for(var x=0;x<n.length;x++){var w=n[x],S=w._private.data;w.isNode()&&(S.parent=m)}y.restore(r,a)}),n.emitAndNotify("move")}}return this};[hL,aW,jv,al,Zu,bW,em,BW,zL,IL,qW,lp,Dv,ir,il,pr].forEach(function(e){rt(Jt,e)});var YW={add:function(t){var n,r=this;if(na(t)){var a=t;if(a._private.cy===r)n=a.restore();else{for(var i=[],l=0;l<a.length;l++){var o=a[l];i.push(o.json())}n=new sr(r,i)}}else if($t(t)){var f=t;n=new sr(r,f)}else if(jt(t)&&($t(t.nodes)||$t(t.edges))){for(var c=t,d=[],v=["nodes","edges"],m=0,y=v.length;m<y;m++){var x=v[m],w=c[x];if($t(w))for(var S=0,b=w.length;S<b;S++){var C=rt({group:x},w[S]);d.push(C)}}n=new sr(r,d)}else{var T=t;n=new Kp(r,T).collection()}return n},remove:function(t){if(!na(t)){if(et(t)){var n=t;t=this.$(n)}}return t.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function XW(e,t,n,r){var a=4,i=.001,l=1e-7,o=10,f=11,c=1/(f-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var v=0;v<4;++v)if(typeof arguments[v]!="number"||isNaN(arguments[v])||!isFinite(arguments[v]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var m=d?new Float32Array(f):new Array(f);function y(M,z){return 1-3*z+3*M}function x(M,z){return 3*z-6*M}function w(M){return 3*M}function S(M,z,P){return((y(z,P)*M+x(z,P))*M+w(z))*M}function b(M,z,P){return 3*y(z,P)*M*M+2*x(z,P)*M+w(z)}function C(M,z){for(var P=0;P<a;++P){var G=b(z,e,n);if(G===0)return z;var I=S(z,e,n)-M;z-=I/G}return z}function T(){for(var M=0;M<f;++M)m[M]=S(M*c,e,n)}function N(M,z,P){var G,I,F=0;do I=z+(P-z)/2,G=S(I,e,n)-M,G>0?P=I:z=I;while(Math.abs(G)>l&&++F<o);return I}function A(M){for(var z=0,P=1,G=f-1;P!==G&&m[P]<=M;++P)z+=c;--P;var I=(M-m[P])/(m[P+1]-m[P]),F=z+I*c,B=b(F,e,n);return B>=i?C(M,F):B===0?F:N(M,z,z+c)}var R=!1;function D(){R=!0,(e!==t||n!==r)&&T()}var L=function(z){return R||D(),e===t&&n===r?z:z===0?0:z===1?1:S(A(z),t,r)};L.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var _="generateBezier("+[e,t,n,r]+")";return L.toString=function(){return _},L}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var QW=(function(){function e(r){return-r.tension*r.x-r.friction*r.v}function t(r,a,i){var l={x:r.x+i.dx*a,v:r.v+i.dv*a,tension:r.tension,friction:r.friction};return{dx:l.v,dv:e(l)}}function n(r,a){var i={dx:r.v,dv:e(r)},l=t(r,a*.5,i),o=t(r,a*.5,l),f=t(r,a,o),c=1/6*(i.dx+2*(l.dx+o.dx)+f.dx),d=1/6*(i.dv+2*(l.dv+o.dv)+f.dv);return r.x=r.x+c*a,r.v=r.v+d*a,r}return function r(a,i,l){var o={x:-1,v:0,tension:null,friction:null},f=[0],c=0,d=1/1e4,v=16/1e3,m,y,x;for(a=parseFloat(a)||500,i=parseFloat(i)||20,l=l||null,o.tension=a,o.friction=i,m=l!==null,m?(c=r(a,i),y=c/l*v):y=v;x=n(x||o,y),f.push(1+x.x),c+=16,Math.abs(x.x)>d&&Math.abs(x.v)>d;);return m?function(w){return f[w*(f.length-1)|0]}:c}})(),Xt=function(t,n,r,a){var i=XW(t,n,r,a);return function(l,o,f){return l+(o-l)*i(f)}},Mv={linear:function(t,n,r){return t+(n-t)*r},ease:Xt(.25,.1,.25,1),"ease-in":Xt(.42,0,1,1),"ease-out":Xt(0,0,.58,1),"ease-in-out":Xt(.42,0,.58,1),"ease-in-sine":Xt(.47,0,.745,.715),"ease-out-sine":Xt(.39,.575,.565,1),"ease-in-out-sine":Xt(.445,.05,.55,.95),"ease-in-quad":Xt(.55,.085,.68,.53),"ease-out-quad":Xt(.25,.46,.45,.94),"ease-in-out-quad":Xt(.455,.03,.515,.955),"ease-in-cubic":Xt(.55,.055,.675,.19),"ease-out-cubic":Xt(.215,.61,.355,1),"ease-in-out-cubic":Xt(.645,.045,.355,1),"ease-in-quart":Xt(.895,.03,.685,.22),"ease-out-quart":Xt(.165,.84,.44,1),"ease-in-out-quart":Xt(.77,0,.175,1),"ease-in-quint":Xt(.755,.05,.855,.06),"ease-out-quint":Xt(.23,1,.32,1),"ease-in-out-quint":Xt(.86,0,.07,1),"ease-in-expo":Xt(.95,.05,.795,.035),"ease-out-expo":Xt(.19,1,.22,1),"ease-in-out-expo":Xt(1,0,0,1),"ease-in-circ":Xt(.6,.04,.98,.335),"ease-out-circ":Xt(.075,.82,.165,1),"ease-in-out-circ":Xt(.785,.135,.15,.86),spring:function(t,n,r){if(r===0)return Mv.linear;var a=QW(t,n,r);return function(i,l,o){return i+(l-i)*a(o)}},"cubic-bezier":Xt};function TA(e,t,n,r,a){if(r===1||t===n)return n;var i=a(t,n,r);return e==null||((e.roundValue||e.color)&&(i=Math.round(i)),e.min!==void 0&&(i=Math.max(i,e.min)),e.max!==void 0&&(i=Math.min(i,e.max))),i}function kA(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function vu(e,t,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var l=kA(e,a),o=kA(t,a);if(Re(l)&&Re(o))return TA(i,l,o,n,r);if($t(l)&&$t(o)){for(var f=[],c=0;c<o.length;c++){var d=l[c],v=o[c];if(d!=null&&v!=null){var m=TA(i,d,v,n,r);f.push(m)}else f.push(v)}return f}}function WW(e,t,n,r){var a=!r,i=e._private,l=t._private,o=l.easing,f=l.startTime,c=r?e:e.cy(),d=c.style();if(!l.easingImpl)if(o==null)l.easingImpl=Mv.linear;else{var v;if(et(o)){var m=d.parse("transition-timing-function",o);v=m.value}else v=o;var y,x;et(v)?(y=v,x=[]):(y=v[1],x=v.slice(2).map(function(Q){return+Q})),x.length>0?(y==="spring"&&x.push(l.duration),l.easingImpl=Mv[y].apply(null,x)):l.easingImpl=Mv[y]}var w=l.easingImpl,S;if(l.duration===0?S=1:S=(n-f)/l.duration,l.applying&&(S=l.progress),S<0?S=0:S>1&&(S=1),l.delay==null){var b=l.startPosition,C=l.position;if(C&&a&&!e.locked()){var T={};wf(b.x,C.x)&&(T.x=vu(b.x,C.x,S,w)),wf(b.y,C.y)&&(T.y=vu(b.y,C.y,S,w)),e.position(T)}var N=l.startPan,A=l.pan,R=i.pan,D=A!=null&&r;D&&(wf(N.x,A.x)&&(R.x=vu(N.x,A.x,S,w)),wf(N.y,A.y)&&(R.y=vu(N.y,A.y,S,w)),e.emit("pan"));var L=l.startZoom,_=l.zoom,M=_!=null&&r;M&&(wf(L,_)&&(i.zoom=Xf(i.minZoom,vu(L,_,S,w),i.maxZoom)),e.emit("zoom")),(D||M)&&e.emit("viewport");var z=l.style;if(z&&z.length>0&&a){for(var P=0;P<z.length;P++){var G=z[P],I=G.name,F=G,B=l.startStyle[I],H=d.properties[B.name],Y=vu(B,F,S,w,H);d.overrideBypass(e,I,Y)}e.emit("style")}}return l.progress=S,S}function wf(e,t){return e==null||t==null?!1:Re(e)&&Re(t)?!0:!!(e&&t)}function ZW(e,t,n,r){var a=t._private;a.started=!0,a.startTime=n-a.progress*a.duration}function NA(e,t){var n=t._private.aniEles,r=[];function a(d,v){var m=d._private,y=m.animation.current,x=m.animation.queue,w=!1;if(y.length===0){var S=x.shift();S&&y.push(S)}for(var b=function(R){for(var D=R.length-1;D>=0;D--){var L=R[D];L()}R.splice(0,R.length)},C=y.length-1;C>=0;C--){var T=y[C],N=T._private;if(N.stopped){y.splice(C,1),N.hooked=!1,N.playing=!1,N.started=!1,b(N.frames);continue}!N.playing&&!N.applying||(N.playing&&N.applying&&(N.applying=!1),N.started||ZW(d,T,e),WW(d,T,e,v),N.applying&&(N.applying=!1),b(N.frames),N.step!=null&&N.step(e),T.completed()&&(y.splice(C,1),N.hooked=!1,N.playing=!1,N.started=!1,b(N.completes)),w=!0)}return!v&&y.length===0&&x.length===0&&r.push(d),w}for(var i=!1,l=0;l<n.length;l++){var o=n[l],f=a(o);i=i||f}var c=a(t,!0);(i||c)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var JW={animate:_t.animate(),animation:_t.animation(),animated:_t.animated(),clearQueue:_t.clearQueue(),delay:_t.delay(),delayAnimation:_t.delayAnimation(),stop:_t.stop(),addToAnimationPool:function(t){var n=this;n.styleEnabled()&&n._private.aniEles.merge(t)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var t=this;if(t._private.animationsRunning=!0,!t.styleEnabled())return;function n(){t._private.animationsRunning&&np(function(i){NA(i,t),n()})}var r=t.renderer();r&&r.beforeRender?r.beforeRender(function(i,l){NA(l,t)},r.beforeRenderPriorities.animations):n()}},eZ={qualifierCompare:function(t,n){return t==null||n==null?t==null&&n==null:t.sameText(n)},eventMatches:function(t,n,r){var a=n.qualifier;return a!=null?t!==r.target&&bd(r.target)&&a.matches(r.target):!0},addEventFields:function(t,n){n.cy=t,n.target=t},callbackContext:function(t,n,r){return n.qualifier!=null?r.target:t}},hv=function(t){return et(t)?new fl(t):t},UL={createEmitter:function(){var t=this._private;return t.emitter||(t.emitter=new tm(eZ,this)),this},emitter:function(){return this._private.emitter},on:function(t,n,r){return this.emitter().on(t,hv(n),r),this},removeListener:function(t,n,r){return this.emitter().removeListener(t,hv(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(t,n,r){return this.emitter().one(t,hv(n),r),this},once:function(t,n,r){return this.emitter().one(t,hv(n),r),this},emit:function(t,n){return this.emitter().emit(t,n),this},emitAndNotify:function(t,n){return this.emit(t),this.notify(t,n),this}};_t.eventAliasesOn(UL);var Vb={png:function(t){var n=this._private.renderer;return t=t||{},n.png(t)},jpg:function(t){var n=this._private.renderer;return t=t||{},t.bg=t.bg||"#fff",n.jpg(t)}};Vb.jpeg=Vb.jpg;var Ov={layout:function(t){var n=this;if(t==null){ln("Layout options must be specified to make a layout");return}if(t.name==null){ln("A `name` must be specified to make a layout");return}var r=t.name,a=n.extension("layout",r);if(a==null){ln("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;et(t.eles)?i=n.$(t.eles):i=t.eles!=null?t.eles:n.$();var l=new a(rt({},t,{cy:n,eles:i}));return l}};Ov.createLayout=Ov.makeLayout=Ov.layout;var tZ={notify:function(t,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var a=r.batchNotifications[t]=r.batchNotifications[t]||this.collection();n!=null&&a.merge(n);return}if(r.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(t,n)}},notifications:function(t){var n=this._private;return t===void 0?n.notificationsEnabled:(n.notificationsEnabled=!!t,this)},noNotifications:function(t){this.notifications(!1),t(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var t=this._private;return t.batchCount==null&&(t.batchCount=0),t.batchCount===0&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this},endBatch:function(){var t=this._private;if(t.batchCount===0)return this;if(t.batchCount--,t.batchCount===0){t.batchStyleEles.updateStyle();var n=this.renderer();Object.keys(t.batchNotifications).forEach(function(r){var a=t.batchNotifications[r];a.empty()?n.notify(r):n.notify(r,a)})}return this},batch:function(t){return this.startBatch(),t(),this.endBatch(),this},batchData:function(t){var n=this;return this.batch(function(){for(var r=Object.keys(t),a=0;a<r.length;a++){var i=r[a],l=t[i],o=n.getElementById(i);o.data(l)}})}},nZ=lr({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Hb={renderTo:function(t,n,r,a){var i=this._private.renderer;return i.renderTo(t,n,r,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(t){var n=this,r=n.extension("renderer",t.name);if(r==null){ln("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}t.wheelSensitivity!==void 0&&Bt("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=nZ(t);a.cy=n,n._private.renderer=new r(a),this.notify("init")},destroyRenderer:function(){var t=this;t.notify("destroy");var n=t.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach(function(r){var a=r._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(t){return this.on("render",t)},offRender:function(t){return this.off("render",t)}};Hb.invalidateDimensions=Hb.resize;var Lv={collection:function(t,n){return et(t)?this.$(t):na(t)?t.collection():$t(t)?(n||(n={}),new sr(this,t,n.unique,n.removed)):new sr(this)},nodes:function(t){var n=this.$(function(r){return r.isNode()});return t?n.filter(t):n},edges:function(t){var n=this.$(function(r){return r.isEdge()});return t?n.filter(t):n},$:function(t){var n=this._private.elements;return t?n.filter(t):n.spawnSelf()},mutableElements:function(){return this._private.elements}};Lv.elements=Lv.filter=Lv.$;var Zn={},_f="t",rZ="f";Zn.apply=function(e){for(var t=this,n=t._private,r=n.cy,a=r.collection(),i=0;i<e.length;i++){var l=e[i],o=t.getContextMeta(l);if(!o.empty){var f=t.getContextStyle(o),c=t.applyContextStyle(o,f,l);l._private.appliedInitStyle?t.updateTransitions(l,c.diffProps):l._private.appliedInitStyle=!0;var d=t.updateStyleHints(l);d&&a.push(l)}}return a};Zn.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=e+"-"+t,i=r[a];if(i)return i;for(var l=[],o={},f=0;f<n.length;f++){var c=n[f],d=e[f]===_f,v=t[f]===_f,m=d!==v,y=c.mappedProperties.length>0;if(m||v&&y){var x=void 0;m&&y||m?x=c.properties:y&&(x=c.mappedProperties);for(var w=0;w<x.length;w++){for(var S=x[w],b=S.name,C=!1,T=f+1;T<n.length;T++){var N=n[T],A=t[T]===_f;if(A&&(C=N.properties[S.name]!=null,C))break}!o[b]&&!C&&(o[b]=!0,l.push(b))}}}return r[a]=l,l};Zn.getContextMeta=function(e){for(var t=this,n="",r,a=e._private.styleCxtKey||"",i=0;i<t.length;i++){var l=t[i],o=l.selector&&l.selector.matches(e);o?n+=_f:n+=rZ}return r=t.getPropertiesDiff(a,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}};Zn.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var a={_private:{key:t}},i=0;i<n.length;i++){var l=n[i],o=t[i]===_f;if(o)for(var f=0;f<l.properties.length;f++){var c=l.properties[f];a[c.name]=c}}return r[t]=a,a};Zn.applyContextStyle=function(e,t,n){for(var r=this,a=e.diffPropNames,i={},l=r.types,o=0;o<a.length;o++){var f=a[o],c=t[f],d=n.pstyle(f);if(!c)if(d)d.bypass?c={name:f,deleteBypassed:!0}:c={name:f,delete:!0};else continue;if(d!==c){if(c.mapped===l.fn&&d!=null&&d.mapping!=null&&d.mapping.value===c.value){var v=d.mapping,m=v.fnValue=c.value(n);if(m===v.prevFnValue)continue}var y=i[f]={prev:d};r.applyParsedProperty(n,c),y.next=n.pstyle(f),y.next&&y.next.bypass&&(y.next=y.next.bypassed)}}return{diffProps:i}};Zn.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(re,ge,ke){return n.getPropertiesHash(re,ge,ke)},l=t.styleKey;if(e.removed())return!1;var o=t.group==="nodes",f=e._private.style;r=Object.keys(f);for(var c=0;c<a.length;c++){var d=a[c];t.styleKeys[d]=[$l,wu]}for(var v=function(re,ge){return t.styleKeys[ge][0]=$f(re,t.styleKeys[ge][0])},m=function(re,ge){return t.styleKeys[ge][1]=Kf(re,t.styleKeys[ge][1])},y=function(re,ge){v(re,ge),m(re,ge)},x=function(re,ge){for(var ke=0;ke<re.length;ke++){var Be=re.charCodeAt(ke);v(Be,ge),m(Be,ge)}},w=2e9,S=function(re){return-128<re&&re<128&&Math.floor(re)!==re?w-(re*1024|0):re},b=0;b<r.length;b++){var C=r[b],T=f[C];if(T!=null){var N=this.properties[C],A=N.type,R=N.groupKey,D=void 0;N.hashOverride!=null?D=N.hashOverride(e,T):T.pfValue!=null&&(D=T.pfValue);var L=N.enums==null?T.value:null,_=D!=null,M=L!=null,z=_||M,P=T.units;if(A.number&&z&&!A.multiple){var G=_?D:L;y(S(G),R),!_&&P!=null&&x(P,R)}else x(T.strValue,R)}}for(var I=[$l,wu],F=0;F<a.length;F++){var B=a[F],H=t.styleKeys[B];I[0]=$f(H[0],I[0]),I[1]=Kf(H[1],I[1])}t.styleKey=xY(I[0],I[1]);var Y=t.styleKeys;t.labelDimsKey=Ls(Y.labelDimensions);var Q=i(e,["label"],Y.labelDimensions);if(t.labelKey=Ls(Q),t.labelStyleKey=Ls(iv(Y.commonLabel,Q)),!o){var V=i(e,["source-label"],Y.labelDimensions);t.sourceLabelKey=Ls(V),t.sourceLabelStyleKey=Ls(iv(Y.commonLabel,V));var q=i(e,["target-label"],Y.labelDimensions);t.targetLabelKey=Ls(q),t.targetLabelStyleKey=Ls(iv(Y.commonLabel,q))}if(o){var X=t.styleKeys,U=X.nodeBody,te=X.nodeBorder,ie=X.nodeOutline,oe=X.backgroundImage,ae=X.compound,we=X.pie,fe=X.stripe,J=[U,te,ie,oe,ae,we,fe].filter(function(ne){return ne!=null}).reduce(iv,[$l,wu]);t.nodeKey=Ls(J),t.hasPie=we!=null&&we[0]!==$l&&we[1]!==wu,t.hasStripe=fe!=null&&fe[0]!==$l&&fe[1]!==wu}return l!==t.styleKey};Zn.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null,t.hasStripe=null};Zn.applyParsedProperty=function(e,t){var n=this,r=t,a=e._private.style,i,l=n.types,o=n.properties[r.name].type,f=r.bypass,c=a[r.name],d=c&&c.bypass,v=e._private,m="mapping",y=function(U){return U==null?null:U.pfValue!=null?U.pfValue:U.value},x=function(){var U=y(c),te=y(r);n.checkTriggers(e,r.name,U,te)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,"bezier",f)),r.delete)return a[r.name]=void 0,x(),!0;if(r.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,x(),!0):!1:(x(),!0);if(r.deleteBypass)return c?c.bypass?(a[r.name]=c.bypassed,x(),!0):!1:(x(),!0);var w=function(){Bt("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case l.mapData:{for(var S=r.field.split("."),b=v.data,C=0;C<S.length&&b;C++){var T=S[C];b=b[T]}if(b==null)return w(),!1;var N;if(Re(b)){var A=r.fieldMax-r.fieldMin;A===0?N=0:N=(b-r.fieldMin)/A}else return Bt("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+b+"` for `"+e.id()+"` is non-numeric)"),!1;if(N<0?N=0:N>1&&(N=1),o.color){var R=r.valueMin[0],D=r.valueMax[0],L=r.valueMin[1],_=r.valueMax[1],M=r.valueMin[2],z=r.valueMax[2],P=r.valueMin[3]==null?1:r.valueMin[3],G=r.valueMax[3]==null?1:r.valueMax[3],I=[Math.round(R+(D-R)*N),Math.round(L+(_-L)*N),Math.round(M+(z-M)*N),Math.round(P+(G-P)*N)];i={bypass:r.bypass,name:r.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else if(o.number){var F=r.valueMin+(r.valueMax-r.valueMin)*N;i=this.parse(r.name,F,r.bypass,m)}else return!1;if(!i)return w(),!1;i.mapping=r,r=i;break}case l.data:{for(var B=r.field.split("."),H=v.data,Y=0;Y<B.length&&H;Y++){var Q=B[Y];H=H[Q]}if(H!=null&&(i=this.parse(r.name,H,r.bypass,m)),!i)return w(),!1;i.mapping=r,r=i;break}case l.fn:{var V=r.value,q=r.fnValue!=null?r.fnValue:V(e);if(r.prevFnValue=q,q==null)return Bt("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(i=this.parse(r.name,q,r.bypass,m),!i)return Bt("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;i.mapping=ai(r),r=i;break}case void 0:break;default:return!1}return f?(d?r.bypassed=c.bypassed:r.bypassed=c,a[r.name]=r):d?c.bypassed=r:a[r.name]=r,x(),!0};Zn.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!t)r._private.style={};else for(var a=r._private.style,i=Object.keys(a),l=0;l<i.length;l++){var o=i[l],f=a[o];f!=null&&(f.bypass?f.bypassed=null:a[o]=null)}}};Zn.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()};Zn.updateTransitions=function(e,t){var n=this,r=e._private,a=e.pstyle("transition-property").value,i=e.pstyle("transition-duration").pfValue,l=e.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},f=!1,c=0;c<a.length;c++){var d=a[c],v=e.pstyle(d),m=t[d];if(m){var y=m.prev,x=y,w=m.next!=null?m.next:v,S=!1,b=void 0,C=1e-6;x&&(Re(x.pfValue)&&Re(w.pfValue)?(S=w.pfValue-x.pfValue,b=x.pfValue+C*S):Re(x.value)&&Re(w.value)?(S=w.value-x.value,b=x.value+C*S):$t(x.value)&&$t(w.value)&&(S=x.value[0]!==w.value[0]||x.value[1]!==w.value[1]||x.value[2]!==w.value[2],b=x.strValue),S&&(o[d]=w.strValue,this.applyBypass(e,d,b),f=!0))}}if(!f)return;r.transitioning=!0,new dc(function(T){l>0?e.delayAnimation(l).play().promise().then(T):T()}).then(function(){return e.animation({style:o,duration:i,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,a),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,a),e.emitAndNotify("style"),r.transitioning=!1)};Zn.checkTrigger=function(e,t,n,r,a,i){var l=this.properties[t],o=a(l);e.removed()||o!=null&&o(n,r,e)&&i(l)};Zn.checkZOrderTrigger=function(e,t,n,r){var a=this;this.checkTrigger(e,t,n,r,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",e)})};Zn.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBounds},function(a){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})};Zn.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBoundsOfConnectedEdges},function(a){e.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};Zn.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBoundsOfParallelEdges},function(a){e.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};Zn.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var Nd={};Nd.applyBypass=function(e,t,n,r){var a=this,i=[],l=!0;if(t==="*"||t==="**"){if(n!==void 0)for(var o=0;o<a.properties.length;o++){var f=a.properties[o],c=f.name,d=this.parse(c,n,!0);d&&i.push(d)}}else if(et(t)){var v=this.parse(t,n,!0);v&&i.push(v)}else if(jt(t)){var m=t;r=n;for(var y=Object.keys(m),x=0;x<y.length;x++){var w=y[x],S=m[w];if(S===void 0&&(S=m[Gp(w)]),S!==void 0){var b=this.parse(w,S,!0);b&&i.push(b)}}}else return!1;if(i.length===0)return!1;for(var C=!1,T=0;T<e.length;T++){for(var N=e[T],A={},R=void 0,D=0;D<i.length;D++){var L=i[D];if(r){var _=N.pstyle(L.name);R=A[L.name]={prev:_}}C=this.applyParsedProperty(N,ai(L))||C,r&&(R.next=N.pstyle(L.name))}C&&this.updateStyleHints(N),r&&this.updateTransitions(N,A,l)}return C};Nd.overrideBypass=function(e,t,n){t=pw(t);for(var r=0;r<e.length;r++){var a=e[r],i=a._private.style[t],l=this.properties[t].type,o=l.color,f=l.mutiple,c=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,t,n):(i.value=n,i.pfValue!=null&&(i.pfValue=n),o?i.strValue="rgb("+n.join(",")+")":f?i.strValue=n.join(" "):i.strValue=""+n,this.updateStyleHints(a)),this.checkTriggers(a,t,c,n)}};Nd.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)};Nd.removeBypasses=function(e,t,n){for(var r=!0,a=0;a<e.length;a++){for(var i=e[a],l={},o=0;o<t.length;o++){var f=t[o],c=this.properties[f],d=i.pstyle(c.name);if(!(!d||!d.bypass)){var v="",m=this.parse(f,v,!0),y=l[c.name]={prev:d};this.applyParsedProperty(i,m),y.next=i.pstyle(c.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,l,r)}};var jw={};jw.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1};jw.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)};var ci={};ci.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)};ci.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var r={},a=0;a<n.properties.length;a++){var i=n.properties[a],l=n.getStylePropertyValue(e,i.name,t);l!=null&&(r[i.name]=l,r[Gp(i.name)]=l)}return r}};ci.getIndexedStyle=function(e,t,n,r){var a=e.pstyle(t)[n][r];return a??e.cy().style().getDefaultProperty(t)[n][0]};ci.getStylePropertyValue=function(e,t,n){var r=this;if(e=e[0],e){var a=r.properties[t];a.alias&&(a=a.pointsTo);var i=a.type,l=e.pstyle(a.name);if(l){var o=l.value,f=l.units,c=l.strValue;if(n&&i.number&&o!=null&&Re(o)){var d=e.cy().zoom(),v=function(S){return S*d},m=function(S,b){return v(S)+b},y=$t(o),x=y?f.every(function(w){return w!=null}):f!=null;return x?y?o.map(function(w,S){return m(w,f[S])}).join(" "):m(o,f):y?o.map(function(w){return et(w)?w:""+v(w)}).join(" "):""+v(o)}else if(c!=null)return c}return null}};ci.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var a=t[r],i=a.name,l=e.pstyle(i);l!==void 0&&(jt(l)?l=this.parse(i,l.strValue):l=this.parse(i,l)),l&&(n[i]=l)}return n};ci.getPropsList=function(e){var t=this,n=[],r=e,a=t.properties;if(r)for(var i=Object.keys(r),l=0;l<i.length;l++){var o=i[l],f=r[o],c=a[o]||a[pw(o)],d=this.parse(c.name,f);d&&n.push(d)}return n};ci.getNonDefaultPropertiesHash=function(e,t,n){var r=n.slice(),a,i,l,o,f,c;for(f=0;f<t.length;f++)if(a=t[f],i=e.pstyle(a,!1),i!=null)if(i.pfValue!=null)r[0]=$f(o,r[0]),r[1]=Kf(o,r[1]);else for(l=i.strValue,c=0;c<l.length;c++)o=l.charCodeAt(c),r[0]=$f(o,r[0]),r[1]=Kf(o,r[1]);return r};ci.getPropertiesHash=ci.getNonDefaultPropertiesHash;var am={};am.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],a=r.selector,i=r.style||r.css,l=Object.keys(i);t.selector(a);for(var o=0;o<l.length;o++){var f=l[o],c=i[f];t.css(f,c)}}return t};am.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t};am.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,a=n.properties,i={},l=0;l<a.length;l++){var o=a[l];i[o.name]=o.strValue}e.push({selector:r?r.toString():"core",style:i})}return e};var Dw={};Dw.appendFromString=function(e){var t=this,n=this,r=""+e,a,i,l;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){r.length>a.length?r=r.substr(a.length):r=""}function f(){i.length>l.length?i=i.substr(l.length):i=""}for(;;){var c=r.match(/^\s*$/);if(c)break;var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Bt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=d[0];var v=d[1];if(v!=="core"){var m=new fl(v);if(m.invalid){Bt("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),o();continue}}var y=d[2],x=!1;i=y;for(var w=[];;){var S=i.match(/^\s*$/);if(S)break;var b=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!b){Bt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+y),x=!0;break}l=b[0];var C=b[1],T=b[2],N=t.properties[C];if(!N){Bt("Skipping property: Invalid property name in: "+l),f();continue}var A=n.parse(C,T);if(!A){Bt("Skipping property: Invalid property definition in: "+l),f();continue}w.push({name:C,val:T}),f()}if(x){o();break}n.selector(v);for(var R=0;R<w.length;R++){var D=w[R];n.css(D.name,D.val)}o()}return n};Dw.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var Mn={};(function(){var e=In,t=WK,n=JK,r=eY,a=tY,i=function(ne){return"^"+ne+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},l=function(ne){var re=e+"|\\w+|"+t+"|"+n+"|"+r+"|"+a;return"^"+ne+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+re+")\\s*\\,\\s*("+re+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Mn.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:l("mapData")},mapLayoutData:{mapping:!0,regex:l("mapLayoutData")},mapScratch:{mapping:!0,regex:l("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(ne,re){switch(ne.length){case 2:return re[0]!=="deg"&&re[0]!=="rad"&&re[1]!=="deg"&&re[1]!=="rad";case 1:return et(ne[0])||re[0]==="deg"||re[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(ne){var re=ne.length;return re===1||re===2||re===4}}};var f={zeroNonZero:function(ne,re){return(ne==null||re==null)&&ne!==re||ne==0&&re!=0?!0:ne!=0&&re==0},any:function(ne,re){return ne!=re},emptyNonEmpty:function(ne,re){var ge=ol(ne),ke=ol(re);return ge&&!ke||!ge&&ke}},c=Mn.types,d=[{name:"label",type:c.text,triggersBounds:f.any,triggersZOrder:f.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any}],v=[{name:"source-label",type:c.text,triggersBounds:f.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-offset",type:c.size,triggersBounds:f.any}],m=[{name:"target-label",type:c.text,triggersBounds:f.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-offset",type:c.size,triggersBounds:f.any}],y=[{name:"font-family",type:c.fontFamily,triggersBounds:f.any},{name:"font-style",type:c.fontStyle,triggersBounds:f.any},{name:"font-weight",type:c.fontWeight,triggersBounds:f.any},{name:"font-size",type:c.size,triggersBounds:f.any},{name:"text-transform",type:c.textTransform,triggersBounds:f.any},{name:"text-wrap",type:c.textWrap,triggersBounds:f.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:f.any},{name:"text-max-width",type:c.size,triggersBounds:f.any},{name:"text-outline-width",type:c.size,triggersBounds:f.any},{name:"line-height",type:c.positiveNumber,triggersBounds:f.any}],x=[{name:"text-valign",type:c.valign,triggersBounds:f.any},{name:"text-halign",type:c.halign,triggersBounds:f.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:f.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:f.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:f.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:f.any},{name:"text-justification",type:c.justification},{name:"box-select-labels",type:c.bool,triggersBounds:f.any}],w=[{name:"events",type:c.bool,triggersZOrder:f.any},{name:"text-events",type:c.bool,triggersZOrder:f.any},{name:"box-selection",type:c.boxSelection,triggersZOrder:f.any}],S=[{name:"display",type:c.display,triggersZOrder:f.any,triggersBounds:f.any,triggersBoundsOfConnectedEdges:f.any,triggersBoundsOfParallelEdges:function(ne,re,ge){return ne===re?!1:ge.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:c.visibility,triggersZOrder:f.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:f.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:f.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:f.any},{name:"z-index",type:c.number,triggersZOrder:f.any}],b=[{name:"overlay-padding",type:c.size,triggersBounds:f.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"overlay-corner-radius",type:c.cornerRadius}],C=[{name:"underlay-padding",type:c.size,triggersBounds:f.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"underlay-corner-radius",type:c.cornerRadius}],T=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],N=function(ne,re){return re.value==="label"?-ne.poolIndex():re.pfValue},A=[{name:"height",type:c.nodeSize,triggersBounds:f.any,hashOverride:N},{name:"width",type:c.nodeSize,triggersBounds:f.any,hashOverride:N},{name:"shape",type:c.nodeShape,triggersBounds:f.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:f.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:f.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:f.any}],R=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:f.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],D=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:f.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:f.any}],L=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],_=[{name:"position",type:c.position,triggersBounds:f.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:f.any},{name:"min-width",type:c.size,triggersBounds:f.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height",type:c.size,triggersBounds:f.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:f.any}],M=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:f.any,triggersBoundsOfParallelEdges:function(ne,re){return ne===re?!1:ne==="bezier"||re==="bezier"}},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:f.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"control-point-step-size",type:c.size,triggersBounds:f.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"control-point-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"segment-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-radii",type:c.numbers,triggersBounds:f.any},{name:"radius-type",type:c.radiusType,triggersBounds:f.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:f.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:f.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:f.any},{name:"taxi-radius",type:c.number,triggersBounds:f.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:f.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:f.any},{name:"loop-direction",type:c.angle,triggersBounds:f.any},{name:"loop-sweep",type:c.angle,triggersBounds:f.any},{name:"source-distance-from-node",type:c.size,triggersBounds:f.any},{name:"target-distance-from-node",type:c.size,triggersBounds:f.any}],z=[{name:"ghost",type:c.bool,triggersBounds:f.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-opacity",type:c.zeroOneNumber}],P=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],G=[];Mn.pieBackgroundN=16,G.push({name:"pie-size",type:c.sizeMaybePercent}),G.push({name:"pie-hole",type:c.sizeMaybePercent}),G.push({name:"pie-start-angle",type:c.angle});for(var I=1;I<=Mn.pieBackgroundN;I++)G.push({name:"pie-"+I+"-background-color",type:c.color}),G.push({name:"pie-"+I+"-background-size",type:c.percent}),G.push({name:"pie-"+I+"-background-opacity",type:c.zeroOneNumber});var F=[];Mn.stripeBackgroundN=16,F.push({name:"stripe-size",type:c.sizeMaybePercent}),F.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var B=1;B<=Mn.stripeBackgroundN;B++)F.push({name:"stripe-"+B+"-background-color",type:c.color}),F.push({name:"stripe-"+B+"-background-size",type:c.percent}),F.push({name:"stripe-"+B+"-background-opacity",type:c.zeroOneNumber});var H=[],Y=Mn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:f.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(J){Y.forEach(function(ne){var re=ne+"-"+J.name,ge=J.type,ke=J.triggersBounds;H.push({name:re,type:ge,triggersBounds:ke})})},{});var Q=Mn.properties=[].concat(w,T,S,b,C,z,x,y,d,v,m,A,R,D,L,G,F,_,M,H,P),V=Mn.propertyGroups={behavior:w,transition:T,visibility:S,overlay:b,underlay:C,ghost:z,commonLabel:x,labelDimensions:y,mainLabel:d,sourceLabel:v,targetLabel:m,nodeBody:A,nodeBorder:R,nodeOutline:D,backgroundImage:L,pie:G,stripe:F,compound:_,edgeLine:M,edgeArrow:H,core:P},q=Mn.propertyGroupNames={},X=Mn.propertyGroupKeys=Object.keys(V);X.forEach(function(J){q[J]=V[J].map(function(ne){return ne.name}),V[J].forEach(function(ne){return ne.groupKey=J})});var U=Mn.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Mn.propertyNames=Q.map(function(J){return J.name});for(var te=0;te<Q.length;te++){var ie=Q[te];Q[ie.name]=ie}for(var oe=0;oe<U.length;oe++){var ae=U[oe],we=Q[ae.pointsTo],fe={name:ae.name,alias:!0,pointsTo:we};Q.push(fe),Q[ae.name]=fe}})();Mn.getDefaultProperty=function(e){return this.getDefaultProperties()[e]};Mn.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=rt({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var d=1;d<=Mn.pieBackgroundN;d++){var v=c.name.replace("{{i}}",d),m=c.value;f[v]=m}return f},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var d=1;d<=Mn.stripeBackgroundN;d++){var v=c.name.replace("{{i}}",d),m=c.value;f[v]=m}return f},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(f,c){return Mn.arrowPrefixes.forEach(function(d){var v=d+"-"+c.name,m=c.value;f[v]=m}),f},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var i=a.name,l=t[i],o=this.parse(i,l);n[i]=o}}return e.defaultProperties=n,e.defaultProperties};Mn.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var im={};im.parse=function(e,t,n,r){var a=this;if(hn(t))return a.parseImplWarn(e,t,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,l=n?"t":"f",o=""+t,f=ZO(e,o,l,i),c=a.propCache=a.propCache||[],d;return(d=c[f])||(d=c[f]=a.parseImplWarn(e,t,n,r)),(n||r==="mapping")&&(d=ai(d),d&&(d.value=ai(d.value))),d};im.parseImplWarn=function(e,t,n,r){var a=this.parseImpl(e,t,n,r);return!a&&t!=null&&Bt("The style property `".concat(e,": ").concat(t,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&t==="label"&&Bt("The style value of `label` is deprecated for `"+a.name+"`"),a};im.parseImpl=function(e,t,n,r){var a=this;e=pw(e);var i=a.properties[e],l=t,o=a.types;if(!i||t===void 0)return null;i.alias&&(i=i.pointsTo,e=i.name);var f=et(t);f&&(t=t.trim());var c=i.type;if(!c)return null;if(n&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(hn(t))return{name:e,value:t,strValue:"fn",mapped:o.fn,bypass:n};var d,v;if(!(!f||r||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(d=new RegExp(o.data.regex).exec(t))){if(n)return!1;var m=o.data;return{name:e,value:d,strValue:""+t,mapped:m,field:d[1],bypass:n}}else if(t.length>=10&&t[0]==="m"&&(v=new RegExp(o.mapData.regex).exec(t))){if(n||c.multiple)return!1;var y=o.mapData;if(!(c.color||c.number))return!1;var x=this.parse(e,v[4]);if(!x||x.mapped)return!1;var w=this.parse(e,v[5]);if(!w||w.mapped)return!1;if(x.pfValue===w.pfValue||x.strValue===w.strValue)return Bt("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+x.strValue+"`"),this.parse(e,x.strValue);if(c.color){var S=x.value,b=w.value,C=S[0]===b[0]&&S[1]===b[1]&&S[2]===b[2]&&(S[3]===b[3]||(S[3]==null||S[3]===1)&&(b[3]==null||b[3]===1));if(C)return!1}return{name:e,value:v,strValue:""+t,mapped:y,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:x.value,valueMax:w.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var T;if(f?T=t.split(/\s+/):$t(t)?T=t:T=[t],c.evenMultiple&&T.length%2!==0)return null;for(var N=[],A=[],R=[],D="",L=!1,_=0;_<T.length;_++){var M=a.parse(e,T[_],n,"multiple");L=L||et(M.value),N.push(M.value),R.push(M.pfValue!=null?M.pfValue:M.value),A.push(M.units),D+=(_>0?" ":"")+M.strValue}return c.validate&&!c.validate(N,A)?null:c.singleEnum&&L?N.length===1&&et(N[0])?{name:e,value:N[0],strValue:N[0],bypass:n}:null:{name:e,value:N,pfValue:R,strValue:D,bypass:n,units:A}}var z=function(){for(var fe=0;fe<c.enums.length;fe++){var J=c.enums[fe];if(J===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(c.number){var P,G="px";if(c.units&&(P=c.units),c.implicitUnits&&(G=c.implicitUnits),!c.unitless)if(f){var I="px|em"+(c.allowPercent?"|\\%":"");P&&(I=P);var F=t.match("^("+In+")("+I+")?$");F&&(t=F[1],P=F[2]||G)}else(!P||c.implicitUnits)&&(P=G);if(t=parseFloat(t),isNaN(t)&&c.enums===void 0)return null;if(isNaN(t)&&c.enums!==void 0)return t=l,z();if(c.integer&&!HK(t)||c.min!==void 0&&(t<c.min||c.strictMin&&t===c.min)||c.max!==void 0&&(t>c.max||c.strictMax&&t===c.max))return null;var B={name:e,value:t,strValue:""+t+(P||""),units:P,bypass:n};return c.unitless||P!=="px"&&P!=="em"?B.pfValue=t:B.pfValue=P==="px"||!P?t:this.getEmSizeInPixels()*t,(P==="ms"||P==="s")&&(B.pfValue=P==="ms"?t:1e3*t),(P==="deg"||P==="rad")&&(B.pfValue=P==="rad"?t:eX(t)),P==="%"&&(B.pfValue=t/100),B}else if(c.propList){var H=[],Y=""+t;if(Y!=="none"){for(var Q=Y.split(/\s*,\s*|\s+/),V=0;V<Q.length;V++){var q=Q[V].trim();a.properties[q]?H.push(q):Bt("`"+q+"` is not a valid property name")}if(H.length===0)return null}return{name:e,value:H,strValue:H.length===0?"none":H.join(" "),bypass:n}}else if(c.color){var X=GO(t);return X?{name:e,value:X,pfValue:X,strValue:"rgb("+X[0]+","+X[1]+","+X[2]+")",bypass:n}:null}else if(c.regex||c.regexes){if(c.enums){var U=z();if(U)return U}for(var te=c.regexes?c.regexes:[c.regex],ie=0;ie<te.length;ie++){var oe=new RegExp(te[ie]),ae=oe.exec(t);if(ae)return{name:e,value:c.singleRegexMatchValue?ae[1]:ae,strValue:""+t,bypass:n}}return null}else return c.string?{name:e,value:""+t,strValue:""+t,bypass:n}:c.enums?z():null};var Wn=function(t){if(!(this instanceof Wn))return new Wn(t);if(!vw(t)){ln("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},mr=Wn.prototype;mr.instanceString=function(){return"style"};mr.clear=function(){for(var e=this._private,t=e.cy,n=t.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};mr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};mr.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)};mr.selector=function(e){var t=e==="core"?null:new fl(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this};mr.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],r=0;r<e.properties.length;r++){var a=e.properties[r],i=n[a.name];i===void 0&&(i=n[Gp(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else t.length===2&&this.cssRule(t[0],t[1]);return this};mr.style=mr.css;mr.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n);var a=!this[r].selector;a&&(this._private.coreStyle[n.name]=n)}return this};mr.append=function(e){return UO(e)?e.appendToStyle(this):$t(e)?this.appendFromJson(e):et(e)&&this.appendFromString(e),this};Wn.fromJson=function(e,t){var n=new Wn(e);return n.fromJson(t),n};Wn.fromString=function(e,t){return new Wn(e).fromString(t)};[Zn,Nd,jw,ci,am,Dw,Mn,im].forEach(function(e){rt(mr,e)});Wn.types=mr.types;Wn.properties=mr.properties;Wn.propertyGroups=mr.propertyGroups;Wn.propertyGroupNames=mr.propertyGroupNames;Wn.propertyGroupKeys=mr.propertyGroupKeys;var aZ={style:function(t){if(t){var n=this.setStyle(t);n.update()}return this._private.style},setStyle:function(t){var n=this._private;return UO(t)?n.style=t.generateStyle(this):$t(t)?n.style=Wn.fromJson(this,t):et(t)?n.style=Wn.fromString(this,t):n.style=Wn(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},iZ="single",xo={autolock:function(t){if(t!==void 0)this._private.autolock=!!t;else return this._private.autolock;return this},autoungrabify:function(t){if(t!==void 0)this._private.autoungrabify=!!t;else return this._private.autoungrabify;return this},autounselectify:function(t){if(t!==void 0)this._private.autounselectify=!!t;else return this._private.autounselectify;return this},selectionType:function(t){var n=this._private;if(n.selectionType==null&&(n.selectionType=iZ),t!==void 0)(t==="additive"||t==="single")&&(n.selectionType=t);else return n.selectionType;return this},panningEnabled:function(t){if(t!==void 0)this._private.panningEnabled=!!t;else return this._private.panningEnabled;return this},userPanningEnabled:function(t){if(t!==void 0)this._private.userPanningEnabled=!!t;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(t){if(t!==void 0)this._private.zoomingEnabled=!!t;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(t){if(t!==void 0)this._private.userZoomingEnabled=!!t;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(t){if(t!==void 0)this._private.boxSelectionEnabled=!!t;else return this._private.boxSelectionEnabled;return this},pan:function(){var t=arguments,n=this._private.pan,r,a,i,l,o;switch(t.length){case 0:return n;case 1:if(et(t[0]))return r=t[0],n[r];if(jt(t[0])){if(!this._private.panningEnabled)return this;i=t[0],l=i.x,o=i.y,Re(l)&&(n.x=l),Re(o)&&(n.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=t[0],a=t[1],(r==="x"||r==="y")&&Re(a)&&(n[r]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(t,n){var r=arguments,a=this._private.pan,i,l,o,f,c;if(!this._private.panningEnabled)return this;switch(r.length){case 1:jt(t)&&(o=r[0],f=o.x,c=o.y,Re(f)&&(a.x+=f),Re(c)&&(a.y+=c),this.emit("pan viewport"));break;case 2:i=t,l=n,(i==="x"||i==="y")&&Re(l)&&(a[i]+=l),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(t,n){var r=this.getFitViewport(t,n);if(r){var a=this._private;a.zoom=r.zoom,a.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(t,n){if(Re(t)&&n===void 0&&(n=t,t=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(et(t)){var a=t;t=this.$(a)}else if(KK(t)){var i=t;r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else na(t)||(t=this.mutableElements());if(!(na(t)&&t.empty())){r=r||t.boundingBox();var l=this.width(),o=this.height(),f;if(n=Re(n)?n:0,!isNaN(l)&&!isNaN(o)&&l>0&&o>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){f=Math.min((l-2*n)/r.w,(o-2*n)/r.h),f=f>this._private.maxZoom?this._private.maxZoom:f,f=f<this._private.minZoom?this._private.minZoom:f;var c={x:(l-f*(r.x1+r.x2))/2,y:(o-f*(r.y1+r.y2))/2};return{zoom:f,pan:c}}}}},zoomRange:function(t,n){var r=this._private;if(n==null){var a=t;t=a.min,n=a.max}return Re(t)&&Re(n)&&t<=n?(r.minZoom=t,r.maxZoom=n):Re(t)&&n===void 0&&t<=r.maxZoom?r.minZoom=t:Re(n)&&t===void 0&&n>=r.minZoom&&(r.maxZoom=n),this},minZoom:function(t){return t===void 0?this._private.minZoom:this.zoomRange({min:t})},maxZoom:function(t){return t===void 0?this._private.maxZoom:this.zoomRange({max:t})},getZoomedViewport:function(t){var n=this._private,r=n.pan,a=n.zoom,i,l,o=!1;if(n.zoomingEnabled||(o=!0),Re(t)?l=t:jt(t)&&(l=t.level,t.position!=null?i=Yp(t.position,a,r):t.renderedPosition!=null&&(i=t.renderedPosition),i!=null&&!n.panningEnabled&&(o=!0)),l=l>n.maxZoom?n.maxZoom:l,l=l<n.minZoom?n.minZoom:l,o||!Re(l)||l===a||i!=null&&(!Re(i.x)||!Re(i.y)))return null;if(i!=null){var f=r,c=a,d=l,v={x:-d/c*(i.x-f.x)+i.x,y:-d/c*(i.y-f.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:v}}else return{zoomed:!0,panned:!1,zoom:l,pan:r}},zoom:function(t){if(t===void 0)return this._private.zoom;var n=this.getZoomedViewport(t),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(t){var n=this._private,r=!0,a=!0,i=[],l=!1,o=!1;if(!t)return this;if(Re(t.zoom)||(r=!1),jt(t.pan)||(a=!1),!r&&!a)return this;if(r){var f=t.zoom;f<n.minZoom||f>n.maxZoom||!n.zoomingEnabled?l=!0:(n.zoom=f,i.push("zoom"))}if(a&&(!l||!t.cancelOnFailedZoom)&&n.panningEnabled){var c=t.pan;Re(c.x)&&(n.pan.x=c.x,o=!1),Re(c.y)&&(n.pan.y=c.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(t){var n=this.getCenterPan(t);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(t,n){if(this._private.panningEnabled){if(et(t)){var r=t;t=this.mutableElements().filter(r)}else na(t)||(t=this.mutableElements());if(t.length!==0){var a=t.boundingBox(),i=this.width(),l=this.height();n=n===void 0?this._private.zoom:n;var o={x:(i-n*(a.x1+a.x2))/2,y:(l-n*(a.y1+a.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var t=this._private,n=t.container,r=this;return t.sizeCache=t.sizeCache||(n?(function(){var a=r.window().getComputedStyle(n),i=function(o){return parseFloat(a.getPropertyValue(o))};return{width:n.clientWidth-i("padding-left")-i("padding-right"),height:n.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var t=this._private.pan,n=this._private.zoom,r=this.renderedExtent(),a={x1:(r.x1-t.x)/n,x2:(r.x2-t.x)/n,y1:(r.y1-t.y)/n,y2:(r.y2-t.y)/n};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var t=this.width(),n=this.height();return{x1:0,y1:0,x2:t,y2:n,w:t,h:n}},multiClickDebounceTime:function(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};xo.centre=xo.center;xo.autolockNodes=xo.autolock;xo.autoungrabifyNodes=xo.autoungrabify;var Jf={data:_t.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_t.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_t.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_t.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Jf.attr=Jf.data;Jf.removeAttr=Jf.removeData;var ed=function(t){var n=this;t=rt({},t);var r=t.container;r&&!tp(r)&&tp(r[0])&&(r=r[0]);var a=r?r._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];r&&(r._cyreg=a),a.cy=n;var l=Pn!==void 0&&r!==void 0&&!t.headless,o=t;o.layout=rt({name:l?"grid":"null"},o.layout),o.renderer=rt({name:l?"canvas":"null"},o.renderer);var f=function(x,w,S){return w!==void 0?w:S!==void 0?S:x},c=this._private={container:r,ready:!1,options:o,elements:new sr(this),listeners:[],aniEles:new sr(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:f(!0,o.zoomingEnabled),userZoomingEnabled:f(!0,o.userZoomingEnabled),panningEnabled:f(!0,o.panningEnabled),userPanningEnabled:f(!0,o.userPanningEnabled),boxSelectionEnabled:f(!0,o.boxSelectionEnabled),autolock:f(!1,o.autolock,o.autolockNodes),autoungrabify:f(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:f(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?l:o.styleEnabled,zoom:Re(o.zoom)?o.zoom:1,pan:{x:jt(o.pan)&&Re(o.pan.x)?o.pan.x:0,y:jt(o.pan)&&Re(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:f(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var d=function(x,w){var S=x.some(YK);if(S)return dc.all(x).then(w);w(x)};c.styleEnabled&&n.setStyle([]);var v=rt({},o,o.renderer);n.initRenderer(v);var m=function(x,w,S){n.notifications(!1);var b=n.mutableElements();b.length>0&&b.remove(),x!=null&&(jt(x)||$t(x))&&n.add(x),n.one("layoutready",function(T){n.notifications(!0),n.emit(T),n.one("load",w),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",S),n.emit("done")});var C=rt({},n._private.options.layout);C.eles=n.elements(),n.layout(C).run()};d([o.style,o.elements],function(y){var x=y[0],w=y[1];c.styleEnabled&&n.style().append(x),m(w,function(){n.startAnimationLoop(),c.ready=!0,hn(o.ready)&&n.on("ready",o.ready);for(var S=0;S<i.length;S++){var b=i[S];n.on("ready",b)}a&&(a.readies=[]),n.emit("ready")},o.done)})},op=ed.prototype;rt(op,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(t){return this.isReady()?this.emitter().emit("ready",[],t):this.on("ready",t),this},destroy:function(){var t=this;if(!t.destroyed())return t.stopAnimationLoop(),t.destroyRenderer(),this.emit("destroy"),t._private.destroyed=!0,t},hasElementWithId:function(t){return this._private.elements.hasElementWithId(t)},getElementById:function(t){return this._private.elements.getElementById(t)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(t){return this._private.elements.merge(t),this},removeFromPool:function(t){return this._private.elements.unmerge(t),this},container:function(){return this._private.container||null},window:function(){var t=this._private.container;if(t==null)return Pn;var n=this._private.container.ownerDocument;return n===void 0||n==null?Pn:n.defaultView||Pn},mount:function(t){if(t!=null){var n=this,r=n._private,a=r.options;return!tp(t)&&tp(t[0])&&(t=t[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=t,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(rt({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),n.startAnimationLoop(),n.style(a.style),n.emit("mount"),n}},unmount:function(){var t=this;return t.stopAnimationLoop(),t.destroyRenderer(),t.initRenderer({name:"null"}),t.emit("unmount"),t},options:function(){return ai(this._private.options)},json:function(t){var n=this,r=n._private,a=n.mutableElements(),i=function(N){return n.getElementById(N.id())};if(jt(t)){if(n.startBatch(),t.elements){var l={},o=function(N,A){for(var R=[],D=[],L=0;L<N.length;L++){var _=N[L];if(!_.data.id){Bt("cy.json() cannot handle elements without an ID attribute");continue}var M=""+_.data.id,z=n.getElementById(M);l[M]=!0,z.length!==0?D.push({ele:z,json:_}):(A&&(_.group=A),R.push(_))}n.add(R);for(var P=0;P<D.length;P++){var G=D[P],I=G.ele,F=G.json;I.json(F)}};if($t(t.elements))o(t.elements);else for(var f=["nodes","edges"],c=0;c<f.length;c++){var d=f[c],v=t.elements[d];$t(v)&&o(v,d)}var m=n.collection();a.filter(function(T){return!l[T.id()]}).forEach(function(T){T.isParent()?m.merge(T):T.remove()}),m.forEach(function(T){return T.children().move({parent:null})}),m.forEach(function(T){return i(T).remove()})}t.style&&n.style(t.style),t.zoom!=null&&t.zoom!==r.zoom&&n.zoom(t.zoom),t.pan&&(t.pan.x!==r.pan.x||t.pan.y!==r.pan.y)&&n.pan(t.pan),t.data&&n.data(t.data);for(var y=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],x=0;x<y.length;x++){var w=y[x];t[w]!=null&&n[w](t[w])}return n.endBatch(),this}else{var S=!!t,b={};S?b.elements=this.elements().map(function(T){return T.json()}):(b.elements={},a.forEach(function(T){var N=T.group();b.elements[N]||(b.elements[N]=[]),b.elements[N].push(T.json())})),this._private.styleEnabled&&(b.style=n.style().json()),b.data=ai(n.data());var C=r.options;return b.zoomingEnabled=r.zoomingEnabled,b.userZoomingEnabled=r.userZoomingEnabled,b.zoom=r.zoom,b.minZoom=r.minZoom,b.maxZoom=r.maxZoom,b.panningEnabled=r.panningEnabled,b.userPanningEnabled=r.userPanningEnabled,b.pan=ai(r.pan),b.boxSelectionEnabled=r.boxSelectionEnabled,b.renderer=ai(C.renderer),b.hideEdgesOnViewport=C.hideEdgesOnViewport,b.textureOnViewport=C.textureOnViewport,b.wheelSensitivity=C.wheelSensitivity,b.motionBlur=C.motionBlur,b.multiClickDebounceTime=C.multiClickDebounceTime,b}}});op.$id=op.getElementById;[YW,JW,UL,Vb,Ov,tZ,Hb,Lv,aZ,xo,Jf].forEach(function(e){rt(op,e)});var sZ={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}},lZ={maximal:!1,acyclic:!1},pu=function(t){return t.scratch("breadthfirst")},AA=function(t,n){return t.scratch("breadthfirst",n)};function VL(e){this.options=rt({},sZ,lZ,e)}VL.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().filter(function(qe){return qe.isChildless()}),a=n,i=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,o=!!e.boundingBox,f=kr(o?e.boundingBox:structuredClone(t.extent())),c;if(na(e.roots))c=e.roots;else if($t(e.roots)){for(var d=[],v=0;v<e.roots.length;v++){var m=e.roots[v],y=t.getElementById(m);d.push(y)}c=t.collection(d)}else if(et(e.roots))c=t.$(e.roots);else if(i)c=r.roots();else{var x=n.components();c=t.collection();for(var w=function(){var je=x[S],Ge=je.maxDegree(!1),Xe=je.filter(function(it){return it.degree(!1)===Ge});c=c.add(Xe)},S=0;S<x.length;S++)w()}var b=[],C={},T=function(je,Ge){b[Ge]==null&&(b[Ge]=[]);var Xe=b[Ge].length;b[Ge].push(je),AA(je,{index:Xe,depth:Ge})},N=function(je,Ge){var Xe=pu(je),it=Xe.depth,Pe=Xe.index;b[it][Pe]=null,je.isChildless()&&T(je,Ge)};a.bfs({roots:c,directed:e.directed,visit:function(je,Ge,Xe,it,Pe){var ft=je[0],he=ft.id();ft.isChildless()&&T(ft,Pe),C[he]=!0}});for(var A=[],R=0;R<r.length;R++){var D=r[R];C[D.id()]||A.push(D)}var L=function(je){for(var Ge=b[je],Xe=0;Xe<Ge.length;Xe++){var it=Ge[Xe];if(it==null){Ge.splice(Xe,1),Xe--;continue}AA(it,{depth:je,index:Xe})}},_=function(je,Ge){for(var Xe=pu(je),it=je.incomers().filter(function(Me){return Me.isNode()&&n.has(Me)}),Pe=-1,ft=je.id(),he=0;he<it.length;he++){var Ce=it[he],De=pu(Ce);Pe=Math.max(Pe,De.depth)}if(Xe.depth<=Pe){if(!e.acyclic&&Ge[ft])return null;var ze=Pe+1;return N(je,ze),Ge[ft]=ze,!0}return!1};if(i&&l){var M=[],z={},P=function(je){return M.push(je)},G=function(){return M.shift()};for(r.forEach(function(qe){return M.push(qe)});M.length>0;){var I=G(),F=_(I,z);if(F)I.outgoers().filter(function(qe){return qe.isNode()&&n.has(qe)}).forEach(P);else if(F===null){Bt("Detected double maximal shift for node `"+I.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var B=0;if(e.avoidOverlap)for(var H=0;H<r.length;H++){var Y=r[H],Q=Y.layoutDimensions(e),V=Q.w,q=Q.h;B=Math.max(B,V,q)}var X={},U=function(je){if(X[je.id()])return X[je.id()];for(var Ge=pu(je).depth,Xe=je.neighborhood(),it=0,Pe=0,ft=0;ft<Xe.length;ft++){var he=Xe[ft];if(!(he.isEdge()||he.isParent()||!r.has(he))){var Ce=pu(he);if(Ce!=null){var De=Ce.index,ze=Ce.depth;if(!(De==null||ze==null)){var Me=b[ze].length;ze<Ge&&(it+=De/Me,Pe++)}}}}return Pe=Math.max(1,Pe),it=it/Pe,Pe===0&&(it=0),X[je.id()]=it,it},te=function(je,Ge){var Xe=U(je),it=U(Ge),Pe=Xe-it;return Pe===0?HO(je.id(),Ge.id()):Pe};e.depthSort!==void 0&&(te=e.depthSort);for(var ie=b.length,oe=0;oe<ie;oe++)b[oe].sort(te),L(oe);for(var ae=[],we=0;we<A.length;we++)ae.push(A[we]);var fe=function(){for(var je=0;je<ie;je++)L(je)};ae.length&&(b.unshift(ae),ie=b.length,fe());for(var J=0,ne=0;ne<ie;ne++)J=Math.max(b[ne].length,J);var re={x:f.x1+f.w/2,y:f.y1+f.h/2},ge=r.reduce(function(qe,je){return(function(Ge){return{w:qe.w===-1?Ge.w:(qe.w+Ge.w)/2,h:qe.h===-1?Ge.h:(qe.h+Ge.h)/2}})(je.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ke=Math.max(ie===1?0:o?(f.h-e.padding*2-ge.h)/(ie-1):(f.h-e.padding*2-ge.h)/(ie+1),B),Be=b.reduce(function(qe,je){return Math.max(qe,je.length)},0),lt=function(je){var Ge=pu(je),Xe=Ge.depth,it=Ge.index;if(e.circle){var Pe=Math.min(f.w/2/ie,f.h/2/ie);Pe=Math.max(Pe,B);var ft=Pe*Xe+Pe-(ie>0&&b[0].length<=3?Pe/2:0),he=2*Math.PI/b[Xe].length*it;return Xe===0&&b[0].length===1&&(ft=1),{x:re.x+ft*Math.cos(he),y:re.y+ft*Math.sin(he)}}else{var Ce=b[Xe].length,De=Math.max(Ce===1?0:o?(f.w-e.padding*2-ge.w)/((e.grid?Be:Ce)-1):(f.w-e.padding*2-ge.w)/((e.grid?Be:Ce)+1),B),ze={x:re.x+(it+1-(Ce+1)/2)*De,y:re.y+(Xe+1-(ie+1)/2)*ke};return ze}},Ze={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ze).indexOf(e.direction)===-1&&ln("Invalid direction '".concat(e.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ze).join(", ")));var Qe=function(je){return EY(lt(je),f,Ze[e.direction])};return n.nodes().layoutPositions(this,e,Qe),this};var oZ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function HL(e){this.options=rt({},oZ,e)}HL.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));for(var l=kr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:l.x1+l.w/2,y:l.y1+l.h/2},f=t.sweep===void 0?2*Math.PI-2*Math.PI/i.length:t.sweep,c=f/Math.max(1,i.length-1),d,v=0,m=0;m<i.length;m++){var y=i[m],x=y.layoutDimensions(t),w=x.w,S=x.h;v=Math.max(v,w,S)}if(Re(t.radius)?d=t.radius:i.length<=1?d=0:d=Math.min(l.h,l.w)/2-v,i.length>1&&t.avoidOverlap){v*=1.75;var b=Math.cos(c)-Math.cos(0),C=Math.sin(c)-Math.sin(0),T=Math.sqrt(v*v/(b*b+C*C));d=Math.max(T,d)}var N=function(R,D){var L=t.startAngle+D*c*(a?1:-1),_=d*Math.cos(L),M=d*Math.sin(L),z={x:o.x+_,y:o.y+M};return z};return r.nodes().layoutPositions(this,t,N),this};var uZ={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(t){return t.degree()},levelWidth:function(t){return t.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function GL(e){this.options=rt({},uZ,e)}GL.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,r=e.cy,a=t.eles,i=a.nodes().not(":parent"),l=kr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:l.x1+l.w/2,y:l.y1+l.h/2},f=[],c=0,d=0;d<i.length;d++){var v=i[d],m=void 0;m=t.concentric(v),f.push({value:m,node:v}),v._private.scratch.concentric=m}i.updateStyle();for(var y=0;y<i.length;y++){var x=i[y],w=x.layoutDimensions(t);c=Math.max(c,w.w,w.h)}f.sort(function(ke,Be){return Be.value-ke.value});for(var S=t.levelWidth(i),b=[[]],C=b[0],T=0;T<f.length;T++){var N=f[T];if(C.length>0){var A=Math.abs(C[0].value-N.value);A>=S&&(C=[],b.push(C))}C.push(N)}var R=c+t.minNodeSpacing;if(!t.avoidOverlap){var D=b.length>0&&b[0].length>1,L=Math.min(l.w,l.h)/2-R,_=L/(b.length+D?1:0);R=Math.min(R,_)}for(var M=0,z=0;z<b.length;z++){var P=b[z],G=t.sweep===void 0?2*Math.PI-2*Math.PI/P.length:t.sweep,I=P.dTheta=G/Math.max(1,P.length-1);if(P.length>1&&t.avoidOverlap){var F=Math.cos(I)-Math.cos(0),B=Math.sin(I)-Math.sin(0),H=Math.sqrt(R*R/(F*F+B*B));M=Math.max(H,M)}P.r=M,M+=R}if(t.equidistant){for(var Y=0,Q=0,V=0;V<b.length;V++){var q=b[V],X=q.r-Q;Y=Math.max(Y,X)}Q=0;for(var U=0;U<b.length;U++){var te=b[U];U===0&&(Q=te.r),te.r=Q,Q+=Y}}for(var ie={},oe=0;oe<b.length;oe++)for(var ae=b[oe],we=ae.dTheta,fe=ae.r,J=0;J<ae.length;J++){var ne=ae[J],re=t.startAngle+(n?1:-1)*we*J,ge={x:o.x+fe*Math.cos(re),y:o.y+fe*Math.sin(re)};ie[ne.node.id()]=ge}return a.nodes().layoutPositions(this,t,function(ke){var Be=ke.id();return ie[Be]}),this};var T0,cZ={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(t,n){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(t){return 2048},nodeOverlap:4,idealEdgeLength:function(t){return 32},edgeElasticity:function(t){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function sm(e){this.options=rt({},cZ,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(a){var i=a.source().data("id"),l=a.target().data("id"),o=t.some(function(c){return c.data("id")===i}),f=t.some(function(c){return c.data("id")===l});return!o||!f});this.options.eles=this.options.eles.not(r)}sm.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:"layoutstart",layout:n}),e.debug===!0?T0=!0:T0=!1;var r=fZ(t,n,e);T0&&hZ(r),e.randomize&&vZ(r);var a=Yi(),i=function(){pZ(r,t,e),e.fit===!0&&t.fit(e.padding)},l=function(m){return!(n.stopped||m>=e.numIter||(mZ(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature<e.minTemp))},o=function(){if(e.animate===!0||e.animate===!1)i(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var m=e.eles.nodes(),y=KL(r,e,m);m.layoutPositions(n,e,y)}},f=0,c=!0;if(e.animate===!0){var d=function(){for(var m=0;c&&m<e.refresh;)c=l(f),f++,m++;if(!c)jA(r,e),o();else{var y=Yi();y-a>=e.animationThreshold&&i(),np(d)}};d()}else{for(;c;)c=l(f),f++;jA(r,e),o()}return this};sm.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};sm.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var fZ=function(t,n,r){for(var a=r.eles.edges(),i=r.eles.nodes(),l=kr(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:r.initialTemp,clientWidth:l.w,clientHeight:l.h,boundingBox:l},f=r.eles.components(),c={},d=0;d<f.length;d++)for(var v=f[d],m=0;m<v.length;m++){var y=v[m];c[y.id()]=d}for(var d=0;d<o.nodeSize;d++){var x=i[d],w=x.layoutDimensions(r),S={};S.isLocked=x.locked(),S.id=x.data("id"),S.parentId=x.data("parent"),S.cmptId=c[x.id()],S.children=[],S.positionX=x.position("x"),S.positionY=x.position("y"),S.offsetX=0,S.offsetY=0,S.height=w.w,S.width=w.h,S.maxX=S.positionX+S.width/2,S.minX=S.positionX-S.width/2,S.maxY=S.positionY+S.height/2,S.minY=S.positionY-S.height/2,S.padLeft=parseFloat(x.style("padding")),S.padRight=parseFloat(x.style("padding")),S.padTop=parseFloat(x.style("padding")),S.padBottom=parseFloat(x.style("padding")),S.nodeRepulsion=hn(r.nodeRepulsion)?r.nodeRepulsion(x):r.nodeRepulsion,o.layoutNodes.push(S),o.idToIndex[S.id]=d}for(var b=[],C=0,T=-1,N=[],d=0;d<o.nodeSize;d++){var x=o.layoutNodes[d],A=x.parentId;A!=null?o.layoutNodes[o.idToIndex[A]].children.push(x.id):(b[++T]=x.id,N.push(x.id))}for(o.graphSet.push(N);C<=T;){var R=b[C++],D=o.idToIndex[R],y=o.layoutNodes[D],L=y.children;if(L.length>0){o.graphSet.push(L);for(var d=0;d<L.length;d++)b[++T]=L[d]}}for(var d=0;d<o.graphSet.length;d++)for(var _=o.graphSet[d],m=0;m<_.length;m++){var M=o.idToIndex[_[m]];o.indexToGraph[M]=d}for(var d=0;d<o.edgeSize;d++){var z=a[d],P={};P.id=z.data("id"),P.sourceId=z.data("source"),P.targetId=z.data("target");var G=hn(r.idealEdgeLength)?r.idealEdgeLength(z):r.idealEdgeLength,I=hn(r.edgeElasticity)?r.edgeElasticity(z):r.edgeElasticity,F=o.idToIndex[P.sourceId],B=o.idToIndex[P.targetId],H=o.indexToGraph[F],Y=o.indexToGraph[B];if(H!=Y){for(var Q=dZ(P.sourceId,P.targetId,o),V=o.graphSet[Q],q=0,S=o.layoutNodes[F];V.indexOf(S.id)===-1;)S=o.layoutNodes[o.idToIndex[S.parentId]],q++;for(S=o.layoutNodes[B];V.indexOf(S.id)===-1;)S=o.layoutNodes[o.idToIndex[S.parentId]],q++;G*=q*r.nestingFactor}P.idealLength=G,P.elasticity=I,o.layoutEdges.push(P)}return o},dZ=function(t,n,r){var a=$L(t,n,0,r);return 2>a.count?0:a.graph},$L=function(t,n,r,a){var i=a.graphSet[r];if(-1<i.indexOf(t)&&-1<i.indexOf(n))return{count:2,graph:r};for(var l=0,o=0;o<i.length;o++){var f=i[o],c=a.idToIndex[f],d=a.layoutNodes[c].children;if(d.length!==0){var v=a.indexToGraph[a.idToIndex[d[0]]],m=$L(t,n,v,a);if(m.count!==0)if(m.count===1){if(l++,l===2)break}else return m}}return{count:l,graph:r}},hZ,vZ=function(t,n){for(var r=t.clientWidth,a=t.clientHeight,i=0;i<t.nodeSize;i++){var l=t.layoutNodes[i];l.children.length===0&&!l.isLocked&&(l.positionX=Math.random()*r,l.positionY=Math.random()*a)}},KL=function(t,n,r){var a=t.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(l){var o=t.layoutNodes[t.idToIndex[l.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(l,o){var f=t.layoutNodes[t.idToIndex[l.data("id")]];if(n.boundingBox){var c=i.w===0?.5:(f.positionX-i.x1)/i.w,d=i.h===0?.5:(f.positionY-i.y1)/i.h;return{x:a.x1+c*a.w,y:a.y1+d*a.h}}else return{x:f.positionX,y:f.positionY}}},pZ=function(t,n,r){var a=r.layout,i=r.eles.nodes(),l=KL(t,r,i);i.positions(l),t.ready!==!0&&(t.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},mZ=function(t,n,r){gZ(t,n),bZ(t),wZ(t,n),SZ(t),EZ(t)},gZ=function(t,n){for(var r=0;r<t.graphSet.length;r++)for(var a=t.graphSet[r],i=a.length,l=0;l<i;l++)for(var o=t.layoutNodes[t.idToIndex[a[l]]],f=l+1;f<i;f++){var c=t.layoutNodes[t.idToIndex[a[f]]];yZ(o,c,t,n)}},RA=function(t){return-1+2*t*Math.random()},yZ=function(t,n,r,a){var i=t.cmptId,l=n.cmptId;if(!(i!==l&&!r.isCompound)){var o=n.positionX-t.positionX,f=n.positionY-t.positionY,c=1;o===0&&f===0&&(o=RA(c),f=RA(c));var d=xZ(t,n,o,f);if(d>0)var v=a.nodeOverlap*d,m=Math.sqrt(o*o+f*f),y=v*o/m,x=v*f/m;else var w=up(t,o,f),S=up(n,-1*o,-1*f),b=S.x-w.x,C=S.y-w.y,T=b*b+C*C,m=Math.sqrt(T),v=(t.nodeRepulsion+n.nodeRepulsion)/T,y=v*b/m,x=v*C/m;t.isLocked||(t.offsetX-=y,t.offsetY-=x),n.isLocked||(n.offsetX+=y,n.offsetY+=x)}},xZ=function(t,n,r,a){if(r>0)var i=t.maxX-n.minX;else var i=n.maxX-t.minX;if(a>0)var l=t.maxY-n.minY;else var l=n.maxY-t.minY;return i>=0&&l>=0?Math.sqrt(i*i+l*l):0},up=function(t,n,r){var a=t.positionX,i=t.positionY,l=t.height||1,o=t.width||1,f=r/n,c=l/o,d={};return n===0&&0<r||n===0&&0>r?(d.x=a,d.y=i+l/2,d):0<n&&-1*c<=f&&f<=c?(d.x=a+o/2,d.y=i+o*r/2/n,d):0>n&&-1*c<=f&&f<=c?(d.x=a-o/2,d.y=i-o*r/2/n,d):0<r&&(f<=-1*c||f>=c)?(d.x=a+l*n/2/r,d.y=i+l/2,d):(0>r&&(f<=-1*c||f>=c)&&(d.x=a-l*n/2/r,d.y=i-l/2),d)},bZ=function(t,n){for(var r=0;r<t.edgeSize;r++){var a=t.layoutEdges[r],i=t.idToIndex[a.sourceId],l=t.layoutNodes[i],o=t.idToIndex[a.targetId],f=t.layoutNodes[o],c=f.positionX-l.positionX,d=f.positionY-l.positionY;if(!(c===0&&d===0)){var v=up(l,c,d),m=up(f,-1*c,-1*d),y=m.x-v.x,x=m.y-v.y,w=Math.sqrt(y*y+x*x),S=Math.pow(a.idealLength-w,2)/a.elasticity;if(w!==0)var b=S*y/w,C=S*x/w;else var b=0,C=0;l.isLocked||(l.offsetX+=b,l.offsetY+=C),f.isLocked||(f.offsetX-=b,f.offsetY-=C)}}},wZ=function(t,n){if(n.gravity!==0)for(var r=1,a=0;a<t.graphSet.length;a++){var i=t.graphSet[a],l=i.length;if(a===0)var o=t.clientHeight/2,f=t.clientWidth/2;else var c=t.layoutNodes[t.idToIndex[i[0]]],d=t.layoutNodes[t.idToIndex[c.parentId]],o=d.positionX,f=d.positionY;for(var v=0;v<l;v++){var m=t.layoutNodes[t.idToIndex[i[v]]];if(!m.isLocked){var y=o-m.positionX,x=f-m.positionY,w=Math.sqrt(y*y+x*x);if(w>r){var S=n.gravity*y/w,b=n.gravity*x/w;m.offsetX+=S,m.offsetY+=b}}}}},SZ=function(t,n){var r=[],a=0,i=-1;for(r.push.apply(r,t.graphSet[0]),i+=t.graphSet[0].length;a<=i;){var l=r[a++],o=t.idToIndex[l],f=t.layoutNodes[o],c=f.children;if(0<c.length&&!f.isLocked){for(var d=f.offsetX,v=f.offsetY,m=0;m<c.length;m++){var y=t.layoutNodes[t.idToIndex[c[m]]];y.offsetX+=d,y.offsetY+=v,r[++i]=c[m]}f.offsetX=0,f.offsetY=0}}},EZ=function(t,n){for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];if(!(0<a.children.length||a.isLocked)){var i=CZ(a.offsetX,a.offsetY,t.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,YL(a,t)}}for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},CZ=function(t,n,r){var a=Math.sqrt(t*t+n*n);if(a>r)var i={x:r*t/a,y:r*n/a};else var i={x:t,y:n};return i},YL=function(t,n){var r=t.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],i=!1;if((a.maxX==null||t.maxX+a.padRight>a.maxX)&&(a.maxX=t.maxX+a.padRight,i=!0),(a.minX==null||t.minX-a.padLeft<a.minX)&&(a.minX=t.minX-a.padLeft,i=!0),(a.maxY==null||t.maxY+a.padBottom>a.maxY)&&(a.maxY=t.maxY+a.padBottom,i=!0),(a.minY==null||t.minY-a.padTop<a.minY)&&(a.minY=t.minY-a.padTop,i=!0),i)return YL(a,n)}},jA=function(t,n){for(var r=t.layoutNodes,a=[],i=0;i<r.length;i++){var l=r[i],o=l.cmptId,f=a[o]=a[o]||[];f.push(l)}for(var c=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var v=0;v<d.length;v++){var m=d[v];d.x1=Math.min(d.x1,m.positionX-m.width/2),d.x2=Math.max(d.x2,m.positionX+m.width/2),d.y1=Math.min(d.y1,m.positionY-m.height/2),d.y2=Math.max(d.y2,m.positionY+m.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,c+=d.w*d.h}}a.sort(function(C,T){return T.w*T.h-C.w*C.h});for(var y=0,x=0,w=0,S=0,b=Math.sqrt(c)*t.clientWidth/t.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var v=0;v<d.length;v++){var m=d[v];m.isLocked||(m.positionX+=y-d.x1,m.positionY+=x-d.y1)}y+=d.w+n.componentSpacing,w+=d.w+n.componentSpacing,S=Math.max(S,d.h),w>b&&(x+=S+n.componentSpacing,y=0,w=0,S=0)}}},TZ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(t){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function XL(e){this.options=rt({},TZ,e)}XL.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));var i=kr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,t,function(U){return{x:i.x1,y:i.y1}});else{var l=a.size(),o=Math.sqrt(l*i.h/i.w),f=Math.round(o),c=Math.round(i.w/i.h*o),d=function(te){if(te==null)return Math.min(f,c);var ie=Math.min(f,c);ie==f?f=te:c=te},v=function(te){if(te==null)return Math.max(f,c);var ie=Math.max(f,c);ie==f?f=te:c=te},m=t.rows,y=t.cols!=null?t.cols:t.columns;if(m!=null&&y!=null)f=m,c=y;else if(m!=null&&y==null)f=m,c=Math.ceil(l/f);else if(m==null&&y!=null)c=y,f=Math.ceil(l/c);else if(c*f>l){var x=d(),w=v();(x-1)*w>=l?d(x-1):(w-1)*x>=l&&v(w-1)}else for(;c*f<l;){var S=d(),b=v();(b+1)*S>=l?v(b+1):d(S+1)}var C=i.w/c,T=i.h/f;if(t.condense&&(C=0,T=0),t.avoidOverlap)for(var N=0;N<a.length;N++){var A=a[N],R=A._private.position;(R.x==null||R.y==null)&&(R.x=0,R.y=0);var D=A.layoutDimensions(t),L=t.avoidOverlapPadding,_=D.w+L,M=D.h+L;C=Math.max(C,_),T=Math.max(T,M)}for(var z={},P=function(te,ie){return!!z["c-"+te+"-"+ie]},G=function(te,ie){z["c-"+te+"-"+ie]=!0},I=0,F=0,B=function(){F++,F>=c&&(F=0,I++)},H={},Y=0;Y<a.length;Y++){var Q=a[Y],V=t.position(Q);if(V&&(V.row!==void 0||V.col!==void 0)){var q={row:V.row,col:V.col};if(q.col===void 0)for(q.col=0;P(q.row,q.col);)q.col++;else if(q.row===void 0)for(q.row=0;P(q.row,q.col);)q.row++;H[Q.id()]=q,G(q.row,q.col)}}var X=function(te,ie){var oe,ae;if(te.locked()||te.isParent())return!1;var we=H[te.id()];if(we)oe=we.col*C+C/2+i.x1,ae=we.row*T+T/2+i.y1;else{for(;P(I,F);)B();oe=F*C+C/2+i.x1,ae=I*T+T/2+i.y1,G(I,F),B()}return{x:oe,y:ae}};a.layoutPositions(this,t,X)}return this};var kZ={ready:function(){},stop:function(){}};function Mw(e){this.options=rt({},kZ,e)}Mw.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this};Mw.prototype.stop=function(){return this};var NZ={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function QL(e){this.options=rt({},NZ,e)}QL.prototype.run=function(){var e=this.options,t=e.eles,n=t.nodes(),r=hn(e.positions);function a(i){if(e.positions==null)return XY(i.position());if(r)return e.positions(i);var l=e.positions[i._private.data.id];return l??null}return n.layoutPositions(this,e,function(i,l){var o=a(i);return i.locked()||o==null?!1:o}),this};var AZ={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function WL(e){this.options=rt({},AZ,e)}WL.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=kr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),a=function(l,o){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,e,a),this};var RZ=[{name:"breadthfirst",impl:VL},{name:"circle",impl:HL},{name:"concentric",impl:GL},{name:"cose",impl:sm},{name:"grid",impl:XL},{name:"null",impl:Mw},{name:"preset",impl:QL},{name:"random",impl:WL}];function ZL(e){this.options=e,this.notifications=0}var DA=function(){},MA=function(){throw new Error("A headless instance can not render images")};ZL.prototype={recalculateRenderedStyle:DA,notify:function(){this.notifications++},init:DA,isHeadless:function(){return!0},png:MA,jpg:MA};var Ow={};Ow.arrowShapeWidth=.3;Ow.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(c,d,v,m,y,x,w){var S=y.x-v/2-w,b=y.x+v/2+w,C=y.y-v/2-w,T=y.y+v/2+w,N=S<=c&&c<=b&&C<=d&&d<=T;return N},r=function(c,d,v,m,y){var x=c*Math.cos(m)-d*Math.sin(m),w=c*Math.sin(m)+d*Math.cos(m),S=x*v,b=w*v,C=S+y.x,T=b+y.y;return{x:C,y:T}},a=function(c,d,v,m){for(var y=[],x=0;x<c.length;x+=2){var w=c[x],S=c[x+1];y.push(r(w,S,d,v,m))}return y},i=function(c){for(var d=[],v=0;v<c.length;v++){var m=c[v];d.push(m.x,m.y)}return d},l=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},o=function(c,d){et(d)&&(d=e[d]),e[c]=rt({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(m,y,x,w,S,b){var C=i(a(this.points,x+2*b,w,S)),T=Fr(m,y,C);return T},roughCollide:n,draw:function(m,y,x,w){var S=a(this.points,y,x,w);t.arrowShapeImpl("polygon")(m,S)},spacing:function(m){return 0},gap:l},d)};o("none",{collide:rp,roughCollide:rp,draw:yw,spacing:$k,gap:$k}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,d,v,m,y){var x=a(this.points,d,v,m),w=this.controlPoint,S=r(w[0],w[1],d,v,m);t.arrowShapeImpl(this.name)(c,x,S)},gap:function(c){return l(c)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,d,v,m,y,x,w){var S=i(a(this.points,v+2*w,m,y)),b=i(a(this.pointsTee,v+2*w,m,y)),C=Fr(c,d,S)||Fr(c,d,b);return C},draw:function(c,d,v,m,y){var x=a(this.points,d,v,m),w=a(this.pointsTee,d,v,m);t.arrowShapeImpl(this.name)(c,x,w)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,v,m,y,x,w){var S=y,b=Math.pow(S.x-c,2)+Math.pow(S.y-d,2)<=Math.pow((v+2*w)*this.radius,2),C=i(a(this.points,v+2*w,m,y));return Fr(c,d,C)||b},draw:function(c,d,v,m,y){var x=a(this.pointsTr,d,v,m);t.arrowShapeImpl(this.name)(c,x,m.x,m.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,d){var v=this.baseCrossLinePts.slice(),m=d/c,y=3,x=5;return v[y]=v[y]-m,v[x]=v[x]-m,v},collide:function(c,d,v,m,y,x,w){var S=i(a(this.points,v+2*w,m,y)),b=i(a(this.crossLinePts(v,x),v+2*w,m,y)),C=Fr(c,d,S)||Fr(c,d,b);return C},draw:function(c,d,v,m,y){var x=a(this.points,d,v,m),w=a(this.crossLinePts(d,y),d,v,m);t.arrowShapeImpl(this.name)(c,x,w)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return l(c)*.525}}),o("circle",{radius:.15,collide:function(c,d,v,m,y,x,w){var S=y,b=Math.pow(S.x-c,2)+Math.pow(S.y-d,2)<=Math.pow((v+2*w)*this.radius,2);return b},draw:function(c,d,v,m,y){t.arrowShapeImpl(this.name)(c,m.x,m.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var Eo={};Eo.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],i=r[1],l=r[4],o=n.pan(),f=n.zoom(),c=((e-a)/l-o.x)/f,d=((t-i)/l-o.y)/f;return[c,d]};Eo.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(b){return parseFloat(n.getPropertyValue(b))},a={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},l=e.clientWidth,o=e.clientHeight,f=a.left+a.right,c=a.top+a.bottom,d=i.left+i.right,v=t.width/(l+d),m=l-f,y=o-c,x=t.left+a.left+i.left,w=t.top+a.top+i.top;return this.containerBB=[x,w,m,y,v]};Eo.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Eo.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]};Eo.findNearestElements=function(e,t,n,r){var a=this,i=this,l=i.getCachedZSortedEles(),o=[],f=i.cy.zoom(),c=i.cy.hasCompoundNodes(),d=(r?24:8)/f,v=(r?8:2)/f,m=(r?8:2)/f,y=1/0,x,w;n&&(l=l.interactive);function S(D,L){if(D.isNode()){if(w)return;w=D,o.push(D)}if(D.isEdge()&&(L==null||L<y))if(x){if(x.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value&&x.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value){for(var _=0;_<o.length;_++)if(o[_].isEdge()){o[_]=D,x=D,y=L??y;break}}}else o.push(D),x=D,y=L??y}function b(D){var L=D.outerWidth()+2*v,_=D.outerHeight()+2*v,M=L/2,z=_/2,P=D.position(),G=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,I=D._private.rscratch;if(P.x-M<=e&&e<=P.x+M&&P.y-z<=t&&t<=P.y+z){var F=i.nodeShapes[a.getNodeShape(D)];if(F.checkPoint(e,t,0,L,_,P.x,P.y,G,I))return S(D,0),!0}}function C(D){var L=D._private,_=L.rscratch,M=D.pstyle("width").pfValue,z=D.pstyle("arrow-scale").value,P=M/2+d,G=P*P,I=P*2,Y=L.source,Q=L.target,F;if(_.edgeType==="segments"||_.edgeType==="straight"||_.edgeType==="haystack"){for(var B=_.allpts,H=0;H+3<B.length;H+=2)if(uX(e,t,B[H],B[H+1],B[H+2],B[H+3],I)&&G>(F=vX(e,t,B[H],B[H+1],B[H+2],B[H+3])))return S(D,F),!0}else if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"){for(var B=_.allpts,H=0;H+5<_.allpts.length;H+=4)if(cX(e,t,B[H],B[H+1],B[H+2],B[H+3],B[H+4],B[H+5],I)&&G>(F=hX(e,t,B[H],B[H+1],B[H+2],B[H+3],B[H+4],B[H+5])))return S(D,F),!0}for(var Y=Y||L.source,Q=Q||L.target,V=a.getArrowWidth(M,z),q=[{name:"source",x:_.arrowStartX,y:_.arrowStartY,angle:_.srcArrowAngle},{name:"target",x:_.arrowEndX,y:_.arrowEndY,angle:_.tgtArrowAngle},{name:"mid-source",x:_.midX,y:_.midY,angle:_.midsrcArrowAngle},{name:"mid-target",x:_.midX,y:_.midY,angle:_.midtgtArrowAngle}],H=0;H<q.length;H++){var X=q[H],U=i.arrowShapes[D.pstyle(X.name+"-arrow-shape").value],te=D.pstyle("width").pfValue;if(U.roughCollide(e,t,V,X.angle,{x:X.x,y:X.y},te,d)&&U.collide(e,t,V,X.angle,{x:X.x,y:X.y},te,d))return S(D),!0}c&&o.length>0&&(b(Y),b(Q))}function T(D,L,_){return Ir(D,L,_)}function N(D,L){var _=D._private,M=m,z;L?z=L+"-":z="",D.boundingBox();var P=_.labelBounds[L||"main"],G=D.pstyle(z+"label").value,I=D.pstyle("text-events").strValue==="yes";if(!(!I||!G)){var F=T(_.rscratch,"labelX",L),B=T(_.rscratch,"labelY",L),H=T(_.rscratch,"labelAngle",L),Y=D.pstyle(z+"text-margin-x").pfValue,Q=D.pstyle(z+"text-margin-y").pfValue,V=P.x1-M-Y,q=P.x2+M-Y,X=P.y1-M-Q,U=P.y2+M-Q;if(H){var te=Math.cos(H),ie=Math.sin(H),oe=function(ge,ke){return ge=ge-F,ke=ke-B,{x:ge*te-ke*ie+F,y:ge*ie+ke*te+B}},ae=oe(V,X),we=oe(V,U),fe=oe(q,X),J=oe(q,U),ne=[ae.x+Y,ae.y+Q,fe.x+Y,fe.y+Q,J.x+Y,J.y+Q,we.x+Y,we.y+Q];if(Fr(e,t,ne))return S(D),!0}else if(Qs(P,e,t))return S(D),!0}}for(var A=l.length-1;A>=0;A--){var R=l[A];R.isNode()?b(R)||N(R):C(R)||N(R)||N(R,"source")||N(R,"target")}return o};Eo.getAllInBox=function(e,t,n,r){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),l=2/i,o=[],f=Math.min(e,n),c=Math.max(e,n),d=Math.min(t,r),v=Math.max(t,r);e=f,n=c,t=d,r=v;var m=kr({x1:e,y1:t,x2:n,y2:r}),y=[{x:m.x1,y:m.y1},{x:m.x2,y:m.y1},{x:m.x2,y:m.y2},{x:m.x1,y:m.y2}],x=[[y[0],y[1]],[y[1],y[2]],[y[2],y[3]],[y[3],y[0]]];function w(ge,ke,Be){return Ir(ge,ke,Be)}function S(ge,ke){var Be=ge._private,lt=l,Ze="";ge.boundingBox();var Qe=Be.labelBounds.main;if(!Qe)return null;var qe=w(Be.rscratch,"labelX",ke),je=w(Be.rscratch,"labelY",ke),Ge=w(Be.rscratch,"labelAngle",ke),Xe=ge.pstyle(Ze+"text-margin-x").pfValue,it=ge.pstyle(Ze+"text-margin-y").pfValue,Pe=Qe.x1-lt-Xe,ft=Qe.x2+lt-Xe,he=Qe.y1-lt-it,Ce=Qe.y2+lt-it;if(Ge){var De=Math.cos(Ge),ze=Math.sin(Ge),Me=function(ye,K){return ye=ye-qe,K=K-je,{x:ye*De-K*ze+qe,y:ye*ze+K*De+je}};return[Me(Pe,he),Me(ft,he),Me(ft,Ce),Me(Pe,Ce)]}else return[{x:Pe,y:he},{x:ft,y:he},{x:ft,y:Ce},{x:Pe,y:Ce}]}function b(ge,ke,Be,lt){function Ze(Qe,qe,je){return(je.y-Qe.y)*(qe.x-Qe.x)>(qe.y-Qe.y)*(je.x-Qe.x)}return Ze(ge,Be,lt)!==Ze(ke,Be,lt)&&Ze(ge,ke,Be)!==Ze(ge,ke,lt)}for(var C=0;C<a.length;C++){var T=a[C];if(T.isNode()){var N=T,A=N.pstyle("text-events").strValue==="yes",R=N.pstyle("box-selection").strValue,D=N.pstyle("box-select-labels").strValue==="yes";if(R==="none")continue;var L=(R==="overlap"||D)&&A,_=N.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:L});if(R==="contain"){var M=!1;if(D&&A){var z=S(N);z&&Ex(z,y)&&(o.push(N),M=!0)}!M&&iL(m,_)&&o.push(N)}else if(R==="overlap"&&Sw(m,_)){var P=N.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),G=[{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}];if(Ex(G,y))o.push(N);else{var I=S(N);I&&Ex(I,y)&&o.push(N)}}}else{var F=T,B=F._private,H=B.rscratch,Y=F.pstyle("box-selection").strValue;if(Y==="none")continue;if(Y==="contain"){if(H.startX!=null&&H.startY!=null&&!Qs(m,H.startX,H.startY)||H.endX!=null&&H.endY!=null&&!Qs(m,H.endX,H.endY))continue;if(H.edgeType==="bezier"||H.edgeType==="multibezier"||H.edgeType==="self"||H.edgeType==="compound"||H.edgeType==="segments"||H.edgeType==="haystack"){for(var Q=B.rstyle.bezierPts||B.rstyle.linePts||B.rstyle.haystackPts,V=!0,q=0;q<Q.length;q++)if(!Wk(m,Q[q])){V=!1;break}V&&o.push(F)}else H.edgeType==="straight"&&o.push(F)}else if(Y==="overlap"){var X=!1;if(H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(Qs(m,H.startX,H.startY)||Qs(m,H.endX,H.endY)))o.push(F),X=!0;else if(!X&&H.edgeType==="haystack"){for(var U=B.rstyle.haystackPts,te=0;te<U.length;te++)if(Wk(m,U[te])){o.push(F),X=!0;break}}if(!X){var ie=B.rstyle.bezierPts||B.rstyle.linePts||B.rstyle.haystackPts;if((!ie||ie.length<2)&&H.edgeType==="straight"&&H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(ie=[{x:H.startX,y:H.startY},{x:H.endX,y:H.endY}]),!ie||ie.length<2)continue;for(var oe=0;oe<ie.length-1;oe++){for(var ae=ie[oe],we=ie[oe+1],fe=0;fe<x.length;fe++){var J=On(x[fe],2),ne=J[0],re=J[1];if(b(ae,we,ne,re)){o.push(F),X=!0;break}}if(X)break}}}}}return o};var cp={};cp.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType==="haystack",r=t.edgeType==="bezier",a=t.edgeType==="multibezier",i=t.edgeType==="segments",l=t.edgeType==="compound",o=t.edgeType==="self",f,c,d,v,m,y,b,C;if(n?(d=t.haystackPts[0],v=t.haystackPts[1],m=t.haystackPts[2],y=t.haystackPts[3]):(d=t.arrowStartX,v=t.arrowStartY,m=t.arrowEndX,y=t.arrowEndY),b=t.midX,C=t.midY,i)f=d-t.segpts[0],c=v-t.segpts[1];else if(a||l||o||r){var x=t.allpts,w=Xn(x[0],x[2],x[4],.1),S=Xn(x[1],x[3],x[5],.1);f=d-w,c=v-S}else f=d-b,c=v-C;t.srcArrowAngle=sv(f,c);var b=t.midX,C=t.midY;if(n&&(b=(d+m)/2,C=(v+y)/2),f=m-d,c=y-v,i){var x=t.allpts;if(x.length/2%2===0){var T=x.length/2,N=T-2;f=x[T]-x[N],c=x[T+1]-x[N+1]}else if(t.isRound)f=t.midVector[1],c=-t.midVector[0];else{var T=x.length/2-1,N=T-2;f=x[T]-x[N],c=x[T+1]-x[N+1]}}else if(a||l||o){var x=t.allpts,A=t.ctrlpts,R,D,L,_;if(A.length/2%2===0){var M=x.length/2-1,z=M+2,P=z+2;R=Xn(x[M],x[z],x[P],0),D=Xn(x[M+1],x[z+1],x[P+1],0),L=Xn(x[M],x[z],x[P],1e-4),_=Xn(x[M+1],x[z+1],x[P+1],1e-4)}else{var z=x.length/2-1,M=z-2,P=z+2;R=Xn(x[M],x[z],x[P],.4999),D=Xn(x[M+1],x[z+1],x[P+1],.4999),L=Xn(x[M],x[z],x[P],.5),_=Xn(x[M+1],x[z+1],x[P+1],.5)}f=L-R,c=_-D}if(t.midtgtArrowAngle=sv(f,c),t.midDispX=f,t.midDispY=c,f*=-1,c*=-1,i){var x=t.allpts;if(x.length/2%2!==0){if(!t.isRound){var T=x.length/2-1,G=T+2;f=-(x[G]-x[T]),c=-(x[G+1]-x[T+1])}}}if(t.midsrcArrowAngle=sv(f,c),i)f=m-t.segpts[t.segpts.length-2],c=y-t.segpts[t.segpts.length-1];else if(a||l||o||r){var x=t.allpts,I=x.length,w=Xn(x[I-6],x[I-4],x[I-2],.9),S=Xn(x[I-5],x[I-3],x[I-1],.9);f=m-w,c=y-S}else f=m-b,c=y-C;t.tgtArrowAngle=sv(f,c)};cp.getArrowWidth=cp.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(e*13.37,.9),29)*t,n[e+", "+t]=r,r)};var Gb,$b,Qa={},ma={},OA,LA,Kl,_v,Oi,Ul,Gl,Ka,mu,vv,JL,e_,Kb,Yb,_A,BA=function(t,n,r){r.x=n.x-t.x,r.y=n.y-t.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},jZ=function(t,n){n.x=t.x*-1,n.y=t.y*-1,n.nx=t.nx*-1,n.ny=t.ny*-1,n.ang=t.ang>0?-(Math.PI-t.ang):Math.PI+t.ang},DZ=function(t,n,r,a,i){if(t!==_A?BA(n,t,Qa):jZ(ma,Qa),BA(n,r,ma),OA=Qa.nx*ma.ny-Qa.ny*ma.nx,LA=Qa.nx*ma.nx-Qa.ny*-ma.ny,Oi=Math.asin(Math.max(-1,Math.min(1,OA))),Math.abs(Oi)<1e-6){Gb=n.x,$b=n.y,Gl=mu=0;return}Kl=1,_v=!1,LA<0?Oi<0?Oi=Math.PI+Oi:(Oi=Math.PI-Oi,Kl=-1,_v=!0):Oi>0&&(Kl=-1,_v=!0),n.radius!==void 0?mu=n.radius:mu=a,Ul=Oi/2,vv=Math.min(Qa.len/2,ma.len/2),i?(Ka=Math.abs(Math.cos(Ul)*mu/Math.sin(Ul)),Ka>vv?(Ka=vv,Gl=Math.abs(Ka*Math.sin(Ul)/Math.cos(Ul))):Gl=mu):(Ka=Math.min(vv,mu),Gl=Math.abs(Ka*Math.sin(Ul)/Math.cos(Ul))),Kb=n.x+ma.nx*Ka,Yb=n.y+ma.ny*Ka,Gb=Kb-ma.ny*Gl*Kl,$b=Yb+ma.nx*Gl*Kl,JL=n.x+Qa.nx*Ka,e_=n.y+Qa.ny*Ka,_A=n};function t_(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function Lw(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(DZ(e,t,n,r,a),{cx:Gb,cy:$b,radius:Gl,startX:JL,startY:e_,stopX:Kb,stopY:Yb,startAngle:Qa.ang+Math.PI/2*Kl,endAngle:ma.ang-Math.PI/2*Kl,counterClockwise:_v})}var td=.01,MZ=Math.sqrt(2*td),yr={};yr.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,a=t.vectorNormInverse,i,l=e.pstyle("source-endpoint"),o=e.pstyle("target-endpoint"),f=l.units!=null&&o.units!=null,c=function(A,R,D,L){var _=L-R,M=D-A,z=Math.sqrt(M*M+_*_);return{x:-_/z,y:M/z}},d=e.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(f){var v=this.manualEndptToPx(e.source()[0],l),m=On(v,2),y=m[0],x=m[1],w=this.manualEndptToPx(e.target()[0],o),S=On(w,2),b=S[0],C=S[1],T={x1:y,y1:x,x2:b,y2:C};a=c(y,x,b,C),i=T}else Bt("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=r;break}}return{midptPts:i,vectorNormInverse:a}};yr.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,a=r.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var l=r.source,o=r.target,f=l.position(),c=o.position(),d=l.width(),v=o.width(),m=l.height(),y=o.height(),x=n.pstyle("haystack-radius").value,w=x/2;a.haystackPts=a.allpts=[a.source.x*d*w+f.x,a.source.y*m*w+f.y,a.target.x*v*w+c.x,a.target.y*y*w+c.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}};yr.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle("segment-weights"),a=e.pstyle("segment-distances"),i=e.pstyle("segment-radii"),l=e.pstyle("radius-type"),o=Math.min(r.pfValue.length,a.pfValue.length),f=i.pfValue[i.pfValue.length-1],c=l.pfValue[l.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<o;d++){var v=r.pfValue[d],m=a.pfValue[d],y=1-v,x=v,w=this.findMidptPtsEtc(e,t),S=w.midptPts,b=w.vectorNormInverse,C={x:S.x1*y+S.x2*x,y:S.y1*y+S.y2*x};n.segpts.push(C.x+b.x*m,C.y+b.y*m),n.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:f),n.isArcRadius.push((l.pfValue[d]!==void 0?l.pfValue[d]:c)==="arc-radius")}};yr.findLoopPoints=function(e,t,n,r){var a=e._private.rscratch,i=t.dirCounts,l=t.srcPos,o=e.pstyle("control-point-distances"),f=o?o.pfValue[0]:void 0,c=e.pstyle("loop-direction").pfValue,d=e.pstyle("loop-sweep").pfValue,v=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var m=n,y=v;r&&(m=0,y=f);var x=c-Math.PI/2,w=x-d/2,S=x+d/2,b=c+"_"+d;m=i[b]===void 0?i[b]=0:++i[b],a.ctrlpts=[l.x+Math.cos(w)*1.4*y*(m/3+1),l.y+Math.sin(w)*1.4*y*(m/3+1),l.x+Math.cos(S)*1.4*y*(m/3+1),l.y+Math.sin(S)*1.4*y*(m/3+1)]};yr.findCompoundLoopPoints=function(e,t,n,r){var a=e._private.rscratch;a.edgeType="compound";var i=t.srcPos,l=t.tgtPos,o=t.srcW,f=t.srcH,c=t.tgtW,d=t.tgtH,v=e.pstyle("control-point-step-size").pfValue,m=e.pstyle("control-point-distances"),y=m?m.pfValue[0]:void 0,x=n,w=v;r&&(x=0,w=y);var S=50,b={x:i.x-o/2,y:i.y-f/2},C={x:l.x-c/2,y:l.y-d/2},T={x:Math.min(b.x,C.x),y:Math.min(b.y,C.y)},N=.5,A=Math.max(N,Math.log(o*td)),R=Math.max(N,Math.log(c*td));a.ctrlpts=[T.x,T.y-(1+Math.pow(S,1.12)/100)*w*(x/3+1)*A,T.x-(1+Math.pow(S,1.12)/100)*w*(x/3+1)*R,T.y]};yr.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"};yr.findBezierPoints=function(e,t,n,r,a){var i=e._private.rscratch,l=e.pstyle("control-point-step-size").pfValue,o=e.pstyle("control-point-distances"),f=e.pstyle("control-point-weights"),c=o&&f?Math.min(o.value.length,f.value.length):1,d=o?o.pfValue[0]:void 0,v=f.value[0],m=r;i.edgeType=m?"multibezier":"bezier",i.ctrlpts=[];for(var y=0;y<c;y++){var x=(.5-t.eles.length/2+n)*l*(a?-1:1),w=void 0,S=ww(x);m&&(d=o?o.pfValue[y]:l,v=f.value[y]),r?w=d:w=d!==void 0?S*d:void 0;var b=w!==void 0?w:x,C=1-v,T=v,N=this.findMidptPtsEtc(e,t),A=N.midptPts,R=N.vectorNormInverse,D={x:A.x1*C+A.x2*T,y:A.y1*C+A.y2*T};i.ctrlpts.push(D.x+R.x*b,D.y+R.y*b)}};yr.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",i="leftward",l="rightward",o="downward",f="upward",c="auto",d=t.posPts,v=t.srcW,m=t.srcH,y=t.tgtW,x=t.tgtH,w=e.pstyle("edge-distances").value,S=w!=="node-position",b=e.pstyle("taxi-direction").value,C=b,T=e.pstyle("taxi-turn"),N=T.units==="%",A=T.pfValue,R=A<0,D=e.pstyle("taxi-turn-min-distance").pfValue,L=S?(v+y)/2:0,_=S?(m+x)/2:0,M=d.x2-d.x1,z=d.y2-d.y1,P=function(K,le){return K>0?Math.max(K-le,0):Math.min(K+le,0)},G=P(M,L),I=P(z,_),F=!1;C===c?b=Math.abs(G)>Math.abs(I)?a:r:C===f||C===o?(b=r,F=!0):(C===i||C===l)&&(b=a,F=!0);var B=b===r,H=B?I:G,Y=B?z:M,Q=ww(Y),V=!1;!(F&&(N||R))&&(C===o&&Y<0||C===f&&Y>0||C===i&&Y>0||C===l&&Y<0)&&(Q*=-1,H=Q*Math.abs(H),V=!0);var q;if(N){var X=A<0?1+A:A;q=X*H}else{var U=A<0?H:0;q=U+A*Q}var te=function(K){return Math.abs(K)<D||Math.abs(K)>=Math.abs(H)},ie=te(q),oe=te(Math.abs(H)-Math.abs(q)),ae=ie||oe;if(ae&&!V)if(B){var we=Math.abs(Y)<=m/2,fe=Math.abs(M)<=y/2;if(we){var J=(d.x1+d.x2)/2,ne=d.y1,re=d.y2;n.segpts=[J,ne,J,re]}else if(fe){var ge=(d.y1+d.y2)/2,ke=d.x1,Be=d.x2;n.segpts=[ke,ge,Be,ge]}else n.segpts=[d.x1,d.y2]}else{var lt=Math.abs(Y)<=v/2,Ze=Math.abs(z)<=x/2;if(lt){var Qe=(d.y1+d.y2)/2,qe=d.x1,je=d.x2;n.segpts=[qe,Qe,je,Qe]}else if(Ze){var Ge=(d.x1+d.x2)/2,Xe=d.y1,it=d.y2;n.segpts=[Ge,Xe,Ge,it]}else n.segpts=[d.x2,d.y1]}else if(B){var Pe=d.y1+q+(S?m/2*Q:0),ft=d.x1,he=d.x2;n.segpts=[ft,Pe,he,Pe]}else{var Ce=d.x1+q+(S?v/2*Q:0),De=d.y1,ze=d.y2;n.segpts=[Ce,De,Ce,ze]}if(n.isRound){var Me=e.pstyle("taxi-radius").value,Oe=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(Me),n.isArcRadius=new Array(n.segpts.length/2).fill(Oe)}};yr.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var r=t.srcPos,a=t.tgtPos,i=t.srcW,l=t.srcH,o=t.tgtW,f=t.tgtH,c=t.srcShape,d=t.tgtShape,v=t.srcCornerRadius,m=t.tgtCornerRadius,y=t.srcRs,x=t.tgtRs,w=!Re(n.startX)||!Re(n.startY),S=!Re(n.arrowStartX)||!Re(n.arrowStartY),b=!Re(n.endX)||!Re(n.endY),C=!Re(n.arrowEndX)||!Re(n.arrowEndY),T=3,N=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,A=T*N,R=go({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),D=R<A,L=go({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),_=L<A,M=!1;if(w||S||D){M=!0;var z={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},P=Math.sqrt(z.x*z.x+z.y*z.y),G={x:z.x/P,y:z.y/P},I=Math.max(i,l),F={x:n.ctrlpts[0]+G.x*2*I,y:n.ctrlpts[1]+G.y*2*I},B=c.intersectLine(r.x,r.y,i,l,F.x,F.y,0,v,y);D?(n.ctrlpts[0]=n.ctrlpts[0]+G.x*(A-R),n.ctrlpts[1]=n.ctrlpts[1]+G.y*(A-R)):(n.ctrlpts[0]=B[0]+G.x*A,n.ctrlpts[1]=B[1]+G.y*A)}if(b||C||_){M=!0;var H={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},Y=Math.sqrt(H.x*H.x+H.y*H.y),Q={x:H.x/Y,y:H.y/Y},V=Math.max(i,l),q={x:n.ctrlpts[0]+Q.x*2*V,y:n.ctrlpts[1]+Q.y*2*V},X=d.intersectLine(a.x,a.y,o,f,q.x,q.y,0,m,x);_?(n.ctrlpts[0]=n.ctrlpts[0]+Q.x*(A-L),n.ctrlpts[1]=n.ctrlpts[1]+Q.y*(A-L)):(n.ctrlpts[0]=X[0]+Q.x*A,n.ctrlpts[1]=X[1]+Q.y*A)}M&&this.findEndpoints(e)}};yr.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var r,a;t.ctrlpts.length/2%2===0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,a=.5,t.midX=Xn(t.allpts[r],t.allpts[r+2],t.allpts[r+4],a),t.midY=Xn(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],a))}else if(t.edgeType==="straight")t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType==="segments"){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var i=2;i+3<t.allpts.length;i+=2){var l=t.radii[i/2-1],o=t.isArcRadius[i/2-1];t.roundCorners.push(Lw({x:t.allpts[i-2],y:t.allpts[i-1]},{x:t.allpts[i],y:t.allpts[i+1],radius:l},{x:t.allpts[i+2],y:t.allpts[i+3]},l,o))}}if(t.segpts.length%4===0){var f=t.segpts.length/2,c=f-2;t.midX=(t.segpts[c]+t.segpts[f])/2,t.midY=(t.segpts[c+1]+t.segpts[f+1])/2}else{var d=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[d],t.midY=t.segpts[d+1];else{var v={x:t.segpts[d],y:t.segpts[d+1]},m=t.roundCorners[d/2];if(m.radius===0){var y={x:t.segpts[d+2],y:t.segpts[d+3]};t.midX=v.x,t.midY=v.y,t.midVector=[v.y-y.y,y.x-v.x]}else{var x=[v.x-m.cx,v.y-m.cy],w=m.radius/Math.sqrt(Math.pow(x[0],2)+Math.pow(x[1],2));x=x.map(function(S){return S*w}),t.midX=m.cx+x[0],t.midY=m.cy+x[1],t.midVector=x}}}}};yr.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Re(t.startX)&&Re(t.startY)&&Re(t.endX)&&Re(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Bt("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};yr.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i=new Ui,l=function(_,M){return[].concat(ep(_),[M?1:0]).join("-")},o=[],f=[],c=0;c<e.length;c++){var d=e[c],v=d._private,m=d.pstyle("curve-style").value;if(!(d.removed()||!d.takesUpSpace())){if(m==="haystack"){f.push(d);continue}var y=m==="unbundled-bezier"||Xs(m,"segments")||m==="straight"||m==="straight-triangle"||Xs(m,"taxi"),x=m==="unbundled-bezier"||m==="bezier",w=v.source,S=v.target,b=w.poolIndex(),C=S.poolIndex(),T=[b,C].sort(),N=l(T,y),A=i.get(N);A==null&&(A={eles:[]},o.push({pairId:T,edgeIsUnbundled:y}),i.set(N,A)),A.eles.push(d),y&&(A.hasUnbundled=!0),x&&(A.hasBezier=!0)}}for(var R=function(){var _=o[D],M=_.pairId,z=_.edgeIsUnbundled,P=l(M,z),G=i.get(P),I;if(!G.hasUnbundled){var F=G.eles[0].parallelEdges().filter(function(Oe){return Oe.isBundledBezier()});xw(G.eles),F.forEach(function(Oe){return G.eles.push(Oe)}),G.eles.sort(function(Oe,ye){return Oe.poolIndex()-ye.poolIndex()})}var B=G.eles[0],H=B.source(),Y=B.target();if(H.poolIndex()>Y.poolIndex()){var Q=H;H=Y,Y=Q}var V=G.srcPos=H.position(),q=G.tgtPos=Y.position(),X=G.srcW=H.outerWidth(),U=G.srcH=H.outerHeight(),te=G.tgtW=Y.outerWidth(),ie=G.tgtH=Y.outerHeight(),oe=G.srcShape=n.nodeShapes[t.getNodeShape(H)],ae=G.tgtShape=n.nodeShapes[t.getNodeShape(Y)],we=G.srcCornerRadius=H.pstyle("corner-radius").value==="auto"?"auto":H.pstyle("corner-radius").pfValue,fe=G.tgtCornerRadius=Y.pstyle("corner-radius").value==="auto"?"auto":Y.pstyle("corner-radius").pfValue,J=G.tgtRs=Y._private.rscratch,ne=G.srcRs=H._private.rscratch;G.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re<G.eles.length;re++){var ge=G.eles[re],ke=ge[0]._private.rscratch,Be=ge.pstyle("curve-style").value,lt=Be==="unbundled-bezier"||Xs(Be,"segments")||Xs(Be,"taxi"),Ze=!H.same(ge.source());if(!G.calculatedIntersection&&H!==Y&&(G.hasBezier||G.hasUnbundled)){G.calculatedIntersection=!0;var Qe=oe.intersectLine(V.x,V.y,X,U,q.x,q.y,0,we,ne),qe=G.srcIntn=Qe,je=ae.intersectLine(q.x,q.y,te,ie,V.x,V.y,0,fe,J),Ge=G.tgtIntn=je,Xe=G.intersectionPts={x1:Qe[0],x2:je[0],y1:Qe[1],y2:je[1]},it=G.posPts={x1:V.x,x2:q.x,y1:V.y,y2:q.y},Pe=je[1]-Qe[1],ft=je[0]-Qe[0],he=Math.sqrt(ft*ft+Pe*Pe);Re(he)&&he>=MZ||(he=Math.sqrt(Math.max(ft*ft,td)+Math.max(Pe*Pe,td)));var Ce=G.vector={x:ft,y:Pe},De=G.vectorNorm={x:Ce.x/he,y:Ce.y/he},ze={x:-De.y,y:De.x};G.nodesOverlap=!Re(he)||ae.checkPoint(Qe[0],Qe[1],0,te,ie,q.x,q.y,fe,J)||oe.checkPoint(je[0],je[1],0,X,U,V.x,V.y,we,ne),G.vectorNormInverse=ze,I={nodesOverlap:G.nodesOverlap,dirCounts:G.dirCounts,calculatedIntersection:!0,hasBezier:G.hasBezier,hasUnbundled:G.hasUnbundled,eles:G.eles,srcPos:q,srcRs:J,tgtPos:V,tgtRs:ne,srcW:te,srcH:ie,tgtW:X,tgtH:U,srcIntn:Ge,tgtIntn:qe,srcShape:ae,tgtShape:oe,posPts:{x1:it.x2,y1:it.y2,x2:it.x1,y2:it.y1},intersectionPts:{x1:Xe.x2,y1:Xe.y2,x2:Xe.x1,y2:Xe.y1},vector:{x:-Ce.x,y:-Ce.y},vectorNorm:{x:-De.x,y:-De.y},vectorNormInverse:{x:-ze.x,y:-ze.y}}}var Me=Ze?I:G;ke.nodesOverlap=Me.nodesOverlap,ke.srcIntn=Me.srcIntn,ke.tgtIntn=Me.tgtIntn,ke.isRound=Be.startsWith("round"),a&&(H.isParent()||H.isChild()||Y.isParent()||Y.isChild())&&(H.parents().anySame(Y)||Y.parents().anySame(H)||H.same(Y)&&H.isParent())?t.findCompoundLoopPoints(ge,Me,re,lt):H===Y?t.findLoopPoints(ge,Me,re,lt):Be.endsWith("segments")?t.findSegmentsPoints(ge,Me):Be.endsWith("taxi")?t.findTaxiPoints(ge,Me):Be==="straight"||!lt&&G.eles.length%2===1&&re===Math.floor(G.eles.length/2)?t.findStraightEdgePoints(ge):t.findBezierPoints(ge,Me,re,lt,Ze),t.findEndpoints(ge),t.tryToCorrectInvalidPoints(ge,Me),t.checkForInvalidEdgeWarning(ge),t.storeAllpts(ge),t.storeEdgeProjections(ge),t.calculateArrowAngles(ge),t.recalculateEdgeLabelProjections(ge),t.calculateLabelAngles(ge)}},D=0;D<o.length;D++)R();this.findHaystackPoints(f)}};function n_(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1];t.push({x:r,y:a})}return t}}yr.getSegmentPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n==="segments")return n_(t.segpts)};yr.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return n_(t.ctrlpts)};yr.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Ad={};Ad.manualEndptToPx=function(e,t){var n=this,r=e.position(),a=e.outerWidth(),i=e.outerHeight(),l=e._private.rscratch;if(t.value.length===2){var o=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(o[0]=o[0]*a),t.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=r.x,o[1]+=r.y,o}else{var f=t.pfValue[0];f=-Math.PI/2+f;var c=2*Math.max(a,i),d=[r.x+Math.cos(f)*c,r.y+Math.sin(f)*c];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,a,i,d[0],d[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,l)}};Ad.findEndpoints=function(e){var t,n,r,a,i=this,l,o=e.source()[0],f=e.target()[0],c=o.position(),d=f.position(),v=e.pstyle("target-arrow-shape").value,m=e.pstyle("source-arrow-shape").value,y=e.pstyle("target-distance-from-node").pfValue,x=e.pstyle("source-distance-from-node").pfValue,w=o._private.rscratch,S=f._private.rscratch,b=e.pstyle("curve-style").value,C=e._private.rscratch,T=C.edgeType,N=Xs(b,"taxi"),A=T==="self"||T==="compound",R=T==="bezier"||T==="multibezier"||A,D=T!=="bezier",L=T==="straight"||T==="segments",_=T==="segments",M=R||D||L,z=A||N,P=e.pstyle("source-endpoint"),G=z?"outside-to-node":P.value,I=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,F=e.pstyle("target-endpoint"),B=z?"outside-to-node":F.value,H=f.pstyle("corner-radius").value==="auto"?"auto":f.pstyle("corner-radius").pfValue;C.srcManEndpt=P,C.tgtManEndpt=F;var Y,Q,V,q,X=(t=(F==null||(n=F.pfValue)===null||n===void 0?void 0:n.length)===2?F.pfValue:null)!==null&&t!==void 0?t:[0,0],U=(r=(P==null||(a=P.pfValue)===null||a===void 0?void 0:a.length)===2?P.pfValue:null)!==null&&r!==void 0?r:[0,0];if(R){var te=[C.ctrlpts[0],C.ctrlpts[1]],ie=D?[C.ctrlpts[C.ctrlpts.length-2],C.ctrlpts[C.ctrlpts.length-1]]:te;Y=ie,Q=te}else if(L){var oe=_?C.segpts.slice(0,2):[d.x+X[0],d.y+X[1]],ae=_?C.segpts.slice(C.segpts.length-2):[c.x+U[0],c.y+U[1]];Y=ae,Q=oe}if(B==="inside-to-node")l=[d.x,d.y];else if(F.units)l=this.manualEndptToPx(f,F);else if(B==="outside-to-line")l=C.tgtIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?V=Y:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(V=[c.x,c.y]),l=i.nodeShapes[this.getNodeShape(f)].intersectLine(d.x,d.y,f.outerWidth(),f.outerHeight(),V[0],V[1],0,H,S),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var we=f._private.rscratch,fe=we.labelWidth,J=we.labelHeight,ne=we.labelX,re=we.labelY,ge=fe/2,ke=J/2,Be=f.pstyle("text-valign").value;Be==="top"?re-=ke:Be==="bottom"&&(re+=ke);var lt=f.pstyle("text-halign").value;lt==="left"?ne-=ge:lt==="right"&&(ne+=ge);var Ze=Qf(V[0],V[1],[ne-ge,re-ke,ne+ge,re-ke,ne+ge,re+ke,ne-ge,re+ke],d.x,d.y);if(Ze.length>0){var Qe=c,qe=Hl(Qe,Eu(l)),je=Hl(Qe,Eu(Ze)),Ge=qe;if(je<qe&&(l=Ze,Ge=je),Ze.length>2){var Xe=Hl(Qe,{x:Ze[2],y:Ze[3]});Xe<Ge&&(l=[Ze[2],Ze[3]])}}}var it=lv(l,Y,i.arrowShapes[v].spacing(e)+y),Pe=lv(l,Y,i.arrowShapes[v].gap(e)+y);if(C.endX=Pe[0],C.endY=Pe[1],C.arrowEndX=it[0],C.arrowEndY=it[1],G==="inside-to-node")l=[c.x,c.y];else if(P.units)l=this.manualEndptToPx(o,P);else if(G==="outside-to-line")l=C.srcIntn;else if(G==="outside-to-node"||G==="outside-to-node-or-label"?q=Q:(G==="outside-to-line"||G==="outside-to-line-or-label")&&(q=[d.x,d.y]),l=i.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),q[0],q[1],0,I,w),G==="outside-to-node-or-label"||G==="outside-to-line-or-label"){var ft=o._private.rscratch,he=ft.labelWidth,Ce=ft.labelHeight,De=ft.labelX,ze=ft.labelY,Me=he/2,Oe=Ce/2,ye=o.pstyle("text-valign").value;ye==="top"?ze-=Oe:ye==="bottom"&&(ze+=Oe);var K=o.pstyle("text-halign").value;K==="left"?De-=Me:K==="right"&&(De+=Me);var le=Qf(q[0],q[1],[De-Me,ze-Oe,De+Me,ze-Oe,De+Me,ze+Oe,De-Me,ze+Oe],c.x,c.y);if(le.length>0){var pe=d,de=Hl(pe,Eu(l)),xe=Hl(pe,Eu(le)),Le=de;if(xe<de&&(l=[le[0],le[1]],Le=xe),le.length>2){var Te=Hl(pe,{x:le[2],y:le[3]});Te<Le&&(l=[le[2],le[3]])}}}var He=lv(l,Q,i.arrowShapes[m].spacing(e)+x),Ie=lv(l,Q,i.arrowShapes[m].gap(e)+x);C.startX=Ie[0],C.startY=Ie[1],C.arrowStartX=He[0],C.arrowStartY=He[1],M&&(!Re(C.startX)||!Re(C.startY)||!Re(C.endX)||!Re(C.endY)?C.badLine=!0:C.badLine=!1)};Ad.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}};Ad.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var _w={};function OZ(e,t,n){for(var r=function(c,d,v,m){return Xn(c,d,v,m)},a=t._private,i=a.rstyle.bezierPts,l=0;l<e.bezierProjPcts.length;l++){var o=e.bezierProjPcts[l];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}_w.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)OZ(this,e,n.allpts.slice(a,a+6))}else if(r==="segments")for(var i=t.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(r==="haystack"){var l=n.haystackPts;t.rstyle.haystackPts=[{x:l[0],y:l[1]},{x:l[2],y:l[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth};_w.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var hi={};hi.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!ol(t)){var n,r,a=e._private,i=e.width(),l=e.height(),o=e.padding(),f=e.position(),c=e.pstyle("text-halign").strValue,d=e.pstyle("text-valign").strValue,v=a.rscratch,m=a.rstyle;switch(c){case"left":n=f.x-i/2-o;break;case"right":n=f.x+i/2+o;break;default:n=f.x}switch(d){case"top":r=f.y-l/2-o;break;case"bottom":r=f.y+l/2+o;break;default:r=f.y}v.labelX=n,v.labelY=r,m.labelX=n,m.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var r_=function(t,n){var r=Math.atan(n/t);return t===0&&r<0&&(r=r*-1),r},a_=function(t,n){var r=n.x-t.x,a=n.y-t.y;return r_(r,a)},LZ=function(t,n,r,a){var i=Xf(0,a-.001,1),l=Xf(0,a+.001,1),o=Du(t,n,r,i),f=Du(t,n,r,l);return a_(o,f)};hi.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,a=this,i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target){t={x:r.midX,y:r.midY};var l=function(v,m,y){Pi(n.rscratch,v,m,y),Pi(n.rstyle,v,m,y)};l("labelX",null,t.x),l("labelY",null,t.y);var o=r_(r.midDispX,r.midDispY);l("labelAutoAngle",null,o);var f=function(){if(f.cache)return f.cache;for(var v=[],m=0;m+5<r.allpts.length;m+=4){var y={x:r.allpts[m],y:r.allpts[m+1]},x={x:r.allpts[m+2],y:r.allpts[m+3]},w={x:r.allpts[m+4],y:r.allpts[m+5]};v.push({p0:y,p1:x,p2:w,startDist:0,length:0,segments:[]})}var S=n.rstyle.bezierPts,b=a.bezierProjPcts.length;function C(D,L,_,M,z){var P=go(L,_),G=D.segments[D.segments.length-1],I={p0:L,p1:_,t0:M,t1:z,startDist:G?G.startDist+G.length:0,length:P};D.segments.push(I),D.length+=P}for(var T=0;T<v.length;T++){var N=v[T],A=v[T-1];A&&(N.startDist=A.startDist+A.length),C(N,N.p0,S[T*b],0,a.bezierProjPcts[0]);for(var R=0;R<b-1;R++)C(N,S[T*b+R],S[T*b+R+1],a.bezierProjPcts[R],a.bezierProjPcts[R+1]);C(N,S[T*b+b-1],N.p2,a.bezierProjPcts[b-1],1)}return f.cache=v},c=function(v){var m,y=v==="source";if(i[v]){var x=e.pstyle(v+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var w=f(),S,b=0,C=0,T=0;T<w.length;T++){for(var N=w[y?T:w.length-1-T],A=0;A<N.segments.length;A++){var R=N.segments[y?A:N.segments.length-1-A],D=T===w.length-1&&A===N.segments.length-1;if(b=C,C+=R.length,C>=x||D){S={cp:N,segment:R};break}}if(S)break}var L=S.cp,_=S.segment,M=(x-b)/_.length,z=_.t1-_.t0,P=y?_.t0+z*M:_.t1-z*M;P=Xf(0,P,1),t=Du(L.p0,L.p1,L.p2,P),m=LZ(L.p0,L.p1,L.p2,P);break}case"straight":case"segments":case"haystack":{for(var G=0,I,F,B,H,Y=r.allpts.length,Q=0;Q+3<Y&&(y?(B={x:r.allpts[Q],y:r.allpts[Q+1]},H={x:r.allpts[Q+2],y:r.allpts[Q+3]}):(B={x:r.allpts[Y-2-Q],y:r.allpts[Y-1-Q]},H={x:r.allpts[Y-4-Q],y:r.allpts[Y-3-Q]}),I=go(B,H),F=G,G+=I,!(G>=x));Q+=2);var V=x-F,q=V/I;q=Xf(0,q,1),t=nX(B,H,q),m=a_(B,H);break}}l("labelX",v,t.x),l("labelY",v,t.y),l("labelAutoAngle",v,m)}};c("source"),c("target"),this.applyLabelDimensions(e)}};hi.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))};hi.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),a=mo(r,e._private.labelDimsKey);if(Ir(n.rscratch,"prefixedLabelDimsKey",t)!==a){Pi(n.rscratch,"prefixedLabelDimsKey",t,a);var i=this.calculateLabelDimensions(e,r),l=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,f=Ir(n.rscratch,"labelWrapCachedLines",t)||[],c=o!=="wrap"?1:Math.max(f.length,1),d=i.height/c,v=d*l,m=i.width,y=i.height+(c-1)*(l-1)*d;Pi(n.rstyle,"labelWidth",t,m),Pi(n.rscratch,"labelWidth",t,m),Pi(n.rstyle,"labelHeight",t,y),Pi(n.rscratch,"labelHeight",t,y),Pi(n.rscratch,"labelLineHeight",t,v)}};hi.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",a=e.pstyle(r+"label").strValue,i=e.pstyle("text-transform").value,l=function(U,te){return te?(Pi(n.rscratch,U,t,te),te):Ir(n.rscratch,U,t)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var o=e.pstyle("text-wrap").value;if(o==="wrap"){var f=l("labelKey");if(f!=null&&l("labelWrapKey")===f)return l("labelWrapCachedText");for(var c="",d=a.split(`
|
|
471
|
+
`),v=e.pstyle("text-max-width").pfValue,m=e.pstyle("text-overflow-wrap").value,y=m==="anywhere",x=[],w=/[\s\u200b]+|$/g,S=0;S<d.length;S++){var b=d[S],C=this.calculateLabelDimensions(e,b),T=C.width;if(y){var N=b.split("").join(c);b=N}if(T>v){var A=b.matchAll(w),R="",D=0,L=qr(A),_;try{for(L.s();!(_=L.n()).done;){var M=_.value,z=M[0],P=b.substring(D,M.index);D=M.index+z.length;var G=R.length===0?P:R+P+z,I=this.calculateLabelDimensions(e,G),F=I.width;F<=v?R+=P+z:(R&&x.push(R),R=P+z)}}catch(X){L.e(X)}finally{L.f()}R.match(/^[\s\u200b]+$/)||x.push(R)}else x.push(b)}l("labelWrapCachedLines",x),a=l("labelWrapCachedText",x.join(`
|
|
472
|
+
`)),l("labelWrapKey",f)}else if(o==="ellipsis"){var B=e.pstyle("text-max-width").pfValue,H="",Y="…",Q=!1;if(this.calculateLabelDimensions(e,a).width<B)return a;for(var V=0;V<a.length;V++){var q=this.calculateLabelDimensions(e,H+a[V]+Y).width;if(q>B)break;H+=a[V],V===a.length-1&&(Q=!0)}return Q||(H+=Y),H}return a};hi.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if(t==="auto")if(e.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return t};hi.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window(),a=r.document,i=0,l=e.pstyle("font-style").strValue,o=e.pstyle("font-size").pfValue,f=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,v=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=a.createElement("canvas"),v=this.labelCalcCanvasContext=d.getContext("2d");var m=d.style;m.position="absolute",m.left="-9999px",m.top="-9999px",m.zIndex="-1",m.visibility="hidden",m.pointerEvents="none"}v.font="".concat(l," ").concat(c," ").concat(o,"px ").concat(f);for(var y=0,x=0,w=t.split(`
|
|
473
|
+
`),S=0;S<w.length;S++){var b=w[S],C=v.measureText(b),T=Math.ceil(C.width),N=o;y=Math.max(T,y),x+=N}return y+=i,x+=i,{width:y,height:x}};hi.calculateLabelAngle=function(e,t){var n=e._private,r=n.rscratch,a=e.isEdge(),i=t?t+"-":"",l=e.pstyle(i+"text-rotation"),o=l.strValue;return o==="none"?0:a&&o==="autorotate"?r.labelAutoAngle:o==="autorotate"?0:l.pfValue};hi.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private,a=r.rscratch;a.labelAngle=t.calculateLabelAngle(e),n&&(a.sourceLabelAngle=t.calculateLabelAngle(e,"source"),a.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var i_={},PA=28,zA=!1;i_.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<PA||e.height()<PA))return zA||(Bt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),zA=!0),"rectangle";if(e.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n};var lm={};lm.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(l),o)for(var f=0;f<l.length;f++){var c=l[f],d=c._private,v=d.rstyle;v.clean=!1,v.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(l){var o=l.target;r(o)}).on("style.* background.*",function(l){var o=l.target;r(o,!1)});var a=function(l){if(l){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var f=0;f<t.length;f++){var c=t[f],d=c._private.rstyle;c.isNode()&&!d.cleanConnected&&(r(c.connectedEdges()),d.cleanConnected=!0)}if(o)for(var v=0;v<o.length;v++){var m=o[v];m(l,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)};lm.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)};lm.recalculateRenderedStyle=function(e,t){var n=function(N){return N._private.rstyle.cleanConnected};if(e.length!==0){var r=[],a=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var l=e[i],o=l._private,f=o.rstyle;l.isEdge()&&(!n(l.source())||!n(l.target()))&&(f.clean=!1),l.isEdge()&&l.isBundledBezier()&&l.parallelEdges().some(function(T){return!T._private.rstyle.clean&&T.isBundledBezier()})&&(f.clean=!1),!(t&&f.clean||l.removed())&&l.pstyle("display").value!=="none"&&(o.group==="nodes"?a.push(l):r.push(l),f.clean=!0)}for(var c=0;c<a.length;c++){var d=a[c],v=d._private,m=v.rstyle,y=d.position();this.recalculateNodeLabelProjection(d),m.nodeX=y.x,m.nodeY=y.y,m.nodeW=d.pstyle("width").pfValue,m.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var x=0;x<r.length;x++){var w=r[x],S=w._private,b=S.rstyle,C=S.rscratch;b.srcX=C.arrowStartX,b.srcY=C.arrowStartY,b.tgtX=C.arrowEndX,b.tgtY=C.arrowEndY,b.midX=C.midX,b.midY=C.midY,b.labelAngle=C.labelAngle,b.sourceLabelAngle=C.sourceLabelAngle,b.targetLabelAngle=C.targetLabelAngle}}}};var om={};om.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):a.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}};om.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};om.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(FL),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var s_={};[Eo,cp,yr,Ad,_w,hi,i_,lm,om].forEach(function(e){rt(s_,e)});var l_={};l_.getCachedImage=function(e,t,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[e]=a[e]||{};var l=i.image=new Image;l.addEventListener("load",n),l.addEventListener("error",function(){l.error=!0});var o="data:",f=e.substring(0,o.length).toLowerCase()===o;return f||(t=t==="null"?null:t,l.crossOrigin=t),l.src=e,l};var pc={};pc.registerBinding=function(e,t,n,r){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(e)){for(var i=[],l=0;l<e.length;l++){var o=e[l];if(o!==void 0){var f=this.binder(o);i.push(f.on.apply(f,a))}}return i}var f=this.binder(e);return f.on.apply(f,a)};pc.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||$K(e);if(t.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=a}var l=function(f,c,d){var v=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(v[2]={capture:d??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:v}),(e.addEventListener||e.on).apply(e,v),this};return{on:l,addEventListener:l,addListener:l,bind:l}};pc.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()};pc.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()};pc.load=function(){var e=this,t=e.cy.window(),n=function(K){return K.selected()},r=function(K){var le=K.getRootNode();if(le&&le.nodeType===11&&le.host!==void 0)return le},a=function(K,le,pe,de){K==null&&(K=e.cy);for(var xe=0;xe<le.length;xe++){var Le=le[xe];K.emit({originalEvent:pe,type:Le,position:de})}},i=function(K){return K.shiftKey||K.metaKey||K.ctrlKey},l=function(K,le){var pe=!0;if(e.cy.hasCompoundNodes()&&K&&K.pannable())for(var de=0;le&&de<le.length;de++){var K=le[de];if(K.isNode()&&K.isParent()&&!K.pannable()){pe=!1;break}}else pe=!0;return pe},o=function(K){K[0]._private.grabbed=!0},f=function(K){K[0]._private.grabbed=!1},c=function(K){K[0]._private.rscratch.inDragLayer=!0},d=function(K){K[0]._private.rscratch.inDragLayer=!1},v=function(K){K[0]._private.rscratch.isGrabTarget=!0},m=function(K){K[0]._private.rscratch.isGrabTarget=!1},y=function(K,le){var pe=le.addToList,de=pe.has(K);!de&&K.grabbable()&&!K.locked()&&(pe.merge(K),o(K))},x=function(K,le){if(K.cy().hasCompoundNodes()&&!(le.inDragLayer==null&&le.addToList==null)){var pe=K.descendants();le.inDragLayer&&(pe.forEach(c),pe.connectedEdges().forEach(c)),le.addToList&&y(pe,le)}},w=function(K,le){le=le||{};var pe=K.cy().hasCompoundNodes();le.inDragLayer&&(K.forEach(c),K.neighborhood().stdFilter(function(de){return!pe||de.isEdge()}).forEach(c)),le.addToList&&K.forEach(function(de){y(de,le)}),x(K,le),C(K,{inDragLayer:le.inDragLayer}),e.updateCachedGrabbedEles()},S=w,b=function(K){K&&(e.getCachedZSortedEles().forEach(function(le){f(le),d(le),m(le)}),e.updateCachedGrabbedEles())},C=function(K,le){if(!(le.inDragLayer==null&&le.addToList==null)&&K.cy().hasCompoundNodes()){var pe=K.ancestors().orphans();if(!pe.same(K)){var de=pe.descendants().spawnSelf().merge(pe).unmerge(K).unmerge(K.descendants()),xe=de.connectedEdges();le.inDragLayer&&(xe.forEach(c),de.forEach(c)),le.addToList&&de.forEach(function(Le){y(Le,le)})}}},T=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},N=typeof MutationObserver<"u",A=typeof ResizeObserver<"u";N?(e.removeObserver=new MutationObserver(function(ye){for(var K=0;K<ye.length;K++){var le=ye[K],pe=le.removedNodes;if(pe)for(var de=0;de<pe.length;de++){var xe=pe[de];if(xe===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(ye){e.destroy()});var R=Cd(function(){e.cy.resize()},100);N&&(e.styleObserver=new MutationObserver(R),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",R),A&&(e.resizeObserver=new ResizeObserver(R),e.resizeObserver.observe(e.container));var D=function(K,le){for(;K!=null;)le(K),K=K.parentNode},L=function(){e.invalidateContainerClientCoordsCache()};D(e.container,function(ye){e.registerBinding(ye,"transitionend",L),e.registerBinding(ye,"animationend",L),e.registerBinding(ye,"scroll",L)}),e.registerBinding(e.container,"contextmenu",function(ye){ye.preventDefault()});var _=function(){return e.selection[4]!==0},M=function(K){for(var le=e.findContainerClientCoords(),pe=le[0],de=le[1],xe=le[2],Le=le[3],Te=K.touches?K.touches:[K],He=!1,Ie=0;Ie<Te.length;Ie++){var We=Te[Ie];if(pe<=We.clientX&&We.clientX<=pe+xe&&de<=We.clientY&&We.clientY<=de+Le){He=!0;break}}if(!He)return!1;for(var ot=e.container,ut=K.target,Ue=ut.parentNode,yt=!1;Ue;){if(Ue===ot){yt=!0;break}Ue=Ue.parentNode}return!!yt};e.registerBinding(e.container,"mousedown",function(K){if(M(K)&&!(e.hoverData.which===1&&K.which!==1)){K.preventDefault(),T(),e.hoverData.capture=!0,e.hoverData.which=K.which;var le=e.cy,pe=[K.clientX,K.clientY],de=e.projectIntoViewport(pe[0],pe[1]),xe=e.selection,Le=e.findNearestElements(de[0],de[1],!0,!1),Te=Le[0],He=e.dragData.possibleDragElements;e.hoverData.mdownPos=de,e.hoverData.mdownGPos=pe;var Ie=function(ht){return{originalEvent:K,type:ht,position:{x:de[0],y:de[1]}}},We=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var ht=e.hoverData.down;ht?ht.emit(Ie("taphold")):le.emit(Ie("taphold"))}},e.tapholdDuration)};if(K.which==3){e.hoverData.cxtStarted=!0;var ot={originalEvent:K,type:"cxttapstart",position:{x:de[0],y:de[1]}};Te?(Te.activate(),Te.emit(ot),e.hoverData.down=Te):le.emit(ot),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(K.which==1){Te&&Te.activate();{if(Te!=null&&e.nodeIsGrabbable(Te)){var ut=function(ht){ht.emit(Ie("grab"))};if(v(Te),!Te.selected())He=e.dragData.possibleDragElements=le.collection(),S(Te,{addToList:He}),Te.emit(Ie("grabon")).emit(Ie("grab"));else{He=e.dragData.possibleDragElements=le.collection();var Ue=le.$(function(yt){return yt.isNode()&&yt.selected()&&e.nodeIsGrabbable(yt)});w(Ue,{addToList:He}),Te.emit(Ie("grabon")),Ue.forEach(ut)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=Te,e.hoverData.downs=Le,e.hoverData.downTime=new Date().getTime()}a(Te,["mousedown","tapstart","vmousedown"],K,{x:de[0],y:de[1]}),Te==null?(xe[4]=1,e.data.bgActivePosistion={x:de[0],y:de[1]},e.redrawHint("select",!0),e.redraw()):Te.pannable()&&(xe[4]=1),We()}xe[0]=xe[2]=de[0],xe[1]=xe[3]=de[1]}},!1);var z=r(e.container);e.registerBinding([t,z],"mousemove",function(K){var le=e.hoverData.capture;if(!(!le&&!M(K))){var pe=!1,de=e.cy,xe=de.zoom(),Le=[K.clientX,K.clientY],Te=e.projectIntoViewport(Le[0],Le[1]),He=e.hoverData.mdownPos,Ie=e.hoverData.mdownGPos,We=e.selection,ot=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(ot=e.findNearestElement(Te[0],Te[1],!0,!1));var ut=e.hoverData.last,Ue=e.hoverData.down,yt=[Te[0]-We[2],Te[1]-We[3]],ht=e.dragData.possibleDragElements,on;if(Ie){var Ft=Le[0]-Ie[0],Jn=Ft*Ft,un=Le[1]-Ie[1],bn=un*un,vn=Jn+bn;e.hoverData.isOverThresholdDrag=on=vn>=e.desktopTapThreshold2}var wn=i(K);on&&(e.hoverData.tapholdCancelled=!0);var aa=function(){var Gn=e.hoverData.dragDelta=e.hoverData.dragDelta||[];Gn.length===0?(Gn.push(yt[0]),Gn.push(yt[1])):(Gn[0]+=yt[0],Gn[1]+=yt[1])};pe=!0,a(ot,["mousemove","vmousemove","tapdrag"],K,{x:Te[0],y:Te[1]});var cn=function(Gn){return{originalEvent:K,type:Gn,position:{x:Te[0],y:Te[1]}}},ia=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||de.emit(cn("boxstart")),We[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(on){var Un=cn("cxtdrag");Ue?Ue.emit(Un):de.emit(Un),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||ot!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(cn("cxtdragout")),e.hoverData.cxtOver=ot,ot&&ot.emit(cn("cxtdragover")))}}else if(e.hoverData.dragging){if(pe=!0,de.panningEnabled()&&de.userPanningEnabled()){var an;if(e.hoverData.justStartedPan){var _n=e.hoverData.mdownPos;an={x:(Te[0]-_n[0])*xe,y:(Te[1]-_n[1])*xe},e.hoverData.justStartedPan=!1}else an={x:yt[0]*xe,y:yt[1]*xe};de.panBy(an),de.emit(cn("dragpan")),e.hoverData.dragged=!0}Te=e.projectIntoViewport(K.clientX,K.clientY)}else if(We[4]==1&&(Ue==null||Ue.pannable())){if(on){if(!e.hoverData.dragging&&de.boxSelectionEnabled()&&(wn||!de.panningEnabled()||!de.userPanningEnabled()))ia();else if(!e.hoverData.selecting&&de.panningEnabled()&&de.userPanningEnabled()){var Ar=l(Ue,e.hoverData.downs);Ar&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,We[4]=0,e.data.bgActivePosistion=Eu(He),e.redrawHint("select",!0),e.redraw())}Ue&&Ue.pannable()&&Ue.active()&&Ue.unactivate()}}else{if(Ue&&Ue.pannable()&&Ue.active()&&Ue.unactivate(),(!Ue||!Ue.grabbed())&&ot!=ut&&(ut&&a(ut,["mouseout","tapdragout"],K,{x:Te[0],y:Te[1]}),ot&&a(ot,["mouseover","tapdragover"],K,{x:Te[0],y:Te[1]}),e.hoverData.last=ot),Ue)if(on){if(de.boxSelectionEnabled()&&wn)Ue&&Ue.grabbed()&&(b(ht),Ue.emit(cn("freeon")),ht.emit(cn("free")),e.dragData.didDrag&&(Ue.emit(cn("dragfreeon")),ht.emit(cn("dragfree")))),ia();else if(Ue&&Ue.grabbed()&&e.nodeIsDraggable(Ue)){var Vn=!e.dragData.didDrag;Vn&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||w(ht,{inDragLayer:!0});var Hn={x:0,y:0};if(Re(yt[0])&&Re(yt[1])&&(Hn.x+=yt[0],Hn.y+=yt[1],Vn)){var ur=e.hoverData.dragDelta;ur&&Re(ur[0])&&Re(ur[1])&&(Hn.x+=ur[0],Hn.y+=ur[1])}e.hoverData.draggingEles=!0,ht.silentShift(Hn).emit(cn("position")).emit(cn("drag")),e.redrawHint("drag",!0),e.redraw()}}else aa();pe=!0}if(We[2]=Te[0],We[3]=Te[1],pe)return K.stopPropagation&&K.stopPropagation(),K.preventDefault&&K.preventDefault(),!1}},!1);var P,G,I;e.registerBinding(t,"mouseup",function(K){if(!(e.hoverData.which===1&&K.which!==1&&e.hoverData.capture)){var le=e.hoverData.capture;if(le){e.hoverData.capture=!1;var pe=e.cy,de=e.projectIntoViewport(K.clientX,K.clientY),xe=e.selection,Le=e.findNearestElement(de[0],de[1],!0,!1),Te=e.dragData.possibleDragElements,He=e.hoverData.down,Ie=i(K);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,He&&He.unactivate();var We=function(Ft){return{originalEvent:K,type:Ft,position:{x:de[0],y:de[1]}}};if(e.hoverData.which===3){var ot=We("cxttapend");if(He?He.emit(ot):pe.emit(ot),!e.hoverData.cxtDragged){var ut=We("cxttap");He?He.emit(ut):pe.emit(ut)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(a(Le,["mouseup","tapend","vmouseup"],K,{x:de[0],y:de[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(a(He,["click","tap","vclick"],K,{x:de[0],y:de[1]}),G=!1,K.timeStamp-I<=pe.multiClickDebounceTime()?(P&&clearTimeout(P),G=!0,I=null,a(He,["dblclick","dbltap","vdblclick"],K,{x:de[0],y:de[1]})):(P=setTimeout(function(){G||a(He,["oneclick","onetap","voneclick"],K,{x:de[0],y:de[1]})},pe.multiClickDebounceTime()),I=K.timeStamp)),He==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!i(K)&&(pe.$(n).unselect(["tapunselect"]),Te.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=Te=pe.collection()),Le==He&&!e.dragData.didDrag&&!e.hoverData.selecting&&Le!=null&&Le._private.selectable&&(e.hoverData.dragging||(pe.selectionType()==="additive"||Ie?Le.selected()?Le.unselect(["tapunselect"]):Le.select(["tapselect"]):Ie||(pe.$(n).unmerge(Le).unselect(["tapunselect"]),Le.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var Ue=pe.collection(e.getAllInBox(xe[0],xe[1],xe[2],xe[3]));e.redrawHint("select",!0),Ue.length>0&&e.redrawHint("eles",!0),pe.emit(We("boxend"));var yt=function(Ft){return Ft.selectable()&&!Ft.selected()};pe.selectionType()==="additive"||Ie||pe.$(n).unmerge(Ue).unselect(),Ue.emit(We("box")).stdFilter(yt).select().emit(We("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!xe[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var ht=He&&He.grabbed();b(Te),ht&&(He.emit(We("freeon")),Te.emit(We("free")),e.dragData.didDrag&&(He.emit(We("dragfreeon")),Te.emit(We("dragfree"))))}}xe[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}},!1);var F=[],B=4,H,Y=1e5,Q=function(K,le){for(var pe=0;pe<K.length;pe++)if(K[pe]%le!==0)return!1;return!0},V=function(K){for(var le=Math.abs(K[0]),pe=1;pe<K.length;pe++)if(Math.abs(K[pe])!==le)return!1;return!0},q=function(K){var le=!1,pe=K.deltaY;if(pe==null&&(K.wheelDeltaY!=null?pe=K.wheelDeltaY/4:K.wheelDelta!=null&&(pe=K.wheelDelta/4)),pe!==0){if(H==null)if(F.length>=B){var de=F;if(H=Q(de,5),!H){var xe=Math.abs(de[0]);H=V(de)&&xe>5}if(H)for(var Le=0;Le<de.length;Le++)Y=Math.min(Math.abs(de[Le]),Y)}else F.push(pe),le=!0;else H&&(Y=Math.min(Math.abs(pe),Y));if(!e.scrollingPage){var Te=e.cy,He=Te.zoom(),Ie=Te.pan(),We=e.projectIntoViewport(K.clientX,K.clientY),ot=[We[0]*He+Ie.x,We[1]*He+Ie.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||_()){K.preventDefault();return}if(Te.panningEnabled()&&Te.userPanningEnabled()&&Te.zoomingEnabled()&&Te.userZoomingEnabled()){K.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var ut;le&&Math.abs(pe)>5&&(pe=ww(pe)*5),ut=pe/-250,H&&(ut/=Y,ut*=3),ut=ut*e.wheelSensitivity;var Ue=K.deltaMode===1;Ue&&(ut*=33);var yt=Te.zoom()*Math.pow(10,ut);K.type==="gesturechange"&&(yt=e.gestureStartZoom*K.scale),Te.zoom({level:yt,renderedPosition:{x:ot[0],y:ot[1]}}),Te.emit({type:K.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:K,position:{x:We[0],y:We[1]}})}}}};e.registerBinding(e.container,"wheel",q,!0),e.registerBinding(t,"scroll",function(K){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(K){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||K.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(ye){e.hasTouchStarted||q(ye)},!0),e.registerBinding(e.container,"mouseout",function(K){var le=e.projectIntoViewport(K.clientX,K.clientY);e.cy.emit({originalEvent:K,type:"mouseout",position:{x:le[0],y:le[1]}})},!1),e.registerBinding(e.container,"mouseover",function(K){var le=e.projectIntoViewport(K.clientX,K.clientY);e.cy.emit({originalEvent:K,type:"mouseover",position:{x:le[0],y:le[1]}})},!1);var X,U,te,ie,oe,ae,we,fe,J,ne,re,ge,ke,Be=function(K,le,pe,de){return Math.sqrt((pe-K)*(pe-K)+(de-le)*(de-le))},lt=function(K,le,pe,de){return(pe-K)*(pe-K)+(de-le)*(de-le)},Ze;e.registerBinding(e.container,"touchstart",Ze=function(K){if(e.hasTouchStarted=!0,!!M(K)){T(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var le=e.cy,pe=e.touchData.now,de=e.touchData.earlier;if(K.touches[0]){var xe=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);pe[0]=xe[0],pe[1]=xe[1]}if(K.touches[1]){var xe=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);pe[2]=xe[0],pe[3]=xe[1]}if(K.touches[2]){var xe=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);pe[4]=xe[0],pe[5]=xe[1]}var Le=function(wn){return{originalEvent:K,type:wn,position:{x:pe[0],y:pe[1]}}};if(K.touches[1]){e.touchData.singleTouchMoved=!0,b(e.dragData.touchDragEles);var Te=e.findContainerClientCoords();J=Te[0],ne=Te[1],re=Te[2],ge=Te[3],X=K.touches[0].clientX-J,U=K.touches[0].clientY-ne,te=K.touches[1].clientX-J,ie=K.touches[1].clientY-ne,ke=0<=X&&X<=re&&0<=te&&te<=re&&0<=U&&U<=ge&&0<=ie&&ie<=ge;var He=le.pan(),Ie=le.zoom();oe=Be(X,U,te,ie),ae=lt(X,U,te,ie),we=[(X+te)/2,(U+ie)/2],fe=[(we[0]-He.x)/Ie,(we[1]-He.y)/Ie];var We=200,ot=We*We;if(ae<ot&&!K.touches[2]){var ut=e.findNearestElement(pe[0],pe[1],!0,!0),Ue=e.findNearestElement(pe[2],pe[3],!0,!0);ut&&ut.isNode()?(ut.activate().emit(Le("cxttapstart")),e.touchData.start=ut):Ue&&Ue.isNode()?(Ue.activate().emit(Le("cxttapstart")),e.touchData.start=Ue):le.emit(Le("cxttapstart")),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(K.touches[2])le.boxSelectionEnabled()&&K.preventDefault();else if(!K.touches[1]){if(K.touches[0]){var yt=e.findNearestElements(pe[0],pe[1],!0,!0),ht=yt[0];if(ht!=null&&(ht.activate(),e.touchData.start=ht,e.touchData.starts=yt,e.nodeIsGrabbable(ht))){var on=e.dragData.touchDragEles=le.collection(),Ft=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),ht.selected()?(Ft=le.$(function(vn){return vn.selected()&&e.nodeIsGrabbable(vn)}),w(Ft,{addToList:on})):S(ht,{addToList:on}),v(ht),ht.emit(Le("grabon")),Ft?Ft.forEach(function(vn){vn.emit(Le("grab"))}):ht.emit(Le("grab"))}a(ht,["touchstart","tapstart","vmousedown"],K,{x:pe[0],y:pe[1]}),ht==null&&(e.data.bgActivePosistion={x:xe[0],y:xe[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&a(e.touchData.start,["taphold"],K,{x:pe[0],y:pe[1]})},e.tapholdDuration)}}if(K.touches.length>=1){for(var Jn=e.touchData.startPosition=[null,null,null,null,null,null],un=0;un<pe.length;un++)Jn[un]=de[un]=pe[un];var bn=K.touches[0];e.touchData.startGPosition=[bn.clientX,bn.clientY]}}},!1);var Qe;e.registerBinding(t,"touchmove",Qe=function(K){var le=e.touchData.capture;if(!(!le&&!M(K))){var pe=e.selection,de=e.cy,xe=e.touchData.now,Le=e.touchData.earlier,Te=de.zoom();if(K.touches[0]){var He=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);xe[0]=He[0],xe[1]=He[1]}if(K.touches[1]){var He=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);xe[2]=He[0],xe[3]=He[1]}if(K.touches[2]){var He=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);xe[4]=He[0],xe[5]=He[1]}var Ie=function(Ld){return{originalEvent:K,type:Ld,position:{x:xe[0],y:xe[1]}}},We=e.touchData.startGPosition,ot;if(le&&K.touches[0]&&We){for(var ut=[],Ue=0;Ue<xe.length;Ue++)ut[Ue]=xe[Ue]-Le[Ue];var yt=K.touches[0].clientX-We[0],ht=yt*yt,on=K.touches[0].clientY-We[1],Ft=on*on,Jn=ht+Ft;ot=Jn>=e.touchTapThreshold2}if(le&&e.touchData.cxt){K.preventDefault();var un=K.touches[0].clientX-J,bn=K.touches[0].clientY-ne,vn=K.touches[1].clientX-J,wn=K.touches[1].clientY-ne,aa=lt(un,bn,vn,wn),cn=aa/ae,ia=150,Un=ia*ia,an=1.5,_n=an*an;if(cn>=_n||aa>=Un){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Ar=Ie("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit(Ar),e.touchData.start=null):de.emit(Ar)}}if(le&&e.touchData.cxt){var Ar=Ie("cxtdrag");e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(Ar):de.emit(Ar),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var Vn=e.findNearestElement(xe[0],xe[1],!0,!0);(!e.touchData.cxtOver||Vn!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(Ie("cxtdragout")),e.touchData.cxtOver=Vn,Vn&&Vn.emit(Ie("cxtdragover")))}else if(le&&K.touches[2]&&de.boxSelectionEnabled())K.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||de.emit(Ie("boxstart")),e.touchData.selecting=!0,e.touchData.didSelect=!0,pe[4]=1,!pe||pe.length===0||pe[0]===void 0?(pe[0]=(xe[0]+xe[2]+xe[4])/3,pe[1]=(xe[1]+xe[3]+xe[5])/3,pe[2]=(xe[0]+xe[2]+xe[4])/3+1,pe[3]=(xe[1]+xe[3]+xe[5])/3+1):(pe[2]=(xe[0]+xe[2]+xe[4])/3,pe[3]=(xe[1]+xe[3]+xe[5])/3),e.redrawHint("select",!0),e.redraw();else if(le&&K.touches[1]&&!e.touchData.didSelect&&de.zoomingEnabled()&&de.panningEnabled()&&de.userZoomingEnabled()&&de.userPanningEnabled()){K.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Hn=e.dragData.touchDragEles;if(Hn){e.redrawHint("drag",!0);for(var ur=0;ur<Hn.length;ur++){var rs=Hn[ur]._private;rs.grabbed=!1,rs.rscratch.inDragLayer=!1}}var Gn=e.touchData.start,un=K.touches[0].clientX-J,bn=K.touches[0].clientY-ne,vn=K.touches[1].clientX-J,wn=K.touches[1].clientY-ne,To=Be(un,bn,vn,wn),as=To/oe;if(ke){var is=un-X,El=bn-U,ss=vn-te,kn=wn-ie,Dd=(is+ss)/2,Md=(El+kn)/2,Vr=de.zoom(),Ua=Vr*as,ko=de.pan(),gc=fe[0]*Vr+ko.x,yc=fe[1]*Vr+ko.y,um={x:-Ua/Vr*(gc-ko.x-Dd)+gc,y:-Ua/Vr*(yc-ko.y-Md)+yc};if(Gn&&Gn.active()){var Hn=e.dragData.touchDragEles;b(Hn),e.redrawHint("drag",!0),e.redrawHint("eles",!0),Gn.unactivate().emit(Ie("freeon")),Hn.emit(Ie("free")),e.dragData.didDrag&&(Gn.emit(Ie("dragfreeon")),Hn.emit(Ie("dragfree")))}de.viewport({zoom:Ua,pan:um,cancelOnFailedZoom:!0}),de.emit(Ie("pinchzoom")),oe=To,X=un,U=bn,te=vn,ie=wn,e.pinching=!0}if(K.touches[0]){var He=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);xe[0]=He[0],xe[1]=He[1]}if(K.touches[1]){var He=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);xe[2]=He[0],xe[3]=He[1]}if(K.touches[2]){var He=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);xe[4]=He[0],xe[5]=He[1]}}else if(K.touches[0]&&!e.touchData.didSelect){var cr=e.touchData.start,ls=e.touchData.last,Vn;if(!e.hoverData.draggingEles&&!e.swipePanning&&(Vn=e.findNearestElement(xe[0],xe[1],!0,!0)),le&&cr!=null&&K.preventDefault(),le&&cr!=null&&e.nodeIsDraggable(cr))if(ot){var Hn=e.dragData.touchDragEles,sa=!e.dragData.didDrag;sa&&w(Hn,{inDragLayer:!0}),e.dragData.didDrag=!0;var $n={x:0,y:0};if(Re(ut[0])&&Re(ut[1])&&($n.x+=ut[0],$n.y+=ut[1],sa)){e.redrawHint("eles",!0);var Rr=e.touchData.dragDelta;Rr&&Re(Rr[0])&&Re(Rr[1])&&($n.x+=Rr[0],$n.y+=Rr[1])}e.hoverData.draggingEles=!0,Hn.silentShift($n).emit(Ie("position")).emit(Ie("drag")),e.redrawHint("drag",!0),e.touchData.startPosition[0]==Le[0]&&e.touchData.startPosition[1]==Le[1]&&e.redrawHint("eles",!0),e.redraw()}else{var Rr=e.touchData.dragDelta=e.touchData.dragDelta||[];Rr.length===0?(Rr.push(ut[0]),Rr.push(ut[1])):(Rr[0]+=ut[0],Rr[1]+=ut[1])}if(a(cr||Vn,["touchmove","tapdrag","vmousemove"],K,{x:xe[0],y:xe[1]}),(!cr||!cr.grabbed())&&Vn!=ls&&(ls&&ls.emit(Ie("tapdragout")),Vn&&Vn.emit(Ie("tapdragover"))),e.touchData.last=Vn,le)for(var ur=0;ur<xe.length;ur++)xe[ur]&&e.touchData.startPosition[ur]&&ot&&(e.touchData.singleTouchMoved=!0);if(le&&(cr==null||cr.pannable())&&de.panningEnabled()&&de.userPanningEnabled()){var cm=l(cr,e.touchData.starts);cm&&(K.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=Eu(e.touchData.startPosition)),e.swipePanning?(de.panBy({x:ut[0]*Te,y:ut[1]*Te}),de.emit(Ie("dragpan"))):ot&&(e.swipePanning=!0,de.panBy({x:yt*Te,y:on*Te}),de.emit(Ie("dragpan")),cr&&(cr.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var He=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);xe[0]=He[0],xe[1]=He[1]}}for(var Ue=0;Ue<xe.length;Ue++)Le[Ue]=xe[Ue];le&&K.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var qe;e.registerBinding(t,"touchcancel",qe=function(K){var le=e.touchData.start;e.touchData.capture=!1,le&&le.unactivate()});var je,Ge,Xe,it;if(e.registerBinding(t,"touchend",je=function(K){var le=e.touchData.start,pe=e.touchData.capture;if(pe)K.touches.length===0&&(e.touchData.capture=!1),K.preventDefault();else return;var de=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var xe=e.cy,Le=xe.zoom(),Te=e.touchData.now,He=e.touchData.earlier;if(K.touches[0]){var Ie=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);Te[0]=Ie[0],Te[1]=Ie[1]}if(K.touches[1]){var Ie=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);Te[2]=Ie[0],Te[3]=Ie[1]}if(K.touches[2]){var Ie=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);Te[4]=Ie[0],Te[5]=Ie[1]}var We=function(Un){return{originalEvent:K,type:Un,position:{x:Te[0],y:Te[1]}}};le&&le.unactivate();var ot;if(e.touchData.cxt){if(ot=We("cxttapend"),le?le.emit(ot):xe.emit(ot),!e.touchData.cxtDragged){var ut=We("cxttap");le?le.emit(ut):xe.emit(ut)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!K.touches[2]&&xe.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var Ue=xe.collection(e.getAllInBox(de[0],de[1],de[2],de[3]));de[0]=void 0,de[1]=void 0,de[2]=void 0,de[3]=void 0,de[4]=0,e.redrawHint("select",!0),xe.emit(We("boxend"));var yt=function(Un){return Un.selectable()&&!Un.selected()};Ue.emit(We("box")).stdFilter(yt).select().emit(We("boxselect")),Ue.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(le!=null&&le.unactivate(),K.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!K.touches[1]){if(!K.touches[0]){if(!K.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var ht=e.dragData.touchDragEles;if(le!=null){var on=le._private.grabbed;b(ht),e.redrawHint("drag",!0),e.redrawHint("eles",!0),on&&(le.emit(We("freeon")),ht.emit(We("free")),e.dragData.didDrag&&(le.emit(We("dragfreeon")),ht.emit(We("dragfree")))),a(le,["touchend","tapend","vmouseup","tapdragout"],K,{x:Te[0],y:Te[1]}),le.unactivate(),e.touchData.start=null}else{var Ft=e.findNearestElement(Te[0],Te[1],!0,!0);a(Ft,["touchend","tapend","vmouseup","tapdragout"],K,{x:Te[0],y:Te[1]})}var Jn=e.touchData.startPosition[0]-Te[0],un=Jn*Jn,bn=e.touchData.startPosition[1]-Te[1],vn=bn*bn,wn=un+vn,aa=wn*Le*Le;e.touchData.singleTouchMoved||(le||xe.$(":selected").unselect(["tapunselect"]),a(le,["tap","vclick"],K,{x:Te[0],y:Te[1]}),Ge=!1,K.timeStamp-it<=xe.multiClickDebounceTime()?(Xe&&clearTimeout(Xe),Ge=!0,it=null,a(le,["dbltap","vdblclick"],K,{x:Te[0],y:Te[1]})):(Xe=setTimeout(function(){Ge||a(le,["onetap","voneclick"],K,{x:Te[0],y:Te[1]})},xe.multiClickDebounceTime()),it=K.timeStamp)),le!=null&&!e.dragData.didDrag&&le._private.selectable&&aa<e.touchTapThreshold2&&!e.pinching&&(xe.selectionType()==="single"?(xe.$(n).unmerge(le).unselect(["tapunselect"]),le.select(["tapselect"])):le.selected()?le.unselect(["tapunselect"]):le.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}}}for(var cn=0;cn<Te.length;cn++)He[cn]=Te[cn];e.dragData.didDrag=!1,K.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),K.touches.length<2&&(K.touches.length===1&&(e.touchData.startGPosition=[K.touches[0].clientX,K.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var Pe=[],ft=function(K){return{clientX:K.clientX,clientY:K.clientY,force:1,identifier:K.pointerId,pageX:K.pageX,pageY:K.pageY,radiusX:K.width/2,radiusY:K.height/2,screenX:K.screenX,screenY:K.screenY,target:K.target}},he=function(K){return{event:K,touch:ft(K)}},Ce=function(K){Pe.push(he(K))},De=function(K){for(var le=0;le<Pe.length;le++){var pe=Pe[le];if(pe.event.pointerId===K.pointerId){Pe.splice(le,1);return}}},ze=function(K){var le=Pe.filter(function(pe){return pe.event.pointerId===K.pointerId})[0];le.event=K,le.touch=ft(K)},Me=function(K){K.touches=Pe.map(function(le){return le.touch})},Oe=function(K){return K.pointerType==="mouse"||K.pointerType===4};e.registerBinding(e.container,"pointerdown",function(ye){Oe(ye)||(ye.preventDefault(),Ce(ye),Me(ye),Ze(ye))}),e.registerBinding(e.container,"pointerup",function(ye){Oe(ye)||(De(ye),Me(ye),je(ye))}),e.registerBinding(e.container,"pointercancel",function(ye){Oe(ye)||(De(ye),Me(ye),qe(ye))}),e.registerBinding(e.container,"pointermove",function(ye){Oe(ye)||(ye.preventDefault(),ze(ye),Me(ye),Qe(ye))})}};var ts={};ts.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(r,a,i,l,o,f){this.renderer.nodeShapeImpl("polygon",r,a,i,l,o,this.points)},intersectLine:function(r,a,i,l,o,f,c,d){return Qf(o,f,this.points,r,a,i/2,l/2,c)},checkPoint:function(r,a,i,l,o,f,c,d){return Xi(r,a,this.points,f,c,l,o,[0,-1],i)},hasMiterBounds:e!=="rectangle",miterBounds:function(r,a,i,l,o,f){return oX(this.points,r,a,i,l,o)}}};ts.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i)},intersectLine:function(t,n,r,a,i,l,o,f){return mX(i,l,t,n,r/2+o,a/2+o)},checkPoint:function(t,n,r,a,i,l,o,f){return Xl(t,n,a,i,l,o,r)}}};ts.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(r,a,i,l,o,f,c){if(f[c]!==void 0&&f[c+"-cx"]===r&&f[c+"-cy"]===a)return f[c];f[c]=new Array(t.length/2),f[c+"-cx"]=r,f[c+"-cy"]=a;var d=i/2,v=l/2;o=o==="auto"?oL(i,l):o;for(var m=new Array(t.length/2),y=0;y<t.length/2;y++)m[y]={x:r+d*t[y*2],y:a+v*t[y*2+1]};var x,w,S,b,C=m.length;for(w=m[C-1],x=0;x<C;x++)S=m[x%C],b=m[(x+1)%C],f[c][x]=Lw(w,S,b,o),w=S,S=b;return f[c]},draw:function(r,a,i,l,o,f,c){this.renderer.nodeShapeImpl("round-polygon",r,a,i,l,o,this.points,this.getOrCreateCorners(a,i,l,o,f,c,"drawCorners"))},intersectLine:function(r,a,i,l,o,f,c,d,v){return yX(o,f,this.points,r,a,i,l,c,this.getOrCreateCorners(r,a,i,l,d,v,"corners"))},checkPoint:function(r,a,i,l,o,f,c,d,v){return pX(r,a,this.points,f,c,l,o,this.getOrCreateCorners(f,c,l,o,d,v,"corners"))}}};ts.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:wr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,this.points,l)},intersectLine:function(t,n,r,a,i,l,o,f){return sL(i,l,t,n,r,a,o,f)},checkPoint:function(t,n,r,a,i,l,o,f){var c=a/2,d=i/2;f=f==="auto"?cl(a,i):f,f=Math.min(c,d,f);var v=f*2;return!!(Xi(t,n,this.points,l,o,a,i-v,[0,-1],r)||Xi(t,n,this.points,l,o,a-v,i,[0,-1],r)||Xl(t,n,v,v,l-c+f,o-d+f,r)||Xl(t,n,v,v,l+c-f,o-d+f,r)||Xl(t,n,v,v,l+c-f,o+d-f,r)||Xl(t,n,v,v,l-c+f,o+d-f,r))}}};ts.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Ew(),points:wr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,null,l)},generateCutTrianglePts:function(t,n,r,a,i){var l=i==="auto"?this.cornerLength:i,o=n/2,f=t/2,c=r-f,d=r+f,v=a-o,m=a+o;return{topLeft:[c,v+l,c+l,v,c+l,v+l],topRight:[d-l,v,d,v+l,d-l,v+l],bottomRight:[d,m-l,d-l,m,d-l,m-l],bottomLeft:[c+l,m,c,m-l,c+l,m-l]}},intersectLine:function(t,n,r,a,i,l,o,f){var c=this.generateCutTrianglePts(r+2*o,a+2*o,t,n,f),d=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return Qf(i,l,d,t,n)},checkPoint:function(t,n,r,a,i,l,o,f){var c=f==="auto"?this.cornerLength:f;if(Xi(t,n,this.points,l,o,a,i-2*c,[0,-1],r)||Xi(t,n,this.points,l,o,a-2*c,i,[0,-1],r))return!0;var d=this.generateCutTrianglePts(a,i,l,o);return Fr(t,n,d.topLeft)||Fr(t,n,d.topRight)||Fr(t,n,d.bottomRight)||Fr(t,n,d.bottomLeft)}}};ts.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:wr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i)},intersectLine:function(t,n,r,a,i,l,o,f){var c=.15,d=.5,v=.85,m=this.generateBarrelBezierPts(r+2*o,a+2*o,t,n),y=function(S){var b=Du({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},c),C=Du({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},d),T=Du({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},v);return[S[0],S[1],b.x,b.y,C.x,C.y,T.x,T.y,S[4],S[5]]},x=[].concat(y(m.topLeft),y(m.topRight),y(m.bottomRight),y(m.bottomLeft));return Qf(i,l,x,t,n)},generateBarrelBezierPts:function(t,n,r,a){var i=n/2,l=t/2,o=r-l,f=r+l,c=a-i,d=a+i,v=Bb(t,n),m=v.heightOffset,y=v.widthOffset,x=v.ctrlPtOffsetPct*t,w={topLeft:[o,c+m,o+x,c,o+y,c],topRight:[f-y,c,f-x,c,f,c+m],bottomRight:[f,d-m,f-x,d,f-y,d],bottomLeft:[o+y,d,o+x,d,o,d-m]};return w.topLeft.isTop=!0,w.topRight.isTop=!0,w.bottomLeft.isBottom=!0,w.bottomRight.isBottom=!0,w},checkPoint:function(t,n,r,a,i,l,o,f){var c=Bb(a,i),d=c.heightOffset,v=c.widthOffset;if(Xi(t,n,this.points,l,o,a,i-2*d,[0,-1],r)||Xi(t,n,this.points,l,o,a-2*v,i,[0,-1],r))return!0;for(var m=this.generateBarrelBezierPts(a,i,l,o),y=function(L,_,M){var z=M[4],P=M[2],G=M[0],I=M[5],F=M[1],B=Math.min(z,G),H=Math.max(z,G),Y=Math.min(I,F),Q=Math.max(I,F);if(B<=L&&L<=H&&Y<=_&&_<=Q){var V=xX(z,P,G),q=fX(V[0],V[1],V[2],L),X=q.filter(function(U){return 0<=U&&U<=1});if(X.length>0)return X[0]}return null},x=Object.keys(m),w=0;w<x.length;w++){var S=x[w],b=m[S],C=y(t,n,b);if(C!=null){var T=b[5],N=b[3],A=b[1],R=Xn(T,N,A,C);if(b.isTop&&R<=n||b.isBottom&&n<=R)return!0}}return!1}}};ts.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:wr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,this.points,l)},intersectLine:function(t,n,r,a,i,l,o,f){var c=t-(r/2+o),d=n-(a/2+o),v=d,m=t+(r/2+o),y=Ws(i,l,t,n,c,d,m,v,!1);return y.length>0?y:sL(i,l,t,n,r,a,o,f)},checkPoint:function(t,n,r,a,i,l,o,f){f=f==="auto"?cl(a,i):f;var c=2*f;if(Xi(t,n,this.points,l,o,a,i-c,[0,-1],r)||Xi(t,n,this.points,l,o,a-c,i,[0,-1],r))return!0;var d=a/2+2*r,v=i/2+2*r,m=[l-d,o-v,l-d,o,l+d,o,l+d,o-v];return!!(Fr(t,n,m)||Xl(t,n,c,c,l+a/2-f,o+i/2-f,r)||Xl(t,n,c,c,l-a/2+f,o+i/2-f,r))}}};ts.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",wr(3,0)),this.generateRoundPolygon("round-triangle",wr(3,0)),this.generatePolygon("rectangle",wr(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",wr(5,0)),this.generateRoundPolygon("round-pentagon",wr(5,0)),this.generatePolygon("hexagon",wr(6,0)),this.generateRoundPolygon("round-hexagon",wr(6,0)),this.generatePolygon("heptagon",wr(7,0)),this.generateRoundPolygon("round-heptagon",wr(7,0)),this.generatePolygon("octagon",wr(8,0)),this.generateRoundPolygon("round-octagon",wr(8,0));var r=new Array(20);{var a=_b(5,0),i=_b(5,Math.PI/5),l=.5*(3-Math.sqrt(5));l*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=l,i[o*2+1]*=l;for(var o=0;o<20/4;o++)r[o*4]=a[o*2],r[o*4+1]=a[o*2+1],r[o*4+2]=i[o*2],r[o*4+3]=i[o*2+1]}r=lL(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var f=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",f),this.generateRoundPolygon("round-tag",f)}e.makePolygon=function(c){var d=c.join("$"),v="polygon-"+d,m;return(m=this[v])?m:t.generatePolygon(v,c)}};var Rd={};Rd.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Rd.redraw=function(e){e=e||nL();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e};Rd.beforeRender=function(e,t){if(!this.destroyed){t==null&&ln("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(r,a){return a.priority-r.priority})}};var IA=function(t,n,r){for(var a=t.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};Rd.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function(a){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){IA(e,!0,a);var i=Yi();e.render(e.renderOptions);var l=e.lastDrawTime=Yi();e.averageRedrawTime===void 0&&(e.averageRedrawTime=l-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var o=l-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else IA(e,!1,a);e.skipFrame=!1,np(n)}};np(n)}};var _Z=function(t){this.init(t)},o_=_Z,mc=o_.prototype;mc.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];mc.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var a=r.document,i=a.head,l="__________cytoscape_stylesheet",o="__________cytoscape_container",f=a.getElementById(l)!=null;if(n.className.indexOf(o)<0&&(n.className=(n.className||"")+" "+o),!f){var c=a.createElement("style");c.id=l,c.textContent="."+o+" { position: relative; }",i.insertBefore(c,i.children[0])}var d=r.getComputedStyle(n),v=d.getPropertyValue("position");v==="static"&&Bt("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.webgl=e.webgl,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Re(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()};mc.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&r.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&n.invalidateCachedZSortedEles(),e==="viewport"&&n.redrawHint("select",!0),e==="gc"&&n.redrawHint("gc",!0),(e==="load"||e==="resize"||e==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};mc.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}};mc.isHeadless=function(){return!1};[Ow,s_,l_,pc,ts,Rd].forEach(function(e){rt(mc,e)});var k0=1e3/60,u_={setupDequeueing:function(t){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=Cd(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},t.deqRedrawThreshold),l=function(c,d){var v=Yi(),m=a.averageRedrawTime,y=a.lastRedrawTime,x=[],w=a.cy.extent(),S=a.getPixelRatio();for(c||a.flushRenderedStyleQueue();;){var b=Yi(),C=b-v,T=b-d;if(y<k0){var N=k0-(c?m:0);if(T>=t.deqFastCost*N)break}else if(c){if(C>=t.deqCost*y||C>=t.deqAvgCost*m)break}else if(T>=t.deqNoDrawCost*k0)break;var A=t.deq(r,S,w);if(A.length>0)for(var R=0;R<A.length;R++)x.push(A[R]);else break}x.length>0&&(t.onDeqd(r,x),!c&&t.shouldRedraw(r,x,S,w)&&i())},o=t.priority||yw;a.beforeRender(l,o(r))}}}},BZ=(function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rp;yl(this,e),this.idsByKey=new Ui,this.keyForId=new Ui,this.cachesByLvl=new Ui,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return xl(e,[{key:"getIdsFor",value:function(n){n==null&&ln("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new fc,r.set(n,a)),a}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);this.deleteIdForKey(a,r),this.addIdForKey(i,r),this.keyForId.set(r,i)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteIdForKey(a,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);return a!==i}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,a=this.lvls,i=r.get(n);return i||(i=new Ui,r.set(n,i),a.push(n)),i}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var a=this.getKey(n),i=this.getCache(a,r);return i!=null&&this.updateKeyMappingFor(n),i}},{key:"getForCachedKey",value:function(n,r){var a=this.keyForId.get(n.id()),i=this.getCache(a,r);return i}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var a=this.getKey(n);return this.hasCache(a,r)}},{key:"setCache",value:function(n,r,a){a.key=n,this.getCachesAt(r).set(n,a)}},{key:"set",value:function(n,r,a){var i=this.getKey(n);this.setCache(i,r,a),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var a=this.getKey(n);this.deleteCache(a,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(a){return r.deleteCache(n,a)})}},{key:"invalidate",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteKeyMappingFor(n);var i=this.doesEleInvalidateKey(n);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}])})(),FA=25,pv=50,Bv=-4,Xb=3,c_=7.99,PZ=8,zZ=1024,IZ=1024,FZ=1024,qZ=.2,UZ=.8,VZ=10,HZ=.15,GZ=.1,$Z=.9,KZ=.9,YZ=100,XZ=1,Tu={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},QZ=lr({getKey:null,doesEleInvalidateKey:rp,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:JO,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),jf=function(t,n){var r=this;r.renderer=t,r.onDequeues=[];var a=QZ(n);rt(r,a),r.lookup=new BZ(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},qn=jf.prototype;qn.reasons=Tu;qn.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]};qn.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},r=n[e]=n[e]||[];return r};qn.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new Td(function(n,r){return r.reqs-n.reqs});return t};qn.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};qn.getElement=function(e,t,n,r,a){var i=this,l=this.renderer,o=l.cy.zoom(),f=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent())return null;if(r==null&&(r=Math.ceil(bw(o*n))),r<Bv)r=Bv;else if(o>=c_||r>Xb)return null;var c=Math.pow(2,r),d=t.h*c,v=t.w*c,m=l.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,m))return null;var y=f.get(e,r);if(y&&y.invalidated&&(y.invalidated=!1,y.texture.invalidatedWidth-=y.width),y)return y;var x;if(d<=FA?x=FA:d<=pv?x=pv:x=Math.ceil(d/pv)*pv,d>FZ||v>IZ)return null;var w=i.getTextureQueue(x),S=w[w.length-2],b=function(){return i.recycleTexture(x,v)||i.addTexture(x,v)};S||(S=w[w.length-1]),S||(S=b()),S.width-S.usedWidth<v&&(S=b());for(var C=function(B){return B&&B.scaledLabelShown===m},T=a&&a===Tu.dequeue,N=a&&a===Tu.highQuality,A=a&&a===Tu.downscale,R,D=r+1;D<=Xb;D++){var L=f.get(e,D);if(L){R=L;break}}var _=R&&R.level===r+1?R:null,M=function(){S.context.drawImage(_.texture.canvas,_.x,0,_.width,_.height,S.usedWidth,0,v,d)};if(S.context.setTransform(1,0,0,1,0,0),S.context.clearRect(S.usedWidth,0,v,x),C(_))M();else if(C(R))if(N){for(var z=R.level;z>r;z--)_=i.getElement(e,t,n,z,Tu.downscale);M()}else return i.queueElement(e,R.level-1),R;else{var P;if(!T&&!N&&!A)for(var G=r-1;G>=Bv;G--){var I=f.get(e,G);if(I){P=I;break}}if(C(P))return i.queueElement(e,r),P;S.context.translate(S.usedWidth,0),S.context.scale(c,c),this.drawElement(S.context,e,t,m,!1),S.context.scale(1/c,1/c),S.context.translate(-S.usedWidth,0)}return y={x:S.usedWidth,texture:S,level:r,scale:c,width:v,height:d,scaledLabelShown:m},S.usedWidth+=Math.ceil(v+PZ),S.eleCaches.push(y),f.set(e,r,y),i.checkTextureFullness(S),y};qn.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])};qn.invalidateElement=function(e){var t=this,n=t.lookup,r=[],a=n.isInvalid(e);if(a){for(var i=Bv;i<=Xb;i++){var l=n.getForCachedKey(e,i);l&&r.push(l)}var o=n.invalidate(e);if(o)for(var f=0;f<r.length;f++){var c=r[f],d=c.texture;d.invalidatedWidth+=c.width,c.invalidated=!0,t.checkTextureUtility(d)}t.removeFromQueue(e)}};qn.checkTextureUtility=function(e){e.invalidatedWidth>=qZ*e.width&&this.retireTexture(e)};qn.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>UZ&&e.fullnessChecks>=VZ?ul(n,e):e.fullnessChecks++};qn.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),a=this.lookup;ul(r,e),e.retired=!0;for(var i=e.eleCaches,l=0;l<i.length;l++){var o=i[l];a.deleteCache(o.key,o.level)}xw(i);var f=t.getRetiredTextureQueue(n);f.push(e)};qn.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),a={};return r.push(a),a.eleCaches=[],a.height=e,a.width=Math.max(zZ,t),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};qn.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),a=n.getRetiredTextureQueue(e),i=0;i<a.length;i++){var l=a[i];if(l.width>=t)return l.retired=!1,l.usedWidth=0,l.invalidatedWidth=0,l.fullnessChecks=0,xw(l.eleCaches),l.context.setTransform(1,0,0,1,0,0),l.context.clearRect(0,0,l.width,l.height),ul(a,l),r.push(l),l}};qn.queueElement=function(e,t){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(e),l=a[i];if(l)l.level=Math.max(l.level,t),l.eles.merge(e),l.reqs++,r.updateItem(l);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};r.push(o),a[i]=o}};qn.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=[],i=t.lookup,l=0;l<XZ&&n.size()>0;l++){var o=n.pop(),f=o.key,c=o.eles[0],d=i.hasCache(c,o.level);if(r[f]=null,d)continue;a.push(o);var v=t.getBoundingBox(c);t.getElement(c,v,e,o.level,Tu.dequeue)}return a};qn.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=this.getKey(e),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=gw,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(e))};qn.onDequeue=function(e){this.onDequeues.push(e)};qn.offDequeue=function(e){ul(this.onDequeues,e)};qn.setupDequeueing=u_.setupDequeueing({deqRedrawThreshold:YZ,deqCost:HZ,deqAvgCost:GZ,deqNoDrawCost:$Z,deqFastCost:KZ,deq:function(t,n,r){return t.dequeue(n,r)},onDeqd:function(t,n){for(var r=0;r<t.onDequeues.length;r++){var a=t.onDequeues[r];a(n)}},shouldRedraw:function(t,n,r,a){for(var i=0;i<n.length;i++)for(var l=n[i].eles,o=0;o<l.length;o++){var f=l[o].boundingBox();if(Sw(f,a))return!0}return!1},priority:function(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}});var WZ=1,Bf=-4,fp=2,ZZ=3.99,JZ=50,eJ=50,tJ=.15,nJ=.1,rJ=.9,aJ=.9,iJ=1,qA=250,sJ=4e3*4e3,UA=32767,lJ=!0,f_=function(t){var n=this,r=n.renderer=t,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Yi()-2*qA,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=Cd(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},eJ),r.beforeRender(function(l,o){o-n.lastInvalidationTime<=qA?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(o,f){return f.reqs-o.reqs};n.layersQueue=new Td(i),n.setupDequeueing()},or=f_.prototype,VA=0,oJ=Math.pow(2,53)-1;or.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),a=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(r,a),l={id:VA=++VA%oJ,bb:e,level:t,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=l.context,f=-l.bb.x1,c=-l.bb.y1;return o.scale(n,n),o.translate(f,c),l};or.getLayers=function(e,t,n){var r=this,a=r.renderer,i=a.cy,l=i.zoom(),o=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(bw(l*t)),n<Bf)n=Bf;else if(l>=ZZ||n>fp)return null}r.validateLayersElesOrdering(n,e);var f=r.layersByLevel,c=Math.pow(2,n),d=f[n]=f[n]||[],v,m=r.levelIsComplete(n,e),y,x=function(){var M=function(F){if(r.validateLayersElesOrdering(F,e),r.levelIsComplete(F,e))return y=f[F],!0},z=function(F){if(!y)for(var B=n+F;Bf<=B&&B<=fp&&!M(B);B+=F);};z(1),z(-1);for(var P=d.length-1;P>=0;P--){var G=d[P];G.invalid&&ul(d,G)}};if(!m)x();else return d;var w=function(){if(!v){v=kr();for(var M=0;M<e.length;M++)iX(v,e[M].boundingBox())}return v},S=function(M){M=M||{};var z=M.after;w();var P=Math.ceil(v.w*c),G=Math.ceil(v.h*c);if(P>UA||G>UA)return null;var I=P*G;if(I>sJ)return null;var F=r.makeLayer(v,n);if(z!=null){var B=d.indexOf(z)+1;d.splice(B,0,F)}else(M.insert===void 0||M.insert)&&d.unshift(F);return F};if(r.skipping&&!o)return null;for(var b=null,C=e.length/WZ,T=!o,N=0;N<e.length;N++){var A=e[N],R=A._private.rscratch,D=R.imgLayerCaches=R.imgLayerCaches||{},L=D[n];if(L){b=L;continue}if((!b||b.eles.length>=C||!iL(b.bb,A.boundingBox()))&&(b=S({insert:!0,after:b}),!b))return null;y||T?r.queueLayer(b,A):r.drawEleInLayer(b,A,n,t),b.eles.push(A),D[n]=b}return y||(T?null:d)};or.getEleLevelForLayerLevel=function(e,t){return e};or.drawEleInLayer=function(e,t,n,r){var a=this,i=this.renderer,l=e.context,o=t.boundingBox();o.w===0||o.h===0||!t.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(l,!1),i.drawCachedElement(l,t,null,null,n,lJ),i.setImgSmoothing(l,!0))};or.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var l=r[i];if(l.reqs>0||l.invalid)return!1;a+=l.eles.length}return a===t.length};or.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,l=0;l<t.length;l++)if(a.eles[0]===t[l]){i=l;break}if(i<0){this.invalidateLayer(a);continue}for(var o=i,l=0;l<a.eles.length;l++)if(a.eles[l]!==t[o+l]){this.invalidateLayer(a);break}}};or.updateElementsInLayers=function(e,t){for(var n=this,r=bd(e[0]),a=0;a<e.length;a++)for(var i=r?null:e[a],l=r?e[a]:e[a].ele,o=l._private.rscratch,f=o.imgLayerCaches=o.imgLayerCaches||{},c=Bf;c<=fp;c++){var d=f[c];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||t(d,l,i))}};or.haveLayers=function(){for(var e=this,t=!1,n=Bf;n<=fp;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t};or.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=Yi(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(r,a,i){t.invalidateLayer(r)}))};or.invalidateLayer=function(e){if(this.lastInvalidationTime=Yi(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];ul(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}};or.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(r,a,i){var l=r.replacement;if(l||(l=r.replacement=t.makeLayer(r.bb,r.level),l.replaces=r,l.eles=r.eles),!l.reqs)for(var o=0;o<l.eles.length;o++)t.queueLayer(l,l.eles[o])})};or.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()};or.queueLayer=function(e,t){var n=this,r=n.layersQueue,a=e.elesQueue,i=a.hasId=a.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;a.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,r.updateItem(e)):(e.reqs=1,r.push(e))}};or.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],a=0;a<iJ&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var l=i.elesQueue.shift();l&&(t.drawEleInLayer(i,l,i.level,e),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return r};or.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=e;for(var i=0;i<e.eles.length;i++){var l=e.eles[i]._private,o=l.imgLayerCaches=l.imgLayerCaches||{};o&&(o[e.level]=e)}t.requestRedraw()}};or.requestRedraw=Cd(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100);or.setupDequeueing=u_.setupDequeueing({deqRedrawThreshold:JZ,deqCost:tJ,deqAvgCost:nJ,deqNoDrawCost:rJ,deqFastCost:aJ,deq:function(t,n){return t.dequeue(n)},onDeqd:yw,shouldRedraw:JO,priority:function(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}});var d_={},HA;function uJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function cJ(e,t,n){for(var r,a=0;a<t.length;a++){var i=t[a];a===0&&(r=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function GA(e,t,n){e.beginPath&&e.beginPath();for(var r=t,a=0;a<r.length;a++){var i=r[a];e.lineTo(i.x,i.y)}var l=n,o=n[0];e.moveTo(o.x,o.y);for(var a=1;a<l.length;a++){var i=l[a];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function fJ(e,t,n,r,a){e.beginPath&&e.beginPath(),e.arc(n,r,a,0,Math.PI*2,!1);var i=t,l=i[0];e.moveTo(l.x,l.y);for(var o=0;o<i.length;o++){var f=i[o];e.lineTo(f.x,f.y)}e.closePath&&e.closePath()}function dJ(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}d_.arrowShapeImpl=function(e){return(HA||(HA={polygon:uJ,"triangle-backcurve":cJ,"triangle-tee":GA,"circle-triangle":fJ,"triangle-cross":GA,circle:dJ}))[e]};var vi={};vi.drawElement=function(e,t,n,r,a,i){var l=this;t.isNode()?l.drawNode(e,t,n,r,a,i):l.drawEdge(e,t,n,r,a,i)};vi.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)};vi.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)};vi.drawCachedElementPortion=function(e,t,n,r,a,i,l,o){var f=this,c=n.getBoundingBox(t);if(!(c.w===0||c.h===0)){var d=n.getElement(t,c,r,a,i);if(d!=null){var v=o(f,t);if(v===0)return;var m=l(f,t),y=c.x1,x=c.y1,w=c.w,S=c.h,b,C,T,N,A;if(m!==0){var R=n.getRotationPoint(t);T=R.x,N=R.y,e.translate(T,N),e.rotate(m),A=f.getImgSmoothing(e),A||f.setImgSmoothing(e,!0);var D=n.getRotationOffset(t);b=D.x,C=D.y}else b=y,C=x;var L;v!==1&&(L=e.globalAlpha,e.globalAlpha=L*v),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,b,C,w,S),v!==1&&(e.globalAlpha=L),m!==0&&(e.rotate(-m),e.translate(-T,-N),A||f.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var hJ=function(){return 0},vJ=function(t,n){return t.getTextAngle(n,null)},pJ=function(t,n){return t.getTextAngle(n,"source")},mJ=function(t,n){return t.getTextAngle(n,"target")},gJ=function(t,n){return n.effectiveOpacity()},N0=function(t,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};vi.drawCachedElement=function(e,t,n,r,a,i){var l=this,o=l.data,f=o.eleTxrCache,c=o.lblTxrCache,d=o.slbTxrCache,v=o.tlbTxrCache,m=t.boundingBox(),y=i===!0?f.reasons.highQuality:null;if(!(m.w===0||m.h===0||!t.visible())&&(!r||Sw(m,r))){var x=t.isEdge(),w=t.element()._private.rscratch.badLine;l.drawElementUnderlay(e,t),l.drawCachedElementPortion(e,t,f,n,a,y,hJ,gJ),(!x||!w)&&l.drawCachedElementPortion(e,t,c,n,a,y,vJ,N0),x&&!w&&(l.drawCachedElementPortion(e,t,d,n,a,y,pJ,N0),l.drawCachedElementPortion(e,t,v,n,a,y,mJ,N0)),l.drawElementOverlay(e,t)}};vi.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var a=t[r];n.drawElement(e,a)}};vi.drawCachedElements=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var l=t[i];a.drawCachedElement(e,l,n,r)}};vi.drawCachedNodes=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var l=t[i];l.isNode()&&a.drawCachedElement(e,l,n,r)}};vi.drawLayeredElements=function(e,t,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(t,n);if(i)for(var l=0;l<i.length;l++){var o=i[l],f=o.bb;f.w===0||f.h===0||e.drawImage(o.canvas,f.x1,f.y1,f.w,f.h)}else a.drawCachedElements(e,t,n,r)};var ns={};ns.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this,o=t._private.rscratch;if(!(i&&!t.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var f;n&&(f=n,e.translate(-f.x1,-f.y1));var c=i?t.pstyle("opacity").value:1,d=i?t.pstyle("line-opacity").value:1,v=t.pstyle("curve-style").value,m=t.pstyle("line-style").value,y=t.pstyle("width").pfValue,x=t.pstyle("line-cap").value,w=t.pstyle("line-outline-width").value,S=t.pstyle("line-outline-color").value,b=c*d,C=c*d,T=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;v==="straight-triangle"?(l.eleStrokeStyle(e,t,F),l.drawEdgeTrianglePath(t,e,o.allpts)):(e.lineWidth=y,e.lineCap=x,l.eleStrokeStyle(e,t,F),l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},N=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;if(e.lineWidth=y+w,e.lineCap=x,w>0)l.colorStrokeStyle(e,S[0],S[1],S[2],F);else{e.lineCap="butt";return}v==="straight-triangle"?l.drawEdgeTrianglePath(t,e,o.allpts):(l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},A=function(){a&&l.drawEdgeOverlay(e,t)},R=function(){a&&l.drawEdgeUnderlay(e,t)},D=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C;l.drawArrowheads(e,t,F)},L=function(){l.drawElementText(e,t,null,r)};e.lineJoin="round";var _=t.pstyle("ghost").value==="yes";if(_){var M=t.pstyle("ghost-offset-x").pfValue,z=t.pstyle("ghost-offset-y").pfValue,P=t.pstyle("ghost-opacity").value,G=b*P;e.translate(M,z),T(G),D(G),e.translate(-M,-z)}else N();R(),T(),D(),A(),L(),n&&e.translate(f.x1,f.y1)}};var h_=function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(n,r){if(r.visible()){var a=r.pstyle("".concat(t,"-opacity")).value;if(a!==0){var i=this,l=i.usePaths(),o=r._private.rscratch,f=r.pstyle("".concat(t,"-padding")).pfValue,c=2*f,d=r.pstyle("".concat(t,"-color")).value;n.lineWidth=c,o.edgeType==="self"&&!l?n.lineCap="butt":n.lineCap="round",i.colorStrokeStyle(n,d[0],d[1],d[2],a),i.drawEdgePath(r,n,o.allpts,"solid")}}}};ns.drawEdgeOverlay=h_("overlay");ns.drawEdgeUnderlay=h_("underlay");ns.drawEdgePath=function(e,t,n,r){var a=e._private.rscratch,i=t,l,o=!1,f=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,d=e.pstyle("line-dash-offset").pfValue;if(f){var v=n.join("$"),m=a.pathCacheKey&&a.pathCacheKey===v;m?(l=t=a.pathCache,o=!0):(l=t=new Path2D,a.pathCacheKey=v,a.pathCache=l)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(c),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!o&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var y=2;y+3<n.length;y+=4)t.quadraticCurveTo(n[y],n[y+1],n[y+2],n[y+3]);break;case"straight":case"haystack":for(var x=2;x+1<n.length;x+=2)t.lineTo(n[x],n[x+1]);break;case"segments":if(a.isRound){var w=qr(a.roundCorners),S;try{for(w.s();!(S=w.n()).done;){var b=S.value;t_(t,b)}}catch(T){w.e(T)}finally{w.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var C=2;C+1<n.length;C+=2)t.lineTo(n[C],n[C+1]);break}t=i,f?t.stroke(l):t.stroke(),t.setLineDash&&t.setLineDash([])};ns.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/l,-i[0]/l],f=[o[0]*r/2,o[1]*r/2];t.beginPath(),t.moveTo(n[a]-f[0],n[a+1]-f[1]),t.lineTo(n[a]+f[0],n[a+1]+f[1]),t.lineTo(n[a+2],n[a+3]),t.closePath(),t.fill()}};ns.drawArrowheads=function(e,t,n){var r=t._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)};ns.drawArrowhead=function(e,t,n,r,a,i,l){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var o=this,f=t.pstyle(n+"-arrow-shape").value;if(f!=="none"){var c=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=t.pstyle(n+"-arrow-fill").value,v=t.pstyle("width").pfValue,m=t.pstyle(n+"-arrow-width"),y=m.value==="match-line"?v:m.pfValue;m.units==="%"&&(y*=v);var x=t.pstyle("opacity").value;l===void 0&&(l=x);var w=e.globalCompositeOperation;(l!==1||d==="hollow")&&(e.globalCompositeOperation="destination-out",o.colorFillStyle(e,255,255,255,1),o.colorStrokeStyle(e,255,255,255,1),o.drawArrowShape(t,e,c,v,f,y,r,a,i),e.globalCompositeOperation=w);var S=t.pstyle(n+"-arrow-color").value;o.colorFillStyle(e,S[0],S[1],S[2],l),o.colorStrokeStyle(e,S[0],S[1],S[2],l),o.drawArrowShape(t,e,d,v,f,y,r,a,i)}}};ns.drawArrowShape=function(e,t,n,r,a,i,l,o,f){var c=this,d=this.usePaths()&&a!=="triangle-cross",v=!1,m,y=t,x={x:l,y:o},w=e.pstyle("arrow-scale").value,S=this.getArrowWidth(r,w),b=c.arrowShapes[a];if(d){var C=c.arrowPathCache=c.arrowPathCache||[],T=mo(a),N=C[T];N!=null?(m=t=N,v=!0):(m=t=new Path2D,C[T]=m)}v||(t.beginPath&&t.beginPath(),d?b.draw(t,1,0,{x:0,y:0},1):b.draw(t,S,f,x,r),t.closePath&&t.closePath()),t=y,d&&(t.translate(l,o),t.rotate(f),t.scale(S,S)),(n==="filled"||n==="both")&&(d?t.fill(m):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(d?S:1),t.lineJoin="miter",d?t.stroke(m):t.stroke()),d&&(t.scale(1/S,1/S),t.rotate(-f),t.translate(-l,-o))};var Bw={};Bw.safeDrawImage=function(e,t,n,r,a,i,l,o,f,c){if(!(a<=0||i<=0||f<=0||c<=0))try{e.drawImage(t,n,r,a,i,l,o,f,c)}catch(d){Bt(d)}};Bw.drawInscribedImage=function(e,t,n,r,a){var i=this,l=n.position(),o=l.x,f=l.y,c=n.cy().style(),d=c.getIndexedStyle.bind(c),v=d(n,"background-fit","value",r),m=d(n,"background-repeat","value",r),y=n.width(),x=n.height(),w=n.padding()*2,S=y+(d(n,"background-width-relative-to","value",r)==="inner"?0:w),b=x+(d(n,"background-height-relative-to","value",r)==="inner"?0:w),C=n._private.rscratch,T=d(n,"background-clip","value",r),N=T==="node",A=d(n,"background-image-opacity","value",r)*a,R=d(n,"background-image-smoothing","value",r),D=n.pstyle("corner-radius").value;D!=="auto"&&(D=n.pstyle("corner-radius").pfValue);var L=t.width||t.cachedW,_=t.height||t.cachedH;(L==null||_==null)&&(document.body.appendChild(t),L=t.cachedW=t.width||t.offsetWidth,_=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var M=L,z=_;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?M=d(n,"background-width","pfValue",r)*S:M=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?z=d(n,"background-height","pfValue",r)*b:z=d(n,"background-height","pfValue",r)),!(M===0||z===0)){if(v==="contain"){var P=Math.min(S/M,b/z);M*=P,z*=P}else if(v==="cover"){var P=Math.max(S/M,b/z);M*=P,z*=P}var G=o-S/2,I=d(n,"background-position-x","units",r),F=d(n,"background-position-x","pfValue",r);I==="%"?G+=(S-M)*F:G+=F;var B=d(n,"background-offset-x","units",r),H=d(n,"background-offset-x","pfValue",r);B==="%"?G+=(S-M)*H:G+=H;var Y=f-b/2,Q=d(n,"background-position-y","units",r),V=d(n,"background-position-y","pfValue",r);Q==="%"?Y+=(b-z)*V:Y+=V;var q=d(n,"background-offset-y","units",r),X=d(n,"background-offset-y","pfValue",r);q==="%"?Y+=(b-z)*X:Y+=X,C.pathCache&&(G-=o,Y-=f,o=0,f=0);var U=e.globalAlpha;e.globalAlpha=A;var te=i.getImgSmoothing(e),ie=!1;if(R==="no"&&te?(i.setImgSmoothing(e,!1),ie=!0):R==="yes"&&!te&&(i.setImgSmoothing(e,!0),ie=!0),m==="no-repeat")N&&(e.save(),C.pathCache?e.clip(C.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,S,b,D,C),e.clip())),i.safeDrawImage(e,t,0,0,L,_,G,Y,M,z),N&&e.restore();else{var oe=e.createPattern(t,m);e.fillStyle=oe,i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,S,b,D,C),e.translate(G,Y),e.fill(),e.translate(-G,-Y)}e.globalAlpha=U,ie&&i.setImgSmoothing(e,te)}};var Co={};Co.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(bw(n*r));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t,l=e.pstyle("min-zoomed-font-size").pfValue;return!(i<l)};Co.drawElementText=function(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this;if(r==null){if(i&&!l.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var o=t.pstyle("label");if(!o||!o.value)return;var f=l.getLabelJustification(t);e.textAlign=f,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,d=t.pstyle("label"),v=t.pstyle("source-label"),m=t.pstyle("target-label");if(c||(!d||!d.value)&&(!v||!v.value)&&(!m||!m.value))return;e.textAlign="center",e.textBaseline="bottom"}var y=!n,x;n&&(x=n,e.translate(-x.x1,-x.y1)),a==null?(l.drawText(e,t,null,y,i),t.isEdge()&&(l.drawText(e,t,"source",y,i),l.drawText(e,t,"target",y,i))):l.drawText(e,t,a,y,i),n&&e.translate(x.x1,x.y1)};Co.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t};Co.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle("font-style").strValue,a=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,l=t.pstyle("font-weight").strValue,o=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,f=t.pstyle("text-outline-opacity").value*o,c=t.pstyle("color").value,d=t.pstyle("text-outline-color").value;e.font=r+" "+l+" "+a+" "+i,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],o),this.colorStrokeStyle(e,d[0],d[1],d[2],f)};function yJ(e,t,n,r,a){var i=Math.min(r,a),l=i/2,o=t+r/2,f=n+a/2;e.beginPath(),e.arc(o,f,l,0,Math.PI*2),e.closePath()}function $A(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,l=Math.min(i,r/2,a/2);e.beginPath(),e.moveTo(t+l,n),e.lineTo(t+r-l,n),e.quadraticCurveTo(t+r,n,t+r,n+l),e.lineTo(t+r,n+a-l),e.quadraticCurveTo(t+r,n+a,t+r-l,n+a),e.lineTo(t+l,n+a),e.quadraticCurveTo(t,n+a,t,n+a-l),e.lineTo(t,n+l),e.quadraticCurveTo(t,n,t+l,n),e.closePath()}Co.getTextAngle=function(e,t){var n,r=e._private,a=r.rscratch,i=t?t+"-":"",l=e.pstyle(i+"text-rotation");if(l.strValue==="autorotate"){var o=Ir(a,"labelAngle",t);n=e.isEdge()?o:0}else l.strValue==="none"?n=0:n=l.pfValue;return n};Co.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,l=i.rscratch,o=a?t.effectiveOpacity():1;if(!(a&&(o===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var f=Ir(l,"labelX",n),c=Ir(l,"labelY",n),d,v,m=this.getLabelText(t,n);if(m!=null&&m!==""&&!isNaN(f)&&!isNaN(c)){this.setupTextStyle(e,t,a);var y=n?n+"-":"",x=Ir(l,"labelWidth",n),w=Ir(l,"labelHeight",n),S=t.pstyle(y+"text-margin-x").pfValue,b=t.pstyle(y+"text-margin-y").pfValue,C=t.isEdge(),T=t.pstyle("text-halign").value,N=t.pstyle("text-valign").value;C&&(T="center",N="center"),f+=S,c+=b;var A;switch(r?A=this.getTextAngle(t,n):A=0,A!==0&&(d=f,v=c,e.translate(d,v),e.rotate(A),f=0,c=0),N){case"top":break;case"center":c+=w/2;break;case"bottom":c+=w;break}var R=t.pstyle("text-background-opacity").value,D=t.pstyle("text-border-opacity").value,L=t.pstyle("text-border-width").pfValue,_=t.pstyle("text-background-padding").pfValue,M=t.pstyle("text-background-shape").strValue,z=M==="round-rectangle"||M==="roundrectangle",P=M==="circle",G=2;if(R>0||L>0&&D>0){var I=e.fillStyle,F=e.strokeStyle,B=e.lineWidth,H=t.pstyle("text-background-color").value,Y=t.pstyle("text-border-color").value,Q=t.pstyle("text-border-style").value,V=R>0,q=L>0&&D>0,X=f-_;switch(T){case"left":X-=x;break;case"center":X-=x/2;break}var U=c-w-_,te=x+2*_,ie=w+2*_;if(V&&(e.fillStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[2],",").concat(R*o,")")),q&&(e.strokeStyle="rgba(".concat(Y[0],",").concat(Y[1],",").concat(Y[2],",").concat(D*o,")"),e.lineWidth=L,e.setLineDash))switch(Q){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=L/4,e.setLineDash([]);break;case"solid":default:e.setLineDash([]);break}if(z?(e.beginPath(),$A(e,X,U,te,ie,G)):P?(e.beginPath(),yJ(e,X,U,te,ie)):(e.beginPath(),e.rect(X,U,te,ie)),V&&e.fill(),q&&e.stroke(),q&&Q==="double"){var oe=L/2;e.beginPath(),z?$A(e,X+oe,U+oe,te-2*oe,ie-2*oe,G):e.rect(X+oe,U+oe,te-2*oe,ie-2*oe),e.stroke()}e.fillStyle=I,e.strokeStyle=F,e.lineWidth=B,e.setLineDash&&e.setLineDash([])}var ae=2*t.pstyle("text-outline-width").pfValue;if(ae>0&&(e.lineWidth=ae),t.pstyle("text-wrap").value==="wrap"){var we=Ir(l,"labelWrapCachedLines",n),fe=Ir(l,"labelLineHeight",n),J=x/2,ne=this.getLabelJustification(t);switch(ne==="auto"||(T==="left"?ne==="left"?f+=-x:ne==="center"&&(f+=-J):T==="center"?ne==="left"?f+=-J:ne==="right"&&(f+=J):T==="right"&&(ne==="center"?f+=J:ne==="right"&&(f+=x))),N){case"top":c-=(we.length-1)*fe;break;case"center":case"bottom":c-=(we.length-1)*fe;break}for(var re=0;re<we.length;re++)ae>0&&e.strokeText(we[re],f,c),e.fillText(we[re],f,c),c+=fe}else ae>0&&e.strokeText(m,f,c),e.fillText(m,f,c);A!==0&&(e.rotate(-A),e.translate(-d,-v))}}};var wl={};wl.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this,o,f,c=t._private,d=c.rscratch,v=t.position();if(!(!Re(v.x)||!Re(v.y))&&!(i&&!t.visible())){var m=i?t.effectiveOpacity():1,y=l.usePaths(),x,w=!1,S=t.padding();o=t.width()+2*S,f=t.height()+2*S;var b;n&&(b=n,e.translate(-b.x1,-b.y1));for(var C=t.pstyle("background-image"),T=C.value,N=new Array(T.length),A=new Array(T.length),R=0,D=0;D<T.length;D++){var L=T[D],_=N[D]=L!=null&&L!=="none";if(_){var M=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",D);R++,A[D]=l.getCachedImage(L,M,function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var z=t.pstyle("background-blacken").value,P=t.pstyle("border-width").pfValue,G=t.pstyle("background-opacity").value*m,I=t.pstyle("border-color").value,F=t.pstyle("border-style").value,B=t.pstyle("border-join").value,H=t.pstyle("border-cap").value,Y=t.pstyle("border-position").value,Q=t.pstyle("border-dash-pattern").pfValue,V=t.pstyle("border-dash-offset").pfValue,q=t.pstyle("border-opacity").value*m,X=t.pstyle("outline-width").pfValue,U=t.pstyle("outline-color").value,te=t.pstyle("outline-style").value,ie=t.pstyle("outline-opacity").value*m,oe=t.pstyle("outline-offset").value,ae=t.pstyle("corner-radius").value;ae!=="auto"&&(ae=t.pstyle("corner-radius").pfValue);var we=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;l.eleFillStyle(e,t,Oe)},fe=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;l.colorStrokeStyle(e,I[0],I[1],I[2],Oe)},J=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ie;l.colorStrokeStyle(e,U[0],U[1],U[2],Oe)},ne=function(Oe,ye,K,le){var pe=l.nodePathCache=l.nodePathCache||[],de=ZO(K==="polygon"?K+","+le.join(","):K,""+ye,""+Oe,""+ae),xe=pe[de],Le,Te=!1;return xe!=null?(Le=xe,Te=!0,d.pathCache=Le):(Le=new Path2D,pe[de]=d.pathCache=Le),{path:Le,cacheHit:Te}},re=t.pstyle("shape").strValue,ge=t.pstyle("shape-polygon-points").pfValue;if(y){e.translate(v.x,v.y);var ke=ne(o,f,re,ge);x=ke.path,w=ke.cacheHit}var Be=function(){if(!w){var Oe=v;y&&(Oe={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(x||e,Oe.x,Oe.y,o,f,ae,d)}y?e.fill(x):e.fill()},lt=function(){for(var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=c.backgrounding,le=0,pe=0;pe<A.length;pe++){var de=t.cy().style().getIndexedStyle(t,"background-image-containment","value",pe);if(ye&&de==="over"||!ye&&de==="inside"){le++;continue}N[pe]&&A[pe].complete&&!A[pe].error&&(le++,l.drawInscribedImage(e,A[pe],t,pe,Oe))}c.backgrounding=le!==R,K!==c.backgrounding&&t.updateStyle(!1)},Ze=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;l.hasPie(t)&&(l.drawPie(e,t,ye),Oe&&(y||l.nodeShapes[l.getNodeShape(t)].draw(e,v.x,v.y,o,f,ae,d)))},Qe=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;l.hasStripe(t)&&(e.save(),y?e.clip(d.pathCache):(l.nodeShapes[l.getNodeShape(t)].draw(e,v.x,v.y,o,f,ae,d),e.clip()),l.drawStripe(e,t,ye),e.restore(),Oe&&(y||l.nodeShapes[l.getNodeShape(t)].draw(e,v.x,v.y,o,f,ae,d)))},qe=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,ye=(z>0?z:-z)*Oe,K=z>0?0:255;z!==0&&(l.colorFillStyle(e,K,K,K,ye),y?e.fill(x):e.fill())},je=function(){if(P>0){if(e.lineWidth=P,e.lineCap=H,e.lineJoin=B,e.setLineDash)switch(F){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(Q),e.lineDashOffset=V;break;case"solid":case"double":e.setLineDash([]);break}if(Y!=="center"){if(e.save(),e.lineWidth*=2,Y==="inside")y?e.clip(x):e.clip();else{var Oe=new Path2D;Oe.rect(-o/2-P,-f/2-P,o+2*P,f+2*P),Oe.addPath(x),e.clip(Oe,"evenodd")}y?e.stroke(x):e.stroke(),e.restore()}else y?e.stroke(x):e.stroke();if(F==="double"){e.lineWidth=P/3;var ye=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(x):e.stroke(),e.globalCompositeOperation=ye}e.setLineDash&&e.setLineDash([])}},Ge=function(){if(X>0){if(e.lineWidth=X,e.lineCap="butt",e.setLineDash)switch(te){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var Oe=v;y&&(Oe={x:0,y:0});var ye=l.getNodeShape(t),K=P;Y==="inside"&&(K=0),Y==="outside"&&(K*=2);var le=(o+K+(X+oe))/o,pe=(f+K+(X+oe))/f,de=o*le,xe=f*pe,Le=l.nodeShapes[ye].points,Te;if(y){var He=ne(de,xe,ye,Le);Te=He.path}if(ye==="ellipse")l.drawEllipsePath(Te||e,Oe.x,Oe.y,de,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ye)){var Ie=0,We=0,ot=0;ye==="round-diamond"?Ie=(K+oe+X)*1.4:ye==="round-heptagon"?(Ie=(K+oe+X)*1.075,ot=-(K/2+oe+X)/35):ye==="round-hexagon"?Ie=(K+oe+X)*1.12:ye==="round-pentagon"?(Ie=(K+oe+X)*1.13,ot=-(K/2+oe+X)/15):ye==="round-tag"?(Ie=(K+oe+X)*1.12,We=(K/2+X+oe)*.07):ye==="round-triangle"&&(Ie=(K+oe+X)*(Math.PI/2),ot=-(K+oe/2+X)/Math.PI),Ie!==0&&(le=(o+Ie)/o,de=o*le,["round-hexagon","round-tag"].includes(ye)||(pe=(f+Ie)/f,xe=f*pe)),ae=ae==="auto"?oL(de,xe):ae;for(var ut=de/2,Ue=xe/2,yt=ae+(K+X+oe)/2,ht=new Array(Le.length/2),on=new Array(Le.length/2),Ft=0;Ft<Le.length/2;Ft++)ht[Ft]={x:Oe.x+We+ut*Le[Ft*2],y:Oe.y+ot+Ue*Le[Ft*2+1]};var Jn,un,bn,vn,wn=ht.length;for(un=ht[wn-1],Jn=0;Jn<wn;Jn++)bn=ht[Jn%wn],vn=ht[(Jn+1)%wn],on[Jn]=Lw(un,bn,vn,yt),un=bn,bn=vn;l.drawRoundPolygonPath(Te||e,Oe.x+We,Oe.y+ot,o*le,f*pe,Le,on)}else if(["roundrectangle","round-rectangle"].includes(ye))ae=ae==="auto"?cl(de,xe):ae,l.drawRoundRectanglePath(Te||e,Oe.x,Oe.y,de,xe,ae+(K+X+oe)/2);else if(["cutrectangle","cut-rectangle"].includes(ye))ae=ae==="auto"?Ew():ae,l.drawCutRectanglePath(Te||e,Oe.x,Oe.y,de,xe,null,ae+(K+X+oe)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ye))ae=ae==="auto"?cl(de,xe):ae,l.drawBottomRoundRectanglePath(Te||e,Oe.x,Oe.y,de,xe,ae+(K+X+oe)/2);else if(ye==="barrel")l.drawBarrelPath(Te||e,Oe.x,Oe.y,de,xe);else if(ye.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ye)){var aa=(K+X+oe)/o;Le=ap(ip(Le,aa)),l.drawPolygonPath(Te||e,Oe.x,Oe.y,o,f,Le)}else{var cn=(K+X+oe)/o;Le=ap(ip(Le,-cn)),l.drawPolygonPath(Te||e,Oe.x,Oe.y,o,f,Le)}if(y?e.stroke(Te):e.stroke(),te==="double"){e.lineWidth=K/3;var ia=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(Te):e.stroke(),e.globalCompositeOperation=ia}e.setLineDash&&e.setLineDash([])}},Xe=function(){a&&l.drawNodeOverlay(e,t,v,o,f)},it=function(){a&&l.drawNodeUnderlay(e,t,v,o,f)},Pe=function(){l.drawElementText(e,t,null,r)},ft=t.pstyle("ghost").value==="yes";if(ft){var he=t.pstyle("ghost-offset-x").pfValue,Ce=t.pstyle("ghost-offset-y").pfValue,De=t.pstyle("ghost-opacity").value,ze=De*m;e.translate(he,Ce),J(),Ge(),we(De*G),Be(),lt(ze,!0),fe(De*q),je(),Ze(z!==0||P!==0),Qe(z!==0||P!==0),lt(ze,!1),qe(ze),e.translate(-he,-Ce)}y&&e.translate(-v.x,-v.y),it(),y&&e.translate(v.x,v.y),J(),Ge(),we(),Be(),lt(m,!0),fe(),je(),Ze(z!==0||P!==0),Qe(z!==0||P!==0),lt(m,!1),qe(),y&&e.translate(-v.x,-v.y),Pe(),Xe(),n&&e.translate(b.x1,b.y1)}};var v_=function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(n,r,a,i,l){var o=this;if(r.visible()){var f=r.pstyle("".concat(t,"-padding")).pfValue,c=r.pstyle("".concat(t,"-opacity")).value,d=r.pstyle("".concat(t,"-color")).value,v=r.pstyle("".concat(t,"-shape")).value,m=r.pstyle("".concat(t,"-corner-radius")).value;if(c>0){if(a=a||r.position(),i==null||l==null){var y=r.padding();i=r.width()+2*y,l=r.height()+2*y}o.colorFillStyle(n,d[0],d[1],d[2],c),o.nodeShapes[v].draw(n,a.x,a.y,i+f*2,l+f*2,m),n.fill()}}}};wl.drawNodeOverlay=v_("overlay");wl.drawNodeUnderlay=v_("underlay");wl.hasPie=function(e){return e=e[0],e._private.hasPie};wl.hasStripe=function(e){return e=e[0],e._private.hasStripe};wl.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),i=t.pstyle("pie-size"),l=t.pstyle("pie-hole"),o=t.pstyle("pie-start-angle").pfValue,f=r.x,c=r.y,d=t.width(),v=t.height(),m=Math.min(d,v)/2,y,x=0,w=this.usePaths();if(w&&(f=0,c=0),i.units==="%"?m=m*i.pfValue:i.pfValue!==void 0&&(m=i.pfValue/2),l.units==="%"?y=m*l.pfValue:l.pfValue!==void 0&&(y=l.pfValue/2),!(y>=m))for(var S=1;S<=a.pieBackgroundN;S++){var b=t.pstyle("pie-"+S+"-background-size").value,C=t.pstyle("pie-"+S+"-background-color").value,T=t.pstyle("pie-"+S+"-background-opacity").value*n,N=b/100;N+x>1&&(N=1-x);var A=1.5*Math.PI+2*Math.PI*x;A+=o;var R=2*Math.PI*N,D=A+R;b===0||x>=1||x+N>1||(y===0?(e.beginPath(),e.moveTo(f,c),e.arc(f,c,m,A,D),e.closePath()):(e.beginPath(),e.arc(f,c,m,A,D),e.arc(f,c,y,D,A,!0),e.closePath()),this.colorFillStyle(e,C[0],C[1],C[2],T),e.fill(),x+=N)}};wl.drawStripe=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),i=r.x,l=r.y,o=t.width(),f=t.height(),c=0,d=this.usePaths();e.save();var v=t.pstyle("stripe-direction").value,m=t.pstyle("stripe-size");switch(v){case"vertical":break;case"righward":e.rotate(-Math.PI/2);break}var y=o,x=f;m.units==="%"?(y=y*m.pfValue,x=x*m.pfValue):m.pfValue!==void 0&&(y=m.pfValue,x=m.pfValue),d&&(i=0,l=0),l-=y/2,i-=x/2;for(var w=1;w<=a.stripeBackgroundN;w++){var S=t.pstyle("stripe-"+w+"-background-size").value,b=t.pstyle("stripe-"+w+"-background-color").value,C=t.pstyle("stripe-"+w+"-background-opacity").value*n,T=S/100;T+c>1&&(T=1-c),!(S===0||c>=1||c+T>1)&&(e.beginPath(),e.rect(i,l+x*c,y,x*T),e.closePath(),this.colorFillStyle(e,b[0],b[1],b[2],C),e.fill(),c+=T)}e.restore()};var Nr={},xJ=100;Nr.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n};Nr.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<t.length;a++)if(r=t[a],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r};Nr.createGradientStyleFor=function(e,t,n,r,a){var i,l=this.usePaths(),o=n.pstyle(t+"-gradient-stop-colors").value,f=n.pstyle(t+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),d=n.targetEndpoint(),v=n.midpoint(),m=go(c,v),y=go(d,v);i=e.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(m,y))}else{var x=l?{x:0,y:0}:n.position(),w=n.paddedWidth(),S=n.paddedHeight();i=e.createRadialGradient(x.x,x.y,0,x.x,x.y,Math.max(w,S))}else if(n.isEdge()){var b=n.sourceEndpoint(),C=n.targetEndpoint();i=e.createLinearGradient(b.x,b.y,C.x,C.y)}else{var T=l?{x:0,y:0}:n.position(),N=n.paddedWidth(),A=n.paddedHeight(),R=N/2,D=A/2,L=n.pstyle("background-gradient-direction").value;switch(L){case"to-bottom":i=e.createLinearGradient(T.x,T.y-D,T.x,T.y+D);break;case"to-top":i=e.createLinearGradient(T.x,T.y+D,T.x,T.y-D);break;case"to-left":i=e.createLinearGradient(T.x+R,T.y,T.x-R,T.y);break;case"to-right":i=e.createLinearGradient(T.x-R,T.y,T.x+R,T.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(T.x-R,T.y-D,T.x+R,T.y+D);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(T.x-R,T.y+D,T.x+R,T.y-D);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(T.x+R,T.y-D,T.x-R,T.y+D);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(T.x+R,T.y+D,T.x-R,T.y-D);break}}if(!i)return null;for(var _=f.length===o.length,M=o.length,z=0;z<M;z++)i.addColorStop(_?f[z]:z/(M-1),"rgba("+o[z][0]+","+o[z][1]+","+o[z][2]+","+a+")");return i};Nr.gradientFillStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"background",t,n,r);if(!a)return null;e.fillStyle=a};Nr.colorFillStyle=function(e,t,n,r,a){e.fillStyle="rgba("+t+","+n+","+r+","+a+")"};Nr.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(e,t,r,n);else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],n)}};Nr.gradientStrokeStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"line",t,n,r);if(!a)return null;e.strokeStyle=a};Nr.colorStrokeStyle=function(e,t,n,r,a){e.strokeStyle="rgba("+t+","+n+","+r+","+a+")"};Nr.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(e,t,r,n);else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],n)}};Nr.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),a=r[2],i=r[3],l=t.getPixelRatio(),o=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(l=o);var f=a*l,c=i*l,d;if(!(f===t.canvasWidth&&c===t.canvasHeight)){t.fontCaches=null;var v=n.canvasContainer;v.style.width=a+"px",v.style.height=i+"px";for(var m=0;m<t.CANVAS_LAYERS;m++)d=n.canvases[m],d.width=f,d.height=c,d.style.width=a+"px",d.style.height=i+"px";for(var m=0;m<t.BUFFER_COUNT;m++)d=n.bufferCanvases[m],d.width=f,d.height=c,d.style.width=a+"px",d.style.height=i+"px";t.textureMult=1,l<=1&&(d=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,d.width=f*t.textureMult,d.height=c*t.textureMult),t.canvasWidth=f,t.canvasHeight=c,t.pixelRatio=l}};Nr.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})};Nr.clearCanvas=function(){var e=this,t=e.data;function n(r){r.clearRect(0,0,e.canvasWidth,e.canvasHeight)}n(t.contexts[e.NODE]),n(t.contexts[e.DRAG])};Nr.render=function(e){var t=this;e=e||nL();var n=t.cy,r=e.forcedContext,a=e.drawAllLayers,i=e.drawOnlyNodeLayer,l=e.forcedZoom,o=e.forcedPan,f=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,c=t.data,d=c.canvasNeedsRedraw,v=t.textureOnViewport&&!r&&(t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming),m=e.motionBlur!==void 0?e.motionBlur:t.motionBlur,y=t.motionBlurPxRatio,x=n.hasCompoundNodes(),w=t.hoverData.draggingEles,S=!!(t.hoverData.selecting||t.touchData.selecting);m=m&&!r&&t.motionBlurEnabled&&!S;var b=m;r||(t.prevPxRatio!==f&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container),t.redrawHint("eles",!0),t.redrawHint("drag",!0)),t.prevPxRatio=f),!r&&t.motionBlurTimeout&&clearTimeout(t.motionBlurTimeout),m&&(t.mbFrames==null&&(t.mbFrames=0),t.mbFrames++,t.mbFrames<3&&(b=!1),t.mbFrames>t.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!v&&(d[t.NODE]=!0,d[t.SELECT_BOX]=!0);var C=n.style(),T=n.zoom(),N=l!==void 0?l:T,A=n.pan(),R={x:A.x,y:A.y},D={zoom:T,pan:{x:A.x,y:A.y}},L=t.prevViewport,_=L===void 0||D.zoom!==L.zoom||D.pan.x!==L.pan.x||D.pan.y!==L.pan.y;!_&&!(w&&!x)&&(t.motionBlurPxRatio=1),o&&(R=o),N*=f,R.x*=f,R.y*=f;var M=t.getCachedZSortedEles();function z(fe,J,ne,re,ge){var ke=fe.globalCompositeOperation;fe.globalCompositeOperation="destination-out",t.colorFillStyle(fe,255,255,255,t.motionBlurTransparency),fe.fillRect(J,ne,re,ge),fe.globalCompositeOperation=ke}function P(fe,J){var ne,re,ge,ke;!t.clearingMotionBlur&&(fe===c.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||fe===c.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(ne={x:A.x*y,y:A.y*y},re=T*y,ge=t.canvasWidth*y,ke=t.canvasHeight*y):(ne=R,re=N,ge=t.canvasWidth,ke=t.canvasHeight),fe.setTransform(1,0,0,1,0,0),J==="motionBlur"?z(fe,0,0,ge,ke):!r&&(J===void 0||J)&&fe.clearRect(0,0,ge,ke),a||(fe.translate(ne.x,ne.y),fe.scale(re,re)),o&&fe.translate(o.x,o.y),l&&fe.scale(l,l)}if(v||(t.textureDrawLastFrame=!1),v){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var G=t.data.bufferContexts[t.TEXTURE_BUFFER];G.setTransform(1,0,0,1,0,0),G.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:G,drawOnlyNodeLayer:!0,forcedPxRatio:f*t.textureMult});var D=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight};D.mpan={x:(0-D.pan.x)/D.zoom,y:(0-D.pan.y)/D.zoom}}d[t.DRAG]=!1,d[t.NODE]=!1;var I=c.contexts[t.NODE],F=t.textureCache.texture,D=t.textureCache.viewport;I.setTransform(1,0,0,1,0,0),m?z(I,0,0,D.width,D.height):I.clearRect(0,0,D.width,D.height);var B=C.core("outside-texture-bg-color").value,H=C.core("outside-texture-bg-opacity").value;t.colorFillStyle(I,B[0],B[1],B[2],H),I.fillRect(0,0,D.width,D.height);var T=n.zoom();P(I,!1),I.clearRect(D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f),I.drawImage(F,D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f)}else t.textureOnViewport&&!r&&(t.textureCache=null);var Y=n.extent(),Q=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),V=t.hideEdgesOnViewport&&Q,q=[];if(q[t.NODE]=!d[t.NODE]&&m&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,q[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),q[t.DRAG]=!d[t.DRAG]&&m&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,q[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),d[t.NODE]||a||i||q[t.NODE]){var X=m&&!q[t.NODE]&&y!==1,I=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:c.contexts[t.NODE]),U=m&&!X?"motionBlur":void 0;P(I,U),V?t.drawCachedNodes(I,M.nondrag,f,Y):t.drawLayeredElements(I,M.nondrag,f,Y),t.debug&&t.drawDebugPoints(I,M.nondrag),!a&&!m&&(d[t.NODE]=!1)}if(!i&&(d[t.DRAG]||a||q[t.DRAG])){var X=m&&!q[t.DRAG]&&y!==1,I=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:c.contexts[t.DRAG]);P(I,m&&!X?"motionBlur":void 0),V?t.drawCachedNodes(I,M.drag,f,Y):t.drawCachedElements(I,M.drag,f,Y),t.debug&&t.drawDebugPoints(I,M.drag),!a&&!m&&(d[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,P),m&&y!==1){var te=c.contexts[t.NODE],ie=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],oe=c.contexts[t.DRAG],ae=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],we=function(J,ne,re){J.setTransform(1,0,0,1,0,0),re||!b?J.clearRect(0,0,t.canvasWidth,t.canvasHeight):z(J,0,0,t.canvasWidth,t.canvasHeight);var ge=y;J.drawImage(ne,0,0,t.canvasWidth*ge,t.canvasHeight*ge,0,0,t.canvasWidth,t.canvasHeight)};(d[t.NODE]||q[t.NODE])&&(we(te,ie,q[t.NODE]),d[t.NODE]=!1),(d[t.DRAG]||q[t.DRAG])&&(we(oe,ae,q[t.DRAG]),d[t.DRAG]=!1)}t.prevViewport=D,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),m&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!v,t.mbFrames=0,d[t.NODE]=!0,d[t.DRAG]=!0,t.redraw()},xJ)),r||n.emit("render")};var Sf;Nr.drawSelectionRectangle=function(e,t){var n=this,r=n.cy,a=n.data,i=r.style(),l=e.drawOnlyNodeLayer,o=e.drawAllLayers,f=a.canvasNeedsRedraw,c=e.forcedContext;if(n.showFps||!l&&f[n.SELECT_BOX]&&!o){var d=c||a.contexts[n.SELECT_BOX];if(t(d),n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var v=n.cy.zoom(),m=i.core("selection-box-border-width").value/v;d.lineWidth=m,d.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",d.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),m>0&&(d.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",d.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(a.bgActivePosistion&&!n.hoverData.selecting){var v=n.cy.zoom(),y=a.bgActivePosistion;d.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",d.beginPath(),d.arc(y.x,y.y,i.core("active-bg-size").pfValue/v,0,2*Math.PI),d.fill()}var x=n.lastRedrawTime;if(n.showFps&&x){x=Math.round(x);var w=Math.round(1e3/x),S="1 frame = "+x+" ms = "+w+" fps";if(d.setTransform(1,0,0,1,0,0),d.fillStyle="rgba(255, 0, 0, 0.75)",d.strokeStyle="rgba(255, 0, 0, 0.75)",d.font="30px Arial",!Sf){var b=d.measureText(S);Sf=b.actualBoundingBoxAscent}d.fillText(S,0,Sf);var C=60;d.strokeRect(0,Sf+10,250,20),d.fillRect(0,Sf+10,250*Math.min(w/C,1),20)}o||(f[n.SELECT_BOX]=!1)}};function KA(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(r));return r}function bJ(e,t,n){var r=KA(e,e.VERTEX_SHADER,t),a=KA(e,e.FRAGMENT_SHADER,n),i=e.createProgram();if(e.attachShader(i,r),e.attachShader(i,a),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function wJ(e,t,n){n===void 0&&(n=t);var r=e.makeOffscreenCanvas(t,n),a=r.context=r.getContext("2d");return r.clear=function(){return a.clearRect(0,0,r.width,r.height)},r.clear(),r}function Pw(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function SJ(e){var t=e.pixelRatio,n=e.cy.zoom();return n*t}function EJ(e,t,n,r,a){var i=r*n+t.x,l=a*n+t.y;return l=Math.round(e.canvasHeight-l),[i,l]}function CJ(e){return e.pstyle("background-fill").value!=="solid"||e.pstyle("background-image").strValue!=="none"?!1:e.pstyle("border-width").value===0||e.pstyle("border-opacity").value===0?!0:e.pstyle("border-style").value==="solid"}function TJ(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Vl(e,t,n){var r=e[0]/255,a=e[1]/255,i=e[2]/255,l=t,o=n||new Array(4);return o[0]=r*l,o[1]=a*l,o[2]=i*l,o[3]=l,o}function gu(e,t){var n=t||new Array(4);return n[0]=(e>>0&255)/255,n[1]=(e>>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function kJ(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function NJ(e,t){var n=e.createTexture();return n.buffer=function(r){e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null)},n.deleteTexture=function(){e.deleteTexture(n)},n}function p_(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function m_(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function AJ(e,t,n,r,a,i){switch(t){case e.FLOAT:return new Float32Array(n.buffer,i*r,a);case e.INT:return new Int32Array(n.buffer,i*r,a)}}function RJ(e,t,n,r){var a=p_(e,t),i=On(a,2),l=i[0],o=i[1],f=m_(e,o,r),c=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,f,e.STATIC_DRAW),o===e.FLOAT?e.vertexAttribPointer(n,l,o,!1,0,0):o===e.INT&&e.vertexAttribIPointer(n,l,o,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,null),c}function Ya(e,t,n,r){var a=p_(e,n),i=On(a,3),l=i[0],o=i[1],f=i[2],c=m_(e,o,t*l),d=l*f,v=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,v),e.bufferData(e.ARRAY_BUFFER,t*d,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,l,o,!1,d,0):o===e.INT&&e.vertexAttribIPointer(r,l,o,d,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var m=new Array(t),y=0;y<t;y++)m[y]=AJ(e,o,c,d,l,y);return v.dataArray=c,v.stride=d,v.size=l,v.getView=function(x){return m[x]},v.setPoint=function(x,w,S){var b=m[x];b[0]=w,b[1]=S},v.bufferSubData=function(x){e.bindBuffer(e.ARRAY_BUFFER,v),x?e.bufferSubData(e.ARRAY_BUFFER,0,c,0,x*l):e.bufferSubData(e.ARRAY_BUFFER,0,c)},v}function jJ(e,t,n){for(var r=9,a=new Float32Array(t*r),i=new Array(t),l=0;l<t;l++){var o=l*r*4;i[l]=new Float32Array(a.buffer,o,r)}var f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,a.byteLength,e.DYNAMIC_DRAW);for(var c=0;c<3;c++){var d=n+c;e.enableVertexAttribArray(d),e.vertexAttribPointer(d,3,e.FLOAT,!1,36,c*12),e.vertexAttribDivisor(d,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),f.getMatrixView=function(v){return i[v]},f.setData=function(v,m){i[m].set(v,0)},f.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferSubData(e.ARRAY_BUFFER,0,a)},f}function DJ(e){var t=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,t);var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.bindFramebuffer(e.FRAMEBUFFER,null),t.setFramebufferAttachmentSizes=function(r,a){e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r,a,0,e.RGBA,e.UNSIGNED_BYTE,null)},t}var YA=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function A0(){var e=new YA(9);return YA!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function XA(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function MJ(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],d=t[7],v=t[8],m=n[0],y=n[1],x=n[2],w=n[3],S=n[4],b=n[5],C=n[6],T=n[7],N=n[8];return e[0]=m*r+y*l+x*c,e[1]=m*a+y*o+x*d,e[2]=m*i+y*f+x*v,e[3]=w*r+S*l+b*c,e[4]=w*a+S*o+b*d,e[5]=w*i+S*f+b*v,e[6]=C*r+T*l+N*c,e[7]=C*a+T*o+N*d,e[8]=C*i+T*f+N*v,e}function Pv(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],d=t[7],v=t[8],m=n[0],y=n[1];return e[0]=r,e[1]=a,e[2]=i,e[3]=l,e[4]=o,e[5]=f,e[6]=m*r+y*l+c,e[7]=m*a+y*o+d,e[8]=m*i+y*f+v,e}function QA(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],d=t[7],v=t[8],m=Math.sin(n),y=Math.cos(n);return e[0]=y*r+m*l,e[1]=y*a+m*o,e[2]=y*i+m*f,e[3]=y*l-m*r,e[4]=y*o-m*a,e[5]=y*f-m*i,e[6]=c,e[7]=d,e[8]=v,e}function Qb(e,t,n){var r=n[0],a=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function OJ(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}var LJ=(function(){function e(t,n,r,a){yl(this,e),this.debugID=Math.floor(Math.random()*1e4),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(t,n,n),this.scratch=a(t,n,this.texHeight,"scratch")}return xl(e,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(n){var r=n.w,a=n.h,i=this.texHeight,l=this.texSize,o=i/a,f=r*o,c=a*o;return f>l&&(o=l/r,f=r*o,c=a*o),{scale:o,texW:f,texH:c}}},{key:"draw",value:function(n,r,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var l=this.texSize,o=this.texRows,f=this.texHeight,c=this.getScale(r),d=c.scale,v=c.texW,m=c.texH,y=function(T,N){if(a&&N){var A=N.context,R=T.x,D=T.row,L=R,_=f*D;A.save(),A.translate(L,_),A.scale(d,d),a(A,r),A.restore()}},x=[null,null],w=function(){y(i.freePointer,i.canvas),x[0]={x:i.freePointer.x,y:i.freePointer.row*f,w:v,h:m},x[1]={x:i.freePointer.x+v,y:i.freePointer.row*f,w:0,h:m},i.freePointer.x+=v,i.freePointer.x==l&&(i.freePointer.x=0,i.freePointer.row++)},S=function(){var T=i.scratch,N=i.canvas;T.clear(),y({x:0,row:0},T);var A=l-i.freePointer.x,R=v-A,D=f;{var L=i.freePointer.x,_=i.freePointer.row*f,M=A;N.context.drawImage(T,0,0,M,D,L,_,M,D),x[0]={x:L,y:_,w:M,h:m}}{var z=A,P=(i.freePointer.row+1)*f,G=R;N&&N.context.drawImage(T,z,0,G,D,0,P,G,D),x[1]={x:0,y:P,w:G,h:m}}i.freePointer.x=R,i.freePointer.row++},b=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+v<=l)w();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===l?(b(),w()):this.enableWrapping?S():(b(),w())}return this.keyToLocation.set(n,x),this.needsBuffer=!0,x}},{key:"getOffsets",value:function(n){return this.keyToLocation.get(n)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(n){if(this.locked)return!1;var r=this.texSize,a=this.texRows,i=this.getScale(n),l=i.texW;return this.freePointer.x+l>r?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(n){this.texture||(this.texture=NJ(n,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),_J=(function(){function e(t,n,r,a){yl(this,e),this.r=t,this.texSize=n,this.texRows=r,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return xl(e,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var n=this.r,r=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new LJ(n,r,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var n=this.r,r=this.texSize,a=this.texRows,i=this.createTextureCanvas,l=Math.floor(r/a);this.scratch=i(n,r,l,"scratch")}return this.scratch}},{key:"draw",value:function(n,r,a){var i=this.styleKeyToAtlas.get(n);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(r))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(n,r,a),this.styleKeyToAtlas.set(n,i)),i}},{key:"getAtlas",value:function(n){return this.styleKeyToAtlas.get(n)}},{key:"hasAtlas",value:function(n){return this.styleKeyToAtlas.has(n)}},{key:"markKeyForGC",value:function(n){this.markedKeys.add(n)}},{key:"gc",value:function(){var n=this,r=this.markedKeys;if(r.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,l=null,o=qr(this.atlases),f;try{var c=function(){var v=f.value,m=v.getKeys(),y=BJ(r,m);if(y.size===0)return a.push(v),m.forEach(function(A){return i.set(A,v)}),1;l||(l=n._createAtlas(),a.push(l));var x=qr(m),w;try{for(x.s();!(w=x.n()).done;){var S=w.value;if(!y.has(S)){var b=v.getOffsets(S),C=On(b,2),T=C[0],N=C[1];l.canFit({w:T.w+N.w,h:T.h})||(l.lock(),l=n._createAtlas(),a.push(l)),v.canvas&&(n._copyTextureToNewAtlas(S,v,l),i.set(S,l))}}}catch(A){x.e(A)}finally{x.f()}v.dispose()};for(o.s();!(f=o.n()).done;)c()}catch(d){o.e(d)}finally{o.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(n,r,a){var i=r.getOffsets(n),l=On(i,2),o=l[0],f=l[1];if(f.w===0)a.draw(n,o,function(m){m.drawImage(r.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var c=this._getScratchCanvas();c.clear(),c.context.drawImage(r.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),c.context.drawImage(r.canvas,f.x,f.y,f.w,f.h,o.w,0,f.w,f.h);var d=o.w+f.w,v=o.h;a.draw(n,{w:d,h:v},function(m){m.drawImage(c,0,0,d,v,0,0,d,v)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function BJ(e,t){return e.intersection?e.intersection(t):new Set(ep(e).filter(function(n){return t.has(n)}))}var PJ=(function(){function e(t,n){yl(this,e),this.r=t,this.globalOptions=n,this.atlasSize=n.webglTexSize,this.maxAtlasesPerBatch=n.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return xl(e,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(n,r){var a=this.globalOptions,i=a.webglTexSize,l=a.createTextureCanvas,o=r.texRows,f=this._cacheScratchCanvas(l),c=new _J(this.r,i,o,f);this.collections.set(n,c)}},{key:"addRenderType",value:function(n,r){var a=r.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),l=rt({type:n,atlasCollection:i},r);this.renderTypes.set(n,l)}},{key:"getRenderTypeOpts",value:function(n){return this.renderTypes.get(n)}},{key:"getAtlasCollection",value:function(n){return this.collections.get(n)}},{key:"_cacheScratchCanvas",value:function(n){var r=-1,a=-1,i=null;return function(l,o,f,c){return c?((!i||o!=r||f!=a)&&(r=o,a=f,i=n(l,o,f)),i):n(l,o,f)}}},{key:"_key",value:function(n,r){return"".concat(n,"-").concat(r)}},{key:"invalidate",value:function(n){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,l=i===void 0?!1:i,o=a.filterEle,f=o===void 0?function(){return!0}:o,c=a.filterType,d=c===void 0?function(){return!0}:c,v=!1,m=!1,y=qr(n),x;try{for(y.s();!(x=y.n()).done;){var w=x.value;if(f(w)){var S=qr(this.renderTypes.values()),b;try{var C=function(){var N=b.value,A=N.type;if(d(A)){var R=r.collections.get(N.collection),D=N.getKey(w),L=Array.isArray(D)?D:[D];if(l)L.forEach(function(P){return R.markKeyForGC(P)}),m=!0;else{var _=N.getID?N.getID(w):w.id(),M=r._key(A,_),z=r.typeAndIdToKey.get(M);z!==void 0&&!TJ(L,z)&&(v=!0,r.typeAndIdToKey.delete(M),z.forEach(function(P){return R.markKeyForGC(P)}))}}};for(S.s();!(b=S.n()).done;)C()}catch(T){S.e(T)}finally{S.f()}}}}catch(T){y.e(T)}finally{y.f()}return m&&(this.gc(),v=!1),v}},{key:"gc",value:function(){var n=qr(this.collections.values()),r;try{for(n.s();!(r=n.n()).done;){var a=r.value;a.gc()}}catch(i){n.e(i)}finally{n.f()}}},{key:"getOrCreateAtlas",value:function(n,r,a,i){var l=this.renderTypes.get(r),o=this.collections.get(l.collection),f=!1,c=o.draw(i,a,function(m){l.drawClipped?(m.save(),m.beginPath(),m.rect(0,0,a.w,a.h),m.clip(),l.drawElement(m,n,a,!0,!0),m.restore()):l.drawElement(m,n,a,!0,!0),f=!0});if(f){var d=l.getID?l.getID(n):n.id(),v=this._key(r,d);this.typeAndIdToKey.has(v)?this.typeAndIdToKey.get(v).push(i):this.typeAndIdToKey.set(v,[i])}return c}},{key:"getAtlasInfo",value:function(n,r){var a=this,i=this.renderTypes.get(r),l=i.getKey(n),o=Array.isArray(l)?l:[l];return o.map(function(f){var c=i.getBoundingBox(n,f),d=a.getOrCreateAtlas(n,r,c,f),v=d.getOffsets(f),m=On(v,2),y=m[0],x=m[1];return{atlas:d,tex:y,tex1:y,tex2:x,bb:c}})}},{key:"getDebugInfo",value:function(){var n=[],r=qr(this.collections),a;try{for(r.s();!(a=r.n()).done;){var i=On(a.value,2),l=i[0],o=i[1],f=o.getCounts(),c=f.keyCount,d=f.atlasCount;n.push({type:l,keyCount:c,atlasCount:d})}}catch(v){r.e(v)}finally{r.f()}return n}}])})(),zJ=(function(){function e(t){yl(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return xl(e,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(n,r){return r})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(n){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(n):!0}},{key:"getAtlasIndexForBatch",value:function(n){var r=this.batchAtlases.indexOf(n);if(r<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(n),r=this.batchAtlases.length-1}return r}}])})(),IJ=`
|
|
474
|
+
float circleSD(vec2 p, float r) {
|
|
475
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
476
|
+
}
|
|
477
|
+
`,FJ=`
|
|
478
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
479
|
+
vec2 d = abs(p)-b;
|
|
480
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
481
|
+
}
|
|
482
|
+
`,qJ=`
|
|
483
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
484
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
485
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
486
|
+
vec2 q = abs(p) - b + cr.x;
|
|
487
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
488
|
+
}
|
|
489
|
+
`,UJ=`
|
|
490
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
491
|
+
p = abs( p ); // symmetry
|
|
492
|
+
|
|
493
|
+
// find root with Newton solver
|
|
494
|
+
vec2 q = ab*(p-ab);
|
|
495
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
496
|
+
for( int i=0; i<5; i++ ) {
|
|
497
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
498
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
499
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
500
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// compute final point and distance
|
|
504
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
505
|
+
|
|
506
|
+
// return signed distance
|
|
507
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
508
|
+
}
|
|
509
|
+
`,Pf={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},dp={IGNORE:1,USE_BB:2},R0=0,WA=1,ZA=2,j0=3,yu=4,mv=5,Ef=6,Cf=7,VJ=(function(){function e(t,n,r){yl(this,e),this.r=t,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=wJ,this.atlasManager=new PJ(t,r),this.batchManager=new zJ(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Pf.SCREEN),this.pickingProgram=this._createShaderProgram(Pf.PICKING),this.vao=this._createVAO()}return xl(e,[{key:"addAtlasCollection",value:function(n,r){this.atlasManager.addAtlasCollection(n,r)}},{key:"addTextureAtlasRenderType",value:function(n,r){this.atlasManager.addRenderType(n,r)}},{key:"addSimpleShapeRenderType",value:function(n,r){this.simpleShapeOptions.set(n,r)}},{key:"invalidate",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.type,i=this.atlasManager;return a?i.invalidate(n,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(n)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(n){var r=this.gl,a=`#version 300 es
|
|
510
|
+
precision highp float;
|
|
511
|
+
|
|
512
|
+
uniform mat3 uPanZoomMatrix;
|
|
513
|
+
uniform int uAtlasSize;
|
|
514
|
+
|
|
515
|
+
// instanced
|
|
516
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
517
|
+
|
|
518
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
519
|
+
in int aVertType; // the type of thing we are rendering
|
|
520
|
+
|
|
521
|
+
// the z-index that is output when using picking mode
|
|
522
|
+
in vec4 aIndex;
|
|
523
|
+
|
|
524
|
+
// For textures
|
|
525
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
526
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
527
|
+
|
|
528
|
+
// for edges
|
|
529
|
+
in vec4 aPointAPointB;
|
|
530
|
+
in vec4 aPointCPointD;
|
|
531
|
+
in vec2 aLineWidth; // also used for node border width
|
|
532
|
+
|
|
533
|
+
// simple shapes
|
|
534
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
535
|
+
in vec4 aColor; // also used for edges
|
|
536
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
537
|
+
|
|
538
|
+
// output values passed to the fragment shader
|
|
539
|
+
out vec2 vTexCoord;
|
|
540
|
+
out vec4 vColor;
|
|
541
|
+
out vec2 vPosition;
|
|
542
|
+
// flat values are not interpolated
|
|
543
|
+
flat out int vAtlasId;
|
|
544
|
+
flat out int vVertType;
|
|
545
|
+
flat out vec2 vTopRight;
|
|
546
|
+
flat out vec2 vBotLeft;
|
|
547
|
+
flat out vec4 vCornerRadius;
|
|
548
|
+
flat out vec4 vBorderColor;
|
|
549
|
+
flat out vec2 vBorderWidth;
|
|
550
|
+
flat out vec4 vIndex;
|
|
551
|
+
|
|
552
|
+
void main(void) {
|
|
553
|
+
int vid = gl_VertexID;
|
|
554
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
555
|
+
|
|
556
|
+
if(aVertType == `.concat(R0,`) {
|
|
557
|
+
float texX = aTex.x; // texture coordinates
|
|
558
|
+
float texY = aTex.y;
|
|
559
|
+
float texW = aTex.z;
|
|
560
|
+
float texH = aTex.w;
|
|
561
|
+
|
|
562
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
563
|
+
texX += texW;
|
|
564
|
+
}
|
|
565
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
566
|
+
texY += texH;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
float d = float(uAtlasSize);
|
|
570
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
571
|
+
|
|
572
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
573
|
+
}
|
|
574
|
+
else if(aVertType == `).concat(yu," || aVertType == ").concat(Cf,`
|
|
575
|
+
|| aVertType == `).concat(mv," || aVertType == ").concat(Ef,`) { // simple shapes
|
|
576
|
+
|
|
577
|
+
// the bounding box is needed by the fragment shader
|
|
578
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
579
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
580
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
581
|
+
|
|
582
|
+
// calculations are done in the fragment shader, just pass these along
|
|
583
|
+
vColor = aColor;
|
|
584
|
+
vCornerRadius = aCornerRadius;
|
|
585
|
+
vBorderColor = aBorderColor;
|
|
586
|
+
vBorderWidth = aLineWidth;
|
|
587
|
+
|
|
588
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
589
|
+
}
|
|
590
|
+
else if(aVertType == `).concat(WA,`) {
|
|
591
|
+
vec2 source = aPointAPointB.xy;
|
|
592
|
+
vec2 target = aPointAPointB.zw;
|
|
593
|
+
|
|
594
|
+
// adjust the geometry so that the line is centered on the edge
|
|
595
|
+
position.y = position.y - 0.5;
|
|
596
|
+
|
|
597
|
+
// stretch the unit square into a long skinny rectangle
|
|
598
|
+
vec2 xBasis = target - source;
|
|
599
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
600
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
601
|
+
|
|
602
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
603
|
+
vColor = aColor;
|
|
604
|
+
}
|
|
605
|
+
else if(aVertType == `).concat(ZA,`) {
|
|
606
|
+
vec2 pointA = aPointAPointB.xy;
|
|
607
|
+
vec2 pointB = aPointAPointB.zw;
|
|
608
|
+
vec2 pointC = aPointCPointD.xy;
|
|
609
|
+
vec2 pointD = aPointCPointD.zw;
|
|
610
|
+
|
|
611
|
+
// adjust the geometry so that the line is centered on the edge
|
|
612
|
+
position.y = position.y - 0.5;
|
|
613
|
+
|
|
614
|
+
vec2 p0, p1, p2, pos;
|
|
615
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
616
|
+
p0 = pointA;
|
|
617
|
+
p1 = pointB;
|
|
618
|
+
p2 = pointC;
|
|
619
|
+
pos = position;
|
|
620
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
621
|
+
p0 = pointD;
|
|
622
|
+
p1 = pointC;
|
|
623
|
+
p2 = pointB;
|
|
624
|
+
pos = vec2(0.0, -position.y);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
vec2 p01 = p1 - p0;
|
|
628
|
+
vec2 p12 = p2 - p1;
|
|
629
|
+
vec2 p21 = p1 - p2;
|
|
630
|
+
|
|
631
|
+
// Find the normal vector.
|
|
632
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
633
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
634
|
+
|
|
635
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
636
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
637
|
+
|
|
638
|
+
// Determine the bend direction.
|
|
639
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
640
|
+
float width = aLineWidth[0];
|
|
641
|
+
|
|
642
|
+
if(sign(pos.y) == -sigma) {
|
|
643
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
644
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
645
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
646
|
+
} else {
|
|
647
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
648
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
649
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
vColor = aColor;
|
|
653
|
+
}
|
|
654
|
+
else if(aVertType == `).concat(j0,` && vid < 3) {
|
|
655
|
+
// massage the first triangle into an edge arrow
|
|
656
|
+
if(vid == 0)
|
|
657
|
+
position = vec2(-0.15, -0.3);
|
|
658
|
+
if(vid == 1)
|
|
659
|
+
position = vec2( 0.0, 0.0);
|
|
660
|
+
if(vid == 2)
|
|
661
|
+
position = vec2( 0.15, -0.3);
|
|
662
|
+
|
|
663
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
664
|
+
vColor = aColor;
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
vAtlasId = aAtlasId;
|
|
671
|
+
vVertType = aVertType;
|
|
672
|
+
vIndex = aIndex;
|
|
673
|
+
}
|
|
674
|
+
`),i=this.batchManager.getIndexArray(),l=`#version 300 es
|
|
675
|
+
precision highp float;
|
|
676
|
+
|
|
677
|
+
// declare texture unit for each texture atlas in the batch
|
|
678
|
+
`.concat(i.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(`
|
|
679
|
+
`),`
|
|
680
|
+
|
|
681
|
+
uniform vec4 uBGColor;
|
|
682
|
+
uniform float uZoom;
|
|
683
|
+
|
|
684
|
+
in vec2 vTexCoord;
|
|
685
|
+
in vec4 vColor;
|
|
686
|
+
in vec2 vPosition; // model coordinates
|
|
687
|
+
|
|
688
|
+
flat in int vAtlasId;
|
|
689
|
+
flat in vec4 vIndex;
|
|
690
|
+
flat in int vVertType;
|
|
691
|
+
flat in vec2 vTopRight;
|
|
692
|
+
flat in vec2 vBotLeft;
|
|
693
|
+
flat in vec4 vCornerRadius;
|
|
694
|
+
flat in vec4 vBorderColor;
|
|
695
|
+
flat in vec2 vBorderWidth;
|
|
696
|
+
|
|
697
|
+
out vec4 outColor;
|
|
698
|
+
|
|
699
|
+
`).concat(IJ,`
|
|
700
|
+
`).concat(FJ,`
|
|
701
|
+
`).concat(qJ,`
|
|
702
|
+
`).concat(UJ,`
|
|
703
|
+
|
|
704
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
705
|
+
return vec4(
|
|
706
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
707
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
712
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
713
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
714
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
void main(void) {
|
|
718
|
+
if(vVertType == `).concat(R0,`) {
|
|
719
|
+
// look up the texel from the texture unit
|
|
720
|
+
`).concat(i.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
|
|
721
|
+
else `),`
|
|
722
|
+
}
|
|
723
|
+
else if(vVertType == `).concat(j0,`) {
|
|
724
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
725
|
+
outColor = blend(vColor, uBGColor);
|
|
726
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
727
|
+
}
|
|
728
|
+
else if(vVertType == `).concat(yu,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
729
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
730
|
+
}
|
|
731
|
+
else if(vVertType == `).concat(yu," || vVertType == ").concat(Cf,`
|
|
732
|
+
|| vVertType == `).concat(mv," || vVertType == ").concat(Ef,`) { // use SDF
|
|
733
|
+
|
|
734
|
+
float outerBorder = vBorderWidth[0];
|
|
735
|
+
float innerBorder = vBorderWidth[1];
|
|
736
|
+
float borderPadding = outerBorder * 2.0;
|
|
737
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
738
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
739
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
740
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
741
|
+
|
|
742
|
+
float d; // signed distance
|
|
743
|
+
if(vVertType == `).concat(yu,`) {
|
|
744
|
+
d = rectangleSD(p, b);
|
|
745
|
+
} else if(vVertType == `).concat(Cf,` && w == h) {
|
|
746
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
747
|
+
} else if(vVertType == `).concat(Cf,`) {
|
|
748
|
+
d = ellipseSD(p, b);
|
|
749
|
+
} else {
|
|
750
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
754
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
755
|
+
if(d > 0.0) {
|
|
756
|
+
if(d > outerBorder) {
|
|
757
|
+
discard;
|
|
758
|
+
} else {
|
|
759
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
760
|
+
}
|
|
761
|
+
} else {
|
|
762
|
+
if(d > innerBorder) {
|
|
763
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
764
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
765
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
766
|
+
}
|
|
767
|
+
else {
|
|
768
|
+
vec4 outerColor;
|
|
769
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
770
|
+
outerColor = vec4(0);
|
|
771
|
+
} else if(innerBorder == 0.0) {
|
|
772
|
+
outerColor = vBorderColor;
|
|
773
|
+
} else {
|
|
774
|
+
outerColor = blend(vBorderColor, vColor);
|
|
775
|
+
}
|
|
776
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
else {
|
|
781
|
+
outColor = vColor;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
`).concat(n.picking?`if(outColor.a == 0.0) discard;
|
|
785
|
+
else outColor = vIndex;`:"",`
|
|
786
|
+
}
|
|
787
|
+
`),o=bJ(r,a,l);o.aPosition=r.getAttribLocation(o,"aPosition"),o.aIndex=r.getAttribLocation(o,"aIndex"),o.aVertType=r.getAttribLocation(o,"aVertType"),o.aTransform=r.getAttribLocation(o,"aTransform"),o.aAtlasId=r.getAttribLocation(o,"aAtlasId"),o.aTex=r.getAttribLocation(o,"aTex"),o.aPointAPointB=r.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=r.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=r.getAttribLocation(o,"aLineWidth"),o.aColor=r.getAttribLocation(o,"aColor"),o.aCornerRadius=r.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=r.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=r.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=r.getUniformLocation(o,"uAtlasSize"),o.uBGColor=r.getUniformLocation(o,"uBGColor"),o.uZoom=r.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var f=0;f<this.batchManager.getMaxAtlasesPerBatch();f++)o.uTextures.push(r.getUniformLocation(o,"uTexture".concat(f)));return o}},{key:"_createVAO",value:function(){var n=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=n.length/2;var r=this.maxInstances,a=this.gl,i=this.program,l=a.createVertexArray();return a.bindVertexArray(l),RJ(a,"vec2",i.aPosition,n),this.transformBuffer=jJ(a,r,i.aTransform),this.indexBuffer=Ya(a,r,"vec4",i.aIndex),this.vertTypeBuffer=Ya(a,r,"int",i.aVertType),this.atlasIdBuffer=Ya(a,r,"int",i.aAtlasId),this.texBuffer=Ya(a,r,"vec4",i.aTex),this.pointAPointBBuffer=Ya(a,r,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Ya(a,r,"vec4",i.aPointCPointD),this.lineWidthBuffer=Ya(a,r,"vec2",i.aLineWidth),this.colorBuffer=Ya(a,r,"vec4",i.aColor),this.cornerRadiusBuffer=Ya(a,r,"vec4",i.aCornerRadius),this.borderColorBuffer=Ya(a,r,"vec4",i.aBorderColor),a.bindVertexArray(null),l}},{key:"buffers",get:function(){var n=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(r){return Xs(r,"Buffer")}).map(function(r){return n[r]})),this._buffers}},{key:"startFrame",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pf.SCREEN;this.panZoomMatrix=n,this.renderTarget=r,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(n,r){return n.visible()?r&&r.isVisible?r.isVisible(n):!0:!1}},{key:"drawTexture",value:function(n,r,a){var i=this.atlasManager,l=this.batchManager,o=i.getRenderTypeOpts(a);if(this._isVisible(n,o)&&!(n.isEdge()&&!this._isValidEdge(n))){if(this.renderTarget.picking&&o.getTexPickingMode){var f=o.getTexPickingMode(n);if(f===dp.IGNORE)return;if(f==dp.USE_BB){this.drawPickingRectangle(n,r,a);return}}var c=i.getAtlasInfo(n,a),d=qr(c),v;try{for(d.s();!(v=d.n()).done;){var m=v.value,y=m.atlas,x=m.tex1,w=m.tex2;l.canAddToCurrentBatch(y)||this.endBatch();for(var S=l.getAtlasIndexForBatch(y),b=0,C=[[x,!0],[w,!1]];b<C.length;b++){var T=On(C[b],2),N=T[0],A=T[1];if(N.w!=0){var R=this.instanceCount;this.vertTypeBuffer.getView(R)[0]=R0;var D=this.indexBuffer.getView(R);gu(r,D);var L=this.atlasIdBuffer.getView(R);L[0]=S;var _=this.texBuffer.getView(R);_[0]=N.x,_[1]=N.y,_[2]=N.w,_[3]=N.h;var M=this.transformBuffer.getMatrixView(R);this.setTransformMatrix(n,M,o,m,A),this.instanceCount++,A||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(z){d.e(z)}finally{d.f()}}}},{key:"setTransformMatrix",value:function(n,r,a,i){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(a.shapeProps&&a.shapeProps.padding&&(o=n.pstyle(a.shapeProps.padding).pfValue),i){var f=i.bb,c=i.tex1,d=i.tex2,v=c.w/(c.w+d.w);l||(v=1-v);var m=this._getAdjustedBB(f,o,l,v);this._applyTransformMatrix(r,m,a,n)}else{var y=a.getBoundingBox(n),x=this._getAdjustedBB(y,o,!0,1);this._applyTransformMatrix(r,x,a,n)}}},{key:"_applyTransformMatrix",value:function(n,r,a,i){var l,o;XA(n);var f=a.getRotation?a.getRotation(i):0;if(f!==0){var c=a.getRotationPoint(i),d=c.x,v=c.y;Pv(n,n,[d,v]),QA(n,n,f);var m=a.getRotationOffset(i);l=m.x+(r.xOffset||0),o=m.y+(r.yOffset||0)}else l=r.x1,o=r.y1;Pv(n,n,[l,o]),Qb(n,n,[r.w,r.h])}},{key:"_getAdjustedBB",value:function(n,r,a,i){var l=n.x1,o=n.y1,f=n.w,c=n.h,d=n.yOffset;r&&(l-=r,o-=r,f+=2*r,c+=2*r);var v=0,m=f*i;return a&&i<1?f=m:!a&&i<1&&(v=f-m,l+=v,f=m),{x1:l,y1:o,w:f,h:c,xOffset:v,yOffset:d}}},{key:"drawPickingRectangle",value:function(n,r,a){var i=this.atlasManager.getRenderTypeOpts(a),l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=yu;var o=this.indexBuffer.getView(l);gu(r,o);var f=this.colorBuffer.getView(l);Vl([0,0,0],1,f);var c=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(n,c,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(n,r,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(n,i)){var l=i.shapeProps,o=this._getVertTypeForShape(n,l.shape);if(o===void 0||i.isSimple&&!i.isSimple(n)){this.drawTexture(n,r,a);return}var f=this.instanceCount;if(this.vertTypeBuffer.getView(f)[0]=o,o===mv||o===Ef){var c=i.getBoundingBox(n),d=this._getCornerRadius(n,l.radius,c),v=this.cornerRadiusBuffer.getView(f);v[0]=d,v[1]=d,v[2]=d,v[3]=d,o===Ef&&(v[0]=0,v[2]=0)}var m=this.indexBuffer.getView(f);gu(r,m);var y=n.pstyle(l.color).value,x=n.pstyle(l.opacity).value,w=this.colorBuffer.getView(f);Vl(y,x,w);var S=this.lineWidthBuffer.getView(f);if(S[0]=0,S[1]=0,l.border){var b=n.pstyle("border-width").value;if(b>0){var C=n.pstyle("border-color").value,T=n.pstyle("border-opacity").value,N=this.borderColorBuffer.getView(f);Vl(C,T,N);var A=n.pstyle("border-position").value;if(A==="inside")S[0]=0,S[1]=-b;else if(A==="outside")S[0]=b,S[1]=0;else{var R=b/2;S[0]=R,S[1]=-R}}}var D=this.transformBuffer.getMatrixView(f);this.setTransformMatrix(n,D,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(n,r){var a=n.pstyle(r).value;switch(a){case"rectangle":return yu;case"ellipse":return Cf;case"roundrectangle":case"round-rectangle":return mv;case"bottom-round-rectangle":return Ef;default:return}}},{key:"_getCornerRadius",value:function(n,r,a){var i=a.w,l=a.h;if(n.pstyle(r).value==="auto")return cl(i,l);var o=n.pstyle(r).pfValue,f=i/2,c=l/2;return Math.min(o,c,f)}},{key:"drawEdgeArrow",value:function(n,r,a){if(n.visible()){var i=n._private.rscratch,l,o,f;if(a==="source"?(l=i.arrowStartX,o=i.arrowStartY,f=i.srcArrowAngle):(l=i.arrowEndX,o=i.arrowEndY,f=i.tgtArrowAngle),!(isNaN(l)||l==null||isNaN(o)||o==null||isNaN(f)||f==null)){var c=n.pstyle(a+"-arrow-shape").value;if(c!=="none"){var d=n.pstyle(a+"-arrow-color").value,v=n.pstyle("opacity").value,m=n.pstyle("line-opacity").value,y=v*m,x=n.pstyle("width").pfValue,w=n.pstyle("arrow-scale").value,S=this.r.getArrowWidth(x,w),b=this.instanceCount,C=this.transformBuffer.getMatrixView(b);XA(C),Pv(C,C,[l,o]),Qb(C,C,[S,S]),QA(C,C,f),this.vertTypeBuffer.getView(b)[0]=j0;var T=this.indexBuffer.getView(b);gu(r,T);var N=this.colorBuffer.getView(b);Vl(d,y,N),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(n,r){if(n.visible()){var a=this._getEdgePoints(n);if(a){var i=n.pstyle("opacity").value,l=n.pstyle("line-opacity").value,o=n.pstyle("width").pfValue,f=n.pstyle("line-color").value,c=i*l;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=WA;var v=this.indexBuffer.getView(d);gu(r,v);var m=this.colorBuffer.getView(d);Vl(f,c,m);var y=this.lineWidthBuffer.getView(d);y[0]=o;var x=this.pointAPointBBuffer.getView(d);x[0]=a[0],x[1]=a[1],x[2]=a[2],x[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var w=0;w<a.length-2;w+=2){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=ZA;var b=this.indexBuffer.getView(S);gu(r,b);var C=this.colorBuffer.getView(S);Vl(f,c,C);var T=this.lineWidthBuffer.getView(S);T[0]=o;var N=a[w-2],A=a[w-1],R=a[w],D=a[w+1],L=a[w+2],_=a[w+3],M=a[w+4],z=a[w+5];w==0&&(N=2*R-L+.001,A=2*D-_+.001),w==a.length-4&&(M=2*L-R+.001,z=2*_-D+.001);var P=this.pointAPointBBuffer.getView(S);P[0]=N,P[1]=A,P[2]=R,P[3]=D;var G=this.pointCPointDBuffer.getView(S);G[0]=L,G[1]=_,G[2]=M,G[3]=z,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(n){var r=n._private.rscratch;return!(r.badLine||r.allpts==null||isNaN(r.allpts[0]))}},{key:"_getEdgePoints",value:function(n){var r=n._private.rscratch;if(this._isValidEdge(n)){var a=r.allpts;if(a.length==4)return a;var i=this._getNumSegments(n);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(n){var r=15;return Math.min(Math.max(r,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(n,r){if(n.length==4)return n;for(var a=Array((r+1)*2),i=0;i<=r;i++)if(i==0)a[0]=n[0],a[1]=n[1];else if(i==r)a[i*2]=n[n.length-2],a[i*2+1]=n[n.length-1];else{var l=i/r;this._setCurvePoint(n,l,a,i*2)}return a}},{key:"_setCurvePoint",value:function(n,r,a,i){if(n.length<=2)a[i]=n[0],a[i+1]=n[1];else{for(var l=Array(n.length-2),o=0;o<l.length;o+=2){var f=(1-r)*n[o]+r*n[o+2],c=(1-r)*n[o+1]+r*n[o+3];l[o]=f,l[o+1]=c}return this._setCurvePoint(l,r,a,i)}}},{key:"endBatch",value:function(){var n=this.gl,r=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var l=this.renderTarget.picking?this.pickingProgram:this.program;n.useProgram(l),n.bindVertexArray(r);var o=qr(this.buffers),f;try{for(o.s();!(f=o.n()).done;){var c=f.value;c.bufferSubData(i)}}catch(x){o.e(x)}finally{o.f()}for(var d=this.batchManager.getAtlases(),v=0;v<d.length;v++)d[v].bufferIfNeeded(n);for(var m=0;m<d.length;m++)n.activeTexture(n.TEXTURE0+m),n.bindTexture(n.TEXTURE_2D,d[m].texture),n.uniform1i(l.uTextures[m],m);n.uniform1f(l.uZoom,SJ(this.r)),n.uniformMatrix3fv(l.uPanZoomMatrix,!1,this.panZoomMatrix),n.uniform1i(l.uAtlasSize,this.batchManager.getAtlasSize());var y=Vl(this.bgColor,1);n.uniform4fv(l.uBGColor,y),n.drawArraysInstanced(n.TRIANGLES,0,a,i),n.bindVertexArray(null),n.bindTexture(n.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:d.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var n=this.atlasManager.getDebugInfo(),r=n.reduce(function(l,o){return l+o.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(l,o){return l+o.count},0);return{atlasInfo:n,totalAtlases:r,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),g_={};g_.initWebgl=function(e,t){var n=this,r=n.data.contexts[n.WEBGL];e.bgColor=HJ(n),e.webglTexSize=Math.min(e.webglTexSize,r.getParameter(r.MAX_TEXTURE_SIZE)),e.webglTexRows=Math.min(e.webglTexRows,54),e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54),e.webglBatchSize=Math.min(e.webglBatchSize,16384),e.webglTexPerBatch=Math.min(e.webglTexPerBatch,r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)),n.webglDebug=e.webglDebug,n.webglDebugShowAtlases=e.webglDebugShowAtlases,n.pickingFrameBuffer=DJ(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new VJ(n,r,e);var a=function(v){return function(m){return n.getTextAngle(m,v)}},i=function(v){return function(m){var y=m.pstyle(v);return y&&y.value}},l=function(v){return function(m){return m.pstyle("".concat(v,"-opacity")).value>0}},o=function(v){var m=v.pstyle("text-events").strValue==="yes";return m?dp.USE_BB:dp.IGNORE},f=function(v){var m=v.position(),y=m.x,x=m.y,w=v.outerWidth(),S=v.outerHeight();return{w,h:S,x1:y-w/2,y1:x-S/2}};n.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),n.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:f,isSimple:CJ,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:f,isVisible:l("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:f,isVisible:l("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:D0(t.getLabelKey,null),getBoundingBox:M0(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:a(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:i("label")}),n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:D0(t.getSourceLabelKey,"source"),getBoundingBox:M0(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:a("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:i("source-label")}),n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:D0(t.getTargetLabelKey,"target"),getBoundingBox:M0(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:a("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:i("target-label")});var c=Cd(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(d,v){var m=!1;v&&v.length>0&&(m|=n.drawing.invalidate(v)),m&&c()}),GJ(n)};function HJ(e){var t=e.cy.container(),n=t&&t.style&&t.style.backgroundColor||"white";return GO(n)}function y_(e,t){var n=e._private.rscratch;return Ir(n,"labelWrapCachedLines",t)||[]}var D0=function(t,n){return function(r){var a=t(r),i=y_(r,n);return i.length>1?i.map(function(l,o){return"".concat(a,"_").concat(o)}):a}},M0=function(t,n){return function(r,a){var i=t(r);if(typeof a=="string"){var l=a.indexOf("_");if(l>0){var o=Number(a.substring(l+1)),f=y_(r,n),c=i.h/f.length,d=c*o,v=i.y1+d;return{x1:i.x1,w:i.w,y1:v,h:c,yOffset:d}}}return i}};function GJ(e){{var t=e.render;e.render=function(i){i=i||{};var l=e.cy;e.webgl&&(l.zoom()>c_?($J(e),t.call(e,i)):(KJ(e),b_(e,i,Pf.SCREEN)))}}{var n=e.matchCanvasSize;e.matchCanvasSize=function(i){n.call(e,i),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0}}e.findNearestElements=function(i,l,o,f){return JJ(e,i,l)};{var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e),e.pickingFrameBuffer.needsDraw=!0}}{var a=e.notify;e.notify=function(i,l){a.call(e,i,l),i==="viewport"||i==="bounds"?e.pickingFrameBuffer.needsDraw=!0:i==="background"&&e.drawing.invalidate(l,{type:"node-body"})}}}function $J(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function KJ(e){var t=function(r){r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.canvasWidth,e.canvasHeight),r.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}function YJ(e){var t=e.canvasWidth,n=e.canvasHeight,r=Pw(e),a=r.pan,i=r.zoom,l=A0();Pv(l,l,[a.x,a.y]),Qb(l,l,[i,i]);var o=A0();OJ(o,t,n);var f=A0();return MJ(f,o,l),f}function x_(e,t){var n=e.canvasWidth,r=e.canvasHeight,a=Pw(e),i=a.pan,l=a.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(i.x,i.y),t.scale(l,l)}function XJ(e,t){e.drawSelectionRectangle(t,function(n){return x_(e,n)})}function QJ(e){var t=e.data.contexts[e.NODE];t.save(),x_(e,t),t.strokeStyle="rgba(0, 0, 0, 0.3)",t.beginPath(),t.moveTo(-1e3,0),t.lineTo(1e3,0),t.stroke(),t.beginPath(),t.moveTo(0,-1e3),t.lineTo(0,1e3),t.stroke(),t.restore()}function WJ(e){var t=function(a,i,l){for(var o=a.atlasManager.getAtlasCollection(i),f=e.data.contexts[e.NODE],c=o.atlases,d=0;d<c.length;d++){var v=c[d],m=v.canvas;if(m){var y=m.width,x=m.height,w=y*d,S=m.height*l,b=.4;f.save(),f.scale(b,b),f.drawImage(m,w,S),f.strokeStyle="black",f.rect(w,S,y,x),f.stroke(),f.restore()}}},n=0;t(e.drawing,"node",n++),t(e.drawing,"label",n++)}function ZJ(e,t,n,r,a){var i,l,o,f,c=Pw(e),d=c.pan,v=c.zoom;{var m=EJ(e,d,v,t,n),y=On(m,2),x=y[0],w=y[1],S=6;i=x-S/2,l=w-S/2,o=S,f=S}if(o===0||f===0)return[];var b=e.data.contexts[e.WEBGL];b.bindFramebuffer(b.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(b.viewport(0,0,b.canvas.width,b.canvas.height),b_(e,null,Pf.PICKING),e.pickingFrameBuffer.needsDraw=!1);var C=o*f,T=new Uint8Array(C*4);b.readPixels(i,l,o,f,b.RGBA,b.UNSIGNED_BYTE,T),b.bindFramebuffer(b.FRAMEBUFFER,null);for(var N=new Set,A=0;A<C;A++){var R=T.slice(A*4,A*4+4),D=kJ(R)-1;D>=0&&N.add(D)}return N}function JJ(e,t,n){var r=ZJ(e,t,n),a=e.getCachedZSortedEles(),i,l,o=qr(r),f;try{for(o.s();!(f=o.n()).done;){var c=f.value,d=a[c];if(!i&&d.isNode()&&(i=d),!l&&d.isEdge()&&(l=d),i&&l)break}}catch(v){o.e(v)}finally{o.f()}return[i,l].filter(Boolean)}function O0(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function b_(e,t,n){var r;e.webglDebug&&(r=performance.now());var a=e.drawing,i=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&XJ(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var l=e.data.contexts[e.WEBGL];n.screen?(l.clearColor(0,0,0,0),l.enable(l.BLEND),l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA)):l.disable(l.BLEND),l.clear(l.COLOR_BUFFER_BIT|l.DEPTH_BUFFER_BIT),l.viewport(0,0,l.canvas.width,l.canvas.height);var o=YJ(e),f=e.getCachedZSortedEles();if(i=f.length,a.startFrame(o,n),n.screen){for(var c=0;c<f.nondrag.length;c++)O0(e,c,f.nondrag[c]);for(var d=0;d<f.drag.length;d++)O0(e,d,f.drag[d])}else if(n.picking)for(var v=0;v<f.length;v++)O0(e,v,f[v]);a.endFrame(),n.screen&&e.webglDebugShowAtlases&&(QJ(e),WJ(e)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var m=performance.now(),y=!1,x=Math.ceil(m-r),w=a.getDebugInfo(),S=["".concat(i," elements"),"".concat(w.totalInstances," instances"),"".concat(w.batchCount," batches"),"".concat(w.totalAtlases," atlases"),"".concat(w.wrappedCount," wrapped textures"),"".concat(w.simpleCount," simple shapes")].join(", ");if(y)console.log("WebGL (".concat(n.name,") - time ").concat(x,"ms, ").concat(S));else{console.log("WebGL (".concat(n.name,") - frame time ").concat(x,"ms")),console.log("Totals:"),console.log(" ".concat(S)),console.log("Texture Atlases Used:");var b=w.atlasInfo,C=qr(b),T;try{for(C.s();!(T=C.n()).done;){var N=T.value;console.log(" ".concat(N.type,": ").concat(N.keyCount," keys, ").concat(N.atlasCount," atlases"))}}catch(A){C.e(A)}finally{C.f()}console.log("")}}e.data.gc&&(console.log("Garbage Collect!"),e.data.gc=!1,a.gc())}var Sl={};Sl.drawPolygonPath=function(e,t,n,r,a,i){var l=r/2,o=a/2;e.beginPath&&e.beginPath(),e.moveTo(t+l*i[0],n+o*i[1]);for(var f=1;f<i.length/2;f++)e.lineTo(t+l*i[f*2],n+o*i[f*2+1]);e.closePath()};Sl.drawRoundPolygonPath=function(e,t,n,r,a,i,l){l.forEach(function(o){return t_(e,o)}),e.closePath()};Sl.drawRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?cl(r,a):Math.min(i,o,l);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.arcTo(t+l,n-o,t+l,n,f),e.arcTo(t+l,n+o,t,n+o,f),e.arcTo(t-l,n+o,t-l,n,f),e.arcTo(t-l,n-o,t,n-o,f),e.lineTo(t,n-o),e.closePath()};Sl.drawBottomRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?cl(r,a):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.lineTo(t+l,n-o),e.lineTo(t+l,n),e.arcTo(t+l,n+o,t,n+o,f),e.arcTo(t-l,n+o,t-l,n,f),e.lineTo(t-l,n-o),e.lineTo(t,n-o),e.closePath()};Sl.drawCutRectanglePath=function(e,t,n,r,a,i,l){var o=r/2,f=a/2,c=l==="auto"?Ew():l;e.beginPath&&e.beginPath(),e.moveTo(t-o+c,n-f),e.lineTo(t+o-c,n-f),e.lineTo(t+o,n-f+c),e.lineTo(t+o,n+f-c),e.lineTo(t+o-c,n+f),e.lineTo(t-o+c,n+f),e.lineTo(t-o,n+f-c),e.lineTo(t-o,n-f+c),e.closePath()};Sl.drawBarrelPath=function(e,t,n,r,a){var i=r/2,l=a/2,o=t-i,f=t+i,c=n-l,d=n+l,v=Bb(r,a),m=v.widthOffset,y=v.heightOffset,x=v.ctrlPtOffsetPct*m;e.beginPath&&e.beginPath(),e.moveTo(o,c+y),e.lineTo(o,d-y),e.quadraticCurveTo(o+x,d,o+m,d),e.lineTo(f-m,d),e.quadraticCurveTo(f-x,d,f,d-y),e.lineTo(f,c+y),e.quadraticCurveTo(f-x,c,f-m,c),e.lineTo(o+m,c),e.quadraticCurveTo(o+x,c,o,c+y),e.closePath()};var JA=Math.sin(0),eR=Math.cos(0),Wb={},Zb={},w_=Math.PI/40;for(var xu=0*Math.PI;xu<2*Math.PI;xu+=w_)Wb[xu]=Math.sin(xu),Zb[xu]=Math.cos(xu);Sl.drawEllipsePath=function(e,t,n,r,a){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,a/2,0,0,2*Math.PI);else for(var i,l,o=r/2,f=a/2,c=0*Math.PI;c<2*Math.PI;c+=w_)i=t-o*Wb[c]*JA+o*Zb[c]*eR,l=n+f*Zb[c]*JA+f*Wb[c]*eR,c===0?e.moveTo(i,l):e.lineTo(i,l);e.closePath()};var jd={};jd.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]};jd.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=e.full?Math.ceil(r.w):a[2],l=e.full?Math.ceil(r.h):a[3],o=Re(e.maxWidth)||Re(e.maxHeight),f=this.getPixelRatio(),c=1;if(e.scale!==void 0)i*=e.scale,l*=e.scale,c=e.scale;else if(o){var d=1/0,v=1/0;Re(e.maxWidth)&&(d=c*e.maxWidth/i),Re(e.maxHeight)&&(v=c*e.maxHeight/l),c=Math.min(d,v),i*=c,l*=c}o||(i*=f,l*=f,c*=f);var m=document.createElement("canvas");m.width=i,m.height=l,m.style.width=i+"px",m.style.height=l+"px";var y=m.getContext("2d");if(i>0&&l>0){y.clearRect(0,0,i,l),y.globalCompositeOperation="source-over";var x=this.getCachedZSortedEles();if(e.full)y.translate(-r.x1*c,-r.y1*c),y.scale(c,c),this.drawElements(y,x),y.scale(1/c,1/c),y.translate(r.x1*c,r.y1*c);else{var w=t.pan(),S={x:w.x*c,y:w.y*c};c*=t.zoom(),y.translate(S.x,S.y),y.scale(c,c),this.drawElements(y,x),y.scale(1/c,1/c),y.translate(-S.x,-S.y)}e.bg&&(y.globalCompositeOperation="destination-over",y.fillStyle=e.bg,y.rect(0,0,i,l),y.fill())}return m};function eee(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:t})}function tR(e){var t=e.indexOf(",");return e.substr(t+1)}function S_(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new dc(function(a,i){try{t.toBlob(function(l){l!=null?a(l):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(l){i(l)}});case"blob":return eee(tR(r()),n);case"base64":return tR(r());case"base64uri":default:return r()}}jd.png=function(e){return S_(e,this.bufferCanvasImage(e),"image/png")};jd.jpg=function(e){return S_(e,this.bufferCanvasImage(e),"image/jpeg")};var E_={};E_.nodeShapeImpl=function(e,t,n,r,a,i,l,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,a,i);case"polygon":return this.drawPolygonPath(t,n,r,a,i,l);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,a,i,l,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,a,i,l,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,a,i,o);case"barrel":return this.drawBarrelPath(t,n,r,a,i)}};var tee=C_,xt=C_.prototype;xt.CANVAS_LAYERS=3;xt.SELECT_BOX=0;xt.DRAG=1;xt.NODE=2;xt.WEBGL=3;xt.CANVAS_TYPES=["2d","2d","2d","webgl2"];xt.BUFFER_COUNT=3;xt.TEXTURE_BUFFER=0;xt.MOTIONBLUR_BUFFER_NODE=1;xt.MOTIONBLUR_BUFFER_DRAG=2;function C_(e){var t=this,n=t.cy.window(),r=n.document;e.webgl&&(xt.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:new Array(xt.CANVAS_LAYERS),contexts:new Array(xt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(xt.CANVAS_LAYERS),bufferCanvases:new Array(xt.BUFFER_COUNT),bufferContexts:new Array(xt.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=r.createElement("div");var l=t.data.canvasContainer.style;t.data.canvasContainer.style[a]=i,l.position="relative",l.zIndex="0",l.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[a]=i;var f={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};XK()&&(f["-ms-touch-action"]="none",f["touch-action"]="none");for(var c=0;c<xt.CANVAS_LAYERS;c++){var d=t.data.canvases[c]=r.createElement("canvas"),v=xt.CANVAS_TYPES[c];t.data.contexts[c]=d.getContext(v),t.data.contexts[c]||ln("Could not create canvas of type "+v),Object.keys(f).forEach(function(fe){d.style[fe]=f[fe]}),d.style.position="absolute",d.setAttribute("data-id","layer"+c),d.style.zIndex=String(xt.CANVAS_LAYERS-c),t.data.canvasContainer.appendChild(d),t.data.canvasNeedsRedraw[c]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[xt.NODE].setAttribute("data-id","layer"+xt.NODE+"-node"),t.data.canvases[xt.SELECT_BOX].setAttribute("data-id","layer"+xt.SELECT_BOX+"-selectbox"),t.data.canvases[xt.DRAG].setAttribute("data-id","layer"+xt.DRAG+"-drag"),t.data.canvases[xt.WEBGL]&&t.data.canvases[xt.WEBGL].setAttribute("data-id","layer"+xt.WEBGL+"-webgl");for(var c=0;c<xt.BUFFER_COUNT;c++)t.data.bufferCanvases[c]=r.createElement("canvas"),t.data.bufferContexts[c]=t.data.bufferCanvases[c].getContext("2d"),t.data.bufferCanvases[c].style.position="absolute",t.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),t.data.bufferCanvases[c].style.zIndex=String(-c-1),t.data.bufferCanvases[c].style.visibility="hidden";t.pathsEnabled=!0;var m=kr(),y=function(J){return{x:(J.x1+J.x2)/2,y:(J.y1+J.y2)/2}},x=function(J){return{x:-J.w/2,y:-J.h/2}},w=function(J){var ne=J[0]._private,re=ne.oldBackgroundTimestamp===ne.backgroundTimestamp;return!re},S=function(J){return J[0]._private.nodeKey},b=function(J){return J[0]._private.labelStyleKey},C=function(J){return J[0]._private.sourceLabelStyleKey},T=function(J){return J[0]._private.targetLabelStyleKey},N=function(J,ne,re,ge,ke){return t.drawElement(J,ne,re,!1,!1,ke)},A=function(J,ne,re,ge,ke){return t.drawElementText(J,ne,re,ge,"main",ke)},R=function(J,ne,re,ge,ke){return t.drawElementText(J,ne,re,ge,"source",ke)},D=function(J,ne,re,ge,ke){return t.drawElementText(J,ne,re,ge,"target",ke)},L=function(J){return J.boundingBox(),J[0]._private.bodyBounds},_=function(J){return J.boundingBox(),J[0]._private.labelBounds.main||m},M=function(J){return J.boundingBox(),J[0]._private.labelBounds.source||m},z=function(J){return J.boundingBox(),J[0]._private.labelBounds.target||m},P=function(J,ne){return ne},G=function(J){return y(L(J))},I=function(J,ne,re){var ge=J?J+"-":"";return{x:ne.x+re.pstyle(ge+"text-margin-x").pfValue,y:ne.y+re.pstyle(ge+"text-margin-y").pfValue}},F=function(J,ne,re){var ge=J[0]._private.rscratch;return{x:ge[ne],y:ge[re]}},B=function(J){return I("",F(J,"labelX","labelY"),J)},H=function(J){return I("source",F(J,"sourceLabelX","sourceLabelY"),J)},Y=function(J){return I("target",F(J,"targetLabelX","targetLabelY"),J)},Q=function(J){return x(L(J))},V=function(J){return x(M(J))},q=function(J){return x(z(J))},X=function(J){var ne=_(J),re=x(_(J));if(J.isNode()){switch(J.pstyle("text-halign").value){case"left":re.x=-ne.w-(ne.leftPad||0);break;case"right":re.x=-(ne.rightPad||0);break}switch(J.pstyle("text-valign").value){case"top":re.y=-ne.h-(ne.topPad||0);break;case"bottom":re.y=-(ne.botPad||0);break}}return re},U=t.data.eleTxrCache=new jf(t,{getKey:S,doesEleInvalidateKey:w,drawElement:N,getBoundingBox:L,getRotationPoint:G,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),te=t.data.lblTxrCache=new jf(t,{getKey:b,drawElement:A,getBoundingBox:_,getRotationPoint:B,getRotationOffset:X,isVisible:P}),ie=t.data.slbTxrCache=new jf(t,{getKey:C,drawElement:R,getBoundingBox:M,getRotationPoint:H,getRotationOffset:V,isVisible:P}),oe=t.data.tlbTxrCache=new jf(t,{getKey:T,drawElement:D,getBoundingBox:z,getRotationPoint:Y,getRotationOffset:q,isVisible:P}),ae=t.data.lyrTxrCache=new f_(t);t.onUpdateEleCalcs(function(J,ne){U.invalidateElements(ne),te.invalidateElements(ne),ie.invalidateElements(ne),oe.invalidateElements(ne),ae.invalidateElements(ne);for(var re=0;re<ne.length;re++){var ge=ne[re]._private;ge.oldBackgroundTimestamp=ge.backgroundTimestamp}});var we=function(J){for(var ne=0;ne<J.length;ne++)ae.enqueueElementRefinement(J[ne].ele)};U.onDequeue(we),te.onDequeue(we),ie.onDequeue(we),oe.onDequeue(we),e.webgl&&t.initWebgl(e,{getStyleKey:S,getLabelKey:b,getSourceLabelKey:C,getTargetLabelKey:T,drawElement:N,drawLabel:A,drawSourceLabel:R,drawTargetLabel:D,getElementBox:L,getLabelBox:_,getSourceLabelBox:M,getTargetLabelBox:z,getElementRotationPoint:G,getElementRotationOffset:Q,getLabelRotationPoint:B,getSourceLabelRotationPoint:H,getTargetLabelRotationPoint:Y,getLabelRotationOffset:X,getSourceLabelRotationOffset:V,getTargetLabelRotationOffset:q})}xt.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[xt.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[xt.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[xt.SELECT_BOX]=t;break;case"gc":n.data.gc=!0;break}};var nee=typeof Path2D<"u";xt.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e};xt.usePaths=function(){return nee&&this.pathsEnabled};xt.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)};xt.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled};xt.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":Fn(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=e,n.height=t}return n};[d_,vi,ns,Bw,Co,wl,Nr,g_,Sl,jd,E_].forEach(function(e){rt(xt,e)});var ree=[{name:"null",impl:ZL},{name:"base",impl:o_},{name:"canvas",impl:tee}],aee=[{type:"layout",extensions:RZ},{type:"renderer",extensions:ree}],T_={},k_={};function N_(e,t,n){var r=n,a=function(L){Bt("Can not register `"+t+"` for `"+e+"` since `"+L+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(ed.prototype[t])return a(t);ed.prototype[t]=n}else if(e==="collection"){if(sr.prototype[t])return a(t);sr.prototype[t]=n}else if(e==="layout"){for(var i=function(L){this.options=L,n.call(this,L),jt(this._private)||(this._private={}),this._private.cy=L.cy,this._private.listeners=[],this.createEmitter()},l=i.prototype=Object.create(n.prototype),o=[],f=0;f<o.length;f++){var c=o[f];l[c]=l[c]||function(){return this}}l.start&&!l.run?l.run=function(){return this.start(),this}:!l.start&&l.run&&(l.start=function(){return this.run(),this});var d=n.prototype.stop;l.stop=function(){var D=this.options;if(D&&D.animate){var L=this.animations;if(L)for(var _=0;_<L.length;_++)L[_].stop()}return d?d.call(this):this.emit("layoutstop"),this},l.destroy||(l.destroy=function(){return this}),l.cy=function(){return this._private.cy};var v=function(L){return L._private.cy},m={addEventFields:function(L,_){_.layout=L,_.cy=v(L),_.target=L},bubble:function(){return!0},parent:function(L){return v(L)}};rt(l,{createEmitter:function(){return this._private.emitter=new tm(m,this),this},emitter:function(){return this._private.emitter},on:function(L,_){return this.emitter().on(L,_),this},one:function(L,_){return this.emitter().one(L,_),this},once:function(L,_){return this.emitter().one(L,_),this},removeListener:function(L,_){return this.emitter().removeListener(L,_),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(L,_){return this.emitter().emit(L,_),this}}),_t.eventAliasesOn(l),r=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var y=A_("renderer","base"),x=y.prototype,w=n,S=n.prototype,b=function(){y.apply(this,arguments),w.apply(this,arguments)},C=b.prototype;for(var T in x){var N=x[T],A=S[T]!=null;if(A)return a(T);C[T]=N}for(var R in S)C[R]=S[R];x.clientFunctions.forEach(function(D){C[D]=C[D]||function(){ln("Renderer does not implement `renderer."+D+"()` on its prototype")}}),r=b}else if(e==="__proto__"||e==="constructor"||e==="prototype")return ln(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return $O({map:T_,keys:[e,t],value:r})}function A_(e,t){return KO({map:T_,keys:[e,t]})}function iee(e,t,n,r,a){return $O({map:k_,keys:[e,t,n,r],value:a})}function see(e,t,n,r){return KO({map:k_,keys:[e,t,n,r]})}var Jb=function(){if(arguments.length===2)return A_.apply(null,arguments);if(arguments.length===3)return N_.apply(null,arguments);if(arguments.length===4)return see.apply(null,arguments);if(arguments.length===5)return iee.apply(null,arguments);ln("Invalid extension access syntax")};ed.prototype.extension=Jb;aee.forEach(function(e){e.extensions.forEach(function(t){N_(e.type,t.name,t.impl)})});var hp=function(){if(!(this instanceof hp))return new hp;this.length=0},bo=hp.prototype;bo.instanceString=function(){return"stylesheet"};bo.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this};bo.css=function(e,t){var n=this.length-1;if(et(e))this[n].properties.push({name:e,value:t});else if(jt(e))for(var r=e,a=Object.keys(r),i=0;i<a.length;i++){var l=a[i],o=r[l];if(o!=null){var f=Wn.properties[l]||Wn.properties[Gp(l)];if(f!=null){var c=f.name,d=o;this[n].properties.push({name:c,value:d})}}}return this};bo.style=bo.css;bo.generateStyle=function(e){var t=new Wn(e);return this.appendToStyle(t)};bo.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,a=n.properties;e.selector(r);for(var i=0;i<a.length;i++){var l=a[i];e.css(l.name,l.value)}}return e};var lee="3.33.1",wo=function(t){if(t===void 0&&(t={}),jt(t))return new ed(t);if(et(t))return Jb.apply(Jb,arguments)};wo.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(wo),e.apply(null,t),this};wo.warnings=function(e){return eL(e)};wo.version=lee;wo.stylesheet=wo.Stylesheet=hp;const ar={sage:"#abcfb8",ochre:"#edbf7f",terracotta:"#ffb4a1",neutral:"#8b928c",dimNeutral:"#6e7370",onSurface:"#e5e2e1",surface:"#111111"},oee={concept:ar.sage,component:ar.ochre,bug:ar.terracotta,tool:ar.neutral,file:ar.neutral,spore:ar.sage,session:ar.ochre,other:ar.dimNeutral},uee=ar.dimNeutral,nR=24,cee=60,fee=12,dee=10,hee=8,L0=1.5,gv=.25,_0=.7,vee=9,pee=.7,mee=4,gee=.6,yee=1e4,xee=120,bee=.2,wee=600,B0=50,rR=20,aR={concept:"Concept",component:"Component",bug:"Bug",tool:"Tool",file:"File",spore:"Spore",session:"Session",other:"Other"};function See(e){const t=Math.min(e/fee,1);return nR+t*(cee-nR)}function Eee(e){return e.length<=rR?e:e.slice(0,rR-1)+"…"}function iR(e){return oee[e==null?void 0:e.toLowerCase()]??uee}function Cee({nodes:e,edges:t,onNodeSelect:n}){const r=j.useRef(null),a=j.useRef(null),i=j.useRef(n);i.current=n,j.useEffect(()=>{if(!r.current||e.length===0)return;const o=new Map(e.map(y=>[y.id,y])),f=new Map;for(const y of e)f.set(y.id,0);for(const y of t)f.set(y.source_id,(f.get(y.source_id)??0)+1),f.set(y.target_id,(f.get(y.target_id)??0)+1);const c=[...e.map(y=>{var w;const x=aR[(w=y.type)==null?void 0:w.toLowerCase()]??aR.other;return{data:{id:y.id,label:`${Eee(y.name)}
|
|
788
|
+
${x}`,fullLabel:y.name,type:y.type,degree:f.get(y.id)??0,nodeSize:See(f.get(y.id)??0)}}}),...t.map((y,x)=>({data:{id:`edge-${x}`,source:y.source_id,target:y.target_id,label:y.label??"",weight:y.weight??1}}))],d=r.current.getBoundingClientRect();if(d.width===0||d.height===0)return;const v=wo({container:r.current,elements:c,style:[{selector:"node",style:{label:"data(label)","background-color":y=>iR(y.data("type")),"background-opacity":.9,color:ar.onSurface,"font-size":dee,"font-family":"Inter, system-ui, sans-serif","text-valign":"bottom","text-margin-y":hee,"text-outline-color":ar.surface,"text-outline-width":2,"text-outline-opacity":.8,"text-wrap":"wrap","text-max-width":"120px",width:"data(nodeSize)",height:"data(nodeSize)","border-width":0,"border-color":ar.sage,"border-opacity":0,"overlay-opacity":0}},{selector:"node:active",style:{"overlay-opacity":.08,"overlay-color":ar.sage}},{selector:"node:selected",style:{"border-width":mee,"border-color":y=>iR(y.data("type")),"border-opacity":gee,"background-opacity":1}},{selector:"edge",style:{width:L0,"line-color":ar.neutral,"line-opacity":gv,"curve-style":"unbundled-bezier","control-point-distances":[40],"control-point-weights":[.5],"target-arrow-shape":"triangle","target-arrow-color":ar.neutral,"arrow-scale":pee,label:"data(label)","font-size":vee,"font-family":"Inter, system-ui, sans-serif",color:ar.neutral,"text-opacity":0,"text-rotation":"autorotate","text-margin-y":-8,"text-outline-color":ar.surface,"text-outline-width":2,"text-outline-opacity":.7}},{selector:"edge:active",style:{"text-opacity":1,"line-opacity":_0}},{selector:"node.faded",style:{opacity:.3}},{selector:"edge.faded",style:{opacity:.1}}],layout:{name:"preset"},userZoomingEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,minZoom:.3,maxZoom:3}),m=v.layout({name:"cose",animate:!0,animationDuration:wee,nodeRepulsion:()=>yee,idealEdgeLength:()=>xee,gravity:bee,nodeDimensionsIncludeLabels:!0,fit:!0,padding:B0});return m.on("layoutstop",()=>{const y=v.nodes().maxDegree(!1);y.degree(!1)>2&&v.nodes().length>20?v.animate({center:{eles:y},zoom:1.2,duration:300,easing:"ease-out"}):v.fit(void 0,B0)}),m.run(),v.on("tap","node",y=>{var C;const x=y.target,w=x.data();v.elements().removeClass("faded");const S=x.closedNeighborhood();v.elements().not(S).addClass("faded"),x.connectedEdges().style({"line-opacity":_0,"text-opacity":.9,width:2});const b=o.get(w.id);(C=i.current)==null||C.call(i,b??{id:w.id,name:w.fullLabel??w.label,type:w.type})}),v.on("tap",y=>{var x;y.target===v&&(v.elements().removeClass("faded"),v.edges().style({"line-opacity":gv,"text-opacity":0,width:L0}),(x=i.current)==null||x.call(i,null))}),v.on("mouseover","edge",y=>{y.target.style("text-opacity",1),y.target.style("line-opacity",_0)}),v.on("mouseout","edge",y=>{const x=v.$("node:selected");x.length>0&&x.connectedEdges().contains(y.target)||(y.target.style("text-opacity",0),y.target.style("line-opacity",gv))}),a.current=v,()=>{v.destroy(),a.current=null}},[e,t]);const l=j.useCallback(()=>{const o=a.current;o&&(o.elements().removeClass("faded"),o.edges().style({"line-opacity":gv,"text-opacity":0,width:L0}),o.fit(void 0,B0))},[]);return{containerRef:r,resetView:l}}function Tee({nodes:e,edges:t,onNodeSelect:n}){const{containerRef:r,resetView:a}=Cee({nodes:e,edges:t,onNodeSelect:n});return p.jsxs("div",{className:"absolute inset-0",children:[p.jsx("div",{className:"absolute inset-0 rounded-md bg-surface-container-lowest",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(139, 146, 140, 0.05) 1px, transparent 0)",backgroundSize:"40px 40px"}}),p.jsx("div",{ref:r,className:"absolute inset-0 rounded-md"}),p.jsx("div",{className:"absolute top-3 right-3 z-10 flex items-center gap-2",children:p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:a,className:"gap-1.5",children:[p.jsx(m1,{className:"h-3.5 w-3.5"}),"Reset"]})}),e.length>0&&p.jsxs("div",{className:"absolute bottom-3 left-3 z-10 flex items-center gap-3 font-mono text-[10px] text-on-surface-variant/60",children:[p.jsxs("span",{children:[e.length," nodes"]}),p.jsxs("span",{children:[t.length," edges"]})]}),e.length===0&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:p.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No nodes to display"})})]})}const sR=[{type:"concept",label:"Concept",dotColor:"bg-primary"},{type:"component",label:"Component",dotColor:"bg-secondary"},{type:"bug",label:"Bug",dotColor:"bg-tertiary"},{type:"tool",label:"Tool",dotColor:"bg-outline"},{type:"file",label:"File",dotColor:"bg-outline"},{type:"spore",label:"Spore",dotColor:"bg-primary"},{type:"session",label:"Session",dotColor:"bg-secondary"},{type:"other",label:"Other",dotColor:"bg-on-surface-variant"}],kee=[{type:"RELATES_TO",label:"Relates To"},{type:"DERIVES_FROM",label:"Derives From"},{type:"REFERENCES",label:"References"},{type:"DEPENDS_ON",label:"Depends On"},{type:"AFFECTS",label:"Affects"}];function Nee({entityCounts:e={},enabledTypes:t,onToggleType:n,searchQuery:r,onSearchChange:a,enabledEdgeTypes:i,onToggleEdgeType:l}){const[o,f]=j.useState(!1),c=Object.values(e).reduce((v,m)=>v+m,0),d=sR.length-t.size;return p.jsxs("div",{className:"absolute top-3 left-3 z-10",children:[!o&&p.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex items-center gap-2 rounded-md bg-surface-container/90 backdrop-blur-sm px-3 py-2 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high/90 transition-colors shadow-sm","aria-label":"Open graph filters",children:[p.jsx(YP,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"font-sans text-xs font-medium",children:"Filters"}),d>0&&p.jsx("span",{className:"font-mono text-[10px] bg-primary/20 text-primary rounded-full px-1.5 py-0.5 leading-none",children:d}),p.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/50",children:c})]}),o&&p.jsxs("div",{className:"w-52 rounded-md bg-surface-container/95 backdrop-blur-md shadow-lg border border-outline-variant/20 overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-outline-variant/10",children:[p.jsx("span",{className:"font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",children:"Filters"}),p.jsx("button",{type:"button",onClick:()=>f(!1),className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface transition-colors","aria-label":"Close filters",children:p.jsx(rc,{className:"h-3.5 w-3.5"})})]}),p.jsxs("div",{className:"p-3 space-y-4",children:[p.jsxs("div",{className:"relative",children:[p.jsx(nc,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-on-surface-variant/50"}),p.jsx(fn,{placeholder:"Search nodes...",value:r,onChange:v=>a(v.target.value),className:"text-xs pl-7 h-7"})]}),p.jsx("div",{className:"space-y-1",children:sR.map(v=>{const m=e[v.type]??0,y=t.has(v.type);return p.jsxs("label",{className:"flex items-center gap-2 py-1 cursor-pointer group",children:[p.jsx("input",{type:"checkbox",checked:y,onChange:()=>n(v.type),className:"sr-only"}),p.jsx("div",{className:Ae("h-3 w-3 rounded-sm flex items-center justify-center transition-colors",y?"bg-surface-container-high":"bg-surface-container-lowest"),children:y&&p.jsx("div",{className:Ae("h-1.5 w-1.5 rounded-full",v.dotColor)})}),p.jsx("span",{className:Ae("font-sans text-xs transition-colors",y?"text-on-surface":"text-on-surface-variant/50"),children:v.label}),p.jsx("span",{className:"ml-auto font-mono text-[10px] text-on-surface-variant/50",children:m})]},v.type)})}),i&&l&&p.jsxs("div",{className:"space-y-1 pt-1 border-t border-outline-variant/10",children:[p.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant/60 pt-1",children:"Edges"}),kee.map(v=>{const m=i.has(v.type);return p.jsxs("label",{className:"flex items-center gap-2 py-0.5 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:m,onChange:()=>l(v.type),className:"sr-only"}),p.jsx("div",{className:Ae("h-2.5 w-2.5 rounded-sm flex items-center justify-center transition-colors",m?"bg-surface-container-high":"bg-surface-container-lowest"),children:m&&p.jsx("div",{className:"h-1 w-1 rounded-full bg-outline"})}),p.jsx("span",{className:Ae("font-sans text-[11px] transition-colors",m?"text-on-surface-variant":"text-on-surface-variant/40"),children:v.label})]},v.type)})]})]})]})]})}const lR=400,Aee={concept:"default",component:"warning",bug:"destructive",tool:"secondary",file:"secondary",spore:"default",session:"warning"},oR={concept:"bg-primary",component:"bg-secondary",bug:"bg-tertiary",tool:"bg-outline",file:"bg-outline",spore:"bg-primary",session:"bg-secondary"};function Bs({label:e,value:t}){return p.jsxs("div",{className:"flex justify-between items-baseline py-1",children:[p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:e}),p.jsx("span",{className:"font-mono text-xs text-on-surface text-right max-w-[160px] truncate",children:t})]})}function uR(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function Ree({node:e,edges:t,nodes:n,metadata:r,markdownPreview:a,connectedSpores:i,onClose:l,onNodeSelect:o}){const f=Wi();if(!e)return null;const c=e.type.toLowerCase(),d=Aee[c]??"secondary",v=oR[c]??"bg-outline",m=new Map((n??[]).map(b=>[b.id,b])),y=[];for(const b of t??[])if(b.source_id===e.id){const C=m.get(b.target_id);C&&y.push({nodeId:C.id,nodeName:C.name,nodeType:C.type,edgeLabel:b.label??"connected",direction:"outgoing"})}else if(b.target_id===e.id){const C=m.get(b.source_id);C&&y.push({nodeId:C.id,nodeName:C.name,nodeType:C.type,edgeLabel:b.label??"connected",direction:"incoming"})}const x=a??e.content,w=x&&x.length>lR?x.slice(0,lR)+"…":x,S=e.type==="spore"?"Observation":e.type==="session"?"Summary":"Notes";return p.jsxs(st,{glass:!0,className:"absolute top-0 right-0 z-20 w-[320px] max-h-full overflow-y-auto flex flex-col shadow-lg border border-outline-variant/15 rounded-md",children:[p.jsx("div",{className:"p-4 pb-3",children:p.jsxs("div",{className:"flex items-start justify-between gap-2",children:[p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[p.jsx("div",{className:`h-2 w-2 rounded-full ${v} shrink-0`}),p.jsx(Ln,{variant:d,className:"text-[10px] uppercase",children:e.observation_type??e.type})]}),p.jsx("h2",{className:"font-serif text-lg text-on-surface leading-tight break-words",children:e.name}),uR(e)&&p.jsxs("button",{onClick:()=>f(uR(e)),className:"inline-flex items-center gap-1 mt-1.5 font-sans text-xs text-on-surface-variant hover:text-primary transition-colors group cursor-pointer",children:[p.jsxs("span",{children:["View ",e.type]}),p.jsx(p1,{className:"h-3 w-3 group-hover:translate-x-0.5 transition-transform"})]})]}),l&&p.jsx("button",{onClick:l,className:"shrink-0 rounded-md p-1 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors",children:p.jsx(rc,{className:"h-4 w-4"})})]})}),p.jsx("div",{className:"h-px bg-surface-container-high/50"}),p.jsxs("div",{className:"px-4 py-3 space-y-0.5",children:[p.jsx(Zt,{children:"Metadata"}),p.jsxs("div",{className:"mt-1.5",children:[p.jsx(Bs,{label:"Type",value:e.observation_type??e.type}),p.jsx(Bs,{label:"ID",value:e.id.slice(0,12)+"…"}),e.status&&p.jsx(Bs,{label:"Status",value:e.status}),e.created_at!=null&&p.jsx(Bs,{label:"Created",value:new Date(e.created_at).toLocaleDateString()}),e.mention_count!=null&&e.mention_count>0&&p.jsx(Bs,{label:"Mentions",value:String(e.mention_count)}),p.jsx(Bs,{label:"Connections",value:String(y.length)}),e.depth!==void 0&&p.jsx(Bs,{label:"Depth",value:String(e.depth)}),r&&Object.entries(r).map(([b,C])=>p.jsx(Bs,{label:b,value:C},b))]})]}),w&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"h-px bg-surface-container-high/50"}),p.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[p.jsx(Zt,{children:S}),p.jsx(st,{level:"lowest",className:"p-3 font-sans text-xs text-on-surface-variant whitespace-pre-wrap leading-relaxed",children:w})]})]}),y.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"h-px bg-surface-container-high/50"}),p.jsxs("div",{className:"px-4 py-3 space-y-2",children:[p.jsxs(Zt,{children:["Connections (",y.length,")"]}),p.jsx("div",{className:"space-y-1",children:y.map((b,C)=>{const T=b.nodeType.toLowerCase(),N=oR[T]??"bg-outline",A=m.get(b.nodeId);return p.jsxs("button",{className:"w-full flex items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-surface-container-high/50 transition-colors group",onClick:()=>A&&(o==null?void 0:o(A)),children:[p.jsx("div",{className:`h-2 w-2 rounded-full ${N} shrink-0`}),p.jsx("span",{className:"font-sans text-xs text-on-surface truncate flex-1 group-hover:text-primary transition-colors",children:b.nodeName}),p.jsx(ab,{className:`h-3 w-3 shrink-0 ${b.direction==="incoming"?"rotate-180":""} text-on-surface-variant/50`}),p.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 shrink-0 max-w-[80px] truncate",children:b.edgeLabel})]},`${b.nodeId}-${b.edgeLabel}-${C}`)})})]})]}),i&&i.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"h-px bg-surface-container-high/50"}),p.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[p.jsx(Zt,{children:"Connected Spores"}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(b=>p.jsx(Ln,{variant:"secondary",className:"cursor-pointer text-[10px] hover:bg-surface-container-highest transition-colors",children:b.name},b.id))})]})]})]})}const jee=15e3,Dee=3e4,Mee=3e4,Oee=6e4;function Lee(e){const t=new URLSearchParams;e!=null&&e.type&&t.set("type",e.type),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/spores?${n}`:"/spores";return Tn({queryKey:["spores",e],queryFn:({signal:a})=>bt(r,{signal:a}),staleTime:jee})}function _ee(e){return Tn({queryKey:["spore",e],queryFn:({signal:t})=>bt(`/spores/${e}`,{signal:t}),enabled:e!==void 0,staleTime:Dee})}function Bee(){return Tn({queryKey:["full-graph"],queryFn:({signal:e})=>bt("/graph",{signal:e}),staleTime:Mee})}function Pee(e){const t=e?`/digest?agent_id=${encodeURIComponent(e)}`:"/digest";return Tn({queryKey:["digest",e],queryFn:({signal:n})=>bt(t,{signal:n}),staleTime:Oee})}function R_(e){switch(e){case"wisdom":return"bg-primary/15 text-primary";case"discovery":return"bg-primary/15 text-primary";case"decision":return"bg-secondary/15 text-secondary";case"trade_off":return"bg-secondary/15 text-secondary";case"gotcha":return"bg-tertiary/15 text-tertiary";case"bug_fix":return"bg-tertiary/15 text-tertiary";default:return"bg-surface-container text-on-surface-variant"}}function j_(e){switch(e){case"active":return"bg-primary/15 text-primary";case"consolidated":return"bg-surface-container-high text-on-surface-variant";case"superseded":return"bg-tertiary/10 text-tertiary/70";default:return"bg-surface-container text-on-surface-variant"}}function lo(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}const cR=120,zee=1e3,Iee=8,Fee=[Tr,"gotcha","decision","discovery","trade_off","bug_fix"],qee=[Tr,"active","superseded","consolidated"],Uee=[{key:"type",label:"Type",options:Fee.map(e=>({value:e,label:e===Tr?"All types":lo(e)}))},{key:"status",label:"Status",options:qee.map(e=>({value:e,label:e===Tr?"All statuses":lo(e)}))}];function Vee(e){return new Date(e*zee).toLocaleDateString()}function Hee({spore:e,onClick:t,isSelected:n}){return p.jsx(st,{level:n?"high":"low",className:Ae("p-4 cursor-pointer transition-all duration-150 hover:bg-surface-container-high hover:shadow-[inset_3px_0_0_var(--primary)] rounded-lg","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",n&&"ring-1 ring-primary/30"),onClick:t,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())},tabIndex:0,role:"button","aria-label":`${lo(e.observation_type)} spore: ${db(e.content,cR)}`,"aria-pressed":n,children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[p.jsx("span",{className:Ae("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",R_(e.observation_type)),children:lo(e.observation_type)}),p.jsx("span",{className:Ae("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",j_(e.status)),children:lo(e.status)}),e.importance!==null&&p.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.importance.toFixed(1)})]}),p.jsx("p",{className:"font-sans text-sm text-on-surface",children:db(e.content,cR)})]}),p.jsxs("div",{className:"shrink-0 text-right space-y-1",children:[e.session_id&&p.jsx("div",{className:"font-mono text-xs text-on-surface-variant",children:e.session_id.slice(0,Iee)}),p.jsx("div",{className:"font-sans text-xs text-on-surface-variant",children:Vee(e.created_at)})]})]})})}function Gee(){return p.jsx(st,{level:"low",className:"p-4 rounded-lg",children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs("div",{className:"flex-1 space-y-2",children:[p.jsxs("div",{className:"flex gap-2",children:[p.jsx("div",{className:"h-5 w-16 animate-pulse rounded bg-surface-container"}),p.jsx("div",{className:"h-5 w-14 animate-pulse rounded bg-surface-container"})]}),p.jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-surface-container"})]}),p.jsxs("div",{className:"shrink-0 space-y-1",children:[p.jsx("div",{className:"h-3 w-14 animate-pulse rounded bg-surface-container"}),p.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-surface-container"})]})]})})}function $ee({onSelectSpore:e,selectedSporeId:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=Y1({initialFilters:{type:Tr,status:Tr}}),d=c("type"),v=c("status"),{data:m,isLoading:y,isError:x,error:w}=Lee({type:d,status:v,search:r,limit:ni,offset:i}),S=(m==null?void 0:m.spores)??[],b=(m==null?void 0:m.total)??0;return p.jsxs("div",{className:"space-y-3",children:[p.jsx(K1,{searchPlaceholder:"Search spores...",searchValue:n,onSearchChange:o,filters:Uee,filterValues:a,onFilterChange:f}),x?p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Failed to load spores"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:w instanceof Error?w.message:"Unknown error"})]}):p.jsx("div",{className:"space-y-2",children:y?[1,2,3,4,5].map(C=>p.jsx(Gee,{},C)):S.length===0?p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[p.jsx(uz,{className:"h-8 w-8 opacity-30"}),p.jsx("span",{className:"font-sans text-sm",children:b===0&&!r&&!d&&!v?"No spores yet":"No matching spores"}),b===0&&!r&&!d&&!v&&p.jsx("span",{className:"font-sans text-xs",children:"Spores are extracted from session activity by the agent"})]}):S.map(C=>p.jsx(Hee,{spore:C,onClick:()=>e(C),isSelected:C.id===t},C.id))}),p.jsx(Ip,{total:b,offset:i,limit:ni,onPageChange:l})]})}const Kee=12,fR=8;function Yee({type:e}){return p.jsx("span",{className:Ae("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",R_(e)),children:lo(e)})}function Xee({status:e}){return p.jsx("span",{className:Ae("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",j_(e)),children:lo(e)})}function Tf({label:e,value:t,children:n}){return p.jsxs("div",{className:"flex items-start justify-between gap-3 py-1.5",children:[p.jsx("span",{className:"shrink-0 font-sans text-xs text-on-surface-variant",children:e}),n??p.jsx("span",{className:"font-mono text-xs text-on-surface text-right break-all",children:t})]})}function Qee({id:e,onBack:t,onNavigateToSpore:n,onNavigateToGraph:r}){const a=Wi(),{data:i,isLoading:l,isError:o,error:f}=_ee(e);if(l)return p.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[p.jsx(Qn,{className:"h-5 w-5 animate-spin"}),p.jsx("span",{className:"font-sans",children:"Loading spore..."})]});if(o||!i)return p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Spore not found"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:f instanceof Error?f.message:"Unknown error"})]});const c=(()=>{if(!i.tags)return[];if(i.tags.startsWith("["))try{return JSON.parse(i.tags)}catch{}return i.tags.split(",").map(d=>d.trim()).filter(Boolean)})();return p.jsxs("div",{className:"space-y-6",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),"Spores"]}),p.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[p.jsx(Yee,{type:i.observation_type}),p.jsx(Xee,{status:i.status}),i.importance!==null&&p.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Importance: ",p.jsx("span",{className:"text-on-surface font-medium",children:i.importance.toFixed(1)})]}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant ml-auto",children:oi(i.created_at)})]}),p.jsxs(st,{level:"low",className:"p-5",children:[p.jsx(Zt,{className:"mb-2",children:"Observation"}),p.jsx(ui,{content:i.content})]}),i.context&&p.jsxs(st,{level:"low",className:"p-5",children:[p.jsx(Zt,{className:"mb-2",children:"Context"}),p.jsx(ui,{content:i.context})]}),c.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map(d=>p.jsx("span",{className:"inline-flex items-center rounded-full bg-surface-container px-2.5 py-0.5 font-sans text-xs text-on-surface-variant",children:d},d))}),(i.predecessor_id||i.successor_id)&&p.jsxs(st,{level:"low",className:"p-5 space-y-2",children:[p.jsx(Zt,{children:"Resolution History"}),i.predecessor_id&&p.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[p.jsx("span",{children:"Supersedes"}),p.jsxs("button",{className:"font-mono text-primary hover:underline flex items-center gap-1",onClick:()=>n==null?void 0:n(i.predecessor_id),children:[i.predecessor_id.slice(0,fR),p.jsx(ab,{className:"h-3 w-3"})]})]}),i.successor_id&&p.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[p.jsx("span",{children:"Superseded by"}),p.jsxs("button",{className:"font-mono text-primary hover:underline flex items-center gap-1",onClick:()=>n==null?void 0:n(i.successor_id),children:[i.successor_id.slice(0,fR),p.jsx(ab,{className:"h-3 w-3"})]})]})]}),p.jsxs(st,{glass:!0,className:"p-5",children:[p.jsx(Zt,{className:"mb-2",children:"Metadata"}),p.jsxs("div",{className:"text-sm",children:[p.jsx(Tf,{label:"ID",value:i.id}),p.jsx(Tf,{label:"Created",value:fb(i.created_at)}),p.jsx(Tf,{label:"Updated",value:fb(i.updated_at)}),i.session_id&&p.jsx(Tf,{label:"Session",children:p.jsxs("button",{className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",onClick:()=>a(`/sessions/${i.session_id}`),children:[i.session_id.slice(0,Kee),p.jsx(p1,{className:"h-3 w-3"})]})}),i.agent_id&&p.jsx(Tf,{label:"Agent",value:i.agent_id})]})]})]})}const P0=200,Wee={1500:"T1500 — Compact",5e3:"T5000 — Standard",1e4:"T10000 — Full"};function Zee(e){return Wee[e]??`T${e}`}function Jee({tier:e}){const[t,n]=j.useState(!1),r=e.content.length>P0,a=r&&!t?e.content.slice(0,P0)+"…":e.content;return p.jsxs(st,{level:"low",className:"p-5 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[p.jsx("span",{className:"font-mono text-sm text-on-surface font-medium",children:Zee(e.tier)}),p.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Generated ",oi(e.generated_at)]})]}),p.jsx(ui,{content:a}),r&&p.jsx(Ke,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-xs text-on-surface-variant",onClick:()=>n(!t),children:t?p.jsxs(p.Fragment,{children:[p.jsx(FP,{className:"h-3 w-3"}),"Show less"]}):p.jsxs(p.Fragment,{children:[p.jsx(_a,{className:"h-3 w-3"}),"Show more (",e.content.length-P0," more chars)"]})})]})}function ete(){return p.jsxs(st,{level:"low",className:"p-5",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-surface-container"}),p.jsx("div",{className:"h-3 w-20 animate-pulse rounded bg-surface-container"})]}),p.jsxs("div",{className:"space-y-2 mt-3",children:[p.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container"}),p.jsx("div",{className:"h-3 w-4/5 animate-pulse rounded bg-surface-container"}),p.jsx("div",{className:"h-3 w-3/5 animate-pulse rounded bg-surface-container"})]})]})}function tte({agentId:e}){const{data:t,isLoading:n,isError:r,error:a}=Pee(e),i=(t==null?void 0:t.tiers)??[];return n?p.jsx("div",{className:"space-y-4",children:[1,2,3].map(l=>p.jsx(ete,{},l))}):r?p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Failed to load digest"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:a instanceof Error?a.message:"Unknown error"})]}):i.length===0?p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[p.jsx(XP,{className:"h-8 w-8 opacity-30"}),p.jsx("span",{className:"font-sans text-sm",children:"No digest generated yet"}),p.jsx("span",{className:"font-sans text-xs text-center max-w-xs",children:"Run the agent with the digest-only task to synthesize your vault knowledge into context extracts."})]}):p.jsxs("div",{className:"space-y-4",children:[p.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:[i.length," tier",i.length!==1?"s":""," — pre-computed context extracts at different token budgets."]}),i.map(l=>p.jsx(Jee,{tier:l},l.tier))]})}const z0=new Set(["concept","component","bug","tool","file","spore","session","other"]),nte=[{id:"graph",label:"Graph"},{id:"spores",label:"Spores"},{id:"digest",label:"Digest"}],D_="tab",M_="spore",rte=new Set(["graph","spores","digest"]);function ate(){const e=new URLSearchParams(window.location.search),t=e.get(D_);return{tab:t&&rte.has(t)?t:"graph",sporeId:e.get(M_)??void 0}}function ite(e,t){const n=new URLSearchParams;e!=="graph"&&n.set(D_,e),t&&n.set(M_,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.replaceState(null,"",a)}function ste(){const[e,t]=j.useState(new Set(z0)),[n,r]=j.useState(""),[a,i]=j.useState(null),{data:l}=Bee(),o=j.useMemo(()=>(l==null?void 0:l.nodes)??[],[l==null?void 0:l.nodes]),f=j.useMemo(()=>{const y={};for(const x of o){const w=x.type.toLowerCase(),S=z0.has(w)?w:"other";y[S]=(y[S]??0)+1}return y},[o]),c=j.useMemo(()=>{const y=n.toLowerCase();return o.filter(x=>{const w=x.type.toLowerCase(),S=z0.has(w)?w:"other";return!(!e.has(S)||y&&!x.name.toLowerCase().includes(y))})},[o,e,n]),d=j.useMemo(()=>{const y=(l==null?void 0:l.edges)??[],x=new Set(c.map(w=>w.id));return y.filter(w=>x.has(w.source_id)&&x.has(w.target_id))},[l==null?void 0:l.edges,c]),v=j.useCallback(y=>{t(x=>{const w=new Set(x);return w.has(y)?w.delete(y):w.add(y),w})},[]),m=j.useCallback(y=>{i(y)},[]);return p.jsxs("div",{className:"relative h-[calc(100vh-180px)]",children:[p.jsx(Tee,{nodes:c,edges:d,onNodeSelect:m,selectedNode:a}),p.jsx(Nee,{entityCounts:f,enabledTypes:e,onToggleType:v,searchQuery:n,onSearchChange:r}),p.jsx(Ree,{node:a,edges:d,nodes:c,onClose:()=>i(null),onNodeSelect:y=>i(y)})]})}function lte(){const e=ate(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.sporeId?{id:e.sporeId}:null);j.useEffect(()=>{ite(t,r==null?void 0:r.id)},[t,r==null?void 0:r.id]);function i(c){a(c)}function l(){a(null)}function o(c){a({id:c})}function f(c){n(c),c!=="spores"&&a(null)}return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsx(Gi,{title:"Mycelium",subtitle:"Derived intelligence — spores, entity graph, and synthesized context.",tabs:nte,activeTab:t,onTabChange:c=>f(c)}),t==="graph"&&p.jsx(ste,{}),t==="spores"&&(r?p.jsx(Qee,{id:r.id,onBack:l,onNavigateToSpore:o}):p.jsx($ee,{onSelectSpore:i})),t==="digest"&&p.jsx(tte,{})]})}const ote=[{value:Tr,label:"All statuses"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}];function ute({status:e}){const t=AD(e);return p.jsx("span",{className:Ae("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold",t==="default"?"bg-primary-container/20 text-primary":t==="destructive"?"bg-tertiary-container/20 text-tertiary":t==="warning"?"bg-secondary-container/20 text-secondary":"bg-surface-container-high text-on-surface-variant"),children:M1(e)})}function cte(){return p.jsx("tr",{className:"border-b border-outline-variant/20",children:[200,80,100,80,80].map((e,t)=>p.jsx("td",{className:"px-4 py-3",children:p.jsx("div",{className:Ae("h-4 animate-pulse rounded bg-surface-container"),style:{width:e}})},t))})}function fte({run:e,onClick:t,taskNameMap:n}){const r=e.task?n.get(e.task)??e.task:jD;return p.jsxs("tr",{className:"border-b border-outline-variant/20 last:border-0 hover:bg-surface-container-high/50 cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Agent run: ${r}, status ${e.status}`,children:[p.jsx("td",{className:"px-4 py-3",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(dd,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),p.jsx("span",{className:"text-sm font-medium text-on-surface truncate max-w-xs",children:r})]})}),p.jsx("td",{className:"px-4 py-3",children:p.jsx(ute,{status:e.status})}),p.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:TD(e.started_at)}),p.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:Dp(e.started_at,e.completed_at)}),p.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:P1(e.tokens_used)}),p.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:B1(e.cost_usd)})]})}function dte({onSelectRun:e,onTriggerRun:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=Y1({initialFilters:{status:Tr,task:Tr}}),{data:d}=ic(),v=j.useMemo(()=>{const L=new Map;for(const _ of(d==null?void 0:d.tasks)??[])L.set(_.name,_.displayName);return L},[d]),m=j.useMemo(()=>{const L=[{value:Tr,label:"All tasks"}];for(const _ of(d==null?void 0:d.tasks)??[])L.push({value:_.name,label:_.displayName});return L},[d]),y=j.useMemo(()=>[{key:"status",label:"Status",options:ote},{key:"task",label:"Task",options:m}],[m]),x=c("status"),w=c("task"),{data:S,isLoading:b,isError:C,error:T}=ND({limit:ni,offset:i,search:r,status:x,task:w}),N=(S==null?void 0:S.runs)??[],A=(S==null?void 0:S.total)??0,R=p.jsx(K1,{searchPlaceholder:"Search runs...",searchValue:n,onSearchChange:o,filters:y,filterValues:a,onFilterChange:f}),D=p.jsx("thead",{children:p.jsxs("tr",{className:"border-b border-outline-variant/20 bg-surface-container/50",children:[p.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Task"}),p.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Status"}),p.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Started"}),p.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Duration"}),p.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Tokens"}),p.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Cost"})]})});return C?p.jsxs("div",{className:"space-y-4",children:[R,p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Failed to load runs"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:T instanceof Error?T.message:"Unknown error"})]})]}):p.jsxs("div",{className:"space-y-4",children:[R,b?p.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:p.jsxs("table",{className:"w-full",children:[D,p.jsx("tbody",{children:[1,2,3].map(L=>p.jsx(cte,{},L))})]})}):N.length===0?p.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 rounded-md bg-surface-container-low text-on-surface-variant",children:[p.jsx(dd,{className:"h-10 w-10 opacity-30"}),p.jsxs("div",{className:"text-center font-sans",children:[p.jsx("p",{className:"text-sm",children:A===0&&!r&&!x&&!w?"No agent runs yet":"No matching runs"}),A===0&&!r&&!x&&!w&&p.jsx("p",{className:"text-xs mt-1",children:"Trigger the first run to see the agent at work"})]}),A===0&&!r&&!x&&!w&&p.jsxs(Ke,{variant:"outline",size:"sm",className:"gap-2 mt-2",onClick:t,children:[p.jsx(Ku,{className:"h-3.5 w-3.5"}),"Run Now"]})]}):p.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:p.jsxs("table",{className:"w-full","aria-label":"Agent runs",children:[D,p.jsx("tbody",{children:N.map(L=>p.jsx(fte,{run:L,taskNameMap:v,onClick:()=>e(L.id)},L.id))})]})}),p.jsx(Ip,{total:A,offset:i,limit:ni,onPageChange:l})]})}function hte({text:e}){const[t,n]=j.useState(!1),r=e.length>200||e.includes(`
|
|
789
|
+
`);return p.jsxs("div",{className:"mt-1",children:[p.jsx("div",{className:!t&&r?"line-clamp-2":void 0,children:p.jsx(ui,{content:e,className:"text-on-surface-variant [&>*]:text-on-surface-variant"})}),r&&p.jsx("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors mt-1",onClick:()=>n(!t),children:t?p.jsxs(p.Fragment,{children:[p.jsx(_a,{className:"h-3 w-3"})," Show less"]}):p.jsxs(p.Fragment,{children:[p.jsx(Ea,{className:"h-3 w-3"})," Show more"]})})]})}function vte({phases:e}){return p.jsxs("div",{className:"space-y-3",children:[p.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Phase Execution"}),e.map((t,n)=>p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-surface-container-high font-mono text-sm font-medium text-on-surface-variant shrink-0",children:n+1}),p.jsxs(st,{level:"default",className:"flex-1 p-3",children:[p.jsxs("div",{className:"flex justify-between items-center",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:t.name}),p.jsx(Ln,{variant:AD(t.status),children:t.status})]}),p.jsxs("div",{className:"flex gap-3 font-mono text-xs text-on-surface-variant",children:[p.jsxs("span",{children:[t.turnsUsed," turns"]}),p.jsx("span",{children:P1(t.tokensUsed)}),p.jsx("span",{children:B1(t.costUsd)})]})]}),t.summary&&p.jsx(hte,{text:t.summary})]})]},t.name))]})}const dR=80,pte=1e3;function mte(e){const t=e.toLowerCase();return t.includes("extract")||t.includes("create")||t.includes("supersed")||t.includes("update")?"default":t.includes("skip")||t.includes("no-op")?"secondary":t.includes("error")||t.includes("fail")?"destructive":"default"}function gte(e){return e===null?"—":new Date(e*pte).toLocaleTimeString()}function yte(e,t){return e&&db(e,t)||"—"}function xte({report:e}){const[t,n]=j.useState(!1),[r,a]=j.useState(!1),i=e.details!==null&&e.details.length>0,l=e.summary.length>200||e.summary.includes(`
|
|
790
|
+
`);let o=null;if(i)try{o=JSON.parse(e.details)}catch{o=e.details}return p.jsxs(st,{level:"low",className:"p-4 space-y-2",children:[p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx(Ln,{variant:mte(e.action),children:e.action}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:!r&&l?"line-clamp-3":void 0,children:p.jsx(ui,{content:e.summary})}),l&&p.jsx("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors mt-1",onClick:()=>a(!r),children:r?p.jsxs(p.Fragment,{children:[p.jsx(_a,{className:"h-3 w-3"})," Show less"]}):p.jsxs(p.Fragment,{children:[p.jsx(Ea,{className:"h-3 w-3"})," Show more"]})})]}),p.jsx("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:gte(e.created_at)})]}),i&&p.jsxs("div",{children:[p.jsxs("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",onClick:()=>n(!t),children:[t?p.jsx(_a,{className:"h-3.5 w-3.5"}):p.jsx(Ea,{className:"h-3.5 w-3.5"}),t?"Hide details":"Show details"]}),t&&p.jsx("pre",{className:"mt-2 rounded-md bg-surface-container-lowest p-3 font-mono text-xs overflow-auto max-h-48 text-on-surface-variant",children:typeof o=="string"?o:JSON.stringify(o,null,2)})]})]})}function bte({turn:e}){const[t,n]=j.useState(!1);let r=null;if(e.tool_input)try{r=JSON.parse(e.tool_input)}catch{r=e.tool_input}const a=e.tool_input?yte(e.tool_input,dR):"—",i=e.tool_input!==null&&e.tool_input.length>dR;return p.jsx("div",{className:"px-4 py-2.5 hover:bg-surface-container-high/30 transition-colors border-b border-outline-variant/10 last:border-b-0",children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx("span",{className:"font-mono text-xs text-on-surface-variant w-5 shrink-0 pt-0.5 text-right",children:e.turn_number}),p.jsx("span",{className:"font-mono text-xs font-medium text-on-surface shrink-0 pt-0.5 min-w-[140px]",children:e.tool_name}),p.jsxs("div",{className:"flex-1 min-w-0",children:[i?p.jsxs("button",{className:"flex items-start gap-1 text-left font-mono text-xs text-on-surface-variant hover:text-on-surface transition-colors w-full",onClick:()=>n(!t),children:[t?p.jsx(_a,{className:"h-3 w-3 mt-0.5 shrink-0"}):p.jsx(Ea,{className:"h-3 w-3 mt-0.5 shrink-0"}),p.jsx("span",{className:t?void 0:"truncate",children:a})]}):p.jsx("span",{className:"font-mono text-xs text-on-surface-variant truncate block",children:a}),t&&r!==null&&p.jsx("pre",{className:"mt-1.5 ml-4 rounded-md bg-surface-container-lowest p-2.5 font-mono text-xs overflow-auto max-h-48 text-on-surface-variant",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})})}function wte({runId:e,onBack:t}){var N;const[n,r]=j.useState(!1),{data:a,isLoading:i,isError:l}=VF(e),o=(N=a==null?void 0:a.run)==null?void 0:N.status,{data:f,isLoading:c}=HF(e,o),{data:d,isLoading:v}=GF(n?e:void 0,o),{data:m}=ic(),y=j.useMemo(()=>(m==null?void 0:m.tasks)??[],[m]);if(i)return p.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[p.jsx(Qn,{className:"h-5 w-5 animate-spin"}),p.jsx("span",{className:"font-sans",children:"Loading run..."})]});if(l||!(a!=null&&a.run))return p.jsxs("div",{className:"space-y-4",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),"Runs"]}),p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Run not found"})]})]});const x=a.run,w=(f==null?void 0:f.reports)??[],S=d??[];let b=null,C,T;if(x.actions_taken)try{const A=JSON.parse(x.actions_taken);A!=null&&A.phases&&Array.isArray(A.phases)&&(b=A.phases),typeof(A==null?void 0:A.model)=="string"&&(C=A.model),typeof(A==null?void 0:A.provider)=="string"&&(T=A.provider)}catch{}return p.jsxs("div",{className:"space-y-6",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),"Runs"]}),p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[p.jsx(yn,{label:"Status",value:M1(x.status),accent:"sage"}),p.jsx(yn,{label:"Task",value:DD(x.task,y),accent:"outline"}),p.jsx(yn,{label:"Started",value:TD(x.started_at),accent:"outline"}),p.jsx(yn,{label:"Duration",value:Dp(x.started_at,x.completed_at),accent:"outline"}),p.jsx(yn,{label:"Tokens",value:P1(x.tokens_used),accent:"ochre"}),p.jsx(yn,{label:"Cost",value:B1(x.cost_usd),accent:"ochre"})]}),(C||T)&&p.jsxs("div",{className:"flex items-center gap-4 px-1",children:[T&&p.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Provider: ",p.jsx("span",{className:"font-mono text-on-surface",children:T})]}),C&&p.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Model: ",p.jsx("span",{className:"font-mono text-on-surface",children:C})]})]}),x.error&&p.jsx("div",{className:"rounded-md bg-tertiary/10 px-3 py-2",children:p.jsx("p",{className:"font-mono text-xs text-tertiary",children:x.error})}),b&&b.length>0&&p.jsx(st,{level:"low",className:"p-4",children:p.jsx(vte,{phases:b})}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Decisions",w.length>0&&p.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[w.length," ",w.length===1?"action":"actions"]})]}),c?p.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant py-4",children:[p.jsx(Qn,{className:"h-4 w-4 animate-spin"}),p.jsx("span",{className:"font-sans text-sm",children:"Loading decisions..."})]}):w.length===0?p.jsx(st,{level:"low",className:"flex h-24 items-center justify-center",children:p.jsx("span",{className:"font-sans text-sm text-on-surface-variant",children:"No decisions recorded for this run"})}):p.jsx("div",{className:"space-y-2",children:w.map(A=>p.jsx(xte,{report:A},A.id))})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("button",{className:"flex items-center gap-2 font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide hover:text-on-surface transition-colors",onClick:()=>r(!n),children:[n?p.jsx(_a,{className:"h-4 w-4"}):p.jsx(Ea,{className:"h-4 w-4"}),"Audit Trail",p.jsx("span",{className:"normal-case font-normal text-xs",children:"(diagnostics)"})]}),n&&p.jsxs(st,{level:"low",className:Ae("overflow-hidden"),children:[p.jsx("div",{className:"p-4 pb-2",children:p.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Turn-by-turn trace"})}),p.jsx("div",{className:"p-0",children:v?p.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant p-4",children:[p.jsx(Qn,{className:"h-4 w-4 animate-spin"}),p.jsx("span",{className:"font-sans text-sm",children:"Loading turns..."})]}):S.length===0?p.jsx("p",{className:"font-sans text-sm text-on-surface-variant p-4",children:"No turns recorded."}):p.jsx("div",{children:S.map(A=>p.jsx(bte,{turn:A},A.id))})})]})]})]})}function Ste(e){return e.displayName??e.name}function Ete({open:e,onOpenChange:t,onTriggered:n}){var S;const[r,a]=j.useState(void 0),[i,l]=j.useState(""),{data:o,isLoading:f}=ic(),{mutate:c,isPending:d,error:v}=_1(),m=(o==null?void 0:o.tasks)??[],y=m.find(b=>b.isDefault),x=r??(y==null?void 0:y.name)??((S=m[0])==null?void 0:S.name)??"";function w(){const b={task:x||void 0,instruction:i.trim()||void 0};c(b,{onSuccess:()=>{t(!1),a(void 0),l(""),n==null||n()}})}return p.jsx(Ap,{open:e,onOpenChange:t,children:p.jsxs(hd,{className:"sm:max-w-md",children:[p.jsxs(Rp,{children:[p.jsx(vd,{children:"Trigger Agent Run"}),p.jsx(A1,{children:"Run the Myco agent now. It will process unprocessed sessions and update the vault."})]}),p.jsxs("div",{className:"space-y-4 py-2",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Task"}),f?p.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[p.jsx(Qn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):p.jsxs(io,{value:x,onValueChange:a,children:[p.jsx(tl,{children:p.jsx(so,{})}),p.jsx(nl,{children:m.map(b=>p.jsxs(rl,{value:b.name,children:[Ste(b),b.isDefault&&p.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant",children:"(default)"})]},b.name))})]})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",p.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),p.jsx("textarea",{className:"w-full rounded-md bg-surface-container-lowest px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-none focus:ring-2 focus:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50 resize-none",rows:3,placeholder:"E.g. Focus on gotchas from yesterday's sessions...",value:i,onChange:b=>l(b.target.value),disabled:d})]}),v&&p.jsx("p",{className:"font-sans text-xs text-tertiary",children:v instanceof Error?v.message:"Failed to trigger run"})]}),p.jsxs(jp,{children:[p.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>t(!1),disabled:d,children:"Cancel"}),p.jsx(Ke,{size:"sm",className:"gap-2",onClick:w,disabled:d,children:d?p.jsxs(p.Fragment,{children:[p.jsx(Qn,{className:"h-3.5 w-3.5 animate-spin"}),"Starting..."]}):p.jsxs(p.Fragment,{children:[p.jsx(Ku,{className:"h-3.5 w-3.5"}),"Run Now"]})})]})]})})}function Cte(e){return!e.phases||e.phases.length===0?"Single query":`${e.phases.length} phases`}function Tte(e){return e===g1?"User":"Built-in"}function kte({task:e,onClick:t}){return p.jsxs(st,{level:"low",interactive:!0,className:Ae("p-4 space-y-2 transition-all",e.isDefault&&"ring-1 ring-primary/20 shadow-[inset_0_0_12px_rgba(171,207,184,0.08)]"),onClick:t,children:[p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.displayName}),e.isDefault&&p.jsx(cz,{className:"h-3.5 w-3.5 text-primary shrink-0 fill-primary/30"})]}),e.description&&p.jsx("p",{className:"font-sans text-xs text-on-surface-variant mt-1 line-clamp-2",children:e.description})]}),p.jsx("div",{className:"flex items-center gap-2 shrink-0",children:p.jsx(Ln,{variant:RD(e.source),children:Tte(e.source)})})]}),p.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[p.jsxs("div",{className:"flex items-center gap-1.5 text-on-surface-variant",children:[p.jsx(ZP,{className:"h-3 w-3"}),p.jsx("span",{className:"font-mono text-xs",children:Cte(e)})]}),e.model&&p.jsx("span",{className:"font-mono text-xs text-on-surface-variant/70 truncate max-w-[160px]",children:e.model}),e.maxTurns!==void 0&&p.jsxs("span",{className:"font-mono text-xs text-on-surface-variant/70",children:["max ",e.maxTurns," turns"]})]})]})}function Nte({onSelect:e}){const{data:t,isLoading:n}=ic(),r=(t==null?void 0:t.tasks)??[];return n?p.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Array.from({length:3}).map((a,i)=>p.jsx("div",{className:"h-28 rounded-md animate-pulse bg-surface-container-low"},i))}):r.length===0?p.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No tasks found."}):p.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:r.map(a=>p.jsx(kte,{task:a,onClick:()=>e(a.name)},a.name))})}const Ate=new Set(["instruction"]),Rte={session_id:"Session ID"},jte={session_id:"e.g. 36858a44-4ef7-4448-96e8-382e992e8ba4"};function Dte(e){const t=e.matchAll(/\{\{(\w+)\}\}/g),n=new Set;for(const r of t){const a=r[1];Ate.has(a)||n.add(a)}return[...n]}function hR(e){return Rte[e]??e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Mte({task:e,onRunTriggered:t,onDeleted:n,onCustomized:r}){const a=_1(),i=KF(),l=YF(),[o,f]=j.useState(!1),[c,d]=j.useState({}),[v,m]=j.useState(""),y=j.useMemo(()=>Dte(e.prompt??""),[e.prompt]),x=y.length>0;function w(){var N;const b=[];for(const A of y){const R=(N=c[A])==null?void 0:N.trim();R&&b.push(`${A}: ${R}`)}const C=v.trim();C&&b.push(C);const T=b.length>0?b.join(`
|
|
791
|
+
`):void 0;a.mutate({task:e.name,instruction:T},{onSuccess:A=>{f(!1),d({}),m(""),t==null||t(A.runId)}})}function S(b,C){d(T=>({...T,[b]:C}))}return p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ke,{size:"sm",onClick:()=>{f(!0)},children:"Run Now"}),e.source===Tz&&p.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>i.mutate({taskId:e.name},{onSuccess:b=>{var T;const C=(T=b==null?void 0:b.task)==null?void 0:T.name;C&&r&&r(C)}}),children:"Customize"}),e.source===g1&&p.jsx(Ke,{variant:"destructive",size:"sm",onClick:()=>{l.mutate(e.name,{onSuccess:()=>n==null?void 0:n()})},children:"Delete"}),p.jsx(Ap,{open:o,onOpenChange:f,children:p.jsxs(hd,{className:"sm:max-w-md",children:[p.jsx(Rp,{children:p.jsxs(vd,{children:["Run ",e.displayName]})}),p.jsxs("div",{className:"space-y-4 py-2",children:[y.map(b=>p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:hR(b)}),p.jsx(fn,{value:c[b]??"",onChange:C=>S(b,C.target.value),placeholder:jte[b]??`Enter ${hR(b).toLowerCase()}`,className:"font-mono",autoFocus:y.indexOf(b)===0})]},b)),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",p.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),p.jsx("textarea",{className:"w-full rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-none focus:border-primary/40 resize-none",rows:2,placeholder:"Additional instructions for this run...",value:v,onChange:b=>m(b.target.value),disabled:a.isPending})]})]}),p.jsxs(jp,{children:[p.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>f(!1),children:"Cancel"}),p.jsxs(Ke,{size:"sm",disabled:a.isPending,onClick:w,className:"gap-2",children:[a.isPending?p.jsx(Qn,{className:"h-3.5 w-3.5 animate-spin"}):p.jsx(Ku,{className:"h-3.5 w-3.5"}),"Run"]})]})]})})]})}const Ote=20;function Lte({taskId:e,onSaved:t}){const{data:n,isLoading:r,isError:a}=XF(e),i=QF(),[l,o]=j.useState(""),[f,c]=j.useState(!1);j.useEffect(()=>{n!=null&&n.yaml&&(o(n.yaml),c(!1))},[n==null?void 0:n.yaml]);function d(x){o(x),c(!0)}function v(){i.mutate({taskId:e,yaml:l},{onSuccess:()=>{c(!1),t==null||t()}})}function m(){n!=null&&n.yaml&&(o(n.yaml),c(!1))}if(r)return p.jsx("div",{className:"h-64 animate-pulse rounded-md bg-surface-container-low"});if(a)return p.jsx("div",{className:"rounded-md bg-tertiary-container/20 p-4 font-sans text-sm text-tertiary",children:"Failed to load task YAML."});const y=(n==null?void 0:n.source)!=="user";return p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Task Definition ",y&&"(read-only)"]}),!y&&p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ke,{variant:"ghost",size:"sm",onClick:m,disabled:!f,children:"Reset"}),p.jsx(Ke,{size:"sm",onClick:v,disabled:!f||i.isPending,children:i.isPending?"Saving...":"Save"})]})]}),p.jsx("textarea",{value:l,onChange:x=>d(x.target.value),readOnly:y,rows:Ote,spellCheck:!1,className:`w-full rounded-md bg-surface-container-lowest p-4 font-mono text-sm text-on-surface leading-relaxed resize-y focus:outline-none focus:ring-2 focus:ring-primary/40 ${y?"opacity-75 cursor-not-allowed":""}`}),i.isError&&p.jsx("div",{className:"rounded-md bg-tertiary-container/20 p-3 font-sans text-sm text-tertiary",children:i.error.message}),i.isSuccess&&!f&&p.jsx("div",{className:"rounded-md bg-primary-container/20 p-3 font-sans text-sm text-primary",children:"Task saved successfully."})]})}const O_=3e4;function _te(e){return Tn({queryKey:["task-config",e],queryFn:({signal:t})=>bt(`/agent/tasks/${e}/config`,{signal:t}),enabled:e!==void 0,staleTime:O_})}function Bte(){return Tn({queryKey:["providers"],queryFn:({signal:e})=>bt("/providers",{signal:e}),staleTime:O_})}function Pte(){return vl({mutationFn:e=>Cr("/providers/test",e)})}function zte(){const e=Ca();return vl({mutationFn:({taskId:t,config:n})=>wp(`/agent/tasks/${t}/config`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["task-config",n.taskId]})}})}const Ite={cloud:"Anthropic Cloud",ollama:"Ollama",lmstudio:"LM Studio"},Fte={cloud:VP,ollama:sz,lmstudio:v1};function L_({providerType:e,model:t,baseUrl:n,contextLength:r,modelPlaceholder:a,providers:i,isLoadingProviders:l,onProviderChange:o,onModelChange:f,onBaseUrlChange:c,onContextLengthChange:d}){const v=i.find(x=>x.type===e),m=e==="ollama"||e==="lmstudio",y=(v==null?void 0:v.models)??[];return p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"grid grid-cols-3 gap-2",children:["cloud","ollama","lmstudio"].map(x=>{const w=Fte[x],S=i.find(C=>C.type===x),b=e===x;return p.jsxs("button",{onClick:()=>o(x),className:`
|
|
792
|
+
flex flex-col items-center gap-1.5 rounded-md border px-3 py-2.5 transition-colors
|
|
793
|
+
${b?"border-primary/40 bg-primary/5 text-on-surface":"border-[var(--ghost-border)] bg-surface-container-lowest text-on-surface-variant hover:border-primary/20"}
|
|
794
|
+
`,children:[p.jsx(w,{className:"h-4 w-4"}),p.jsx("span",{className:"font-sans text-xs font-medium",children:Ite[x]}),!l&&p.jsx(Ln,{variant:S!=null&&S.available?"secondary":"destructive",className:"text-[10px] px-1.5 py-0",children:S!=null&&S.available?"online":"offline"})]},x)})}),m&&p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),p.jsx(fn,{value:n,onChange:x=>c(x.target.value),placeholder:(v==null?void 0:v.baseUrl)??""})]}),m&&p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Context Length"}),p.jsx(fn,{type:"number",value:r,onChange:x=>d(x.target.value),placeholder:"32768"})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),y.length>0?p.jsxs(io,{value:t,onValueChange:f,children:[p.jsx(tl,{children:p.jsx(so,{placeholder:a??"Select a model"})}),p.jsx(nl,{children:y.map(x=>p.jsx(rl,{value:x,children:p.jsx("span",{className:"font-mono text-sm",children:x})},x))})]}):p.jsx(fn,{value:t,onChange:x=>f(x.target.value),placeholder:(v==null?void 0:v.available)===!1?"Provider offline":"Enter model name",disabled:(v==null?void 0:v.available)===!1})]})]})}function qte({phase:e,override:t,taskModel:n,providers:r,isLoadingProviders:a,onChange:i}){var c,d,v,m;const[l,o]=j.useState(!1),f=t.provider!==void 0||t.model!==void 0||t.maxTurns!==void 0;return p.jsxs("div",{className:"border border-[var(--ghost-border)] rounded-md",children:[p.jsxs("button",{onClick:()=>o(!l),className:"flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-surface-container-low/50 transition-colors rounded-md",children:[l?p.jsx(_a,{className:"h-3.5 w-3.5 text-on-surface-variant"}):p.jsx(Ea,{className:"h-3.5 w-3.5 text-on-surface-variant"}),p.jsx("span",{className:"font-sans text-sm text-on-surface",children:e.name}),p.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:["max ",t.maxTurns??e.maxTurns," turns"]}),f&&p.jsx(Ln,{variant:"secondary",className:"text-[10px] ml-auto",children:"override"})]}),l&&p.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-[var(--ghost-border)]",children:[p.jsx("div",{className:"pt-3",children:p.jsx(L_,{providerType:((c=t.provider)==null?void 0:c.type)??"cloud",model:((d=t.provider)==null?void 0:d.model)??t.model??"",baseUrl:((v=t.provider)==null?void 0:v.base_url)??"",contextLength:((m=t.provider)==null?void 0:m.context_length)!=null?String(t.provider.context_length):"",modelPlaceholder:e.model??n,providers:r,isLoadingProviders:a,onProviderChange:y=>{var w;const x=(w=r.find(S=>S.type===y))==null?void 0:w.baseUrl;i({...t,provider:{type:y,base_url:x},model:void 0})},onModelChange:y=>i({...t,provider:t.provider?{...t.provider,model:y}:void 0,model:t.provider?void 0:y}),onBaseUrlChange:y=>i({...t,provider:t.provider?{...t.provider,base_url:y}:void 0}),onContextLengthChange:y=>i({...t,provider:t.provider?{...t.provider,context_length:y?Number(y):void 0}:void 0})})}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),p.jsx(fn,{type:"number",value:t.maxTurns??"",onChange:y=>i({...t,maxTurns:y.target.value?Number(y.target.value):void 0}),placeholder:String(e.maxTurns)})]}),f&&p.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>i(null),className:"text-xs text-on-surface-variant",children:"Clear Phase Override"})]})]})}function Ute({taskId:e,phases:t,defaults:n}){const{data:r,isPending:a}=Bte(),{data:i}=_te(e),l=Pte(),o=zte(),f=i==null?void 0:i.config,[c,d]=j.useState("cloud"),[v,m]=j.useState(""),[y,x]=j.useState(""),[w,S]=j.useState(""),[b,C]=j.useState(""),[T,N]=j.useState(""),[A,R]=j.useState({}),[D,L]=j.useState(!1);j.useEffect(()=>{var F,B,H,Y;f&&(d(((F=f.provider)==null?void 0:F.type)??"cloud"),m(((B=f.provider)==null?void 0:B.model)??f.model??""),x(((H=f.provider)==null?void 0:H.base_url)??""),S(((Y=f.provider)==null?void 0:Y.context_length)!=null?String(f.provider.context_length):""),C(f.maxTurns!=null?String(f.maxTurns):""),N(f.timeoutSeconds!=null?String(f.timeoutSeconds):""),R(f.phases??{}),L(!1))},[f]);const _=(r==null?void 0:r.providers)??[];function M(F){var B;d(F),m(""),x(((B=_.find(H=>H.type===F))==null?void 0:B.baseUrl)??""),S(""),L(!0),l.reset()}function z(F,B){R(H=>{const Y={...H};return B===null?delete Y[F]:Y[F]=B,Y}),L(!0)}function P(){const F=c==="ollama"||c==="lmstudio",B={type:c,...v?{model:v}:{},...F&&y?{base_url:y}:{},...F&&w?{context_length:Number(w)}:{}};o.mutate({taskId:e,config:{provider:B,...b?{maxTurns:Number(b)}:{maxTurns:null},...T?{timeoutSeconds:Number(T)}:{timeoutSeconds:null},...Object.keys(A).length>0?{phases:A}:{phases:null}}},{onSuccess:()=>L(!1)})}function G(){o.mutate({taskId:e,config:{provider:null,model:null,maxTurns:null,timeoutSeconds:null,phases:null}},{onSuccess:()=>{d("cloud"),m(""),x(""),S(""),C(""),N(""),R({}),L(!1)}})}function I(){const B={type:c,...(c==="ollama"||c==="lmstudio")&&y?{base_url:y}:{}};l.mutate(B)}return p.jsxs(st,{level:"low",className:"p-4 space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Task Config"}),f&&p.jsx(Ke,{variant:"ghost",size:"sm",onClick:G,className:"text-xs text-on-surface-variant",children:"Clear All Overrides"})]}),p.jsx(L_,{providerType:c,model:v,baseUrl:y,contextLength:w,modelPlaceholder:n==null?void 0:n.model,providers:_,isLoadingProviders:a,onProviderChange:M,onModelChange:F=>{m(F),L(!0)},onBaseUrlChange:F=>{x(F),L(!0)},onContextLengthChange:F=>{S(F),L(!0)}}),p.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),p.jsx(fn,{type:"number",value:b,onChange:F=>{C(F.target.value),L(!0)},placeholder:(n==null?void 0:n.maxTurns)!=null?String(n.maxTurns):"—"})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout (seconds)"}),p.jsx(fn,{type:"number",value:T,onChange:F=>{N(F.target.value),L(!0)},placeholder:(n==null?void 0:n.timeoutSeconds)!=null?String(n.timeoutSeconds):"—"})]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:I,disabled:l.isPending,className:"gap-1.5 text-on-surface-variant",children:[l.isPending?p.jsx(Qn,{className:"h-3.5 w-3.5 animate-spin"}):p.jsx(gz,{className:"h-3.5 w-3.5"}),"Test"]}),l.isSuccess&&p.jsx("span",{className:"flex items-center gap-1 text-xs",children:l.data.ok?p.jsxs(p.Fragment,{children:[p.jsx(wj,{className:"h-3.5 w-3.5 text-green-500"}),p.jsxs("span",{className:"text-green-500 font-mono",children:[l.data.latency_ms,"ms"]})]}):p.jsxs(p.Fragment,{children:[p.jsx(yp,{className:"h-3.5 w-3.5 text-red-400"}),p.jsx("span",{className:"text-red-400",children:l.data.error})]})}),p.jsx("div",{className:"flex-1"}),p.jsxs(Ke,{size:"sm",onClick:P,disabled:!D||o.isPending,className:"gap-1.5",children:[o.isPending&&p.jsx(Qn,{className:"h-3.5 w-3.5 animate-spin"}),"Save"]})]}),t&&t.length>0&&p.jsxs("div",{className:"space-y-2 pt-2 border-t border-[var(--ghost-border)]",children:[p.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Per-Phase Overrides"}),t.map(F=>p.jsx(qte,{phase:F,override:A[F.name]??{},taskModel:v||"claude-sonnet-4-6",providers:_,isLoadingProviders:a,onChange:B=>z(F.name,B)},F.name))]})]})}const Vte=3;function Hte(e){var t,n,r;return{model:((t=e.execution)==null?void 0:t.model)??e.model,maxTurns:((n=e.execution)==null?void 0:n.maxTurns)??e.maxTurns,timeoutSeconds:((r=e.execution)==null?void 0:r.timeoutSeconds)??e.timeoutSeconds}}function Gte(){return p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),p.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[p.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),p.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),p.jsx("div",{className:"h-8 w-32 animate-pulse rounded bg-surface-container-high"})]}),p.jsx("div",{className:"rounded-md bg-surface-container-low p-4 space-y-2",children:Array.from({length:Vte}).map((e,t)=>p.jsx("div",{className:"h-5 animate-pulse rounded bg-surface-container-high"},t))})]})}function $te({phase:e,index:t}){return p.jsxs(st,{level:"low",className:"p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-surface-container-high font-mono text-xs font-semibold text-on-surface-variant shrink-0",children:t+1}),p.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:e.name}),!e.required&&p.jsx(Ln,{variant:"secondary",children:"optional"})]}),p.jsxs("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:["max ",e.maxTurns," turns"]})]}),e.tools.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1",children:e.tools.map(n=>p.jsx("span",{className:"font-mono text-xs px-1.5 py-0.5 rounded-sm bg-surface-container-high text-on-surface-variant",children:n},n))}),p.jsx(st,{level:"lowest",className:"p-3 overflow-auto max-h-40",children:p.jsx(ui,{content:e.prompt})})]})}function Kte({taskId:e,onBack:t,onNavigate:n,onRunTriggered:r}){const{data:a,isPending:i,isError:l}=$F(e);if(i)return p.jsx(Gte,{});if(l||!(a!=null&&a.task))return p.jsxs("div",{className:"space-y-4",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),"Tasks"]}),p.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[p.jsx(Zi,{className:"h-5 w-5"}),p.jsx("span",{className:"font-sans text-sm",children:"Task not found"})]})]});const o=a.task,f=o.phases??[],c=Hte(o);return p.jsxs("div",{className:"space-y-6",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[p.jsx(Js,{className:"h-4 w-4"}),"Tasks"]}),p.jsxs(st,{level:"low",className:"p-4 space-y-4",children:[p.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[p.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[p.jsx("h1",{className:"font-serif text-lg text-on-surface",children:o.displayName}),o.description&&p.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:o.description})]}),p.jsx(Ln,{variant:RD(o.source),className:"shrink-0",children:M1(o.source??"built-in")})]}),p.jsx(Mte,{task:o,onDeleted:t,onCustomized:d=>n==null?void 0:n(d),onRunTriggered:r})]}),p.jsx(Ute,{taskId:e,phases:f,defaults:{model:c.model,maxTurns:c.maxTurns,timeoutSeconds:c.timeoutSeconds}}),(c.model!==void 0||c.maxTurns!==void 0||c.timeoutSeconds!==void 0)&&p.jsxs(st,{level:"low",className:"p-4 space-y-3",children:[p.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Execution Config"}),p.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.model!==void 0&&p.jsxs("div",{children:[p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),p.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.model})]}),c.maxTurns!==void 0&&p.jsxs("div",{children:[p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),p.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.maxTurns})]}),c.timeoutSeconds!==void 0&&p.jsxs("div",{children:[p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout"}),p.jsxs("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:[c.timeoutSeconds,"s"]})]})]})]}),f.length>0?p.jsxs("div",{className:"space-y-3",children:[p.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Phases",p.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[f.length," ",f.length===1?"phase":"phases"]})]}),f.map((d,v)=>p.jsx($te,{phase:d,index:v},d.name))]}):p.jsxs("div",{className:"space-y-3",children:[p.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Prompt"}),p.jsx(st,{level:"lowest",className:"p-4 overflow-auto max-h-96",children:p.jsx(ui,{content:o.prompt??""})})]}),p.jsx(Lte,{taskId:e})]})}function __(){const e=Ca(),t=Tn({queryKey:["config"],queryFn:({signal:r})=>bt("/config",{signal:r})}),n=vl({mutationFn:r=>wp("/config",r),onSuccess:()=>e.invalidateQueries({queryKey:["config"]})});return{config:t.data,isLoading:t.isLoading,error:t.error,saveConfig:n.mutateAsync,isSaving:n.isPending,saveError:n.error}}function B_({checked:e,onCheckedChange:t}){return p.jsx("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),className:`relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 ${e?"bg-primary":"bg-surface-container-high"}`,children:p.jsx("span",{className:`pointer-events-none block h-5 w-5 rounded-full bg-on-surface shadow-lg ring-0 transition-transform ${e?"translate-x-5":"translate-x-0"}`})})}const I0=30;function P_(e,t){var n,r,a;return{autoRun:((n=e.agent)==null?void 0:n.auto_run)??!0,intervalSeconds:String(((r=e.agent)==null?void 0:r.interval_seconds)??ib),summaryBatchInterval:String(((a=e.agent)==null?void 0:a.summary_batch_interval)??sb),defaultTask:t??""}}function Yte(e,t,n){const r=P_(t,n);return e.autoRun!==r.autoRun||e.intervalSeconds!==r.intervalSeconds||e.summaryBatchInterval!==r.summaryBatchInterval||e.defaultTask!==r.defaultTask}function Xte(e){const t=Number(e);if(isNaN(t)||t<=0)return"";const n=t/60;return n<1?`${t}s`:Number.isInteger(n)?`${n} min`:`${n.toFixed(1)} min`}function vR({label:e,value:t,max:n,color:r}){const a=n>0?Math.round(t/n*100):0,i=2*Math.PI*36,l=i-a/100*i;return p.jsxs("div",{className:"flex flex-col items-center gap-2",children:[p.jsxs("div",{className:"relative h-20 w-20",children:[p.jsxs("svg",{className:"h-20 w-20 -rotate-90",viewBox:"0 0 80 80",children:[p.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:"currentColor",className:"text-surface-container/30",strokeWidth:"6"}),p.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:r,strokeWidth:"6",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,className:"transition-all duration-700"})]}),p.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:p.jsxs("span",{className:"text-sm font-semibold font-mono text-on-surface",children:[a,"%"]})})]}),p.jsx("span",{className:"text-xs text-on-surface-variant text-center font-sans",children:e})]})}function Li({label:e,value:t}){return p.jsxs("div",{className:"flex items-center justify-between py-1",children:[p.jsx("span",{className:"text-xs text-on-surface-variant font-sans",children:e}),p.jsx("span",{className:"text-xs font-mono text-on-surface",children:t})]})}function Qte({stats:e}){const t=e.embedding.total_embeddable>0?e.embedding.embedded_count:0,n=e.embedding.total_embeddable;return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("h2",{className:"text-xs font-semibold text-on-surface-variant uppercase tracking-widest flex items-center gap-2 font-sans",children:[p.jsx(rb,{className:"h-3.5 w-3.5"}),"System Health"]}),p.jsxs("div",{className:"flex justify-center gap-8 py-2",children:[p.jsx(vR,{label:"Embedding Coverage",value:t,max:n,color:"#abcfb8"}),p.jsx(vR,{label:"Queue Health",value:Math.max(0,n-e.embedding.queue_depth),max:n,color:"#edbf7f"})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-0",children:[p.jsx(Li,{label:"Sessions",value:String(e.vault.session_count)}),p.jsx(Li,{label:"Spores",value:String(e.vault.spore_count)}),p.jsx(Li,{label:"Entities",value:String(e.vault.entity_count)}),p.jsx(Li,{label:"Graph edges",value:String(e.vault.edge_count)}),p.jsx(Li,{label:"Uptime",value:j1(e.daemon.uptime_seconds)}),p.jsx(Li,{label:"Daemon",value:`v${e.daemon.version} :${e.daemon.port}`}),e.agent.last_run_at!==null&&p.jsxs(p.Fragment,{children:[p.jsx(Li,{label:"Last run",value:oi(e.agent.last_run_at)}),p.jsx(Li,{label:"Total runs",value:String(e.agent.total_runs)})]}),e.digest.freshest_tier!==null&&p.jsx(Li,{label:"Digest tier",value:`T${e.digest.freshest_tier}`})]})]})}function Wte(){var L;const{config:e,isLoading:t,saveConfig:n,isSaving:r}=__(),{data:a,isLoading:i}=Sp(),{data:l,isLoading:o}=ic(),{restart:f}=x1(),[c,d]=j.useState(null),[v,m]=j.useState(null),[y,x]=j.useState("idle"),[w,S]=j.useState(""),b=(l==null?void 0:l.tasks)??[],C=((L=b.find(_=>_.isDefault))==null?void 0:L.name)??"",T=j.useRef(!1);e&&!o&&!T.current&&(T.current=!0,c===null&&d(P_(e,C)));const N=c&&e?Yte(c,e,C):!1,A=j.useCallback((_,M)=>{d(z=>z&&{...z,[_]:M}),m(null)},[]),R=async()=>{if(!(!c||!e)){m(null);try{const _={...e,agent:{...e.agent,auto_run:c.autoRun,interval_seconds:Math.max(I0,Hv(c.intervalSeconds,ib)),summary_batch_interval:Hv(c.summaryBatchInterval,sb)}};await n(_),m({type:"success",text:"Agent settings saved. Restarting daemon..."});try{await f()}catch{m({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{m({type:"error",text:"Failed to save settings."})}}},D=async()=>{if(e){x("testing"),S("");try{const _=new URLSearchParams({provider:e.embedding.provider,type:"embedding"});e.embedding.base_url&&_.set("base_url",e.embedding.base_url);const z=(await bt(`/models?${_.toString()}`)).models.length;x("success"),S(`Connected -- ${z} model${z!==1?"s":""} available.`)}catch(_){x("error"),S(_ instanceof Error?_.message:"Connection failed.")}}};return t||!e||!c?p.jsx("div",{className:"space-y-4",children:[1,2,3].map(_=>p.jsx("div",{className:"h-32 rounded-md animate-pulse bg-surface-container-low"},_))}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs(st,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[p.jsx(Zt,{children:p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(lz,{className:"h-4 w-4 text-primary"}),"Agent Operations"]})}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"space-y-0.5",children:[p.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Auto Run"}),p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Automatically process unprocessed batches on a timer."})]}),p.jsx(B_,{checked:c.autoRun,onCheckedChange:_=>A("autoRun",_)})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Run Interval"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(fn,{type:"number",min:I0,placeholder:String(ib),value:c.intervalSeconds,onChange:_=>A("intervalSeconds",_.target.value),className:"w-32 font-mono"}),p.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["seconds",c.intervalSeconds&&p.jsxs("span",{className:"ml-1 text-on-surface",children:["(",Xte(c.intervalSeconds),")"]})]})]}),p.jsxs("p",{className:"font-sans text-xs text-on-surface-variant",children:["How often the agent checks for unprocessed work. Minimum ",I0,"s."]})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Summary Batch Interval"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(fn,{type:"number",min:0,placeholder:String(sb),value:c.summaryBatchInterval,onChange:_=>A("summaryBatchInterval",_.target.value),className:"w-32 font-mono"}),p.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"batches"})]}),p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Trigger a session summary every N batches. Set to 0 to disable."})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Default Task"}),o?p.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[p.jsx(Qn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):p.jsxs(io,{value:c.defaultTask,onValueChange:_=>A("defaultTask",_),children:[p.jsx(tl,{children:p.jsx(so,{placeholder:"Select default task"})}),p.jsx(nl,{children:b.map(_=>p.jsx(rl,{value:_.name,children:_.displayName},_.name))})]}),p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"The task used when auto-run triggers or no task is specified."})]}),p.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[p.jsxs(Ke,{onClick:R,disabled:!N||r,size:"sm",children:[r?p.jsx(Qn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Save Changes"]}),v&&p.jsx("span",{className:v.type==="success"?"font-sans text-xs text-primary":"font-sans text-xs text-tertiary",children:v.text})]})]}),p.jsxs(st,{level:"low",className:"p-6 space-y-4 border-t-2 border-t-ochre",children:[p.jsx(Zt,{children:p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(v1,{className:"h-4 w-4 text-secondary"}),"Embedding Configuration"]})}),p.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:[p.jsxs("div",{children:[p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Provider"}),p.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5",children:e.embedding.provider})]}),p.jsxs("div",{children:[p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),p.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.model,children:e.embedding.model})]}),e.embedding.base_url&&p.jsxs("div",{className:"col-span-2",children:[p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),p.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.base_url,children:e.embedding.base_url})]})]}),p.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[p.jsxs(Ke,{type:"button",variant:"ghost",size:"sm",onClick:D,disabled:y==="testing",children:[y==="testing"?p.jsx(Qn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Test Connection"]}),p.jsxs("a",{href:"/settings",className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:[p.jsx(p1,{className:"h-3 w-3"}),"Edit in Settings"]}),y==="success"&&p.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-primary",children:[p.jsx(bj,{className:"h-3.5 w-3.5"}),w]}),y==="error"&&p.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-tertiary",children:[p.jsx(yp,{className:"h-3.5 w-3.5"}),w]})]})]}),i?p.jsx(st,{level:"low",className:"p-6",children:p.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-container"})}):a?p.jsx(st,{level:"low",className:"p-6",children:p.jsx(Qte,{stats:a})}):null]})}const z_="tab",I_="run",F_="task",Zte=new Set(["runs","tasks","config"]);function Jte(){const e=new URLSearchParams(window.location.search),t=e.get(z_);return{tab:t&&Zte.has(t)?t:"runs",runId:e.get(I_)??void 0,taskId:e.get(F_)??void 0}}function ene(e,t,n){const r=new URLSearchParams;e!=="runs"&&r.set(z_,e),t&&r.set(I_,t),n&&r.set(F_,n);const a=r.toString(),i=a?`${window.location.pathname}?${a}`:window.location.pathname;window.history.replaceState(null,"",i)}const tne=[{id:"runs",label:"Runs"},{id:"tasks",label:"Tasks"},{id:"config",label:"Config"}];function nne(){const e=Jte(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.runId),[i,l]=j.useState(e.taskId),[o,f]=j.useState(!1);j.useEffect(()=>{ene(t,r,i)},[t,r,i]);const c=j.useCallback(d=>{const v=d;n(v),v!=="runs"&&a(void 0),v!=="tasks"&&l(void 0)},[]);return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsx(Gi,{title:"Agent",subtitle:"Intelligence runs, task configuration, and operational settings",tabs:tne,activeTab:t,onTabChange:c,actions:t==="runs"?p.jsxs(Ke,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>f(!0),children:[p.jsx(Ku,{className:"h-3.5 w-3.5"}),"Run Now"]}):void 0}),t==="runs"&&(r?p.jsx(wte,{runId:r,onBack:()=>a(void 0)}):p.jsx(dte,{onSelectRun:a,onTriggerRun:()=>f(!0)})),t==="tasks"&&(i?p.jsx(Kte,{taskId:i,onBack:()=>l(void 0),onNavigate:l,onRunTriggered:d=>{l(void 0),n("runs"),d&&a(d)}}):p.jsx(Nte,{onSelect:l})),t==="config"&&p.jsx(Wte,{}),p.jsx(Ete,{open:o,onOpenChange:f,onTriggered:()=>a(void 0)})]})}function rne(){const[e,t]=j.useState({}),[n,r]=j.useState([]),[a,i]=j.useState([]),[l,o]=j.useState(""),[f,c]=j.useState(!1),[d,v]=j.useState(null),[m,y]=j.useState(!0);j.useEffect(()=>{bt("/config/plan-dirs").then(N=>{t(N.symbiont),r(N.custom),i(N.custom)}).catch(()=>{}).finally(()=>y(!1))},[]);const x=n.length!==a.length||n.some((N,A)=>N!==a[A]),w=j.useCallback(()=>{const N=l.trim();!N||n.includes(N)||(r(A=>[...A,N]),o(""),v(null))},[l,n]),S=j.useCallback(N=>{r(A=>A.filter(R=>R!==N)),v(null)},[]),b=j.useCallback(async()=>{c(!0),v(null);try{const N=await Cr("/config/plan-dirs",{plan_dirs:n});i(N.custom),r(N.custom),v({type:"success",text:"Plan directories saved."})}catch{v({type:"error",text:"Failed to save plan directories."})}finally{c(!1)}},[n]),C=j.useCallback(N=>{N.key==="Enter"&&w()},[w]),T=Object.entries(e);return p.jsxs(st,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-amber-500",children:[p.jsx(Zt,{children:"Plan Capture"}),m?p.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"Loading..."}):p.jsxs("div",{className:"space-y-5",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Agent Directories"}),p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Directories monitored by connected agents. Managed by symbiont manifests."}),T.length===0?p.jsx("p",{className:"font-sans text-xs text-on-surface-variant italic",children:"No agent directories configured."}):p.jsx("div",{className:"space-y-3",children:T.map(([N,A])=>p.jsxs("div",{className:"space-y-1",children:[p.jsx("p",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:N}),p.jsx("div",{className:"space-y-1",children:A.map(R=>p.jsx("div",{className:"rounded bg-surface-container px-3 py-1.5 font-mono text-xs text-on-surface-variant",children:R},R))})]},N))})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Custom Directories"}),p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Additional directories to watch for plan files."}),n.length>0&&p.jsx("div",{className:"space-y-1",children:n.map(N=>p.jsxs("div",{className:"flex items-center gap-2 rounded bg-surface-container px-3 py-1.5",children:[p.jsx("span",{className:"flex-1 font-mono text-xs text-on-surface",children:N}),p.jsx("button",{type:"button",onClick:()=>S(N),className:"font-sans text-xs text-on-surface-variant hover:text-tertiary transition-colors leading-none","aria-label":`Remove ${N}`,children:"x"})]},N))}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(fn,{placeholder:"/path/to/plans",value:l,onChange:N=>o(N.target.value),onKeyDown:C,className:"flex-1 font-mono text-xs"}),p.jsx(Ke,{type:"button",size:"sm",onClick:w,disabled:!l.trim(),children:"Add"})]})]}),x&&p.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[p.jsx(Ke,{onClick:b,disabled:f,size:"sm",children:f?"Saving...":"Save"}),d&&p.jsx("span",{className:d.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:d.text})]}),!x&&(d==null?void 0:d.type)==="success"&&p.jsx("p",{className:"font-sans text-sm text-primary",children:d.text})]})]})}const ane=["debug","info","warn","error"],ine=[{value:"ollama",label:"Ollama"},{value:"openai-compatible",label:"OpenAI-compatible"}],sne=[{value:"1500",label:"1.5K — Executive briefing"},{value:"5000",label:"5K — Deep onboarding"},{value:"10000",label:"10K — Full institutional"}];function q_(e){var t,n,r;return{daemonPort:e.daemon.port!=null?String(e.daemon.port):"",logLevel:e.daemon.log_level,logRetentionDays:String(e.daemon.log_retention_days),embeddingProvider:e.embedding.provider,embeddingModel:e.embedding.model,embeddingBaseUrl:e.embedding.base_url??"",contextDigestTier:String(((t=e.context)==null?void 0:t.digest_tier)??Rj),contextPromptSearch:((n=e.context)==null?void 0:n.prompt_search)??!0,contextMaxSpores:String(((r=e.context)==null?void 0:r.prompt_max_spores)??jj)}}function lne(e,t){return{...t,daemon:{...t.daemon,port:e.daemonPort!==""?Number(e.daemonPort):null,log_level:e.logLevel,log_retention_days:Number(e.logRetentionDays)},embedding:{...t.embedding,provider:e.embeddingProvider,model:e.embeddingModel,base_url:e.embeddingBaseUrl!==""?e.embeddingBaseUrl:void 0},agent:t.agent,context:{...t.context,digest_tier:Hv(e.contextDigestTier,Rj),prompt_search:e.contextPromptSearch,prompt_max_spores:Hv(e.contextMaxSpores,jj)}}}function one(e,t){const n=q_(t);return e.daemonPort!==n.daemonPort||e.logLevel!==n.logLevel||e.logRetentionDays!==n.logRetentionDays||e.embeddingProvider!==n.embeddingProvider||e.embeddingModel!==n.embeddingModel||e.embeddingBaseUrl!==n.embeddingBaseUrl||e.contextDigestTier!==n.contextDigestTier||e.contextPromptSearch!==n.contextPromptSearch||e.contextMaxSpores!==n.contextMaxSpores}function Xa({children:e,hint:t}){return p.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&p.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function yv({children:e}){return p.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function une(){const{config:e,isLoading:t,saveConfig:n,isSaving:r}=__(),{data:a}=Sp(),{restart:i}=x1(),l=j.useRef(!1),[o,f]=j.useState(null);e&&!l.current&&(l.current=!0,o===null&&f(q_(e)));const[c,d]=j.useState(null),[v,m]=j.useState("idle"),[y,x]=j.useState(""),w=o&&e?one(o,e):!1,S=j.useCallback((N,A)=>{f(R=>R&&{...R,[N]:A}),d(null)},[]),b=j.useCallback(async()=>{if(!(!o||!e)){d(null);try{await n(lne(o,e)),d({type:"success",text:"Settings saved. Restarting daemon..."});try{await i()}catch{d({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{d({type:"error",text:"Failed to save settings."})}}},[o,e,n,i]),C=j.useCallback(async()=>{if(o){m("testing"),x("");try{const N=new URLSearchParams({provider:o.embeddingProvider,type:"embedding"});o.embeddingBaseUrl&&N.set("base_url",o.embeddingBaseUrl);const R=(await bt(`/models?${N.toString()}`)).models.length;m("success"),x(`Connected -- ${R} model${R!==1?"s":""} available.`)}catch(N){m("error"),x(N instanceof Error?N.message:"Connection failed.")}}},[o]);if(t||!o||!e)return p.jsxs("div",{className:"p-6",children:[p.jsx(Gi,{title:"Settings"}),p.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-2",children:"Loading..."})]});const T=(a==null?void 0:a.vault.name)??e.embedding.provider;return p.jsxs("div",{className:"p-6",children:[p.jsx(Gi,{title:"Settings",subtitle:"Vault configuration and daemon settings"}),p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsxs(st,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[p.jsx(Zt,{children:"Project"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Vault Name"}),p.jsx(fn,{value:T,readOnly:!0,disabled:!0,className:"text-on-surface-variant bg-surface-container-lowest"})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Daemon Port"}),p.jsx(fn,{type:"number",placeholder:"Auto",value:o.daemonPort,onChange:N=>S("daemonPort",N.target.value)}),p.jsx(yv,{children:"Leave blank to use a random available port."})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Log Level"}),p.jsxs(io,{value:o.logLevel,onValueChange:N=>S("logLevel",N),children:[p.jsx(tl,{children:p.jsx(so,{})}),p.jsx(nl,{children:ane.map(N=>p.jsx(rl,{value:N,children:N},N))})]})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Log Retention (days)"}),p.jsx(fn,{type:"number",min:1,max:365,className:"w-24",value:o.logRetentionDays,onChange:N=>S("logRetentionDays",N.target.value)})]})]})]}),p.jsxs(st,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre h-fit",children:[p.jsx(Zt,{children:"Embedding"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Provider"}),p.jsxs(io,{value:o.embeddingProvider,onValueChange:N=>{S("embeddingProvider",N),m("idle"),x("")},children:[p.jsx(tl,{children:p.jsx(so,{})}),p.jsx(nl,{children:ine.map(N=>p.jsx(rl,{value:N.value,children:N.label},N.value))})]})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Model"}),p.jsx(fn,{placeholder:"bge-m3",value:o.embeddingModel,onChange:N=>S("embeddingModel",N.target.value)})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{hint:"optional",children:"Base URL"}),p.jsx(fn,{type:"url",placeholder:"http://localhost:11434",value:o.embeddingBaseUrl,onChange:N=>{S("embeddingBaseUrl",N.target.value),m("idle"),x("")}})]}),p.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[p.jsxs(Ke,{type:"button",variant:"ghost",size:"sm",onClick:C,disabled:v==="testing",children:[v==="testing"?p.jsx(Qn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Test Connection"]}),v==="success"&&p.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-primary",children:[p.jsx(bj,{className:"h-4 w-4"}),y]}),v==="error"&&p.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[p.jsx(yp,{className:"h-4 w-4"}),y]})]})]})]})]}),p.jsxs(st,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre",children:[p.jsx(Zt,{children:"Context Injection"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Digest Tier"}),p.jsxs(io,{value:o.contextDigestTier,onValueChange:N=>S("contextDigestTier",N),children:[p.jsx(tl,{children:p.jsx(so,{})}),p.jsx(nl,{children:sne.map(N=>p.jsx(rl,{value:N.value,children:N.label},N.value))})]}),p.jsx(yv,{children:"Token budget for digest context injected at session start."})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"space-y-0.5",children:[p.jsx(Xa,{children:"Prompt Search"}),p.jsx(yv,{children:"Search vault for relevant observations on each prompt."})]}),p.jsx(B_,{checked:o.contextPromptSearch,onCheckedChange:N=>S("contextPromptSearch",N)})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(Xa,{children:"Max Spores per Prompt"}),p.jsx(fn,{type:"number",min:"0",max:"10",placeholder:"3",value:o.contextMaxSpores,onChange:N=>S("contextMaxSpores",N.target.value)}),p.jsx(yv,{children:"Maximum observations injected per prompt. Lower = leaner context."})]})]})]}),p.jsx(rne,{}),p.jsxs(st,{level:"low",className:"p-4 flex items-center gap-4 border-t-2 border-t-sage",children:[p.jsxs(Ke,{onClick:b,disabled:!w||r,children:[r?p.jsx(Qn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Settings"]}),c&&p.jsx("span",{className:c.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:c.text})]})]})]})}function cne(){return Fa({queryKey:["embedding-details"],queryFn:({signal:e})=>bt("/embedding/details",{signal:e}),refetchInterval:ra.STATS,pollCategory:"standard"})}const xv=1024;function pR(e){if(e<xv)return`${e} B`;const t=e/xv;return t<xv?`${t.toFixed(1)} KB`:`${(t/xv).toFixed(1)} MB`}function fne(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function dne(){const[e,t]=j.useState([]),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(null),[d,v]=j.useState(""),[m,y]=j.useState(""),[x,w]=j.useState(!1);j.useEffect(()=>{bt("/backup/config").then(A=>{v(A.dir??""),y(A.default_dir)}).catch(()=>{})},[]);const S=j.useCallback(async()=>{w(!0);try{await wp("/backup/config",{dir:d||null}),o({type:"success",text:d?"Backup directory updated. Restart daemon to apply.":"Backup directory reset to default. Restart daemon to apply."})}catch{o({type:"error",text:"Failed to save backup directory."})}finally{w(!1)}},[d]),b=j.useCallback(async()=>{try{const A=await bt("/backups");t(A.backups),r(!0)}catch(A){o({type:"error",text:`Failed to load backups: ${A.message}`})}},[]);!n&&!a&&(i(!0),b().finally(()=>i(!1)));async function C(){o(null),c(null);try{const A=await Cr("/backup");o({type:"success",text:`Backup created: ${A.machine_id} (${pR(A.size_bytes)})`}),await b()}catch(A){o({type:"error",text:`Backup failed: ${A.message}`})}}async function T(A){o(null),c(null);try{const R=await Cr("/restore/preview",{machine_id:A});c(R)}catch(R){o({type:"error",text:`Preview failed: ${R.message}`})}}async function N(A){o(null),c(null);try{const R=await Cr("/restore",{machine_id:A});o({type:"success",text:`Restored ${R.total_restored} records, skipped ${R.total_skipped} duplicates`})}catch(R){o({type:"error",text:`Restore failed: ${R.message}`})}}return p.jsxs(st,{level:"low",className:"p-6 space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(WP,{className:"h-4 w-4 text-primary"}),p.jsx(Zt,{children:"Backup & Restore"})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:b,children:[p.jsx(bp,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]}),p.jsxs(Ke,{variant:"default",size:"sm",onClick:C,children:[p.jsx(HP,{className:"mr-1.5 h-3.5 w-3.5"}),"Backup Now"]})]})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("label",{className:"font-sans text-xs text-on-surface-variant flex items-center gap-1.5",children:[p.jsx(QP,{className:"h-3.5 w-3.5"}),"Backup Directory"]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{type:"text",value:d,onChange:A=>v(A.target.value),placeholder:m||"Default vault directory",className:"flex-1 bg-surface-container text-on-surface font-mono text-sm rounded px-3 py-1.5 outline-none border border-outline-variant/15 focus:border-primary/40 placeholder:text-on-surface-variant/50"}),p.jsx(Ke,{variant:"ghost",size:"sm",onClick:S,disabled:x,children:x?"Saving...":"Save"})]}),p.jsxs("p",{className:"font-sans text-xs text-on-surface-variant",children:["Override where backups are stored. Leave empty for default (",m||"vault/backups","). Useful for network shares or git-tracked directories."]})]}),l&&p.jsx("p",{className:Ae("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),e.length>0?p.jsx("div",{className:"space-y-2",children:e.map(A=>p.jsxs("div",{className:Ae("flex items-center justify-between rounded-md px-4 py-3","bg-surface-container-lowest transition-colors"),children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[p.jsx("span",{className:"font-mono text-sm text-on-surface truncate",children:A.machine_id}),p.jsx(Ln,{variant:"secondary",children:pR(A.size_bytes)}),p.jsx("span",{className:"text-xs text-on-surface-variant",children:fne(A.modified_at)})]}),p.jsxs("div",{className:"flex gap-2 flex-shrink-0 ml-3",children:[p.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>T(A.machine_id),children:"Preview"}),p.jsxs(Ke,{variant:"secondary",size:"sm",onClick:()=>N(A.machine_id),children:[p.jsx(hz,{className:"mr-1.5 h-3.5 w-3.5"}),"Restore"]})]})]},A.machine_id))}):n?p.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:'No backups yet. Click "Backup Now" to create one.'}):null,f&&p.jsxs(st,{level:"lowest",className:"p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Zt,{children:"Restore Preview"}),p.jsx(Ln,{variant:"outline",children:f.machine_id})]}),p.jsx("div",{className:"overflow-x-auto",children:p.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Restore preview",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"text-left text-on-surface-variant",children:[p.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),p.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"New"}),p.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Existing"})]})}),p.jsx("tbody",{children:f.tables.map((A,R)=>p.jsxs("tr",{className:Ae("transition-colors hover:bg-surface-container-high/50",R%2===1?"bg-surface-container-low/30":""),children:[p.jsx("td",{className:"py-2 pr-4",children:A.table}),p.jsx("td",{className:"py-2 pr-4 text-right",children:A.new>0?p.jsx("span",{className:"text-primary",children:A.new}):0}),p.jsx("td",{className:"py-2 text-right text-on-surface-variant",children:A.existing})]},A.table))})]})}),p.jsxs("div",{className:"flex gap-4 font-sans text-sm text-on-surface-variant",children:[p.jsxs("span",{children:["New: ",p.jsx("strong",{className:"text-primary",children:f.total_new})]}),p.jsxs("span",{children:["Existing: ",p.jsx("strong",{children:f.total_existing})]})]})]})]})}const hne=["sessions","spores","plans","artifacts"],mR="embedding",vne=100,gR=2e3,pne=40,yR=20;function mne(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"processing":"idle":"unavailable"}function gne(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"bg-secondary":"bg-primary":"bg-tertiary"}function yne(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return`${n}:${r}:${a}`}function xne(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=pne}function bne({data:e}){return p.jsx("div",{className:"overflow-x-auto",children:p.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Embedding namespace breakdown",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"text-left text-on-surface-variant",children:[p.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Namespace"}),p.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Embedded"}),p.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Pending"}),p.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Stale"}),p.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Total"})]})}),p.jsx("tbody",{children:hne.map((t,n)=>{const r=e.by_namespace[t],a=(r==null?void 0:r.embedded)??0,i=(r==null?void 0:r.stale)??0,l=e.pending[t]??0,o=a+l;return p.jsxs("tr",{className:Ae("transition-colors hover:bg-surface-container-high/50",n%2===1?"bg-surface-container-low/30":""),children:[p.jsx("td",{className:"py-2.5 pr-4",children:t}),p.jsx("td",{className:"py-2.5 pr-4 text-right",children:a}),p.jsx("td",{className:"py-2.5 pr-4 text-right",children:l>0?p.jsx("span",{className:"text-secondary",children:l}):l}),p.jsx("td",{className:"py-2.5 pr-4 text-right",children:i>0?p.jsx("span",{className:"text-tertiary",children:i}):i}),p.jsx("td",{className:"py-2.5 text-right",children:o})]},t)})})]})})}function wne({entry:e}){return p.jsxs("tr",{className:"hover:bg-surface-container-high/30 transition-colors",children:[p.jsx("td",{className:"whitespace-nowrap py-1.5 pl-4 pr-3 text-on-surface-variant/60 align-top w-[68px]",children:yne(e.timestamp)}),p.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[20px]",children:p.jsx("div",{className:Ae("h-2 w-2 rounded-full mt-1",y1(e.level))})}),p.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[54px]",children:p.jsx(Ln,{variant:Dj(e.level),className:"px-1.5 py-0 text-[10px] uppercase",children:e.level})}),p.jsx("td",{className:"py-1.5 pr-4 text-on-surface align-top break-words",children:e.message})]})}function Sne(){const{data:e,isLoading:t,isError:n,error:r}=cne(),a=Ca(),[i,l]=j.useState(null),[o,f]=j.useState([]);j.useEffect(()=>{e&&f(I=>{const F=[...I,e.total];return F.length>yR?F.slice(-yR):F})},[e]);const[c,d]=j.useState([]),[v,m]=j.useState(void 0),[y,x]=j.useState(!0),[w,S]=j.useState(!1),b=j.useRef(null),C=j.useRef(y);C.current=y;const T=j.useRef(v);T.current=v;const{data:N}=Fa({queryKey:["embedding-logs"],queryFn:({signal:I})=>{const F=new URLSearchParams({limit:String(vne),category:mR});return T.current&&F.set("since",T.current),bt(`/logs?${F.toString()}`,{signal:I})},refetchInterval:ra.LOGS,pollCategory:"standard"});j.useEffect(()=>{N!=null&&N.entries.length&&(d(I=>{let F;if(N.cursor_reset){const B=new Set(I.map(Y=>`${Y.timestamp}|${Y.message}`)),H=N.entries.filter(Y=>!B.has(`${Y.timestamp}|${Y.message}`));F=H.length?[...I,...H]:I}else F=[...I,...N.entries];return F.length>gR?F.slice(-gR):F}),m(N.cursor),C.current||S(!0))},[N]),j.useEffect(()=>{!y||!b.current||(b.current.scrollTop=b.current.scrollHeight,S(!1))},[c,y]);const A=j.useCallback(()=>{const I=b.current;I&&(xne(I)?(x(!0),S(!1)):x(!1))},[]),R=j.useCallback(()=>{b.current&&(b.current.scrollTop=b.current.scrollHeight,x(!0),S(!1))},[]),D=j.useMemo(()=>{const I=qv.debug;return c.filter(F=>!(qv[F.level]<I||F.category!==mR))},[c]);async function L(){l(null);try{const I=await Cr("/embedding/reembed-stale");l({type:"success",text:`Re-embedded ${I.reembedded} stale vectors`}),a.invalidateQueries({queryKey:["embedding-details"]})}catch(I){l({type:"error",text:`Error: ${I.message}`})}}async function _(){if(confirm("This will re-embed all vectors. Continue?")){l(null);try{const I=await Cr("/embedding/rebuild");l({type:"success",text:`Rebuild queued: ${I.queued} vectors to re-embed`}),a.invalidateQueries({queryKey:["embedding-details"]})}catch(I){l({type:"error",text:`Error: ${I.message}`})}}}async function M(){l(null);try{const I=await Cr("/embedding/clean-orphans");l({type:"success",text:`Cleaned ${I.orphans_cleaned} orphan vectors`}),a.invalidateQueries({queryKey:["embedding-details"]})}catch(I){l({type:"error",text:`Error: ${I.message}`})}}async function z(){l(null);try{const I=await Cr("/embedding/reconcile");l({type:"success",text:`Reconcile complete: ${I.embedded} embedded, ${I.orphans_cleaned} orphans cleaned (${I.duration_ms}ms)`}),a.invalidateQueries({queryKey:["embedding-details"]})}catch(I){l({type:"error",text:`Error: ${I.message}`})}}const P=e?Object.values(e.pending).reduce((I,F)=>I+F,0):0,G=e?Object.values(e.by_namespace).reduce((I,F)=>I+F.stale,0):0;return p.jsx(R1,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Loading embedding details...",children:e&&p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsx("div",{className:"px-6 pt-6",children:p.jsx(Gi,{title:"Operations",subtitle:"Embedding health, maintenance actions, and activity log"})}),p.jsx("div",{className:"flex-1 overflow-auto",children:p.jsxs("div",{className:"space-y-6 px-6 pb-6",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(v1,{className:"h-4 w-4 text-primary"}),p.jsx("span",{className:"text-on-surface-variant",children:"Provider"}),p.jsx("span",{className:"font-mono text-on-surface",children:e.provider.name})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-on-surface-variant",children:"Model"}),p.jsx("span",{className:"font-mono text-xs text-on-surface truncate max-w-[200px]",title:e.provider.model,children:e.provider.model})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:Ae("h-2 w-2 rounded-full",gne(e))}),p.jsx("span",{className:"text-on-surface-variant capitalize",children:mne(e)})]})]}),p.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[p.jsx(yn,{label:"Total Vectors",value:String(e.total),sparklineData:o,accent:"sage"}),p.jsx(yn,{label:"Pending",value:String(P),accent:P>0?"ochre":"outline"}),p.jsx(yn,{label:"Stale",value:String(G),accent:G>0?"terracotta":"outline"})]}),p.jsxs(st,{level:"low",className:"p-6 space-y-4",children:[p.jsx(Zt,{children:"Namespace Breakdown"}),p.jsx(bne,{data:e})]}),p.jsxs(st,{level:"low",className:"p-6 space-y-3",children:[p.jsx(Zt,{children:"Actions"}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:L,children:[p.jsx(bp,{className:"mr-2 h-4 w-4"}),"Re-embed stale"]}),p.jsxs(Ke,{variant:"ghost",size:"sm",onClick:M,children:[p.jsx(qf,{className:"mr-2 h-4 w-4"}),"Clean orphans"]}),p.jsxs(Ke,{variant:"secondary",size:"sm",onClick:z,children:[p.jsx(Ku,{className:"mr-2 h-4 w-4"}),"Force reconcile"]}),p.jsxs(Ke,{variant:"destructive",size:"sm",onClick:_,children:[p.jsx(m1,{className:"mr-2 h-4 w-4"}),"Rebuild all"]})]}),i&&p.jsx("p",{className:Ae("font-sans text-sm",i.type==="success"?"text-primary":"text-tertiary"),children:i.text})]}),p.jsx(dne,{}),p.jsxs(st,{level:"low",className:"flex flex-col overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[p.jsx(Zt,{children:"Activity Log"}),p.jsxs(Ke,{size:"sm",variant:y?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{y?x(!1):R()},title:y?"Pause auto-scroll":"Resume auto-scroll",children:[y?p.jsx(az,{className:"h-3 w-3"}):p.jsx(Ku,{className:"h-3 w-3"}),y?"Pause":"Resume"]})]}),p.jsxs("div",{className:"relative flex-1 p-0",children:[p.jsx("div",{ref:b,onScroll:A,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:D.length===0?p.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No embedding log entries"}):p.jsx("table",{className:"w-full border-collapse","aria-label":"Embedding activity log",children:p.jsx("tbody",{children:D.map((I,F)=>p.jsx(wne,{entry:I},`${I.timestamp}-${F}`))})})}),w&&!y&&p.jsxs("button",{type:"button",onClick:R,className:Ae("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[p.jsx(IP,{className:"h-3 w-3"}),"New entries below"]})]})]})]})})]})})}function Ene(){return Fa({queryKey:["team-status"],queryFn:({signal:e})=>bt("/team/status",{signal:e}),refetchInterval:ra.STATS,pollCategory:"standard"})}function F0({label:e,value:t,mono:n=!0}){const[r,a]=j.useState(!1),i=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[t]);return p.jsxs("div",{className:"space-y-1",children:[p.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),p.jsxs("div",{className:"flex items-center gap-2 group",children:[p.jsx("span",{className:`text-sm text-on-surface break-all ${n?"font-mono":""}`,children:t}),p.jsx("button",{type:"button",onClick:i,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:r?p.jsx(gp,{className:"h-3.5 w-3.5 text-primary"}):p.jsx(Sj,{className:"h-3.5 w-3.5"})})]})]})}function Cne({label:e,value:t}){const[n,r]=j.useState(!1),[a,i]=j.useState(!1),l=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[t]),o=`${t.slice(0,8)}${"*".repeat(Math.max(0,t.length-12))}${t.slice(-4)}`;return p.jsxs("div",{className:"space-y-1",children:[p.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),p.jsxs("div",{className:"flex items-center gap-2 group",children:[p.jsx("span",{className:"text-sm text-on-surface font-mono break-all",children:n?t:o}),p.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface transition-opacity",title:n?"Hide":"Reveal",children:n?p.jsx(GP,{className:"h-3.5 w-3.5"}):p.jsx($P,{className:"h-3.5 w-3.5"})}),p.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:a?p.jsx(gp,{className:"h-3.5 w-3.5 text-primary"}):p.jsx(Sj,{className:"h-3.5 w-3.5"})})]})]})}function Tne({onConnected:e}){const[t,n]=j.useState(""),[r,a]=j.useState(""),[i,l]=j.useState(null),[o,f]=j.useState(!1),c=async d=>{d.preventDefault(),l(null),f(!0);try{await Cr("/team/connect",{url:t,api_key:r}),e()}catch(v){l(v instanceof Error?v.message:"Connection failed")}finally{f(!1)}};return p.jsxs(st,{level:"low",ghostBorder:!0,className:"p-6",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx(Nj,{className:"h-4 w-4 text-on-surface-variant"}),p.jsx(Zt,{children:"Connect to team"})]}),p.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:"Enter the URL and API key for your team's Cloudflare Worker to enable cross-machine knowledge sharing."}),p.jsxs("form",{onSubmit:c,className:"space-y-3",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"Worker URL"}),p.jsx(fn,{type:"url",placeholder:"https://myco-team.your-account.workers.dev",value:t,onChange:d=>n(d.target.value),required:!0})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"API Key"}),p.jsx(fn,{type:"password",placeholder:"your-api-key",value:r,onChange:d=>a(d.target.value),required:!0})]}),i&&p.jsx("p",{className:"text-sm text-tertiary",children:i}),p.jsx(Ke,{type:"submit",size:"sm",disabled:o||!t||!r,children:o?p.jsxs(p.Fragment,{children:[p.jsx(bp,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Connecting..."]}):"Connect"})]})]})}function kne({status:e}){const t=Ca(),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),f=async()=>{r(!0);try{await Cr("/team/disconnect"),t.invalidateQueries({queryKey:["team-status"]})}finally{r(!1)}},c=j.useCallback(async()=>{i(!0),o(null);try{const d=await Cr("/team/backfill");o(d.enqueued>0?`Enqueued ${d.enqueued} records for sync. They'll push on the next flush cycle.`:"All records are already synced or enqueued."),t.invalidateQueries({queryKey:["team-status"]})}catch{o("Backfill failed.")}finally{i(!1)}},[t]);return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[p.jsx(yn,{label:"Status",value:e.healthy?"Connected":"Unhealthy",icon:e.healthy?pz:Nj}),p.jsx(yn,{label:"Pending sync",value:e.pending_sync_count}),p.jsx(yn,{label:"Protocol",value:`v${e.sync_protocol_version}`}),p.jsx(yn,{label:"Schema",value:`v${e.schema_version}`})]}),p.jsxs(st,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Zt,{children:"Team Credentials"}),p.jsx(Ln,{variant:e.healthy?"default":"destructive",children:e.healthy?"healthy":"unhealthy"})]}),p.jsx("p",{className:"text-xs text-on-surface-variant",children:"Share these with teammates so they can connect from the Team page."}),p.jsxs("div",{className:"space-y-3",children:[e.worker_url&&p.jsx(F0,{label:"Worker URL",value:e.worker_url}),e.api_key&&p.jsx(Cne,{label:"API Key",value:e.api_key})]})]}),p.jsxs(st,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[p.jsx(Zt,{children:"This Node"}),p.jsxs("div",{className:"grid gap-3",children:[p.jsx(F0,{label:"Machine ID",value:e.machine_id}),p.jsx(F0,{label:"Package Version",value:e.package_version})]}),e.health_error&&p.jsx("p",{className:"text-sm text-tertiary mt-2",children:e.health_error})]}),p.jsxs(st,{level:"low",ghostBorder:!0,className:"p-5 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Zt,{children:"Sync"}),p.jsx(Ke,{variant:"default",size:"sm",onClick:c,disabled:a,children:a?p.jsxs(p.Fragment,{children:[p.jsx(bp,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Syncing..."]}):"Sync All"})]}),p.jsx("p",{className:"text-xs text-on-surface-variant",children:"Push all unsynced local knowledge to the team store. Records sync automatically on new writes, but historical data needs a one-time backfill."}),l&&p.jsx("p",{className:"text-sm text-primary",children:l})]}),p.jsx("div",{className:"flex justify-end",children:p.jsx(Ke,{variant:"outline",size:"sm",onClick:f,disabled:n,children:n?"Disconnecting...":"Disconnect"})})]})}function Nne(){const{data:e,isLoading:t}=Ene(),n=Ca();if(t)return p.jsx(R1,{});const r=(e==null?void 0:e.enabled)&&(e==null?void 0:e.worker_url);return p.jsxs("div",{className:"p-6 max-w-4xl",children:[p.jsx(Gi,{title:"Team",subtitle:"Share knowledge across machines with team sync"}),r&&e?p.jsx(kne,{status:e}):p.jsxs("div",{className:"space-y-4",children:[p.jsxs(st,{level:"low",ghostBorder:!0,className:"p-6 space-y-4",children:[p.jsx(Zt,{children:"Getting Started"}),p.jsx("p",{className:"text-sm text-on-surface-variant",children:"Team sync lets multiple machines share captured knowledge through a Cloudflare Worker. One team member provisions the infrastructure, then shares the connection details."}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"1. Install Wrangler"}),p.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"npm install -g wrangler && wrangler login"})]}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"2. Provision the team"}),p.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"myco team init"}),p.jsx("p",{className:"text-xs text-on-surface-variant mt-1",children:"Creates a D1 database, Vectorize index, and deploys the sync worker. Outputs a Worker URL and API key to share with teammates."})]}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"3. Connect"}),p.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Paste the Worker URL and API key below, or if you ran ",p.jsx("code",{className:"font-mono",children:"myco team init"}),", you're already connected."]})]})]})]}),p.jsx(Tne,{onConnected:()=>n.invalidateQueries({queryKey:["team-status"]})})]})]})}const Ane=[{value:"15m",label:"15m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"},{value:"30d",label:"30d"}];function Rne({mode:e,onModeChange:t,searchValue:n,onSearchChange:r,onSearchSubmit:a,activeLevel:i,onLevelChange:l,components:o,activeComponents:f,onComponentToggle:c,onComponentsClear:d,timeRange:v,onTimeRangeChange:m,totalResults:y}){return p.jsxs(st,{level:"default",className:"rounded-md p-3 space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{className:"flex items-center rounded-md bg-surface-container-low",children:[p.jsxs(Ke,{size:"sm",variant:e==="live"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-r-none",onClick:()=>t("live"),children:[p.jsx(Cj,{className:"h-3 w-3"}),"Live"]}),p.jsxs(Ke,{size:"sm",variant:e==="search"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-l-none",onClick:()=>t("search"),children:[p.jsx(nc,{className:"h-3 w-3"}),"Search"]})]}),e==="search"&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"h-5 w-px bg-outline-variant/30"}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(UP,{className:"h-3 w-3 text-on-surface-variant/50"}),Ane.map(x=>p.jsx(Ke,{size:"sm",variant:v===x.value?"default":"ghost",className:"h-6 px-1.5 text-[10px]",onClick:()=>m(x.value),children:x.label},x.value))]})]}),p.jsx("form",{className:"ml-auto flex items-center gap-1.5",onSubmit:x=>{x.preventDefault(),a()},children:p.jsx(fn,{className:"h-7 w-56 text-xs",placeholder:e==="search"?"Search logs...":"Filter messages...",value:n,onChange:x=>r(x.target.value),"aria-label":"Search log messages"})}),e==="search"&&y!==void 0&&p.jsxs("span",{className:"text-[10px] font-mono text-on-surface-variant/50 tabular-nums whitespace-nowrap",children:[y.toLocaleString()," results"]})]}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"flex items-center gap-1",children:Cz.map(x=>p.jsxs(Ke,{size:"sm",variant:i===x?"default":"ghost",className:"h-6 px-2 text-[10px] capitalize gap-1.5",onClick:()=>l(x),children:[p.jsx("div",{className:Ae("h-1.5 w-1.5 rounded-full",y1(x))}),x]},x))}),o.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"h-4 w-px bg-outline-variant/20"}),p.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[o.map(x=>p.jsx(Ke,{size:"sm",variant:f.has(x)?"default":"ghost",className:"h-5 px-1.5 text-[10px]",onClick:()=>c(x),children:x},x)),f.size>0&&p.jsx(Ke,{size:"sm",variant:"ghost",className:"h-5 px-1.5 text-[10px] text-on-surface-variant",onClick:d,children:"clear"})]})]})]})]})}const jne={debug:"border-l-outline/30",info:"border-l-primary/50",warn:"border-l-secondary/70",error:"border-l-tertiary/80"},Dne={context:"text-primary/70",hooks:"text-on-surface-variant/70",agent:"text-secondary/80",daemon:"text-on-surface-variant/60",capture:"text-primary/60",processor:"text-on-surface-variant/70",lifecycle:"text-primary/50",embedding:"text-on-surface-variant/60",power:"text-on-surface-variant/50",server:"text-on-surface-variant/60"};function Mne(e,t){if(t)return D1(e);const n=new Date(e),r=String(n.getHours()).padStart(2,"0"),a=String(n.getMinutes()).padStart(2,"0"),i=String(n.getSeconds()).padStart(2,"0");return`${r}:${a}:${i}`}function One({entries:e,selectedId:t,onSelect:n,autoScroll:r=!1,relativeTime:a=!1,compact:i=!0}){const l=j.useRef(null);return j.useEffect(()=>{!r||!l.current||(l.current.scrollTop=l.current.scrollHeight)},[e,r]),p.jsx("div",{ref:l,className:"flex-1 overflow-y-auto bg-surface-container-lowest font-mono text-xs",children:e.length===0?p.jsx("div",{className:"flex h-full min-h-[200px] items-center justify-center text-on-surface-variant/50 font-sans text-sm",children:"No log entries"}):p.jsx("table",{className:"w-full border-collapse","aria-label":"Log entries",children:p.jsx("tbody",{children:e.map(o=>p.jsx(Lne,{entry:o,selected:o.id===t,onSelect:n,relativeTime:a,compact:i},o.id))})})})}const Lne=j.memo(function({entry:t,selected:n,onSelect:r,relativeTime:a,compact:i}){const l=i?"py-0.5":"py-1.5";return p.jsxs("tr",{className:Ae("cursor-pointer transition-colors border-l-2",jne[t.level],n?"bg-primary/10":"hover:bg-surface-container-high/30"),onClick:()=>r(t),children:[p.jsx("td",{className:Ae("whitespace-nowrap pl-3 pr-2 text-on-surface-variant/50 align-top w-[68px] tabular-nums",l),children:Mne(t.timestamp,a)}),p.jsx("td",{className:Ae("whitespace-nowrap pr-1 align-top w-[12px]",l),children:p.jsx("div",{className:Ae("h-1.5 w-1.5 rounded-full mt-1",y1(t.level))})}),p.jsx("td",{className:Ae("whitespace-nowrap pr-2 align-top w-[48px]",l),children:p.jsx(Ln,{variant:Dj(t.level),className:"px-1 py-0 text-[9px] uppercase",children:t.level})}),p.jsx("td",{className:Ae("whitespace-nowrap pr-2 align-top w-[90px] truncate max-w-[90px]",l,Dne[t.component]??"text-on-surface-variant/60"),children:t.component}),p.jsx("td",{className:Ae("pr-3 text-on-surface align-top break-words",l),children:t.message})]})});function _ne({value:e}){const t=String(e),n=t.slice(0,8);return p.jsxs(mp,{to:`/sessions/${t}`,className:"font-mono text-primary hover:underline",children:[n,"..."]})}function Bne({value:e}){return Array.isArray(e)?p.jsx("span",{className:"flex flex-wrap gap-1",children:e.map((t,n)=>p.jsx(Ln,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:String(t)},n))}):p.jsx("span",{children:String(e)})}function Pne({value:e}){return Array.isArray(e)?p.jsx("span",{className:"flex gap-1",children:e.map((t,n)=>p.jsx(Ln,{variant:"outline",className:"text-[10px] px-1.5 py-0 tabular-nums",children:String(t)},n))}):p.jsx("span",{children:String(e)})}function zne({value:e}){return p.jsx("span",{className:"rounded bg-tertiary/10 px-2 py-0.5 text-tertiary font-mono text-[11px]",children:String(e)})}function xR({value:e}){return p.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-surface-container-lowest px-2 py-1 text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:String(e)})}function Ine({value:e}){const t=new Date(String(e)),r=new Date().getTime()-t.getTime(),a=Math.floor(r/6e4),i=Math.floor(a/60),l=Math.floor(i/24);let o;return a<1?o="just now":a<60?o=`${a}m ago`:i<24?o=`${i}h ago`:o=`${l}d ago`,p.jsx("span",{className:"tabular-nums",title:t.toISOString(),children:o})}function Fne({value:e}){return typeof e=="object"&&e!==null?p.jsx("pre",{className:"text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):p.jsx("span",{children:String(e)})}const qne={session_id:_ne,spore_titles:Bne,scores:Pne,error:zne,preview:xR,generated_at:Ine,text:xR},Une=new Set(["id","timestamp","level","kind","component","message"]);function bR(e,t){const n=qne[e]??Fne;return p.jsx(n,{value:t})}function Vne(e){return Une.has(e)}function Hne(e){return e?Object.entries(e).filter(([t])=>!Vne(t)):[]}const Gne={debug:"text-on-surface-variant/60",info:"text-primary",warn:"text-secondary",error:"text-tertiary"};function $ne({entry:e,resolved:t,onClose:n}){const r=Hne(e.data);return p.jsxs("div",{className:"flex h-full flex-col bg-surface-container-low",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/10",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ln,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-mono",children:e.kind}),p.jsx("span",{className:Ae("text-xs font-medium",Gne[e.level]),children:e.level.toUpperCase()})]}),p.jsx(Ke,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:n,"aria-label":"Close detail panel",children:p.jsx(rc,{className:"h-3.5 w-3.5"})})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Timestamp"}),p.jsx("div",{className:"font-mono text-xs tabular-nums",children:new Date(e.timestamp).toLocaleString()})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Message"}),p.jsx("div",{className:"text-sm text-on-surface leading-relaxed",children:e.message})]}),e.session_id&&p.jsxs("div",{children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Session"}),p.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[bR("session_id",e.session_id),(t==null?void 0:t.session_title)&&p.jsx("span",{className:"text-on-surface-variant/70",children:String(t.session_title)})]})]}),r.length>0&&p.jsxs("div",{children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-1.5",children:"Metadata"}),p.jsx("div",{className:"space-y-2",children:r.map(([a,i])=>p.jsxs("div",{children:[p.jsx("div",{className:"text-[10px] text-on-surface-variant/40 mb-0.5",children:a}),p.jsx("div",{className:"text-xs",children:bR(a,i)})]},a))})]})]}),p.jsx("div",{className:"px-4 py-2 border-t border-outline-variant/10",children:p.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/40 tabular-nums",children:["id: ",e.id]})})]})}const wR=5e3;function Kne(){const[e,t]=j.useState([]),n=j.useRef(0),{data:r}=Tn({queryKey:["logs-stream"],queryFn:({signal:i})=>bt(`/logs/stream?since=${n.current}`,{signal:i}),refetchInterval:ra.LOGS});j.useEffect(()=>{r!=null&&r.entries.length&&(n.current=r.cursor,t(i=>{const l=[...i,...r.entries];return l.length>wR?l.slice(-wR):l}))},[r]);const a=j.useCallback(()=>{t([])},[]);return{entries:e,clear:a}}function Yne(e,t){const n=new URLSearchParams;return e.q&&n.set("q",e.q),e.level&&n.set("level",e.level),e.component&&n.set("component",e.component),e.kind&&n.set("kind",e.kind),e.session_id&&n.set("session_id",e.session_id),e.from&&n.set("from",e.from),e.to&&n.set("to",e.to),e.page&&n.set("page",String(e.page)),e.page_size&&n.set("page_size",String(e.page_size)),Tn({queryKey:["logs-search",Object.fromEntries(n)],queryFn:({signal:r})=>bt(`/logs/search?${n.toString()}`,{signal:r}),enabled:t})}function Xne(e){return Tn({queryKey:["log-detail",e],queryFn:({signal:t})=>bt(`/logs/${e}`,{signal:t}),enabled:e!==null})}function Qne(e){const t=Date.now(),n={"15m":15*6e4,"1h":60*6e4,"6h":360*6e4,"24h":1440*6e4,"7d":10080*6e4,"30d":720*60*6e4};return new Date(t-(n[e]??n["24h"])).toISOString()}function Wne(){const[e,t]=j.useState("live"),[n,r]=j.useState(""),[a,i]=j.useState(""),[l,o]=j.useState("debug"),[f,c]=j.useState(new Set),[d,v]=j.useState("24h"),[m,y]=j.useState(1),[x,w]=j.useState(null),{entries:S}=Kne(),b=j.useMemo(()=>({q:a||void 0,level:l!=="debug"?l:void 0,component:f.size>0?Array.from(f).join(","):void 0,from:Qne(d),page:m,page_size:ni}),[a,l,f,d,m]),{data:C}=Yne(b,e==="search"),{data:T}=Xne((x==null?void 0:x.id)??null),[N,A]=j.useState([]);j.useEffect(()=>{const I=e==="live"?S:(C==null?void 0:C.entries)??[];A(F=>{const B=new Set(F);let H=!1;for(const Y of I)B.has(Y.component)||(B.add(Y.component),H=!0);return H?Array.from(B).sort():F})},[S,C,e]);const R=j.useMemo(()=>{const I=qv[l]??0,F=n.trim().toLowerCase();return S.filter(B=>!((qv[B.level]??0)<I||f.size>0&&!f.has(B.component)||F&&!B.message.toLowerCase().includes(F)))},[S,l,f,n]),D=e==="live"?R:(C==null?void 0:C.entries)??[],L=j.useCallback(I=>{t(I),w(null)},[]),_=j.useCallback(()=>{i(n),y(1)},[n]),M=j.useCallback(I=>{w(F=>(F==null?void 0:F.id)===I.id?null:I)},[]),z=j.useCallback(I=>{c(F=>{const B=new Set(F);return B.has(I)?B.delete(I):B.add(I),B}),y(1)},[]),P=j.useCallback(I=>{o(I),y(1)},[]),G=x!==null;return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsx("div",{className:"px-6 pt-6",children:p.jsx(Gi,{title:"Logs",subtitle:"Daemon log explorer"})}),p.jsx("div",{className:"px-6 mb-3",children:p.jsx(Rne,{mode:e,onModeChange:L,searchValue:n,onSearchChange:r,onSearchSubmit:_,activeLevel:l,onLevelChange:P,components:N,activeComponents:f,onComponentToggle:z,onComponentsClear:()=>{c(new Set),y(1)},timeRange:d,onTimeRangeChange:I=>{v(I),y(1)},totalResults:e==="search"?C==null?void 0:C.total:void 0})}),p.jsxs("div",{className:"flex flex-1 overflow-hidden mx-6 mb-6 rounded-lg border border-outline-variant/10",children:[p.jsxs("div",{className:Ae("flex flex-col",G?"w-3/5":"w-full"),children:[p.jsx(One,{entries:D,selectedId:(x==null?void 0:x.id)??null,onSelect:M,autoScroll:e==="live",relativeTime:e==="live",compact:!0}),e==="search"&&C&&p.jsx("div",{className:"border-t border-outline-variant/10 px-3 py-2 bg-surface-container-low",children:p.jsx(Ip,{total:C.total,offset:(m-1)*ni,limit:ni,onPageChange:I=>y(Math.floor(I/ni)+1)})})]}),G&&x&&p.jsx("div",{className:"w-2/5 border-l border-outline-variant/10",children:p.jsx($ne,{entry:x,resolved:T==null?void 0:T.resolved,onClose:()=>w(null)})})]})]})}function Zne(){return p.jsx(UB,{children:p.jsxs(Ra,{element:p.jsx(pF,{}),children:[p.jsx(Ra,{path:"/",element:p.jsx(fq,{})}),p.jsx(Ra,{path:"/sessions",element:p.jsx(Nk,{})}),p.jsx(Ra,{path:"/sessions/:id",element:p.jsx(Nk,{})}),p.jsx(Ra,{path:"/mycelium",element:p.jsx(lte,{})}),p.jsx(Ra,{path:"/agent",element:p.jsx(nne,{})}),p.jsx(Ra,{path:"/settings",element:p.jsx(une,{})}),p.jsx(Ra,{path:"/operations",element:p.jsx(Sne,{})}),p.jsx(Ra,{path:"/team",element:p.jsx(Nne,{})}),p.jsx(Ra,{path:"/logs",element:p.jsx(Wne,{})})]})})}const Jne=new R4({defaultOptions:{queries:{staleTime:Ez}}});a4.createRoot(document.getElementById("root")).render(p.jsx(Bi.StrictMode,{children:p.jsx(CP,{children:p.jsx(jP,{children:p.jsx(LP,{children:p.jsx(j4,{client:Jne,children:p.jsx(dP,{children:p.jsx(Zne,{})})})})})})}));
|