@goondocks/myco 0.12.10 → 0.13.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/README.md +6 -0
- package/dist/{agent-run-GUHXRNZB.js → agent-run-YBASQHC7.js} +8 -7
- package/dist/{agent-run-GUHXRNZB.js.map → agent-run-YBASQHC7.js.map} +1 -1
- package/dist/{agent-tasks-GWZI5WSB.js → agent-tasks-WBQFDHWC.js} +8 -7
- package/dist/{agent-tasks-GWZI5WSB.js.map → agent-tasks-WBQFDHWC.js.map} +1 -1
- package/dist/{chunk-LGPBVBFY.js → chunk-2PWO3WPS.js} +5 -7
- package/dist/chunk-2PWO3WPS.js.map +1 -0
- package/dist/{chunk-TCGOSLW6.js → chunk-5BK6M6X5.js} +503 -53
- package/dist/chunk-5BK6M6X5.js.map +1 -0
- package/dist/{chunk-QL2RBFIC.js → chunk-5YQ6VOFZ.js} +2 -2
- package/dist/{chunk-D4M2AV65.js → chunk-DTE3SHYK.js} +46 -3
- package/dist/chunk-DTE3SHYK.js.map +1 -0
- package/dist/{chunk-FYGFMIS6.js → chunk-EUQQVKGQ.js} +2 -2
- package/dist/{chunk-YRUJ5KGV.js → chunk-GDCSPMH4.js} +3 -3
- package/dist/{chunk-LUQBT2Y4.js → chunk-HHZ3RTEI.js} +2 -2
- package/dist/{chunk-JROOQQH6.js → chunk-JBFFAGJK.js} +12 -7
- package/dist/chunk-JBFFAGJK.js.map +1 -0
- package/dist/{chunk-D4ESHOOJ.js → chunk-KNTJOMWY.js} +3 -3
- package/dist/{chunk-JHLALJPB.js → chunk-LD6U3L6O.js} +8 -8
- package/dist/{chunk-Q2AYS2QE.js → chunk-LPISXFM4.js} +5 -7
- package/dist/chunk-LPISXFM4.js.map +1 -0
- package/dist/{chunk-PW5QVY44.js → chunk-NCVR636M.js} +318 -4
- package/dist/chunk-NCVR636M.js.map +1 -0
- package/dist/{chunk-4VSNNMEU.js → chunk-NRT2ZRUG.js} +8 -3
- package/dist/{chunk-4VSNNMEU.js.map → chunk-NRT2ZRUG.js.map} +1 -1
- package/dist/{chunk-7NBDELZB.js → chunk-NVCGF2DS.js} +26 -8
- package/dist/{chunk-7NBDELZB.js.map → chunk-NVCGF2DS.js.map} +1 -1
- package/dist/{chunk-SW62AX75.js → chunk-OKCSSDFC.js} +2 -2
- package/dist/{chunk-RR75ZKEV.js → chunk-OQVKLTQY.js} +4 -4
- package/dist/{chunk-J3L2RTYK.js → chunk-RBFECYNA.js} +2 -2
- package/dist/{chunk-M5XWW7UI.js → chunk-SODRR3HE.js} +8 -1
- package/dist/chunk-SODRR3HE.js.map +1 -0
- package/dist/{chunk-MCARJFBA.js → chunk-T77674VB.js} +4 -4
- package/dist/chunk-TFGGH6UB.js +112 -0
- package/dist/chunk-TFGGH6UB.js.map +1 -0
- package/dist/{chunk-SFC4GXEN.js → chunk-TNCBMGWB.js} +39 -104
- package/dist/chunk-TNCBMGWB.js.map +1 -0
- package/dist/{chunk-PIRWYDOH.js → chunk-TRA3R4EC.js} +7 -1
- package/dist/chunk-TRA3R4EC.js.map +1 -0
- package/dist/{chunk-SVQAPEYH.js → chunk-VQEXXS56.js} +22 -5
- package/dist/chunk-VQEXXS56.js.map +1 -0
- package/dist/{chunk-OAGY5APE.js → chunk-W3T3QDBN.js} +68 -7
- package/dist/chunk-W3T3QDBN.js.map +1 -0
- package/dist/{chunk-HLGPGHT7.js → chunk-YYQWCTF6.js} +3 -3
- package/dist/{cli-CFOIDXOY.js → cli-WCBTILMW.js} +41 -40
- package/dist/{cli-CFOIDXOY.js.map → cli-WCBTILMW.js.map} +1 -1
- package/dist/{client-ZBCGODTS.js → client-MJUZJ5MC.js} +5 -5
- package/dist/{config-6RQ7FAEV.js → config-WBCOTJUE.js} +5 -3
- package/dist/{config-6RQ7FAEV.js.map → config-WBCOTJUE.js.map} +1 -1
- package/dist/{detect-providers-JFE3QLJI.js → detect-providers-PAVE2X6O.js} +4 -4
- package/dist/{doctor-W3I7RVU4.js → doctor-GDCLRJOF.js} +13 -11
- package/dist/{doctor-W3I7RVU4.js.map → doctor-GDCLRJOF.js.map} +1 -1
- package/dist/{executor-LKDWMGC7.js → executor-TCAXFOIS.js} +374 -39
- package/dist/executor-TCAXFOIS.js.map +1 -0
- package/dist/{init-M3HYJGHE.js → init-ZSDMXY4T.js} +16 -15
- package/dist/{init-M3HYJGHE.js.map → init-ZSDMXY4T.js.map} +1 -1
- package/dist/{init-wizard-C4WQA47U.js → init-wizard-6LDUVR7C.js} +12 -12
- package/dist/installer-25TSX4SR.js +13 -0
- package/dist/{llm-O46QYWEM.js → llm-T3QVHC3Y.js} +7 -7
- package/dist/{loader-4FMGOVWF.js → loader-L2TCAYCT.js} +4 -2
- package/dist/{loader-BQ4X4K3F.js → loader-WQKVWL5D.js} +4 -4
- package/dist/{main-CMWNMCW2.js → main-25MKYYKO.js} +452 -103
- package/dist/main-25MKYYKO.js.map +1 -0
- package/dist/{open-4N7T37XV.js → open-4YTUNIP3.js} +8 -7
- package/dist/{open-4N7T37XV.js.map → open-4YTUNIP3.js.map} +1 -1
- package/dist/{openai-embeddings-HWAKOGUM.js → openai-embeddings-5T5ZP7LO.js} +4 -4
- package/dist/{openrouter-GXZK7JXR.js → openrouter-RD2COFC7.js} +4 -4
- package/dist/{post-compact-BPICHUPV.js → post-compact-E5V4OZJB.js} +7 -7
- package/dist/{post-tool-use-OHJ2EH7I.js → post-tool-use-Y6UWKCVD.js} +7 -7
- package/dist/{post-tool-use-failure-CBPY2TSN.js → post-tool-use-failure-AHFXMNHX.js} +7 -7
- package/dist/{pre-compact-ULAA4XIB.js → pre-compact-EI5EV3N7.js} +7 -7
- package/dist/{provider-check-CKZW3GQX.js → provider-check-QN7OGXZA.js} +4 -4
- package/dist/{registry-ZHUVXGPO.js → registry-2XQMCPA6.js} +5 -5
- package/dist/{remove-52PTVOCJ.js → remove-F63WBELE.js} +10 -8
- package/dist/{remove-52PTVOCJ.js.map → remove-F63WBELE.js.map} +1 -1
- package/dist/{resolution-events-WZHPQQMN.js → resolution-events-BZYMUQ53.js} +4 -4
- package/dist/{restart-O37BUPLH.js → restart-GULUNCMX.js} +9 -8
- package/dist/{restart-O37BUPLH.js.map → restart-GULUNCMX.js.map} +1 -1
- package/dist/{search-52YK2ZWU.js → search-NLZMCEAG.js} +9 -8
- package/dist/{search-52YK2ZWU.js.map → search-NLZMCEAG.js.map} +1 -1
- package/dist/{server-7OKRAJCM.js → server-CXPWUO6H.js} +115 -14
- package/dist/server-CXPWUO6H.js.map +1 -0
- package/dist/{session-57IAZYRK.js → session-XXVEDIQZ.js} +10 -9
- package/dist/{session-57IAZYRK.js.map → session-XXVEDIQZ.js.map} +1 -1
- package/dist/{session-end-WRKDJEWM.js → session-end-6DP6VTZV.js} +6 -6
- package/dist/{session-start-7VWGEVOX.js → session-start-QNAQDF5M.js} +12 -12
- package/dist/{setup-llm-IDQPX22O.js → setup-llm-ER3B7AZ2.js} +10 -9
- package/dist/{setup-llm-IDQPX22O.js.map → setup-llm-ER3B7AZ2.js.map} +1 -1
- package/dist/src/agent/definitions/agent.yaml +2 -0
- package/dist/src/agent/definitions/tasks/digest-only.yaml +1 -0
- package/dist/src/agent/definitions/tasks/extract-only.yaml +1 -0
- package/dist/src/agent/definitions/tasks/full-intelligence.yaml +8 -0
- package/dist/src/agent/definitions/tasks/graph-maintenance.yaml +1 -0
- package/dist/src/agent/definitions/tasks/review-session.yaml +1 -0
- package/dist/src/agent/definitions/tasks/skill-evolve.yaml +155 -0
- package/dist/src/agent/definitions/tasks/skill-generate.yaml +210 -0
- package/dist/src/agent/definitions/tasks/skill-survey.yaml +149 -0
- package/dist/src/agent/definitions/tasks/supersession-sweep.yaml +1 -0
- package/dist/src/agent/definitions/tasks/title-summary.yaml +1 -0
- package/dist/src/agent/prompts/agent.md +29 -0
- package/dist/src/cli.js +1 -1
- package/dist/src/daemon/main.js +1 -1
- package/dist/src/hooks/post-tool-use.js +1 -1
- package/dist/src/hooks/session-end.js +1 -1
- package/dist/src/hooks/session-start.js +1 -1
- package/dist/src/hooks/stop.js +1 -1
- package/dist/src/hooks/user-prompt-submit.js +1 -1
- package/dist/src/mcp/server.js +1 -1
- package/dist/src/worker/src/index.ts +3 -0
- package/dist/src/worker/src/schema.ts +56 -0
- package/dist/{stats-D7U5HQ3L.js → stats-VQ7XMOCU.js} +10 -9
- package/dist/{stats-D7U5HQ3L.js.map → stats-VQ7XMOCU.js.map} +1 -1
- package/dist/{stop-VJU4AAOQ.js → stop-VTO2KIRG.js} +6 -6
- package/dist/{stop-failure-ILPHO26U.js → stop-failure-C5T6LJQR.js} +7 -7
- package/dist/{subagent-start-77MY4UMP.js → subagent-start-NZF42NKF.js} +7 -7
- package/dist/{subagent-stop-DABERMXZ.js → subagent-stop-UV5ECFVU.js} +7 -7
- package/dist/{task-completed-TBWBOAJ6.js → task-completed-3SV6TL3V.js} +7 -7
- package/dist/{team-K6H4B3ZD.js → team-XSJXLBZX.js} +45 -19
- package/dist/team-XSJXLBZX.js.map +1 -0
- package/dist/ui/assets/index-BeygBZGu.css +1 -0
- package/dist/ui/assets/index-CbGC0T_o.js +822 -0
- package/dist/ui/index.html +2 -2
- package/dist/{update-GW774ZMW.js → update-5GXOQIY5.js} +8 -7
- package/dist/{update-GW774ZMW.js.map → update-5GXOQIY5.js.map} +1 -1
- package/dist/{user-prompt-submit-C47Y5Y5I.js → user-prompt-submit-VLQG77A6.js} +6 -6
- package/dist/{verify-MQAANTUR.js → verify-WF7U3NQW.js} +8 -8
- package/dist/{version-42DQW43N.js → version-RGX7TZ7V.js} +2 -2
- package/dist/version-RGX7TZ7V.js.map +1 -0
- package/package.json +6 -6
- package/dist/chunk-D4M2AV65.js.map +0 -1
- package/dist/chunk-JROOQQH6.js.map +0 -1
- package/dist/chunk-LGPBVBFY.js.map +0 -1
- package/dist/chunk-M5XWW7UI.js.map +0 -1
- package/dist/chunk-OAGY5APE.js.map +0 -1
- package/dist/chunk-PIRWYDOH.js.map +0 -1
- package/dist/chunk-PW5QVY44.js.map +0 -1
- package/dist/chunk-Q2AYS2QE.js.map +0 -1
- package/dist/chunk-SFC4GXEN.js.map +0 -1
- package/dist/chunk-SVQAPEYH.js.map +0 -1
- package/dist/chunk-TCGOSLW6.js.map +0 -1
- package/dist/executor-LKDWMGC7.js.map +0 -1
- package/dist/main-CMWNMCW2.js.map +0 -1
- package/dist/server-7OKRAJCM.js.map +0 -1
- package/dist/team-K6H4B3ZD.js.map +0 -1
- package/dist/ui/assets/index-BGbil7f1.css +0 -1
- package/dist/ui/assets/index-ZSGlKT25.js +0 -804
- /package/dist/{chunk-QL2RBFIC.js.map → chunk-5YQ6VOFZ.js.map} +0 -0
- /package/dist/{chunk-FYGFMIS6.js.map → chunk-EUQQVKGQ.js.map} +0 -0
- /package/dist/{chunk-YRUJ5KGV.js.map → chunk-GDCSPMH4.js.map} +0 -0
- /package/dist/{chunk-LUQBT2Y4.js.map → chunk-HHZ3RTEI.js.map} +0 -0
- /package/dist/{chunk-D4ESHOOJ.js.map → chunk-KNTJOMWY.js.map} +0 -0
- /package/dist/{chunk-JHLALJPB.js.map → chunk-LD6U3L6O.js.map} +0 -0
- /package/dist/{chunk-SW62AX75.js.map → chunk-OKCSSDFC.js.map} +0 -0
- /package/dist/{chunk-RR75ZKEV.js.map → chunk-OQVKLTQY.js.map} +0 -0
- /package/dist/{chunk-J3L2RTYK.js.map → chunk-RBFECYNA.js.map} +0 -0
- /package/dist/{chunk-MCARJFBA.js.map → chunk-T77674VB.js.map} +0 -0
- /package/dist/{chunk-HLGPGHT7.js.map → chunk-YYQWCTF6.js.map} +0 -0
- /package/dist/{client-ZBCGODTS.js.map → client-MJUZJ5MC.js.map} +0 -0
- /package/dist/{detect-providers-JFE3QLJI.js.map → detect-providers-PAVE2X6O.js.map} +0 -0
- /package/dist/{init-wizard-C4WQA47U.js.map → init-wizard-6LDUVR7C.js.map} +0 -0
- /package/dist/{llm-O46QYWEM.js.map → installer-25TSX4SR.js.map} +0 -0
- /package/dist/{loader-4FMGOVWF.js.map → llm-T3QVHC3Y.js.map} +0 -0
- /package/dist/{loader-BQ4X4K3F.js.map → loader-L2TCAYCT.js.map} +0 -0
- /package/dist/{openai-embeddings-HWAKOGUM.js.map → loader-WQKVWL5D.js.map} +0 -0
- /package/dist/{openrouter-GXZK7JXR.js.map → openai-embeddings-5T5ZP7LO.js.map} +0 -0
- /package/dist/{provider-check-CKZW3GQX.js.map → openrouter-RD2COFC7.js.map} +0 -0
- /package/dist/{post-compact-BPICHUPV.js.map → post-compact-E5V4OZJB.js.map} +0 -0
- /package/dist/{post-tool-use-OHJ2EH7I.js.map → post-tool-use-Y6UWKCVD.js.map} +0 -0
- /package/dist/{post-tool-use-failure-CBPY2TSN.js.map → post-tool-use-failure-AHFXMNHX.js.map} +0 -0
- /package/dist/{pre-compact-ULAA4XIB.js.map → pre-compact-EI5EV3N7.js.map} +0 -0
- /package/dist/{registry-ZHUVXGPO.js.map → provider-check-QN7OGXZA.js.map} +0 -0
- /package/dist/{resolution-events-WZHPQQMN.js.map → registry-2XQMCPA6.js.map} +0 -0
- /package/dist/{version-42DQW43N.js.map → resolution-events-BZYMUQ53.js.map} +0 -0
- /package/dist/{session-end-WRKDJEWM.js.map → session-end-6DP6VTZV.js.map} +0 -0
- /package/dist/{session-start-7VWGEVOX.js.map → session-start-QNAQDF5M.js.map} +0 -0
- /package/dist/{stop-VJU4AAOQ.js.map → stop-VTO2KIRG.js.map} +0 -0
- /package/dist/{stop-failure-ILPHO26U.js.map → stop-failure-C5T6LJQR.js.map} +0 -0
- /package/dist/{subagent-start-77MY4UMP.js.map → subagent-start-NZF42NKF.js.map} +0 -0
- /package/dist/{subagent-stop-DABERMXZ.js.map → subagent-stop-UV5ECFVU.js.map} +0 -0
- /package/dist/{task-completed-TBWBOAJ6.js.map → task-completed-3SV6TL3V.js.map} +0 -0
- /package/dist/{user-prompt-submit-C47Y5Y5I.js.map → user-prompt-submit-VLQG77A6.js.map} +0 -0
- /package/dist/{verify-MQAANTUR.js.map → verify-WF7U3NQW.js.map} +0 -0
|
@@ -0,0 +1,822 @@
|
|
|
1
|
+
var kC=e=>{throw TypeError(e)};var Sy=(e,t,n)=>t.has(e)||kC("Cannot "+n);var Z=(e,t,n)=>(Sy(e,t,"read from private field"),n?n.call(e):t.get(e)),et=(e,t,n)=>t.has(e)?kC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_e=(e,t,n,r)=>(Sy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),mt=(e,t,n)=>(Sy(e,t,"access private method"),n);var rv=(e,t,n,r)=>({set _(a){_e(e,t,a,n)},get _(){return Z(e,t,r)}});function i4(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 vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ey={exports:{}},vf={};/**
|
|
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 jC;function s4(){if(jC)return vf;jC=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 vf.Fragment=t,vf.jsx=n,vf.jsxs=n,vf}var AC;function l4(){return AC||(AC=1,Ey.exports=s4()),Ey.exports}var v=l4(),Cy={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 RC;function o4(){if(RC)return ct;RC=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"),p=Symbol.for("react.activity"),m=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=m&&I[m]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function w(I,X,U){this.props=I,this.context=X,this.refs=S,this.updater=U||x}w.prototype.isReactComponent={},w.prototype.setState=function(I,X){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,X,"setState")},w.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function C(){}C.prototype=w.prototype;function T(I,X,U){this.props=I,this.context=X,this.refs=S,this.updater=U||x}var k=T.prototype=new C;k.constructor=T,b(k,w.prototype),k.isPureReactComponent=!0;var R=Array.isArray;function A(){}var D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function P(I,X,U){var te=U.ref;return{$$typeof:e,type:I,key:X,ref:te!==void 0?te:null,props:U}}function M(I,X){return P(I.type,X,I.props)}function _(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var X={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(U){return X[U]})}var q=/\/+/g;function V(I,X){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):X.toString(36)}function G(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function(X){I.status==="pending"&&(I.status="fulfilled",I.value=X)},function(X){I.status==="pending"&&(I.status="rejected",I.reason=X)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function F(I,X,U,te,ie){var oe=typeof I;(oe==="undefined"||oe==="boolean")&&(I=null);var ae=!1;if(I===null)ae=!0;else switch(oe){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(I.$$typeof){case e:case t:ae=!0;break;case d:return ae=I._init,F(ae(I._payload),X,U,te,ie)}}if(ae)return ie=ie(I),ae=te===""?"."+V(I,0):te,R(ie)?(U="",ae!=null&&(U=ae.replace(q,"$&/")+"/"),F(ie,X,U,"",function(J){return J})):ie!=null&&(_(ie)&&(ie=M(ie,U+(ie.key==null||I&&I.key===ie.key?"":(""+ie.key).replace(q,"$&/")+"/")+ae)),X.push(ie)),1;ae=0;var we=te===""?".":te+":";if(R(I))for(var fe=0;fe<I.length;fe++)te=I[fe],oe=we+V(te,fe),ae+=F(te,X,U,oe,ie);else if(fe=y(I),typeof fe=="function")for(I=fe.call(I),fe=0;!(te=I.next()).done;)te=te.value,oe=we+V(te,fe++),ae+=F(te,X,U,oe,ie);else if(oe==="object"){if(typeof I.then=="function")return F(G(I),X,U,te,ie);throw X=String(I),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ae}function H(I,X,U){if(I==null)return I;var te=[],ie=0;return F(I,te,"","",function(oe){return X.call(U,oe,ie++)}),te}function Y(I){if(I._status===-1){var X=I._result;X=X(),X.then(function(U){(I._status===0||I._status===-1)&&(I._status=1,I._result=U)},function(U){(I._status===0||I._status===-1)&&(I._status=2,I._result=U)}),I._status===-1&&(I._status=0,I._result=X)}if(I._status===1)return I._result.default;throw I._result}var Q=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},z={map:H,forEach:function(I,X,U){H(I,function(){X.apply(this,arguments)},U)},count:function(I){var X=0;return H(I,function(){X++}),X},toArray:function(I){return H(I,function(X){return X})||[]},only:function(I){if(!_(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return ct.Activity=p,ct.Children=z,ct.Component=w,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(I){return D.H.useMemoCache(I)}},ct.cache=function(I){return function(){return I.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(I,X,U){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var te=b({},I.props),ie=I.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 P(I.type,ie,te)},ct.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:i,_context:I},I},ct.createElement=function(I,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(I&&I.defaultProps)for(te in ae=I.defaultProps,ae)ie[te]===void 0&&(ie[te]=ae[te]);return P(I,oe,ie)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(I){return{$$typeof:o,render:I}},ct.isValidElement=_,ct.lazy=function(I){return{$$typeof:d,_payload:{_status:-1,_result:I},_init:Y}},ct.memo=function(I,X){return{$$typeof:c,type:I,compare:X===void 0?null:X}},ct.startTransition=function(I){var X=D.T,U={};D.T=U;try{var te=I(),ie=D.S;ie!==null&&ie(U,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(A,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(I){return D.H.use(I)},ct.useActionState=function(I,X,U){return D.H.useActionState(I,X,U)},ct.useCallback=function(I,X){return D.H.useCallback(I,X)},ct.useContext=function(I){return D.H.useContext(I)},ct.useDebugValue=function(){},ct.useDeferredValue=function(I,X){return D.H.useDeferredValue(I,X)},ct.useEffect=function(I,X){return D.H.useEffect(I,X)},ct.useEffectEvent=function(I){return D.H.useEffectEvent(I)},ct.useId=function(){return D.H.useId()},ct.useImperativeHandle=function(I,X,U){return D.H.useImperativeHandle(I,X,U)},ct.useInsertionEffect=function(I,X){return D.H.useInsertionEffect(I,X)},ct.useLayoutEffect=function(I,X){return D.H.useLayoutEffect(I,X)},ct.useMemo=function(I,X){return D.H.useMemo(I,X)},ct.useOptimistic=function(I,X){return D.H.useOptimistic(I,X)},ct.useReducer=function(I,X,U){return D.H.useReducer(I,X,U)},ct.useRef=function(I){return D.H.useRef(I)},ct.useState=function(I){return D.H.useState(I)},ct.useSyncExternalStore=function(I,X,U){return D.H.useSyncExternalStore(I,X,U)},ct.useTransition=function(){return D.H.useTransition()},ct.version="19.2.4",ct}var DC;function i1(){return DC||(DC=1,Cy.exports=o4()),Cy.exports}var j=i1();const Ui=vd(j),UA=i4({__proto__:null,default:Ui},[j]);var Ty={exports:{}},pf={},Ny={exports:{}},ky={};/**
|
|
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 MC;function u4(){return MC||(MC=1,(function(e){function t(F,H){var Y=F.length;F.push(H);e:for(;0<Y;){var Q=Y-1>>>1,z=F[Q];if(0<a(z,H))F[Q]=H,F[Y]=z,Y=Q;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var H=F[0],Y=F.pop();if(Y!==H){F[0]=Y;e:for(var Q=0,z=F.length,I=z>>>1;Q<I;){var X=2*(Q+1)-1,U=F[X],te=X+1,ie=F[te];if(0>a(U,Y))te<z&&0>a(ie,U)?(F[Q]=ie,F[te]=Y,Q=te):(F[Q]=U,F[X]=Y,Q=X);else if(te<z&&0>a(ie,Y))F[Q]=ie,F[te]=Y,Q=te;else break e}}return H}function a(F,H){var Y=F.sortIndex-H.sortIndex;return Y!==0?Y:F.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,p=null,m=3,y=!1,x=!1,b=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function k(F){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=F)r(c),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(c)}}function R(F){if(b=!1,k(F),!x)if(n(f)!==null)x=!0,A||(A=!0,B());else{var H=n(c);H!==null&&G(R,H.startTime-F)}}var A=!1,D=-1,L=5,P=-1;function M(){return S?!0:!(e.unstable_now()-P<L)}function _(){if(S=!1,A){var F=e.unstable_now();P=F;var H=!0;try{e:{x=!1,b&&(b=!1,C(D),D=-1),y=!0;var Y=m;try{t:{for(k(F),p=n(f);p!==null&&!(p.expirationTime>F&&M());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,m=p.priorityLevel;var z=Q(p.expirationTime<=F);if(F=e.unstable_now(),typeof z=="function"){p.callback=z,k(F),H=!0;break t}p===n(f)&&r(f),k(F)}else r(f);p=n(f)}if(p!==null)H=!0;else{var I=n(c);I!==null&&G(R,I.startTime-F),H=!1}}break e}finally{p=null,m=Y,y=!1}H=void 0}}finally{H?B():A=!1}}}var B;if(typeof T=="function")B=function(){T(_)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,V=q.port2;q.port1.onmessage=_,B=function(){V.postMessage(null)}}else B=function(){w(_,0)};function G(F,H){D=w(function(){F(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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(F){switch(m){case 1:case 2:case 3:var H=3;break;default:H=m}var Y=m;m=H;try{return F()}finally{m=Y}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(F,H){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Y=m;m=F;try{return H()}finally{m=Y}},e.unstable_scheduleCallback=function(F,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,F){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Y+z,F={id:d++,callback:H,priorityLevel:F,startTime:Y,expirationTime:z,sortIndex:-1},Y>Q?(F.sortIndex=Y,t(c,F),n(f)===null&&F===n(c)&&(b?(C(D),D=-1):b=!0,G(R,Y-Q))):(F.sortIndex=z,t(f,F),x||y||(x=!0,A||(A=!0,B()))),F},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(F){var H=m;return function(){var Y=m;m=H;try{return F.apply(this,arguments)}finally{m=Y}}}})(ky)),ky}var OC;function c4(){return OC||(OC=1,Ny.exports=u4()),Ny.exports}var jy={exports:{}},hr={};/**
|
|
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 LC;function f4(){if(LC)return hr;LC=1;var e=i1();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 p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,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 hr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,hr.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)},hr.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()}},hr.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))},hr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},hr.preinit=function(f,c){if(typeof f=="string"&&c&&typeof c.as=="string"){var d=c.as,p=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:p,integrity:m,fetchPriority:y}):d==="script"&&r.d.X(f,{crossOrigin:p,integrity:m,fetchPriority:y,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},hr.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)},hr.preload=function(f,c){if(typeof f=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var d=c.as,p=o(d,c.crossOrigin);r.d.L(f,d,{crossOrigin:p,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})}},hr.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)},hr.requestFormReset=function(f){r.d.r(f)},hr.unstable_batchedUpdates=function(f,c){return f(c)},hr.useFormState=function(f,c,d){return l.H.useFormState(f,c,d)},hr.useFormStatus=function(){return l.H.useHostTransitionStatus()},hr.version="19.2.4",hr}var _C;function qA(){if(_C)return jy.exports;_C=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(),jy.exports=f4(),jy.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 BC;function d4(){if(BC)return pf;BC=1;var e=c4(),t=i1(),n=qA();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 N=E.alternate;if(N===null){if(g=E.return,g!==null){h=g;continue}break}if(E.child===N.child){for(N=E.child;N;){if(N===h)return f(E),s;if(N===g)return f(E),u;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=E,g=N;else{for(var O=!1,$=E.child;$;){if($===h){O=!0,h=E,g=N;break}if($===g){O=!0,g=E,h=N;break}$=$.sibling}if(!O){for($=N.child;$;){if($===h){O=!0,h=N,g=E;break}if($===g){O=!0,g=N,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 p=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),_=Symbol.iterator;function B(s){return s===null||typeof s!="object"?null:(s=_&&s[_]||s["@@iterator"],typeof s=="function"?s:null)}var q=Symbol.for("react.client.reference");function V(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===q?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case R:return"Suspense";case A:return"SuspenseList";case P: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 k: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:V(s.type)||"Memo";case L:u=s._payload,s=s._init;try{return V(s(u))}catch{}}return null}var G=Array.isArray,F=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=[],z=-1;function I(s){return{current:s}}function X(s){0>z||(s.current=Q[z],Q[z]=null,z--)}function U(s,u){z++,Q[z]=s.current,s.current=u}var te=I(null),ie=I(null),oe=I(null),ae=I(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)?Q2(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=Q2(u),s=W2(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=W2(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),cf._currentValue=Y)}var re,ge;function Ne(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 N=g.DetermineComponentFrameRoot(),O=N[0],$=N[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:"")?Ne(h):""}function Je(s,u){switch(s.tag){case 26:case 27:case 5:return Ne(s.type);case 16:return Ne("Lazy");case 13:return s.child!==u&&u!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("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 Ne("Activity");default:return""}}function Qe(s){try{var u="",h=null;do u+=Je(s,h),h=s,s=s.return;while(s);return u}catch(g){return`
|
|
47
|
+
Error generating stack: `+g.message+`
|
|
48
|
+
`+g.stack}}var Ve=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,Ke=e.unstable_cancelCallback,Xe=e.unstable_shouldYield,st=e.unstable_requestPaint,Pe=e.unstable_now,ft=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,Ie=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 $e=256,Fe=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,N=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var $=g&134217727;return $!==0?(g=$&~N,g!==0?E=ot(g):(O&=$,O!==0?E=ot(O):h||(h=$&~s,h!==0&&(E=ot(h))))):($=g&~N,$!==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&N)===0&&(N=E&-E,h=u&-u,N>=h||N===32&&(h&4194048)!==0)?u:E}function He(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function xt(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 vt(){var s=We;return We<<=1,(We&62914560)===0&&(We=4194304),s}function fn(s){for(var u=[],h=0;31>h;h++)u.push(s);return u}function qt(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function er(s,u,h,g,E,N){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&&dn(s,g,0),N!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=N&~(O&~u))}function dn(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 Sn(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 gn(s,u){var h=u&-u;return h=(h&42)!==0?1:En(h),(h&(s.suspendedLanes|u))!==0?0:h}function En(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 ua(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function hn(){var s=H.p;return s!==0?s:(s=window.event,s===void 0?32:bC(s.type))}function ca(s,u){var h=H.p;try{return H.p=s,u()}finally{H.p=h}}var Vn=Math.random().toString(36).slice(2),ln="__reactFiber$"+Vn,_n="__reactProps$"+Vn,Ar="__reactContainer$"+Vn,Hn="__reactEvents$"+Vn,Gn="__reactListeners$"+Vn,fr="__reactHandles$"+Vn,ss="__reactResources$"+Vn,$n="__reactMarker$"+Vn;function ko(s){delete s[ln],delete s[_n],delete s[Hn],delete s[Gn],delete s[fr]}function ls(s){var u=s[ln];if(u)return u;for(var h=s.parentNode;h;){if(u=h[Ar]||h[ln]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(s=aC(s);s!==null;){if(h=s[ln])return h;s=aC(s)}return u}s=h,h=s.parentNode}return null}function os(s){if(s=s[ln]||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 Cl(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function us(s){var u=s[ss];return u||(u=s[ss]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function kn(s){s[$n]=!0}var Vd=new Set,Hd={};function $r(s,u){Ka(s,u),Ka(s+"Capture",u)}function Ka(s,u){for(Hd[s]=u,s=0;s<u.length;s++)Vd.add(u[s])}var jo=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]*$"),Cc={},Tc={};function vm(s){return Ve.call(Tc,s)?!0:Ve.call(Cc,s)?!1:jo.test(s)?Tc[s]=!0:(Cc[s]=!0,!1)}function dr(s,u,h){if(vm(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 cs(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 fa(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 Kn(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 pm(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,N=g.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(O){h=""+O,N.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 Gd(s){if(!s._valueTracker){var u=Rr(s)?"checked":"value";s._valueTracker=pm(s,u,""+s[u])}}function $d(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 Kd(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 J_=/[\n"\\]/g;function da(s){return s.replace(J_,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function mm(s,u,h,g,E,N,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=""+Kn(u)):s.value!==""+Kn(u)&&(s.value=""+Kn(u)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),u!=null?gm(s,O,Kn(u)):h!=null?gm(s,O,Kn(h)):g!=null&&s.removeAttribute("value"),E==null&&N!=null&&(s.defaultChecked=!!N),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.name=""+Kn($):s.removeAttribute("name")}function Hw(s,u,h,g,E,N,O,$){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),u!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||u!=null)){Gd(s);return}h=h!=null?""+Kn(h):"",u=u!=null?""+Kn(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),Gd(s)}function gm(s,u,h){u==="number"&&Kd(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Ao(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=""+Kn(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 Gw(s,u,h){if(u!=null&&(u=""+Kn(u),u!==s.value&&(s.value=u),h==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=h!=null?""+Kn(h):""}function $w(s,u,h,g){if(u==null){if(g!=null){if(h!=null)throw Error(r(92));if(G(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),u=h}h=Kn(u),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),Gd(s)}function Ro(s,u){if(u){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=u;return}}s.textContent=u}var e5=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 Kw(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||e5.has(u)?u==="float"?s.cssFloat=h:s[u]=(""+h).trim():s[u]=h+"px"}function Yw(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&&Kw(s,E,g)}else for(var N in u)u.hasOwnProperty(N)&&Kw(s,N,u[N])}function ym(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 t5=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"]]),n5=/^[\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 Yd(s){return n5.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function bi(){}var xm=null;function bm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Do=null,Mo=null;function Xw(s){var u=os(s);if(u&&(s=u.stateNode)){var h=s[_n]||null;e:switch(s=u.stateNode,u.type){case"input":if(mm(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="'+da(""+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));mm(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&&$d(g)}break e;case"textarea":Gw(s,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Ao(s,!!h.multiple,u,!1)}}}var wm=!1;function Qw(s,u,h){if(wm)return s(u,h);wm=!0;try{var g=s(u);return g}finally{if(wm=!1,(Do!==null||Mo!==null)&&(_h(),Do&&(u=Do,s=Mo,Mo=Do=null,Xw(u),s)))for(u=0;u<s.length;u++)Xw(s[u])}}function Nc(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 wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sm=!1;if(wi)try{var kc={};Object.defineProperty(kc,"passive",{get:function(){Sm=!0}}),window.addEventListener("test",kc,kc),window.removeEventListener("test",kc,kc)}catch{Sm=!1}var fs=null,Em=null,Xd=null;function Ww(){if(Xd)return Xd;var s,u=Em,h=u.length,g,E="value"in fs?fs.value:fs.textContent,N=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[N-g];g++);return Xd=E.slice(s,1<g?1-g:void 0)}function Qd(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 Wd(){return!0}function Zw(){return!1}function Dr(s){function u(h,g,E,N,O){this._reactName=h,this._targetInst=E,this.type=g,this.nativeEvent=N,this.target=O,this.currentTarget=null;for(var $ in s)s.hasOwnProperty($)&&(h=s[$],this[$]=h?h(N):N[$]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Wd:Zw,this.isPropagationStopped=Zw,this}return p(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=Wd)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Wd)},persist:function(){},isPersistent:Wd}),u}var Tl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zd=Dr(Tl),jc=p({},Tl,{view:0,detail:0}),r5=Dr(jc),Cm,Tm,Ac,Jd=p({},jc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:km,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!==Ac&&(Ac&&s.type==="mousemove"?(Cm=s.screenX-Ac.screenX,Tm=s.screenY-Ac.screenY):Tm=Cm=0,Ac=s),Cm)},movementY:function(s){return"movementY"in s?s.movementY:Tm}}),Jw=Dr(Jd),a5=p({},Jd,{dataTransfer:0}),i5=Dr(a5),s5=p({},jc,{relatedTarget:0}),Nm=Dr(s5),l5=p({},Tl,{animationName:0,elapsedTime:0,pseudoElement:0}),o5=Dr(l5),u5=p({},Tl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),c5=Dr(u5),f5=p({},Tl,{data:0}),eS=Dr(f5),d5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},h5={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"},v5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p5(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=v5[s])?!!u[s]:!1}function km(){return p5}var m5=p({},jc,{key:function(s){if(s.key){var u=d5[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=Qd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?h5[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:km,charCode:function(s){return s.type==="keypress"?Qd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Qd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),g5=Dr(m5),y5=p({},Jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tS=Dr(y5),x5=p({},jc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:km}),b5=Dr(x5),w5=p({},Tl,{propertyName:0,elapsedTime:0,pseudoElement:0}),S5=Dr(w5),E5=p({},Jd,{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}),C5=Dr(E5),T5=p({},Tl,{newState:0,oldState:0}),N5=Dr(T5),k5=[9,13,27,32],jm=wi&&"CompositionEvent"in window,Rc=null;wi&&"documentMode"in document&&(Rc=document.documentMode);var j5=wi&&"TextEvent"in window&&!Rc,nS=wi&&(!jm||Rc&&8<Rc&&11>=Rc),rS=" ",aS=!1;function iS(s,u){switch(s){case"keyup":return k5.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sS(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Oo=!1;function A5(s,u){switch(s){case"compositionend":return sS(u);case"keypress":return u.which!==32?null:(aS=!0,rS);case"textInput":return s=u.data,s===rS&&aS?null:s;default:return null}}function R5(s,u){if(Oo)return s==="compositionend"||!jm&&iS(s,u)?(s=Ww(),Xd=Em=fs=null,Oo=!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 nS&&u.locale!=="ko"?null:u.data;default:return null}}var D5={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 lS(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!D5[s.type]:u==="textarea"}function oS(s,u,h,g){Do?Mo?Mo.push(g):Mo=[g]:Do=g,u=qh(u,"onChange"),0<u.length&&(h=new Zd("onChange","change",null,h,g),s.push({event:h,listeners:u}))}var Dc=null,Mc=null;function M5(s){H2(s,0)}function eh(s){var u=Cl(s);if($d(u))return s}function uS(s,u){if(s==="change")return u}var cS=!1;if(wi){var Am;if(wi){var Rm="oninput"in document;if(!Rm){var fS=document.createElement("div");fS.setAttribute("oninput","return;"),Rm=typeof fS.oninput=="function"}Am=Rm}else Am=!1;cS=Am&&(!document.documentMode||9<document.documentMode)}function dS(){Dc&&(Dc.detachEvent("onpropertychange",hS),Mc=Dc=null)}function hS(s){if(s.propertyName==="value"&&eh(Mc)){var u=[];oS(u,Mc,s,bm(s)),Qw(M5,u)}}function O5(s,u,h){s==="focusin"?(dS(),Dc=u,Mc=h,Dc.attachEvent("onpropertychange",hS)):s==="focusout"&&dS()}function L5(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return eh(Mc)}function _5(s,u){if(s==="click")return eh(u)}function B5(s,u){if(s==="input"||s==="change")return eh(u)}function P5(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Kr=typeof Object.is=="function"?Object.is:P5;function Oc(s,u){if(Kr(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(!Ve.call(u,E)||!Kr(s[E],u[E]))return!1}return!0}function vS(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function pS(s,u){var h=vS(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=vS(h)}}function mS(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?mS(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function gS(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=Kd(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=Kd(s.document)}return u}function Dm(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 z5=wi&&"documentMode"in document&&11>=document.documentMode,Lo=null,Mm=null,Lc=null,Om=!1;function yS(s,u,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Om||Lo==null||Lo!==Kd(g)||(g=Lo,"selectionStart"in g&&Dm(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}),Lc&&Oc(Lc,g)||(Lc=g,g=qh(Mm,"onSelect"),0<g.length&&(u=new Zd("onSelect","select",null,u,h),s.push({event:u,listeners:g}),u.target=Lo)))}function Nl(s,u){var h={};return h[s.toLowerCase()]=u.toLowerCase(),h["Webkit"+s]="webkit"+u,h["Moz"+s]="moz"+u,h}var _o={animationend:Nl("Animation","AnimationEnd"),animationiteration:Nl("Animation","AnimationIteration"),animationstart:Nl("Animation","AnimationStart"),transitionrun:Nl("Transition","TransitionRun"),transitionstart:Nl("Transition","TransitionStart"),transitioncancel:Nl("Transition","TransitionCancel"),transitionend:Nl("Transition","TransitionEnd")},Lm={},xS={};wi&&(xS=document.createElement("div").style,"AnimationEvent"in window||(delete _o.animationend.animation,delete _o.animationiteration.animation,delete _o.animationstart.animation),"TransitionEvent"in window||delete _o.transitionend.transition);function kl(s){if(Lm[s])return Lm[s];if(!_o[s])return s;var u=_o[s],h;for(h in u)if(u.hasOwnProperty(h)&&h in xS)return Lm[s]=u[h];return s}var bS=kl("animationend"),wS=kl("animationiteration"),SS=kl("animationstart"),I5=kl("transitionrun"),F5=kl("transitionstart"),U5=kl("transitioncancel"),ES=kl("transitionend"),CS=new Map,_m="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(" ");_m.push("scrollEnd");function Oa(s,u){CS.set(s,u),$r(u,[s])}var th=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)},ha=[],Bo=0,Bm=0;function nh(){for(var s=Bo,u=Bm=Bo=0;u<s;){var h=ha[u];ha[u++]=null;var g=ha[u];ha[u++]=null;var E=ha[u];ha[u++]=null;var N=ha[u];if(ha[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}N!==0&&TS(h,E,N)}}function rh(s,u,h,g){ha[Bo++]=s,ha[Bo++]=u,ha[Bo++]=h,ha[Bo++]=g,Bm|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function Pm(s,u,h,g){return rh(s,u,h,g),ah(s)}function jl(s,u){return rh(s,null,null,u),ah(s)}function TS(s,u,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var E=!1,N=s.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(E=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,E&&u!==null&&(E=31-de(h),s=N.hiddenUpdates,g=s[E],g===null?s[E]=[u]:g.push(u),u.lane=h|536870912),N):null}function ah(s){if(50<nf)throw nf=0,$g=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Po={};function q5(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 Yr(s,u,h,g){return new q5(s,u,h,g)}function zm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Si(s,u){var h=s.alternate;return h===null?(h=Yr(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 NS(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 ih(s,u,h,g,E,N){var O=0;if(g=s,typeof s=="function")zm(s)&&(O=1);else if(typeof s=="string")O=K3(s,h,te.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case P:return s=Yr(31,h,u,E),s.elementType=P,s.lanes=N,s;case b:return Al(h.children,E,N,u);case S:O=8,E|=24;break;case w:return s=Yr(12,h,u,E|2),s.elementType=w,s.lanes=N,s;case R:return s=Yr(13,h,u,E),s.elementType=R,s.lanes=N,s;case A:return s=Yr(19,h,u,E),s.elementType=A,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:O=10;break e;case C:O=9;break e;case k: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=Yr(O,h,u,E),u.elementType=s,u.type=g,u.lanes=N,u}function Al(s,u,h,g){return s=Yr(7,s,g,u),s.lanes=h,s}function Im(s,u,h){return s=Yr(6,s,null,u),s.lanes=h,s}function kS(s){var u=Yr(18,null,null,0);return u.stateNode=s,u}function Fm(s,u,h){return u=Yr(4,s.children!==null?s.children:[],s.key,u),u.lanes=h,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var jS=new WeakMap;function va(s,u){if(typeof s=="object"&&s!==null){var h=jS.get(s);return h!==void 0?h:(u={value:s,source:u,stack:Qe(u)},jS.set(s,u),u)}return{value:s,source:u,stack:Qe(u)}}var zo=[],Io=0,sh=null,_c=0,pa=[],ma=0,ds=null,Ya=1,Xa="";function Ei(s,u){zo[Io++]=_c,zo[Io++]=sh,sh=s,_c=u}function AS(s,u,h){pa[ma++]=Ya,pa[ma++]=Xa,pa[ma++]=ds,ds=s;var g=Ya;s=Xa;var E=32-de(g)-1;g&=~(1<<E),h+=1;var N=32-de(u)+E;if(30<N){var O=E-E%5;N=(g&(1<<O)-1).toString(32),g>>=O,E-=O,Ya=1<<32-de(u)+E|h<<E|g,Xa=N+s}else Ya=1<<N|h<<E|g,Xa=s}function Um(s){s.return!==null&&(Ei(s,1),AS(s,1,0))}function qm(s){for(;s===sh;)sh=zo[--Io],zo[Io]=null,_c=zo[--Io],zo[Io]=null;for(;s===ds;)ds=pa[--ma],pa[ma]=null,Xa=pa[--ma],pa[ma]=null,Ya=pa[--ma],pa[ma]=null}function RS(s,u){pa[ma++]=Ya,pa[ma++]=Xa,pa[ma++]=ds,Ya=u.id,Xa=u.overflow,ds=s}var tr=null,tn=null,kt=!1,hs=null,ga=!1,Vm=Error(r(519));function vs(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bc(va(u,s)),Vm}function DS(s){var u=s.stateNode,h=s.type,g=s.memoizedProps;switch(u[ln]=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<af.length;h++)St(af[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),Hw(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),$w(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||Y2(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=bi),u=!0):u=!1,u||vs(s,!0)}function MS(s){for(tr=s.return;tr;)switch(tr.tag){case 5:case 31:case 13:ga=!1;return;case 27:case 3:ga=!0;return;default:tr=tr.return}}function Fo(s){if(s!==tr)return!1;if(!kt)return MS(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")||ly(s.type,s.memoizedProps)),h=!h),h&&tn&&vs(s),MS(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));tn=rC(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));tn=rC(s)}else u===27?(u=tn,js(s.type)?(s=dy,dy=null,tn=s):tn=u):tn=tr?xa(s.stateNode.nextSibling):null;return!0}function Rl(){tn=tr=null,kt=!1}function Hm(){var s=hs;return s!==null&&(_r===null?_r=s:_r.push.apply(_r,s),hs=null),s}function Bc(s){hs===null?hs=[s]:hs.push(s)}var Gm=I(null),Dl=null,Ci=null;function ps(s,u,h){U(Gm,u._currentValue),u._currentValue=h}function Ti(s){s._currentValue=Gm.current,X(Gm)}function $m(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 Km(s,u,h,g){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var N=E.dependencies;if(N!==null){var O=E.child;N=N.firstContext;e:for(;N!==null;){var $=N;N=E;for(var W=0;W<u.length;W++)if($.context===u[W]){N.lanes|=h,$=N.alternate,$!==null&&($.lanes|=h),$m(N.return,h,s),g||(O=null);break e}N=$.next}}else if(E.tag===18){if(O=E.return,O===null)throw Error(r(341));O.lanes|=h,N=O.alternate,N!==null&&(N.lanes|=h),$m(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 Uo(s,u,h,g){s=null;for(var E=u,N=!1;E!==null;){if(!N){if((E.flags&524288)!==0)N=!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;Kr(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(cf):s=[cf])}E=E.return}s!==null&&Km(u,s,h,g),u.flags|=262144}function lh(s){for(s=s.firstContext;s!==null;){if(!Kr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Ml(s){Dl=s,Ci=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function nr(s){return OS(Dl,s)}function oh(s,u){return Dl===null&&Ml(s),OS(s,u)}function OS(s,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},Ci===null){if(s===null)throw Error(r(308));Ci=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Ci=Ci.next=u;return h}var V5=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()})}},H5=e.unstable_scheduleCallback,G5=e.unstable_NormalPriority,jn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ym(){return{controller:new V5,data:new Map,refCount:0}}function Pc(s){s.refCount--,s.refCount===0&&H5(G5,function(){s.controller.abort()})}var zc=null,Xm=0,qo=0,Vo=null;function $5(s,u){if(zc===null){var h=zc=[];Xm=0,qo=Zg(),Vo={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Xm++,u.then(LS,LS),u}function LS(){if(--Xm===0&&zc!==null){Vo!==null&&(Vo.status="fulfilled");var s=zc;zc=null,qo=0,Vo=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function K5(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 _S=F.S;F.S=function(s,u){y2=Pe(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&$5(s,u),_S!==null&&_S(s,u)};var Ol=I(null);function Qm(){var s=Ol.current;return s!==null?s:Kt.pooledCache}function uh(s,u){u===null?U(Ol,Ol.current):U(Ol,u.pool)}function BS(){var s=Qm();return s===null?null:{parent:jn._currentValue,pool:s}}var Ho=Error(r(460)),Wm=Error(r(474)),ch=Error(r(542)),fh={then:function(){}};function PS(s){return s=s.status,s==="fulfilled"||s==="rejected"}function zS(s,u,h){switch(h=s[h],h===void 0?s.push(u):h!==u&&(u.then(bi,bi),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,FS(s),s;default:if(typeof u.status=="string")u.then(bi,bi);else{if(s=Kt,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,FS(s),s}throw _l=u,Ho}}function Ll(s){try{var u=s._init;return u(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(_l=h,Ho):h}}var _l=null;function IS(){if(_l===null)throw Error(r(459));var s=_l;return _l=null,s}function FS(s){if(s===Ho||s===ch)throw Error(r(483))}var Go=null,Ic=0;function dh(s){var u=Ic;return Ic+=1,Go===null&&(Go=[]),zS(Go,s,u)}function Fc(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function hh(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 US(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=Si(se,ee),se.index=0,se.sibling=null,se}function N(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=Im(ue,se.mode,Se),ee.return=se,ee):(ee=E(ee,ue),ee.return=se,ee)}function W(se,ee,ue,Se){var nt=ue.type;return nt===b?be(se,ee,ue.props.children,Se,ue.key):ee!==null&&(ee.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===L&&Ll(nt)===ee.type)?(ee=E(ee,ue.props),Fc(ee,ue),ee.return=se,ee):(ee=ih(ue.type,ue.key,ue.props,null,se.mode,Se),Fc(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=Fm(ue,se.mode,Se),ee.return=se,ee):(ee=E(ee,ue.children||[]),ee.return=se,ee)}function be(se,ee,ue,Se,nt){return ee===null||ee.tag!==7?(ee=Al(ue,se.mode,Se,nt),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=Im(""+ee,se.mode,ue),ee.return=se,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return ue=ih(ee.type,ee.key,ee.props,null,se.mode,ue),Fc(ue,ee),ue.return=se,ue;case x:return ee=Fm(ee,se.mode,ue),ee.return=se,ee;case L:return ee=Ll(ee),Ee(se,ee,ue)}if(G(ee)||B(ee))return ee=Al(ee,se.mode,ue,null),ee.return=se,ee;if(typeof ee.then=="function")return Ee(se,dh(ee),ue);if(ee.$$typeof===T)return Ee(se,oh(se,ee),ue);hh(se,ee)}return null}function ve(se,ee,ue,Se){var nt=ee!==null?ee.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return nt!==null?null:$(se,ee,""+ue,Se);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===nt?W(se,ee,ue,Se):null;case x:return ue.key===nt?ce(se,ee,ue,Se):null;case L:return ue=Ll(ue),ve(se,ee,ue,Se)}if(G(ue)||B(ue))return nt!==null?null:be(se,ee,ue,Se,null);if(typeof ue.then=="function")return ve(se,ee,dh(ue),Se);if(ue.$$typeof===T)return ve(se,ee,oh(se,ue),Se);hh(se,ue)}return null}function me(se,ee,ue,Se,nt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return se=se.get(ue)||null,$(ee,se,""+Se,nt);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,nt);case x:return se=se.get(Se.key===null?ue:Se.key)||null,ce(ee,se,Se,nt);case L:return Se=Ll(Se),me(se,ee,ue,Se,nt)}if(G(Se)||B(Se))return se=se.get(ue)||null,be(ee,se,Se,nt,null);if(typeof Se.then=="function")return me(se,ee,ue,dh(Se),nt);if(Se.$$typeof===T)return me(se,ee,ue,oh(ee,Se),nt);hh(ee,Se)}return null}function Ge(se,ee,ue,Se){for(var nt=null,Mt=null,Ye=ee,pt=ee=0,Nt=null;Ye!==null&&pt<ue.length;pt++){Ye.index>pt?(Nt=Ye,Ye=null):Nt=Ye.sibling;var Ot=ve(se,Ye,ue[pt],Se);if(Ot===null){Ye===null&&(Ye=Nt);break}s&&Ye&&Ot.alternate===null&&u(se,Ye),ee=N(Ot,ee,pt),Mt===null?nt=Ot:Mt.sibling=Ot,Mt=Ot,Ye=Nt}if(pt===ue.length)return h(se,Ye),kt&&Ei(se,pt),nt;if(Ye===null){for(;pt<ue.length;pt++)Ye=Ee(se,ue[pt],Se),Ye!==null&&(ee=N(Ye,ee,pt),Mt===null?nt=Ye:Mt.sibling=Ye,Mt=Ye);return kt&&Ei(se,pt),nt}for(Ye=g(Ye);pt<ue.length;pt++)Nt=me(Ye,se,pt,ue[pt],Se),Nt!==null&&(s&&Nt.alternate!==null&&Ye.delete(Nt.key===null?pt:Nt.key),ee=N(Nt,ee,pt),Mt===null?nt=Nt:Mt.sibling=Nt,Mt=Nt);return s&&Ye.forEach(function(Os){return u(se,Os)}),kt&&Ei(se,pt),nt}function it(se,ee,ue,Se){if(ue==null)throw Error(r(151));for(var nt=null,Mt=null,Ye=ee,pt=ee=0,Nt=null,Ot=ue.next();Ye!==null&&!Ot.done;pt++,Ot=ue.next()){Ye.index>pt?(Nt=Ye,Ye=null):Nt=Ye.sibling;var Os=ve(se,Ye,Ot.value,Se);if(Os===null){Ye===null&&(Ye=Nt);break}s&&Ye&&Os.alternate===null&&u(se,Ye),ee=N(Os,ee,pt),Mt===null?nt=Os:Mt.sibling=Os,Mt=Os,Ye=Nt}if(Ot.done)return h(se,Ye),kt&&Ei(se,pt),nt;if(Ye===null){for(;!Ot.done;pt++,Ot=ue.next())Ot=Ee(se,Ot.value,Se),Ot!==null&&(ee=N(Ot,ee,pt),Mt===null?nt=Ot:Mt.sibling=Ot,Mt=Ot);return kt&&Ei(se,pt),nt}for(Ye=g(Ye);!Ot.done;pt++,Ot=ue.next())Ot=me(Ye,se,pt,Ot.value,Se),Ot!==null&&(s&&Ot.alternate!==null&&Ye.delete(Ot.key===null?pt:Ot.key),ee=N(Ot,ee,pt),Mt===null?nt=Ot:Mt.sibling=Ot,Mt=Ot);return s&&Ye.forEach(function(a4){return u(se,a4)}),kt&&Ei(se,pt),nt}function Gt(se,ee,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===b&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var nt=ue.key;ee!==null;){if(ee.key===nt){if(nt=ue.type,nt===b){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===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===L&&Ll(nt)===ee.type){h(se,ee.sibling),Se=E(ee,ue.props),Fc(Se,ue),Se.return=se,se=Se;break e}h(se,ee);break}else u(se,ee);ee=ee.sibling}ue.type===b?(Se=Al(ue.props.children,se.mode,Se,ue.key),Se.return=se,se=Se):(Se=ih(ue.type,ue.key,ue.props,null,se.mode,Se),Fc(Se,ue),Se.return=se,se=Se)}return O(se);case x:e:{for(nt=ue.key;ee!==null;){if(ee.key===nt)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=Fm(ue,se.mode,Se),Se.return=se,se=Se}return O(se);case L:return ue=Ll(ue),Gt(se,ee,ue,Se)}if(G(ue))return Ge(se,ee,ue,Se);if(B(ue)){if(nt=B(ue),typeof nt!="function")throw Error(r(150));return ue=nt.call(ue),it(se,ee,ue,Se)}if(typeof ue.then=="function")return Gt(se,ee,dh(ue),Se);if(ue.$$typeof===T)return Gt(se,ee,oh(se,ue),Se);hh(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=Im(ue,se.mode,Se),Se.return=se,se=Se),O(se)):h(se,ee)}return function(se,ee,ue,Se){try{Ic=0;var nt=Gt(se,ee,ue,Se);return Go=null,nt}catch(Ye){if(Ye===Ho||Ye===ch)throw Ye;var Mt=Yr(29,Ye,null,se.mode);return Mt.lanes=Se,Mt.return=se,Mt}finally{}}}var Bl=US(!0),qS=US(!1),ms=!1;function Zm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jm(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 gs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ys(s,u,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(_t&2)!==0){var E=g.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),g.pending=u,u=ah(s),TS(s,null,h),u}return rh(s,g,u,h),ah(s)}function Uc(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,Sn(s,h)}}function eg(s,u){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var E=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var O={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?E=N=O:N=N.next=O,h=h.next}while(h!==null);N===null?E=N=u:N=N.next=u}else E=N=u;h={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:N,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 tg=!1;function qc(){if(tg){var s=Vo;if(s!==null)throw s}}function Vc(s,u,h,g){tg=!1;var E=s.updateQueue;ms=!1;var N=E.firstBaseUpdate,O=E.lastBaseUpdate,$=E.shared.pending;if($!==null){E.shared.pending=null;var W=$,ce=W.next;W.next=null,O===null?N=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(N!==null){var Ee=E.baseState;O=0,be=ce=W=null,$=N;do{var ve=$.lane&-536870913,me=ve!==$.lane;if(me?(Tt&ve)===ve:(g&ve)===ve){ve!==0&&ve===qo&&(tg=!0),be!==null&&(be=be.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ge=s,it=$;ve=u;var Gt=h;switch(it.tag){case 1:if(Ge=it.payload,typeof Ge=="function"){Ee=Ge.call(Gt,Ee,ve);break e}Ee=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=it.payload,ve=typeof Ge=="function"?Ge.call(Gt,Ee,ve):Ge,ve==null)break e;Ee=p({},Ee,ve);break e;case 2:ms=!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,N===null&&(E.shared.lanes=0),Es|=O,s.lanes=O,s.memoizedState=Ee}}function VS(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function HS(s,u){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)VS(h[s],u)}var $o=I(null),vh=I(0);function GS(s,u){s=Li,U(vh,s),U($o,u),Li=s|u.baseLanes}function ng(){U(vh,Li),U($o,$o.current)}function rg(){Li=vh.current,X($o),X(vh)}var Xr=I(null),ya=null;function xs(s){var u=s.alternate;U(Cn,Cn.current&1),U(Xr,s),ya===null&&(u===null||$o.current!==null||u.memoizedState!==null)&&(ya=s)}function ag(s){U(Cn,Cn.current),U(Xr,s),ya===null&&(ya=s)}function $S(s){s.tag===22?(U(Cn,Cn.current),U(Xr,s),ya===null&&(ya=s)):bs()}function bs(){U(Cn,Cn.current),U(Xr,Xr.current)}function Qr(s){X(Xr),ya===s&&(ya=null),X(Cn)}var Cn=I(0);function ph(s){for(var u=s;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||cy(h)||fy(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 Ni=0,ht=null,Vt=null,An=null,mh=!1,Ko=!1,Pl=!1,gh=0,Hc=0,Yo=null,Y5=0;function yn(){throw Error(r(321))}function ig(s,u){if(u===null)return!1;for(var h=0;h<u.length&&h<s.length;h++)if(!Kr(s[h],u[h]))return!1;return!0}function sg(s,u,h,g,E,N){return Ni=N,ht=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,F.H=s===null||s.memoizedState===null?AE:wg,Pl=!1,N=h(g,E),Pl=!1,Ko&&(N=YS(u,h,g,E)),KS(s),N}function KS(s){F.H=Kc;var u=Vt!==null&&Vt.next!==null;if(Ni=0,An=Vt=ht=null,mh=!1,Hc=0,Yo=null,u)throw Error(r(300));s===null||Rn||(s=s.dependencies,s!==null&&lh(s)&&(Rn=!0))}function YS(s,u,h,g){ht=s;var E=0;do{if(Ko&&(Yo=null),Hc=0,Ko=!1,25<=E)throw Error(r(301));if(E+=1,An=Vt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}F.H=RE,N=u(h,g)}while(Ko);return N}function X5(){var s=F.H,u=s.useState()[0];return u=typeof u.then=="function"?Gc(u):u,s=s.useState()[0],(Vt!==null?Vt.memoizedState:null)!==s&&(ht.flags|=1024),u}function lg(){var s=gh!==0;return gh=0,s}function og(s,u,h){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~h}function ug(s){if(mh){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}mh=!1}Ni=0,An=Vt=ht=null,Ko=!1,Hc=gh=0,Yo=null}function Sr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?ht.memoizedState=An=s:An=An.next=s,An}function Tn(){if(Vt===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=Vt.next;var u=An===null?ht.memoizedState:An.next;if(u!==null)An=u,Vt=s;else{if(s===null)throw ht.alternate===null?Error(r(467)):Error(r(310));Vt=s,s={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},An===null?ht.memoizedState=An=s:An=An.next=s}return An}function yh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gc(s){var u=Hc;return Hc+=1,Yo===null&&(Yo=[]),s=zS(Yo,s,u),u=ht,(An===null?u.memoizedState:An.next)===null&&(u=u.alternate,F.H=u===null||u.memoizedState===null?AE:wg),s}function xh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Gc(s);if(s.$$typeof===T)return nr(s)}throw Error(r(438,String(s)))}function cg(s){var u=null,h=ht.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var g=ht.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=yh(),ht.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 ki(s,u){return typeof u=="function"?u(s):u}function bh(s){var u=Tn();return fg(u,Vt,s)}function fg(s,u,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var E=s.baseQueue,N=g.pending;if(N!==null){if(E!==null){var O=E.next;E.next=N.next,N.next=O}u.baseQueue=E=N,g.pending=null}if(N=s.baseState,E===null)s.memoizedState=N;else{u=E.next;var $=O=null,W=null,ce=u,be=!1;do{var Ee=ce.lane&-536870913;if(Ee!==ce.lane?(Tt&Ee)===Ee:(Ni&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===qo&&(be=!0);else if((Ni&ve)===ve){ce=ce.next,ve===qo&&(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=N):W=W.next=Ee,ht.lanes|=ve,Es|=ve;Ee=ce.action,Pl&&h(N,Ee),N=ce.hasEagerState?ce.eagerState:h(N,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=N):W=W.next=ve,ht.lanes|=Ee,Es|=Ee;ce=ce.next}while(ce!==null&&ce!==u);if(W===null?O=N:W.next=$,!Kr(N,s.memoizedState)&&(Rn=!0,be&&(h=Vo,h!==null)))throw h;s.memoizedState=N,s.baseState=O,s.baseQueue=W,g.lastRenderedState=N}return E===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function dg(s){var u=Tn(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,E=h.pending,N=u.memoizedState;if(E!==null){h.pending=null;var O=E=E.next;do N=s(N,O.action),O=O.next;while(O!==E);Kr(N,u.memoizedState)||(Rn=!0),u.memoizedState=N,u.baseQueue===null&&(u.baseState=N),h.lastRenderedState=N}return[N,g]}function XS(s,u,h){var g=ht,E=Tn(),N=kt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=u();var O=!Kr((Vt||E).memoizedState,h);if(O&&(E.memoizedState=h,Rn=!0),E=E.queue,pg(ZS.bind(null,g,E,s),[s]),E.getSnapshot!==u||O||An!==null&&An.memoizedState.tag&1){if(g.flags|=2048,Xo(9,{destroy:void 0},WS.bind(null,g,E,h,u),null),Kt===null)throw Error(r(349));N||(Ni&127)!==0||QS(g,u,h)}return h}function QS(s,u,h){s.flags|=16384,s={getSnapshot:u,value:h},u=ht.updateQueue,u===null?(u=yh(),ht.updateQueue=u,u.stores=[s]):(h=u.stores,h===null?u.stores=[s]:h.push(s))}function WS(s,u,h,g){u.value=h,u.getSnapshot=g,JS(u)&&eE(s)}function ZS(s,u,h){return h(function(){JS(u)&&eE(s)})}function JS(s){var u=s.getSnapshot;s=s.value;try{var h=u();return!Kr(s,h)}catch{return!0}}function eE(s){var u=jl(s,2);u!==null&&Br(u,s,2)}function hg(s){var u=Sr();if(typeof s=="function"){var h=s;if(s=h(),Pl){pe(!0);try{h()}finally{pe(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:s},u}function tE(s,u,h,g){return s.baseState=h,fg(s,Vt,typeof g=="function"?g:ki)}function Q5(s,u,h,g,E){if(Eh(s))throw Error(r(485));if(s=u.action,s!==null){var N={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){N.listeners.push(O)}};F.T!==null?h(!0):N.isTransition=!1,g(N),h=u.pending,h===null?(N.next=u.pending=N,nE(u,N)):(N.next=h.next,u.pending=h.next=N)}}function nE(s,u){var h=u.action,g=u.payload,E=s.state;if(u.isTransition){var N=F.T,O={};F.T=O;try{var $=h(E,g),W=F.S;W!==null&&W(O,$),rE(s,u,$)}catch(ce){vg(s,u,ce)}finally{N!==null&&O.types!==null&&(N.types=O.types),F.T=N}}else try{N=h(E,g),rE(s,u,N)}catch(ce){vg(s,u,ce)}}function rE(s,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){aE(s,u,g)},function(g){return vg(s,u,g)}):aE(s,u,h)}function aE(s,u,h){u.status="fulfilled",u.value=h,iE(u),s.state=h,u=s.pending,u!==null&&(h=u.next,h===u?s.pending=null:(h=h.next,u.next=h,nE(s,h)))}function vg(s,u,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=h,iE(u),u=u.next;while(u!==g)}s.action=null}function iE(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function sE(s,u){return u}function lE(s,u){if(kt){var h=Kt.formState;if(h!==null){e:{var g=ht;if(kt){if(tn){t:{for(var E=tn,N=ga;E.nodeType!==8;){if(!N){E=null;break t}if(E=xa(E.nextSibling),E===null){E=null;break t}}N=E.data,E=N==="F!"||N==="F"?E:null}if(E){tn=xa(E.nextSibling),g=E.data==="F!";break e}}vs(g)}g=!1}g&&(u=h[0])}}return h=Sr(),h.memoizedState=h.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sE,lastRenderedState:u},h.queue=g,h=NE.bind(null,ht,g),g.dispatch=h,g=hg(!1),N=bg.bind(null,ht,!1,g.queue),g=Sr(),E={state:u,dispatch:null,action:s,pending:null},g.queue=E,h=Q5.bind(null,ht,E,N,h),E.dispatch=h,g.memoizedState=s,[u,h,!1]}function oE(s){var u=Tn();return uE(u,Vt,s)}function uE(s,u,h){if(u=fg(s,u,sE)[0],s=bh(ki)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=Gc(u)}catch(O){throw O===Ho?ch:O}else g=u;u=Tn();var E=u.queue,N=E.dispatch;return h!==u.memoizedState&&(ht.flags|=2048,Xo(9,{destroy:void 0},W5.bind(null,E,h),null)),[g,N,s]}function W5(s,u){s.action=u}function cE(s){var u=Tn(),h=Vt;if(h!==null)return uE(u,h,s);Tn(),u=u.memoizedState,h=Tn();var g=h.queue.dispatch;return h.memoizedState=s,[u,g,!1]}function Xo(s,u,h,g){return s={tag:s,create:h,deps:g,inst:u,next:null},u=ht.updateQueue,u===null&&(u=yh(),ht.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 fE(){return Tn().memoizedState}function wh(s,u,h,g){var E=Sr();ht.flags|=s,E.memoizedState=Xo(1|u,{destroy:void 0},h,g===void 0?null:g)}function Sh(s,u,h,g){var E=Tn();g=g===void 0?null:g;var N=E.memoizedState.inst;Vt!==null&&g!==null&&ig(g,Vt.memoizedState.deps)?E.memoizedState=Xo(u,N,h,g):(ht.flags|=s,E.memoizedState=Xo(1|u,N,h,g))}function dE(s,u){wh(8390656,8,s,u)}function pg(s,u){Sh(2048,8,s,u)}function Z5(s){ht.flags|=4;var u=ht.updateQueue;if(u===null)u=yh(),ht.updateQueue=u,u.events=[s];else{var h=u.events;h===null?u.events=[s]:h.push(s)}}function hE(s){var u=Tn().memoizedState;return Z5({ref:u,nextImpl:s}),function(){if((_t&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function vE(s,u){return Sh(4,2,s,u)}function pE(s,u){return Sh(4,4,s,u)}function mE(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 gE(s,u,h){h=h!=null?h.concat([s]):null,Sh(4,4,mE.bind(null,u,s),h)}function mg(){}function yE(s,u){var h=Tn();u=u===void 0?null:u;var g=h.memoizedState;return u!==null&&ig(u,g[1])?g[0]:(h.memoizedState=[s,u],s)}function xE(s,u){var h=Tn();u=u===void 0?null:u;var g=h.memoizedState;if(u!==null&&ig(u,g[1]))return g[0];if(g=s(),Pl){pe(!0);try{s()}finally{pe(!1)}}return h.memoizedState=[g,u],g}function gg(s,u,h){return h===void 0||(Ni&1073741824)!==0&&(Tt&261930)===0?s.memoizedState=u:(s.memoizedState=h,s=b2(),ht.lanes|=s,Es|=s,h)}function bE(s,u,h,g){return Kr(h,u)?h:$o.current!==null?(s=gg(s,h,g),Kr(s,u)||(Rn=!0),s):(Ni&42)===0||(Ni&1073741824)!==0&&(Tt&261930)===0?(Rn=!0,s.memoizedState=h):(s=b2(),ht.lanes|=s,Es|=s,u)}function wE(s,u,h,g,E){var N=H.p;H.p=N!==0&&8>N?N:8;var O=F.T,$={};F.T=$,bg(s,!1,u,h);try{var W=E(),ce=F.S;if(ce!==null&&ce($,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var be=K5(W,g);$c(s,u,be,Jr(s))}else $c(s,u,g,Jr(s))}catch(Ee){$c(s,u,{then:function(){},status:"rejected",reason:Ee},Jr())}finally{H.p=N,O!==null&&$.types!==null&&(O.types=$.types),F.T=O}}function J5(){}function yg(s,u,h,g){if(s.tag!==5)throw Error(r(476));var E=SE(s).queue;wE(s,E,u,Y,h===null?J5:function(){return EE(s),h(g)})}function SE(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:ki,lastRenderedState:Y},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:h},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function EE(s){var u=SE(s);u.next===null&&(u=s.alternate.memoizedState),$c(s,u.next.queue,{},Jr())}function xg(){return nr(cf)}function CE(){return Tn().memoizedState}function TE(){return Tn().memoizedState}function e3(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var h=Jr();s=gs(h);var g=ys(u,s,h);g!==null&&(Br(g,u,h),Uc(g,u,h)),u={cache:Ym()},s.payload=u;return}u=u.return}}function t3(s,u,h){var g=Jr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Eh(s)?kE(u,h):(h=Pm(s,u,h,g),h!==null&&(Br(h,s,g),jE(h,u,g)))}function NE(s,u,h){var g=Jr();$c(s,u,h,g)}function $c(s,u,h,g){var E={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Eh(s))kE(u,E);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=u.lastRenderedReducer,N!==null))try{var O=u.lastRenderedState,$=N(O,h);if(E.hasEagerState=!0,E.eagerState=$,Kr($,O))return rh(s,u,E,0),Kt===null&&nh(),!1}catch{}finally{}if(h=Pm(s,u,E,g),h!==null)return Br(h,s,g),jE(h,u,g),!0}return!1}function bg(s,u,h,g){if(g={lane:2,revertLane:Zg(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Eh(s)){if(u)throw Error(r(479))}else u=Pm(s,h,g,2),u!==null&&Br(u,s,2)}function Eh(s){var u=s.alternate;return s===ht||u!==null&&u===ht}function kE(s,u){Ko=mh=!0;var h=s.pending;h===null?u.next=u:(u.next=h.next,h.next=u),s.pending=u}function jE(s,u,h){if((h&4194048)!==0){var g=u.lanes;g&=s.pendingLanes,h|=g,u.lanes=h,Sn(s,h)}}var Kc={readContext:nr,use:xh,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useLayoutEffect:yn,useInsertionEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useSyncExternalStore:yn,useId:yn,useHostTransitionStatus:yn,useFormState:yn,useActionState:yn,useOptimistic:yn,useMemoCache:yn,useCacheRefresh:yn};Kc.useEffectEvent=yn;var AE={readContext:nr,use:xh,useCallback:function(s,u){return Sr().memoizedState=[s,u===void 0?null:u],s},useContext:nr,useEffect:dE,useImperativeHandle:function(s,u,h){h=h!=null?h.concat([s]):null,wh(4194308,4,mE.bind(null,u,s),h)},useLayoutEffect:function(s,u){return wh(4194308,4,s,u)},useInsertionEffect:function(s,u){wh(4,2,s,u)},useMemo:function(s,u){var h=Sr();u=u===void 0?null:u;var g=s();if(Pl){pe(!0);try{s()}finally{pe(!1)}}return h.memoizedState=[g,u],g},useReducer:function(s,u,h){var g=Sr();if(h!==void 0){var E=h(u);if(Pl){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=t3.bind(null,ht,s),[g.memoizedState,s]},useRef:function(s){var u=Sr();return s={current:s},u.memoizedState=s},useState:function(s){s=hg(s);var u=s.queue,h=NE.bind(null,ht,u);return u.dispatch=h,[s.memoizedState,h]},useDebugValue:mg,useDeferredValue:function(s,u){var h=Sr();return gg(h,s,u)},useTransition:function(){var s=hg(!1);return s=wE.bind(null,ht,s.queue,!0,!1),Sr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,h){var g=ht,E=Sr();if(kt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),Kt===null)throw Error(r(349));(Tt&127)!==0||QS(g,u,h)}E.memoizedState=h;var N={value:h,getSnapshot:u};return E.queue=N,dE(ZS.bind(null,g,N,s),[s]),g.flags|=2048,Xo(9,{destroy:void 0},WS.bind(null,g,N,h,u),null),h},useId:function(){var s=Sr(),u=Kt.identifierPrefix;if(kt){var h=Xa,g=Ya;h=(g&~(1<<32-de(g)-1)).toString(32)+h,u="_"+u+"R_"+h,h=gh++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=Y5++,u="_"+u+"r_"+h.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:xg,useFormState:lE,useActionState:lE,useOptimistic:function(s){var u=Sr();u.memoizedState=u.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=bg.bind(null,ht,!0,h),h.dispatch=u,[s,u]},useMemoCache:cg,useCacheRefresh:function(){return Sr().memoizedState=e3.bind(null,ht)},useEffectEvent:function(s){var u=Sr(),h={impl:s};return u.memoizedState=h,function(){if((_t&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},wg={readContext:nr,use:xh,useCallback:yE,useContext:nr,useEffect:pg,useImperativeHandle:gE,useInsertionEffect:vE,useLayoutEffect:pE,useMemo:xE,useReducer:bh,useRef:fE,useState:function(){return bh(ki)},useDebugValue:mg,useDeferredValue:function(s,u){var h=Tn();return bE(h,Vt.memoizedState,s,u)},useTransition:function(){var s=bh(ki)[0],u=Tn().memoizedState;return[typeof s=="boolean"?s:Gc(s),u]},useSyncExternalStore:XS,useId:CE,useHostTransitionStatus:xg,useFormState:oE,useActionState:oE,useOptimistic:function(s,u){var h=Tn();return tE(h,Vt,s,u)},useMemoCache:cg,useCacheRefresh:TE};wg.useEffectEvent=hE;var RE={readContext:nr,use:xh,useCallback:yE,useContext:nr,useEffect:pg,useImperativeHandle:gE,useInsertionEffect:vE,useLayoutEffect:pE,useMemo:xE,useReducer:dg,useRef:fE,useState:function(){return dg(ki)},useDebugValue:mg,useDeferredValue:function(s,u){var h=Tn();return Vt===null?gg(h,s,u):bE(h,Vt.memoizedState,s,u)},useTransition:function(){var s=dg(ki)[0],u=Tn().memoizedState;return[typeof s=="boolean"?s:Gc(s),u]},useSyncExternalStore:XS,useId:CE,useHostTransitionStatus:xg,useFormState:cE,useActionState:cE,useOptimistic:function(s,u){var h=Tn();return Vt!==null?tE(h,Vt,s,u):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:cg,useCacheRefresh:TE};RE.useEffectEvent=hE;function Sg(s,u,h,g){u=s.memoizedState,h=h(g,u),h=h==null?u:p({},u,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var Eg={enqueueSetState:function(s,u,h){s=s._reactInternals;var g=Jr(),E=gs(g);E.payload=u,h!=null&&(E.callback=h),u=ys(s,E,g),u!==null&&(Br(u,s,g),Uc(u,s,g))},enqueueReplaceState:function(s,u,h){s=s._reactInternals;var g=Jr(),E=gs(g);E.tag=1,E.payload=u,h!=null&&(E.callback=h),u=ys(s,E,g),u!==null&&(Br(u,s,g),Uc(u,s,g))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var h=Jr(),g=gs(h);g.tag=2,u!=null&&(g.callback=u),u=ys(s,g,h),u!==null&&(Br(u,s,h),Uc(u,s,h))}};function DE(s,u,h,g,E,N,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,O):u.prototype&&u.prototype.isPureReactComponent?!Oc(h,g)||!Oc(E,N):!0}function ME(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&&Eg.enqueueReplaceState(u,u.state,null)}function zl(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=p({},h));for(var E in s)h[E]===void 0&&(h[E]=s[E])}return h}function OE(s){th(s)}function LE(s){console.error(s)}function _E(s){th(s)}function Ch(s,u){try{var h=s.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function BE(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 Cg(s,u,h){return h=gs(h),h.tag=3,h.payload={element:null},h.callback=function(){Ch(s,u)},h}function PE(s){return s=gs(s),s.tag=3,s}function zE(s,u,h,g){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var N=g.value;s.payload=function(){return E(N)},s.callback=function(){BE(u,h,g)}}var O=h.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){BE(u,h,g),typeof E!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var $=g.stack;this.componentDidCatch(g.value,{componentStack:$!==null?$:""})})}function n3(s,u,h,g,E){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=h.alternate,u!==null&&Uo(u,h,E,!0),h=Xr.current,h!==null){switch(h.tag){case 31:case 13:return ya===null?Bh():h.alternate===null&&xn===0&&(xn=3),h.flags&=-257,h.flags|=65536,h.lanes=E,g===fh?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([g]):u.add(g),Xg(s,g,E)),!1;case 22:return h.flags|=65536,g===fh?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)),Xg(s,g,E)),!1}throw Error(r(435,h.tag))}return Xg(s,g,E),Bh(),!1}if(kt)return u=Xr.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,g!==Vm&&(s=Error(r(422),{cause:g}),Bc(va(s,h)))):(g!==Vm&&(u=Error(r(423),{cause:g}),Bc(va(u,h))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,g=va(g,h),E=Cg(s.stateNode,g,E),eg(s,E),xn!==4&&(xn=2)),!1;var N=Error(r(520),{cause:g});if(N=va(N,h),tf===null?tf=[N]:tf.push(N),xn!==4&&(xn=2),u===null)return!0;g=va(g,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,s=E&-E,h.lanes|=s,s=Cg(h.stateNode,g,s),eg(h,s),!1;case 1:if(u=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Cs===null||!Cs.has(N))))return h.flags|=65536,E&=-E,h.lanes|=E,E=PE(E),zE(E,s,h,g),eg(h,E),!1}h=h.return}while(h!==null);return!1}var Tg=Error(r(461)),Rn=!1;function rr(s,u,h,g){u.child=s===null?qS(u,null,h,g):Bl(u,s.child,h,g)}function IE(s,u,h,g,E){h=h.render;var N=u.ref;if("ref"in g){var O={};for(var $ in g)$!=="ref"&&(O[$]=g[$])}else O=g;return Ml(u),g=sg(s,u,h,O,N,E),$=lg(),s!==null&&!Rn?(og(s,u,E),ji(s,u,E)):(kt&&$&&Um(u),u.flags|=1,rr(s,u,g,E),u.child)}function FE(s,u,h,g,E){if(s===null){var N=h.type;return typeof N=="function"&&!zm(N)&&N.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=N,UE(s,u,N,g,E)):(s=ih(h.type,null,g,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(N=s.child,!Og(s,E)){var O=N.memoizedProps;if(h=h.compare,h=h!==null?h:Oc,h(O,g)&&s.ref===u.ref)return ji(s,u,E)}return u.flags|=1,s=Si(N,g),s.ref=u.ref,s.return=u,u.child=s}function UE(s,u,h,g,E){if(s!==null){var N=s.memoizedProps;if(Oc(N,g)&&s.ref===u.ref)if(Rn=!1,u.pendingProps=g=N,Og(s,E))(s.flags&131072)!==0&&(Rn=!0);else return u.lanes=s.lanes,ji(s,u,E)}return Ng(s,u,h,g,E)}function qE(s,u,h,g){var E=g.children,N=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(N=N!==null?N.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&~N}else g=0,u.child=null;return VE(s,u,N,h,g)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&uh(u,N!==null?N.cachePool:null),N!==null?GS(u,N):ng(),$S(u);else return g=u.lanes=536870912,VE(s,u,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(uh(u,N.cachePool),GS(u,N),bs(),u.memoizedState=null):(s!==null&&uh(u,null),ng(),bs());return rr(s,u,E,h),u.child}function Yc(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function VE(s,u,h,g,E){var N=Qm();return N=N===null?null:{parent:jn._currentValue,pool:N},u.memoizedState={baseLanes:h,cachePool:N},s!==null&&uh(u,null),ng(),$S(u),s!==null&&Uo(s,u,g,!0),u.childLanes=E,null}function Th(s,u){return u=kh({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function HE(s,u,h){return Bl(u,s.child,null,h),s=Th(u,u.pendingProps),s.flags|=2,Qr(u),u.memoizedState=null,s}function r3(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=Th(u,g),u.lanes=536870912,Yc(null,s);if(ag(u),(s=tn)?(s=nC(s,ga),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ds!==null?{id:Ya,overflow:Xa}:null,retryLane:536870912,hydrationErrors:null},h=kS(s),h.return=u,u.child=h,tr=u,tn=null)):s=null,s===null)throw vs(u);return u.lanes=536870912,null}return Th(u,g)}var N=s.memoizedState;if(N!==null){var O=N.dehydrated;if(ag(u),E)if(u.flags&256)u.flags&=-257,u=HE(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||Uo(s,u,h,!1),E=(h&s.childLanes)!==0,Rn||E){if(g=Kt,g!==null&&(O=gn(g,h),O!==0&&O!==N.retryLane))throw N.retryLane=O,jl(s,O),Br(g,s,O),Tg;Bh(),u=HE(s,u,h)}else s=N.treeContext,tn=xa(O.nextSibling),tr=u,kt=!0,hs=null,ga=!1,s!==null&&RS(u,s),u=Th(u,g),u.flags|=4096;return u}return s=Si(s.child,{mode:g.mode,children:g.children}),s.ref=u.ref,u.child=s,s.return=u,s}function Nh(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 Ng(s,u,h,g,E){return Ml(u),h=sg(s,u,h,g,void 0,E),g=lg(),s!==null&&!Rn?(og(s,u,E),ji(s,u,E)):(kt&&g&&Um(u),u.flags|=1,rr(s,u,h,E),u.child)}function GE(s,u,h,g,E,N){return Ml(u),u.updateQueue=null,h=YS(u,g,h,E),KS(s),g=lg(),s!==null&&!Rn?(og(s,u,N),ji(s,u,N)):(kt&&g&&Um(u),u.flags|=1,rr(s,u,h,N),u.child)}function $E(s,u,h,g,E){if(Ml(u),u.stateNode===null){var N=Po,O=h.contextType;typeof O=="object"&&O!==null&&(N=nr(O)),N=new h(g,N),u.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=Eg,u.stateNode=N,N._reactInternals=u,N=u.stateNode,N.props=g,N.state=u.memoizedState,N.refs={},Zm(u),O=h.contextType,N.context=typeof O=="object"&&O!==null?nr(O):Po,N.state=u.memoizedState,O=h.getDerivedStateFromProps,typeof O=="function"&&(Sg(u,h,O,g),N.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(O=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),O!==N.state&&Eg.enqueueReplaceState(N,N.state,null),Vc(u,g,N,E),qc(),N.state=u.memoizedState),typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(s===null){N=u.stateNode;var $=u.memoizedProps,W=zl(h,$);N.props=W;var ce=N.context,be=h.contextType;O=Po,typeof be=="object"&&be!==null&&(O=nr(be));var Ee=h.getDerivedStateFromProps;be=typeof Ee=="function"||typeof N.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,be||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||($||ce!==O)&&ME(u,N,g,O),ms=!1;var ve=u.memoizedState;N.state=ve,Vc(u,g,N,E),qc(),ce=u.memoizedState,$||ve!==ce||ms?(typeof Ee=="function"&&(Sg(u,h,Ee,g),ce=u.memoizedState),(W=ms||DE(u,h,W,g,ve,ce,O))?(be||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=ce),N.props=g,N.state=ce,N.context=O,g=W):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{N=u.stateNode,Jm(s,u),O=u.memoizedProps,be=zl(h,O),N.props=be,Ee=u.pendingProps,ve=N.context,ce=h.contextType,W=Po,typeof ce=="object"&&ce!==null&&(W=nr(ce)),$=h.getDerivedStateFromProps,(ce=typeof $=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(O!==Ee||ve!==W)&&ME(u,N,g,W),ms=!1,ve=u.memoizedState,N.state=ve,Vc(u,g,N,E),qc();var me=u.memoizedState;O!==Ee||ve!==me||ms||s!==null&&s.dependencies!==null&&lh(s.dependencies)?(typeof $=="function"&&(Sg(u,h,$,g),me=u.memoizedState),(be=ms||DE(u,h,be,g,ve,me,W)||s!==null&&s.dependencies!==null&&lh(s.dependencies))?(ce||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,me,W),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,me,W)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=me),N.props=g,N.state=me,N.context=W,g=be):(typeof N.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),g=!1)}return N=g,Nh(s,u),g=(u.flags&128)!==0,N||g?(N=u.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),u.flags|=1,s!==null&&g?(u.child=Bl(u,s.child,null,E),u.child=Bl(u,null,h,E)):rr(s,u,h,E),u.memoizedState=N.state,s=u.child):s=ji(s,u,E),s}function KE(s,u,h,g){return Rl(),u.flags|=256,rr(s,u,h,g),u.child}var kg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jg(s){return{baseLanes:s,cachePool:BS()}}function Ag(s,u,h){return s=s!==null?s.childLanes&~h:0,u&&(s|=Zr),s}function YE(s,u,h){var g=u.pendingProps,E=!1,N=(u.flags&128)!==0,O;if((O=N)||(O=s!==null&&s.memoizedState===null?!1:(Cn.current&2)!==0),O&&(E=!0,u.flags&=-129),O=(u.flags&32)!==0,u.flags&=-33,s===null){if(kt){if(E?xs(u):bs(),(s=tn)?(s=nC(s,ga),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ds!==null?{id:Ya,overflow:Xa}:null,retryLane:536870912,hydrationErrors:null},h=kS(s),h.return=u,u.child=h,tr=u,tn=null)):s=null,s===null)throw vs(u);return fy(s)?u.lanes=32:u.lanes=536870912,null}var $=g.children;return g=g.fallback,E?(bs(),E=u.mode,$=kh({mode:"hidden",children:$},E),g=Al(g,E,h,null),$.return=u,g.return=u,$.sibling=g,u.child=$,g=u.child,g.memoizedState=jg(h),g.childLanes=Ag(s,O,h),u.memoizedState=kg,Yc(null,g)):(xs(u),Rg(u,$))}var W=s.memoizedState;if(W!==null&&($=W.dehydrated,$!==null)){if(N)u.flags&256?(xs(u),u.flags&=-257,u=Dg(s,u,h)):u.memoizedState!==null?(bs(),u.child=s.child,u.flags|=128,u=null):(bs(),$=g.fallback,E=u.mode,g=kh({mode:"visible",children:g.children},E),$=Al($,E,h,null),$.flags|=2,g.return=u,$.return=u,g.sibling=$,u.child=g,Bl(u,s.child,null,h),g=u.child,g.memoizedState=jg(h),g.childLanes=Ag(s,O,h),u.memoizedState=kg,u=Yc(null,g));else if(xs(u),fy($)){if(O=$.nextSibling&&$.nextSibling.dataset,O)var ce=O.dgst;O=ce,g=Error(r(419)),g.stack="",g.digest=O,Bc({value:g,source:null,stack:null}),u=Dg(s,u,h)}else if(Rn||Uo(s,u,h,!1),O=(h&s.childLanes)!==0,Rn||O){if(O=Kt,O!==null&&(g=gn(O,h),g!==0&&g!==W.retryLane))throw W.retryLane=g,jl(s,g),Br(O,s,g),Tg;cy($)||Bh(),u=Dg(s,u,h)}else cy($)?(u.flags|=192,u.child=s.child,u=null):(s=W.treeContext,tn=xa($.nextSibling),tr=u,kt=!0,hs=null,ga=!1,s!==null&&RS(u,s),u=Rg(u,g.children),u.flags|=4096);return u}return E?(bs(),$=g.fallback,E=u.mode,W=s.child,ce=W.sibling,g=Si(W,{mode:"hidden",children:g.children}),g.subtreeFlags=W.subtreeFlags&65011712,ce!==null?$=Si(ce,$):($=Al($,E,h,null),$.flags|=2),$.return=u,g.return=u,g.sibling=$,u.child=g,Yc(null,g),g=u.child,$=s.child.memoizedState,$===null?$=jg(h):(E=$.cachePool,E!==null?(W=jn._currentValue,E=E.parent!==W?{parent:W,pool:W}:E):E=BS(),$={baseLanes:$.baseLanes|h,cachePool:E}),g.memoizedState=$,g.childLanes=Ag(s,O,h),u.memoizedState=kg,Yc(s.child,g)):(xs(u),h=s.child,s=h.sibling,h=Si(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 Rg(s,u){return u=kh({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function kh(s,u){return s=Yr(22,s,null,u),s.lanes=0,s}function Dg(s,u,h){return Bl(u,s.child,null,h),s=Rg(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function XE(s,u,h){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u),$m(s.return,u,h)}function Mg(s,u,h,g,E,N){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:E,treeForkCount:N}:(O.isBackwards=u,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=h,O.tailMode=E,O.treeForkCount=N)}function QE(s,u,h){var g=u.pendingProps,E=g.revealOrder,N=g.tail;g=g.children;var O=Cn.current,$=(O&2)!==0;if($?(O=O&1|2,u.flags|=128):O&=1,U(Cn,O),rr(s,u,g,h),g=kt?_c:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&XE(s,h,u);else if(s.tag===19)XE(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&&ph(s)===null&&(E=h),h=h.sibling;h=E,h===null?(E=u.child,u.child=null):(E=h.sibling,h.sibling=null),Mg(u,!1,E,h,N,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&&ph(s)===null){u.child=E;break}s=E.sibling,E.sibling=h,h=E,E=s}Mg(u,!0,h,null,N,g);break;case"together":Mg(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function ji(s,u,h){if(s!==null&&(u.dependencies=s.dependencies),Es|=u.lanes,(h&u.childLanes)===0)if(s!==null){if(Uo(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=Si(s,s.pendingProps),u.child=h,h.return=u;s.sibling!==null;)s=s.sibling,h=h.sibling=Si(s,s.pendingProps),h.return=u;h.sibling=null}return u.child}function Og(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&lh(s)))}function a3(s,u,h){switch(u.tag){case 3:we(u,u.stateNode.containerInfo),ps(u,jn,s.memoizedState.cache),Rl();break;case 27:case 5:J(u);break;case 4:we(u,u.stateNode.containerInfo);break;case 10:ps(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,ag(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(xs(u),u.flags|=128,null):(h&u.child.childLanes)!==0?YE(s,u,h):(xs(u),s=ji(s,u,h),s!==null?s.sibling:null);xs(u);break;case 19:var E=(s.flags&128)!==0;if(g=(h&u.childLanes)!==0,g||(Uo(s,u,h,!1),g=(h&u.childLanes)!==0),E){if(g)return QE(s,u,h);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),U(Cn,Cn.current),g)break;return null;case 22:return u.lanes=0,qE(s,u,h,u.pendingProps);case 24:ps(u,jn,s.memoizedState.cache)}return ji(s,u,h)}function WE(s,u,h){if(s!==null)if(s.memoizedProps!==u.pendingProps)Rn=!0;else{if(!Og(s,h)&&(u.flags&128)===0)return Rn=!1,a3(s,u,h);Rn=(s.flags&131072)!==0}else Rn=!1,kt&&(u.flags&1048576)!==0&&AS(u,_c,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(s=Ll(u.elementType),u.type=s,typeof s=="function")zm(s)?(g=zl(s,g),u.tag=1,u=$E(null,u,s,g,h)):(u.tag=0,u=Ng(null,u,s,g,h));else{if(s!=null){var E=s.$$typeof;if(E===k){u.tag=11,u=IE(null,u,s,g,h);break e}else if(E===D){u.tag=14,u=FE(null,u,s,g,h);break e}}throw u=V(s)||s,Error(r(306,u,""))}}return u;case 0:return Ng(s,u,u.type,u.pendingProps,h);case 1:return g=u.type,E=zl(g,u.pendingProps),$E(s,u,g,E,h);case 3:e:{if(we(u,u.stateNode.containerInfo),s===null)throw Error(r(387));g=u.pendingProps;var N=u.memoizedState;E=N.element,Jm(s,u),Vc(u,g,null,h);var O=u.memoizedState;if(g=O.cache,ps(u,jn,g),g!==N.cache&&Km(u,[jn],h,!0),qc(),g=O.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:O.cache},u.updateQueue.baseState=N,u.memoizedState=N,u.flags&256){u=KE(s,u,g,h);break e}else if(g!==E){E=va(Error(r(424)),u),Bc(E),u=KE(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(tn=xa(s.firstChild),tr=u,kt=!0,hs=null,ga=!0,h=qS(u,null,g,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Rl(),g===E){u=ji(s,u,h);break e}rr(s,u,g,h)}u=u.child}return u;case 26:return Nh(s,u),s===null?(h=oC(u.type,null,u.pendingProps,null))?u.memoizedState=h:kt||(h=u.type,s=u.pendingProps,g=Vh(oe.current).createElement(h),g[ln]=u,g[_n]=s,ar(g,h,s),kn(g),u.stateNode=g):u.memoizedState=oC(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return J(u),s===null&&kt&&(g=u.stateNode=iC(u.type,u.pendingProps,oe.current),tr=u,ga=!0,E=tn,js(u.type)?(dy=E,tn=xa(g.firstChild)):tn=E),rr(s,u,u.pendingProps.children,h),Nh(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&kt&&((E=g=tn)&&(g=L3(g,u.type,u.pendingProps,ga),g!==null?(u.stateNode=g,tr=u,tn=xa(g.firstChild),ga=!1,E=!0):E=!1),E||vs(u)),J(u),E=u.type,N=u.pendingProps,O=s!==null?s.memoizedProps:null,g=N.children,ly(E,N)?g=null:O!==null&&ly(E,O)&&(u.flags|=32),u.memoizedState!==null&&(E=sg(s,u,X5,null,null,h),cf._currentValue=E),Nh(s,u),rr(s,u,g,h),u.child;case 6:return s===null&&kt&&((s=h=tn)&&(h=_3(h,u.pendingProps,ga),h!==null?(u.stateNode=h,tr=u,tn=null,s=!0):s=!1),s||vs(u)),null;case 13:return YE(s,u,h);case 4:return we(u,u.stateNode.containerInfo),g=u.pendingProps,s===null?u.child=Bl(u,null,g,h):rr(s,u,g,h),u.child;case 11:return IE(s,u,u.type,u.pendingProps,h);case 7:return rr(s,u,u.pendingProps,h),u.child;case 8:return rr(s,u,u.pendingProps.children,h),u.child;case 12:return rr(s,u,u.pendingProps.children,h),u.child;case 10:return g=u.pendingProps,ps(u,u.type,g.value),rr(s,u,g.children,h),u.child;case 9:return E=u.type._context,g=u.pendingProps.children,Ml(u),E=nr(E),g=g(E),u.flags|=1,rr(s,u,g,h),u.child;case 14:return FE(s,u,u.type,u.pendingProps,h);case 15:return UE(s,u,u.type,u.pendingProps,h);case 19:return QE(s,u,h);case 31:return r3(s,u,h);case 22:return qE(s,u,h,u.pendingProps);case 24:return Ml(u),g=nr(jn),s===null?(E=Qm(),E===null&&(E=Kt,N=Ym(),E.pooledCache=N,N.refCount++,N!==null&&(E.pooledCacheLanes|=h),E=N),u.memoizedState={parent:g,cache:E},Zm(u),ps(u,jn,E)):((s.lanes&h)!==0&&(Jm(s,u),Vc(u,null,null,h),qc()),E=s.memoizedState,N=u.memoizedState,E.parent!==g?(E={parent:g,cache:g},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),ps(u,jn,g)):(g=N.cache,ps(u,jn,g),g!==E.cache&&Km(u,[jn],h,!0))),rr(s,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Ai(s){s.flags|=4}function Lg(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(C2())s.flags|=8192;else throw _l=fh,Wm}else s.flags&=-16777217}function ZE(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!hC(u))if(C2())s.flags|=8192;else throw _l=fh,Wm}function jh(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?vt():536870912,s.lanes|=u,Jo|=u)}function Xc(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 nn(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 i3(s,u,h){var g=u.pendingProps;switch(qm(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(u),null;case 1:return nn(u),null;case 3:return h=u.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),Ti(jn),fe(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(Fo(u)?Ai(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Hm())),nn(u),null;case 26:var E=u.type,N=u.memoizedState;return s===null?(Ai(u),N!==null?(nn(u),ZE(u,N)):(nn(u),Lg(u,E,null,g,h))):N?N!==s.memoizedState?(Ai(u),nn(u),ZE(u,N)):(nn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==g&&Ai(u),nn(u),Lg(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&&Ai(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return nn(u),null}s=te.current,Fo(u)?DS(u):(s=iC(E,g,h),u.stateNode=s,Ai(u))}return nn(u),null;case 5:if(ne(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&Ai(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return nn(u),null}if(N=te.current,Fo(u))DS(u);else{var O=Vh(oe.current);switch(N){case 1:N=O.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:N=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":N=O.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":N=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":N=O.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?O.createElement(E,{is:g.is}):O.createElement(E)}}N[ln]=u,N[_n]=g;e:for(O=u.child;O!==null;){if(O.tag===5||O.tag===6)N.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=N;e:switch(ar(N,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&&Ai(u)}}return nn(u),Lg(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,h),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==g&&Ai(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(s=oe.current,Fo(u)){if(s=u.stateNode,h=u.memoizedProps,g=null,E=tr,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}s[ln]=u,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||Y2(s.nodeValue,h)),s||vs(u,!0)}else s=Vh(s).createTextNode(g),s[ln]=u,u.stateNode=s}return nn(u),null;case 31:if(h=u.memoizedState,s===null||s.memoizedState!==null){if(g=Fo(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[ln]=u}else Rl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;nn(u),s=!1}else h=Hm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return u.flags&256?(Qr(u),u):(Qr(u),null);if((u.flags&128)!==0)throw Error(r(558))}return nn(u),null;case 13:if(g=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Fo(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[ln]=u}else Rl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;nn(u),E=!1}else E=Hm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(Qr(u),u):(Qr(u),null)}return Qr(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),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==E&&(g.flags|=2048)),h!==s&&h&&(u.child.flags|=8192),jh(u,u.updateQueue),nn(u),null);case 4:return fe(),s===null&&ny(u.stateNode.containerInfo),nn(u),null;case 10:return Ti(u.type),nn(u),null;case 19:if(X(Cn),g=u.memoizedState,g===null)return nn(u),null;if(E=(u.flags&128)!==0,N=g.rendering,N===null)if(E)Xc(g,!1);else{if(xn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(N=ph(s),N!==null){for(u.flags|=128,Xc(g,!1),s=N.updateQueue,u.updateQueue=s,jh(u,s),u.subtreeFlags=0,s=h,h=u.child;h!==null;)NS(h,s),h=h.sibling;return U(Cn,Cn.current&1|2),kt&&Ei(u,g.treeForkCount),u.child}s=s.sibling}g.tail!==null&&Pe()>Oh&&(u.flags|=128,E=!0,Xc(g,!1),u.lanes=4194304)}else{if(!E)if(s=ph(N),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,jh(u,s),Xc(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!kt)return nn(u),null}else 2*Pe()-g.renderingStartTime>Oh&&h!==536870912&&(u.flags|=128,E=!0,Xc(g,!1),u.lanes=4194304);g.isBackwards?(N.sibling=u.child,u.child=N):(s=g.last,s!==null?s.sibling=N:u.child=N,g.last=N)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Pe(),s.sibling=null,h=Cn.current,U(Cn,E?h&1|2:h&1),kt&&Ei(u,g.treeForkCount),s):(nn(u),null);case 22:case 23:return Qr(u),rg(),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&&(nn(u),u.subtreeFlags&6&&(u.flags|=8192)):nn(u),h=u.updateQueue,h!==null&&jh(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(Ol),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),Ti(jn),nn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function s3(s,u){switch(qm(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Ti(jn),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(Qr(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(Qr(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(Cn),null;case 4:return fe(),null;case 10:return Ti(u.type),null;case 22:case 23:return Qr(u),rg(),s!==null&&X(Ol),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Ti(jn),null;case 25:return null;default:return null}}function JE(s,u){switch(qm(u),u.tag){case 3:Ti(jn),fe();break;case 26:case 27:case 5:ne(u);break;case 4:fe();break;case 31:u.memoizedState!==null&&Qr(u);break;case 13:Qr(u);break;case 19:X(Cn);break;case 10:Ti(u.type);break;case 22:case 23:Qr(u),rg(),s!==null&&X(Ol);break;case 24:Ti(jn)}}function Qc(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 N=h.create,O=h.inst;g=N(),O.destroy=g}h=h.next}while(h!==E)}}catch($){Ut(u,u.return,$)}}function ws(s,u,h){try{var g=u.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var N=E.next;g=N;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){Ut(E,W,be)}}}g=g.next}while(g!==N)}}catch(be){Ut(u,u.return,be)}}function e2(s){var u=s.updateQueue;if(u!==null){var h=s.stateNode;try{HS(u,h)}catch(g){Ut(s,s.return,g)}}}function t2(s,u,h){h.props=zl(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){Ut(s,u,g)}}function Wc(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){Ut(s,u,E)}}function Qa(s,u){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(E){Ut(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){Ut(s,u,E)}else h.current=null}function n2(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){Ut(s,s.return,E)}}function _g(s,u,h){try{var g=s.stateNode;j3(g,s.type,h,u),g[_n]=u}catch(E){Ut(s,s.return,E)}}function r2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&js(s.type)||s.tag===4}function Bg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||r2(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&&js(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 Pg(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=bi));else if(g!==4&&(g===27&&js(s.type)&&(h=s.stateNode,u=null),s=s.child,s!==null))for(Pg(s,u,h),s=s.sibling;s!==null;)Pg(s,u,h),s=s.sibling}function Ah(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&&js(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Ah(s,u,h),s=s.sibling;s!==null;)Ah(s,u,h),s=s.sibling}function a2(s){var u=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);ar(u,g,h),u[ln]=s,u[_n]=h}catch(N){Ut(s,s.return,N)}}var Ri=!1,Dn=!1,zg=!1,i2=typeof WeakSet=="function"?WeakSet:Set,Yn=null;function l3(s,u){if(s=s.containerInfo,iy=Qh,s=gS(s),Dm(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,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.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!==N||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===N&&++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(sy={focusedElem:s,selectionRange:h},Qh=!1,Yn=u;Yn!==null;)if(u=Yn,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Yn=s;else for(;Yn!==null;){switch(u=Yn,N=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&&N!==null){s=void 0,h=u,E=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Ge=zl(h.type,E);s=g.getSnapshotBeforeUpdate(Ge,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(it){Ut(h,h.return,it)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,h=s.nodeType,h===9)uy(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":uy(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,Yn=s;break}Yn=u.return}}function s2(s,u,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Mi(s,h),g&4&&Qc(5,h);break;case 1:if(Mi(s,h),g&4)if(s=h.stateNode,u===null)try{s.componentDidMount()}catch(O){Ut(h,h.return,O)}else{var E=zl(h.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(O){Ut(h,h.return,O)}}g&64&&e2(h),g&512&&Wc(h,h.return);break;case 3:if(Mi(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{HS(s,u)}catch(O){Ut(h,h.return,O)}}break;case 27:u===null&&g&4&&a2(h);case 26:case 5:Mi(s,h),u===null&&g&4&&n2(h),g&512&&Wc(h,h.return);break;case 12:Mi(s,h);break;case 31:Mi(s,h),g&4&&u2(s,h);break;case 13:Mi(s,h),g&4&&c2(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=m3.bind(null,h),B3(s,h))));break;case 22:if(g=h.memoizedState!==null||Ri,!g){u=u!==null&&u.memoizedState!==null||Dn,E=Ri;var N=Dn;Ri=g,(Dn=u)&&!N?Oi(s,h,(h.subtreeFlags&8772)!==0):Mi(s,h),Ri=E,Dn=N}break;case 30:break;default:Mi(s,h)}}function l2(s){var u=s.alternate;u!==null&&(s.alternate=null,l2(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&ko(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 on=null,Mr=!1;function Di(s,u,h){for(h=h.child;h!==null;)o2(s,u,h),h=h.sibling}function o2(s,u,h){if(le&&typeof le.onCommitFiberUnmount=="function")try{le.onCommitFiberUnmount(K,h)}catch{}switch(h.tag){case 26:Dn||Qa(h,u),Di(s,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Dn||Qa(h,u);var g=on,E=Mr;js(h.type)&&(on=h.stateNode,Mr=!1),Di(s,u,h),lf(h.stateNode),on=g,Mr=E;break;case 5:Dn||Qa(h,u);case 6:if(g=on,E=Mr,on=null,Di(s,u,h),on=g,Mr=E,on!==null)if(Mr)try{(on.nodeType===9?on.body:on.nodeName==="HTML"?on.ownerDocument.body:on).removeChild(h.stateNode)}catch(N){Ut(h,u,N)}else try{on.removeChild(h.stateNode)}catch(N){Ut(h,u,N)}break;case 18:on!==null&&(Mr?(s=on,eC(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),lu(s)):eC(on,h.stateNode));break;case 4:g=on,E=Mr,on=h.stateNode.containerInfo,Mr=!0,Di(s,u,h),on=g,Mr=E;break;case 0:case 11:case 14:case 15:ws(2,h,u),Dn||ws(4,h,u),Di(s,u,h);break;case 1:Dn||(Qa(h,u),g=h.stateNode,typeof g.componentWillUnmount=="function"&&t2(h,u,g)),Di(s,u,h);break;case 21:Di(s,u,h);break;case 22:Dn=(g=Dn)||h.memoizedState!==null,Di(s,u,h),Dn=g;break;default:Di(s,u,h)}}function u2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{lu(s)}catch(h){Ut(u,u.return,h)}}}function c2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{lu(s)}catch(h){Ut(u,u.return,h)}}function o3(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new i2),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new i2),u;default:throw Error(r(435,s.tag))}}function Rh(s,u){var h=o3(s);u.forEach(function(g){if(!h.has(g)){h.add(g);var E=g3.bind(null,s,g);g.then(E,E)}})}function Or(s,u){var h=u.deletions;if(h!==null)for(var g=0;g<h.length;g++){var E=h[g],N=s,O=u,$=O;e:for(;$!==null;){switch($.tag){case 27:if(js($.type)){on=$.stateNode,Mr=!1;break e}break;case 5:on=$.stateNode,Mr=!1;break e;case 3:case 4:on=$.stateNode.containerInfo,Mr=!0;break e}$=$.return}if(on===null)throw Error(r(160));o2(N,O,E),on=null,Mr=!1,N=E.alternate,N!==null&&(N.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)f2(u,s),u=u.sibling}var La=null;function f2(s,u){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Or(u,s),Lr(s),g&4&&(ws(3,s,s.return),Qc(3,s),ws(5,s,s.return));break;case 1:Or(u,s),Lr(s),g&512&&(Dn||h===null||Qa(h,h.return)),g&64&&Ri&&(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=La;if(Or(u,s),Lr(s),g&512&&(Dn||h===null||Qa(h,h.return)),g&4){var N=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":N=E.getElementsByTagName("title")[0],(!N||N[$n]||N[ln]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=E.createElement(g),E.head.insertBefore(N,E.querySelector("head > title"))),ar(N,g,h),N[ln]=s,kn(N),g=N;break e;case"link":var O=fC("link","href",E).get(g+(h.href||""));if(O){for(var $=0;$<O.length;$++)if(N=O[$],N.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&N.getAttribute("rel")===(h.rel==null?null:h.rel)&&N.getAttribute("title")===(h.title==null?null:h.title)&&N.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){O.splice($,1);break t}}N=E.createElement(g),ar(N,g,h),E.head.appendChild(N);break;case"meta":if(O=fC("meta","content",E).get(g+(h.content||""))){for($=0;$<O.length;$++)if(N=O[$],N.getAttribute("content")===(h.content==null?null:""+h.content)&&N.getAttribute("name")===(h.name==null?null:h.name)&&N.getAttribute("property")===(h.property==null?null:h.property)&&N.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&N.getAttribute("charset")===(h.charSet==null?null:h.charSet)){O.splice($,1);break t}}N=E.createElement(g),ar(N,g,h),E.head.appendChild(N);break;default:throw Error(r(468,g))}N[ln]=s,kn(N),g=N}s.stateNode=g}else dC(E,s.type,s.stateNode);else s.stateNode=cC(E,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?dC(E,s.type,s.stateNode):cC(E,g,s.memoizedProps)):g===null&&s.stateNode!==null&&_g(s,s.memoizedProps,h.memoizedProps)}break;case 27:Or(u,s),Lr(s),g&512&&(Dn||h===null||Qa(h,h.return)),h!==null&&g&4&&_g(s,s.memoizedProps,h.memoizedProps);break;case 5:if(Or(u,s),Lr(s),g&512&&(Dn||h===null||Qa(h,h.return)),s.flags&32){E=s.stateNode;try{Ro(E,"")}catch(Ge){Ut(s,s.return,Ge)}}g&4&&s.stateNode!=null&&(E=s.memoizedProps,_g(s,E,h!==null?h.memoizedProps:E)),g&1024&&(zg=!0);break;case 6:if(Or(u,s),Lr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Ge){Ut(s,s.return,Ge)}}break;case 3:if($h=null,E=La,La=Hh(u.containerInfo),Or(u,s),La=E,Lr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{lu(u.containerInfo)}catch(Ge){Ut(s,s.return,Ge)}zg&&(zg=!1,d2(s));break;case 4:g=La,La=Hh(s.stateNode.containerInfo),Or(u,s),Lr(s),La=g;break;case 12:Or(u,s),Lr(s);break;case 31:Or(u,s),Lr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Rh(s,g)));break;case 13:Or(u,s),Lr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Mh=Pe()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Rh(s,g)));break;case 22:E=s.memoizedState!==null;var W=h!==null&&h.memoizedState!==null,ce=Ri,be=Dn;if(Ri=ce||E,Dn=be||W,Or(u,s),Dn=be,Ri=ce,Lr(s),g&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(h===null||W||Ri||Dn||Il(s)),h=null,u=s;;){if(u.tag===5||u.tag===26){if(h===null){W=h=u;try{if(N=W.stateNode,E)O=N.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(Ge){Ut(W,W.return,Ge)}}}else if(u.tag===6){if(h===null){W=u;try{W.stateNode.nodeValue=E?"":W.memoizedProps}catch(Ge){Ut(W,W.return,Ge)}}}else if(u.tag===18){if(h===null){W=u;try{var me=W.stateNode;E?tC(me,!0):tC(W.stateNode,!1)}catch(Ge){Ut(W,W.return,Ge)}}}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,Rh(s,h))));break;case 19:Or(u,s),Lr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Rh(s,g)));break;case 30:break;case 21:break;default:Or(u,s),Lr(s)}}function Lr(s){var u=s.flags;if(u&2){try{for(var h,g=s.return;g!==null;){if(r2(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var E=h.stateNode,N=Bg(s);Ah(s,N,E);break;case 5:var O=h.stateNode;h.flags&32&&(Ro(O,""),h.flags&=-33);var $=Bg(s);Ah(s,$,O);break;case 3:case 4:var W=h.stateNode.containerInfo,ce=Bg(s);Pg(s,ce,W);break;default:throw Error(r(161))}}catch(be){Ut(s,s.return,be)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function d2(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;d2(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Mi(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)s2(s,u.alternate,u),u=u.sibling}function Il(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:ws(4,u,u.return),Il(u);break;case 1:Qa(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&t2(u,u.return,h),Il(u);break;case 27:lf(u.stateNode);case 26:case 5:Qa(u,u.return),Il(u);break;case 22:u.memoizedState===null&&Il(u);break;case 30:Il(u);break;default:Il(u)}s=s.sibling}}function Oi(s,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,E=s,N=u,O=N.flags;switch(N.tag){case 0:case 11:case 15:Oi(E,N,h),Qc(4,N);break;case 1:if(Oi(E,N,h),g=N,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(ce){Ut(g,g.return,ce)}if(g=N,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++)VS(W[E],$)}catch(ce){Ut(g,g.return,ce)}}h&&O&64&&e2(N),Wc(N,N.return);break;case 27:a2(N);case 26:case 5:Oi(E,N,h),h&&g===null&&O&4&&n2(N),Wc(N,N.return);break;case 12:Oi(E,N,h);break;case 31:Oi(E,N,h),h&&O&4&&u2(E,N);break;case 13:Oi(E,N,h),h&&O&4&&c2(E,N);break;case 22:N.memoizedState===null&&Oi(E,N,h),Wc(N,N.return);break;case 30:break;default:Oi(E,N,h)}u=u.sibling}}function Ig(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&&Pc(h))}function Fg(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&Pc(s))}function _a(s,u,h,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)h2(s,u,h,g),u=u.sibling}function h2(s,u,h,g){var E=u.flags;switch(u.tag){case 0:case 11:case 15:_a(s,u,h,g),E&2048&&Qc(9,u);break;case 1:_a(s,u,h,g);break;case 3:_a(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&&Pc(s)));break;case 12:if(E&2048){_a(s,u,h,g),s=u.stateNode;try{var N=u.memoizedProps,O=N.id,$=N.onPostCommit;typeof $=="function"&&$(O,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(W){Ut(u,u.return,W)}}else _a(s,u,h,g);break;case 31:_a(s,u,h,g);break;case 13:_a(s,u,h,g);break;case 23:break;case 22:N=u.stateNode,O=u.alternate,u.memoizedState!==null?N._visibility&2?_a(s,u,h,g):Zc(s,u):N._visibility&2?_a(s,u,h,g):(N._visibility|=2,Qo(s,u,h,g,(u.subtreeFlags&10256)!==0||!1)),E&2048&&Ig(O,u);break;case 24:_a(s,u,h,g),E&2048&&Fg(u.alternate,u);break;default:_a(s,u,h,g)}}function Qo(s,u,h,g,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var N=s,O=u,$=h,W=g,ce=O.flags;switch(O.tag){case 0:case 11:case 15:Qo(N,O,$,W,E),Qc(8,O);break;case 23:break;case 22:var be=O.stateNode;O.memoizedState!==null?be._visibility&2?Qo(N,O,$,W,E):Zc(N,O):(be._visibility|=2,Qo(N,O,$,W,E)),E&&ce&2048&&Ig(O.alternate,O);break;case 24:Qo(N,O,$,W,E),E&&ce&2048&&Fg(O.alternate,O);break;default:Qo(N,O,$,W,E)}u=u.sibling}}function Zc(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:Zc(h,g),E&2048&&Ig(g.alternate,g);break;case 24:Zc(h,g),E&2048&&Fg(g.alternate,g);break;default:Zc(h,g)}u=u.sibling}}var Jc=8192;function Wo(s,u,h){if(s.subtreeFlags&Jc)for(s=s.child;s!==null;)v2(s,u,h),s=s.sibling}function v2(s,u,h){switch(s.tag){case 26:Wo(s,u,h),s.flags&Jc&&s.memoizedState!==null&&Y3(h,La,s.memoizedState,s.memoizedProps);break;case 5:Wo(s,u,h);break;case 3:case 4:var g=La;La=Hh(s.stateNode.containerInfo),Wo(s,u,h),La=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Jc,Jc=16777216,Wo(s,u,h),Jc=g):Wo(s,u,h));break;default:Wo(s,u,h)}}function p2(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 ef(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];Yn=g,g2(g,s)}p2(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)m2(s),s=s.sibling}function m2(s){switch(s.tag){case 0:case 11:case 15:ef(s),s.flags&2048&&ws(9,s,s.return);break;case 3:ef(s);break;case 12:ef(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,Dh(s)):ef(s);break;default:ef(s)}}function Dh(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];Yn=g,g2(g,s)}p2(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:ws(8,u,u.return),Dh(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,Dh(u));break;default:Dh(u)}s=s.sibling}}function g2(s,u){for(;Yn!==null;){var h=Yn;switch(h.tag){case 0:case 11:case 15:ws(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:Pc(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Yn=g;else e:for(h=s;Yn!==null;){g=Yn;var E=g.sibling,N=g.return;if(l2(g),g===h){Yn=null;break e}if(E!==null){E.return=N,Yn=E;break e}Yn=N}}}var u3={getCacheForType:function(s){var u=nr(jn),h=u.data.get(s);return h===void 0&&(h=s(),u.data.set(s,h)),h},cacheSignal:function(){return nr(jn).controller.signal}},c3=typeof WeakMap=="function"?WeakMap:Map,_t=0,Kt=null,wt=null,Tt=0,Ft=0,Wr=null,Ss=!1,Zo=!1,Ug=!1,Li=0,xn=0,Es=0,Fl=0,qg=0,Zr=0,Jo=0,tf=null,_r=null,Vg=!1,Mh=0,y2=0,Oh=1/0,Lh=null,Cs=null,Bn=0,Ts=null,eu=null,_i=0,Hg=0,Gg=null,x2=null,nf=0,$g=null;function Jr(){return(_t&2)!==0&&Tt!==0?Tt&-Tt:F.T!==null?Zg():hn()}function b2(){if(Zr===0)if((Tt&536870912)===0||kt){var s=Fe;Fe<<=1,(Fe&3932160)===0&&(Fe=262144),Zr=s}else Zr=536870912;return s=Xr.current,s!==null&&(s.flags|=32),Zr}function Br(s,u,h){(s===Kt&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)&&(tu(s,0),Ns(s,Tt,Zr,!1)),qt(s,h),((_t&2)===0||s!==Kt)&&(s===Kt&&((_t&2)===0&&(Fl|=h),xn===4&&Ns(s,Tt,Zr,!1)),Wa(s))}function w2(s,u,h){if((_t&6)!==0)throw Error(r(327));var g=!h&&(u&127)===0&&(u&s.expiredLanes)===0||He(s,u),E=g?h3(s,u):Yg(s,u,!0),N=g;do{if(E===0){Zo&&!g&&Ns(s,u,0,!1);break}else{if(h=s.current.alternate,N&&!f3(h)){E=Yg(s,u,!1),N=!1;continue}if(E===2){if(N=u,s.errorRecoveryDisabledLanes&N)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=tf;var W=$.current.memoizedState.isDehydrated;if(W&&(tu($,O).flags|=256),O=Yg($,O,!1),O!==2){if(Ug&&!W){$.errorRecoveryDisabledLanes|=N,Fl|=N,E=4;break e}N=_r,_r=E,N!==null&&(_r===null?_r=N:_r.push.apply(_r,N))}E=O}if(N=!1,E!==2)continue}}if(E===1){tu(s,0),Ns(s,u,0,!0);break}e:{switch(g=s,N=E,N){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Ns(g,u,Zr,!Ss);break e;case 2:_r=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=Mh+300-Pe(),10<E)){if(Ns(g,u,Zr,!Ss),ut(g,0,!0)!==0)break e;_i=u,g.timeoutHandle=Z2(S2.bind(null,g,h,_r,Lh,Vg,u,Zr,Fl,Jo,Ss,N,"Throttled",-0,0),E);break e}S2(g,h,_r,Lh,Vg,u,Zr,Fl,Jo,Ss,N,null,-0,0)}}break}while(!0);Wa(s)}function S2(s,u,h,g,E,N,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:bi},v2(u,N,Ee);var Ge=(N&62914560)===N?Mh-Pe():(N&4194048)===N?y2-Pe():0;if(Ge=X3(Ee,Ge),Ge!==null){_i=N,s.cancelPendingCommit=Ge(R2.bind(null,s,u,N,h,g,E,O,$,W,be,Ee,null,ve,me)),Ns(s,N,O,!ce);return}}R2(s,u,N,h,g,E,O,$,W)}function f3(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],N=E.getSnapshot;E=E.value;try{if(!Kr(N(),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 Ns(s,u,h,g){u&=~qg,u&=~Fl,s.suspendedLanes|=u,s.pingedLanes&=~u,g&&(s.warmLanes|=u),g=s.expirationTimes;for(var E=u;0<E;){var N=31-de(E),O=1<<N;g[N]=-1,E&=~O}h!==0&&dn(s,h,u)}function _h(){return(_t&6)===0?(rf(0),!1):!0}function Kg(){if(wt!==null){if(Ft===0)var s=wt.return;else s=wt,Ci=Dl=null,ug(s),Go=null,Ic=0,s=wt;for(;s!==null;)JE(s.alternate,s),s=s.return;wt=null}}function tu(s,u){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,D3(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),_i=0,Kg(),Kt=s,wt=h=Si(s.current,null),Tt=u,Ft=0,Wr=null,Ss=!1,Zo=He(s,u),Ug=!1,Jo=Zr=qg=Fl=Es=xn=0,_r=tf=null,Vg=!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),N=1<<E;u|=s[E],g&=~N}return Li=u,nh(),h}function E2(s,u){ht=null,F.H=Kc,u===Ho||u===ch?(u=IS(),Ft=3):u===Wm?(u=IS(),Ft=4):Ft=u===Tg?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Wr=u,wt===null&&(xn=1,Ch(s,va(u,s.current)))}function C2(){var s=Xr.current;return s===null?!0:(Tt&4194048)===Tt?ya===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?s===ya:!1}function T2(){var s=F.H;return F.H=Kc,s===null?Kc:s}function N2(){var s=F.A;return F.A=u3,s}function Bh(){xn=4,Ss||(Tt&4194048)!==Tt&&Xr.current!==null||(Zo=!0),(Es&134217727)===0&&(Fl&134217727)===0||Kt===null||Ns(Kt,Tt,Zr,!1)}function Yg(s,u,h){var g=_t;_t|=2;var E=T2(),N=N2();(Kt!==s||Tt!==u)&&(Lh=null,tu(s,u)),u=!1;var O=xn;e:do try{if(Ft!==0&&wt!==null){var $=wt,W=Wr;switch(Ft){case 8:Kg(),O=6;break e;case 3:case 2:case 9:case 6:Xr.current===null&&(u=!0);var ce=Ft;if(Ft=0,Wr=null,nu(s,$,W,ce),h&&Zo){O=0;break e}break;default:ce=Ft,Ft=0,Wr=null,nu(s,$,W,ce)}}d3(),O=xn;break}catch(be){E2(s,be)}while(!0);return u&&s.shellSuspendCounter++,Ci=Dl=null,_t=g,F.H=E,F.A=N,wt===null&&(Kt=null,Tt=0,nh()),O}function d3(){for(;wt!==null;)k2(wt)}function h3(s,u){var h=_t;_t|=2;var g=T2(),E=N2();Kt!==s||Tt!==u?(Lh=null,Oh=Pe()+500,tu(s,u)):Zo=He(s,u);e:do try{if(Ft!==0&&wt!==null){u=wt;var N=Wr;t:switch(Ft){case 1:Ft=0,Wr=null,nu(s,u,N,1);break;case 2:case 9:if(PS(N)){Ft=0,Wr=null,j2(u);break}u=function(){Ft!==2&&Ft!==9||Kt!==s||(Ft=7),Wa(s)},N.then(u,u);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:PS(N)?(Ft=0,Wr=null,j2(u)):(Ft=0,Wr=null,nu(s,u,N,7));break;case 5:var O=null;switch(wt.tag){case 26:O=wt.memoizedState;case 5:case 27:var $=wt;if(O?hC(O):$.stateNode.complete){Ft=0,Wr=null;var W=$.sibling;if(W!==null)wt=W;else{var ce=$.return;ce!==null?(wt=ce,Ph(ce)):wt=null}break t}}Ft=0,Wr=null,nu(s,u,N,5);break;case 6:Ft=0,Wr=null,nu(s,u,N,6);break;case 8:Kg(),xn=6;break e;default:throw Error(r(462))}}v3();break}catch(be){E2(s,be)}while(!0);return Ci=Dl=null,F.H=g,F.A=E,_t=h,wt!==null?0:(Kt=null,Tt=0,nh(),xn)}function v3(){for(;wt!==null&&!Xe();)k2(wt)}function k2(s){var u=WE(s.alternate,s,Li);s.memoizedProps=s.pendingProps,u===null?Ph(s):wt=u}function j2(s){var u=s,h=u.alternate;switch(u.tag){case 15:case 0:u=GE(h,u,u.pendingProps,u.type,void 0,Tt);break;case 11:u=GE(h,u,u.pendingProps,u.type.render,u.ref,Tt);break;case 5:ug(u);default:JE(h,u),u=wt=NS(u,Li),u=WE(h,u,Li)}s.memoizedProps=s.pendingProps,u===null?Ph(s):wt=u}function nu(s,u,h,g){Ci=Dl=null,ug(u),Go=null,Ic=0;var E=u.return;try{if(n3(s,E,u,h,Tt)){xn=1,Ch(s,va(h,s.current)),wt=null;return}}catch(N){if(E!==null)throw wt=E,N;xn=1,Ch(s,va(h,s.current)),wt=null;return}u.flags&32768?(kt||g===1?s=!0:Zo||(Tt&536870912)!==0?s=!1:(Ss=s=!0,(g===2||g===9||g===3||g===6)&&(g=Xr.current,g!==null&&g.tag===13&&(g.flags|=16384))),A2(u,s)):Ph(u)}function Ph(s){var u=s;do{if((u.flags&32768)!==0){A2(u,Ss);return}s=u.return;var h=i3(u.alternate,u,Li);if(h!==null){wt=h;return}if(u=u.sibling,u!==null){wt=u;return}wt=u=s}while(u!==null);xn===0&&(xn=5)}function A2(s,u){do{var h=s3(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);xn=6,wt=null}function R2(s,u,h,g,E,N,O,$,W){s.cancelPendingCommit=null;do zh();while(Bn!==0);if((_t&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(N=u.lanes|u.childLanes,N|=Bm,er(s,h,N,O,$,W),s===Kt&&(wt=Kt=null,Tt=0),eu=u,Ts=s,_i=h,Hg=N,Gg=E,x2=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,y3(De,function(){return _2(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=F.T,F.T=null,E=H.p,H.p=2,O=_t,_t|=4;try{l3(s,u,h)}finally{_t=O,H.p=E,F.T=g}}Bn=1,D2(),M2(),O2()}}function D2(){if(Bn===1){Bn=0;var s=Ts,u=eu,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=F.T,F.T=null;var g=H.p;H.p=2;var E=_t;_t|=4;try{f2(u,s);var N=sy,O=gS(s.containerInfo),$=N.focusedElem,W=N.selectionRange;if(O!==$&&$&&$.ownerDocument&&mS($.ownerDocument.documentElement,$)){if(W!==null&&Dm($)){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(),Ge=$.textContent.length,it=Math.min(W.start,Ge),Gt=W.end===void 0?it:Math.min(W.end,Ge);!me.extend&&it>Gt&&(O=Gt,Gt=it,it=O);var se=pS($,it),ee=pS($,Gt);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(),it>Gt?(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}}Qh=!!iy,sy=iy=null}finally{_t=E,H.p=g,F.T=h}}s.current=u,Bn=2}}function M2(){if(Bn===2){Bn=0;var s=Ts,u=eu,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=F.T,F.T=null;var g=H.p;H.p=2;var E=_t;_t|=4;try{s2(s,u.alternate,u)}finally{_t=E,H.p=g,F.T=h}}Bn=3}}function O2(){if(Bn===4||Bn===3){Bn=0,st();var s=Ts,u=eu,h=_i,g=x2;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Bn=5:(Bn=0,eu=Ts=null,L2(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(Cs=null),ua(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=F.T,E=H.p,H.p=2,F.T=null;try{for(var N=s.onRecoverableError,O=0;O<g.length;O++){var $=g[O];N($.value,{componentStack:$.stack})}}finally{F.T=u,H.p=E}}(_i&3)!==0&&zh(),Wa(s),E=s.pendingLanes,(h&261930)!==0&&(E&42)!==0?s===$g?nf++:(nf=0,$g=s):nf=0,rf(0)}}function L2(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,Pc(u)))}function zh(){return D2(),M2(),O2(),_2()}function _2(){if(Bn!==5)return!1;var s=Ts,u=Hg;Hg=0;var h=ua(_i),g=F.T,E=H.p;try{H.p=32>h?32:h,F.T=null,h=Gg,Gg=null;var N=Ts,O=_i;if(Bn=0,eu=Ts=null,_i=0,(_t&6)!==0)throw Error(r(331));var $=_t;if(_t|=4,m2(N.current),h2(N,N.current,O,h),_t=$,rf(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(K,N)}catch{}return!0}finally{H.p=E,F.T=g,L2(s,u)}}function B2(s,u,h){u=va(h,u),u=Cg(s.stateNode,u,2),s=ys(s,u,2),s!==null&&(qt(s,2),Wa(s))}function Ut(s,u,h){if(s.tag===3)B2(s,s,h);else for(;u!==null;){if(u.tag===3){B2(u,s,h);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Cs===null||!Cs.has(g))){s=va(h,s),h=PE(2),g=ys(u,h,2),g!==null&&(zE(h,g,u,s),qt(g,2),Wa(g));break}}u=u.return}}function Xg(s,u,h){var g=s.pingCache;if(g===null){g=s.pingCache=new c3;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)||(Ug=!0,E.add(h),s=p3.bind(null,s,u,h),u.then(s,s))}function p3(s,u,h){var g=s.pingCache;g!==null&&g.delete(u),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Kt===s&&(Tt&h)===h&&(xn===4||xn===3&&(Tt&62914560)===Tt&&300>Pe()-Mh?(_t&2)===0&&tu(s,0):qg|=h,Jo===Tt&&(Jo=0)),Wa(s)}function P2(s,u){u===0&&(u=vt()),s=jl(s,u),s!==null&&(qt(s,u),Wa(s))}function m3(s){var u=s.memoizedState,h=0;u!==null&&(h=u.retryLane),P2(s,h)}function g3(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),P2(s,h)}function y3(s,u){return Re(s,u)}var Ih=null,ru=null,Qg=!1,Fh=!1,Wg=!1,ks=0;function Wa(s){s!==ru&&s.next===null&&(ru===null?Ih=ru=s:ru=ru.next=s),Fh=!0,Qg||(Qg=!0,b3())}function rf(s,u){if(!Wg&&Fh){Wg=!0;do for(var h=!1,g=Ih;g!==null;){if(s!==0){var E=g.pendingLanes;if(E===0)var N=0;else{var O=g.suspendedLanes,$=g.pingedLanes;N=(1<<31-de(42|s)+1)-1,N&=E&~(O&~$),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,U2(g,N))}else N=Tt,N=ut(g,g===Kt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||He(g,N)||(h=!0,U2(g,N));g=g.next}while(h);Wg=!1}}function x3(){z2()}function z2(){Fh=Qg=!1;var s=0;ks!==0&&R3()&&(s=ks);for(var u=Pe(),h=null,g=Ih;g!==null;){var E=g.next,N=I2(g,u);N===0?(g.next=null,h===null?Ih=E:h.next=E,E===null&&(ru=h)):(h=g,(s!==0||(N&3)!==0)&&(Fh=!0)),g=E}Bn!==0&&Bn!==5||rf(s),ks!==0&&(ks=0)}function I2(s,u){for(var h=s.suspendedLanes,g=s.pingedLanes,E=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var O=31-de(N),$=1<<O,W=E[O];W===-1?(($&h)===0||($&g)!==0)&&(E[O]=xt($,u)):W<=u&&(s.expiredLanes|=$),N&=~$}if(u=Kt,h=Tt,h=ut(s,s===u?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===u&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ke(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||He(s,h)){if(u=h&-h,u===s.callbackPriority)return u;switch(g!==null&&Ke(g),ua(h)){case 2:case 8:h=Ce;break;case 32:h=De;break;case 268435456:h=Me;break;default:h=De}return g=F2.bind(null,s),h=Re(h,g),s.callbackPriority=u,s.callbackNode=h,u}return g!==null&&g!==null&&Ke(g),s.callbackPriority=2,s.callbackNode=null,2}function F2(s,u){if(Bn!==0&&Bn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(zh()&&s.callbackNode!==h)return null;var g=Tt;return g=ut(s,s===Kt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(w2(s,g,u),I2(s,Pe()),s.callbackNode!=null&&s.callbackNode===h?F2.bind(null,s):null)}function U2(s,u){if(zh())return null;w2(s,u,!0)}function b3(){M3(function(){(_t&6)!==0?Re(he,x3):z2()})}function Zg(){if(ks===0){var s=qo;s===0&&(s=$e,$e<<=1,($e&261888)===0&&($e=256)),ks=s}return ks}function q2(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Yd(""+s)}function V2(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 w3(s,u,h,g,E){if(u==="submit"&&h&&h.stateNode===E){var N=q2((E[_n]||null).action),O=g.submitter;O&&(u=(u=O[_n]||null)?q2(u.formAction):O.getAttribute("formAction"),u!==null&&(N=u,O=null));var $=new Zd("action","action",null,g,E);s.push({event:$,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ks!==0){var W=O?V2(E,O):new FormData(E);yg(h,{pending:!0,data:W,method:E.method,action:N},null,W)}}else typeof N=="function"&&($.preventDefault(),W=O?V2(E,O):new FormData(E),yg(h,{pending:!0,data:W,method:E.method,action:N},N,W))},currentTarget:E}]})}}for(var Jg=0;Jg<_m.length;Jg++){var ey=_m[Jg],S3=ey.toLowerCase(),E3=ey[0].toUpperCase()+ey.slice(1);Oa(S3,"on"+E3)}Oa(bS,"onAnimationEnd"),Oa(wS,"onAnimationIteration"),Oa(SS,"onAnimationStart"),Oa("dblclick","onDoubleClick"),Oa("focusin","onFocus"),Oa("focusout","onBlur"),Oa(I5,"onTransitionRun"),Oa(F5,"onTransitionStart"),Oa(U5,"onTransitionCancel"),Oa(ES,"onTransitionEnd"),Ka("onMouseEnter",["mouseout","mouseover"]),Ka("onMouseLeave",["mouseout","mouseover"]),Ka("onPointerEnter",["pointerout","pointerover"]),Ka("onPointerLeave",["pointerout","pointerover"]),$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$r("onBeforeInput",["compositionend","keypress","textInput","paste"]),$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var af="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(" "),C3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(af));function H2(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 N=void 0;if(u)for(var O=g.length-1;0<=O;O--){var $=g[O],W=$.instance,ce=$.currentTarget;if($=$.listener,W!==N&&E.isPropagationStopped())break e;N=$,E.currentTarget=ce;try{N(E)}catch(be){th(be)}E.currentTarget=null,N=W}else for(O=0;O<g.length;O++){if($=g[O],W=$.instance,ce=$.currentTarget,$=$.listener,W!==N&&E.isPropagationStopped())break e;N=$,E.currentTarget=ce;try{N(E)}catch(be){th(be)}E.currentTarget=null,N=W}}}}function St(s,u){var h=u[Hn];h===void 0&&(h=u[Hn]=new Set);var g=s+"__bubble";h.has(g)||(G2(u,s,2,!1),h.add(g))}function ty(s,u,h){var g=0;u&&(g|=4),G2(h,s,g,u)}var Uh="_reactListening"+Math.random().toString(36).slice(2);function ny(s){if(!s[Uh]){s[Uh]=!0,Vd.forEach(function(h){h!=="selectionchange"&&(C3.has(h)||ty(h,!1,s),ty(h,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Uh]||(u[Uh]=!0,ty("selectionchange",!1,u))}}function G2(s,u,h,g){switch(bC(u)){case 2:var E=Z3;break;case 8:E=J3;break;default:E=gy}h=E.bind(null,u,h,s),E=void 0,!Sm||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 ry(s,u,h,g,E){var N=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=ls($),O===null)return;if(W=O.tag,W===5||W===6||W===26||W===27){g=N=O;continue e}$=$.parentNode}}g=g.return}Qw(function(){var ce=N,be=bm(h),Ee=[];e:{var ve=CS.get(s);if(ve!==void 0){var me=Zd,Ge=s;switch(s){case"keypress":if(Qd(h)===0)break e;case"keydown":case"keyup":me=g5;break;case"focusin":Ge="focus",me=Nm;break;case"focusout":Ge="blur",me=Nm;break;case"beforeblur":case"afterblur":me=Nm;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=Jw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=i5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=b5;break;case bS:case wS:case SS:me=o5;break;case ES:me=S5;break;case"scroll":case"scrollend":me=r5;break;case"wheel":me=C5;break;case"copy":case"cut":case"paste":me=c5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=tS;break;case"toggle":case"beforetoggle":me=N5}var it=(u&4)!==0,Gt=!it&&(s==="scroll"||s==="scrollend"),se=it?ve!==null?ve+"Capture":null:ve;it=[];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=Nc(ee,se),Se!=null&&it.push(sf(ee,Se,ue))),Gt)break;ee=ee.return}0<it.length&&(ve=new me(ve,Ge,null,h,be),Ee.push({event:ve,listeners:it}))}}if((u&7)===0){e:{if(ve=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",ve&&h!==xm&&(Ge=h.relatedTarget||h.fromElement)&&(ls(Ge)||Ge[Ar]))break e;if((me||ve)&&(ve=be.window===be?be:(ve=be.ownerDocument)?ve.defaultView||ve.parentWindow:window,me?(Ge=h.relatedTarget||h.toElement,me=ce,Ge=Ge?ls(Ge):null,Ge!==null&&(Gt=i(Ge),it=Ge.tag,Ge!==Gt||it!==5&&it!==27&&it!==6)&&(Ge=null)):(me=null,Ge=ce),me!==Ge)){if(it=Jw,Se="onMouseLeave",se="onMouseEnter",ee="mouse",(s==="pointerout"||s==="pointerover")&&(it=tS,Se="onPointerLeave",se="onPointerEnter",ee="pointer"),Gt=me==null?ve:Cl(me),ue=Ge==null?ve:Cl(Ge),ve=new it(Se,ee+"leave",me,h,be),ve.target=Gt,ve.relatedTarget=ue,Se=null,ls(be)===ce&&(it=new it(se,ee+"enter",Ge,h,be),it.target=ue,it.relatedTarget=Gt,Se=it),Gt=Se,me&&Ge)t:{for(it=T3,se=me,ee=Ge,ue=0,Se=se;Se;Se=it(Se))ue++;Se=0;for(var nt=ee;nt;nt=it(nt))Se++;for(;0<ue-Se;)se=it(se),ue--;for(;0<Se-ue;)ee=it(ee),Se--;for(;ue--;){if(se===ee||ee!==null&&se===ee.alternate){it=se;break t}se=it(se),ee=it(ee)}it=null}else it=null;me!==null&&$2(Ee,ve,me,it,!1),Ge!==null&&Gt!==null&&$2(Ee,Gt,Ge,it,!0)}}e:{if(ve=ce?Cl(ce):window,me=ve.nodeName&&ve.nodeName.toLowerCase(),me==="select"||me==="input"&&ve.type==="file")var Mt=uS;else if(lS(ve))if(cS)Mt=B5;else{Mt=L5;var Ye=O5}else me=ve.nodeName,!me||me.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?ce&&ym(ce.elementType)&&(Mt=uS):Mt=_5;if(Mt&&(Mt=Mt(s,ce))){oS(Ee,Mt,h,be);break e}Ye&&Ye(s,ve,ce),s==="focusout"&&ce&&ve.type==="number"&&ce.memoizedProps.value!=null&&gm(ve,"number",ve.value)}switch(Ye=ce?Cl(ce):window,s){case"focusin":(lS(Ye)||Ye.contentEditable==="true")&&(Lo=Ye,Mm=ce,Lc=null);break;case"focusout":Lc=Mm=Lo=null;break;case"mousedown":Om=!0;break;case"contextmenu":case"mouseup":case"dragend":Om=!1,yS(Ee,h,be);break;case"selectionchange":if(z5)break;case"keydown":case"keyup":yS(Ee,h,be)}var pt;if(jm)e:{switch(s){case"compositionstart":var Nt="onCompositionStart";break e;case"compositionend":Nt="onCompositionEnd";break e;case"compositionupdate":Nt="onCompositionUpdate";break e}Nt=void 0}else Oo?iS(s,h)&&(Nt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(Nt="onCompositionStart");Nt&&(nS&&h.locale!=="ko"&&(Oo||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&Oo&&(pt=Ww()):(fs=be,Em="value"in fs?fs.value:fs.textContent,Oo=!0)),Ye=qh(ce,Nt),0<Ye.length&&(Nt=new eS(Nt,s,null,h,be),Ee.push({event:Nt,listeners:Ye}),pt?Nt.data=pt:(pt=sS(h),pt!==null&&(Nt.data=pt)))),(pt=j5?A5(s,h):R5(s,h))&&(Nt=qh(ce,"onBeforeInput"),0<Nt.length&&(Ye=new eS("onBeforeInput","beforeinput",null,h,be),Ee.push({event:Ye,listeners:Nt}),Ye.data=pt)),w3(Ee,s,ce,h,be)}H2(Ee,u)})}function sf(s,u,h){return{instance:s,listener:u,currentTarget:h}}function qh(s,u){for(var h=u+"Capture",g=[];s!==null;){var E=s,N=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||N===null||(E=Nc(s,h),E!=null&&g.unshift(sf(s,E,N)),E=Nc(s,u),E!=null&&g.push(sf(s,E,N))),s.tag===3)return g;s=s.return}return[]}function T3(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function $2(s,u,h,g,E){for(var N=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=Nc(h,N),ce!=null&&O.unshift(sf(h,ce,W))):E||(ce=Nc(h,N),ce!=null&&O.push(sf(h,ce,W)))),h=h.return}O.length!==0&&s.push({event:u,listeners:O})}var N3=/\r\n?/g,k3=/\u0000|\uFFFD/g;function K2(s){return(typeof s=="string"?s:""+s).replace(N3,`
|
|
49
|
+
`).replace(k3,"")}function Y2(s,u){return u=K2(u),K2(s)===u}function Ht(s,u,h,g,E,N){switch(h){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Ro(s,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Ro(s,""+g);break;case"className":cs(s,"class",g);break;case"tabIndex":cs(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":cs(s,h,g);break;case"style":Yw(s,g,N);break;case"data":if(u!=="object"){cs(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=Yd(""+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 N=="function"&&(h==="formAction"?(u!=="input"&&Ht(s,u,"name",E.name,E,null),Ht(s,u,"formEncType",E.formEncType,E,null),Ht(s,u,"formMethod",E.formMethod,E,null),Ht(s,u,"formTarget",E.formTarget,E,null)):(Ht(s,u,"encType",E.encType,E,null),Ht(s,u,"method",E.method,E,null),Ht(s,u,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Yd(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=bi);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=Yd(""+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),dr(s,"popover",g);break;case"xlinkActuate":fa(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":fa(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":fa(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":fa(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":fa(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":fa(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":fa(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":fa(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":fa(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":dr(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=t5.get(h)||h,dr(s,h,g))}}function ay(s,u,h,g,E,N){switch(h){case"style":Yw(s,g,N);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"?Ro(s,g):(typeof g=="number"||typeof g=="bigint")&&Ro(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=bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hd.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(E=h.endsWith("Capture"),u=h.slice(2,E?h.length-7:void 0),N=s[_n]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(u,N,E),typeof g=="function")){typeof N!="function"&&N!==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,""):dr(s,h,g)}}}function ar(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,N;for(N in h)if(h.hasOwnProperty(N)){var O=h[N];if(O!=null)switch(N){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,N,O,h,null)}}E&&Ht(s,u,"srcSet",h.srcSet,h,null),g&&Ht(s,u,"src",h.src,h,null);return;case"input":St("invalid",s);var $=N=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":N=be;break;case"defaultValue":$=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,u));break;default:Ht(s,u,g,be,h,null)}}Hw(s,N,$,W,ce,O,E,!1);return;case"select":St("invalid",s),g=O=N=null;for(E in h)if(h.hasOwnProperty(E)&&($=h[E],$!=null))switch(E){case"value":N=$;break;case"defaultValue":O=$;break;case"multiple":g=$;default:Ht(s,u,E,$,h,null)}u=N,h=O,s.multiple=!!g,u!=null?Ao(s,!!g,u,!1):h!=null&&Ao(s,!!g,h,!0);return;case"textarea":St("invalid",s),N=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":N=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:Ht(s,u,O,$,h,null)}$w(s,g,E,N);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:Ht(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<af.length;g++)St(af[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:Ht(s,u,ce,g,h,null)}return;default:if(ym(u)){for(be in h)h.hasOwnProperty(be)&&(g=h[be],g!==void 0&&ay(s,u,be,g,h,void 0));return}}for($ in h)h.hasOwnProperty($)&&(g=h[$],g!=null&&Ht(s,u,$,g,h,null))}function j3(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,N=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)||Ht(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":N=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&&Ht(s,u,ve,me,g,Ee)}}mm(s,O,$,W,ce,be,N,E);return;case"select":me=O=$=ve=null;for(N in h)if(W=h[N],h.hasOwnProperty(N)&&W!=null)switch(N){case"value":break;case"multiple":me=W;default:g.hasOwnProperty(N)||Ht(s,u,N,null,g,W)}for(E in g)if(N=g[E],W=h[E],g.hasOwnProperty(E)&&(N!=null||W!=null))switch(E){case"value":ve=N;break;case"defaultValue":$=N;break;case"multiple":O=N;default:N!==W&&Ht(s,u,E,N,g,W)}u=$,h=O,g=me,ve!=null?Ao(s,!!h,ve,!1):!!g!=!!h&&(u!=null?Ao(s,!!h,u,!0):Ao(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:Ht(s,u,$,null,g,E)}for(O in g)if(E=g[O],N=h[O],g.hasOwnProperty(O)&&(E!=null||N!=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!==N&&Ht(s,u,O,E,g,N)}Gw(s,ve,me);return;case"option":for(var Ge in h)if(ve=h[Ge],h.hasOwnProperty(Ge)&&ve!=null&&!g.hasOwnProperty(Ge))switch(Ge){case"selected":s.selected=!1;break;default:Ht(s,u,Ge,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:Ht(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 it in h)ve=h[it],h.hasOwnProperty(it)&&ve!=null&&!g.hasOwnProperty(it)&&Ht(s,u,it,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:Ht(s,u,ce,ve,g,me)}return;default:if(ym(u)){for(var Gt in h)ve=h[Gt],h.hasOwnProperty(Gt)&&ve!==void 0&&!g.hasOwnProperty(Gt)&&ay(s,u,Gt,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||ay(s,u,be,ve,g,me);return}}for(var se in h)ve=h[se],h.hasOwnProperty(se)&&ve!=null&&!g.hasOwnProperty(se)&&Ht(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||Ht(s,u,Ee,ve,g,me)}function X2(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A3(){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],N=E.transferSize,O=E.initiatorType,$=E.duration;if(N&&$&&X2(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&&X2(Ee)&&(W=W.responseEnd,O+=be*(W<$?1:($-ce)/(W-ce)))}if(--g,u+=8*(N+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 iy=null,sy=null;function Vh(s){return s.nodeType===9?s:s.ownerDocument}function Q2(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 W2(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 ly(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 oy=null;function R3(){var s=window.event;return s&&s.type==="popstate"?s===oy?!1:(oy=s,!0):(oy=null,!1)}var Z2=typeof setTimeout=="function"?setTimeout:void 0,D3=typeof clearTimeout=="function"?clearTimeout:void 0,J2=typeof Promise=="function"?Promise:void 0,M3=typeof queueMicrotask=="function"?queueMicrotask:typeof J2<"u"?function(s){return J2.resolve(null).then(s).catch(O3)}:Z2;function O3(s){setTimeout(function(){throw s})}function js(s){return s==="head"}function eC(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),lu(u);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")lf(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,lf(h);for(var N=h.firstChild;N;){var O=N.nextSibling,$=N.nodeName;N[$n]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=O}}else h==="body"&&lf(s.ownerDocument.body);h=E}while(h);lu(u)}function tC(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 uy(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":uy(h),ko(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function L3(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[$n])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==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(N=s.getAttribute("src"),(N!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var N=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=xa(s.nextSibling),s===null)break}return null}function _3(s,u,h){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=xa(s.nextSibling),s===null))return null;return s}function nC(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=xa(s.nextSibling),s===null))return null;return s}function cy(s){return s.data==="$?"||s.data==="$~"}function fy(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function B3(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 xa(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 dy=null;function rC(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(u===0)return xa(s.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}s=s.nextSibling}return null}function aC(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 iC(s,u,h){switch(u=Vh(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 lf(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);ko(s)}var ba=new Map,sC=new Set;function Hh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Bi=H.d;H.d={f:P3,r:z3,D:I3,C:F3,L:U3,m:q3,X:H3,S:V3,M:G3};function P3(){var s=Bi.f(),u=_h();return s||u}function z3(s){var u=os(s);u!==null&&u.tag===5&&u.type==="form"?EE(u):Bi.r(s)}var au=typeof document>"u"?null:document;function lC(s,u,h){var g=au;if(g&&typeof u=="string"&&u){var E=da(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof h=="string"&&(E+='[crossorigin="'+h+'"]'),sC.has(E)||(sC.add(E),s={rel:s,crossOrigin:h,href:u},g.querySelector(E)===null&&(u=g.createElement("link"),ar(u,"link",s),kn(u),g.head.appendChild(u)))}}function I3(s){Bi.D(s),lC("dns-prefetch",s,null)}function F3(s,u){Bi.C(s,u),lC("preconnect",s,u)}function U3(s,u,h){Bi.L(s,u,h);var g=au;if(g&&s&&u){var E='link[rel="preload"][as="'+da(u)+'"]';u==="image"&&h&&h.imageSrcSet?(E+='[imagesrcset="'+da(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(E+='[imagesizes="'+da(h.imageSizes)+'"]')):E+='[href="'+da(s)+'"]';var N=E;switch(u){case"style":N=iu(s);break;case"script":N=su(s)}ba.has(N)||(s=p({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:s,as:u},h),ba.set(N,s),g.querySelector(E)!==null||u==="style"&&g.querySelector(of(N))||u==="script"&&g.querySelector(uf(N))||(u=g.createElement("link"),ar(u,"link",s),kn(u),g.head.appendChild(u)))}}function q3(s,u){Bi.m(s,u);var h=au;if(h&&s){var g=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+da(g)+'"][href="'+da(s)+'"]',N=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=su(s)}if(!ba.has(N)&&(s=p({rel:"modulepreload",href:s},u),ba.set(N,s),h.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(uf(N)))return}g=h.createElement("link"),ar(g,"link",s),kn(g),h.head.appendChild(g)}}}function V3(s,u,h){Bi.S(s,u,h);var g=au;if(g&&s){var E=us(g).hoistableStyles,N=iu(s);u=u||"default";var O=E.get(N);if(!O){var $={loading:0,preload:null};if(O=g.querySelector(of(N)))$.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":u},h),(h=ba.get(N))&&hy(s,h);var W=O=g.createElement("link");kn(W),ar(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,Gh(O,u,g)}O={type:"stylesheet",instance:O,count:1,state:$},E.set(N,O)}}}function H3(s,u){Bi.X(s,u);var h=au;if(h&&s){var g=us(h).hoistableScripts,E=su(s),N=g.get(E);N||(N=h.querySelector(uf(E)),N||(s=p({src:s,async:!0},u),(u=ba.get(E))&&vy(s,u),N=h.createElement("script"),kn(N),ar(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(E,N))}}function G3(s,u){Bi.M(s,u);var h=au;if(h&&s){var g=us(h).hoistableScripts,E=su(s),N=g.get(E);N||(N=h.querySelector(uf(E)),N||(s=p({src:s,async:!0,type:"module"},u),(u=ba.get(E))&&vy(s,u),N=h.createElement("script"),kn(N),ar(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(E,N))}}function oC(s,u,h,g){var E=(E=oe.current)?Hh(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=iu(h.href),h=us(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=iu(h.href);var N=us(E).hoistableStyles,O=N.get(s);if(O||(E=E.ownerDocument||E,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,O),(N=E.querySelector(of(s)))&&!N._p&&(O.instance=N,O.state.loading=5),ba.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},ba.set(s,h),N||$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=su(h),h=us(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 iu(s){return'href="'+da(s)+'"'}function of(s){return'link[rel="stylesheet"]['+s+"]"}function uC(s){return p({},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}),ar(u,"link",h),kn(u),s.head.appendChild(u))}function su(s){return'[src="'+da(s)+'"]'}function uf(s){return"script[async]"+s}function cC(s,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var g=s.querySelector('style[data-href~="'+da(h.href)+'"]');if(g)return u.instance=g,kn(g),g;var E=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),kn(g),ar(g,"style",E),Gh(g,h.precedence,s),u.instance=g;case"stylesheet":E=iu(h.href);var N=s.querySelector(of(E));if(N)return u.state.loading|=4,u.instance=N,kn(N),N;g=uC(h),(E=ba.get(E))&&hy(g,E),N=(s.ownerDocument||s).createElement("link"),kn(N);var O=N;return O._p=new Promise(function($,W){O.onload=$,O.onerror=W}),ar(N,"link",g),u.state.loading|=4,Gh(N,h.precedence,s),u.instance=N;case"script":return N=su(h.src),(E=s.querySelector(uf(N)))?(u.instance=E,kn(E),E):(g=h,(E=ba.get(N))&&(g=p({},h),vy(g,E)),s=s.ownerDocument||s,E=s.createElement("script"),kn(E),ar(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,Gh(g,h.precedence,s));return u.instance}function Gh(s,u,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,N=E,O=0;O<g.length;O++){var $=g[O];if($.dataset.precedence===u)N=$;else if(N!==E)break}N?N.parentNode.insertBefore(s,N.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(s,u.firstChild))}function hy(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function vy(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var $h=null;function fC(s,u,h){if($h===null){var g=new Map,E=$h=new Map;E.set(h,g)}else E=$h,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 N=h[E];if(!(N[$n]||N[ln]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var O=N.getAttribute(u)||"";O=s+O;var $=g.get(O);$?$.push(N):g.set(O,[N])}}return g}function dC(s,u,h){s=s.ownerDocument||s,s.head.insertBefore(h,u==="title"?s.querySelector("head > title"):null)}function K3(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 hC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function Y3(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=iu(g.href),N=u.querySelector(of(E));if(N){u=N._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=Kh.bind(s),u.then(s,s)),h.state.loading|=4,h.instance=N,kn(N);return}N=u.ownerDocument||u,g=uC(g),(E=ba.get(E))&&hy(g,E),N=N.createElement("link"),kn(N);var O=N;O._p=new Promise(function($,W){O.onload=$,O.onerror=W}),ar(N,"link",g),h.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=Kh.bind(s),u.addEventListener("load",h),u.addEventListener("error",h))}}var py=0;function X3(s,u){return s.stylesheets&&s.count===0&&Xh(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&Xh(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+u);0<s.imgBytes&&py===0&&(py=62500*A3());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Xh(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>py?50:800)+u);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function Kh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Yh=null;function Xh(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Yh=new Map,u.forEach(Q3,s),Yh=null,Kh.call(s))}function Q3(s,u){if(!(u.state.loading&4)){var h=Yh.get(s);if(h)var g=h.get(null);else{h=new Map,Yh.set(s,h);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<E.length;N++){var O=E[N];(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"),N=h.get(O)||g,N===g&&h.set(null,E),h.set(O,E),this.count++,g=Kh.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),N?N.parentNode.insertBefore(E,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var cf={$$typeof:T,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function W3(s,u,h,g,E,N,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=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=N,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function vC(s,u,h,g,E,N,O,$,W,ce,be,Ee){return s=new W3(s,u,h,O,W,ce,be,Ee,$),u=1,N===!0&&(u|=24),N=Yr(3,null,null,u),s.current=N,N.stateNode=s,u=Ym(),u.refCount++,s.pooledCache=u,u.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:u},Zm(N),s}function pC(s){return s?(s=Po,s):Po}function mC(s,u,h,g,E,N){E=pC(E),g.context===null?g.context=E:g.pendingContext=E,g=gs(u),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=ys(s,g,u),h!==null&&(Br(h,s,u),Uc(h,s,u))}function gC(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<u?h:u}}function my(s,u){gC(s,u),(s=s.alternate)&&gC(s,u)}function yC(s){if(s.tag===13||s.tag===31){var u=jl(s,67108864);u!==null&&Br(u,s,67108864),my(s,67108864)}}function xC(s){if(s.tag===13||s.tag===31){var u=Jr();u=En(u);var h=jl(s,u);h!==null&&Br(h,s,u),my(s,u)}}var Qh=!0;function Z3(s,u,h,g){var E=F.T;F.T=null;var N=H.p;try{H.p=2,gy(s,u,h,g)}finally{H.p=N,F.T=E}}function J3(s,u,h,g){var E=F.T;F.T=null;var N=H.p;try{H.p=8,gy(s,u,h,g)}finally{H.p=N,F.T=E}}function gy(s,u,h,g){if(Qh){var E=yy(g);if(E===null)ry(s,u,g,Wh,h),wC(s,g);else if(t4(E,s,u,h,g))g.stopPropagation();else if(wC(s,g),u&4&&-1<e4.indexOf(s)){for(;E!==null;){var N=os(E);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var O=ot(N.pendingLanes);if(O!==0){var $=N;for($.pendingLanes|=2,$.entangledLanes|=2;O;){var W=1<<31-de(O);$.entanglements[1]|=W,O&=~W}Wa(N),(_t&6)===0&&(Oh=Pe()+500,rf(0))}}break;case 31:case 13:$=jl(N,2),$!==null&&Br($,N,2),_h(),my(N,2)}if(N=yy(g),N===null&&ry(s,u,g,Wh,h),N===E)break;E=N}E!==null&&g.stopPropagation()}else ry(s,u,g,null,h)}}function yy(s){return s=bm(s),xy(s)}var Wh=null;function xy(s){if(Wh=null,s=ls(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 Wh=s,null}function bC(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 Ie:return 32;case Me:return 268435456;default:return 32}default:return 32}}var by=!1,As=null,Rs=null,Ds=null,ff=new Map,df=new Map,Ms=[],e4="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 wC(s,u){switch(s){case"focusin":case"focusout":As=null;break;case"dragenter":case"dragleave":Rs=null;break;case"mouseover":case"mouseout":Ds=null;break;case"pointerover":case"pointerout":ff.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":df.delete(u.pointerId)}}function hf(s,u,h,g,E,N){return s===null||s.nativeEvent!==N?(s={blockedOn:u,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[E]},u!==null&&(u=os(u),u!==null&&yC(u)),s):(s.eventSystemFlags|=g,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function t4(s,u,h,g,E){switch(u){case"focusin":return As=hf(As,s,u,h,g,E),!0;case"dragenter":return Rs=hf(Rs,s,u,h,g,E),!0;case"mouseover":return Ds=hf(Ds,s,u,h,g,E),!0;case"pointerover":var N=E.pointerId;return ff.set(N,hf(ff.get(N)||null,s,u,h,g,E)),!0;case"gotpointercapture":return N=E.pointerId,df.set(N,hf(df.get(N)||null,s,u,h,g,E)),!0}return!1}function SC(s){var u=ls(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,ca(s.priority,function(){xC(h)});return}}else if(u===31){if(u=o(h),u!==null){s.blockedOn=u,ca(s.priority,function(){xC(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 Zh(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var h=yy(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);xm=g,h.target.dispatchEvent(g),xm=null}else return u=os(h),u!==null&&yC(u),s.blockedOn=h,!1;u.shift()}return!0}function EC(s,u,h){Zh(s)&&h.delete(u)}function n4(){by=!1,As!==null&&Zh(As)&&(As=null),Rs!==null&&Zh(Rs)&&(Rs=null),Ds!==null&&Zh(Ds)&&(Ds=null),ff.forEach(EC),df.forEach(EC)}function Jh(s,u){s.blockedOn===u&&(s.blockedOn=null,by||(by=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,n4)))}var ev=null;function CC(s){ev!==s&&(ev=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ev===s&&(ev=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(xy(g||h)===null)continue;break}var N=os(h);N!==null&&(s.splice(u,3),u-=3,yg(N,{pending:!0,data:E,method:h.method,action:g},g,E))}}))}function lu(s){function u(W){return Jh(W,s)}As!==null&&Jh(As,s),Rs!==null&&Jh(Rs,s),Ds!==null&&Jh(Ds,s),ff.forEach(u),df.forEach(u);for(var h=0;h<Ms.length;h++){var g=Ms[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Ms.length&&(h=Ms[0],h.blockedOn===null);)SC(h),h.blockedOn===null&&Ms.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var E=h[g],N=h[g+1],O=E[_n]||null;if(typeof N=="function")O||CC(h);else if(O){var $=null;if(N&&N.hasAttribute("formAction")){if(E=N,O=N[_n]||null)$=O.formAction;else if(xy(E)!==null)continue}else $=O.action;typeof $=="function"?h[g+1]=$:(h.splice(g,3),g-=3),CC(h)}}}function TC(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.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 N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.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 wy(s){this._internalRoot=s}tv.prototype.render=wy.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,g=Jr();mC(h,g,s,u,null,null)},tv.prototype.unmount=wy.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;mC(s.current,2,null,s,null,null),_h(),u[Ar]=null}};function tv(s){this._internalRoot=s}tv.prototype.unstable_scheduleHydration=function(s){if(s){var u=hn();s={blockedOn:null,target:s,priority:u};for(var h=0;h<Ms.length&&u!==0&&u<Ms[h].priority;h++);Ms.splice(h,0,s),h===0&&SC(s)}};var NC=t.version;if(NC!=="19.2.4")throw Error(r(527,NC,"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 r4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nv.isDisabled&&nv.supportsFiber)try{K=nv.inject(r4),le=nv}catch{}}return pf.createRoot=function(s,u){if(!a(s))throw Error(r(299));var h=!1,g="",E=OE,N=LE,O=_E;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&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),u=vC(s,1,!1,null,null,h,g,null,E,N,O,TC),s[Ar]=u.current,ny(s),new wy(u)},pf.hydrateRoot=function(s,u,h){if(!a(s))throw Error(r(299));var g=!1,E="",N=OE,O=LE,$=_E,W=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(O=h.onCaughtError),h.onRecoverableError!==void 0&&($=h.onRecoverableError),h.formState!==void 0&&(W=h.formState)),u=vC(s,1,!0,u,h??null,g,E,W,N,O,$,TC),u.context=pC(null),h=u.current,g=Jr(),g=En(g),E=gs(g),E.callback=null,ys(h,E,g),h=g,u.current.lanes=h,qt(u,h),Wa(u),s[Ar]=u.current,ny(s),new tv(u)},pf.version="19.2.4",pf}var PC;function h4(){if(PC)return Ty.exports;PC=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(),Ty.exports=d4(),Ty.exports}var v4=h4();const p4=vd(v4);var nc=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(){}},Wl,Vs,Pu,RA,m4=(RA=class extends nc{constructor(){super();et(this,Wl);et(this,Vs);et(this,Pu);_e(this,Pu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,Vs)||this.setEventListener(Z(this,Pu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Vs))==null||t.call(this),_e(this,Vs,void 0))}setEventListener(t){var n;_e(this,Pu,t),(n=Z(this,Vs))==null||n.call(this),_e(this,Vs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Wl)!==t&&(_e(this,Wl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Z(this,Wl)=="boolean"?Z(this,Wl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Wl=new WeakMap,Vs=new WeakMap,Pu=new WeakMap,RA),s1=new m4,g4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Hs,a1,DA,y4=(DA=class{constructor(){et(this,Hs,g4);et(this,a1,!1)}setTimeoutProvider(e){_e(this,Hs,e)}setTimeout(e,t){return Z(this,Hs).setTimeout(e,t)}clearTimeout(e){Z(this,Hs).clearTimeout(e)}setInterval(e,t){return Z(this,Hs).setInterval(e,t)}clearInterval(e){Z(this,Hs).clearInterval(e)}},Hs=new WeakMap,a1=new WeakMap,DA),Xl=new y4;function x4(e){setTimeout(e,0)}var b4=typeof window>"u"||"Deno"in globalThis;function Tr(){}function w4(e,t){return typeof e=="function"?e(t):e}function G0(e){return typeof e=="number"&&e>=0&&e!==1/0}function VA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tl(e,t){return typeof e=="function"?e(t):e}function Ca(e,t){return typeof e=="function"?e(t):e}function zC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==l1(l,t.options))return!1}else if(!$f(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 IC(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(uo(t.options.mutationKey)!==uo(i))return!1}else if(!$f(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function l1(e,t){return((t==null?void 0:t.queryKeyHashFn)||uo)(e)}function uo(e){return JSON.stringify(e,(t,n)=>$0(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function $f(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>$f(e[n],t[n])):!1}var S4=Object.prototype.hasOwnProperty;function HA(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=FC(e)&&FC(t);if(!r&&!($0(e)&&$0(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 p=r?d:l[d],m=e[p],y=t[p];if(m===y){f[p]=m,(r?d<i:S4.call(e,p))&&c++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[p]=y;continue}const x=HA(m,y,n+1);f[p]=x,x===m&&c++}return i===o&&c===i?e:f}function Qv(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 FC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $0(e){if(!UC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!UC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function UC(e){return Object.prototype.toString.call(e)==="[object Object]"}function E4(e){return new Promise(t=>{Xl.setTimeout(t,e)})}function K0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?HA(e,t):t}function C4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function T4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var o1=Symbol();function GA(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===o1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function u1(e,t){return typeof e=="function"?e(...t):!!e}function N4(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 Kf=(()=>{let e=()=>b4;return{isServer(){return e()},setIsServer(t){e=t}}})();function Y0(){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 k4=x4;function j4(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=k4;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=j4(),zu,Gs,Iu,MA,A4=(MA=class extends nc{constructor(){super();et(this,zu,!0);et(this,Gs);et(this,Iu);_e(this,Iu,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,Gs)||this.setEventListener(Z(this,Iu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Gs))==null||t.call(this),_e(this,Gs,void 0))}setEventListener(t){var n;_e(this,Iu,t),(n=Z(this,Gs))==null||n.call(this),_e(this,Gs,t(this.setOnline.bind(this)))}setOnline(t){Z(this,zu)!==t&&(_e(this,zu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,zu)}},zu=new WeakMap,Gs=new WeakMap,Iu=new WeakMap,MA),Wv=new A4;function R4(e){return Math.min(1e3*2**e,3e4)}function $A(e){return(e??"online")==="online"?Wv.isOnline():!0}var X0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function KA(e){let t=!1,n=0,r;const a=Y0(),i=()=>a.status!=="pending",l=b=>{var S;if(!i()){const w=new X0(b);m(w),(S=e.onCancel)==null||S.call(e,w)}},o=()=>{t=!0},f=()=>{t=!1},c=()=>s1.isFocused()&&(e.networkMode==="always"||Wv.isOnline())&&e.canRun(),d=()=>$A(e.networkMode)&&e.canRun(),p=b=>{i()||(r==null||r(),a.resolve(b))},m=b=>{i()||(r==null||r(),a.reject(b))},y=()=>new Promise(b=>{var S;r=w=>{(i()||c())&&b(w)},(S=e.onPause)==null||S.call(e)}).then(()=>{var b;r=void 0,i()||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(i())return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(w){b=Promise.reject(w)}Promise.resolve(b).then(p).catch(w=>{var A;if(i())return;const C=e.retry??(Kf.isServer()?0:3),T=e.retryDelay??R4,k=typeof T=="function"?T(n,w):T,R=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,w);if(t||!R){m(w);return}n++,(A=e.onFail)==null||A.call(e,n,w),E4(k).then(()=>c()?void 0:y()).then(()=>{t?m(w):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 Zl,OA,YA=(OA=class{constructor(){et(this,Zl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),G0(this.gcTime)&&_e(this,Zl,Xl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kf.isServer()?1/0:300*1e3))}clearGcTimeout(){Z(this,Zl)&&(Xl.clearTimeout(Z(this,Zl)),_e(this,Zl,void 0))}},Zl=new WeakMap,OA),Jl,Fu,Ea,eo,Xn,ud,to,ta,XA,Fi,LA,D4=(LA=class extends YA{constructor(t){super();et(this,ta);et(this,Jl);et(this,Fu);et(this,Ea);et(this,eo);et(this,Xn);et(this,ud);et(this,to);_e(this,to,!1),_e(this,ud,t.defaultOptions),this.setOptions(t.options),this.observers=[],_e(this,eo,t.client),_e(this,Ea,Z(this,eo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,_e(this,Jl,VC(this.options)),this.state=t.state??Z(this,Jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Z(this,Xn))==null?void 0:t.promise}setOptions(t){if(this.options={...Z(this,ud),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=VC(this.options);n.data!==void 0&&(this.setState(qC(n.data,n.dataUpdatedAt)),_e(this,Jl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,Ea).remove(this)}setData(t,n){const r=K0(this.state.data,t,this.options);return mt(this,ta,Fi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){mt(this,ta,Fi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=Z(this,Xn))==null?void 0:r.promise;return(a=Z(this,Xn))==null||a.cancel(t),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Z(this,Jl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ca(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===o1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>tl(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:!VA(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Xn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Xn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Z(this,Ea).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,Xn)&&(Z(this,to)||mt(this,ta,XA).call(this)?Z(this,Xn).cancel({revert:!0}):Z(this,Xn).cancelRetry()),this.scheduleGc()),Z(this,Ea).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mt(this,ta,Fi).call(this,{type:"invalidate"})}async fetch(t,n){var f,c,d,p,m,y,x,b,S,w,C,T;if(this.state.fetchStatus!=="idle"&&((f=Z(this,Xn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Xn))return Z(this,Xn).continueRetry(),Z(this,Xn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(R=>R.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,a=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(_e(this,to,!0),r.signal)})},i=()=>{const k=GA(this.options,n),A=(()=>{const D={client:Z(this,eo),queryKey:this.queryKey,meta:this.meta};return a(D),D})();return _e(this,to,!1),this.options.persister?this.options.persister(k,A,this):k(A)},o=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Z(this,eo),state:this.state,fetchFn:i};return a(k),k})();(c=this.options.behavior)==null||c.onFetch(o,this),_e(this,Fu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&mt(this,ta,Fi).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),_e(this,Xn,KA({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:k=>{k instanceof X0&&k.revert&&this.setState({...Z(this,Fu),fetchStatus:"idle"}),r.abort()},onFail:(k,R)=>{mt(this,ta,Fi).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{mt(this,ta,Fi).call(this,{type:"pause"})},onContinue:()=>{mt(this,ta,Fi).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const k=await Z(this,Xn).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(y=(m=Z(this,Ea).config).onSuccess)==null||y.call(m,k,this),(b=(x=Z(this,Ea).config).onSettled)==null||b.call(x,k,this.state.error,this),k}catch(k){if(k instanceof X0){if(k.silent)return Z(this,Xn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw mt(this,ta,Fi).call(this,{type:"error",error:k}),(w=(S=Z(this,Ea).config).onError)==null||w.call(S,k,this),(T=(C=Z(this,Ea).config).onSettled)==null||T.call(C,this.state.data,k,this),k}finally{this.scheduleGc()}}},Jl=new WeakMap,Fu=new WeakMap,Ea=new WeakMap,eo=new WeakMap,Xn=new WeakMap,ud=new WeakMap,to=new WeakMap,ta=new WeakSet,XA=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Fi=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,...QA(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...qC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return _e(this,Fu,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,Ea).notify({query:this,type:"updated",action:t})})},LA);function QA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$A(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VC(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 zr,jt,cd,Er,no,Uu,Vi,$s,fd,qu,Vu,ro,ao,Ks,Hu,It,Lf,Q0,W0,Z0,J0,eb,tb,nb,WA,_A,M4=(_A=class extends nc{constructor(t,n){super();et(this,It);et(this,zr);et(this,jt);et(this,cd);et(this,Er);et(this,no);et(this,Uu);et(this,Vi);et(this,$s);et(this,fd);et(this,qu);et(this,Vu);et(this,ro);et(this,ao);et(this,Ks);et(this,Hu,new Set);this.options=n,_e(this,zr,t),_e(this,$s,null),_e(this,Vi,Y0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,jt).addObserver(this),HC(Z(this,jt),this.options)?mt(this,It,Lf).call(this):this.updateResult(),mt(this,It,J0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rb(Z(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rb(Z(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mt(this,It,eb).call(this),mt(this,It,tb).call(this),Z(this,jt).removeObserver(this)}setOptions(t){const n=this.options,r=Z(this,jt);if(this.options=Z(this,zr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ca(this.options.enabled,Z(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mt(this,It,nb).call(this),Z(this,jt).setOptions(this.options),n._defaulted&&!Qv(this.options,n)&&Z(this,zr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,jt),observer:this});const a=this.hasListeners();a&&GC(Z(this,jt),r,this.options,n)&&mt(this,It,Lf).call(this),this.updateResult(),a&&(Z(this,jt)!==r||Ca(this.options.enabled,Z(this,jt))!==Ca(n.enabled,Z(this,jt))||tl(this.options.staleTime,Z(this,jt))!==tl(n.staleTime,Z(this,jt)))&&mt(this,It,Q0).call(this);const i=mt(this,It,W0).call(this);a&&(Z(this,jt)!==r||Ca(this.options.enabled,Z(this,jt))!==Ca(n.enabled,Z(this,jt))||i!==Z(this,Ks))&&mt(this,It,Z0).call(this,i)}getOptimisticResult(t){const n=Z(this,zr).getQueryCache().build(Z(this,zr),t),r=this.createResult(n,t);return L4(this,r)&&(_e(this,Er,r),_e(this,Uu,this.options),_e(this,no,Z(this,jt).state)),r}getCurrentResult(){return Z(this,Er)}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,Vi).status==="pending"&&Z(this,Vi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){Z(this,Hu).add(t)}getCurrentQuery(){return Z(this,jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,zr).defaultQueryOptions(t),r=Z(this,zr).getQueryCache().build(Z(this,zr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return mt(this,It,Lf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,Er)))}createResult(t,n){var P;const r=Z(this,jt),a=this.options,i=Z(this,Er),l=Z(this,no),o=Z(this,Uu),c=t!==r?t.state:Z(this,cd),{state:d}=t;let p={...d},m=!1,y;if(n._optimisticResults){const M=this.hasListeners(),_=!M&&HC(t,n),B=M&&GC(t,r,n,a);(_||B)&&(p={...p,...QA(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:S}=p;y=p.data;let w=!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,w=!0):M=typeof n.placeholderData=="function"?n.placeholderData((P=Z(this,Vu))==null?void 0:P.state.data,Z(this,Vu)):n.placeholderData,M!==void 0&&(S="success",y=K0(i==null?void 0:i.data,M,n),m=!0)}if(n.select&&y!==void 0&&!w)if(i&&y===(l==null?void 0:l.data)&&n.select===Z(this,fd))y=Z(this,qu);else try{_e(this,fd,n.select),y=n.select(y),y=K0(i==null?void 0:i.data,y,n),_e(this,qu,y),_e(this,$s,null)}catch(M){_e(this,$s,M)}Z(this,$s)&&(x=Z(this,$s),y=Z(this,qu),b=Date.now(),S="error");const C=p.fetchStatus==="fetching",T=S==="pending",k=S==="error",R=T&&C,A=y!==void 0,L={status:S,fetchStatus:p.fetchStatus,isPending:T,isSuccess:S==="success",isError:k,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:C,isRefetching:C&&!T,isLoadingError:k&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&A,isStale:c1(t,n),refetch:this.refetch,promise:Z(this,Vi),isEnabled:Ca(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=L.data!==void 0,_=L.status==="error"&&!M,B=G=>{_?G.reject(L.error):M&&G.resolve(L.data)},q=()=>{const G=_e(this,Vi,L.promise=Y0());B(G)},V=Z(this,Vi);switch(V.status){case"pending":t.queryHash===r.queryHash&&B(V);break;case"fulfilled":(_||L.data!==V.value)&&q();break;case"rejected":(!_||L.error!==V.reason)&&q();break}}return L}updateResult(){const t=Z(this,Er),n=this.createResult(Z(this,jt),this.options);if(_e(this,no,Z(this,jt).state),_e(this,Uu,this.options),Z(this,no).data!==void 0&&_e(this,Vu,Z(this,jt)),Qv(n,t))return;_e(this,Er,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!Z(this,Hu).size)return!0;const l=new Set(i??Z(this,Hu));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,Er)).some(o=>{const f=o;return Z(this,Er)[f]!==t[f]&&l.has(f)})};mt(this,It,WA).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mt(this,It,J0).call(this)}},zr=new WeakMap,jt=new WeakMap,cd=new WeakMap,Er=new WeakMap,no=new WeakMap,Uu=new WeakMap,Vi=new WeakMap,$s=new WeakMap,fd=new WeakMap,qu=new WeakMap,Vu=new WeakMap,ro=new WeakMap,ao=new WeakMap,Ks=new WeakMap,Hu=new WeakMap,It=new WeakSet,Lf=function(t){mt(this,It,nb).call(this);let n=Z(this,jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},Q0=function(){mt(this,It,eb).call(this);const t=tl(this.options.staleTime,Z(this,jt));if(Kf.isServer()||Z(this,Er).isStale||!G0(t))return;const r=VA(Z(this,Er).dataUpdatedAt,t)+1;_e(this,ro,Xl.setTimeout(()=>{Z(this,Er).isStale||this.updateResult()},r))},W0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,jt)):this.options.refetchInterval)??!1},Z0=function(t){mt(this,It,tb).call(this),_e(this,Ks,t),!(Kf.isServer()||Ca(this.options.enabled,Z(this,jt))===!1||!G0(Z(this,Ks))||Z(this,Ks)===0)&&_e(this,ao,Xl.setInterval(()=>{(this.options.refetchIntervalInBackground||s1.isFocused())&&mt(this,It,Lf).call(this)},Z(this,Ks)))},J0=function(){mt(this,It,Q0).call(this),mt(this,It,Z0).call(this,mt(this,It,W0).call(this))},eb=function(){Z(this,ro)&&(Xl.clearTimeout(Z(this,ro)),_e(this,ro,void 0))},tb=function(){Z(this,ao)&&(Xl.clearInterval(Z(this,ao)),_e(this,ao,void 0))},nb=function(){const t=Z(this,zr).getQueryCache().build(Z(this,zr),this.options);if(t===Z(this,jt))return;const n=Z(this,jt);_e(this,jt,t),_e(this,cd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},WA=function(t){zn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,Er))}),Z(this,zr).getQueryCache().notify({query:Z(this,jt),type:"observerResultsUpdated"})})},_A);function O4(e,t){return Ca(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function HC(e,t){return O4(e,t)||e.state.data!==void 0&&rb(e,t,t.refetchOnMount)}function rb(e,t,n){if(Ca(t.enabled,e)!==!1&&tl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&c1(e,t)}return!1}function GC(e,t,n,r){return(e!==t||Ca(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&c1(e,n)}function c1(e,t){return Ca(t.enabled,e)!==!1&&e.isStaleByTime(tl(t.staleTime,e))}function L4(e,t){return!Qv(e.getCurrentResult(),t)}function $C(e){return{onFetch:(t,n)=>{var d,p,m,y,x;const r=t.options,a=(m=(p=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:p.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 b=!1;const S=T=>{N4(T,()=>t.signal,()=>b=!0)},w=GA(t.options,t.fetchOptions),C=async(T,k,R)=>{if(b)return Promise.reject();if(k==null&&T.pages.length)return Promise.resolve(T);const D=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:k,direction:R?"backward":"forward",meta:t.options.meta};return S(_),_})(),L=await w(D),{maxPages:P}=t.options,M=R?T4:C4;return{pages:M(T.pages,L,P),pageParams:M(T.pageParams,k,P)}};if(a&&i.length){const T=a==="backward",k=T?_4:KC,R={pages:i,pageParams:l},A=k(r,R);o=await C(R,A,T)}else{const T=e??i.length;do{const k=f===0?l[0]??r.initialPageParam:KC(r,o);if(f>0&&k==null)break;o=await C(o,k),f++}while(f<T)}return o};t.options.persister?t.fetchFn=()=>{var b,S;return(S=(b=t.options).persister)==null?void 0:S.call(b,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function KC(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 _4(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 dd,ri,vr,io,ai,Fs,BA,B4=(BA=class extends YA{constructor(t){super();et(this,ai);et(this,dd);et(this,ri);et(this,vr);et(this,io);_e(this,dd,t.client),this.mutationId=t.mutationId,_e(this,vr,t.mutationCache),_e(this,ri,[]),this.state=t.state||ZA(),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,ri).includes(t)||(Z(this,ri).push(t),this.clearGcTimeout(),Z(this,vr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){_e(this,ri,Z(this,ri).filter(n=>n!==t)),this.scheduleGc(),Z(this,vr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,ri).length||(this.state.status==="pending"?this.scheduleGc():Z(this,vr).remove(this))}continue(){var t;return((t=Z(this,io))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,f,c,d,p,m,y,x,b,S,w,C,T,k,R,A,D;const n=()=>{mt(this,ai,Fs).call(this,{type:"continue"})},r={client:Z(this,dd),meta:this.options.meta,mutationKey:this.options.mutationKey};_e(this,io,KA({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,P)=>{mt(this,ai,Fs).call(this,{type:"failed",failureCount:L,error:P})},onPause:()=>{mt(this,ai,Fs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,vr).canRun(this)}));const a=this.state.status==="pending",i=!Z(this,io).canStart();try{if(a)n();else{mt(this,ai,Fs).call(this,{type:"pending",variables:t,isPaused:i}),Z(this,vr).config.onMutate&&await Z(this,vr).config.onMutate(t,this,r);const P=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));P!==this.state.context&&mt(this,ai,Fs).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const L=await Z(this,io).start();return await((c=(f=Z(this,vr).config).onSuccess)==null?void 0:c.call(f,L,t,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,L,t,this.state.context,r)),await((y=(m=Z(this,vr).config).onSettled)==null?void 0:y.call(m,L,null,this.state.variables,this.state.context,this,r)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,L,null,t,this.state.context,r)),mt(this,ai,Fs).call(this,{type:"success",data:L}),L}catch(L){try{await((w=(S=Z(this,vr).config).onError)==null?void 0:w.call(S,L,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((T=(C=this.options).onError)==null?void 0:T.call(C,L,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((R=(k=Z(this,vr).config).onSettled)==null?void 0:R.call(k,void 0,L,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((D=(A=this.options).onSettled)==null?void 0:D.call(A,void 0,L,t,this.state.context,r))}catch(P){Promise.reject(P)}throw mt(this,ai,Fs).call(this,{type:"error",error:L}),L}finally{Z(this,vr).runNext(this)}}},dd=new WeakMap,ri=new WeakMap,vr=new WeakMap,io=new WeakMap,ai=new WeakSet,Fs=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,ri).forEach(r=>{r.onMutationUpdate(t)}),Z(this,vr).notify({mutation:this,type:"updated",action:t})})},BA);function ZA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hi,Pa,hd,PA,P4=(PA=class extends nc{constructor(t={}){super();et(this,Hi);et(this,Pa);et(this,hd);this.config=t,_e(this,Hi,new Set),_e(this,Pa,new Map),_e(this,hd,0)}build(t,n,r){const a=new B4({client:t,mutationCache:this,mutationId:++rv(this,hd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){Z(this,Hi).add(t);const n=av(t);if(typeof n=="string"){const r=Z(this,Pa).get(n);r?r.push(t):Z(this,Pa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Z(this,Hi).delete(t)){const n=av(t);if(typeof n=="string"){const r=Z(this,Pa).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,Pa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=av(t);if(typeof n=="string"){const r=Z(this,Pa).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=av(t);if(typeof n=="string"){const a=(r=Z(this,Pa).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,Hi).forEach(t=>{this.notify({type:"removed",mutation:t})}),Z(this,Hi).clear(),Z(this,Pa).clear()})}getAll(){return Array.from(Z(this,Hi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>IC(n,r))}findAll(t={}){return this.getAll().filter(n=>IC(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(Tr))))}},Hi=new WeakMap,Pa=new WeakMap,hd=new WeakMap,PA);function av(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Gi,Ys,Ir,$i,Yi,Mv,ab,zA,z4=(zA=class extends nc{constructor(n,r){super();et(this,Yi);et(this,Gi);et(this,Ys);et(this,Ir);et(this,$i);_e(this,Gi,n),this.setOptions(r),this.bindMethods(),mt(this,Yi,Mv).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,Gi).defaultMutationOptions(n),Qv(this.options,r)||Z(this,Gi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Z(this,Ir),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&uo(r.mutationKey)!==uo(this.options.mutationKey)?this.reset():((a=Z(this,Ir))==null?void 0:a.state.status)==="pending"&&Z(this,Ir).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Z(this,Ir))==null||n.removeObserver(this)}onMutationUpdate(n){mt(this,Yi,Mv).call(this),mt(this,Yi,ab).call(this,n)}getCurrentResult(){return Z(this,Ys)}reset(){var n;(n=Z(this,Ir))==null||n.removeObserver(this),_e(this,Ir,void 0),mt(this,Yi,Mv).call(this),mt(this,Yi,ab).call(this)}mutate(n,r){var a;return _e(this,$i,r),(a=Z(this,Ir))==null||a.removeObserver(this),_e(this,Ir,Z(this,Gi).getMutationCache().build(Z(this,Gi),this.options)),Z(this,Ir).addObserver(this),Z(this,Ir).execute(n)}},Gi=new WeakMap,Ys=new WeakMap,Ir=new WeakMap,$i=new WeakMap,Yi=new WeakSet,Mv=function(){var r;const n=((r=Z(this,Ir))==null?void 0:r.state)??ZA();_e(this,Ys,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ab=function(n){zn.batch(()=>{var r,a,i,l,o,f,c,d;if(Z(this,$i)&&this.hasListeners()){const p=Z(this,Ys).variables,m=Z(this,Ys).context,y={client:Z(this,Gi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=Z(this,$i)).onSuccess)==null||a.call(r,n.data,p,m,y)}catch(x){Promise.reject(x)}try{(l=(i=Z(this,$i)).onSettled)==null||l.call(i,n.data,null,p,m,y)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(o=Z(this,$i)).onError)==null||f.call(o,n.error,p,m,y)}catch(x){Promise.reject(x)}try{(d=(c=Z(this,$i)).onSettled)==null||d.call(c,void 0,n.error,p,m,y)}catch(x){Promise.reject(x)}}}this.listeners.forEach(p=>{p(Z(this,Ys))})})},zA),ii,IA,I4=(IA=class extends nc{constructor(t={}){super();et(this,ii);this.config=t,_e(this,ii,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??l1(a,n);let l=this.get(i);return l||(l=new D4({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){Z(this,ii).has(t.queryHash)||(Z(this,ii).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,ii).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,ii).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,ii).get(t)}getAll(){return[...Z(this,ii).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>zC(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()})})}},ii=new WeakMap,IA),bn,Xs,Qs,Gu,$u,Ws,Ku,Yu,FA,F4=(FA=class{constructor(e={}){et(this,bn);et(this,Xs);et(this,Qs);et(this,Gu);et(this,$u);et(this,Ws);et(this,Ku);et(this,Yu);_e(this,bn,e.queryCache||new I4),_e(this,Xs,e.mutationCache||new P4),_e(this,Qs,e.defaultOptions||{}),_e(this,Gu,new Map),_e(this,$u,new Map),_e(this,Ws,0)}mount(){rv(this,Ws)._++,Z(this,Ws)===1&&(_e(this,Ku,s1.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,bn).onFocus())})),_e(this,Yu,Wv.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,bn).onOnline())})))}unmount(){var e,t;rv(this,Ws)._--,Z(this,Ws)===0&&((e=Z(this,Ku))==null||e.call(this),_e(this,Ku,void 0),(t=Z(this,Yu))==null||t.call(this),_e(this,Yu,void 0))}isFetching(e){return Z(this,bn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,Xs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,bn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Z(this,bn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(tl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Z(this,bn).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,bn).get(r.queryHash),i=a==null?void 0:a.state.data,l=w4(t,i);if(l!==void 0)return Z(this,bn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return zn.batch(()=>Z(this,bn).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,bn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Z(this,bn);zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,bn);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,bn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e,t={}){return zn.batch(()=>(Z(this,bn).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,bn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Tr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,bn).build(this,t);return n.isStaleByTime(tl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tr).catch(Tr)}fetchInfiniteQuery(e){return e.behavior=$C(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}ensureInfiniteQueryData(e){return e.behavior=$C(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Wv.isOnline()?Z(this,Xs).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,bn)}getMutationCache(){return Z(this,Xs)}getDefaultOptions(){return Z(this,Qs)}setDefaultOptions(e){_e(this,Qs,e)}setQueryDefaults(e,t){Z(this,Gu).set(uo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,Gu).values()],n={};return t.forEach(r=>{$f(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Z(this,$u).set(uo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,$u).values()],n={};return t.forEach(r=>{$f(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Z(this,Qs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=l1(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===o1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,Qs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,bn).clear(),Z(this,Xs).clear()}},bn=new WeakMap,Xs=new WeakMap,Qs=new WeakMap,Gu=new WeakMap,$u=new WeakMap,Ws=new WeakMap,Ku=new WeakMap,Yu=new WeakMap,FA),JA=j.createContext(void 0),xr=e=>{const t=j.useContext(JA);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},U4=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(JA.Provider,{value:e,children:t})),eR=j.createContext(!1),q4=()=>j.useContext(eR);eR.Provider;function V4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var H4=j.createContext(V4()),G4=()=>j.useContext(H4),$4=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?u1(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},K4=e=>{j.useEffect(()=>{e.clearReset()},[e])},Y4=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||u1(n,[e.error,r])),X4=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))}},Q4=(e,t)=>e.isLoading&&e.isFetching&&!t,W4=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,YC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Z4(e,t,n){var m,y,x,b;const r=q4(),a=G4(),i=xr(),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",X4(l),$4(l,a,o),K4(a);const f=!i.getQueryCache().get(l.queryHash),[c]=j.useState(()=>new t(i,l)),d=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(S=>{const w=p?c.subscribe(zn.batchCalls(S)):Tr;return c.updateResult(),w},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),j.useEffect(()=>{c.setOptions(l)},[l,c]),W4(l,d))throw YC(l,c,a);if(Y4({result:d,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw d.error;if((b=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||b.call(x,l,d),l.experimental_prefetchInRender&&!Kf.isServer()&&Q4(d,r)){const S=f?YC(l,c,a):o==null?void 0:o.promise;S==null||S.catch(Tr).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?d:c.trackResult(d)}function cn(e,t){return Z4(e,M4)}function la(e,t){const n=xr(),[r]=j.useState(()=>new z4(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(Tr)},[r]);if(a.error&&u1(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 XC="popstate";function QC(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function J4(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 ib("",{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:Yf(a)}return tB(t,n,null,e)}function pn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function di(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eB(){return Math.random().toString(36).substring(2,10)}function WC(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 ib(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?rc(t):t,state:n,key:t&&t.key||r||eB(),unstable_mask:a}}function Yf({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 rc(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 tB(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 p(){o="POP";let S=d(),w=S==null?null:S-c;c=S,f&&f({action:o,location:b.location,delta:w})}function m(S,w){o="PUSH";let C=QC(S)?S:ib(b.location,S,w);c=d()+1;let T=WC(C,c),k=b.createHref(C.unstable_mask||C);try{l.pushState(T,"",k)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;a.location.assign(k)}i&&f&&f({action:o,location:b.location,delta:1})}function y(S,w){o="REPLACE";let C=QC(S)?S:ib(b.location,S,w);c=d();let T=WC(C,c),k=b.createHref(C.unstable_mask||C);l.replaceState(T,"",k),i&&f&&f({action:o,location:b.location,delta:0})}function x(S){return nB(S)}let b={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(XC,p),f=S,()=>{a.removeEventListener(XC,p),f=null}},createHref(S){return t(a,S)},createURL:x,encodeLocation(S){let w=x(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:y,go(S){return l.go(S)}};return b}function nB(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),pn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Yf(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function tR(e,t,n="/"){return rB(e,t,n,!1)}function rB(e,t,n,r){let a=typeof t=="string"?rc(t):t,i=Xi(a.pathname||"/",n);if(i==null)return null;let l=nR(e);aB(l);let o=null;for(let f=0;o==null&&f<l.length;++f){let c=pB(i);o=hB(l[f],c,r)}return o}function nR(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;pn(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 p=ui([r,d.relativePath]),m=n.concat(d);l.children&&l.children.length>0&&(pn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),nR(l.children,t,m,p,f)),!(l.path==null&&!l.index)&&t.push({path:p,score:fB(p,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 rR(l.path))i(l,o,!0,c)}),t}function rR(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=rR(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 aB(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dB(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var iB=/^:[\w-]+$/,sB=3,lB=2,oB=1,uB=10,cB=-2,ZC=e=>e==="*";function fB(e,t){let n=e.split("/"),r=n.length;return n.some(ZC)&&(r+=cB),t&&(r+=lB),n.filter(a=>!ZC(a)).reduce((a,i)=>a+(iB.test(i)?sB:i===""?oB:uB),r)}function dB(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 hB(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)||"/",p=Zv({path:f.relativePath,caseSensitive:f.caseSensitive,end:c},d),m=f.route;if(!p&&c&&n&&!r[r.length-1].route.index&&(p=Zv({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},d)),!p)return null;Object.assign(a,p.params),l.push({params:a,pathname:ui([i,p.pathname]),pathnameBase:xB(ui([i,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(i=ui([i,p.pathnameBase]))}return l}function Zv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=vB(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:p},m)=>{if(d==="*"){let x=o[m]||"";l=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const y=o[m];return p&&!y?c[d]=void 0:c[d]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:l,pattern:e}}function vB(e,t=!1,n=!0){di(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 p=d.charAt(c+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 pB(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return di(!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 Xi(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 mB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function gB(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?rc(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=JC(n.substring(1),"/"):i=JC(n,t)):i=t,{pathname:i,search:bB(r),hash:wB(a)}}function JC(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 Ay(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 yB(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aR(e){let t=yB(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function f1(e,t,n,r=!1){let a;typeof e=="string"?a=rc(e):(a={...e},pn(!a.pathname||!a.pathname.includes("?"),Ay("?","pathname","search",a)),pn(!a.pathname||!a.pathname.includes("#"),Ay("#","pathname","hash",a)),pn(!a.search||!a.search.includes("#"),Ay("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,o;if(l==null)o=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),p-=1;a.pathname=m.join("/")}o=p>=0?t[p]:"/"}let f=gB(a,o),c=l&&l!=="/"&&l.endsWith("/"),d=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(c||d)&&(f.pathname+="/"),f}var ui=e=>e.join("/").replace(/\/\/+/g,"/"),xB=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bB=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wB=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,SB=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 EB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function CB(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var iR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sR(e,t){let n=e;if(typeof n!="string"||!mB.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(iR)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),o=Xi(l.pathname,t);l.origin===i.origin&&o!=null?n=o+l.search+l.hash:a=!0}catch{di(!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 lR=["POST","PUT","PATCH","DELETE"];new Set(lR);var TB=["GET",...lR];new Set(TB);var ac=j.createContext(null);ac.displayName="DataRouter";var Tp=j.createContext(null);Tp.displayName="DataRouterState";var NB=j.createContext(!1),oR=j.createContext({isTransitioning:!1});oR.displayName="ViewTransition";var kB=j.createContext(new Map);kB.displayName="Fetchers";var jB=j.createContext(null);jB.displayName="Await";var Da=j.createContext(null);Da.displayName="Navigation";var pd=j.createContext(null);pd.displayName="Location";var Ga=j.createContext({outlet:null,matches:[],isDataRoute:!1});Ga.displayName="Route";var d1=j.createContext(null);d1.displayName="RouteError";var uR="REACT_ROUTER_ERROR",AB="REDIRECT",RB="ROUTE_ERROR_RESPONSE";function DB(e){if(e.startsWith(`${uR}:${AB}:{`))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 MB(e){if(e.startsWith(`${uR}:${RB}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new SB(t.status,t.statusText,t.data)}catch{}}function OB(e,{relative:t}={}){pn(md(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=j.useContext(Da),{hash:a,pathname:i,search:l}=gd(e,{relative:t}),o=i;return n!=="/"&&(o=i==="/"?n:ui([n,i])),r.createHref({pathname:o,search:l,hash:a})}function md(){return j.useContext(pd)!=null}function es(){return pn(md(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(pd).location}var cR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fR(e){j.useContext(Da).static||j.useLayoutEffect(e)}function ts(){let{isDataRoute:e}=j.useContext(Ga);return e?XB():LB()}function LB(){pn(md(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(ac),{basename:t,navigator:n}=j.useContext(Da),{matches:r}=j.useContext(Ga),{pathname:a}=es(),i=JSON.stringify(aR(r)),l=j.useRef(!1);return fR(()=>{l.current=!0}),j.useCallback((f,c={})=>{if(di(l.current,cR),!l.current)return;if(typeof f=="number"){n.go(f);return}let d=f1(f,JSON.parse(i),a,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:ui([t,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[t,n,i,a,e])}var _B=j.createContext(null);function BB(e){let t=j.useContext(Ga).outlet;return j.useMemo(()=>t&&j.createElement(_B.Provider,{value:e},t),[t,e])}function PB(){let{matches:e}=j.useContext(Ga),t=e[e.length-1];return t?t.params:{}}function gd(e,{relative:t}={}){let{matches:n}=j.useContext(Ga),{pathname:r}=es(),a=JSON.stringify(aR(n));return j.useMemo(()=>f1(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function zB(e,t){return dR(e,t)}function dR(e,t,n){var S;pn(md(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=j.useContext(Da),{matches:a}=j.useContext(Ga),i=a[a.length-1],l=i?i.params:{},o=i?i.pathname:"/",f=i?i.pathnameBase:"/",c=i&&i.route;{let w=c&&c.path||"";vR(o,!c||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${w}">) 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="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let d=es(),p;if(t){let w=typeof t=="string"?rc(t):t;pn(f==="/"||((S=w.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 "${w.pathname}" was given in the \`location\` prop.`),p=w}else p=d;let m=p.pathname||"/",y=m;if(f!=="/"){let w=f.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let x=tR(e,{pathname:y});di(c||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),di(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 "${p.pathname}${p.search}${p.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 b=VB(x&&x.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:ui([f,r.encodeLocation?r.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:ui([f,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),a,n);return t&&b?j.createElement(pd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},b):b}function IB(){let e=YB(),t=EB(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 FB=j.createElement(IB,null),hR=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=MB(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Ga.Provider,{value:this.props.routeContext},j.createElement(d1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(UB,{error:e},t):t}};hR.contextType=NB;var Ry=new WeakMap;function UB({children:e,error:t}){let{basename:n}=j.useContext(Da);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=DB(t.digest);if(r){let a=Ry.get(t);if(a)throw a;let i=sR(r.location,n);if(iR&&!Ry.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 Ry.set(t,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function qB({routeContext:e,match:t,children:n}){let r=j.useContext(ac);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Ga.Provider,{value:e},n)}function VB(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(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);pn(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 p=a[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(o=d),p.route.id){let{loaderData:m,errors:y}=r,x=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.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,p)=>{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:CB(r.matches),errorInfo:p})}:void 0;return a.reduceRight((d,p,m)=>{let y,x=!1,b=null,S=null;r&&(y=i&&p.route.id?i[p.route.id]:void 0,b=p.route.errorElement||FB,l&&(o<0&&m===0?(vR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):o===m&&(x=!0,S=p.route.hydrateFallbackElement||null)));let w=t.concat(a.slice(0,m+1)),C=()=>{let T;return y?T=b:x?T=S:p.route.Component?T=j.createElement(p.route.Component,null):p.route.element?T=p.route.element:T=d,j.createElement(qB,{match:p,routeContext:{outlet:d,matches:w,isDataRoute:r!=null},children:T})};return r&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?j.createElement(hR,{location:r.location,revalidation:r.revalidation,component:b,error:y,children:C(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:c}):C()},null)}function h1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function HB(e){let t=j.useContext(ac);return pn(t,h1(e)),t}function GB(e){let t=j.useContext(Tp);return pn(t,h1(e)),t}function $B(e){let t=j.useContext(Ga);return pn(t,h1(e)),t}function v1(e){let t=$B(e),n=t.matches[t.matches.length-1];return pn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function KB(){return v1("useRouteId")}function YB(){var r;let e=j.useContext(d1),t=GB("useRouteError"),n=v1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function XB(){let{router:e}=HB("useNavigate"),t=v1("useNavigate"),n=j.useRef(!1);return fR(()=>{n.current=!0}),j.useCallback(async(a,i={})=>{di(n.current,cR),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var eT={};function vR(e,t,n){!t&&!eT[e]&&(eT[e]=!0,di(!1,n))}j.memo(QB);function QB({routes:e,future:t,state:n,isStatic:r,onError:a}){return dR(e,void 0,{state:n,isStatic:r,onError:a})}function WB(e){return BB(e.context)}function wa(e){pn(!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 ZB({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:l}){pn(!md(),"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=rc(n));let{pathname:c="/",search:d="",hash:p="",state:m=null,key:y="default",unstable_mask:x}=n,b=j.useMemo(()=>{let S=Xi(c,o);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:y,unstable_mask:x},navigationType:r}},[o,c,d,p,m,y,r,x]);return di(b!=null,`<Router basename="${o}"> is not able to match the URL "${c}${d}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:j.createElement(Da.Provider,{value:f},j.createElement(pd.Provider,{children:t,value:b}))}function JB({children:e,location:t}){return zB(sb(e),t)}function sb(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,sb(r.props.children,i));return}pn(r.type===wa,`[${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>`),pn(!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=sb(r.props.children,i)),n.push(l)}),n}var Ov="get",Lv="application/x-www-form-urlencoded";function Np(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function eP(e){return Np(e)&&e.tagName.toLowerCase()==="button"}function tP(e){return Np(e)&&e.tagName.toLowerCase()==="form"}function nP(e){return Np(e)&&e.tagName.toLowerCase()==="input"}function rP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aP(e,t){return e.button===0&&(!t||t==="_self")&&!rP(e)}var iv=null;function iP(){if(iv===null)try{new FormData(document.createElement("form"),0),iv=!1}catch{iv=!0}return iv}var sP=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Dy(e){return e!=null&&!sP.has(e)?(di(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lv}"`),null):e}function lP(e,t){let n,r,a,i,l;if(tP(e)){let o=e.getAttribute("action");r=o?Xi(o,t):null,n=e.getAttribute("method")||Ov,a=Dy(e.getAttribute("enctype"))||Lv,i=new FormData(e)}else if(eP(e)||nP(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?Xi(f,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Ov,a=Dy(e.getAttribute("formenctype"))||Dy(o.getAttribute("enctype"))||Lv,i=new FormData(o,e),!iP()){let{name:c,type:d,value:p}=e;if(d==="image"){let m=c?`${c}.`:"";i.append(`${m}x`,"0"),i.append(`${m}y`,"0")}else c&&i.append(c,p)}}else{if(Np(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ov,r=null,a=Lv,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 p1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oP(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&&Xi(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function uP(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 cP(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 fP(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await uP(i,n);return l.links?l.links():[]}return[]}));return pP(r.flat(1).filter(cP).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function tT(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 p;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:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function dP(e,t,{includeHydrateFallback:n}={}){return hP(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 hP(e){return[...new Set(e)]}function vP(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function pP(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(vP(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function pR(){let e=j.useContext(ac);return p1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function mP(){let e=j.useContext(Tp);return p1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var m1=j.createContext(void 0);m1.displayName="FrameworkContext";function mR(){let e=j.useContext(m1);return p1(e,"You must render this element inside a <HydratedRouter> element"),e}function gP(e,t){let n=j.useContext(m1),[r,a]=j.useState(!1),[i,l]=j.useState(!1),{onFocus:o,onBlur:f,onMouseEnter:c,onMouseLeave:d,onTouchStart:p}=t,m=j.useRef(null);j.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=w=>{w.forEach(C=>{l(C.isIntersecting)})},S=new IntersectionObserver(b,{threshold:.5});return m.current&&S.observe(m.current),()=>{S.disconnect()}}},[e]),j.useEffect(()=>{if(r){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[r]);let y=()=>{a(!0)},x=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,m,{}]:[i,m,{onFocus:mf(o,y),onBlur:mf(f,x),onMouseEnter:mf(c,y),onMouseLeave:mf(d,x),onTouchStart:mf(p,y)}]:[!1,m,{}]}function mf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yP({page:e,...t}){let{router:n}=pR(),r=j.useMemo(()=>tR(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?j.createElement(bP,{page:e,matches:r,...t}):null}function xP(e){let{manifest:t,routeModules:n}=mR(),[r,a]=j.useState([]);return j.useEffect(()=>{let i=!1;return fP(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function bP({page:e,matches:t,...n}){let r=es(),{future:a,manifest:i,routeModules:l}=mR(),{basename:o}=pR(),{loaderData:f,matches:c}=mP(),d=j.useMemo(()=>tT(e,t,c,i,r,"data"),[e,t,c,i,r]),p=j.useMemo(()=>tT(e,t,c,i,r,"assets"),[e,t,c,i,r]),m=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,S=!1;if(t.forEach(C=>{var k;let T=i.routes[C.route.id];!T||!T.hasLoader||(!d.some(R=>R.route.id===C.route.id)&&C.route.id in f&&((k=l[C.route.id])!=null&&k.shouldRevalidate)||T.hasClientLoader?S=!0:b.add(C.route.id))}),b.size===0)return[];let w=oP(e,o,a.unstable_trailingSlashAwareDataRequests,"data");return S&&b.size>0&&w.searchParams.set("_routes",t.filter(C=>b.has(C.route.id)).map(C=>C.route.id).join(",")),[w.pathname+w.search]},[o,a.unstable_trailingSlashAwareDataRequests,f,r,i,d,t,e,l]),y=j.useMemo(()=>dP(p,i),[p,i]),x=xP(p);return j.createElement(j.Fragment,null,m.map(b=>j.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),y.map(b=>j.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),x.map(({key:b,link:S})=>j.createElement("link",{key:b,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function wP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var SP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{SP&&(window.__reactRouterVersion="7.13.1")}catch{}function EP({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=j.useRef();a.current==null&&(a.current=J4({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(ZB,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var gR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ja=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:p,viewTransition:m,unstable_defaultShouldRevalidate:y,...x},b){let{basename:S,navigator:w,unstable_useTransitions:C}=j.useContext(Da),T=typeof d=="string"&&gR.test(d),k=sR(d,S);d=k.to;let R=OB(d,{relative:a}),A=es(),D=null;if(o){let G=f1(o,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(G.pathname=G.pathname==="/"?S:ui([S,G.pathname])),D=w.createHref(G)}let[L,P,M]=gP(r,x),_=NP(d,{replace:l,unstable_mask:o,state:f,target:c,preventScrollReset:p,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:y,unstable_useTransitions:C});function B(G){t&&t(G),G.defaultPrevented||_(G)}let q=!(k.isExternal||i),V=j.createElement("a",{...x,...M,href:(q?D:void 0)||k.absoluteURL||R,onClick:q?B:t,ref:wP(b,P),target:c,"data-discover":!T&&n==="render"?"true":void 0});return L&&!T?j.createElement(j.Fragment,null,V,j.createElement(yP,{page:R})):V});ja.displayName="Link";var g1=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 p=gd(l,{relative:c.relative}),m=es(),y=j.useContext(Tp),{navigator:x,basename:b}=j.useContext(Da),S=y!=null&&DP(p)&&o===!0,w=x.encodeLocation?x.encodeLocation(p).pathname:p.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,w=w.toLowerCase()),T&&b&&(T=Xi(T,b)||T);const k=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let R=C===w||!a&&C.startsWith(w)&&C.charAt(k)==="/",A=T!=null&&(T===w||!a&&T.startsWith(w)&&T.charAt(w.length)==="/"),D={isActive:R,isPending:A,isTransitioning:S},L=R?t:void 0,P;typeof r=="function"?P=r(D):P=[r,R?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(D):i;return j.createElement(ja,{...c,"aria-current":L,className:P,ref:d,style:M,to:l,viewTransition:o},typeof f=="function"?f(D):f)});g1.displayName="NavLink";var CP=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=Ov,action:o,onSubmit:f,relative:c,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},x)=>{let{unstable_useTransitions:b}=j.useContext(Da),S=AP(),w=RP(o,{relative:c}),C=l.toLowerCase()==="get"?"get":"post",T=typeof o=="string"&&gR.test(o),k=R=>{if(f&&f(R),R.defaultPrevented)return;R.preventDefault();let A=R.nativeEvent.submitter,D=(A==null?void 0:A.getAttribute("formmethod"))||l,L=()=>S(A||R.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:a,state:i,relative:c,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:m});b&&n!==!1?j.startTransition(()=>L()):L()};return j.createElement("form",{ref:x,method:C,action:w,onSubmit:r?f:k,...y,"data-discover":!T&&e==="render"?"true":void 0})});CP.displayName="Form";function TP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yR(e){let t=j.useContext(ac);return pn(t,TP(e)),t}function NP(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f,unstable_useTransitions:c}={}){let d=ts(),p=es(),m=gd(e,{relative:l});return j.useCallback(y=>{if(aP(y,t)){y.preventDefault();let x=n!==void 0?n:Yf(p)===Yf(m),b=()=>d(e,{replace:x,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f});c?j.startTransition(()=>b()):b()}},[p,d,m,n,r,a,t,e,i,l,o,f,c])}var kP=0,jP=()=>`__${String(++kP)}__`;function AP(){let{router:e}=yR("useSubmit"),{basename:t}=j.useContext(Da),n=KB(),r=e.fetch,a=e.navigate;return j.useCallback(async(i,l={})=>{let{action:o,method:f,encType:c,formData:d,body:p}=lP(i,t);if(l.navigate===!1){let m=l.fetcherKey||jP();await r(m,n,l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,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:p,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 RP(e,{relative:t}={}){let{basename:n}=j.useContext(Da),r=j.useContext(Ga);pn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...gd(e||".",{relative:t})},l=es();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(p=>p).forEach(p=>o.append("index",p));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:ui([n,i.pathname])),Yf(i)}function DP(e,{relative:t}={}){let n=j.useContext(oR);pn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=yR("useViewTransitionState"),a=gd(e,{relative:t});if(!n.isTransitioning)return!1;let i=Xi(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Xi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Zv(a.pathname,l)!=null||Zv(a.pathname,i)!=null}var yd=qA();const MP=vd(yd),xR="myco-ui-theme",OP="system",nT="light",bR="(prefers-color-scheme: dark)",wR=j.createContext(void 0);function LP(){const e=localStorage.getItem(xR);return e==="light"||e==="dark"||e==="system"?e:OP}function rT(e){const t=document.documentElement;e==="light"||e==="system"&&!window.matchMedia(bR).matches?t.classList.add(nT):t.classList.remove(nT)}function _P({children:e}){const[t,n]=j.useState(LP),r=a=>{localStorage.setItem(xR,a),n(a)};return j.useEffect(()=>{rT(t)},[t]),j.useEffect(()=>{if(t!=="system")return;const a=window.matchMedia(bR),i=()=>rT("system");return a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[t]),v.jsx(wR.Provider,{value:{theme:t,setTheme:r},children:e})}function BP(){const e=j.useContext(wR);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}const SR="myco-ui-font",PP="default",ER={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"}},zP=new Set(Object.keys(ER)),CR=j.createContext(void 0);function IP(){const e=localStorage.getItem(SR);return e&&zP.has(e)?e:PP}function FP(e){const t=ER[e],n=document.documentElement.style;n.setProperty("--font-heading",t.heading),n.setProperty("--font-ui",t.ui),n.setProperty("--font-data",t.data)}function UP({children:e}){const[t,n]=j.useState(IP),r=a=>{localStorage.setItem(SR,a),n(a)};return j.useEffect(()=>{FP(t)},[t]),v.jsx(CR.Provider,{value:{font:t,setFont:r},children:e})}function qP(){const e=j.useContext(CR);if(!e)throw new Error("useFont must be used within a FontProvider");return e}const aT=6e4,VP=3e5,HP=200,iT={active:1,idle:2,deep_sleep:5,hidden:10},sT=["mousemove","mousedown","keydown","scroll","touchstart"],TR=j.createContext(void 0);function GP({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")},VP-aT)},aT)},[l]),f=j.useCallback(()=>{const d=Date.now();d-i.current<HP||(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 sT)document.addEventListener(d,f,{passive:!0});return document.addEventListener("visibilitychange",c),()=>{l();for(const d of sT)document.removeEventListener(d,f);document.removeEventListener("visibilitychange",c)}},[f,c,o,l]),v.jsx(TR.Provider,{value:{powerState:t},children:e})}function $P(){const e=j.useContext(TR);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 KP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),NR=(...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 YP={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 XP=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,...YP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:NR("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 qe=(e,t)=>{const n=j.forwardRef(({className:r,...a},i)=>j.createElement(XP,{ref:i,iconNode:t,className:NR(`lucide-${KP(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 lb=qe("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 QP=qe("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 ci=qe("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 ob=qe("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 WP=qe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
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 xd=qe("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"}]]);/**
|
|
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 bd=qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 Ua=qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 y1=qe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 sa=qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 ZP=qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 oa=qe("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"}]]);/**
|
|
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 lT=qe("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
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 kR=qe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
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 x1=qe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 JP=qe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
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 wd=qe("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"}]]);/**
|
|
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 ez=qe("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"}]]);/**
|
|
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 jR=qe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 tz=qe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
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 AR=qe("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"}]]);/**
|
|
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 b1=qe("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"}]]);/**
|
|
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 nz=qe("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"}]]);/**
|
|
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 Sd=qe("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"}]]);/**
|
|
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 rz=qe("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"}]]);/**
|
|
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 az=qe("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"}]]);/**
|
|
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 iz=qe("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"}]]);/**
|
|
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 sz=qe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
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 lz=qe("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"}]]);/**
|
|
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 oz=qe("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"}]]);/**
|
|
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 uz=qe("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"}]]);/**
|
|
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 cz=qe("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"}]]);/**
|
|
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 fz=qe("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"}]]);/**
|
|
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 dz=qe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
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 Wn=qe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 hz=qe("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"}]]);/**
|
|
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 kp=qe("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"}]]);/**
|
|
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 vz=qe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
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 RR=qe("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"}]]);/**
|
|
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 pz=qe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 mz=qe("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"}]]);/**
|
|
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 gz=qe("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"}]]);/**
|
|
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 Xu=qe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 yz=qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 DR=qe("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"}]]);/**
|
|
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 Qu=qe("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"}]]);/**
|
|
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 w1=qe("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"}]]);/**
|
|
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 MR=qe("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"}]]);/**
|
|
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 ic=qe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 xz=qe("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"}]]);/**
|
|
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 bz=qe("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"}]]);/**
|
|
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 wz=qe("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"}]]);/**
|
|
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 Sz=qe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
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 S1=qe("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"}]]);/**
|
|
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 Ez=qe("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"}]]);/**
|
|
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 Cz=qe("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"}]]);/**
|
|
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 Tz=qe("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"}]]);/**
|
|
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 co=qe("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"}]]);/**
|
|
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 Nz=qe("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"}]]);/**
|
|
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 kz=qe("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"}]]);/**
|
|
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 jz=qe("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"}]]);/**
|
|
386
|
+
* @license lucide-react v0.460.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const OR=qe("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"}]]);/**
|
|
391
|
+
* @license lucide-react v0.460.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const Az=qe("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"}]]);/**
|
|
396
|
+
* @license lucide-react v0.460.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const LR=qe("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"}]]);/**
|
|
401
|
+
* @license lucide-react v0.460.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const sc=qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
406
|
+
* @license lucide-react v0.460.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const Rz=qe("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"}]]),Dz=6e4,Mz=3e4;function Oz(e,t,n){if(t==="heartbeat"){const r=e*iT[n];return n==="hidden"?Math.min(r,Dz):n==="deep_sleep"?Math.min(r,Mz):r}return n==="deep_sleep"||n==="hidden"?!1:e*iT[n]}function Ma(e){const t=$P(),{pollCategory:n,refetchInterval:r,...a}=e,i=Oz(r,n,t);return cn({...a,refetchInterval:i})}const Lz="/api";async function dt(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(`${Lz}${e}`,{...t,headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new _z(i.status,o)}return i.json()}async function sr(e,t){return dt(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function lc(e,t){return dt(e,{method:"PUT",body:JSON.stringify(t)})}async function E1(e){return dt(e,{method:"DELETE"})}class _z extends Error{constructor(t,n){super(`API error ${t}`),this.status=t,this.body=n}}const Hr={HEALTH:5e3,STATS:1e4,LOGS:3e3,UPDATE:3e5},Bz=1e4,Pz=["debug","info","warn","error"],Jv={debug:0,info:1,warn:2,error:3},zz="built-in",C1="user",qr=50,ub=5,_R=5e3,BR=3;function PR(e){switch(e){case"info":return"default";case"warn":return"warning";case"error":return"destructive";default:return"secondary"}}function T1(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"}}const N1=["update-status"];function zR(){return Ma({queryKey:[...N1],queryFn:({signal:e})=>dt("/update/status",{signal:e}),refetchInterval:Hr.UPDATE,pollCategory:"standard"})}function Iz(){const e=xr();return la({mutationFn:()=>sr("/update/check"),onSuccess:()=>{e.invalidateQueries({queryKey:[...N1]})}})}function Fz(){return la({mutationFn:()=>sr("/update/apply")})}function Uz(){const e=xr();return la({mutationFn:t=>lc("/update/channel",{channel:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[...N1]})}})}function jp(){return Ma({queryKey:["daemon-stats"],queryFn:({signal:e})=>dt("/stats",{signal:e}),refetchInterval:Hr.STATS,pollCategory:"standard"})}const My=500,qz=3e4;function k1(){const[e,t]=j.useState(!1),n=j.useRef(null);return{restart:j.useCallback(async(a=!1)=>{t(!0);try{const i=await sr("/restart",{force:a});if(i.status==="busy")return t(!1),i;const l=Date.now()+qz;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,My)}catch{setTimeout(c,My)}};setTimeout(c,My)}),window.location.reload()}catch(i){throw t(!1),i}},[]),isRestarting:e}}function IR(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=IR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function FR(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=IR(e))&&(r&&(r+=" "),r+=t);return r}const oT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,uT=FR,Ap=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return uT(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],p=i==null?void 0:i[c];if(d===null)return null;const m=oT(d)||oT(p);return a[c][m]}),o=n&&Object.entries(n).reduce((c,d)=>{let[p,m]=d;return m===void 0||(c[p]=m),c},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:p,className:m,...y}=d;return Object.entries(y).every(x=>{let[b,S]=x;return Array.isArray(S)?S.includes({...i,...o}[b]):{...i,...o}[b]===S})?[...c,p,m]:c},[]);return uT(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},j1="-",Vz=e=>{const t=Gz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const o=l.split(j1);return o[0]===""&&o.length!==1&&o.shift(),UR(o,t)||Hz(l)},getConflictingClassGroupIds:(l,o)=>{const f=n[l]||[];return o&&r[l]?[...f,...r[l]]:f}}},UR=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?UR(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(j1);return(l=t.validators.find(({validator:o})=>o(i)))==null?void 0:l.classGroupId},cT=/^\[(.+)\]$/,Hz=e=>{if(cT.test(e)){const t=cT.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Gz=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Kz(Object.entries(e.classGroups),n).forEach(([i,l])=>{cb(l,r,i,t)}),r},cb=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:fT(t,a);i.classGroupId=n;return}if(typeof a=="function"){if($z(a)){cb(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{cb(l,fT(t,i),n,r)})})},fT=(e,t)=>{let n=e;return t.split(j1).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$z=e=>e.isThemeGetter,Kz=(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,Yz=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)}}},qR="!",Xz=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,p;for(let S=0;S<o.length;S++){let w=o[S];if(c===0){if(w===a&&(r||o.slice(S,S+i)===t)){f.push(o.slice(d,S)),d=S+i;continue}if(w==="/"){p=S;continue}}w==="["?c++:w==="]"&&c--}const m=f.length===0?o:o.substring(d),y=m.startsWith(qR),x=y?m.substring(1):m,b=p&&p>d?p-d:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:b}};return n?o=>n({className:o,parseClassName:l}):l},Qz=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},Wz=e=>({cache:Yz(e.cacheSize),parseClassName:Xz(e),...Vz(e)}),Zz=/\s+/,Jz=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],l=e.trim().split(Zz);let o="";for(let f=l.length-1;f>=0;f-=1){const c=l[f],{modifiers:d,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}=n(c);let x=!!y,b=r(x?m.substring(0,y):m);if(!b){if(!x){o=c+(o.length>0?" "+o:o);continue}if(b=r(m),!b){o=c+(o.length>0?" "+o:o);continue}x=!1}const S=Qz(d).join(":"),w=p?S+qR:S,C=w+b;if(i.includes(C))continue;i.push(C);const T=a(b,x);for(let k=0;k<T.length;++k){const R=T[k];i.push(w+R)}o=c+(o.length>0?" "+o:o)}return o};function eI(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=VR(t))&&(r&&(r+=" "),r+=n);return r}const VR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=VR(e[r]))&&(n&&(n+=" "),n+=t);return n};function tI(e,...t){let n,r,a,i=l;function l(f){const c=t.reduce((d,p)=>p(d),e());return n=Wz(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=Jz(f,n);return a(f,d),d}return function(){return i(eI.apply(null,arguments))}}const rn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},HR=/^\[(?:([a-z-]+):)?(.+)\]$/i,nI=/^\d+\/\d+$/,rI=new Set(["px","full","screen"]),aI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iI=/\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$/,sI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pi=e=>ju(e)||rI.has(e)||nI.test(e),Ls=e=>oc(e,"length",mI),ju=e=>!!e&&!Number.isNaN(Number(e)),Oy=e=>oc(e,"number",ju),gf=e=>!!e&&Number.isInteger(Number(e)),uI=e=>e.endsWith("%")&&ju(e.slice(0,-1)),gt=e=>HR.test(e),_s=e=>aI.test(e),cI=new Set(["length","size","percentage"]),fI=e=>oc(e,cI,GR),dI=e=>oc(e,"position",GR),hI=new Set(["image","url"]),vI=e=>oc(e,hI,yI),pI=e=>oc(e,"",gI),yf=()=>!0,oc=(e,t,n)=>{const r=HR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},mI=e=>iI.test(e)&&!sI.test(e),GR=()=>!1,gI=e=>lI.test(e),yI=e=>oI.test(e),xI=()=>{const e=rn("colors"),t=rn("spacing"),n=rn("blur"),r=rn("brightness"),a=rn("borderColor"),i=rn("borderRadius"),l=rn("borderSpacing"),o=rn("borderWidth"),f=rn("contrast"),c=rn("grayscale"),d=rn("hueRotate"),p=rn("invert"),m=rn("gap"),y=rn("gradientColorStops"),x=rn("gradientColorStopPositions"),b=rn("inset"),S=rn("margin"),w=rn("opacity"),C=rn("padding"),T=rn("saturate"),k=rn("scale"),R=rn("sepia"),A=rn("skew"),D=rn("space"),L=rn("translate"),P=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",gt,t],B=()=>[gt,t],q=()=>["",Pi,Ls],V=()=>["auto",ju,gt],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["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",gt],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[ju,gt];return{cacheSize:500,separator:":",theme:{colors:[yf],spacing:[Pi,Ls],blur:["none","",_s,gt],brightness:I(),borderColor:[e],borderRadius:["none","","full",_s,gt],borderSpacing:B(),borderWidth:q(),contrast:I(),grayscale:Q(),hueRotate:I(),invert:Q(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[uI,Ls],inset:_(),margin:_(),opacity:I(),padding:B(),saturate:I(),scale:I(),sepia:Q(),skew:I(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",gt]}],container:["container"],columns:[{columns:[_s]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...G(),gt]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gf,gt]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gt]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",gf,gt]}],"grid-cols":[{"grid-cols":[yf]}],"col-start-end":[{col:["auto",{span:["full",gf,gt]},gt]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[yf]}],"row-start-end":[{row:["auto",{span:[gf,gt]},gt]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gt]}],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",gt,t]}],"min-w":[{"min-w":[gt,t,"min","max","fit"]}],"max-w":[{"max-w":[gt,t,"none","full","min","max","fit","prose",{screen:[_s]},_s]}],h:[{h:[gt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_s,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oy]}],"font-family":[{font:[yf]}],"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",gt]}],"line-clamp":[{"line-clamp":["none",ju,Oy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pi,gt]}],"list-image":[{"list-image":["none",gt]}],"list-style-type":[{list:["none","disc","decimal",gt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pi,Ls]}],"underline-offset":[{"underline-offset":["auto",Pi,gt]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gt]}],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",gt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),dI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vI]}],"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":[w]}],"border-style":[{border:[...F(),"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":[w]}],"divide-style":[{divide:F()}],"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:["",...F()]}],"outline-offset":[{"outline-offset":[Pi,gt]}],"outline-w":[{outline:[Pi,Ls]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Pi,Ls]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_s,pI]}],"shadow-color":[{shadow:[yf]}],opacity:[{opacity:[w]}],"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",_s,gt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[T]}],sepia:[{sepia:[R]}],"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":[p]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"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",gt]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",gt]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",gt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[gf,gt]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gt]}],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",gt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",gt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Pi,Ls,Oy]}],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"]}}},bI=tI(xI);function je(...e){return bI(FR(e))}const wI=Ap("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"}}),ze=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>v.jsx("button",{className:je(wI({variant:t,size:n,className:e})),ref:a,...r}));ze.displayName="Button";function Jt(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 dT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $R(...e){return t=>{let n=!1;const r=e.map(a=>{const i=dT(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():dT(e[a],null)}}}}function Nn(...e){return j.useCallback($R(...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 v.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 Rp(e,t=[]){let n=[];function r(i,l){const o=j.createContext(l),f=n.length;n=[...n,l];const c=p=>{var w;const{scope:m,children:y,...x}=p,b=((w=m==null?void 0:m[e])==null?void 0:w[f])||o,S=j.useMemo(()=>x,Object.values(x));return v.jsx(b.Provider,{value:S,children:y})};c.displayName=i+"Provider";function d(p,m){var b;const y=((b=m==null?void 0:m[e])==null?void 0:b[f])||o,x=j.useContext(y);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${p}\` 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,EI(a,...t)]}function EI(...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 p=f(i)[`__scope${c}`];return{...o,...p}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var mr=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},CI=UA[" useId ".trim().toString()]||(()=>{}),TI=0;function Au(e){const[t,n]=j.useState(CI());return mr(()=>{n(r=>r??String(TI++))},[e]),t?`radix-${t}`:""}var NI=UA[" useInsertionEffect ".trim().toString()]||mr;function ep({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,l]=kI({defaultProp:t,onChange:n}),o=e!==void 0,f=o?e:a;{const d=j.useRef(e!==void 0);j.useEffect(()=>{const p=d.current;p!==o&&console.warn(`${r} is changing from ${p?"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 p;if(o){const m=jI(d)?d(e):d;m!==e&&((p=l.current)==null||p.call(l,m))}else i(d)},[o,e,i,l]);return[f,c]}function kI({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),a=j.useRef(n),i=j.useRef(t);return NI(()=>{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 jI(e){return typeof e=="function"}function Xf(e){const t=AI(e),n=j.forwardRef((r,a)=>{const{children:i,...l}=r,o=j.Children.toArray(i),f=o.find(DI);if(f){const c=f.props.children,d=o.map(p=>p===f?j.Children.count(c)>1?j.Children.only(null):j.isValidElement(c)?c.props.children:null:p);return v.jsx(t,{...l,ref:a,children:j.isValidElement(c)?j.cloneElement(c,void 0,d):null})}return v.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function AI(e){const t=j.forwardRef((n,r)=>{const{children:a,...i}=n;if(j.isValidElement(a)){const l=OI(a),o=MI(i,a.props);return a.type!==j.Fragment&&(o.ref=r?$R(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 RI=Symbol("radix.slottable");function DI(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RI}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 OI(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 LI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qt=LI.reduce((e,t)=>{const n=Xf(`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),v.jsx(f,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _I(e,t){e&&yd.flushSync(()=>e.dispatchEvent(t))}function fo(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=fo(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 PI="DismissableLayer",fb="dismissableLayer.update",zI="dismissableLayer.pointerDownOutside",II="dismissableLayer.focusOutside",hT,KR=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),A1=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:o,...f}=e,c=j.useContext(KR),[d,p]=j.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=j.useState({}),x=Nn(t,D=>p(D)),b=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(S),C=d?b.indexOf(d):-1,T=c.layersWithOutsidePointerEventsDisabled.size>0,k=C>=w,R=qI(D=>{const L=D.target,P=[...c.branches].some(M=>M.contains(L));!k||P||(a==null||a(D),l==null||l(D),D.defaultPrevented||o==null||o())},m),A=VI(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&&(hT=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),vT(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=hT)}},[d,m,n,c]),j.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),vT())},[d,c]),j.useEffect(()=>{const D=()=>y({});return document.addEventListener(fb,D),()=>document.removeEventListener(fb,D)},[]),v.jsx(Qt.div,{...f,ref:x,style:{pointerEvents:T?k?"auto":"none":void 0,...e.style},onFocusCapture:Jt(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Jt(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Jt(e.onPointerDownCapture,R.onPointerDownCapture)})});A1.displayName=PI;var FI="DismissableLayerBranch",UI=j.forwardRef((e,t)=>{const n=j.useContext(KR),r=j.useRef(null),a=Nn(t,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),v.jsx(Qt.div,{...e,ref:a})});UI.displayName=FI;function qI(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e),r=j.useRef(!1),a=j.useRef(()=>{});return j.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let f=function(){YR(zI,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 VI(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e),r=j.useRef(!1);return j.useEffect(()=>{const a=i=>{i.target&&!r.current&&YR(II,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 vT(){const e=new CustomEvent(fb);document.dispatchEvent(e)}function YR(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?_I(a,i):a.dispatchEvent(i)}var Ly="focusScope.autoFocusOnMount",_y="focusScope.autoFocusOnUnmount",pT={bubbles:!1,cancelable:!0},HI="FocusScope",R1=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[o,f]=j.useState(null),c=fo(a),d=fo(i),p=j.useRef(null),m=Nn(t,b=>f(b)),y=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let b=function(T){if(y.paused||!o)return;const k=T.target;o.contains(k)?p.current=k:Us(p.current,{select:!0})},S=function(T){if(y.paused||!o)return;const k=T.relatedTarget;k!==null&&(o.contains(k)||Us(p.current,{select:!0}))},w=function(T){if(document.activeElement===document.body)for(const R of T)R.removedNodes.length>0&&Us(o)};document.addEventListener("focusin",b),document.addEventListener("focusout",S);const C=new MutationObserver(w);return o&&C.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",S),C.disconnect()}}},[r,o,y.paused]),j.useEffect(()=>{if(o){gT.add(y);const b=document.activeElement;if(!o.contains(b)){const w=new CustomEvent(Ly,pT);o.addEventListener(Ly,c),o.dispatchEvent(w),w.defaultPrevented||(GI(QI(XR(o)),{select:!0}),document.activeElement===b&&Us(o))}return()=>{o.removeEventListener(Ly,c),setTimeout(()=>{const w=new CustomEvent(_y,pT);o.addEventListener(_y,d),o.dispatchEvent(w),w.defaultPrevented||Us(b??document.body,{select:!0}),o.removeEventListener(_y,d),gT.remove(y)},0)}}},[o,c,d,y]);const x=j.useCallback(b=>{if(!n&&!r||y.paused)return;const S=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,w=document.activeElement;if(S&&w){const C=b.currentTarget,[T,k]=$I(C);T&&k?!b.shiftKey&&w===k?(b.preventDefault(),n&&Us(T,{select:!0})):b.shiftKey&&w===T&&(b.preventDefault(),n&&Us(k,{select:!0})):w===C&&b.preventDefault()}},[n,r,y.paused]);return v.jsx(Qt.div,{tabIndex:-1,...l,ref:m,onKeyDown:x})});R1.displayName=HI;function GI(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Us(r,{select:t}),document.activeElement!==n)return}function $I(e){const t=XR(e),n=mT(t,e),r=mT(t.reverse(),e);return[n,r]}function XR(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 mT(e,t){for(const n of e)if(!KI(n,{upTo:t}))return n}function KI(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 YI(e){return e instanceof HTMLInputElement&&"select"in e}function Us(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&YI(e)&&t&&e.select()}}var gT=XI();function XI(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yT(e,t),e.unshift(t)},remove(t){var n;e=yT(e,t),(n=e[0])==null||n.resume()}}}function yT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function QI(e){return e.filter(t=>t.tagName!=="A")}var WI="Portal",D1=j.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[a,i]=j.useState(!1);mr(()=>i(!0),[]);const l=n||a&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return l?MP.createPortal(v.jsx(Qt.div,{...r,ref:t}),l):null});D1.displayName=WI;function ZI(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Dp=e=>{const{present:t,children:n}=e,r=JI(t),a=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=Nn(r.ref,e6(a));return typeof n=="function"||r.isPresent?j.cloneElement(a,{ref:i}):null};Dp.displayName="Presence";function JI(e){const[t,n]=j.useState(),r=j.useRef(null),a=j.useRef(e),i=j.useRef("none"),l=e?"mounted":"unmounted",[o,f]=ZI(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const c=sv(r.current);i.current=o==="mounted"?c:"none"},[o]),mr(()=>{const c=r.current,d=a.current;if(d!==e){const m=i.current,y=sv(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]),mr(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,p=y=>{const b=sv(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&b&&(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=sv(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:j.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function sv(e){return(e==null?void 0:e.animationName)||"none"}function e6(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 By=0;function QR(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xT()),document.body.insertAdjacentElement("beforeend",e[1]??xT()),By++,()=>{By===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),By--}},[])}function xT(){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 si=function(){return si=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},si.apply(this,arguments)};function WR(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 t6(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 _v="right-scroll-bar-position",Bv="width-before-scroll-bar",n6="with-scroll-bars-hidden",r6="--removed-body-scroll-bar-size";function Py(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function a6(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 i6=typeof window<"u"?j.useLayoutEffect:j.useEffect,bT=new WeakMap;function s6(e,t){var n=a6(null,function(r){return e.forEach(function(a){return Py(a,r)})});return i6(function(){var r=bT.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(o){i.has(o)||Py(o,null)}),i.forEach(function(o){a.has(o)||Py(o,l)})}bT.set(n,e)},[e]),n}function l6(e){return e}function o6(e,t){t===void 0&&(t=l6);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 u6(e){e===void 0&&(e={});var t=o6(null);return t.options=si({async:!0,ssr:!1},e),t}var ZR=function(e){var t=e.sideCar,n=WR(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,si({},n))};ZR.isSideCarExport=!0;function c6(e,t){return e.useMedium(t),ZR}var JR=u6(),zy=function(){},Mp=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:zy,onWheelCapture:zy,onTouchMoveCapture:zy}),a=r[0],i=r[1],l=e.forwardProps,o=e.children,f=e.className,c=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,y=e.noRelative,x=e.noIsolation,b=e.inert,S=e.allowPinchZoom,w=e.as,C=w===void 0?"div":w,T=e.gapMode,k=WR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,A=s6([n,t]),D=si(si({},k),a);return j.createElement(j.Fragment,null,d&&j.createElement(R,{sideCar:JR,removeScrollBar:c,shards:p,noRelative:y,noIsolation:x,inert:b,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:T}),l?j.cloneElement(j.Children.only(o),si(si({},D),{ref:A})):j.createElement(C,si({},D,{className:f,ref:A}),o))});Mp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mp.classNames={fullWidth:Bv,zeroRight:_v};var f6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=f6();return t&&e.setAttribute("nonce",t),e}function h6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var p6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=d6())&&(h6(t,n),v6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},m6=function(){var e=p6();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},eD=function(){var e=m6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},g6={left:0,top:0,right:0,gap:0},Iy=function(e){return parseInt(e||"",10)||0},y6=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[Iy(n),Iy(r),Iy(a)]},x6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return g6;var t=y6(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])}},b6=eD(),Ru="data-scroll-locked",w6=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
411
|
+
.`.concat(n6,` {
|
|
412
|
+
overflow: hidden `).concat(r,`;
|
|
413
|
+
padding-right: `).concat(o,"px ").concat(r,`;
|
|
414
|
+
}
|
|
415
|
+
body[`).concat(Ru,`] {
|
|
416
|
+
overflow: hidden `).concat(r,`;
|
|
417
|
+
overscroll-behavior: contain;
|
|
418
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
419
|
+
padding-left: `.concat(a,`px;
|
|
420
|
+
padding-top: `).concat(i,`px;
|
|
421
|
+
padding-right: `).concat(l,`px;
|
|
422
|
+
margin-left:0;
|
|
423
|
+
margin-top:0;
|
|
424
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
425
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.`).concat(_v,` {
|
|
429
|
+
right: `).concat(o,"px ").concat(r,`;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.`).concat(Bv,` {
|
|
433
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.`).concat(_v," .").concat(_v,` {
|
|
437
|
+
right: 0 `).concat(r,`;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.`).concat(Bv," .").concat(Bv,` {
|
|
441
|
+
margin-right: 0 `).concat(r,`;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
body[`).concat(Ru,`] {
|
|
445
|
+
`).concat(r6,": ").concat(o,`px;
|
|
446
|
+
}
|
|
447
|
+
`)},wT=function(){var e=parseInt(document.body.getAttribute(Ru)||"0",10);return isFinite(e)?e:0},S6=function(){j.useEffect(function(){return document.body.setAttribute(Ru,(wT()+1).toString()),function(){var e=wT()-1;e<=0?document.body.removeAttribute(Ru):document.body.setAttribute(Ru,e.toString())}},[])},E6=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 x6(a)},[a]);return j.createElement(b6,{styles:w6(i,!t,a,n?"":"!important")})},db=!1;if(typeof window<"u")try{var lv=Object.defineProperty({},"passive",{get:function(){return db=!0,!0}});window.addEventListener("test",lv,lv),window.removeEventListener("test",lv,lv)}catch{db=!1}var ou=db?{passive:!1}:!1,C6=function(e){return e.tagName==="TEXTAREA"},tD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!C6(e)&&n[t]==="visible")},T6=function(e){return tD(e,"overflowY")},N6=function(e){return tD(e,"overflowX")},ST=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=nD(e,r);if(a){var i=rD(e,r),l=i[1],o=i[2];if(l>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},k6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},j6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},nD=function(e,t){return e==="v"?T6(t):N6(t)},rD=function(e,t){return e==="v"?k6(t):j6(t)},A6=function(e,t){return e==="h"&&t==="rtl"?-1:1},R6=function(e,t,n,r,a){var i=A6(e,window.getComputedStyle(t).direction),l=i*r,o=n.target,f=t.contains(o),c=!1,d=l>0,p=0,m=0;do{if(!o)break;var y=rD(e,o),x=y[0],b=y[1],S=y[2],w=b-S-i*x;(x||w)&&nD(e,o)&&(p+=w,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(p)<1||!d&&Math.abs(m)<1)&&(c=!0),c},ov=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ET=function(e){return[e.deltaX,e.deltaY]},CT=function(e){return e&&"current"in e?e.current:e},D6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},M6=function(e){return`
|
|
448
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
449
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
450
|
+
`)},O6=0,uu=[];function L6(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),a=j.useState(O6++)[0],i=j.useState(eD)[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 b=t6([e.lockRef.current],(e.shards||[]).map(CT),!0).filter(Boolean);return b.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=j.useCallback(function(b,S){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var w=ov(b),C=n.current,T="deltaX"in b?b.deltaX:C[0]-w[0],k="deltaY"in b?b.deltaY:C[1]-w[1],R,A=b.target,D=Math.abs(T)>Math.abs(k)?"h":"v";if("touches"in b&&D==="h"&&A.type==="range")return!1;var L=window.getSelection(),P=L&&L.anchorNode,M=P?P===A||P.contains(A):!1;if(M)return!1;var _=ST(D,A);if(!_)return!0;if(_?R=D:(R=D==="v"?"h":"v",_=ST(D,A)),!_)return!1;if(!r.current&&"changedTouches"in b&&(T||k)&&(r.current=R),!R)return!0;var B=r.current||R;return R6(B,S,b,B==="h"?T:k)},[]),f=j.useCallback(function(b){var S=b;if(!(!uu.length||uu[uu.length-1]!==i)){var w="deltaY"in S?ET(S):ov(S),C=t.current.filter(function(R){return R.name===S.type&&(R.target===S.target||S.target===R.shadowParent)&&D6(R.delta,w)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var T=(l.current.shards||[]).map(CT).filter(Boolean).filter(function(R){return R.contains(S.target)}),k=T.length>0?o(S,T[0]):!l.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),c=j.useCallback(function(b,S,w,C){var T={name:b,delta:S,target:w,should:C,shadowParent:_6(w)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(k){return k!==T})},1)},[]),d=j.useCallback(function(b){n.current=ov(b),r.current=void 0},[]),p=j.useCallback(function(b){c(b.type,ET(b),b.target,o(b,e.lockRef.current))},[]),m=j.useCallback(function(b){c(b.type,ov(b),b.target,o(b,e.lockRef.current))},[]);j.useEffect(function(){return uu.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",f,ou),document.addEventListener("touchmove",f,ou),document.addEventListener("touchstart",d,ou),function(){uu=uu.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,ou),document.removeEventListener("touchmove",f,ou),document.removeEventListener("touchstart",d,ou)}},[]);var y=e.removeScrollBar,x=e.inert;return j.createElement(j.Fragment,null,x?j.createElement(i,{styles:M6(a)}):null,y?j.createElement(E6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const B6=c6(JR,L6);var M1=j.forwardRef(function(e,t){return j.createElement(Mp,si({},e,{ref:t,sideCar:B6}))});M1.classNames=Mp.classNames;var P6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cu=new WeakMap,uv=new WeakMap,cv={},Fy=0,aD=function(e){return e&&(e.host||aD(e.parentNode))},z6=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=aD(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})},I6=function(e,t,n,r){var a=z6(t,Array.isArray(e)?e:[e]);cv[n]||(cv[n]=new WeakMap);var i=cv[n],l=[],o=new Set,f=new Set(a),c=function(p){!p||o.has(p)||(o.add(p),c(p.parentNode))};a.forEach(c);var d=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(m){if(o.has(m))d(m);else try{var y=m.getAttribute(r),x=y!==null&&y!=="false",b=(cu.get(m)||0)+1,S=(i.get(m)||0)+1;cu.set(m,b),i.set(m,S),l.push(m),b===1&&x&&uv.set(m,!0),S===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return d(t),o.clear(),Fy++,function(){l.forEach(function(p){var m=cu.get(p)-1,y=i.get(p)-1;cu.set(p,m),i.set(p,y),m||(uv.has(p)||p.removeAttribute(r),uv.delete(p)),y||p.removeAttribute(n)}),Fy--,Fy||(cu=new WeakMap,cu=new WeakMap,uv=new WeakMap,cv={})}},iD=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=P6(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),I6(r,a,n,"aria-hidden")):function(){return null}},Op="Dialog",[sD]=Rp(Op),[F6,$a]=sD(Op),lD=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]=ep({prop:r,defaultProp:a??!1,onChange:i,caller:Op});return v.jsx(F6,{scope:t,triggerRef:o,contentRef:f,contentId:Au(),titleId:Au(),descriptionId:Au(),open:c,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(p=>!p),[d]),modal:l,children:n})};lD.displayName=Op;var oD="DialogTrigger",uD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=$a(oD,n),i=Nn(t,a.triggerRef);return v.jsx(Qt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":_1(a.open),...r,ref:i,onClick:Jt(e.onClick,a.onOpenToggle)})});uD.displayName=oD;var O1="DialogPortal",[U6,cD]=sD(O1,{forceMount:void 0}),fD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=$a(O1,t);return v.jsx(U6,{scope:t,forceMount:n,children:j.Children.map(r,l=>v.jsx(Dp,{present:n||i.open,children:v.jsx(D1,{asChild:!0,container:a,children:l})}))})};fD.displayName=O1;var tp="DialogOverlay",dD=j.forwardRef((e,t)=>{const n=cD(tp,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=$a(tp,e.__scopeDialog);return i.modal?v.jsx(Dp,{present:r||i.open,children:v.jsx(V6,{...a,ref:t})}):null});dD.displayName=tp;var q6=Xf("DialogOverlay.RemoveScroll"),V6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=$a(tp,n);return v.jsx(M1,{as:q6,allowPinchZoom:!0,shards:[a.contentRef],children:v.jsx(Qt.div,{"data-state":_1(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ho="DialogContent",hD=j.forwardRef((e,t)=>{const n=cD(ho,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=$a(ho,e.__scopeDialog);return v.jsx(Dp,{present:r||i.open,children:i.modal?v.jsx(H6,{...a,ref:t}):v.jsx(G6,{...a,ref:t})})});hD.displayName=ho;var H6=j.forwardRef((e,t)=>{const n=$a(ho,e.__scopeDialog),r=j.useRef(null),a=Nn(t,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return iD(i)},[]),v.jsx(vD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Jt(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Jt(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,o=l.button===0&&l.ctrlKey===!0;(l.button===2||o)&&i.preventDefault()}),onFocusOutside:Jt(e.onFocusOutside,i=>i.preventDefault())})}),G6=j.forwardRef((e,t)=>{const n=$a(ho,e.__scopeDialog),r=j.useRef(!1),a=j.useRef(!1);return v.jsx(vD,{...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()}})}),vD=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,o=$a(ho,n),f=j.useRef(null),c=Nn(t,f);return QR(),v.jsxs(v.Fragment,{children:[v.jsx(R1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:v.jsx(A1,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":_1(o.open),...l,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx($6,{titleId:o.titleId}),v.jsx(Y6,{contentRef:f,descriptionId:o.descriptionId})]})]})}),L1="DialogTitle",pD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=$a(L1,n);return v.jsx(Qt.h2,{id:a.titleId,...r,ref:t})});pD.displayName=L1;var mD="DialogDescription",gD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=$a(mD,n);return v.jsx(Qt.p,{id:a.descriptionId,...r,ref:t})});gD.displayName=mD;var yD="DialogClose",xD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=$a(yD,n);return v.jsx(Qt.button,{type:"button",...r,ref:t,onClick:Jt(e.onClick,()=>a.onOpenChange(!1))})});xD.displayName=yD;function _1(e){return e?"open":"closed"}var bD="DialogTitleWarning",[lae,wD]=SI(bD,{contentName:ho,titleName:L1,docsSlug:"dialog"}),$6=({titleId:e})=>{const t=wD(bD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
451
|
+
|
|
452
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
453
|
+
|
|
454
|
+
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},K6="DialogDescriptionWarning",Y6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wD(K6).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},X6=lD,Q6=uD,W6=fD,SD=dD,ED=hD,CD=pD,TD=gD,Z6=xD;const Ed=X6,J6=Q6,eF=W6,ND=j.forwardRef(({className:e,...t},n)=>v.jsx(SD,{ref:n,className:je("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));ND.displayName=SD.displayName;const uc=j.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(eF,{children:[v.jsx(ND,{}),v.jsxs(ED,{ref:r,className:je("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,v.jsxs(Z6,{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:[v.jsx(sc,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));uc.displayName=ED.displayName;function Cd({className:e,...t}){return v.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}Cd.displayName="DialogHeader";function Lp({className:e,...t}){return v.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}Lp.displayName="DialogFooter";const cc=j.forwardRef(({className:e,...t},n)=>v.jsx(CD,{ref:n,className:je("text-lg font-serif font-semibold leading-none tracking-tight",e),...t}));cc.displayName=CD.displayName;const _p=j.forwardRef(({className:e,...t},n)=>v.jsx(TD,{ref:n,className:je("text-sm text-on-surface-variant",e),...t}));_p.displayName=TD.displayName;const vn=j.forwardRef(({className:e,type:t,...n},r)=>v.jsx("input",{type:t,className:je("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}));vn.displayName="Input";var kD="Toggle",jD=j.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:a,...i}=e,[l,o]=ep({prop:n,onChange:a,defaultProp:r??!1,caller:kD});return v.jsx(Qt.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Jt(e.onClick,()=>{e.disabled||o(!l)})})});jD.displayName=kD;var AD=jD;const tF=Ap("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"}}),hb=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>v.jsx(AD,{ref:a,className:je(tF({variant:t,size:n,className:e})),...r}));hb.displayName=AD.displayName;const nF=Ap("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 Ct({className:e,variant:t,...n}){return v.jsx("div",{className:je(nF({variant:t}),e),...n})}const rF=120,aF={session:{label:"Sessions",icon:kp},spore:{label:"Spores",icon:S1},plan:{label:"Plans",icon:ez},prompt_batch:{label:"Prompt Batches",icon:lb},activity:{label:"Activities",icon:lb}};function RD(e){return aF[e]??{label:e,icon:iz}}function iF(e,t){return e.length<=t?e:e.slice(0,t)+"…"}function sF({score:e}){const t=Math.round(e*100);return v.jsxs(Ct,{variant:"outline",className:"shrink-0 text-xs tabular-nums text-on-surface-variant",children:[t,"%"]})}function lF({result:e,onSelect:t,isHighlighted:n}){const{icon:r}=RD(e.type);return v.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:[v.jsx(r,{className:"h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("span",{className:"text-sm font-medium truncate",children:e.title})}),e.preview&&v.jsx("p",{className:"text-xs text-on-surface-variant mt-0.5 line-clamp-2",children:iF(e.preview,rF)})]}),v.jsx(sF,{score:e.score})]})}function oF({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 v.jsx("div",{className:"py-2 space-y-1",children:Object.entries(r).map(([i,l])=>{const{label:o}=RD(i),f=a;return a+=l.length,v.jsxs("div",{children:[v.jsx("div",{className:"px-3 py-1",children:v.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-on-surface-variant",children:o})}),l.map((c,d)=>v.jsx(lF,{result:c,onSelect:t,isHighlighted:n===f+d},c.id))]},i)})})}const uF=2,cF=3e4;function fF(e,t="semantic"){return cn({queryKey:["search",e,t],queryFn:({signal:n})=>dt(`/search?q=${encodeURIComponent(e)}&mode=${t}`,{signal:n}),enabled:e.length>uF,staleTime:cF})}const dF=300,hF=20;function vF(e){switch(e.type){case"session":return`/sessions/${e.id}`;case"spore":return`/mycelium?tab=spores&spore=${encodeURIComponent(e.id)}`;case"plan":return e.session_id?`/sessions/${e.session_id}?tab=plans&plan=${encodeURIComponent(e.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 pF({open:e,onOpenChange:t}){const n=ts(),[r,a]=j.useState(""),[i,l]=j.useState(""),[o,f]=j.useState("semantic"),[c,d]=j.useState(0),p=j.useRef(null);j.useEffect(()=>{const T=setTimeout(()=>{l(r.trim())},dF);return()=>clearTimeout(T)},[r]),j.useEffect(()=>{e&&(a(""),l(""),d(0),setTimeout(()=>{var T;return(T=p.current)==null?void 0:T.focus()},50))},[e]);const{data:m,isLoading:y}=fF(i,o),x=((m==null?void 0:m.results)??[]).slice(0,hF);j.useEffect(()=>{d(0)},[x.length,i]);const b=j.useCallback(T=>{const k=vF(T);t(!1),n(k)},[n,t]),S=j.useCallback(T=>{if(x.length!==0){if(T.key==="ArrowDown")T.preventDefault(),d(k=>Math.min(k+1,x.length-1));else if(T.key==="ArrowUp")T.preventDefault(),d(k=>Math.max(k-1,0));else if(T.key==="Enter"){T.preventDefault();const k=x[c];k&&b(k)}}},[x,c,b]),w=i.length>2&&!y&&x.length===0,C=i.length<=2&&!y;return v.jsx(Ed,{open:e,onOpenChange:t,children:v.jsxs(uc,{className:"max-w-2xl p-0 gap-0 overflow-hidden",onKeyDown:S,children:[v.jsx(cc,{className:"sr-only",children:"Search vault"}),v.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--ghost-border)] pl-4 pr-12 py-3",children:[v.jsx(ic,{className:"h-4 w-4 shrink-0 text-on-surface-variant"}),v.jsx(vn,{ref:p,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"}),v.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v.jsx(hb,{size:"sm",pressed:o==="semantic",onPressedChange:()=>f("semantic"),"aria-label":"Semantic search",title:"Semantic (embedded knowledge)",children:"Semantic"}),v.jsx(hb,{size:"sm",pressed:o==="fts",onPressedChange:()=>f("fts"),"aria-label":"Full-text search",title:"Full text (raw data)",children:"Full Text"})]})]}),v.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[y&&i.length>2&&v.jsx("div",{className:"px-4 py-8 text-center",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 text-on-surface-variant",children:[v.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),v.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"}),v.jsx("div",{className:"h-3 w-28 rounded bg-muted animate-pulse"})]})}),C&&v.jsx("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:"Type to search your vault…"}),w&&v.jsxs("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:["No results for ",v.jsxs("span",{className:"font-medium text-on-surface",children:['"',i,'"']})]}),x.length>0&&!y&&v.jsx(oF,{results:x,onSelect:b,highlightedIndex:c})]}),v.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:[v.jsxs("span",{children:[v.jsx("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),v.jsxs("span",{children:[v.jsx("kbd",{className:"font-mono",children:"↵"})," open"]}),v.jsxs("span",{children:[v.jsx("kbd",{className:"font-mono",children:"Esc"})," close"]}),v.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 mF=[{to:"/",label:"Dashboard",icon:fz},{to:"/sessions",label:"Sessions",icon:kp},{to:"/mycelium",label:"Mycelium",icon:mz},{to:"/skills",label:"Skills",icon:S1},{to:"/agent",label:"Agent",icon:xd},{to:"/settings",label:"Settings",icon:wz},{to:"/operations",label:"Operations",icon:LR},{to:"/team",label:"Team",icon:jz},{to:"/logs",label:"Logs",icon:MR}],gF=[{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"}],DD={compact:.85,normal:1,comfy:1.15},yF={compact:"Compact",normal:"Normal",comfy:"Comfy"},xf=["compact","normal","comfy"],TT="myco-ui-sidebar-collapsed",NT=768,MD="myco-ui-density",xF="--density",bF="normal";function wF(){const e=localStorage.getItem(MD);return e&&e in DD?e:bF}function SF(e){const t=DD[e];document.documentElement.style.setProperty(xF,String(t)),document.documentElement.style.fontSize=`calc(14px * ${t})`}function EF(){const[e,t]=j.useState(wF),n=j.useCallback(r=>{localStorage.setItem(MD,r),t(r)},[]);return j.useEffect(()=>{SF(e)},[e]),{density:e,setDensity:n}}function CF(){const[e,t]=j.useState(()=>localStorage.getItem(TT)==="true"),n=j.useCallback(()=>{t(r=>{const a=!r;return localStorage.setItem(TT,String(a)),a})},[]);return{collapsed:e,toggle:n}}function TF(){const[e,t]=j.useState(!1),[n,r]=j.useState(()=>typeof window<"u"&&window.innerWidth<NT);j.useEffect(()=>{const o=window.matchMedia(`(max-width: ${NT-1}px)`),f=c=>{r(c.matches),c.matches||t(!1)};return o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[]);const a=es();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 Uy=["light","dark","system"],NF={light:Tz,dark:pz,system:RR},kF={light:"Light",dark:"Dark",system:"System"};function jF({collapsed:e=!1}){const{theme:t,setTheme:n}=BP(),r=()=>{const l=Uy.indexOf(t),o=Uy[(l+1)%Uy.length];n(o)},a=NF[t]??RR,i=kF[t]??"System";return v.jsxs(ze,{variant:"ghost",size:"sm",onClick:r,title:e?`${i} mode`:void 0,className:je("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[v.jsx(a,{className:"h-4 w-4"}),!e&&v.jsx("span",{children:i})]})}function AF({collapsed:e=!1}){const{restart:t,isRestarting:n}=k1();return v.jsxs(ze,{variant:"ghost",size:"sm",onClick:()=>t(),disabled:n,title:e?n?"Restarting...":"Restart Daemon":void 0,className:je("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[v.jsx(w1,{className:je("h-4 w-4",n&&"animate-spin")}),!e&&v.jsx("span",{children:n?"Restarting...":"Restart Daemon"})]})}function RF(){const{font:e,setFont:t}=qP();return v.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:[v.jsx(Nz,{className:"h-4 w-4 shrink-0"}),v.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:gF.map(n=>v.jsx("option",{value:n.value,children:n.label},n.value))})]})}function DF({density:e,setDensity:t}){const n=xf.indexOf(e),r=()=>{const i=xf[n-1];n>0&&i!==void 0&&t(i)},a=()=>{const i=xf[n+1];n<xf.length-1&&i!==void 0&&t(i)};return v.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[v.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:v.jsx(vz,{className:"h-3 w-3"})}),v.jsx("div",{className:"flex flex-1 justify-center",children:v.jsx("span",{className:"text-xs text-on-surface-variant select-none",children:yF[e]})}),v.jsx("button",{onClick:a,disabled:n===xf.length-1,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Increase density",children:v.jsx(yz,{className:"h-3 w-3"})})]})}function MF({collapsed:e}){const{data:t}=zR(),n=!!(t&&!t.exempt&&t.update_available),r=n?"/operations?tab=system":"/operations";return v.jsxs(g1,{to:r,title:e?"Operations":void 0,className:({isActive:a})=>je("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",a?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[v.jsx(LR,{className:"h-4 w-4 shrink-0"}),!e&&"Operations",n&&v.jsx("span",{className:"h-2 w-2 rounded-full bg-secondary shrink-0 ml-auto"})]})}function kT({collapsed:e,vaultName:t,density:n,setDensity:r,onSearchOpen:a,onCollapseToggle:i,showCollapseToggle:l}){return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:je("px-4 py-5",e&&"px-2 py-4 flex justify-center"),children:e?v.jsxs("div",{className:"relative flex items-center",children:[v.jsx("span",{className:"font-serif text-base text-primary",children:"m"}),v.jsx("span",{className:"ml-1 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}):v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),v.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}),t&&v.jsx("span",{className:"font-mono text-xs text-outline uppercase tracking-widest mt-0.5",children:t})]})}),v.jsx("div",{className:"px-2 pt-2 pb-1",children:v.jsxs("button",{type:"button",onClick:a,title:e?"Search (⌘K)":void 0,className:je("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:[v.jsx(ic,{className:"h-4 w-4 shrink-0"}),!e&&v.jsx("span",{className:"flex-1 text-left",children:"Search"}),!e&&v.jsxs("kbd",{className:"text-xs text-on-surface-variant/60 font-mono",children:["⌘","K"]})]})}),v.jsx("nav",{className:"flex-1 space-y-1 px-2 py-2","aria-label":"Main navigation",children:mF.map(o=>o.to==="/operations"?v.jsx(MF,{collapsed:e},o.to):v.jsxs(g1,{to:o.to,end:o.to==="/",title:e?o.label:void 0,className:({isActive:f})=>je("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:[v.jsx(o.icon,{className:"h-4 w-4 shrink-0"}),!e&&o.label]},o.to))}),v.jsxs("div",{className:je("py-3 space-y-1 mt-auto",e?"px-1 flex flex-col items-center":"px-2"),children:[v.jsx(AF,{collapsed:e}),!e&&v.jsx(RF,{}),!e&&v.jsx(DF,{density:n,setDensity:r}),v.jsx(jF,{collapsed:e})]}),l&&i&&v.jsx("div",{className:je("px-2 py-2",e&&"flex justify-center"),children:v.jsxs(ze,{variant:"ghost",size:"sm",onClick:i,className:je("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?v.jsx(sa,{className:"h-4 w-4"}):v.jsx(y1,{className:"h-4 w-4"}),!e&&v.jsx("span",{children:"Collapse"})]})})]})}function OF(){const{collapsed:e,toggle:t}=CF(),{density:n,setDensity:r}=EF(),{data:a}=jp(),i=a==null?void 0:a.vault.name,[l,o]=j.useState(!1),f=TF();j.useEffect(()=>{const d=p=>{(p.metaKey||p.ctrlKey)&&p.key==="k"&&(p.preventDefault(),o(m=>!m))};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),j.useEffect(()=>{if(!f.open)return;const d=p=>{p.key==="Escape"&&(p.preventDefault(),f.close())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[f.open,f.close]);const c=j.useCallback(()=>o(!0),[]);return v.jsxs("div",{className:"flex h-screen bg-background",children:[v.jsx(pF,{open:l,onOpenChange:o}),f.isMobile&&v.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:[v.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?v.jsx(sc,{className:"h-5 w-5"}):v.jsx(hz,{className:"h-5 w-5"})}),v.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),i&&v.jsx("span",{className:"font-mono text-[10px] text-outline uppercase tracking-widest",children:i}),v.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:v.jsx(ic,{className:"h-4 w-4"})})]}),f.isMobile&&f.open&&v.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&&v.jsx("aside",{className:je("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:v.jsx(kT,{collapsed:!1,vaultName:i,density:n,setDensity:r,onSearchOpen:c,showCollapseToggle:!1})}),!f.isMobile&&v.jsx("aside",{className:je("flex flex-col bg-surface-container transition-[width] duration-200",e?"w-14":"w-56"),children:v.jsx(kT,{collapsed:e,vaultName:i,density:n,setDensity:r,onSearchOpen:c,onCollapseToggle:t,showCollapseToggle:!0})}),v.jsx("main",{className:je("flex-1 overflow-auto bg-surface",f.isMobile&&"pt-12"),"aria-label":"Page content",children:v.jsx(WB,{})})]})}function B1({isLoading:e,error:t,loadingText:n="Loading...",children:r}){return e?v.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[v.jsx(Wn,{className:"h-5 w-5 animate-spin"}),v.jsx("span",{className:"font-sans text-sm",children:n})]}):t?v.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Failed to connect to daemon"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:t.message})]}):v.jsx(v.Fragment,{children:r})}const nl=60,Cu=3600,If=86400,Ta=1e3;function P1(e){if(e<nl)return`${Math.floor(e)}s`;if(e<Cu)return`${Math.floor(e/nl)}m`;if(e<If){const r=Math.floor(e/Cu),a=Math.floor(e%Cu/nl);return`${r}h ${a}m`}const t=Math.floor(e/If),n=Math.floor(e%If/Cu);return`${t}d ${n}h`}function z1(e){const t=(Date.now()-new Date(e).getTime())/Ta;return t<nl?"just now":t<Cu?`${Math.floor(t/nl)}m ago`:t<If?`${Math.floor(t/Cu)}h ago`:`${Math.floor(t/If)}d ago`}function hi(e){return z1(new Date(e*Ta).toISOString())}function vb(e){return new Date(e*Ta).toLocaleString()}function pb(e,t){return e?e.length>t?e.slice(0,t)+"…":e:""}function I1(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Bp(e,t){if(e===null||t===null)return"—";const n=(t-e)*Ta;if(n<Ta)return`${n}ms`;if(n<nl*Ta)return`${(n/Ta).toFixed(1)}s`;const r=Math.floor(n/(nl*Ta)),a=Math.floor(n%(nl*Ta)/Ta);return`${r}m ${a}s`}function LF(e){return e===null?"—":e<Ta?`${e}ms`:`${(e/Ta).toFixed(1)}s`}function mb(e,t){if(e.trim()==="")return t;const n=Number(e);return Number.isFinite(n)?n:t}function Pp(e){return e!==null?hi(e):"—"}const jT=100,_F=1;function BF(e){const{embedded_count:t,total_embeddable:n}=e.embedding;return n===0?jT:Number((t/n*jT).toFixed(_F))}function PF(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 zF(e){return e.embedding.queue_depth>0||e.unprocessed_batches>0}function IF({active:e}){const t=e?"animate-pulse-slow":"";return v.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-20 pointer-events-none",viewBox:"0 0 400 300",preserveAspectRatio:"xMidYMid slice",children:[v.jsx("path",{d:"M200,280 Q200,220 200,160",fill:"none",stroke:"var(--primary)",strokeWidth:"2",className:t}),v.jsx("path",{d:"M200,200 Q240,170 280,180",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),v.jsx("path",{d:"M200,170 Q160,140 120,155",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),v.jsx("path",{d:"M200,160 Q230,110 270,90",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),v.jsx("path",{d:"M200,160 Q170,110 130,80",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),v.jsx("path",{d:"M280,180 Q310,170 340,190",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),v.jsx("path",{d:"M120,155 Q90,145 60,160",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),v.jsx("circle",{cx:"280",cy:"180",r:"3",fill:"var(--primary)",opacity:"0.7"}),v.jsx("circle",{cx:"120",cy:"155",r:"3",fill:"var(--secondary)",opacity:"0.7"}),v.jsx("circle",{cx:"270",cy:"90",r:"2.5",fill:"var(--tertiary)",opacity:"0.6"}),v.jsx("circle",{cx:"130",cy:"80",r:"2.5",fill:"var(--secondary)",opacity:"0.6"}),v.jsx("circle",{cx:"340",cy:"190",r:"2",fill:"var(--tertiary)",opacity:"0.4"}),v.jsx("circle",{cx:"60",cy:"160",r:"2",fill:"var(--primary)",opacity:"0.4"}),v.jsx("circle",{cx:"200",cy:"160",r:"4",fill:"var(--primary)",className:e?"animate-pulse":""})]})}function FF({stats:e}){const t=BF(e),n=PF(e),r=zF(e),a=e.daemon.active_sessions.length,i=P1(e.daemon.uptime_seconds);return v.jsxs("section",{className:"relative flex items-center justify-center rounded-xl overflow-hidden glass-panel border border-outline-variant/10 min-h-[320px]",children:[v.jsx(IF,{active:r}),v.jsxs("div",{className:"text-center relative z-20 space-y-3 py-12",children:[v.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-on-surface-variant/80",children:n}),v.jsx("h1",{className:"font-serif text-5xl italic text-on-surface drop-shadow-sm",children:"Myco"}),v.jsxs("p",{className:"font-mono text-sm text-outline",children:["Node connectivity at ",t,"% capacity"]}),v.jsxs("div",{className:"flex items-center justify-center gap-6 pt-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"h-2 w-2 rounded-full bg-sage shadow-sage-glow animate-pulse"}),v.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[a," active ",a===1?"session":"sessions"]})]}),v.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[e.vault.spore_count," spores"]})}),v.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:["uptime ",i]})})]})]})]})}function UF({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,p)=>({x:p/(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 p=o[Math.max(0,d-1)],m=o[d],y=o[d+1],x=o[Math.min(o.length-1,d+2)],b=m.x+(y.x-p.x)/6,S=m.y+(y.y-p.y)/6,w=y.x-(x.x-m.x)/6,C=y.y-(x.y-m.y)/6;f+=` C ${b} ${S}, ${w} ${C}, ${y.x} ${y.y}`}const c=`${f} L ${t} ${n} L 0 ${n} Z`;return v.jsxs("svg",{width:t,height:n,className:r,viewBox:`0 0 ${t} ${n}`,children:[v.jsx("defs",{children:v.jsxs("linearGradient",{id:"sparkline-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:"0.2"}),v.jsx("stop",{offset:"100%",stopColor:"var(--primary)",stopOpacity:"0"})]})}),v.jsx("path",{d:c,fill:"url(#sparkline-fill)"}),v.jsx("path",{d:f,fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",strokeOpacity:"0.8"})]})}const qF={sage:"border-t-sage",ochre:"border-t-ochre",terracotta:"border-t-terracotta",outline:"border-t-outline"},VF={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta",outline:"text-on-surface"};function an({label:e,value:t,sublabel:n,accent:r,sparklineData:a,className:i,href:l}){const o=je("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",qF[r],i),f=v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-outline mb-2",children:e}),v.jsxs("div",{className:"flex items-end justify-between gap-2",children:[v.jsx("p",{className:je("font-serif text-2xl font-bold",VF[r]),children:t}),a&&a.length>=2&&v.jsx(UF,{data:a,width:80,height:28,className:"opacity-60"})]}),n&&v.jsx("p",{className:"font-mono text-[10px] text-outline mt-1",children:n})]});return l?v.jsx(ja,{to:l,className:je(o,"block no-underline"),children:f}):v.jsx("div",{className:o,children:f})}function HF({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?hi(e.agent.last_run_at):"Never";return v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[v.jsx(an,{label:"Sessions",value:String(e.vault.session_count),sublabel:`${e.daemon.active_sessions.length} active`,accent:"sage",href:"/sessions"}),v.jsx(an,{label:"Spores",value:String(e.vault.spore_count),sublabel:`${e.vault.entity_count} entities`,accent:"sage",href:"/mycelium?tab=spores"}),v.jsx(an,{label:"Embedding",value:`${t}%`,sublabel:`${e.embedding.embedded_count}/${e.embedding.total_embeddable}`,accent:e.embedding.queue_depth>0?"ochre":"sage",href:"/operations"}),v.jsx(an,{label:"Agent",value:`${e.agent.total_runs}`,sublabel:`last: ${r}`,accent:e.agent.last_run_status==="error"?"terracotta":"outline",href:"/agent"}),v.jsx(an,{label:"Digest",value:n,sublabel:e.digest.generated_at?hi(e.digest.generated_at):void 0,accent:"outline",href:"/mycelium?tab=digest"}),v.jsx(an,{label:"Uptime",value:P1(e.daemon.uptime_seconds),sublabel:`v${e.daemon.version}`,accent:"outline"})]})}function OD(e=20){return Ma({queryKey:["activity",e],queryFn:({signal:t})=>dt(`/activity?limit=${e}`,{signal:t}),refetchInterval:Hr.STATS,pollCategory:"standard"})}function GF(e){return e==="agent_run"?"ochre":e==="spore"?"sage":e.includes("error")||e.includes("fail")?"terracotta":"sage"}function $F(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 KF={sage:"border-l-sage",ochre:"border-l-ochre",terracotta:"border-l-terracotta"},YF={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},XF={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},QF={sage:"border-sage/20",ochre:"border-ochre/20",terracotta:"border-terracotta/20"};function WF(e){return`#${e.slice(-6).toUpperCase()}`}function AT(e){return e.summary}function ZF({event:e}){const t=ts(),n=GF(e.type),r=$F(n),a=hi(e.timestamp),i=e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?"/mycelium":null;return v.jsxs("div",{className:je("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",KF[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":`${AT(e)} - ${r.label} - ${a}`,children:[v.jsxs("div",{className:"flex justify-between items-start mb-3",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("p",{className:je("font-mono text-xs font-bold",YF[n]),children:WF(e.id)}),v.jsx("h4",{className:"font-serif text-lg text-on-surface leading-tight mt-0.5 truncate",children:AT(e)})]}),v.jsx("div",{className:je("w-8 h-8 rounded-full border-2 flex items-center justify-center shrink-0 ml-3",QF[n]),children:v.jsx("div",{className:je("w-3.5 h-3.5 rounded-full",r.dotClass)})})]}),v.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]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("span",{className:je("px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono rounded",XF[n]),children:r.label}),v.jsx("span",{className:"px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono text-outline rounded",children:a})]})]})}const RT=6,JF=3;function eU(){return v.jsxs("div",{className:"p-5 rounded-lg border-l-4 border-l-outline-variant/30 bg-surface-container/40 animate-pulse",children:[v.jsxs("div",{className:"flex justify-between items-start mb-3",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high"}),v.jsx("div",{className:"h-5 w-40 rounded bg-surface-container-high"})]}),v.jsx("div",{className:"w-8 h-8 rounded-full bg-surface-container-high"})]}),v.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high/60 mb-3"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("div",{className:"h-5 w-16 rounded bg-surface-container-high/60"}),v.jsx("div",{className:"h-5 w-12 rounded bg-surface-container-high/60"})]})]})}function tU(){const{data:e,isLoading:t}=OD(RT*2),n=(e??[]).filter(r=>r.type!=="agent_run").slice(0,RT);return v.jsxs("section",{className:"space-y-5",children:[v.jsx("div",{className:"flex items-end justify-between border-b border-outline-variant/10 pb-4",children:v.jsxs("div",{children:[v.jsx("h3",{className:"font-serif text-3xl text-on-surface",children:"Session Pods"}),v.jsx("p",{className:"font-mono text-[10px] uppercase text-outline mt-1",children:"Monitoring concurrent thread activity"})]})}),t?v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:JF}).map((r,a)=>v.jsx(eU,{},a))}):n.length===0?v.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[v.jsxs("div",{className:"relative",children:[v.jsx(DR,{className:"h-10 w-10 text-outline/30"}),v.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3 w-3 rounded-full bg-surface-container border-2 border-surface"})]}),v.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No recent activity"}),v.jsx("p",{className:"font-mono text-[10px] uppercase text-outline tracking-wider",children:"Pods appear as sessions and spores are captured"})]}):v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map(r=>v.jsx(ZF,{event:r},r.id))})]})}const nU=Hr.STATS,rU=Hr.HEALTH,aU=Hr.STATS,F1=new Set(["completed","failed","skipped"]),iU=Hr.STATS,U1=6e4,sU=50;function LD(e){const t=(e==null?void 0:e.limit)??sU,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 Ma({queryKey:["agent-runs",e],queryFn:({signal:a})=>dt(`/agent/runs?${r}`,{signal:a}),pollCategory:"standard",refetchInterval:nU})}function lU(e){return cn({queryKey:["agent-run",e],queryFn:({signal:n})=>dt(`/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&&F1.has(r)?!1:rU}})}function oU(e,t){const n=t?F1.has(t):!1;return Ma({queryKey:["agent-reports",e],queryFn:({signal:r})=>dt(`/agent/runs/${e}/reports`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:aU})}function uU(e,t){const n=t?F1.has(t):!1;return Ma({queryKey:["agent-turns",e],queryFn:({signal:r})=>dt(`/agent/runs/${e}/turns`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:iU})}function fc(){return cn({queryKey:["agent-tasks"],queryFn:({signal:e})=>dt("/agent/tasks",{signal:e}),staleTime:U1})}function cU(e){return cn({queryKey:["agent-task",e],queryFn:({signal:t})=>dt(`/agent/tasks/${e}`,{signal:t}),enabled:e!==void 0,staleTime:U1})}function fU(){const e=xr();return la({mutationFn:({taskId:t,name:n})=>sr(`/agent/tasks/${t}/copy`,n?{name:n}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function dU(){const e=xr();return la({mutationFn:t=>E1(`/agent/tasks/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function hU(e){return cn({queryKey:["agent-task-yaml",e],queryFn:({signal:t})=>dt(`/agent/tasks/${e}/yaml`,{signal:t}),enabled:e!==void 0,staleTime:U1})}function vU(){const e=xr();return la({mutationFn:({taskId:t,yaml:n})=>lc(`/agent/tasks/${t}`,{yaml:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]}),e.invalidateQueries({queryKey:["agent-task"]}),e.invalidateQueries({queryKey:["agent-task-yaml"]})}})}function q1(){const e=xr();return la({mutationFn:t=>sr("/agent/run",t),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-runs"]})}})}function V1(e){return e===null?"—":`$${e.toFixed(4)}`}function H1(e){return e===null?"—":e.toLocaleString()}function _D(e){switch(e){case"completed":return"default";case"running":return"warning";case"failed":return"destructive";default:return"secondary"}}function BD(e){return e===C1?"warning":"secondary"}const PD="Default task";function zD(e,t){if(!e)return PD;const n=t.find(r=>r.name===e);return(n==null?void 0:n.displayName)??e}const pU=5,DT={running:"bg-sage animate-pulse",completed:"bg-sage",failed:"bg-terracotta",skipped:"bg-outline/40",pending:"bg-outline/40"};function mU({run:e,taskName:t,onClick:n}){const r=DT[e.status]??DT.pending;return v.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:[v.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[v.jsx("span",{className:je("h-2 w-2 shrink-0 rounded-full",r)}),v.jsx("span",{className:"text-sm text-on-surface truncate",children:t})]}),v.jsxs("div",{className:"flex items-center gap-3 shrink-0 font-mono text-[11px] text-outline",children:[v.jsx("span",{children:e.started_at!==null?hi(e.started_at):"—"}),v.jsx("span",{children:Bp(e.started_at,e.completed_at)})]})]})}function gU(){const{data:e,isLoading:t}=LD({limit:pU}),{data:n}=fc(),r=ts(),a=(n==null?void 0:n.tasks)??[],i=(e==null?void 0:e.runs)??[];return v.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10",children:[v.jsxs("div",{className:"flex justify-between items-center mb-6",children:[v.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"Agent Runs"}),v.jsx(xd,{className:"h-5 w-5 text-outline"})]}),t?v.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"Loading runs..."}):i.length===0?v.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"No agent runs yet"}):v.jsx("div",{children:i.map(l=>v.jsx(mU,{run:l,taskName:zD(l.task,a),onClick:()=>r("/agent")},l.id))})]})}const yU=12,xU=8;function bU(e){return e.includes("error")||e.includes("fail")?"error":e==="agent_run"?"warn":"ok"}const wU={ok:"[OK]",warn:"[WRN]",error:"[ERR]"},SU={ok:"text-sage",warn:"text-ochre",error:"text-terracotta"};function EU(e){return new Date(e*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function CU(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?"/mycelium":null}function TU({event:e,onClick:t}){const n=bU(e.type);return v.jsxs("div",{className:je("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:[v.jsx("span",{className:"text-outline shrink-0 tabular-nums",children:EU(e.timestamp)}),v.jsx("span",{className:je("shrink-0 font-bold",SU[n]),children:wU[n]}),v.jsx("span",{className:"text-on-surface/70 truncate",children:e.summary})]})}function NU(){const{data:e,isLoading:t}=OD(yU),n=ts(),r=(e==null?void 0:e.slice(0,xU))??[];return v.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:[v.jsxs("div",{className:"flex justify-between items-center mb-6",children:[v.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"System Integrity Logs"}),v.jsx("span",{className:"text-[10px] font-mono text-sage px-2 py-1 bg-sage-muted rounded",children:"LIVE"})]}),t?v.jsx("div",{className:"space-y-3",children:[1,2,3].map(a=>v.jsxs("div",{className:"flex gap-4 items-start pb-2 animate-pulse",children:[v.jsx("div",{className:"h-3 w-14 rounded bg-surface-container-high/50"}),v.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high/50"}),v.jsx("div",{className:"h-3 flex-1 rounded bg-surface-container-high/40"})]},a))}):r.length===0?v.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[v.jsx(MR,{className:"h-8 w-8 text-outline/20"}),v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"No log entries yet"})]}):v.jsx("div",{className:"space-y-3",children:r.map(a=>{const i=CU(a);return v.jsx(TU,{event:a,onClick:i?()=>n(i):void 0},a.id)})})]})}function kU(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 jU({stats:e}){const t=kU(e);return v.jsxs("div",{className:"flex items-center justify-between px-2 py-3 border-t border-outline-variant/10",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("span",{className:"font-mono text-[10px] uppercase text-sage",children:["System Connectivity: ",t]}),v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sage animate-pulse"})]}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:e.vault.name}),v.jsxs("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:["v",e.daemon.version]})]})]})}function AU(){const{data:e,isLoading:t,isError:n,error:r}=jp();return v.jsx(B1,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Connecting to daemon...",children:e&&v.jsxs("div",{className:"relative min-h-full",children:[v.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.04]",children:v.jsxs("svg",{height:"100%",width:"100%",viewBox:"0 0 800 800",preserveAspectRatio:"none",children:[v.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 300 500 200 400C100 300 0 400 0 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),v.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 500 500 600 400C700 300 800 400 800 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),v.jsx("path",{className:"mycelial-connector",d:"M400 800C400 500 450 300 400 100",fill:"none",stroke:"#abcfb8",strokeWidth:"1"})]})}),v.jsxs("div",{className:"relative z-10 p-6 lg:p-8 max-w-7xl mx-auto space-y-10",children:[v.jsx(FF,{stats:e}),v.jsx(HF,{stats:e}),v.jsx(tU,{}),v.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsx(gU,{}),v.jsx(NU,{})]}),v.jsx(jU,{stats:e})]})]})})}const RU=Ap("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}}),Ze=j.forwardRef(({className:e,level:t,interactive:n,ghostBorder:r,glass:a,glow:i,...l},o)=>v.jsx("div",{ref:o,className:je(RU({level:t,interactive:n,ghostBorder:r,glass:a,glow:i}),e),...l}));Ze.displayName="Surface";function DU({tabs:e,activeTab:t,onTabChange:n,className:r}){return v.jsx("div",{className:je("flex items-center gap-6",r),children:e.map(a=>v.jsx("button",{onClick:()=>n(a.id),className:je("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 vi({title:e,subtitle:t,tabs:n,activeTab:r,onTabChange:a,actions:i,className:l}){return v.jsxs("div",{className:je("pb-6",l),children:[v.jsxs("div",{className:"flex items-start justify-between",children:[v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:e}),t&&v.jsx("p",{className:"mt-1 font-sans text-sm text-on-surface-variant",children:t})]}),i&&v.jsx("div",{className:"flex items-center gap-2",children:i})]}),n&&r&&a&&v.jsx(DU,{tabs:n,activeTab:r,onTabChange:a,className:"mt-4"})]})}function G1({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 p,m;return v.jsx(Ed,{open:e,onOpenChange:t,children:v.jsxs(uc,{className:"sm:max-w-md border border-outline-variant/20 [&>button:last-child]:hidden",children:[v.jsxs(Cd,{children:[v.jsxs("div",{className:"flex items-center gap-3",children:[a&&v.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-tertiary/15",children:a}),v.jsx(cc,{children:n})]}),v.jsx(_p,{children:r})]}),i&&i.length>0&&v.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-outline-variant/20 px-4 py-3",children:[v.jsx("span",{className:"font-mono text-xs text-on-surface-variant bg-surface-container px-1.5 py-0.5 rounded shrink-0",children:(p=i[0])==null?void 0:p.value}),i.length>1&&v.jsx("span",{className:"text-sm font-medium text-on-surface truncate",children:(m=i[1])==null?void 0:m.value})]}),l&&l.length>0&&v.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.map(y=>v.jsxs("div",{className:"rounded-md border border-outline-variant/20 px-3 py-2",children:[v.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-wider text-on-surface-variant",children:y.label}),v.jsx("div",{className:"font-sans text-base font-medium text-on-surface",children:y.value})]},y.label))}),v.jsxs(Lp,{children:[v.jsx(ze,{variant:"secondary",size:"sm",onClick:()=>t(!1),disabled:d,children:"Cancel"}),v.jsxs(ze,{variant:f,size:"sm",onClick:c,disabled:d,className:"gap-2",children:[d&&v.jsx(Wn,{className:"h-4 w-4 animate-spin"}),o]})]})]})})}function MT(e,[t,n]){return Math.min(n,Math.max(t,e))}function MU(e){const t=e+"CollectionProvider",[n,r]=Rp(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:S,children:w}=b,C=Ui.useRef(null),T=Ui.useRef(new Map).current;return v.jsx(a,{scope:S,itemMap:T,collectionRef:C,children:w})};l.displayName=t;const o=e+"CollectionSlot",f=Xf(o),c=Ui.forwardRef((b,S)=>{const{scope:w,children:C}=b,T=i(o,w),k=Nn(S,T.collectionRef);return v.jsx(f,{ref:k,children:C})});c.displayName=o;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=Xf(d),y=Ui.forwardRef((b,S)=>{const{scope:w,children:C,...T}=b,k=Ui.useRef(null),R=Nn(S,k),A=i(d,w);return Ui.useEffect(()=>(A.itemMap.set(k,{ref:k,...T}),()=>void A.itemMap.delete(k))),v.jsx(m,{[p]:"",ref:R,children:C})});y.displayName=d;function x(b){const S=i(e+"CollectionConsumer",b);return Ui.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const T=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((A,D)=>T.indexOf(A.ref.current)-T.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:y},x,r]}var OU=j.createContext(void 0);function LU(e){const t=j.useContext(OU);return e||t||"ltr"}const _U=["top","right","bottom","left"],ol=Math.min,na=Math.max,np=Math.round,fv=Math.floor,fi=e=>({x:e,y:e}),BU={left:"right",right:"left",bottom:"top",top:"bottom"};function gb(e,t,n){return na(e,ol(t,n))}function Qi(e,t){return typeof e=="function"?e(t):e}function Wi(e){return e.split("-")[0]}function dc(e){return e.split("-")[1]}function $1(e){return e==="x"?"y":"x"}function K1(e){return e==="y"?"height":"width"}function li(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Y1(e){return $1(li(e))}function PU(e,t,n){n===void 0&&(n=!1);const r=dc(e),a=Y1(e),i=K1(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=rp(l)),[l,rp(l)]}function zU(e){const t=rp(e);return[yb(e),t,yb(t)]}function yb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const OT=["left","right"],LT=["right","left"],IU=["top","bottom"],FU=["bottom","top"];function UU(e,t,n){switch(e){case"top":case"bottom":return n?t?LT:OT:t?OT:LT;case"left":case"right":return t?IU:FU;default:return[]}}function qU(e,t,n,r){const a=dc(e);let i=UU(Wi(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(yb)))),i}function rp(e){const t=Wi(e);return BU[t]+e.slice(t.length)}function VU(e){return{top:0,right:0,bottom:0,left:0,...e}}function ID(e){return typeof e!="number"?VU(e):{top:e,right:e,bottom:e,left:e}}function ap(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 _T(e,t,n){let{reference:r,floating:a}=e;const i=li(t),l=Y1(t),o=K1(l),f=Wi(t),c=i==="y",d=r.x+r.width/2-a.width/2,p=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:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(dc(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 HU(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:p="floating",altBoundary:m=!1,padding:y=0}=Qi(t,e),x=ID(y),S=o[m?p==="floating"?"reference":"floating":p],w=ap(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=p==="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)),k=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},R=ap(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:C,offsetParent:T,strategy:f}):C);return{top:(w.top-R.top+x.top)/k.y,bottom:(R.bottom-w.bottom+x.bottom)/k.y,left:(w.left-R.left+x.left)/k.x,right:(R.right-w.right+x.right)/k.x}}const GU=50,$U=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,o=l.detectOverflow?l:{...l,detectOverflow:HU},f=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=_T(c,r,f),m=r,y=0;const x={};for(let b=0;b<i.length;b++){const S=i[b];if(!S)continue;const{name:w,fn:C}=S,{x:T,y:k,data:R,reset:A}=await C({x:d,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:x,rects:c,platform:o,elements:{reference:e,floating:t}});d=T??d,p=k??p,x[w]={...x[w],...R},A&&y<GU&&(y++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(c=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:d,y:p}=_T(c,m,f)),b=-1)}return{x:d,y:p,placement:m,strategy:a,middlewareData:x}},KU=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}=Qi(e,t)||{};if(c==null)return{};const p=ID(d),m={x:n,y:r},y=Y1(a),x=K1(y),b=await l.getDimensions(c),S=y==="y",w=S?"top":"left",C=S?"bottom":"right",T=S?"clientHeight":"clientWidth",k=i.reference[x]+i.reference[y]-m[y]-i.floating[x],R=m[y]-i.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=A?A[T]:0;(!D||!await(l.isElement==null?void 0:l.isElement(A)))&&(D=o.floating[T]||i.floating[x]);const L=k/2-R/2,P=D/2-b[x]/2-1,M=ol(p[w],P),_=ol(p[C],P),B=M,q=D-b[x]-_,V=D/2-b[x]/2+L,G=gb(B,V,q),F=!f.arrow&&dc(a)!=null&&V!==G&&i.reference[x]/2-(V<B?M:_)-b[x]/2<0,H=F?V<B?V-B:V-q:0;return{[y]:m[y]+H,data:{[y]:G,centerOffset:V-G-H,...F&&{alignmentOffset:H}},reset:F}}}),YU=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:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...S}=Qi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Wi(a),C=li(o),T=Wi(o)===o,k=await(f.isRTL==null?void 0:f.isRTL(c.floating)),R=m||(T||!b?[rp(o)]:zU(o)),A=x!=="none";!m&&A&&R.push(...qU(o,b,x,k));const D=[o,...R],L=await f.detectOverflow(t,S),P=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(L[w]),p){const V=PU(a,l,k);P.push(L[V[0]],L[V[1]])}if(M=[...M,{placement:a,overflows:P}],!P.every(V=>V<=0)){var _,B;const V=(((_=i.flip)==null?void 0:_.index)||0)+1,G=D[V];if(G&&(!(p==="alignment"?C!==li(G):!1)||M.every(Y=>li(Y.placement)===C?Y.overflows[0]>0:!0)))return{data:{index:V,overflows:M},reset:{placement:G}};let F=(B=M.filter(H=>H.overflows[0]<=0).sort((H,Y)=>H.overflows[1]-Y.overflows[1])[0])==null?void 0:B.placement;if(!F)switch(y){case"bestFit":{var q;const H=(q=M.filter(Y=>{if(A){const Q=li(Y.placement);return Q===C||Q==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(Q=>Q>0).reduce((Q,z)=>Q+z,0)]).sort((Y,Q)=>Y[1]-Q[1])[0])==null?void 0:q[0];H&&(F=H);break}case"initialPlacement":F=o;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function BT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function PT(e){return _U.some(t=>e[t]>=0)}const XU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Qi(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),o=BT(l,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:PT(o)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),o=BT(l,n.floating);return{data:{escapedOffsets:o,escaped:PT(o)}}}default:return{}}}}},FD=new Set(["left","top"]);async function QU(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Wi(n),o=dc(n),f=li(n)==="y",c=FD.has(l)?-1:1,d=i&&f?-1:1,p=Qi(t,e);let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.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 WU=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 QU(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}}}}},ZU=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:w=>{let{x:C,y:T}=w;return{x:C,y:T}}},...c}=Qi(e,t),d={x:n,y:r},p=await i.detectOverflow(t,c),m=li(Wi(a)),y=$1(m);let x=d[y],b=d[m];if(l){const w=y==="y"?"top":"left",C=y==="y"?"bottom":"right",T=x+p[w],k=x-p[C];x=gb(T,x,k)}if(o){const w=m==="y"?"top":"left",C=m==="y"?"bottom":"right",T=b+p[w],k=b-p[C];b=gb(T,b,k)}const S=f.fn({...t,[y]:x,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[y]:l,[m]:o}}}}}},JU=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}=Qi(e,t),d={x:n,y:r},p=li(a),m=$1(p);let y=d[m],x=d[p];const b=Qi(o,t),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const T=m==="y"?"height":"width",k=i.reference[m]-i.floating[T]+S.mainAxis,R=i.reference[m]+i.reference[T]-S.mainAxis;y<k?y=k:y>R&&(y=R)}if(c){var w,C;const T=m==="y"?"width":"height",k=FD.has(Wi(a)),R=i.reference[p]-i.floating[T]+(k&&((w=l.offset)==null?void 0:w[p])||0)+(k?0:S.crossAxis),A=i.reference[p]+i.reference[T]+(k?0:((C=l.offset)==null?void 0:C[p])||0)-(k?S.crossAxis:0);x<R?x=R:x>A&&(x=A)}return{[m]:y,[p]:x}}}},eq=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}=Qi(e,t),d=await l.detectOverflow(t,c),p=Wi(a),m=dc(a),y=li(a)==="y",{width:x,height:b}=i.floating;let S,w;p==="top"||p==="bottom"?(S=p,w=m===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(w=p,S=m==="end"?"top":"bottom");const C=b-d.top-d.bottom,T=x-d.left-d.right,k=ol(b-d[S],C),R=ol(x-d[w],T),A=!t.middlewareData.shift;let D=k,L=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=C),A&&!m){const M=na(d.left,0),_=na(d.right,0),B=na(d.top,0),q=na(d.bottom,0);y?L=x-2*(M!==0||_!==0?M+_:na(d.left,d.right)):D=b-2*(B!==0||q!==0?B+q:na(d.top,d.bottom))}await f({...t,availableWidth:L,availableHeight:D});const P=await l.getDimensions(o.floating);return x!==P.width||b!==P.height?{reset:{rects:!0}}:{}}}};function zp(){return typeof window<"u"}function hc(e){return UD(e)?(e.nodeName||"").toLowerCase():"#document"}function ra(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mi(e){var t;return(t=(UD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function UD(e){return zp()?e instanceof Node||e instanceof ra(e).Node:!1}function qa(e){return zp()?e instanceof Element||e instanceof ra(e).Element:!1}function ns(e){return zp()?e instanceof HTMLElement||e instanceof ra(e).HTMLElement:!1}function zT(e){return!zp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ra(e).ShadowRoot}function Td(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function tq(e){return/^(table|td|th)$/.test(hc(e))}function Ip(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const nq=/transform|translate|scale|rotate|perspective|filter/,rq=/paint|layout|strict|content/,Ul=e=>!!e&&e!=="none";let qy;function X1(e){const t=qa(e)?Va(e):e;return Ul(t.transform)||Ul(t.translate)||Ul(t.scale)||Ul(t.rotate)||Ul(t.perspective)||!Q1()&&(Ul(t.backdropFilter)||Ul(t.filter))||nq.test(t.willChange||"")||rq.test(t.contain||"")}function aq(e){let t=ul(e);for(;ns(t)&&!Wu(t);){if(X1(t))return t;if(Ip(t))return null;t=ul(t)}return null}function Q1(){return qy==null&&(qy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qy}function Wu(e){return/^(html|body|#document)$/.test(hc(e))}function Va(e){return ra(e).getComputedStyle(e)}function Fp(e){return qa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ul(e){if(hc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zT(e)&&e.host||mi(e);return zT(t)?t.host:t}function qD(e){const t=ul(e);return Wu(t)?e.ownerDocument?e.ownerDocument.body:e.body:ns(t)&&Td(t)?t:qD(t)}function Qf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=qD(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ra(a);if(i){const o=xb(l);return t.concat(l,l.visualViewport||[],Td(a)?a:[],o&&n?Qf(o):[])}else return t.concat(a,Qf(a,[],n))}function xb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function VD(e){const t=Va(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ns(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,o=np(n)!==i||np(r)!==l;return o&&(n=i,r=l),{width:n,height:r,$:o}}function W1(e){return qa(e)?e:e.contextElement}function Du(e){const t=W1(e);if(!ns(t))return fi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=VD(t);let l=(i?np(n.width):n.width)/r,o=(i?np(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const iq=fi(0);function HD(e){const t=ra(e);return!Q1()||!t.visualViewport?iq:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sq(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ra(e)?!1:t}function vo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=W1(e);let l=fi(1);t&&(r?qa(r)&&(l=Du(r)):l=Du(e));const o=sq(i,n,r)?HD(i):fi(0);let f=(a.left+o.x)/l.x,c=(a.top+o.y)/l.y,d=a.width/l.x,p=a.height/l.y;if(i){const m=ra(i),y=r&&qa(r)?ra(r):r;let x=m,b=xb(x);for(;b&&r&&y!==x;){const S=Du(b),w=b.getBoundingClientRect(),C=Va(b),T=w.left+(b.clientLeft+parseFloat(C.paddingLeft))*S.x,k=w.top+(b.clientTop+parseFloat(C.paddingTop))*S.y;f*=S.x,c*=S.y,d*=S.x,p*=S.y,f+=T,c+=k,x=ra(b),b=xb(x)}}return ap({width:d,height:p,x:f,y:c})}function Up(e,t){const n=Fp(e).scrollLeft;return t?t.left+n:vo(mi(e)).left+n}function GD(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Up(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function lq(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=mi(r),o=t?Ip(t.floating):!1;if(r===l||o&&i)return n;let f={scrollLeft:0,scrollTop:0},c=fi(1);const d=fi(0),p=ns(r);if((p||!p&&!i)&&((hc(r)!=="body"||Td(l))&&(f=Fp(r)),p)){const y=vo(r);c=Du(r),d.x=y.x+r.clientLeft,d.y=y.y+r.clientTop}const m=l&&!p&&!i?GD(l,f):fi(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 oq(e){return Array.from(e.getClientRects())}function uq(e){const t=mi(e),n=Fp(e),r=e.ownerDocument.body,a=na(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=na(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Up(e);const o=-n.scrollTop;return Va(r).direction==="rtl"&&(l+=na(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:o}}const IT=25;function cq(e,t){const n=ra(e),r=mi(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=Q1();(!d||d&&t==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}const c=Up(r);if(c<=0){const d=r.ownerDocument,p=d.body,m=getComputedStyle(p),y=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-y);x<=IT&&(i-=x)}else c<=IT&&(i+=c);return{width:i,height:l,x:o,y:f}}function fq(e,t){const n=vo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ns(e)?Du(e):fi(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 FT(e,t,n){let r;if(t==="viewport")r=cq(e,n);else if(t==="document")r=uq(mi(e));else if(qa(t))r=fq(t,n);else{const a=HD(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ap(r)}function $D(e,t){const n=ul(e);return n===t||!qa(n)||Wu(n)?!1:Va(n).position==="fixed"||$D(n,t)}function dq(e,t){const n=t.get(e);if(n)return n;let r=Qf(e,[],!1).filter(o=>qa(o)&&hc(o)!=="body"),a=null;const i=Va(e).position==="fixed";let l=i?ul(e):e;for(;qa(l)&&!Wu(l);){const o=Va(l),f=X1(l);!f&&o.position==="fixed"&&(a=null),(i?!f&&!a:!f&&o.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Td(l)&&!f&&$D(e,l))?r=r.filter(d=>d!==l):a=o,l=ul(l)}return t.set(e,r),r}function hq(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Ip(t)?[]:dq(t,this._c):[].concat(n),r],o=FT(t,l[0],a);let f=o.top,c=o.right,d=o.bottom,p=o.left;for(let m=1;m<l.length;m++){const y=FT(t,l[m],a);f=na(y.top,f),c=ol(y.right,c),d=ol(y.bottom,d),p=na(y.left,p)}return{width:c-p,height:d-f,x:p,y:f}}function vq(e){const{width:t,height:n}=VD(e);return{width:t,height:n}}function pq(e,t,n){const r=ns(t),a=mi(t),i=n==="fixed",l=vo(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const f=fi(0);function c(){f.x=Up(a)}if(r||!r&&!i)if((hc(t)!=="body"||Td(a))&&(o=Fp(t)),r){const y=vo(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?GD(a,o):fi(0),p=l.left+o.scrollLeft-f.x-d.x,m=l.top+o.scrollTop-f.y-d.y;return{x:p,y:m,width:l.width,height:l.height}}function Vy(e){return Va(e).position==="static"}function UT(e,t){if(!ns(e)||Va(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mi(e)===n&&(n=n.ownerDocument.body),n}function KD(e,t){const n=ra(e);if(Ip(e))return n;if(!ns(e)){let a=ul(e);for(;a&&!Wu(a);){if(qa(a)&&!Vy(a))return a;a=ul(a)}return n}let r=UT(e,t);for(;r&&tq(r)&&Vy(r);)r=UT(r,t);return r&&Wu(r)&&Vy(r)&&!X1(r)?n:r||aq(e)||n}const mq=async function(e){const t=this.getOffsetParent||KD,n=this.getDimensions,r=await n(e.floating);return{reference:pq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gq(e){return Va(e).direction==="rtl"}const yq={convertOffsetParentRelativeRectToViewportRelativeRect:lq,getDocumentElement:mi,getClippingRect:hq,getOffsetParent:KD,getElementRects:mq,getClientRects:oq,getDimensions:vq,getScale:Du,isElement:qa,isRTL:gq};function YD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xq(e,t){let n=null,r;const a=mi(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:p,width:m,height:y}=c;if(o||t(),!m||!y)return;const x=fv(p),b=fv(a.clientWidth-(d+m)),S=fv(a.clientHeight-(p+y)),w=fv(d),T={rootMargin:-x+"px "+-b+"px "+-S+"px "+-w+"px",threshold:na(0,ol(1,f))||1};let k=!0;function R(A){const D=A[0].intersectionRatio;if(D!==f){if(!k)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!YD(c,e.getBoundingClientRect())&&l(),k=!1}try{n=new IntersectionObserver(R,{...T,root:a.ownerDocument})}catch{n=new IntersectionObserver(R,T)}n.observe(e)}return l(!0),i}function bq(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=W1(e),d=a||i?[...c?Qf(c):[],...t?Qf(t):[]]:[];d.forEach(w=>{a&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const p=c&&o?xq(c,n):null;let m=-1,y=null;l&&(y=new ResizeObserver(w=>{let[C]=w;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,b=f?vo(e):null;f&&S();function S(){const w=vo(e);b&&!YD(b,w)&&n(),b=w,x=requestAnimationFrame(S)}return n(),()=>{var w;d.forEach(C=>{a&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p==null||p(),(w=y)==null||w.disconnect(),y=null,f&&cancelAnimationFrame(x)}}const wq=WU,Sq=ZU,Eq=YU,Cq=eq,Tq=XU,qT=KU,Nq=JU,kq=(e,t,n)=>{const r=new Map,a={platform:yq,...n},i={...a.platform,_c:r};return $U(e,t,{...a,platform:i})};var jq=typeof document<"u",Aq=function(){},Pv=jq?j.useLayoutEffect:Aq;function ip(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(!ip(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)&&!ip(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function XD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VT(e,t){const n=XD(e);return Math.round(t*n)/n}function Hy(e){const t=j.useRef(e);return Pv(()=>{t.current=e}),t}function Rq(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,p]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,y]=j.useState(r);ip(m,r)||y(r);const[x,b]=j.useState(null),[S,w]=j.useState(null),C=j.useCallback(Y=>{Y!==A.current&&(A.current=Y,b(Y))},[]),T=j.useCallback(Y=>{Y!==D.current&&(D.current=Y,w(Y))},[]),k=i||x,R=l||S,A=j.useRef(null),D=j.useRef(null),L=j.useRef(d),P=f!=null,M=Hy(f),_=Hy(a),B=Hy(c),q=j.useCallback(()=>{if(!A.current||!D.current)return;const Y={placement:t,strategy:n,middleware:m};_.current&&(Y.platform=_.current),kq(A.current,D.current,Y).then(Q=>{const z={...Q,isPositioned:B.current!==!1};V.current&&!ip(L.current,z)&&(L.current=z,yd.flushSync(()=>{p(z)}))})},[m,t,n,_,B]);Pv(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[c]);const V=j.useRef(!1);Pv(()=>(V.current=!0,()=>{V.current=!1}),[]),Pv(()=>{if(k&&(A.current=k),R&&(D.current=R),k&&R){if(M.current)return M.current(k,R,q);q()}},[k,R,q,M,P]);const G=j.useMemo(()=>({reference:A,floating:D,setReference:C,setFloating:T}),[C,T]),F=j.useMemo(()=>({reference:k,floating:R}),[k,R]),H=j.useMemo(()=>{const Y={position:n,left:0,top:0};if(!F.floating)return Y;const Q=VT(F.floating,d.x),z=VT(F.floating,d.y);return o?{...Y,transform:"translate("+Q+"px, "+z+"px)",...XD(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:z}},[n,o,F.floating,d.x,d.y]);return j.useMemo(()=>({...d,update:q,refs:G,elements:F,floatingStyles:H}),[d,q,G,F,H])}const Dq=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?qT({element:r.current,padding:a}).fn(n):{}:r?qT({element:r,padding:a}).fn(n):{}}}},Mq=(e,t)=>{const n=wq(e);return{name:n.name,fn:n.fn,options:[e,t]}},Oq=(e,t)=>{const n=Sq(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lq=(e,t)=>({fn:Nq(e).fn,options:[e,t]}),_q=(e,t)=>{const n=Eq(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bq=(e,t)=>{const n=Cq(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pq=(e,t)=>{const n=Tq(e);return{name:n.name,fn:n.fn,options:[e,t]}},zq=(e,t)=>{const n=Dq(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Iq="Arrow",QD=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return v.jsx(Qt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});QD.displayName=Iq;var Fq=QD;function Uq(e){const[t,n]=j.useState(void 0);return mr(()=>{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 Z1="Popper",[WD,ZD]=Rp(Z1),[qq,JD]=WD(Z1),eM=e=>{const{__scopePopper:t,children:n}=e,[r,a]=j.useState(null);return v.jsx(qq,{scope:t,anchor:r,onAnchorChange:a,children:n})};eM.displayName=Z1;var tM="PopperAnchor",nM=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=JD(tM,n),l=j.useRef(null),o=Nn(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:v.jsx(Qt.div,{...a,ref:o})});nM.displayName=tM;var J1="PopperContent",[Vq,Hq]=WD(J1),rM=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:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:x,...b}=e,S=JD(J1,n),[w,C]=j.useState(null),T=Nn(t,ge=>C(ge)),[k,R]=j.useState(null),A=Uq(k),D=(A==null?void 0:A.width)??0,L=(A==null?void 0:A.height)??0,P=r+(i!=="center"?"-"+i:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},_=Array.isArray(c)?c:[c],B=_.length>0,q={padding:M,boundary:_.filter($q),altBoundary:B},{refs:V,floatingStyles:G,placement:F,isPositioned:H,middlewareData:Y}=Rq({strategy:"fixed",placement:P,whileElementsMounted:(...ge)=>bq(...ge,{animationFrame:y==="always"}),elements:{reference:S.anchor},middleware:[Mq({mainAxis:a+L,alignmentAxis:l}),f&&Oq({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Lq():void 0,...q}),f&&_q({...q}),Bq({...q,apply:({elements:ge,rects:Ne,availableWidth:Be,availableHeight:lt})=>{const{width:Je,height:Qe}=Ne.reference,Ve=ge.floating.style;Ve.setProperty("--radix-popper-available-width",`${Be}px`),Ve.setProperty("--radix-popper-available-height",`${lt}px`),Ve.setProperty("--radix-popper-anchor-width",`${Je}px`),Ve.setProperty("--radix-popper-anchor-height",`${Qe}px`)}}),k&&zq({element:k,padding:o}),Kq({arrowWidth:D,arrowHeight:L}),m&&Pq({strategy:"referenceHidden",...q})]}),[Q,z]=sM(F),I=fo(x);mr(()=>{H&&(I==null||I())},[H,I]);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 mr(()=>{w&&oe(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:H?G.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:v.jsx(Vq,{scope:n,placedSide:Q,onArrowChange:R,arrowX:X,arrowY:U,shouldHideArrow:te,children:v.jsx(Qt.div,{"data-side":Q,"data-align":z,...b,ref:T,style:{...b.style,animation:H?void 0:"none"}})})})});rM.displayName=J1;var aM="PopperArrow",Gq={top:"bottom",right:"left",bottom:"top",left:"right"},iM=j.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=Hq(aM,r),l=Gq[i.placedSide];return v.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:v.jsx(Fq,{...a,ref:n,style:{...a.style,display:"block"}})})});iM.displayName=aM;function $q(e){return e!==null}var Kq=e=>({name:"transformOrigin",options:e,fn(t){var S,w,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]=sM(n),p={start:"0%",center:"50%",end:"100%"}[d],m=(((w=a.arrow)==null?void 0:w.x)??0)+o/2,y=(((C=a.arrow)==null?void 0:C.y)??0)+f/2;let x="",b="";return c==="bottom"?(x=l?p:`${m}px`,b=`${-f}px`):c==="top"?(x=l?p:`${m}px`,b=`${r.floating.height+f}px`):c==="right"?(x=`${-f}px`,b=l?p:`${y}px`):c==="left"&&(x=`${r.floating.width+f}px`,b=l?p:`${y}px`),{data:{x,y:b}}}});function sM(e){const[t,n="center"]=e.split("-");return[t,n]}var Yq=eM,Xq=nM,Qq=rM,Wq=iM;function Zq(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 lM=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"}),Jq="VisuallyHidden",e8=j.forwardRef((e,t)=>v.jsx(Qt.span,{...e,ref:t,style:{...lM,...e.style}}));e8.displayName=Jq;var t8=[" ","Enter","ArrowUp","ArrowDown"],n8=[" ","Enter"],po="Select",[qp,Vp,r8]=MU(po),[vc]=Rp(po,[r8,ZD]),Hp=ZD(),[a8,ml]=vc(po),[i8,s8]=vc(po),oM=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:o,onValueChange:f,dir:c,name:d,autoComplete:p,disabled:m,required:y,form:x}=e,b=Hp(t),[S,w]=j.useState(null),[C,T]=j.useState(null),[k,R]=j.useState(!1),A=LU(c),[D,L]=ep({prop:r,defaultProp:a??!1,onChange:i,caller:po}),[P,M]=ep({prop:l,defaultProp:o,onChange:f,caller:po}),_=j.useRef(null),B=S?x||!!S.closest("form"):!0,[q,V]=j.useState(new Set),G=Array.from(q).map(F=>F.props.value).join(";");return v.jsx(Yq,{...b,children:v.jsxs(a8,{required:y,scope:t,trigger:S,onTriggerChange:w,valueNode:C,onValueNodeChange:T,valueNodeHasChildren:k,onValueNodeHasChildrenChange:R,contentId:Au(),value:P,onValueChange:M,open:D,onOpenChange:L,dir:A,triggerPointerDownPosRef:_,disabled:m,children:[v.jsx(qp.Provider,{scope:t,children:v.jsx(i8,{scope:e.__scopeSelect,onNativeOptionAdd:j.useCallback(F=>{V(H=>new Set(H).add(F))},[]),onNativeOptionRemove:j.useCallback(F=>{V(H=>{const Y=new Set(H);return Y.delete(F),Y})},[]),children:n})}),B?v.jsxs(jM,{"aria-hidden":!0,required:y,tabIndex:-1,name:d,autoComplete:p,value:P,onChange:F=>M(F.target.value),disabled:m,form:x,children:[P===void 0?v.jsx("option",{value:""}):null,Array.from(q)]},G):null]})})};oM.displayName=po;var uM="SelectTrigger",cM=j.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Hp(n),l=ml(uM,n),o=l.disabled||r,f=Nn(t,l.onTriggerChange),c=Vp(n),d=j.useRef("touch"),[p,m,y]=RM(b=>{const S=c().filter(T=>!T.disabled),w=S.find(T=>T.value===l.value),C=DM(S,b,w);C!==void 0&&l.onValueChange(C.value)}),x=b=>{o||(l.onOpenChange(!0),y()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return v.jsx(Xq,{asChild:!0,...i,children:v.jsx(Qt.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":AM(l.value)?"":void 0,...a,ref:f,onClick:Jt(a.onClick,b=>{b.currentTarget.focus(),d.current!=="mouse"&&x(b)}),onPointerDown:Jt(a.onPointerDown,b=>{d.current=b.pointerType;const S=b.target;S.hasPointerCapture(b.pointerId)&&S.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(x(b),b.preventDefault())}),onKeyDown:Jt(a.onKeyDown,b=>{const S=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&m(b.key),!(S&&b.key===" ")&&t8.includes(b.key)&&(x(),b.preventDefault())})})})});cM.displayName=uM;var fM="SelectValue",dM=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...o}=e,f=ml(fM,n),{onValueNodeHasChildrenChange:c}=f,d=i!==void 0,p=Nn(t,f.onValueNodeChange);return mr(()=>{c(d)},[c,d]),v.jsx(Qt.span,{...o,ref:p,style:{pointerEvents:"none"},children:AM(f.value)?v.jsx(v.Fragment,{children:l}):i})});dM.displayName=fM;var l8="SelectIcon",hM=j.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return v.jsx(Qt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});hM.displayName=l8;var o8="SelectPortal",vM=e=>v.jsx(D1,{asChild:!0,...e});vM.displayName=o8;var mo="SelectContent",pM=j.forwardRef((e,t)=>{const n=ml(mo,e.__scopeSelect),[r,a]=j.useState();if(mr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?yd.createPortal(v.jsx(mM,{scope:e.__scopeSelect,children:v.jsx(qp.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),i):null}return v.jsx(gM,{...e,ref:t})});pM.displayName=mo;var Ba=10,[mM,gl]=vc(mo),u8="SelectContentImpl",c8=Xf("SelectContent.RemoveScroll"),gM=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:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:b,avoidCollisions:S,...w}=e,C=ml(mo,n),[T,k]=j.useState(null),[R,A]=j.useState(null),D=Nn(t,ae=>k(ae)),[L,P]=j.useState(null),[M,_]=j.useState(null),B=Vp(n),[q,V]=j.useState(!1),G=j.useRef(!1);j.useEffect(()=>{if(T)return iD(T)},[T]),QR();const F=j.useCallback(ae=>{const[we,...fe]=B().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&&R&&(R.scrollTop=0),re===J&&R&&(R.scrollTop=R.scrollHeight),re==null||re.focus(),document.activeElement!==ne))return},[B,R]),H=j.useCallback(()=>F([L,T]),[F,L,T]);j.useEffect(()=>{q&&H()},[q,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[z,I]=RM(ae=>{const we=B().filter(ne=>!ne.disabled),fe=we.find(ne=>ne.ref.current===document.activeElement),J=DM(we,ae,fe);J&&setTimeout(()=>J.ref.current.focus())}),X=j.useCallback((ae,we,fe)=>{const J=!G.current&&!fe;(C.value!==void 0&&C.value===we||J)&&(P(ae),J&&(G.current=!0))},[C.value]),U=j.useCallback(()=>T==null?void 0:T.focus(),[T]),te=j.useCallback((ae,we,fe)=>{const J=!G.current&&!fe;(C.value!==void 0&&C.value===we||J)&&_(ae)},[C.value]),ie=r==="popper"?bb:yM,oe=ie===bb?{side:o,sideOffset:f,align:c,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:b,avoidCollisions:S}:{};return v.jsx(mM,{scope:n,content:T,viewport:R,onViewportChange:A,itemRefCallback:X,selectedItem:L,onItemLeave:U,itemTextRefCallback:te,focusSelectedItem:H,selectedItemText:M,position:r,isPositioned:q,searchRef:z,children:v.jsx(M1,{as:c8,allowPinchZoom:!0,children:v.jsx(R1,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Jt(a,ae=>{var we;(we=C.trigger)==null||we.focus({preventScroll:!0}),ae.preventDefault()}),children:v.jsx(A1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:v.jsx(ie,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...w,...oe,onPlaced:()=>V(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Jt(w.onKeyDown,ae=>{const we=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!we&&ae.key.length===1&&I(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let J=B().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(()=>F(J)),ae.preventDefault()}})})})})})})});gM.displayName=u8;var f8="SelectItemAlignedPosition",yM=j.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=ml(mo,n),l=gl(mo,n),[o,f]=j.useState(null),[c,d]=j.useState(null),p=Nn(t,D=>d(D)),m=Vp(n),y=j.useRef(!1),x=j.useRef(!0),{viewport:b,selectedItem:S,selectedItemText:w,focusSelectedItem:C}=l,T=j.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&c&&b&&S&&w){const D=i.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),M=w.getBoundingClientRect();if(i.dir!=="rtl"){const ne=M.left-L.left,re=P.left-ne,ge=D.left-re,Ne=D.width+ge,Be=Math.max(Ne,L.width),lt=window.innerWidth-Ba,Je=MT(re,[Ba,Math.max(Ba,lt-Be)]);o.style.minWidth=Ne+"px",o.style.left=Je+"px"}else{const ne=L.right-M.right,re=window.innerWidth-P.right-ne,ge=window.innerWidth-D.right-re,Ne=D.width+ge,Be=Math.max(Ne,L.width),lt=window.innerWidth-Ba,Je=MT(re,[Ba,Math.max(Ba,lt-Be)]);o.style.minWidth=Ne+"px",o.style.right=Je+"px"}const _=m(),B=window.innerHeight-Ba*2,q=b.scrollHeight,V=window.getComputedStyle(c),G=parseInt(V.borderTopWidth,10),F=parseInt(V.paddingTop,10),H=parseInt(V.borderBottomWidth,10),Y=parseInt(V.paddingBottom,10),Q=G+F+q+Y+H,z=Math.min(S.offsetHeight*5,Q),I=window.getComputedStyle(b),X=parseInt(I.paddingTop,10),U=parseInt(I.paddingBottom,10),te=D.top+D.height/2-Ba,ie=B-te,oe=S.offsetHeight/2,ae=S.offsetTop+oe,we=G+F+ae,fe=Q-we;if(we<=te){const ne=_.length>0&&S===_[_.length-1].ref.current;o.style.bottom="0px";const re=c.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(ie,oe+(ne?U:0)+re+H),Ne=we+ge;o.style.height=Ne+"px"}else{const ne=_.length>0&&S===_[0].ref.current;o.style.top="0px";const ge=Math.max(te,G+b.offsetTop+(ne?X:0)+oe)+fe;o.style.height=ge+"px",b.scrollTop=we-te+b.offsetTop}o.style.margin=`${Ba}px 0`,o.style.minHeight=z+"px",o.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,o,c,b,S,w,i.dir,r]);mr(()=>T(),[T]);const[k,R]=j.useState();mr(()=>{c&&R(window.getComputedStyle(c).zIndex)},[c]);const A=j.useCallback(D=>{D&&x.current===!0&&(T(),C==null||C(),x.current=!1)},[T,C]);return v.jsx(h8,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:A,children:v.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:v.jsx(Qt.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});yM.displayName=f8;var d8="SelectPopperPosition",bb=j.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ba,...i}=e,l=Hp(n);return v.jsx(Qq,{...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)"}})});bb.displayName=d8;var[h8,ew]=vc(mo,{}),wb="SelectViewport",xM=j.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=gl(wb,n),l=ew(wb,n),o=Nn(t,i.onViewportChange),f=j.useRef(0);return v.jsxs(v.Fragment,{children:[v.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}),v.jsx(qp.Slot,{scope:n,children:v.jsx(Qt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Jt(a.onScroll,c=>{const d=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=l;if(m!=null&&m.current&&p){const y=Math.abs(f.current-d.scrollTop);if(y>0){const x=window.innerHeight-Ba*2,b=parseFloat(p.style.minHeight),S=parseFloat(p.style.height),w=Math.max(b,S);if(w<x){const C=w+y,T=Math.min(x,C),k=C-T;p.style.height=T+"px",p.style.bottom==="0px"&&(d.scrollTop=k>0?k:0,p.style.justifyContent="flex-end")}}}f.current=d.scrollTop})})})]})});xM.displayName=wb;var bM="SelectGroup",[v8,p8]=vc(bM),m8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Au();return v.jsx(v8,{scope:n,id:a,children:v.jsx(Qt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});m8.displayName=bM;var wM="SelectLabel",g8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=p8(wM,n);return v.jsx(Qt.div,{id:a.id,...r,ref:t})});g8.displayName=wM;var sp="SelectItem",[y8,SM]=vc(sp),EM=j.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,o=ml(sp,n),f=gl(sp,n),c=o.value===r,[d,p]=j.useState(i??""),[m,y]=j.useState(!1),x=Nn(t,C=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,C,r,a)}),b=Au(),S=j.useRef("touch"),w=()=>{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 v.jsx(y8,{scope:n,value:r,disabled:a,textId:b,isSelected:c,onItemTextChange:j.useCallback(C=>{p(T=>T||((C==null?void 0:C.textContent)??"").trim())},[]),children:v.jsx(qp.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:v.jsx(Qt.div,{role:"option","aria-labelledby":b,"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:Jt(l.onFocus,()=>y(!0)),onBlur:Jt(l.onBlur,()=>y(!1)),onClick:Jt(l.onClick,()=>{S.current!=="mouse"&&w()}),onPointerUp:Jt(l.onPointerUp,()=>{S.current==="mouse"&&w()}),onPointerDown:Jt(l.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Jt(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:Jt(l.onPointerLeave,C=>{var T;C.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:Jt(l.onKeyDown,C=>{var k;((k=f.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(n8.includes(C.key)&&w(),C.key===" "&&C.preventDefault())})})})})});EM.displayName=sp;var _f="SelectItemText",CM=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=ml(_f,n),o=gl(_f,n),f=SM(_f,n),c=s8(_f,n),[d,p]=j.useState(null),m=Nn(t,w=>p(w),f.onItemTextChange,w=>{var C;return(C=o.itemTextRefCallback)==null?void 0:C.call(o,w,f.value,f.disabled)}),y=d==null?void 0:d.textContent,x=j.useMemo(()=>v.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=c;return mr(()=>(b(x),()=>S(x)),[b,S,x]),v.jsxs(v.Fragment,{children:[v.jsx(Qt.span,{id:f.textId,...i,ref:m}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?yd.createPortal(i.children,l.valueNode):null]})});CM.displayName=_f;var TM="SelectItemIndicator",NM=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return SM(TM,n).isSelected?v.jsx(Qt.span,{"aria-hidden":!0,...r,ref:t}):null});NM.displayName=TM;var Sb="SelectScrollUpButton",x8=j.forwardRef((e,t)=>{const n=gl(Sb,e.__scopeSelect),r=ew(Sb,e.__scopeSelect),[a,i]=j.useState(!1),l=Nn(t,r.onScrollButtonChange);return mr(()=>{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?v.jsx(kM,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop-f.offsetHeight)}}):null});x8.displayName=Sb;var Eb="SelectScrollDownButton",b8=j.forwardRef((e,t)=>{const n=gl(Eb,e.__scopeSelect),r=ew(Eb,e.__scopeSelect),[a,i]=j.useState(!1),l=Nn(t,r.onScrollButtonChange);return mr(()=>{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?v.jsx(kM,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop+f.offsetHeight)}}):null});b8.displayName=Eb;var kM=j.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=gl("SelectScrollButton",n),l=j.useRef(null),o=Vp(n),f=j.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return j.useEffect(()=>()=>f(),[f]),mr(()=>{var d;const c=o().find(p=>p.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),v.jsx(Qt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Jt(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Jt(a.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Jt(a.onPointerLeave,()=>{f()})})}),w8="SelectSeparator",S8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(Qt.div,{"aria-hidden":!0,...r,ref:t})});S8.displayName=w8;var Cb="SelectArrow",E8=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Hp(n),i=ml(Cb,n),l=gl(Cb,n);return i.open&&l.position==="popper"?v.jsx(Wq,{...a,...r,ref:t}):null});E8.displayName=Cb;var C8="SelectBubbleInput",jM=j.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=j.useRef(null),i=Nn(r,a),l=Zq(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 p=new Event("change",{bubbles:!0});d.call(o,t),o.dispatchEvent(p)}},[l,t]),v.jsx(Qt.select,{...n,style:{...lM,...n.style},ref:i,defaultValue:t})});jM.displayName=C8;function AM(e){return e===""||e===void 0}function RM(e){const t=fo(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 DM(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=T8(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 T8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var N8=oM,MM=cM,k8=dM,j8=hM,A8=vM,OM=pM,R8=xM,LM=EM,D8=CM,M8=NM;const so=N8,lo=k8,rl=j.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(MM,{ref:r,className:je("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,v.jsx(j8,{asChild:!0,children:v.jsx(Ua,{className:"h-4 w-4 opacity-50"})})]}));rl.displayName=MM.displayName;const al=j.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>v.jsx(A8,{children:v.jsx(OM,{ref:a,className:je("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:v.jsx(R8,{className:je("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));al.displayName=OM.displayName;const il=j.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(LM,{ref:r,className:je("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:[v.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(M8,{children:v.jsx(bd,{className:"h-4 w-4"})})}),v.jsx(D8,{children:t})]}));il.displayName=LM.displayName;function Nd({searchPlaceholder:e="Search...",searchValue:t,onSearchChange:n,filters:r=[],filterValues:a={},onFilterChange:i}){return v.jsxs(Ze,{level:"bright",className:"flex items-center gap-3 px-4 py-2 rounded-md",children:[v.jsx(ic,{className:"h-3.5 w-3.5 text-on-surface-variant shrink-0"}),v.jsx(vn,{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=>v.jsx("div",{className:"w-40 shrink-0",children:v.jsxs(so,{value:a[l.key]??"all",onValueChange:o=>i==null?void 0:i(l.key,o),children:[v.jsx(rl,{children:v.jsx(lo,{placeholder:l.label})}),v.jsx(al,{children:l.options.map(o=>v.jsx(il,{value:o.value,children:o.label},o.value))})]})},l.key))]})}function pc({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 v.jsxs("div",{className:"flex items-center justify-center gap-3 pt-1",children:[v.jsxs(ze,{variant:"ghost",size:"sm",disabled:!i,onClick:()=>r(Math.max(0,t-n)),className:"gap-1 text-on-surface-variant",children:[v.jsx(y1,{className:"h-4 w-4"}),"Prev"]}),v.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:[o,"–",f," of ",e]}),v.jsxs(ze,{variant:"ghost",size:"sm",disabled:!l,onClick:()=>r(t+n),className:"gap-1 text-on-surface-variant",children:["Next",v.jsx(sa,{className:"h-4 w-4"})]})]})}const O8=Hr.STATS,L8=Hr.STATS,_8=Hr.STATS,B8=3e4,P8=6e4,z8=1e4,I8=6e4;function F8(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 Ma({queryKey:["sessions",e],queryFn:({signal:a})=>dt(r,{signal:a}),pollCategory:"standard",refetchInterval:O8})}function U8(e){return Ma({queryKey:["session",e],queryFn:({signal:t})=>dt(`/sessions/${e}`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:L8})}function q8(e){return Ma({queryKey:["session-batches",e],queryFn:({signal:t})=>dt(`/sessions/${e}/batches`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:_8})}function V8(e){return cn({queryKey:["batch-activities",e],queryFn:({signal:t})=>dt(`/batches/${e}/activities`,{signal:t}),enabled:e!==void 0,staleTime:B8})}function H8(e){return cn({queryKey:["session-attachments",e],queryFn:({signal:t})=>dt(`/sessions/${e}/attachments`,{signal:t}),enabled:e!==void 0,staleTime:P8})}function _M(){const e=xr();return la({mutationFn:t=>E1(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function BM(e){return cn({queryKey:["session-impact",e],queryFn:({signal:t})=>dt(`/sessions/${e}/impact`,{signal:t}),enabled:e!==null,staleTime:z8})}function PM(e){return cn({queryKey:["session-plans",e],queryFn:({signal:t})=>dt(`/sessions/${e}/plans`,{signal:t}),enabled:!!e,staleTime:I8})}const G8=300;function $8(e,t=G8){const[n,r]=j.useState(e);return j.useEffect(()=>{const a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}const Fn="all";function kd({initialFilters:e}){const[t,n]=j.useState(""),r=$8(t),[a,i]=j.useState(e),[l,o]=j.useState(0),f=j.useCallback((p,m)=>{i(y=>({...y,[p]:m})),o(0)},[]),c=j.useCallback(p=>{n(p),o(0)},[]),d=j.useCallback(p=>{const m=a[p];return m&&m!==Fn?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 zM(e){return e==="active"?"active":e==="completed"?"completed":"error"}const K8={active:"bg-primary",completed:"bg-secondary",error:"bg-tertiary"},Y8={active:"bg-primary/15 text-primary",completed:"bg-surface-container-high text-on-surface-variant",error:"bg-tertiary/15 text-tertiary"};function X8({status:e}){const t=zM(e);return v.jsx("span",{className:je("inline-block h-2 w-2 rounded-full shrink-0",K8[t])})}function IM({status:e}){const t=zM(e),n=e.charAt(0).toUpperCase()+e.slice(1);return v.jsxs("span",{className:je("inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-sans text-xs font-medium",Y8[t]),children:[v.jsx(X8,{status:e}),n]})}const Q8=5,Tb=8,W8=12,Z8=[{key:"status",label:"Status",options:[{value:Fn,label:"All statuses"},{value:"active",label:"Active"},{value:"completed",label:"Completed"}]},{key:"agent",label:"Agent",options:[{value:Fn,label:"All agents"},{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"}]}];function J8({session:e,onClick:t,onDelete:n}){const r=e.title||e.id.slice(0,Tb);return v.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:[v.jsx("td",{className:"px-4 py-3",children:v.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.id.slice(0,W8)})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate block max-w-xs",children:r})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:e.agent||"unknown"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx(IM,{status:e.status})}),v.jsx("td",{className:"px-4 py-3 text-center",children:v.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.prompt_count})}),v.jsx("td",{className:"px-4 py-3",children:v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.date}),v.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:v.jsx(co,{className:"h-3.5 w-3.5"})})]})})]})}function eV(){return v.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high animate-pulse mx-auto"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function fu({children:e,className:t}){return v.jsx("th",{className:je("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function tV(){const e=ts(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=kd({initialFilters:{status:Fn,agent:Fn}}),[c,d]=j.useState(null),p=_M(),{data:m}=BM((c==null?void 0:c.id)??null),y=f("status"),x=f("agent"),{data:b,isLoading:S,isError:w,error:C}=F8({limit:qr,offset:a,status:y,agent:x,search:n});function T(){c&&p.mutate(c.id,{onSuccess:()=>d(null)})}const k=(b==null?void 0:b.sessions)??[],R=(b==null?void 0:b.total)??0,A=v.jsx(Nd,{searchPlaceholder:"Search sessions...",searchValue:t,onSearchChange:l,filters:Z8,filterValues:r,onFilterChange:o}),D=v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[v.jsx(fu,{children:"Session ID"}),v.jsx(fu,{children:"Title"}),v.jsx(fu,{children:"Agent"}),v.jsx(fu,{children:"Status"}),v.jsx(fu,{className:"text-center",children:"Turns"}),v.jsx(fu,{children:"Date"})]})});return w?v.jsxs("div",{children:[v.jsx(vi,{title:"Session Archive"}),A,v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Failed to load sessions"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:C instanceof Error?C.message:"Unknown error"})]})]}):v.jsxs("div",{children:[v.jsx(vi,{title:"Session Archive",subtitle:S?"Loading...":`${R} session${R!==1?"s":""} captured`}),A,S?v.jsx(Ze,{level:"low",className:"rounded-md overflow-hidden mt-4",children:v.jsxs("table",{className:"w-full",children:[D,v.jsx("tbody",{children:Array.from({length:Q8}).map((L,P)=>v.jsx(eV,{},P))})]})}):k.length===0?v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant mt-4",children:[v.jsx(kp,{className:"h-8 w-8 opacity-30"}),v.jsx("span",{className:"font-sans text-sm",children:R===0&&!n&&!y&&!x?"No sessions yet":"No matching sessions"}),R===0&&!n&&!y&&!x&&v.jsx("span",{className:"font-sans text-xs",children:"Sessions appear here as you work with your agent"})]}):v.jsx(Ze,{level:"low",className:"rounded-md overflow-hidden mt-4",children:v.jsxs("table",{className:"w-full","aria-label":"Session archive",children:[D,v.jsx("tbody",{children:k.map(L=>v.jsx(J8,{session:L,onClick:()=>e(`/sessions/${L.id}`),onDelete:()=>d(L)},L.id))})]})}),v.jsx(pc,{total:R,offset:a,limit:qr,onPageChange:i}),v.jsx(G1,{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:v.jsx(co,{className:"h-4 w-4 text-tertiary"}),meta:c?[{label:"ID",value:c.id.slice(0,Tb)},{label:"Title",value:c.title||c.id.slice(0,Tb)}]:[],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:p.isPending})]})}function zt({children:e,className:t}){return v.jsx("div",{className:je("font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}const nV=3e5;function rV(){return cn({queryKey:["symbionts"],queryFn:({signal:e})=>dt("/symbionts",{signal:e}),staleTime:nV})}function aV(e,t,n){const r=e.find(a=>a.name===t);return r!=null&&r.resumeCommand?r.resumeCommand.replace("{sessionId}",n):null}function iV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const sV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oV={};function HT(e,t){return(oV.jsx?lV:sV).test(e)}const uV=/[ \t\n\f\r]/g;function cV(e){return typeof e=="object"?e.type==="text"?GT(e.value):!1:GT(e)}function GT(e){return e.replace(uV,"")===""}class jd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}jd.prototype.normal={};jd.prototype.property={};jd.prototype.space=void 0;function FM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new jd(n,r,t)}function Nb(e){return e.toLowerCase()}class Gr{constructor(t,n){this.attribute=n,this.property=t}}Gr.prototype.attribute="";Gr.prototype.booleanish=!1;Gr.prototype.boolean=!1;Gr.prototype.commaOrSpaceSeparated=!1;Gr.prototype.commaSeparated=!1;Gr.prototype.defined=!1;Gr.prototype.mustUseProperty=!1;Gr.prototype.number=!1;Gr.prototype.overloadedBoolean=!1;Gr.prototype.property="";Gr.prototype.spaceSeparated=!1;Gr.prototype.space=void 0;let fV=0;const yt=Co(),Mn=Co(),kb=Co(),ke=Co(),Zt=Co(),Mu=Co(),ea=Co();function Co(){return 2**++fV}const jb=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Mn,commaOrSpaceSeparated:ea,commaSeparated:Mu,number:ke,overloadedBoolean:kb,spaceSeparated:Zt},Symbol.toStringTag,{value:"Module"})),Gy=Object.keys(jb);class tw extends Gr{constructor(t,n,r,a){let i=-1;if(super(t,n),$T(this,"space",a),typeof r=="number")for(;++i<Gy.length;){const l=Gy[i];$T(this,Gy[i],(r&jb[l])===jb[l])}}}tw.prototype.defined=!0;function $T(e,t,n){n&&(e[t]=n)}function mc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new tw(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Nb(r)]=r,n[Nb(i.attribute)]=r}return new jd(t,n,e.space)}const UM=mc({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Zt,ariaCurrent:null,ariaDescribedBy:Zt,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:Zt,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:Zt,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Zt,ariaLevel:ke,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:Zt,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:Zt,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Mn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function qM(e,t){return t in e?e[t]:t}function VM(e,t){return qM(e,t.toLowerCase())}const dV=mc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Mu,acceptCharset:Zt,accessKey:Zt,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:Zt,autoFocus:yt,autoPlay:yt,blocking:Zt,capture:null,charSet:null,checked:yt,cite:null,className:Zt,cols:ke,colSpan:null,content:null,contentEditable:Mn,controls:yt,controlsList:Zt,coords:ke|Mu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:kb,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Zt,height:ke,hidden:kb,high:ke,href:null,hrefLang:null,htmlFor:Zt,httpEquiv:Zt,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:Zt,itemRef:Zt,itemScope:yt,itemType:Zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,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:yt,optimum:ke,pattern:null,ping:Zt,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:Zt,required:yt,reversed:yt,rows:ke,rowSpan:ke,sandbox:Zt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Mn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Zt,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:VM}),hV=mc({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:ea,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Zt,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:Mu,g2:Mu,glyphName:Mu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:ea,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ea,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ea,rev:ea,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ea,requiredFeatures:ea,requiredFonts:ea,requiredFormats:ea,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:ea,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ea,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ea,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qM}),HM=mc({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()}}),GM=mc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:VM}),$M=mc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vV={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"},pV=/[A-Z]/g,KT=/-[a-z]/g,mV=/^data[-\w.:]+$/i;function gV(e,t){const n=Nb(t);let r=t,a=Gr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&mV.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(KT,xV);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!KT.test(i)){let l=i.replace(pV,yV);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=tw}return new a(r,t)}function yV(e){return"-"+e.toLowerCase()}function xV(e){return e.charAt(1).toUpperCase()}const bV=FM([UM,dV,HM,GM,$M],"html"),nw=FM([UM,hV,HM,GM,$M],"svg");function wV(e){return e.join(" ").trim()}var du={},$y,YT;function SV(){if(YT)return $y;YT=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=`
|
|
455
|
+
`,c="/",d="*",p="",m="comment",y="declaration";function x(S,w){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];w=w||{};var C=1,T=1;function k(V){var G=V.match(t);G&&(C+=G.length);var F=V.lastIndexOf(f);T=~F?V.length-F:T+V.length}function R(){var V={line:C,column:T};return function(G){return G.position=new A(V),P(),G}}function A(V){this.start=V,this.end={line:C,column:T},this.source=w.source}A.prototype.content=S;function D(V){var G=new Error(w.source+":"+C+":"+T+": "+V);if(G.reason=V,G.filename=w.source,G.line=C,G.column=T,G.source=S,!w.silent)throw G}function L(V){var G=V.exec(S);if(G){var F=G[0];return k(F),S=S.slice(F.length),G}}function P(){L(n)}function M(V){var G;for(V=V||[];G=_();)G!==!1&&V.push(G);return V}function _(){var V=R();if(!(c!=S.charAt(0)||d!=S.charAt(1))){for(var G=2;p!=S.charAt(G)&&(d!=S.charAt(G)||c!=S.charAt(G+1));)++G;if(G+=2,p===S.charAt(G-1))return D("End of comment missing");var F=S.slice(2,G-2);return T+=2,k(F),S=S.slice(G),T+=2,V({type:m,comment:F})}}function B(){var V=R(),G=L(r);if(G){if(_(),!L(a))return D("property missing ':'");var F=L(i),H=V({type:y,property:b(G[0].replace(e,p)),value:F?b(F[0].replace(e,p)):p});return L(l),H}}function q(){var V=[];M(V);for(var G;G=B();)G!==!1&&(V.push(G),M(V));return V}return P(),q()}function b(S){return S?S.replace(o,p):p}return $y=x,$y}var XT;function EV(){if(XT)return du;XT=1;var e=du&&du.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(du,"__esModule",{value:!0}),du.default=n;const t=e(SV());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 du}var bf={},QT;function CV(){if(QT)return bf;QT=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.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 bf.camelCase=f,bf}var wf,WT;function TV(){if(WT)return wf;WT=1;var e=wf&&wf.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(EV()),n=CV();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,wf=r,wf}var NV=TV();const kV=vd(NV),KM=YM("end"),rw=YM("start");function YM(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 jV(e){const t=rw(e),n=KM(e);if(t&&n)return{start:t,end:n}}function Ff(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ZT(e.position):"start"in e||"end"in e?ZT(e):"line"in e||"column"in e?Ab(e):""}function Ab(e){return JT(e&&e.line)+":"+JT(e&&e.column)}function ZT(e){return Ab(e&&e.start)+"-"+Ab(e&&e.end)}function JT(e){return e&&typeof e=="number"?e:1}class br 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=Ff(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}}br.prototype.file="";br.prototype.name="";br.prototype.reason="";br.prototype.message="";br.prototype.stack="";br.prototype.column=void 0;br.prototype.line=void 0;br.prototype.ancestors=void 0;br.prototype.cause=void 0;br.prototype.fatal=void 0;br.prototype.place=void 0;br.prototype.ruleId=void 0;br.prototype.source=void 0;const aw={}.hasOwnProperty,AV=new Map,RV=/[A-Z]/g,DV=new Set(["table","tbody","thead","tfoot","tr"]),MV=new Set(["td","th"]),XM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OV(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=UV(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=FV(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"?nw:bV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=QM(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function QM(e,t,n){if(t.type==="element")return LV(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return _V(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return PV(e,t,n);if(t.type==="mdxjsEsm")return BV(e,t);if(t.type==="root")return zV(e,t,n);if(t.type==="text")return IV(e,t)}function LV(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=nw,e.schema=a),e.ancestors.push(t);const i=ZM(e,t.tagName,!1),l=qV(e,t);let o=sw(e,t);return DV.has(t.tagName)&&(o=o.filter(function(f){return typeof f=="string"?!cV(f):!0})),WM(e,l,i,t),iw(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function _V(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)}Wf(e,t.position)}function BV(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wf(e,t.position)}function PV(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=nw,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:ZM(e,t.name,!0),l=VV(e,t),o=sw(e,t);return WM(e,l,i,t),iw(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function zV(e,t,n){const r={};return iw(r,sw(e,t)),e.create(t,e.Fragment,r,n)}function IV(e,t){return t.value}function WM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function iw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function FV(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 UV(e,t){return n;function n(r,a,i,l){const o=Array.isArray(i.children),f=rw(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 qV(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&aw.call(t.properties,a)){const i=HV(e,a,t.properties[a]);if(i){const[l,o]=i;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&MV.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 VV(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 Wf(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 Wf(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function sw(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:AV;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=QM(e,i,l);o!==void 0&&n.push(o)}return n}function HV(e,t,n){const r=gV(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?iV(n):wV(n)),r.property==="style"){let a=typeof n=="object"?n:GV(e,String(n));return e.stylePropertyNameCase==="css"&&(a=$V(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?vV[r.property]||r.property:r.attribute,n]}}function GV(e,t){try{return kV(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new br("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=XM+"#cannot-parse-style-attribute",a}}function ZM(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=HT(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=HT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return aw.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Wf(e)}function Wf(e,t){const n=new br("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=XM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $V(e){const t={};let n;for(n in e)aw.call(e,n)&&(t[KV(n)]=e[n]);return t}function KV(e){let t=e.replace(RV,YV);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function YV(e){return"-"+e.toLowerCase()}const Ky={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"]},XV={};function lw(e,t){const n=XV,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return JM(e,r,a)}function JM(e,t,n){if(QV(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 eN(e.children,t,n)}return Array.isArray(e)?eN(e,t,n):""}function eN(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=JM(e[a],t,n);return r.join("")}function QV(e){return!!(e&&typeof e=="object")}const tN=document.createElement("i");function ow(e){const t="&"+e+";";tN.innerHTML=t;const n=tN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function aa(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 Na(e,t){return e.length>0?(aa(e,e.length,0,t),e):t}const nN={}.hasOwnProperty;function eO(e){const t={};let n=-1;for(;++n<e.length;)WV(t,e[n]);return t}function WV(e,t){let n;for(n in t){const a=(nN.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){nN.call(a,l)||(a[l]=[]);const o=i[l];ZV(a[l],Array.isArray(o)?o:o?[o]:[])}}}function ZV(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);aa(e,0,0,r)}function tO(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 Ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nr=yl(/[A-Za-z]/),pr=yl(/[\dA-Za-z]/),JV=yl(/[#-'*+\--9=?A-Z^-~]/);function lp(e){return e!==null&&(e<32||e===127)}const Rb=yl(/\d/),e9=yl(/[\dA-Fa-f]/),t9=yl(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function Xt(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const Gp=yl(new RegExp("\\p{P}|\\p{S}","u")),go=yl(/\s/);function yl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function gc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&pr(e.charCodeAt(n+1))&&pr(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 n9={tokenize:r9};function r9(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 rt(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),l)}}const a9={tokenize:i9},rN={tokenize:s9};function i9(e){const t=this,n=[];let r=0,a,i,l;return o;function o(T){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,f,c)(T)}return c(T)}function f(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const k=t.events.length;let R=k,A;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){A=t.events[R][1].end;break}w(r);let D=k;for(;D<t.events.length;)t.events[D][1].end={...A},D++;return aa(t.events,R+1,0,t.events.slice(k)),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(rN,d,p)(T)}function d(T){return a&&C(),w(r),m(T)}function p(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(rN,y,x)(T)}function y(T){return r++,n.push([t.currentConstruct,t.containerState]),m(T)}function x(T){if(T===null){a&&C(),w(0),e.consume(T);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),b(T)}function b(T){if(T===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(T);return}return rt(T)?(e.consume(T),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(T),b)}function S(T,k){const R=t.sliceStream(T);if(k&&R.push(null),T.previous=i,i&&(i.next=T),i=T,a.defineSkip(T.start),a.write(R),t.parser.lazy[T.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<l&&(!a.events[A][1].end||a.events[A][1].end.offset>l))return;const D=t.events.length;let L=D,P,M;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(P){M=t.events[L][1].end;break}P=!0}for(w(r),A=D;A<t.events.length;)t.events[A][1].end={...M},A++;aa(t.events,L+1,0,t.events.slice(D)),t.events.length=A}}function w(T){let k=n.length;for(;k-- >T;){const R=n[k];t.containerState=R[1],R[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 s9(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 Zu(e){if(e===null||Xt(e)||go(e))return 1;if(Gp(e))return 2}function $p(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 Db={name:"attention",resolveAll:l9,tokenize:o9};function l9(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 p={...e[r][1].end},m={...e[n][1].start};aN(p,-f),aN(m,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,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=Na(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Na(c,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",i,t]]),c=Na(c,$p(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Na(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=Na(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,aa(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 o9(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Zu(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=Zu(f),p=!d||d===2&&a||n.includes(f),m=!a||a===2&&d||n.includes(r);return c._open=!!(i===42?p:p&&(a||!m)),c._close=!!(i===42?m:m&&(d||!p)),t(f)}}function aN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const u9={name:"autolink",tokenize:c9};function c9(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 Nr(y)?(e.consume(y),l):y===64?n(y):c(y)}function l(y){return y===43||y===45||y===46||pr(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||pr(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||lp(y)?n(y):(e.consume(y),f)}function c(y){return y===64?(e.consume(y),d):JV(y)?(e.consume(y),c):n(y)}function d(y){return pr(y)?p(y):n(y)}function p(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||pr(y))&&r++<63){const x=y===45?m:p;return e.consume(y),x}return n(y)}}const Ad={partial:!0,tokenize:f9};function f9(e,t,n){return r;function r(i){return Et(i)?At(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||rt(i)?t(i):n(i)}}const nO={continuation:{tokenize:h9},exit:v9,name:"blockQuote",tokenize:d9};function d9(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 h9(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(nO,t,n)(l)}}function v9(e){e.exit("blockQuote")}const rO={name:"characterEscape",tokenize:p9};function p9(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 t9(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const aO={name:"characterReference",tokenize:m9};function m9(e,t,n){const r=this;let a=0,i,l;return o;function o(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,l=pr,d(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=e9,d):(e.enter("characterReferenceValue"),i=7,l=Rb,d(p))}function d(p){if(p===59&&a){const m=e.exit("characterReferenceValue");return l===pr&&!ow(r.sliceSerialize(m))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&a++<i?(e.consume(p),d):n(p)}}const iN={partial:!0,tokenize:y9},sN={concrete:!0,name:"codeFenced",tokenize:g9};function g9(e,t,n){const r=this,a={partial:!0,tokenize:R};let i=0,l=0,o;return f;function f(A){return c(A)}function c(A){const D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(A)}function d(A){return A===o?(l++,e.consume(A),d):l<3?n(A):(e.exit("codeFencedFenceSequence"),Et(A)?At(e,p,"whitespace")(A):p(A))}function p(A){return A===null||rt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(iN,b,k)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(A))}function m(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):Et(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,y,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),m)}function y(A){return A===null||rt(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===o?n(A):(e.consume(A),x)}function b(A){return e.attempt(a,k,S)(A)}function S(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),w}function w(A){return i>0&&Et(A)?At(e,C,"linePrefix",i+1)(A):C(A)}function C(A){return A===null||rt(A)?e.check(iN,b,k)(A):(e.enter("codeFlowValue"),T(A))}function T(A){return A===null||rt(A)?(e.exit("codeFlowValue"),C(A)):(e.consume(A),T)}function k(A){return e.exit("codeFenced"),t(A)}function R(A,D,L){let P=0;return M;function M(G){return A.enter("lineEnding"),A.consume(G),A.exit("lineEnding"),_}function _(G){return A.enter("codeFencedFence"),Et(G)?At(A,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):B(G)}function B(G){return G===o?(A.enter("codeFencedFenceSequence"),q(G)):L(G)}function q(G){return G===o?(P++,A.consume(G),q):P>=l?(A.exit("codeFencedFenceSequence"),Et(G)?At(A,V,"whitespace")(G):V(G)):L(G)}function V(G){return G===null||rt(G)?(A.exit("codeFencedFence"),D(G)):L(G)}}}function y9(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 Yy={name:"codeIndented",tokenize:b9},x9={partial:!0,tokenize:w9};function b9(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):rt(c)?e.attempt(x9,l,f)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||rt(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function f(c){return e.exit("codeIndented"),t(c)}}function w9(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):rt(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):rt(l)?a(l):n(l)}}const S9={name:"codeText",previous:C9,resolve:E9,tokenize:T9};function E9(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 C9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function T9(e,t,n){let r=0,a,i;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),o(p)}function o(p){return p===96?(e.consume(p),r++,o):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(i=e.enter("codeTextSequence"),a=0,d(p)):rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||rt(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class N9{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&&Sf(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),Sf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Sf(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);Sf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Sf(this.left,n.reverse())}}}function Sf(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 iO(e){const t={};let n=-1,r,a,i,l,o,f,c;const d=new N9(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,k9(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 aa(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function k9(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,p,m=-1,y=n,x=0,b=0;const S=[b];for(;y;){for(;e.get(++a)[1]!==y;);i.push(a),y._tokenizer||(d=r.sliceStream(y),y.next||d.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(d),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=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&&(b=m+1,S.push(b),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 w=o.slice(S[m],S[m+1]),C=i.pop();f.push([C,C+w.length-1]),e.splice(C,2,w)}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 j9={resolve:R9,tokenize:D9},A9={partial:!0,tokenize:M9};function R9(e){return iO(e),e}function D9(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):rt(o)?e.check(A9,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 M9(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||rt(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 sO(e,t,n,r,a,i,l,o,f){const c=f||Number.POSITIVE_INFINITY;let d=0;return p;function p(w){return w===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(w),e.exit(i),m):w===null||w===32||w===41||lp(w)?n(w):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(w))}function m(w){return w===62?(e.enter(i),e.consume(w),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===62?(e.exit("chunkString"),e.exit(o),m(w)):w===null||w===60||rt(w)?n(w):(e.consume(w),w===92?x:y)}function x(w){return w===60||w===62||w===92?(e.consume(w),y):y(w)}function b(w){return!d&&(w===null||w===41||Xt(w))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(w)):d<c&&w===40?(e.consume(w),d++,b):w===41?(e.consume(w),d--,b):w===null||w===32||w===40||lp(w)?n(w):(e.consume(w),w===92?S:b)}function S(w){return w===40||w===41||w===92?(e.consume(w),b):b(w)}}function lO(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):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||rt(y)||o++>999?(e.exit("chunkString"),d(y)):(e.consume(y),f||(f=!Et(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(e.consume(y),o++,p):p(y)}}function oO(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):rt(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||rt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===l||m===92?(e.consume(m),d):d(m)}}function Uf(e,t){let n;return r;function r(a){return rt(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 O9={name:"definition",tokenize:_9},L9={partial:!0,tokenize:B9};function _9(e,t,n){const r=this;let a;return i;function i(y){return e.enter("definition"),l(y)}function l(y){return lO.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return a=Ia(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 Xt(y)?Uf(e,c)(y):c(y)}function c(y){return sO(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function d(y){return e.attempt(L9,p,p)(y)}function p(y){return Et(y)?At(e,m,"whitespace")(y):m(y)}function m(y){return y===null||rt(y)?(e.exit("definition"),r.parser.defined.push(a),t(y)):n(y)}}function B9(e,t,n){return r;function r(o){return Xt(o)?Uf(e,a)(o):n(o)}function a(o){return oO(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||rt(o)?t(o):n(o)}}const P9={name:"hardBreakEscape",tokenize:z9};function z9(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const I9={name:"headingAtx",resolve:F9,tokenize:U9};function F9(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"},aa(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function U9(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||Xt(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),f(d)):d===null||rt(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||Xt(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const q9=["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"],lN=["pre","script","style","textarea"],V9={concrete:!0,name:"htmlFlow",resolveTo:$9,tokenize:K9},H9={partial:!0,tokenize:X9},G9={partial:!0,tokenize:Y9};function $9(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 K9(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),p}function p(U){return U===33?(e.consume(U),m):U===47?(e.consume(U),i=!0,b):U===63?(e.consume(U),a=3,r.interrupt?t:z):Nr(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):Nr(U)?(e.consume(U),a=4,r.interrupt?t:z):n(U)}function y(U){return U===45?(e.consume(U),r.interrupt?t:z):n(U)}function x(U){const te="CDATA[";return U===te.charCodeAt(o++)?(e.consume(U),o===te.length?r.interrupt?t:B:x):n(U)}function b(U){return Nr(U)?(e.consume(U),l=String.fromCharCode(U),S):n(U)}function S(U){if(U===null||U===47||U===62||Xt(U)){const te=U===47,ie=l.toLowerCase();return!te&&!i&&lN.includes(ie)?(a=1,r.interrupt?t(U):B(U)):q9.includes(l.toLowerCase())?(a=6,te?(e.consume(U),w):r.interrupt?t(U):B(U)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(U):i?C(U):T(U))}return U===45||pr(U)?(e.consume(U),l+=String.fromCharCode(U),S):n(U)}function w(U){return U===62?(e.consume(U),r.interrupt?t:B):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||Nr(U)?(e.consume(U),k):Et(U)?(e.consume(U),T):M(U)}function k(U){return U===45||U===46||U===58||U===95||pr(U)?(e.consume(U),k):R(U)}function R(U){return U===61?(e.consume(U),A):Et(U)?(e.consume(U),R):T(U)}function A(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),A):L(U)}function D(U){return U===f?(e.consume(U),f=null,P):U===null||rt(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||Xt(U)?R(U):(e.consume(U),L)}function P(U){return U===47||U===62||Et(U)?T(U):n(U)}function M(U){return U===62?(e.consume(U),_):n(U)}function _(U){return U===null||rt(U)?B(U):Et(U)?(e.consume(U),_):n(U)}function B(U){return U===45&&a===2?(e.consume(U),F):U===60&&a===1?(e.consume(U),H):U===62&&a===4?(e.consume(U),I):U===63&&a===3?(e.consume(U),z):U===93&&a===5?(e.consume(U),Q):rt(U)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(H9,X,q)(U)):U===null||rt(U)?(e.exit("htmlFlowData"),q(U)):(e.consume(U),B)}function q(U){return e.check(G9,V,X)(U)}function V(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),G}function G(U){return U===null||rt(U)?q(U):(e.enter("htmlFlowData"),B(U))}function F(U){return U===45?(e.consume(U),z):B(U)}function H(U){return U===47?(e.consume(U),l="",Y):B(U)}function Y(U){if(U===62){const te=l.toLowerCase();return lN.includes(te)?(e.consume(U),I):B(U)}return Nr(U)&&l.length<8?(e.consume(U),l+=String.fromCharCode(U),Y):B(U)}function Q(U){return U===93?(e.consume(U),z):B(U)}function z(U){return U===62?(e.consume(U),I):U===45&&a===2?(e.consume(U),z):B(U)}function I(U){return U===null||rt(U)?(e.exit("htmlFlowData"),X(U)):(e.consume(U),I)}function X(U){return e.exit("htmlFlow"),t(U)}}function Y9(e,t,n){const r=this;return a;function a(l){return rt(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 X9(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ad,t,n)}}const Q9={name:"htmlText",tokenize:W9};function W9(e,t,n){const r=this;let a,i,l;return o;function o(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),c):z===47?(e.consume(z),R):z===63?(e.consume(z),T):Nr(z)?(e.consume(z),L):n(z)}function c(z){return z===45?(e.consume(z),d):z===91?(e.consume(z),i=0,x):Nr(z)?(e.consume(z),C):n(z)}function d(z){return z===45?(e.consume(z),y):n(z)}function p(z){return z===null?n(z):z===45?(e.consume(z),m):rt(z)?(l=p,H(z)):(e.consume(z),p)}function m(z){return z===45?(e.consume(z),y):p(z)}function y(z){return z===62?F(z):z===45?m(z):p(z)}function x(z){const I="CDATA[";return z===I.charCodeAt(i++)?(e.consume(z),i===I.length?b:x):n(z)}function b(z){return z===null?n(z):z===93?(e.consume(z),S):rt(z)?(l=b,H(z)):(e.consume(z),b)}function S(z){return z===93?(e.consume(z),w):b(z)}function w(z){return z===62?F(z):z===93?(e.consume(z),w):b(z)}function C(z){return z===null||z===62?F(z):rt(z)?(l=C,H(z)):(e.consume(z),C)}function T(z){return z===null?n(z):z===63?(e.consume(z),k):rt(z)?(l=T,H(z)):(e.consume(z),T)}function k(z){return z===62?F(z):T(z)}function R(z){return Nr(z)?(e.consume(z),A):n(z)}function A(z){return z===45||pr(z)?(e.consume(z),A):D(z)}function D(z){return rt(z)?(l=D,H(z)):Et(z)?(e.consume(z),D):F(z)}function L(z){return z===45||pr(z)?(e.consume(z),L):z===47||z===62||Xt(z)?P(z):n(z)}function P(z){return z===47?(e.consume(z),F):z===58||z===95||Nr(z)?(e.consume(z),M):rt(z)?(l=P,H(z)):Et(z)?(e.consume(z),P):F(z)}function M(z){return z===45||z===46||z===58||z===95||pr(z)?(e.consume(z),M):_(z)}function _(z){return z===61?(e.consume(z),B):rt(z)?(l=_,H(z)):Et(z)?(e.consume(z),_):P(z)}function B(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),a=z,q):rt(z)?(l=B,H(z)):Et(z)?(e.consume(z),B):(e.consume(z),V)}function q(z){return z===a?(e.consume(z),a=void 0,G):z===null?n(z):rt(z)?(l=q,H(z)):(e.consume(z),q)}function V(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||Xt(z)?P(z):(e.consume(z),V)}function G(z){return z===47||z===62||Xt(z)?P(z):n(z)}function F(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function H(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),Y}function Y(z){return Et(z)?At(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):Q(z)}function Q(z){return e.enter("htmlTextData"),l(z)}}const uw={name:"labelEnd",resolveAll:tH,resolveTo:nH,tokenize:rH},Z9={tokenize:aH},J9={tokenize:iH},eH={tokenize:sH};function tH(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&&aa(e,0,e.length,n),e}function nH(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=Na(o,e.slice(i+1,i+r+3)),o=Na(o,[["enter",d,t]]),o=Na(o,$p(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),o=Na(o,[["exit",d,t],e[l-2],e[l-1],["exit",c,t]]),o=Na(o,e.slice(l+1)),o=Na(o,[["exit",f,t]]),aa(e,i,e.length,o),e}function rH(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?p(m):(l=r.parser.defined.includes(Ia(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(Z9,d,l?d:p)(m):m===91?e.attempt(J9,d,l?c:p)(m):l?d(m):p(m)}function c(m){return e.attempt(eH,d,p)(m)}function d(m){return t(m)}function p(m){return i._balanced=!0,n(m)}}function aH(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Xt(p)?Uf(e,i)(p):i(p)}function i(p){return p===41?d(p):sO(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Xt(p)?Uf(e,f)(p):d(p)}function o(p){return n(p)}function f(p){return p===34||p===39||p===40?oO(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function c(p){return Xt(p)?Uf(e,d)(p):d(p)}function d(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function iH(e,t,n){const r=this;return a;function a(o){return lO.call(r,e,i,l,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Ia(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function sH(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 lH={name:"labelStartImage",resolveAll:uw.resolveAll,tokenize:oH};function oH(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 uH={name:"labelStartLink",resolveAll:uw.resolveAll,tokenize:cH};function cH(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 Xy={name:"lineEnding",tokenize:fH};function fH(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}const zv={name:"thematicBreak",tokenize:dH};function dH(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||rt(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 Pr={continuation:{tokenize:mH},exit:yH,name:"list",tokenize:pH},hH={partial:!0,tokenize:xH},vH={partial:!0,tokenize:gH};function pH(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:Rb(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(zv,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 Rb(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(Ad,r.interrupt?n:d,e.attempt(hH,m,p))}function d(y){return r.containerState.initialBlankLine=!0,i++,m(y)}function p(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 mH(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ad,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(vH,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(Pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function gH(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 yH(e){e.exit(this.containerState.type)}function xH(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 oN={name:"setextUnderline",resolveTo:bH,tokenize:wH};function bH(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 wH(e,t,n){const r=this;let a;return i;function i(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(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||rt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const SH={tokenize:EH};function EH(e){const t=this,n=e.attempt(Ad,r,e.attempt(this.parser.constructs.flowInitial,a,At(e,e.attempt(this.parser.constructs.flow,a,e.attempt(j9,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 CH={resolveAll:cO()},TH=uO("string"),NH=uO("text");function uO(e){return{resolveAll:cO(e==="text"?kH: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 p=a[d];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function cO(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 kH(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 jH={42:Pr,43:Pr,45:Pr,48:Pr,49:Pr,50:Pr,51:Pr,52:Pr,53:Pr,54:Pr,55:Pr,56:Pr,57:Pr,62:nO},AH={91:O9},RH={[-2]:Yy,[-1]:Yy,32:Yy},DH={35:I9,42:zv,45:[oN,zv],60:V9,61:oN,95:zv,96:sN,126:sN},MH={38:aO,92:rO},OH={[-5]:Xy,[-4]:Xy,[-3]:Xy,33:lH,38:aO,42:Db,60:[u9,Q9],91:uH,92:[P9,rO],93:uw,95:Db,96:S9},LH={null:[Db,CH]},_H={null:[42,95]},BH={null:[]},PH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_H,contentInitial:AH,disable:BH,document:jH,flow:DH,flowInitial:RH,insideSpan:LH,string:MH,text:OH},Symbol.toStringTag,{value:"Module"}));function zH(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(R),check:D(A),consume:C,enter:T,exit:k,interrupt:D(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:y,write:p};let d=t.tokenize.call(c,f);return t.resolveAll&&i.push(t),c;function p(_){return l=Na(l,_),S(),l[l.length-1]!==null?[]:(L(t,0),c.events=$p(i,c.events,c),c.events)}function m(_,B){return FH(y(_),B)}function y(_){return IH(l,_)}function x(){const{_bufferIndex:_,_index:B,line:q,column:V,offset:G}=r;return{_bufferIndex:_,_index:B,line:q,column:V,offset:G}}function b(_){a[_.line]=_.column,M()}function S(){let _;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<B.length;)w(B.charCodeAt(r._bufferIndex));else w(B)}}function w(_){d=d(_)}function C(_){rt(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,M()):_!==-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=_}function T(_,B){const q=B||{};return q.type=_,q.start=x(),c.events.push(["enter",q,c]),o.push(q),q}function k(_){const B=o.pop();return B.end=x(),c.events.push(["exit",B,c]),B}function R(_,B){L(_,B.from)}function A(_,B){B.restore()}function D(_,B){return q;function q(V,G,F){let H,Y,Q,z;return Array.isArray(V)?X(V):"tokenize"in V?X([V]):I(V);function I(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?F:U(oe[Y])}function U(oe){return ae;function ae(we){return z=P(),Q=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?ie():oe.tokenize.call(B?Object.assign(Object.create(c),B):c,f,te,ie)(we)}}function te(oe){return _(Q,z),G}function ie(oe){return z.restore(),++Y<H.length?U(H[Y]):F}}}function L(_,B){_.resolveAll&&!i.includes(_)&&i.push(_),_.resolve&&aa(c.events,B,c.events.length-B,_.resolve(c.events.slice(B),c)),_.resolveTo&&(c.events=_.resolveTo(c.events,c))}function P(){const _=x(),B=c.previous,q=c.currentConstruct,V=c.events.length,G=Array.from(o);return{from:V,restore:F};function F(){r=_,c.previous=B,c.currentConstruct=q,c.events.length=V,o=G,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function IH(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 FH(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=`
|
|
456
|
+
`;break}case-3:{l=`\r
|
|
457
|
+
`;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 UH(e){const r={constructs:eO([PH,...(e||{}).extensions||[]]),content:a(n9),defined:[],document:a(a9),flow:a(SH),lazy:{},string:a(TH),text:a(NH)};return r;function a(i){return l;function l(o){return zH(r,i,o)}}}function qH(e){for(;!iO(e););return e}const uN=/[\0\t\n\r]/g;function VH(){let e=1,t="",n=!0,r;return a;function a(i,l,o){const f=[];let c,d,p,m,y;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(uN.lastIndex=p,c=uN.exec(i),m=c&&c.index!==void 0?c.index:i.length,y=i.charCodeAt(m),!c){t=i.slice(p);break}if(y===10&&p===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<m&&(f.push(i.slice(p,m)),e+=m-p),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}p=m+1}return o&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const HH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GH(e){return e.replace(HH,$H)}function $H(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return tO(n.slice(i?2:1),i?16:10)}return ow(n)||e}const fO={}.hasOwnProperty;function KH(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),YH(n)(qH(UH(n).document().write(VH()(e,t,!0))))}function YH(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ve),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Be),blockQuote:i(J),characterEscape:P,characterReference:P,codeFenced:i(ne),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ne,l),codeText:i(re,l),codeTextData:P,data:P,codeFlowValue:P,definition:i(ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(Ne),hardBreakEscape:i(lt),hardBreakTrailing:i(lt),htmlFlow:i(Je,l),htmlFlowData:P,htmlText:i(Je,l),htmlTextData:P,image:i(Qe),label:l,link:i(Ve),listItem:i(Ke),listItemValue:m,listOrdered:i(Re,p),listUnordered:i(Re),paragraph:i(Xe),reference:U,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Be),strong:i(st),thematicBreak:i(ft)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:fe,autolinkProtocol:we,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:oe,characterReference:ae,codeFenced:f(S),codeFencedFence:b,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:f(w),codeText:f(G),codeTextData:M,data:M,definition:f(),definitionDestinationString:k,definitionLabelString:C,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(B),hardBreakTrailing:f(B),htmlFlow:f(q),htmlFlowData:M,htmlText:f(V),htmlTextData:M,image:f(H),label:Q,labelText:Y,lineEnding:_,link:f(F),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:te,resourceDestinationString:z,resourceTitleString:I,resource:X,setextHeading:f(L),setextHeadingLineSequence:D,setextHeadingText:A,strong:f(),thematicBreak:f()}};dO(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},Ie=[];let Me=-1;for(;++Me<he.length;)if(he[Me][1].type==="listOrdered"||he[Me][1].type==="listUnordered")if(he[Me][0]==="enter")Ie.push(Me);else{const Oe=Ie.pop();Me=a(he,Oe,Me)}for(Me=-1;++Me<he.length;){const Oe=t[he[Me][0]];fO.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]||cN).call(De,void 0,Oe[0])}for(Ce.position={start:Bs(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Bs(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 Ie=Ce-1,Me=-1,Oe=!1,ye,K,le,pe;for(;++Ie<=De;){const de=he[Ie];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=Ie),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=Ie;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||Ie,0,["exit",ye,de[2]]),Ie++,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(Ie,0,["enter",xe,de[2]]),Ie++,De++,le=void 0,pe=!0}}}return he[Ce][1]._spread=Oe,De}function i(he,Ce){return De;function De(Ie){o.call(this,he(Ie),Ie),Ce&&Ce.call(this,Ie)}}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:Bs(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(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==he.type&&(Ce?Ce.call(this,he,Ie[0]):(Ie[1]||cN).call(this,he,Ie[0]));else throw new Error("Cannot close `"+he.type+"` ("+Ff({start:he.start,end:he.end})+"): it’s not open");De.position.end=Bs(he.end)}function d(){return lw(this.stack.pop())}function p(){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 b(){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 w(){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=Ia(this.sliceSerialize(he)).toLowerCase()}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function k(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function R(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const De=this.sliceSerialize(he).length;Ce.depth=De}}function A(){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 P(he){const De=this.stack[this.stack.length-1].children;let Ie=De[De.length-1];(!Ie||Ie.type!=="text")&&(Ie=Pe(),Ie.position={start:Bs(he.start),end:void 0},De.push(Ie)),this.stack.push(Ie)}function M(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=Bs(he.end)}function _(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=Ce.children[Ce.children.length-1];De.position.end=Bs(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(P.call(this,he),M.call(this,he))}function B(){this.data.atHardBreak=!0}function q(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function V(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function G(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function F(){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=GH(Ce),De.identifier=Ia(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 Ie=he.children;De.children=Ie}else De.alt=Ce}function z(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function I(){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=Ia(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 Ie;De?(Ie=tO(Ce,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=ow(Ce);const Me=this.stack[this.stack.length-1];Me.value+=Ie}function ae(he){const Ce=this.stack.pop();Ce.position.end=Bs(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 Ne(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function Je(){return{type:"html",value:""}}function Qe(){return{type:"image",title:null,url:"",alt:null}}function Ve(){return{type:"link",title:null,url:"",children:[]}}function Re(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ke(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Xe(){return{type:"paragraph",children:[]}}function st(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function ft(){return{type:"thematicBreak"}}}function Bs(e){return{line:e.line,column:e.column,offset:e.offset}}function dO(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?dO(e,r):XH(e,r)}}function XH(e,t){let n;for(n in t)if(fO.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 cN(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ff({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ff({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ff({start:t.start,end:t.end})+") is still open")}function QH(e){const t=this;t.parser=n;function n(r){return KH(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WH(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 ZH(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
458
|
+
`}]}function JH(e,t){const n=t.value?t.value+`
|
|
459
|
+
`:"",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 e7(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function t7(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n7(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=gc(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 r7(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 a7(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hO(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 i7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hO(e,t);const a={src:gc(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 s7(e,t){const n={src:gc(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 l7(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 o7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hO(e,t);const a={href:gc(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 u7(e,t){const n={href:gc(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 c7(e,t,n){const r=e.all(t),a=n?f7(n):vO(t),i={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.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:`
|
|
460
|
+
`}),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:`
|
|
461
|
+
`});const c={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,c),e.applyData(t,c)}function f7(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=vO(n[r])}return t}function vO(e){const t=e.spread;return t??e.children.length>1}function d7(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 h7(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function v7(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function p7(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function m7(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=rw(t.children[1]),f=KM(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 g7(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 p=t.children[f],m={},y=l?l[f]:void 0;y&&(m.align=y);let x={type:"element",tagName:i,properties:m,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,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 y7(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fN=9,dN=32;function x7(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(hN(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(hN(t.slice(a),a>0,!1)),i.join("")}function hN(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===fN||i===dN;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===fN||i===dN;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function b7(e,t){const n={type:"text",value:x7(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function w7(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const S7={blockquote:WH,break:ZH,code:JH,delete:e7,emphasis:t7,footnoteReference:n7,heading:r7,html:a7,imageReference:i7,image:s7,inlineCode:l7,linkReference:o7,link:u7,listItem:c7,list:d7,paragraph:h7,root:v7,strong:p7,table:m7,tableCell:y7,tableRow:g7,text:b7,thematicBreak:w7,toml:dv,yaml:dv,definition:dv,footnoteDefinition:dv};function dv(){}const pO=-1,Kp=0,qf=1,op=2,cw=3,fw=4,dw=5,hw=6,mO=7,gO=8,vN=typeof self=="object"?self:globalThis,E7=(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 Kp:case pO:return n(l,a);case qf:{const o=n([],a);for(const f of l)o.push(r(f));return o}case op:{const o=n({},a);for(const[f,c]of l)o[r(f)]=r(c);return o}case cw:return n(new Date(l),a);case fw:{const{source:o,flags:f}=l;return n(new RegExp(o,f),a)}case dw:{const o=n(new Map,a);for(const[f,c]of l)o.set(r(f),r(c));return o}case hw:{const o=n(new Set,a);for(const f of l)o.add(r(f));return o}case mO:{const{name:o,message:f}=l;return n(new vN[o](f),a)}case gO: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 vN[i](l),a)};return r},pN=e=>E7(new Map,e)(0),hu="",{toString:C7}={},{keys:T7}=Object,Ef=e=>{const t=typeof e;if(t!=="object"||!e)return[Kp,t];const n=C7.call(e).slice(8,-1);switch(n){case"Array":return[qf,hu];case"Object":return[op,hu];case"Date":return[cw,hu];case"RegExp":return[fw,hu];case"Map":return[dw,hu];case"Set":return[hw,hu];case"DataView":return[qf,n]}return n.includes("Array")?[qf,n]:n.includes("Error")?[mO,n]:[op,n]},hv=([e,t])=>e===Kp&&(t==="function"||t==="symbol"),N7=(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]=Ef(l);switch(o){case Kp:{let d=l;switch(f){case"bigint":o=gO,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);d=null;break;case"undefined":return a([pO],l)}return a([o,d],l)}case qf:{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=[],p=a([o,d],l);for(const m of l)d.push(i(m));return p}case op:{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=[],p=a([o,d],l);for(const m of T7(l))(e||!hv(Ef(l[m])))&&d.push([i(m),i(l[m])]);return p}case cw:return a([o,l.toISOString()],l);case fw:{const{source:d,flags:p}=l;return a([o,{source:d,flags:p}],l)}case dw:{const d=[],p=a([o,d],l);for(const[m,y]of l)(e||!(hv(Ef(m))||hv(Ef(y))))&&d.push([i(m),i(y)]);return p}case hw:{const d=[],p=a([o,d],l);for(const m of l)(e||!hv(Ef(m)))&&d.push(i(m));return p}}const{message:c}=l;return a([o,{name:f,message:c}],l)};return i},mN=(e,{json:t,lossy:n}={})=>{const r=[];return N7(!(t||n),!!t,new Map,r)(e),r},up=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?pN(mN(e,t)):structuredClone(e):(e,t)=>pN(mN(e,t));function k7(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 j7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function A7(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||k7,r=e.options.footnoteBackLabel||j7,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),p=String(c.identifier).toUpperCase(),m=gc(p.toLowerCase());let y=0;const x=[],b=e.footnoteCounts.get(p);for(;b!==void 0&&++y<=b;){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 w={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,w),o.push(w)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...up(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
462
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
463
|
+
`}]}}const Yp=(function(e){if(e==null)return O7;if(typeof e=="function")return Xp(e);if(typeof e=="object")return Array.isArray(e)?R7(e):D7(e);if(typeof e=="string")return M7(e);throw new Error("Expected function, string, or object as test")});function R7(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Yp(e[n]);return Xp(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function D7(e){const t=e;return Xp(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function M7(e){return Xp(t);function t(n){return n&&n.type===e}}function Xp(e){return t;function t(n,r,a){return!!(L7(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function O7(){return!0}function L7(e){return e!==null&&typeof e=="object"&&"type"in e}const yO=[],_7=!0,Mb=!1,B7="skip";function xO(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=Yp(a),l=r?-1:1;o(e,void 0,[])();function o(f,c,d){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return m;function m(){let y=yO,x,b,S;if((!t||i(f,c,d[d.length-1]||void 0))&&(y=P7(n(f,d)),y[0]===Mb))return y;if("children"in f&&f.children){const w=f;if(w.children&&y[0]!==B7)for(b=(r?w.children.length:-1)+l,S=d.concat(w);b>-1&&b<w.children.length;){const C=w.children[b];if(x=o(C,b,S)(),x[0]===Mb)return x;b=typeof x[1]=="number"?x[1]:b+l}}return y}}}function P7(e){return Array.isArray(e)?e:typeof e=="number"?[_7,e]:e==null?yO:[e]}function vw(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),xO(e,i,o,a);function o(f,c){const d=c[c.length-1],p=d?d.children.indexOf(f):void 0;return l(f,p,d)}}const Ob={}.hasOwnProperty,z7={};function I7(e,t){const n=t||z7,r=new Map,a=new Map,i=new Map,l={...S7,...n.handlers},o={all:c,applyData:U7,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:F7,wrap:V7};return vw(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const p=d.type==="definition"?r:a,m=String(d.identifier).toUpperCase();p.has(m)||p.set(m,d)}}),o;function f(d,p){const m=d.type,y=o.handlers[m];if(Ob.call(o.handlers,m)&&y)return y(o,d,p);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in d){const{children:b,...S}=d,w=up(S);return w.children=o.all(d),w}return up(d)}return(o.options.unknownHandler||q7)(o,d,p)}function c(d){const p=[];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=gN(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=gN(b.value))}Array.isArray(x)?p.push(...x):p.push(x)}}}return p}}function F7(e,t){e.position&&(t.position=jV(e))}function U7(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,up(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function q7(e,t){const n=t.data||{},r="value"in t&&!(Ob.call(n,"hProperties")||Ob.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 V7(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
464
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
465
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
466
|
+
`}),n}function gN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yN(e,t){const n=I7(e,t),r=n.one(e,void 0),a=A7(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
|
|
467
|
+
`},a),i}function H7(e,t){return e&&"run"in e?async function(n,r){const a=yN(n,{file:r,...t});await e.run(a,r)}:function(n,r){return yN(n,{file:r,...e||t})}}function xN(e){if(e)throw e}var Qy,bN;function G7(){if(bN)return Qy;bN=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"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!p)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 Qy=function f(){var c,d,p,m,y,x,b=arguments[0],S=1,w=arguments.length,C=!1;for(typeof b=="boolean"&&(C=b,b=arguments[1]||{},S=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});S<w;++S)if(c=arguments[S],c!=null)for(d in c)p=o(b,d),m=o(c,d),b!==m&&(C&&m&&(i(m)||(y=a(m)))?(y?(y=!1,x=p&&a(p)?p:[]):x=p&&i(p)?p:{},l(b,{name:d,newValue:f(C,x,m)})):typeof m<"u"&&l(b,{name:d,newValue:m}));return b},Qy}var $7=G7();const Wy=vd($7);function Lb(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 K7(){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 p=-1;if(f){l(f);return}for(;++p<a.length;)(c[p]===null||c[p]===void 0)&&(c[p]=a[p]);a=c,d?Y7(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 Y7(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 ni={basename:X7,dirname:Q7,extname:W7,join:Z7,sep:"/"};function X7(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Rd(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 Q7(e){if(Rd(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 W7(e){Rd(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 Z7(...e){let t=-1,n;for(;++t<e.length;)Rd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":J7(n)}function J7(e){Rd(e);const t=e.codePointAt(0)===47;let n=eG(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function eG(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 Rd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const tG={cwd:nG};function nG(){return"/"}function _b(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rG(e){if(typeof e=="string")e=new URL(e);else if(!_b(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 aG(e)}function aG(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 Zy=["history","path","basename","stem","extname","dirname"];class bO{constructor(t){let n;t?_b(t)?n={path:t}:typeof t=="string"||iG(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":tG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zy.length;){const i=Zy[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)Zy.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ni.basename(this.path):void 0}set basename(t){ex(t,"basename"),Jy(t,"basename"),this.path=ni.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ni.dirname(this.path):void 0}set dirname(t){wN(this.basename,"dirname"),this.path=ni.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ni.extname(this.path):void 0}set extname(t){if(Jy(t,"extname"),wN(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=ni.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_b(t)&&(t=rG(t)),ex(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ni.basename(this.path,this.extname):void 0}set stem(t){ex(t,"stem"),Jy(t,"stem"),this.path=ni.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 br(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 Jy(e,t){if(e&&e.includes(ni.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ni.sep+"`")}function ex(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function iG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sG=(function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),lG={}.hasOwnProperty;class pw extends sG{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=K7()}copy(){const t=new pw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Wy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(rx("data",this.frozen),this.namespace[t]=n,this):lG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(rx("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=vv(t),r=this.parser||this.Parser;return tx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),tx("process",this.parser||this.Parser),nx("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,l){const o=vv(t),f=r.parse(o);r.run(f,o,function(d,p,m){if(d||!p||!m)return c(d);const y=p,x=r.stringify(y,m);cG(x)?m.value=x:m.result=x,c(d,m)});function c(d,p){d||!p?l(d):i?i(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),tx("processSync",this.parser||this.Parser),nx("processSync",this.compiler||this.Compiler),this.process(t,a),EN("processSync","process",n),r;function a(i,l){n=!0,xN(i),r=l}}run(t,n,r){SN(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=vv(n);a.run(t,f,c);function c(d,p,m){const y=p||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),EN("runSync","run",r),a;function i(l,o){xN(l),a=o,r=!0}}stringify(t,n){this.freeze();const r=vv(n),a=this.compiler||this.Compiler;return nx("stringify",a),SN(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(rx("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,...p]=c;f(d,p)}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=Wy(!0,a.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const p=c[d];i(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,d){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===c){m=p;break}if(m===-1)r.push([c,...d]);else if(d.length>0){let[y,...x]=d;const b=r[m][1];Lb(b)&&Lb(y)&&(y=Wy(!0,b,y)),r[m]=[c,y,...x]}}}}const oG=new pw().freeze();function tx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function nx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function rx(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 SN(e){if(!Lb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function EN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vv(e){return uG(e)?e:new bO(e)}function uG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cG(e){return typeof e=="string"||fG(e)}function fG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dG="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",CN=[],TN={allowDangerousHtml:!0},hG=/^(https?|ircs?|mailto|xmpp)$/i,vG=[{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 pG(e){const t=mG(e),n=gG(e);return yG(t.runSync(t.parse(n),n),e)}function mG(e){const t=e.rehypePlugins||CN,n=e.remarkPlugins||CN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...TN}:TN;return oG().use(QH).use(n).use(H7,r).use(t)}function gG(e){const t=e.children||"",n=new bO;return typeof t=="string"&&(n.value=t),n}function yG(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,f=t.urlTransform||xG;for(const d of vG)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+dG+d.id,void 0);return vw(e,c),OV(e,{Fragment:v.Fragment,components:a,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let y;for(y in Ky)if(Object.hasOwn(Ky,y)&&Object.hasOwn(d.properties,y)){const x=d.properties[y],b=Ky[y];(b===null||b.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 p=="number"&&(y=!r(d,p,m)),y&&m&&typeof p=="number")return o&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function xG(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||hG.test(e.slice(0,t))?e:""}function NN(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 bG(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wG(e,t,n){const a=Yp((n||{}).ignore||[]),i=SG(t);let l=-1;for(;++l<i.length;)xO(e,"text",o);function o(c,d){let p=-1,m;for(;++p<d.length;){const y=d[p],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 p=d[d.length-1],m=i[l][0],y=i[l][1];let x=0;const S=p.children.indexOf(c);let w=!1,C=[];m.lastIndex=0;let T=m.exec(c.value);for(;T;){const k=T.index,R={index:T.index,input:T.input,stack:[...d,c]};let A=y(...T,R);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?m.lastIndex=k+1:(x!==k&&C.push({type:"text",value:c.value.slice(x,k)}),Array.isArray(A)?C.push(...A):A&&C.push(A),x=k+T[0].length,w=!0),!m.global)break;T=m.exec(c.value)}return w?(x<c.value.length&&C.push({type:"text",value:c.value.slice(x)}),p.children.splice(S,1,...C)):C=[c],S+C.length}}function SG(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([EG(a[0]),CG(a[1])])}return t}function EG(e){return typeof e=="string"?new RegExp(bG(e),"g"):e}function CG(e){return typeof e=="function"?e:function(){return e}}const ax="phrasing",ix=["autolink","link","image","label"];function TG(){return{transforms:[MG],enter:{literalAutolink:kG,literalAutolinkEmail:sx,literalAutolinkHttp:sx,literalAutolinkWww:sx},exit:{literalAutolink:DG,literalAutolinkEmail:RG,literalAutolinkHttp:jG,literalAutolinkWww:AG}}}function NG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ax,notInConstruct:ix},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ax,notInConstruct:ix},{character:":",before:"[ps]",after:"\\/",inConstruct:ax,notInConstruct:ix}]}}function kG(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sx(e){this.config.enter.autolinkProtocol.call(this,e)}function jG(e){this.config.exit.autolinkProtocol.call(this,e)}function AG(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 RG(e){this.config.exit.autolinkEmail.call(this,e)}function DG(e){this.exit(e)}function MG(e){wG(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),LG]],{ignore:["link","linkReference"]})}function OG(e,t,n,r,a){let i="";if(!wO(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!_G(n)))return!1;const l=BG(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 LG(e,t,n,r){return!wO(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function _G(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 BG(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=NN(e,"(");let i=NN(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 wO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||go(n)||Gp(n))&&(!t||n!==47)}SO.peek=GG;function PG(){this.buffer()}function zG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IG(){this.buffer()}function FG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qG(e){this.exit(e)}function VG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HG(e){this.exit(e)}function GG(){return"["}function SO(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 $G(){return{enter:{gfmFootnoteCallString:PG,gfmFootnoteCall:zG,gfmFootnoteDefinitionLabelString:IG,gfmFootnoteDefinition:FG},exit:{gfmFootnoteCallString:UG,gfmFootnoteCall:qG,gfmFootnoteDefinitionLabelString:VG,gfmFootnoteDefinition:HG}}}function KG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:SO},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?`
|
|
468
|
+
`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?EO:YG))),c(),f}}function YG(e,t,n){return t===0?e:EO(e,t,n)}function EO(e,t,n){return(n?"":" ")+e}const XG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];CO.peek=e$;function QG(){return{canContainEols:["delete"],enter:{strikethrough:ZG},exit:{strikethrough:JG}}}function WG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XG}],handlers:{delete:CO}}}function ZG(e){this.enter({type:"delete",children:[]},e)}function JG(e){this.exit(e)}function CO(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 e$(){return"~"}function t$(e){return e.length}function n$(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||t$,i=[],l=[],o=[],f=[];let c=0,d=-1;for(;++d<e.length;){const b=[],S=[];let w=-1;for(e[d].length>c&&(c=e[d].length);++w<e[d].length;){const C=r$(e[d][w]);if(n.alignDelimiters!==!1){const T=a(C);S[w]=T,(f[w]===void 0||T>f[w])&&(f[w]=T)}b.push(C)}l[d]=b,o[d]=S}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<c;)i[p]=kN(r[p]);else{const b=kN(r);for(;++p<c;)i[p]=b}p=-1;const m=[],y=[];for(;++p<c;){const b=i[p];let S="",w="";b===99?(S=":",w=":"):b===108?S=":":b===114&&(w=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[p]-S.length-w.length);const T=S+"-".repeat(C)+w;n.alignDelimiters!==!1&&(C=S.length+C+w.length,C>f[p]&&(f[p]=C),y[p]=C),m[p]=T}l.splice(1,0,m),o.splice(1,0,y),d=-1;const x=[];for(;++d<l.length;){const b=l[d],S=o[d];p=-1;const w=[];for(;++p<c;){const C=b[p]||"";let T="",k="";if(n.alignDelimiters!==!1){const R=f[p]-(S[p]||0),A=i[p];A===114?T=" ".repeat(R):A===99?R%2?(T=" ".repeat(R/2+.5),k=" ".repeat(R/2-.5)):(T=" ".repeat(R/2),k=T):k=" ".repeat(R)}n.delimiterStart!==!1&&!p&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||p)&&w.push(" "),n.alignDelimiters!==!1&&w.push(T),w.push(C),n.alignDelimiters!==!1&&w.push(k),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||p!==c-1)&&w.push("|")}x.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return x.join(`
|
|
469
|
+
`)}function r$(e){return e==null?"":String(e)}function kN(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 a$(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()),i$);return a(),l}function i$(e,t,n){return">"+(n?"":" ")+e}function s$(e,t){return jN(e,t.inConstruct,!0)&&!jN(e,t.notInConstruct,!1)}function jN(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 AN(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
470
|
+
`&&s$(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
471
|
+
`}function l$(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 o$(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 u$(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 c$(e,t,n,r){const a=u$(n),i=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(o$(e,n)){const p=n.enter("codeIndented"),m=n.indentLines(i,f$);return p(),m}const o=n.createTracker(r),f=a.repeat(Math.max(l$(i,a)+1,3)),c=n.enter("codeFenced");let d=o.move(f);if(e.lang){const p=n.enter(`codeFencedLang${l}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
|
|
472
|
+
`,encode:["`"],...o.current()})),p()}return d+=o.move(`
|
|
473
|
+
`),i&&(d+=o.move(i+`
|
|
474
|
+
`)),d+=o.move(f),c(),d}function f$(e,t,n){return(n?"":" ")+e}function mw(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 d$(e,t,n,r){const a=mw(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?" ":`
|
|
475
|
+
`,...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 h$(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 Zf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cp(e,t,n){const r=Zu(e),a=Zu(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}}TO.peek=v$;function TO(e,t,n,r){const a=h$(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=cp(r.before.charCodeAt(r.before.length-1),c,a);d.inside&&(f=Zf(c)+f.slice(1));const p=f.charCodeAt(f.length-1),m=cp(r.after.charCodeAt(0),p,a);m.inside&&(f=f.slice(0,-1)+Zf(p));const y=l.move(a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+f+y}function v$(e,t,n){return n.options.emphasis||"*"}function p$(e,t){let n=!1;return vw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Mb}),!!((!e.depth||e.depth<3)&&lw(e)&&(t.options.setext||n))}function m$(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(p$(e,n)){const d=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...i.current(),before:`
|
|
476
|
+
`,after:`
|
|
477
|
+
`});return p(),d(),m+`
|
|
478
|
+
`+(a===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
|
|
479
|
+
`))+1))}const l="#".repeat(a),o=n.enter("headingAtx"),f=n.enter("phrasing");i.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
480
|
+
`,...i.current()});return/^[\t ]/.test(c)&&(c=Zf(c.charCodeAt(0))+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),f(),o(),c}NO.peek=g$;function NO(e){return e.value||""}function g$(){return"<"}kO.peek=y$;function kO(e,t,n,r){const a=mw(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 y$(){return"!"}jO.peek=x$;function jO(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 p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=d,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function x$(){return"!"}AO.peek=b$;function AO(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 b$(){return"`"}function RO(e,t){const n=lw(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))}DO.peek=w$;function DO(e,t,n,r){const a=mw(n),i=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let o,f;if(RO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),o(),n.stack=d,p}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 w$(e,t,n){return RO(e,n)?"<":"["}MO.peek=S$;function MO(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 p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=d,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function S$(){return"["}function gw(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 E$(e){const t=gw(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 C$(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 OO(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 T$(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?C$(n):gw(n);const o=e.ordered?l==="."?")":".":E$(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),OO(n)===l&&d){let p=-1;for(;++p<e.children.length;){const m=e.children[p];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 N$(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 k$(e,t,n,r){const a=N$(n);let i=n.bulletCurrent||gw(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(p,m,y){return m?(y?"":" ".repeat(l))+p:(y?i:i+" ".repeat(l-i.length))+p}}function j$(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),a(),l}const A$=Yp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function R$(e,t,n,r){return(e.children.some(function(l){return A$(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function D$(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}LO.peek=M$;function LO(e,t,n,r){const a=D$(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=cp(r.before.charCodeAt(r.before.length-1),c,a);d.inside&&(f=Zf(c)+f.slice(1));const p=f.charCodeAt(f.length-1),m=cp(r.after.charCodeAt(0),p,a);m.inside&&(f=f.slice(0,-1)+Zf(p));const y=l.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},o+f+y}function M$(e,t,n){return n.options.strong||"*"}function O$(e,t,n,r){return n.safe(e.value,r)}function L$(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 _$(e,t,n){const r=(OO(n)+(n.options.ruleSpaces?" ":"")).repeat(L$(n));return n.options.ruleSpaces?r.slice(0,-1):r}const _O={blockquote:a$,break:AN,code:c$,definition:d$,emphasis:TO,hardBreak:AN,heading:m$,html:NO,image:kO,imageReference:jO,inlineCode:AO,link:DO,linkReference:MO,list:T$,listItem:k$,paragraph:j$,root:R$,strong:LO,text:O$,thematicBreak:_$};function B$(){return{enter:{table:P$,tableData:RN,tableHeader:RN,tableRow:I$},exit:{codeText:F$,table:z$,tableData:lx,tableHeader:lx,tableRow:lx}}}function P$(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 z$(e){this.exit(e),this.data.inTable=void 0}function I$(e){this.enter({type:"tableRow",children:[]},e)}function lx(e){this.exit(e)}function RN(e){this.enter({type:"tableCell",children:[]},e)}function F$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U$));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U$(e,t){return t==="|"?t:e}function q$(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
481
|
+
`,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,b,S){return c(d(y,b,S),y.align)}function o(y,x,b,S){const w=p(y,b,S),C=c([w]);return C.slice(0,C.indexOf(`
|
|
482
|
+
`))}function f(y,x,b,S){const w=b.enter("tableCell"),C=b.enter("phrasing"),T=b.containerPhrasing(y,{...S,before:i,after:i});return C(),w(),T}function c(y,x){return n$(y,{align:x,alignDelimiters:r,padding:n,stringLength:a})}function d(y,x,b){const S=y.children;let w=-1;const C=[],T=x.enter("table");for(;++w<S.length;)C[w]=p(S[w],x,b);return T(),C}function p(y,x,b){const S=y.children;let w=-1;const C=[],T=x.enter("tableRow");for(;++w<S.length;)C[w]=f(S[w],y,x,b);return T(),C}function m(y,x,b){let S=_O.inlineCode(y,x,b);return b.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function V$(){return{exit:{taskListCheckValueChecked:DN,taskListCheckValueUnchecked:DN,paragraph:G$}}}function H$(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$$}}}function DN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function G$(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 $$(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=_O.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 K$(){return[TG(),$G(),QG(),B$(),V$()]}function Y$(e){return{extensions:[NG(),KG(e),WG(),q$(e),H$()]}}const X$={tokenize:tK,partial:!0},BO={tokenize:nK,partial:!0},PO={tokenize:rK,partial:!0},zO={tokenize:aK,partial:!0},Q$={tokenize:iK,partial:!0},IO={name:"wwwAutolink",tokenize:J$,previous:UO},FO={name:"protocolAutolink",tokenize:eK,previous:qO},rs={name:"emailAutolink",tokenize:Z$,previous:VO},gi={};function W$(){return{text:gi}}let ql=48;for(;ql<123;)gi[ql]=rs,ql++,ql===58?ql=65:ql===91&&(ql=97);gi[43]=rs;gi[45]=rs;gi[46]=rs;gi[95]=rs;gi[72]=[rs,FO];gi[104]=[rs,FO];gi[87]=[rs,IO];gi[119]=[rs,IO];function Z$(e,t,n){const r=this;let a,i;return l;function l(p){return!Bb(p)||!VO.call(r,r.previous)||yw(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(p))}function o(p){return Bb(p)?(e.consume(p),o):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(Q$,d,c)(p):p===45||p===95||pr(p)?(i=!0,e.consume(p),f):d(p)}function c(p){return e.consume(p),a=!0,f}function d(p){return i&&a&&Nr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function J$(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!UO.call(r,r.previous)||yw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(X$,e.attempt(BO,e.attempt(PO,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function eK(e,t,n){const r=this;let a="",i=!1;return l;function l(p){return(p===72||p===104)&&qO.call(r,r.previous)&&!yw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(p),e.consume(p),o):n(p)}function o(p){if(Nr(p)&&a.length<5)return a+=String.fromCodePoint(p),e.consume(p),o;if(p===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),i?c:(i=!0,f)):n(p)}function c(p){return p===null||lp(p)||Xt(p)||go(p)||Gp(p)?n(p):e.attempt(BO,e.attempt(PO,d),n)(p)}function d(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function tK(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 nK(e,t,n){let r,a,i;return l;function l(c){return c===46||c===95?e.check(zO,f,o)(c):c===null||Xt(c)||go(c)||c!==45&&Gp(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 rK(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(zO,t,i)(l):l===null||Xt(l)||go(l)?t(l):(e.consume(l),a)}function i(l){return l===41&&r++,e.consume(l),a}}function aK(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||Xt(o)||go(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||Xt(o)||go(o)?t(o):r(o)}function i(o){return Nr(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):Nr(o)?(e.consume(o),l):n(o)}}function iK(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return pr(i)?n(i):t(i)}}function UO(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Xt(e)}function qO(e){return!Nr(e)}function VO(e){return!(e===47||Bb(e))}function Bb(e){return e===43||e===45||e===46||e===95||pr(e)}function yw(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 sK={tokenize:vK,partial:!0};function lK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fK,continuation:{tokenize:dK},exit:hK}},text:{91:{name:"gfmFootnoteCall",tokenize:cK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:oK,resolveTo:uK}}}}function oK(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=Ia(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 uK(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 cK(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return o;function o(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(i>999||p===93&&!l||p===null||p===91||Xt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(Ia(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Xt(p)||(l=!0),i++,e.consume(p),p===92?d:c}function d(p){return p===91||p===92||p===93?(e.consume(p),i++,c):c(p)}}function fK(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||Xt(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return i=Ia(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Xt(x)||(o=!0),l++,e.consume(x),x===92?p:d}function p(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 dK(e,t,n){return e.check(Ad,t,e.attempt(sK,t,n))}function hK(e){e.exit("gfmFootnoteDefinition")}function vK(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 pK(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)},p={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",p,o]],y=o.parser.constructs.insideSpan.null;y&&aa(m,m.length,0,$p(y,l.slice(c+1,f),o)),aa(m,m.length,0,[["exit",p,o],["enter",l[f][1],o],["exit",l[f][1],o],["exit",d,o]]),aa(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 p=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 b=Zu(c);if(x===126)return p>1?f(x):(l.consume(x),p++,y);if(p<2&&!n)return f(x);const S=l.exit("strikethroughSequenceTemporary"),w=Zu(x);return S._open=!w||w===2&&!!b,S._close=!b||b===2&&!!w,o(x)}}}class mK{constructor(){this.map=[]}add(t,n,r){gK(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 gK(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 yK(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 xK(){return{flow:{null:{name:"table",tokenize:bK,resolveAll:wK}}}}function bK(e,t,n){const r=this;let a=0,i=0,l;return o;function o(M){let _=r.events.length-1;for(;_>-1;){const V=r.events[_][1].type;if(V==="lineEnding"||V==="linePrefix")_--;else break}const B=_>-1?r.events[_][1].type:null,q=B==="tableHead"||B==="tableRow"?A:f;return q===A&&r.parser.lazy[r.now().line]?n(M):q(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):rt(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"),p(M)))}function p(M){return M===null||M===124||Xt(M)?(e.exit("data"),d(M)):(e.consume(M),M===92?m:p)}function m(M){return M===92||M===124?(e.consume(M),p):p(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"),b):R(M)}function b(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"),w):M===45?(i+=1,w(M)):M===null||rt(M)?k(M):R(M)}function w(M){return M===45?(e.enter("tableDelimiterFiller"),C(M)):R(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,k,"whitespace")(M):k(M)}function k(M){return M===124?x(M):M===null||rt(M)?!l||a!==i?R(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):R(M)}function R(M){return n(M)}function A(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||rt(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||Xt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?P:L)}function P(M){return M===92||M===124?(e.consume(M),L):L(M)}}function wK(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,p;const m=new mK;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(o=!1,f!==0&&(MN(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,p=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],p=pv(m,t,i,a,void 0,p),i=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],p=pv(m,t,i,a,void 0,p)),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],p=pv(m,t,i,a,n,p)):l[1]!==0&&(p=pv(m,t,l,a,n,p)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&MN(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=yK(t.events,n))}return e}function pv(e,t,n,r,a,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},Su(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const f=Su(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=Su(t.events,n[2]),d=Su(t.events,n[3]),p={type:o,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",p,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,b=n[3]-n[2]-1;e.add(x,b,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return a!==void 0&&(i.end=Object.assign({},Su(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function MN(e,t,n,r,a){const i=[],l=Su(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 Su(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const SK={name:"tasklistCheck",tokenize:CK};function EK(){return{text:{91:SK}}}function CK(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 Xt(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 rt(f)?t(f):Et(f)?e.check({tokenize:TK},t,n)(f):n(f)}}function TK(e,t,n){return At(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function NK(e){return eO([W$(),lK(),pK(e),xK(),EK()])}const kK={};function jK(e){const t=this,n=e||kK,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(NK(n)),i.push(K$()),l.push(Y$(n))}function Ra({content:e,className:t}){return v.jsx("div",{className:je("prose-myco",t),children:v.jsx(pG,{remarkPlugins:[jK],children:e})})}function AK({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?v.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-surface-dim/90 backdrop-blur-sm",onClick:n,children:[v.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:v.jsx(sc,{className:"h-5 w-5"})}),e.length>1&&v.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&&v.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:v.jsx(y1,{className:"h-6 w-6"})}),l&&v.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:v.jsx(sa,{className:"h-6 w-6"})}),v.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 RK=3;function DK({activity:e}){const[t,n]=j.useState(!1),r=e.success===1,a=!!(e.tool_input||e.tool_output_summary||e.error_message);return v.jsxs("div",{className:je("border-l-2 transition-colors",t?"border-l-primary/30":"border-transparent hover:border-l-primary/20"),children:[v.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?v.jsx(Ua,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):v.jsx(sa,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),v.jsx("span",{className:"font-mono text-xs font-medium text-on-surface",children:e.tool_name}),e.file_path&&v.jsx("span",{className:"truncate font-sans text-xs text-on-surface-variant flex-1",children:e.file_path}),v.jsx("span",{className:"shrink-0 ml-auto"}),v.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:LF(e.duration_ms)}),r?v.jsx(x1,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):v.jsx(wd,{className:"h-3.5 w-3.5 shrink-0 text-tertiary"})]}),v.jsx("div",{className:"grid transition-[grid-template-rows] duration-150 ease-out",style:{gridTemplateRows:t?"1fr":"0fr"},children:v.jsx("div",{className:"overflow-hidden",children:v.jsxs("div",{className:"px-8 pb-3 space-y-2",children:[!a&&v.jsx("p",{className:"font-sans text-xs text-on-surface-variant/60 italic py-1",children:"No input/output details captured"}),e.tool_input&&v.jsxs("div",{children:[v.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Input"}),v.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&&v.jsxs("div",{children:[v.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Output"}),v.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&&v.jsxs("div",{children:[v.jsx("div",{className:"font-sans text-xs font-medium text-tertiary mb-1",children:"Error"}),v.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 MK({batchId:e,activityCount:t}){const[n,r]=j.useState(!1),{data:a,isLoading:i}=V8(n?e:void 0);if(t===0)return null;const l=a??[];return v.jsxs("div",{className:"border-t border-[var(--ghost-border)]",children:[v.jsxs("button",{type:"button",className:je("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?v.jsx(Ua,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):v.jsx(sa,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),v.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Tool Calls"}),v.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:t})]}),v.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:n?"1fr":"0fr"},children:v.jsxs("div",{className:"overflow-hidden",children:[i&&v.jsx("div",{className:"px-3 py-2 space-y-1",children:Array.from({length:Math.min(t,RK)}).map((o,f)=>v.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container-high w-full"},f))}),!i&&l.length>0&&v.jsx("div",{className:"space-y-0",children:l.map(o=>v.jsx(DK,{activity:o},o.id))})]})})]})}const Pb=120,OK="h-7 w-7",LK=3;function _K(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function BK(e){return e?e.length>Pb?e.slice(0,Pb)+"…":e:"(no prompt)"}function PK({batch:e,batchAttachments:t,defaultOpen:n=!1,promptIndex:r,isLast:a}){const[i,l]=j.useState(n),[o,f]=j.useState(null);return v.jsxs("div",{className:"relative flex gap-4",children:[v.jsxs("div",{className:"relative flex flex-col items-center shrink-0",style:{width:"28px"},children:[r>0&&v.jsx("div",{className:"absolute top-0 w-px bg-outline-variant/40",style:{height:"14px"}}),v.jsx("div",{className:je(OK,"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&&v.jsx("div",{className:"flex-1 w-px bg-outline-variant/40"})]}),v.jsxs(Ze,{level:"low",className:"flex-1 overflow-hidden rounded-md max-w-full border border-outline-variant/10 mb-2",children:[v.jsxs("button",{type:"button",className:je("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?v.jsx(Ua,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}):v.jsx(sa,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}),v.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-2 mb-0.5",children:[v.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0",children:"Prompt"}),e.activity_count>0&&v.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&&v.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:_K(e.started_at)})]}),v.jsx("p",{className:"font-sans text-sm text-on-surface truncate",children:i?e.user_prompt??"(no prompt)":BK(e.user_prompt)})]})]}),v.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:i?"1fr":"0fr"},children:v.jsxs("div",{className:"overflow-hidden",children:[v.jsxs("div",{className:"px-4 pt-0 pb-3 overflow-hidden",children:[e.user_prompt&&e.user_prompt.length>Pb&&v.jsx(Ra,{content:e.user_prompt}),t.length>0&&v.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:t.map((c,d)=>v.jsx("button",{type:"button",className:"rounded-md overflow-hidden hover:ring-2 hover:ring-primary/40 transition-all",onClick:()=>f(d),children:v.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&&v.jsx(AK,{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&&v.jsx(MK,{batchId:e.id,activityCount:e.activity_count}),e.response_summary&&v.jsx("div",{className:"border-t border-[var(--ghost-border)] overflow-hidden",children:v.jsxs("div",{className:"flex gap-3 px-4 py-3",children:[v.jsx("div",{className:"w-0.5 shrink-0 rounded-full bg-primary/30"}),v.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[v.jsx(xd,{className:"h-3 w-3 text-primary/60"}),v.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Response"})]}),v.jsx(Ra,{content:e.response_summary})]})]})})]})})]})]})}function zK({sessionId:e}){const{data:t,isLoading:n}=q8(e),{data:r}=H8(e),a=r??[],{byBatchId:i,byTurnNumber:l}=j.useMemo(()=>{var d;const f=new Map,c=new Map;for(const p of a){if(p.prompt_batch_id!=null){const y=f.get(p.prompt_batch_id)??[];y.push(p),f.set(p.prompt_batch_id,y)}const m=(d=p.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(p),c.set(y,x)}}return{byBatchId:f,byTurnNumber:c}},[a]);if(n)return v.jsx("div",{className:"space-y-3 pl-11",children:Array.from({length:LK}).map((f,c)=>v.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?v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[v.jsx(kp,{className:"h-8 w-8 opacity-30"}),v.jsx("span",{className:"font-sans text-sm",children:"No prompts recorded"})]}):v.jsx("div",{children:o.map((f,c)=>{const d=i.get(f.id)??(f.prompt_number!==null?l.get(f.prompt_number)??[]:[]);return v.jsx(PK,{batch:f,batchAttachments:d,defaultOpen:c===o.length-1,promptIndex:c,isLast:c===o.length-1},f.id)})})}const IK="▲",FK="▼";function UK(e){const t=(e.match(/- \[x\]/gi)??[]).length,n=(e.match(/- \[ \]/g)??[]).length;return{total:t+n,checked:t}}const qK={active:"bg-green-500/10 text-green-500",completed:"bg-blue-500/10 text-blue-500"},VK="bg-muted text-muted-foreground";function HK({status:e}){const t=je("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",qK[e]??VK);return v.jsx("span",{className:t,children:e})}function GK({plan:e,initialExpanded:t=!1}){const[n,r]=j.useState(t),a=j.useMemo(()=>e.content?UK(e.content):null,[e.content]),i=a!==null&&a.total>0,l=i?Math.round(a.checked/a.total*100):0;return v.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 overflow-hidden",children:[v.jsxs("div",{className:"flex items-start gap-3 p-4",children:[v.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[v.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[v.jsx(HK,{status:e.status}),e.title&&v.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.title})]}),e.source_path&&v.jsx("p",{className:"font-mono text-xs text-muted-foreground truncate",title:e.source_path,children:e.source_path}),v.jsxs("div",{className:"flex gap-3 font-sans text-xs text-muted-foreground",children:[v.jsxs("span",{children:["Created ",hi(e.created_at)]}),e.updated_at&&e.updated_at!==e.created_at&&v.jsxs("span",{title:vb(e.updated_at),children:["Updated ",hi(e.updated_at)]})]}),i&&v.jsxs("div",{className:"space-y-1 pt-0.5",children:[v.jsxs("div",{className:"flex items-center justify-between font-sans text-xs text-muted-foreground",children:[v.jsxs("span",{children:[a.checked,"/",a.total," items"]}),v.jsxs("span",{children:[l,"%"]})]}),v.jsx("div",{className:"h-1.5 rounded-full bg-border overflow-hidden",children:v.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})})]})]}),e.content&&v.jsx("button",{onClick:()=>r(o=>!o),className:"shrink-0 mt-0.5 text-xs text-muted-foreground hover:text-on-surface transition-colors cursor-pointer","aria-label":n?"Collapse plan":"Expand plan",children:n?IK:FK})]}),n&&e.content&&v.jsx("div",{className:"border-t border-border px-4 py-3",children:v.jsx(Ra,{content:e.content,className:"text-sm"})})]})}function $K({sessionId:e,expandedPlanId:t}){const{data:n,isLoading:r,isError:a}=PM(e);return r?v.jsx("div",{className:"flex h-32 items-center justify-center",children:v.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Loading plans..."})}):a?v.jsx("div",{className:"flex h-32 items-center justify-center",children:v.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Failed to load plans."})}):!n||n.length===0?v.jsx("div",{className:"flex h-32 items-center justify-center rounded-lg border border-border bg-muted/30",children:v.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"No plans captured for this session"})}):v.jsx("div",{className:"space-y-3",children:n.map(i=>v.jsx(GK,{plan:i,initialExpanded:String(i.id)===t},i.id))})}const ox=8;function KK(e){return e===null?"—":z1(new Date(e*1e3).toISOString())}const YK=1500;function Cf({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),YK)},[t]),f=a?v.jsx("code",{className:"text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5",children:t}):v.jsx("span",{className:je("text-xs text-on-surface",n&&"font-mono"),children:t});return v.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0",children:[v.jsx("span",{className:"shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant",children:e}),r?v.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&&v.jsx(bd,{className:"h-3 w-3 text-primary shrink-0"})]}):v.jsx("span",{className:"min-w-0",children:f})]})}function ON({label:e,value:t,activeTab:n,onClick:r}){return v.jsx("button",{onClick:()=>r(t),className:je("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 XK({id:e}){const t=ts(),{data:n,isLoading:r,isError:a,error:i}=U8(e),{data:l}=rV(),o=q1(),[f,c]=j.useState("idle"),[d,p]=j.useState(!1),[m,y]=j.useState(()=>new URLSearchParams(window.location.search).get("tab")==="plans"?"plans":"conversation"),[x]=j.useState(()=>new URLSearchParams(window.location.search).get("plan")),b=_M(),{data:S}=BM(d?e:null),{data:w}=PM(e);if(r)return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),v.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),v.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[v.jsx(Wn,{className:"h-5 w-5 animate-spin"}),v.jsx("span",{className:"font-sans text-sm",children:"Loading session..."})]})]});if(a||!n)return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),v.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Session not found"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:i instanceof Error?i.message:"Unknown error"})]})]});const C=l?aV(l.symbionts,n.agent,e):null;return v.jsxs("div",{className:"p-6 space-y-6 overflow-hidden",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),v.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[v.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:n.title??n.id.slice(0,ox)}),v.jsx(IM,{status:n.status}),n.agent&&v.jsx(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:n.agent}),v.jsxs(ze,{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"?v.jsx(Wn,{className:"h-4 w-4 animate-spin"}):v.jsx(S1,{className:"h-4 w-4"}),f==="done"?"Summary Requested":"Generate Summary"]}),v.jsxs(ze,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>p(!0),children:[v.jsx(co,{className:"h-4 w-4"}),"Delete"]})]}),v.jsxs("div",{className:"flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant",children:[n.user&&v.jsxs("span",{children:["User: ",v.jsx("span",{className:"text-on-surface",children:n.user})]}),n.branch&&v.jsxs("span",{children:["Branch: ",v.jsx("span",{className:"font-mono text-on-surface",children:n.branch})]}),v.jsxs("span",{children:["Started ",KK(n.started_at)]}),n.ended_at&&v.jsxs("span",{children:["Duration: ",Bp(n.started_at,n.ended_at)]})]})]}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsx(an,{label:"Prompts",value:String(n.prompt_count),accent:"sage"}),v.jsx(an,{label:"Tool Calls",value:String(n.tool_count),accent:"sage"}),v.jsx(an,{label:"Plans",value:String((w==null?void 0:w.length)??0),accent:"outline"})]}),v.jsxs(Ze,{level:"low",className:"p-4 overflow-hidden",children:[v.jsx(zt,{className:"mb-3",children:"Metadata"}),v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6",children:[v.jsx(Cf,{label:"Session ID",value:e,copyable:!0}),C&&v.jsx(Cf,{label:"Resume",value:C,copyable:!0,code:!0}),n.parent_session_id&&v.jsx(Cf,{label:"Parent",value:n.parent_session_id}),n.parent_session_reason&&v.jsx(Cf,{label:"Reason",value:n.parent_session_reason,mono:!1}),n.project_root&&v.jsx(Cf,{label:"Project",value:n.project_root})]})]}),n.summary&&v.jsxs(Ze,{level:"low",className:"p-4 overflow-hidden",children:[v.jsx(zt,{className:"mb-2",children:"Summary"}),v.jsx("p",{className:"font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words",children:n.summary})]}),v.jsxs("div",{className:"min-w-0 overflow-hidden",children:[v.jsxs("div",{className:"flex gap-0 border-b border-border mb-4",children:[v.jsx(ON,{label:"Conversation",value:"conversation",activeTab:m,onClick:y}),v.jsx(ON,{label:"Plans",value:"plans",activeTab:m,onClick:y})]}),m==="conversation"&&v.jsx(zK,{sessionId:e}),m==="plans"&&v.jsx($K,{sessionId:e,expandedPlanId:x})]}),v.jsx(G1,{open:d,onOpenChange:p,title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:v.jsx(co,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"ID",value:n.id.slice(0,ox)},{label:"Title",value:n.title||n.id.slice(0,ox)}]:[],impact:S?[{label:"Prompts",value:S.promptCount},{label:"Spores",value:S.sporeCount},{label:"Attachments",value:S.attachmentCount},{label:"Graph Edges",value:S.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:()=>{b.mutate(n.id,{onSuccess:()=>{p(!1),t("/sessions")}})},isPending:b.isPending})]})}function LN(){const{id:e}=PB();return e?v.jsx(XK,{id:e}):v.jsx("div",{className:"p-6",children:v.jsx(tV,{})})}function zb(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 QK(e){if(Array.isArray(e))return e}function WK(e){if(Array.isArray(e))return zb(e)}function xl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZK(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,GO(r.key),r)}}function bl(e,t,n){return t&&ZK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=xw(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.
|
|
483
|
+
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 HO(e,t,n){return(t=GO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eY(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 tY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
484
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
485
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ln(e,t){return QK(e)||eY(e,t)||xw(e,t)||tY()}function fp(e){return WK(e)||JK(e)||xw(e)||nY()}function rY(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 GO(e){var t=rY(e,"string");return typeof t=="symbol"?t:t+""}function Un(e){"@babel/helpers - typeof";return Un=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},Un(e)}function xw(e,t){if(e){if(typeof e=="string")return zb(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)?zb(e,t):void 0}}var Pn=typeof window>"u"?null:window,_N=Pn?Pn.navigator:null;Pn&&Pn.document;var aY=Un(""),$O=Un({}),iY=Un(function(){}),sY=typeof HTMLElement>"u"?"undefined":Un(HTMLElement),Dd=function(t){return t&&t.instanceString&&mn(t.instanceString)?t.instanceString():null},tt=function(t){return t!=null&&Un(t)==aY},mn=function(t){return t!=null&&Un(t)===iY},Yt=function(t){return!ia(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)},Dt=function(t){return t!=null&&Un(t)===$O&&!Yt(t)&&t.constructor===Object},lY=function(t){return t!=null&&Un(t)===$O},Ae=function(t){return t!=null&&Un(t)===Un(1)&&!isNaN(t)},oY=function(t){return Ae(t)&&Math.floor(t)===t},dp=function(t){if(sY!=="undefined")return t!=null&&t instanceof HTMLElement},ia=function(t){return Md(t)||KO(t)},Md=function(t){return Dd(t)==="collection"&&t._private.single},KO=function(t){return Dd(t)==="collection"&&!t._private.single},bw=function(t){return Dd(t)==="core"},YO=function(t){return Dd(t)==="stylesheet"},uY=function(t){return Dd(t)==="event"},cl=function(t){return t==null?!0:!!(t===""||t.match(/^\s+$/))},cY=function(t){return typeof HTMLElement>"u"?!1:t instanceof HTMLElement},fY=function(t){return Dt(t)&&Ae(t.x1)&&Ae(t.x2)&&Ae(t.y1)&&Ae(t.y2)},dY=function(t){return lY(t)&&mn(t.then)},hY=function(){return _N&&_N.userAgent.match(/msie|trident|edge/i)},Ju=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},ww=Ju(function(e){return e.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}),Qp=Ju(function(e){return e.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}),XO=Ju(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),BN=function(t){return cl(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},Zs=function(t,n){return t.slice(-1*n.length)===n},In="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",vY="rgb[a]?\\(("+In+"[%]?)\\s*,\\s*("+In+"[%]?)\\s*,\\s*("+In+"[%]?)(?:\\s*,\\s*("+In+"))?\\)",pY="rgb[a]?\\((?:"+In+"[%]?)\\s*,\\s*(?:"+In+"[%]?)\\s*,\\s*(?:"+In+"[%]?)(?:\\s*,\\s*(?:"+In+"))?\\)",mY="hsl[a]?\\(("+In+")\\s*,\\s*("+In+"[%])\\s*,\\s*("+In+"[%])(?:\\s*,\\s*("+In+"))?\\)",gY="hsl[a]?\\((?:"+In+")\\s*,\\s*(?:"+In+"[%])\\s*,\\s*(?:"+In+"[%])(?:\\s*,\\s*(?:"+In+"))?\\)",yY="\\#[0-9a-fA-F]{3}",xY="\\#[0-9a-fA-F]{6}",QO=function(t,n){return t<n?-1:t>n?1:0},bY=function(t,n){return-1*QO(t,n)},at=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},wY=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]}},SY=function(t){var n,r,a,i,l,o,f,c;function d(x,b,S){return S<0&&(S+=1),S>1&&(S-=1),S<1/6?x+(b-x)*6*S:S<1/2?b:S<2/3?x+(b-x)*(2/3-S)*6:x}var p=new RegExp("^"+mY+"$").exec(t);if(p){if(r=parseInt(p[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(p[2]),a<0||a>100||(a=a/100,i=parseFloat(p[3]),i<0||i>100)||(i=i/100,l=p[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},EY=function(t){var n,r=new RegExp("^"+vY+"$").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},CY=function(t){return TY[t.toLowerCase()]},WO=function(t){return(Yt(t)?t:null)||CY(t)||wY(t)||EY(t)||SY(t)},TY={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]},ZO=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Dt(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}},JO=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Dt(l))throw Error("Tried to get map with object key");if(n=n[l],n==null)return n}return n},mv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Od(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ux,PN;function Ld(){if(PN)return ux;PN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return ux=e,ux}var cx,zN;function NY(){if(zN)return cx;zN=1;var e=typeof mv=="object"&&mv&&mv.Object===Object&&mv;return cx=e,cx}var fx,IN;function Wp(){if(IN)return fx;IN=1;var e=NY(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return fx=n,fx}var dx,FN;function kY(){if(FN)return dx;FN=1;var e=Wp(),t=function(){return e.Date.now()};return dx=t,dx}var hx,UN;function jY(){if(UN)return hx;UN=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return hx=t,hx}var vx,qN;function AY(){if(qN)return vx;qN=1;var e=jY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return vx=n,vx}var px,VN;function Sw(){if(VN)return px;VN=1;var e=Wp(),t=e.Symbol;return px=t,px}var mx,HN;function RY(){if(HN)return mx;HN=1;var e=Sw(),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 mx=i,mx}var gx,GN;function DY(){if(GN)return gx;GN=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return gx=n,gx}var yx,$N;function eL(){if($N)return yx;$N=1;var e=Sw(),t=RY(),n=DY(),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 yx=l,yx}var xx,KN;function MY(){if(KN)return xx;KN=1;function e(t){return t!=null&&typeof t=="object"}return xx=e,xx}var bx,YN;function _d(){if(YN)return bx;YN=1;var e=eL(),t=MY(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return bx=r,bx}var wx,XN;function OY(){if(XN)return wx;XN=1;var e=AY(),t=Ld(),n=_d(),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 p=i.test(c);return p||l.test(c)?o(c.slice(2),p?2:8):a.test(c)?r:+c}return wx=f,wx}var Sx,QN;function LY(){if(QN)return Sx;QN=1;var e=Ld(),t=kY(),n=OY(),r="Expected a function",a=Math.max,i=Math.min;function l(o,f,c){var d,p,m,y,x,b,S=0,w=!1,C=!1,T=!0;if(typeof o!="function")throw new TypeError(r);f=n(f)||0,e(c)&&(w=!!c.leading,C="maxWait"in c,m=C?a(n(c.maxWait)||0,f):m,T="trailing"in c?!!c.trailing:T);function k(q){var V=d,G=p;return d=p=void 0,S=q,y=o.apply(G,V),y}function R(q){return S=q,x=setTimeout(L,f),w?k(q):y}function A(q){var V=q-b,G=q-S,F=f-V;return C?i(F,m-G):F}function D(q){var V=q-b,G=q-S;return b===void 0||V>=f||V<0||C&&G>=m}function L(){var q=t();if(D(q))return P(q);x=setTimeout(L,A(q))}function P(q){return x=void 0,T&&d?k(q):(d=p=void 0,y)}function M(){x!==void 0&&clearTimeout(x),S=0,d=b=p=x=void 0}function _(){return x===void 0?y:P(t())}function B(){var q=t(),V=D(q);if(d=arguments,p=this,b=q,V){if(x===void 0)return R(b);if(C)return clearTimeout(x),x=setTimeout(L,f),k(b)}return x===void 0&&(x=setTimeout(L,f)),y}return B.cancel=M,B.flush=_,B}return Sx=l,Sx}var _Y=LY(),Bd=Od(_Y),Ex=Pn?Pn.performance:null,tL=Ex&&Ex.now?function(){return Ex.now()}:function(){return Date.now()},BY=(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(tL())},1e3/60)}})(),hp=function(t){return BY(t)},Zi=tL,Kl=9261,nL=65599,Eu=5381,rL=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kl,r=n,a;a=t.next(),!a.done;)r=r*nL+a.value|0;return r},Jf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kl;return n*nL+t|0},ed=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Eu;return(n<<5)+n+t|0},PY=function(t,n){return t*2097152+n},Ps=function(t){return t[0]*2097152+t[1]},gv=function(t,n){return[Jf(t[0],n[0]),ed(t[1],n[1])]},WN=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 rL(l,n)},yo=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 rL(l,n)},aL=function(){return zY(arguments)},zY=function(t){for(var n,r=0;r<t.length;r++){var a=t[r];r===0?n=yo(a):n=yo(a,n)}return n};function IY(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 FY=function(t,n,r,a,i,l){return{x:(t-r)*i+r,y:(n-a)*l+a}};function UY(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=IY(e.x,e.y,r,a,n),f=FY(o.x,o.y,r,a,i,l);return{x:f.x,y:f.y}}var ZN=!0,qY=console.warn!=null,VY=console.trace!=null,Ew=Number.MAX_SAFE_INTEGER||9007199254740991,iL=function(){return!0},vp=function(){return!1},JN=function(){return 0},Cw=function(){},un=function(t){throw new Error(t)},sL=function(t){if(t!==void 0)ZN=!!t;else return ZN},Pt=function(t){sL()&&(qY?console.warn(t):(console.log(t),VY&&console.trace()))},HY=function(t){return at({},t)},oi=function(t){return t==null?t:Yt(t)?t.slice():Dt(t)?HY(t):t},GY=function(t){return t.slice()},lL=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},$Y={},oL=function(){return $Y},ur=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}},fl=function(t,n,r){for(var a=t.length-1;a>=0;a--)t[a]===n&&t.splice(a,1)},Tw=function(t){t.splice(0,t.length)},KY=function(t,n){for(var r=0;r<n.length;r++){var a=n[r];t.push(a)}},Fr=function(t,n,r){return r&&(n=XO(r,n)),t[n]},qi=function(t,n,r,a){r&&(n=XO(r,n)),t[n]=a},YY=(function(){function e(){xl(this,e),this._obj={}}return bl(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]}}])})(),Ki=typeof Map<"u"?Map:YY,XY="undefined",QY=(function(){function e(t){if(xl(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 bl(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)}}])})(),yc=(typeof Set>"u"?"undefined":Un(Set))!==XY?Set:QY,Zp=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(t===void 0||n===void 0||!bw(t)){un("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"){un("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 yc,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=[];Yt(n.classes)?c=n.classes:tt(n.classes)&&(c=n.classes.split(/\s+/));for(var d=0,p=c.length;d<p;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&&(Pt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(y))},ek=function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},function(r,a,i){var l;Dt(r)&&!ia(r)&&(l=r,r=l.roots||l.root,a=l.visit,i=l.directed),i=arguments.length===2&&!mn(a)?a:i,a=mn(a)?a:function(){};for(var o=this._private.cy,f=r=tt(r)?this.filter(r):r,c=[],d=[],p={},m={},y={},x=0,b,S=this.byGroup(),w=S.nodes,C=S.edges,T=0;T<f.length;T++){var k=f[T],R=k.id();k.isNode()&&(c.unshift(k),t.bfs&&(y[R]=!0,d.push(k)),m[R]=0)}for(var A=function(){var q=t.bfs?c.shift():c.pop(),V=q.id();if(t.dfs){if(y[V])return 0;y[V]=!0,d.push(q)}var G=m[V],F=p[V],H=F!=null?F.source():null,Y=F!=null?F.target():null,Q=F==null?void 0:q.same(H)?Y[0]:H[0],z;if(z=a(q,F,Q,x++,G),z===!0)return b=q,1;if(z===!1)return 1;for(var I=q.connectedEdges().filter(function(oe){return(!i||oe.source().same(q))&&C.has(oe)}),X=0;X<I.length;X++){var U=I[X],te=U.connectedNodes().filter(function(oe){return!oe.same(q)&&w.has(oe)}),ie=te.id();te.length!==0&&!y[ie]&&(te=te[0],c.push(te),t.bfs&&(y[ie]=!0,d.push(te)),p[ie]=U,m[ie]=m[V]+1)}},D;c.length!==0&&(D=A(),!(D!==0&&D===1)););for(var L=o.collection(),P=0;P<d.length;P++){var M=d[P],_=p[M.id()];_!=null&&L.push(_),L.push(M)}return{path:o.collection(L),found:o.collection(b)}}},td={breadthFirstSearch:ek({bfs:!0}),depthFirstSearch:ek({dfs:!0})};td.bfs=td.breadthFirstSearch;td.dfs=td.depthFirstSearch;var Iv={exports:{}},WY=Iv.exports,tk;function ZY(){return tk||(tk=1,(function(e,t){(function(){var n,r,a,i,l,o,f,c,d,p,m,y,x,b,S;a=Math.floor,p=Math.min,r=function(w,C){return w<C?-1:w>C?1:0},d=function(w,C,T,k,R){var A;if(T==null&&(T=0),R==null&&(R=r),T<0)throw new Error("lo must be non-negative");for(k==null&&(k=w.length);T<k;)A=a((T+k)/2),R(C,w[A])<0?k=A:T=A+1;return[].splice.apply(w,[T,T-T].concat(C)),C},o=function(w,C,T){return T==null&&(T=r),w.push(C),b(w,0,w.length-1,T)},l=function(w,C){var T,k;return C==null&&(C=r),T=w.pop(),w.length?(k=w[0],w[0]=T,S(w,0,C)):k=T,k},c=function(w,C,T){var k;return T==null&&(T=r),k=w[0],w[0]=C,S(w,0,T),k},f=function(w,C,T){var k;return T==null&&(T=r),w.length&&T(w[0],C)<0&&(k=[w[0],C],C=k[0],w[0]=k[1],S(w,0,T)),C},i=function(w,C){var T,k,R,A,D,L;for(C==null&&(C=r),A=(function(){L=[];for(var P=0,M=a(w.length/2);0<=M?P<M:P>M;0<=M?P++:P--)L.push(P);return L}).apply(this).reverse(),D=[],k=0,R=A.length;k<R;k++)T=A[k],D.push(S(w,T,C));return D},x=function(w,C,T){var k;if(T==null&&(T=r),k=w.indexOf(C),k!==-1)return b(w,0,k,T),S(w,k,T)},m=function(w,C,T){var k,R,A,D,L;if(T==null&&(T=r),R=w.slice(0,C),!R.length)return R;for(i(R,T),L=w.slice(C),A=0,D=L.length;A<D;A++)k=L[A],f(R,k,T);return R.sort(T).reverse()},y=function(w,C,T){var k,R,A,D,L,P,M,_,B;if(T==null&&(T=r),C*10<=w.length){if(A=w.slice(0,C).sort(T),!A.length)return A;for(R=A[A.length-1],M=w.slice(C),D=0,P=M.length;D<P;D++)k=M[D],T(k,R)<0&&(d(A,k,0,null,T),A.pop(),R=A[A.length-1]);return A}for(i(w,T),B=[],L=0,_=p(C,w.length);0<=_?L<_:L>_;0<=_?++L:--L)B.push(l(w,T));return B},b=function(w,C,T,k){var R,A,D;for(k==null&&(k=r),R=w[T];T>C;){if(D=T-1>>1,A=w[D],k(R,A)<0){w[T]=A,T=D;continue}break}return w[T]=R},S=function(w,C,T){var k,R,A,D,L;for(T==null&&(T=r),R=w.length,L=C,A=w[C],k=2*C+1;k<R;)D=k+1,D<R&&!(T(w[k],w[D])<0)&&(k=D),w[C]=w[k],C=k,k=2*C+1;return w[C]=A,b(w,L,C,T)},n=(function(){w.push=o,w.pop=l,w.replace=c,w.pushpop=f,w.heapify=i,w.updateItem=x,w.nlargest=m,w.nsmallest=y;function w(C){this.cmp=C??r,this.nodes=[]}return w.prototype.push=function(C){return o(this.nodes,C,this.cmp)},w.prototype.pop=function(){return l(this.nodes,this.cmp)},w.prototype.peek=function(){return this.nodes[0]},w.prototype.contains=function(C){return this.nodes.indexOf(C)!==-1},w.prototype.replace=function(C){return c(this.nodes,C,this.cmp)},w.prototype.pushpop=function(C){return f(this.nodes,C,this.cmp)},w.prototype.heapify=function(){return i(this.nodes,this.cmp)},w.prototype.updateItem=function(C){return x(this.nodes,C,this.cmp)},w.prototype.clear=function(){return this.nodes=[]},w.prototype.empty=function(){return this.nodes.length===0},w.prototype.size=function(){return this.nodes.length},w.prototype.clone=function(){var C;return C=new w,C.nodes=this.nodes.slice(0),C},w.prototype.toArray=function(){return this.nodes.slice(0)},w.prototype.insert=w.prototype.push,w.prototype.top=w.prototype.peek,w.prototype.front=w.prototype.peek,w.prototype.has=w.prototype.contains,w.prototype.copy=w.prototype.clone,w})(),(function(w,C){return e.exports=C()})(this,function(){return n})}).call(WY)})(Iv)),Iv.exports}var Cx,nk;function JY(){return nk||(nk=1,Cx=ZY()),Cx}var eX=JY(),Pd=Od(eX),tX=ur({root:null,weight:function(t){return 1},directed:!1}),nX={dijkstra:function(t){if(!Dt(t)){var n=arguments;t={root:n[0],weight:n[1],directed:n[2]}}var r=tX(t),a=r.root,i=r.weight,l=r.directed,o=this,f=i,c=tt(a)?this.filter(a)[0]:a[0],d={},p={},m={},y=this.byGroup(),x=y.nodes,b=y.edges;b.unmergeBy(function(G){return G.isLoop()});for(var S=function(F){return d[F.id()]},w=function(F,H){d[F.id()]=H,C.updateItem(F)},C=new Pd(function(G,F){return S(G)-S(F)}),T=0;T<x.length;T++){var k=x[T];d[k.id()]=k.same(c)?0:1/0,C.push(k)}for(var R=function(F,H){for(var Y=(l?F.edgesTo(H):F.edgesWith(H)).intersect(b),Q=1/0,z,I=0;I<Y.length;I++){var X=Y[I],U=f(X);(U<Q||!z)&&(Q=U,z=X)}return{edge:z,dist:Q}};C.size()>0;){var A=C.pop(),D=S(A),L=A.id();if(m[L]=D,D!==1/0)for(var P=A.neighborhood().intersect(x),M=0;M<P.length;M++){var _=P[M],B=_.id(),q=R(A,_),V=D+q.dist;V<S(_)&&(w(_,V),p[B]={node:A,edge:q.edge})}}return{distanceTo:function(F){var H=tt(F)?x.filter(F)[0]:F[0];return m[H.id()]},pathTo:function(F){var H=tt(F)?x.filter(F)[0]:F[0],Y=[],Q=H,z=Q.id();if(H.length>0)for(Y.unshift(H);p[z];){var I=p[z];Y.unshift(I.edge),Y.unshift(I.node),Q=I.node,z=Q.id()}return o.spawn(Y)}}}},rX={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(k){for(var R=0;R<l.length;R++){var A=l[R];if(A.has(k))return R}},c=0;c<i;c++)l[c]=this.spawn(r[c]);for(var d=a.sort(function(T,k){return t(T)-t(k)}),p=0;p<d.length;p++){var m=d[p],y=m.source()[0],x=m.target()[0],b=f(y),S=f(x),w=l[b],C=l[S];b!==S&&(o.merge(m),w.merge(C),l.splice(S,1))}return o}},aX=ur({root:null,goal:null,weight:function(t){return 1},heuristic:function(t){return 0},directed:!1}),iX={aStar:function(t){var n=this.cy(),r=aX(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(),p={},m={},y={},x=new Pd(function(z,I){return m[z.id()]-m[I.id()]}),b=new yc,S={},w={},C=function(I,X){x.push(I),b.add(X)},T,k,R=function(){T=x.pop(),k=T.id(),b.delete(k)},A=function(I){return b.has(I)};C(a,c),p[c]=0,m[c]=l(a);for(var D=0;x.size()>0;){if(R(),D++,k===d){for(var L=[],P=i,M=d,_=w[M];L.unshift(P),_!=null&&L.unshift(_),P=S[M],P!=null;)M=P.id(),_=w[M];return{found:!0,distance:p[k],path:this.spawn(L),steps:D}}y[k]=!0;for(var B=T._private.edges,q=0;q<B.length;q++){var V=B[q];if(this.hasElementWithId(V.id())&&!(o&&V.data("source")!==k)){var G=V.source(),F=V.target(),H=G.id()!==k?G:F,Y=H.id();if(this.hasElementWithId(Y)&&!y[Y]){var Q=p[k]+f(V);if(!A(Y)){p[Y]=Q,m[Y]=Q+l(H),C(H,Y),S[Y]=T,w[Y]=V;continue}Q<p[Y]&&(p[Y]=Q,m[Y]=Q+l(H),S[Y]=T,w[Y]=V)}}}}return{found:!1,distance:void 0,path:void 0,steps:D}}},sX=ur({weight:function(t){return 1},directed:!1}),lX={floydWarshall:function(t){for(var n=this.cy(),r=sX(t),a=r.weight,i=r.directed,l=a,o=this.byGroup(),f=o.nodes,c=o.edges,d=f.length,p=d*d,m=function(U){return f.indexOf(U)},y=function(U){return f[U]},x=new Array(p),b=0;b<p;b++){var S=b%d,w=(b-S)/d;w===S?x[b]=0:x[b]=1/0}for(var C=new Array(p),T=new Array(p),k=0;k<c.length;k++){var R=c[k],A=R.source()[0],D=R.target()[0];if(A!==D){var L=m(A),P=m(D),M=L*d+P,_=l(R);if(x[M]>_&&(x[M]=_,C[M]=P,T[M]=R),!i){var B=P*d+L;!i&&x[B]>_&&(x[B]=_,C[B]=L,T[B]=R)}}}for(var q=0;q<d;q++)for(var V=0;V<d;V++)for(var G=V*d+q,F=0;F<d;F++){var H=V*d+F,Y=q*d+F;x[G]+x[Y]<x[H]&&(x[H]=x[G]+x[Y],C[H]=C[G])}var Q=function(U){return(tt(U)?n.filter(U):U)[0]},z=function(U){return m(Q(U))},I={distance:function(U,te){var ie=z(U),oe=z(te);return x[ie*d+oe]},path:function(U,te){var ie=z(U),oe=z(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 I}},oX=ur({weight:function(t){return 1},directed:!1,root:null}),uX={bellmanFord:function(t){var n=this,r=oX(t),a=r.weight,i=r.directed,l=r.root,o=a,f=this,c=this.cy(),d=this.byGroup(),p=d.edges,m=d.nodes,y=m.length,x=new Ki,b=!1,S=[];l=c.collection(l)[0],p.unmergeBy(function(Je){return Je.isLoop()});for(var w=p.length,C=function(Qe){var Ve=x.get(Qe.id());return Ve||(Ve={},x.set(Qe.id(),Ve)),Ve},T=function(Qe){return(tt(Qe)?c.$(Qe):Qe)[0]},k=function(Qe){return C(T(Qe)).dist},R=function(Qe){for(var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,Re=T(Qe),Ke=[],Xe=Re;;){if(Xe==null)return n.spawn();var st=C(Xe),Pe=st.edge,ft=st.pred;if(Ke.unshift(Xe[0]),Xe.same(Ve)&&Ke.length>0)break;Pe!=null&&Ke.unshift(Pe),Xe=ft}return f.spawn(Ke)},A=0;A<y;A++){var D=m[A],L=C(D);D.same(l)?L.dist=0:L.dist=1/0,L.pred=null,L.edge=null}for(var P=!1,M=function(Qe,Ve,Re,Ke,Xe,st){var Pe=Ke.dist+st;Pe<Xe.dist&&!Re.same(Ke.edge)&&(Xe.dist=Pe,Xe.pred=Qe,Xe.edge=Re,P=!0)},_=1;_<y;_++){P=!1;for(var B=0;B<w;B++){var q=p[B],V=q.source(),G=q.target(),F=o(q),H=C(V),Y=C(G);M(V,G,q,H,Y,F),i||M(G,V,q,Y,H,F)}if(!P)break}if(P)for(var Q=[],z=0;z<w;z++){var I=p[z],X=I.source(),U=I.target(),te=o(I),ie=C(X).dist,oe=C(U).dist;if(ie+te<oe||!i&&oe+te<ie)if(b||(Pt("Graph contains a negative weight cycle for Bellman-Ford"),b=!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(),Ne=0,Be=2;Be<ne.length;Be+=2)ne[Be].id()<ge&&(ge=ne[Be].id(),Ne=Be);ne=ne.slice(Ne).concat(ne.slice(0,Ne)),ne.push(ne[0]);var lt=ne.map(function(Je){return Je.id()}).join(",");Q.indexOf(lt)===-1&&(S.push(f.spawn(ne)),Q.push(lt))}}else break}return{distanceTo:k,pathTo:R,hasNegativeWeightCycle:b,negativeWeightCycles:S}}},cX=Math.sqrt(2),fX=function(t,n,r){r.length===0&&un("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 p=c[d],m=p[1],y=p[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 b=c[x];b[1]===f?(c[x]=b.slice(),c[x][1]=o):b[2]===f&&(c[x]=b.slice(),c[x][2]=o)}for(var S=0;S<n.length;S++)n[S]===f&&(n[S]=o);return c},Tx=function(t,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=fX(i,t,n),r--}return n},dX={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/cX);if(i<2){un("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],d=0;d<l;d++){var p=a[d];c.push([d,r.indexOf(p.source()),r.indexOf(p.target())])}for(var m=1/0,y=[],x=new Array(i),b=new Array(i),S=new Array(i),w=function(Q,z){for(var I=0;I<i;I++)z[I]=Q[I]},C=0;C<=o;C++){for(var T=0;T<i;T++)b[T]=T;var k=Tx(b,c.slice(),i,f),R=k.slice();w(b,S);var A=Tx(b,k,f,2),D=Tx(S,R,f,2);A.length<=D.length&&A.length<m?(m=A.length,y=A,w(b,x)):D.length<=A.length&&D.length<m&&(m=D.length,y=D,w(S,x))}for(var L=this.spawn(y.map(function(Y){return a[Y[0]]})),P=this.spawn(),M=this.spawn(),_=x[0],B=0;B<x.length;B++){var q=x[B],V=r[B];q===_?P.merge(V):M.merge(V)}var G=function(Q){var z=t.spawn();return Q.forEach(function(I){z.merge(I),I.connectedEdges().forEach(function(X){t.contains(X)&&!L.contains(X)&&z.merge(X)})}),z},F=[G(P),G(M)],H={cut:L,components:F,partition1:P,partition2:M};return H}},Nx,hX=function(t){return{x:t.x,y:t.y}},Jp=function(t,n,r){return{x:t.x*n+r.x,y:t.y*n+r.y}},uL=function(t,n,r){return{x:(t.x-r.x)/n,y:(t.y-r.y)/n}},Tu=function(t){return{x:t[0],y:t[1]}},vX=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},pX=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},mX=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},gX=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,p=Math.floor(d/2);return d%2!==0?t[p+1+o]:(t[p-1+o]+t[p+o])/2},yX=function(t){return Math.PI*t/180},yv=function(t,n){return Math.atan2(n,t)-Math.PI/2},Nw=Math.log2||function(e){return Math.log(e)/Math.log(2)},kw=function(t){return t>0?1:t<0?-1:0},xo=function(t,n){return Math.sqrt(Gl(t,n))},Gl=function(t,n){var r=n.x-t.x,a=n.y-t.y;return r*r+a*a},xX=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},Qn=function(t,n,r,a){return(1-a)*(1-a)*t+2*(1-a)*a*n+a*a*r},Ou=function(t,n,r,a){return{x:Qn(t.x,n.x,r.x,a),y:Qn(t.y,n.y,r.y,a)}},bX=function(t,n,r,a){var i={x:n.x-t.x,y:n.y-t.y},l=xo(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}},nd=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}}},wX=function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}},SX=function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0},EX=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},cL=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},Fv=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},Uv=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=Ln(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},rk=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},jw=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)},Js=function(t,n,r){return t.x1<=n&&n<=t.x2&&t.y1<=r&&r<=t.y2},ak=function(t,n){return Js(t,n.x,n.y)},fL=function(t,n){return Js(t,n.x1,n.y1)&&Js(t,n.x2,n.y2)},CX=(Nx=Math.hypot)!==null&&Nx!==void 0?Nx:function(e,t){return Math.sqrt(e*e+t*t)};function TX(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(L,P){return{x:L.x+P.x,y:L.y+P.y}},r=function(L,P){return{x:L.x-P.x,y:L.y-P.y}},a=function(L,P){return{x:L.x*P,y:L.y*P}},i=function(L,P){return L.x*P.y-L.y*P.x},l=function(L){var P=CX(L.x,L.y);return P===0?{x:0,y:0}:{x:L.x/P,y:L.y/P}},o=function(L){for(var P=0,M=0;M<L.length;M++){var _=L[M],B=L[(M+1)%L.length];P+=_.x*B.y-B.x*_.y}return P/2},f=function(L,P,M,_){var B=r(P,L),q=r(_,M),V=i(B,q);if(Math.abs(V)<1e-9)return n(L,a(B,.5));var G=i(r(M,L),q)/V;return n(L,a(B,G))},c=e.map(function(D){return{x:D.x,y:D.y}});o(c)<0&&c.reverse();for(var d=c.length,p=[],m=0;m<d;m++){var y=c[m],x=c[(m+1)%d],b=r(x,y),S=l({x:b.y,y:-b.x});p.push(S)}for(var w=p.map(function(D,L){var P=n(c[L],a(D,t)),M=n(c[(L+1)%d],a(D,t));return{p1:P,p2:M}}),C=[],T=0;T<d;T++){var k=w[(T-1+d)%d],R=w[T],A=f(k.p1,k.p2,R.p1,R.p2);C.push(A)}return C}function NX(e,t,n,r,a,i){var l=_X(e,t,n,r,a),o=TX(l,i),f=kr();return o.forEach(function(c){return cL(f,c.x,c.y)}),f}var dL=function(t,n,r,a,i,l,o){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?dl(i,l):f,d=i/2,p=l/2;c=Math.min(c,d,p);var m=c!==d,y=c!==p,x;if(m){var b=r-d+c-o,S=a-p-o,w=r+d-c+o,C=S;if(x=el(t,n,r,a,b,S,w,C,!1),x.length>0)return x}if(y){var T=r+d+o,k=a-p+c-o,R=T,A=a+p-c+o;if(x=el(t,n,r,a,T,k,R,A,!1),x.length>0)return x}if(m){var D=r-d+c-o,L=a+p+o,P=r+d-c+o,M=L;if(x=el(t,n,r,a,D,L,P,M,!1),x.length>0)return x}if(y){var _=r-d-o,B=a-p+c-o,q=_,V=a+p-c+o;if(x=el(t,n,r,a,_,B,q,V,!1),x.length>0)return x}var G;{var F=r-d+c,H=a-p+c;if(G=Bf(t,n,r,a,F,H,c+o),G.length>0&&G[0]<=F&&G[1]<=H)return[G[0],G[1]]}{var Y=r+d-c,Q=a-p+c;if(G=Bf(t,n,r,a,Y,Q,c+o),G.length>0&&G[0]>=Y&&G[1]<=Q)return[G[0],G[1]]}{var z=r+d-c,I=a+p-c;if(G=Bf(t,n,r,a,z,I,c+o),G.length>0&&G[0]>=z&&G[1]>=I)return[G[0],G[1]]}{var X=r-d+c,U=a+p-c;if(G=Bf(t,n,r,a,X,U,c+o),G.length>0&&G[0]<=X&&G[1]>=U)return[G[0],G[1]]}return[]},kX=function(t,n,r,a,i,l,o){var f=o,c=Math.min(r,i),d=Math.max(r,i),p=Math.min(a,l),m=Math.max(a,l);return c-f<=t&&t<=d+f&&p-f<=n&&n<=m+f},jX=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)},AX=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]},RX=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,p,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){p=c+Math.sqrt(o),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),m=c-Math.sqrt(o),m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),i[0]=-y+p+m,y+=(p+m)/2,i[4]=i[2]=-y,y=Math.sqrt(3)*(-m+p)/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)},DX=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,p=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=[];RX(c,d,p,m,y);for(var x=1e-7,b=[],S=0;S<6;S+=2)Math.abs(y[S+1])<x&&y[S]>=0&&y[S]<=1&&b.push(y[S]);b.push(1),b.push(0);for(var w=-1,C,T,k,R=0;R<b.length;R++)C=Math.pow(1-b[R],2)*r+2*(1-b[R])*b[R]*i+b[R]*b[R]*o,T=Math.pow(1-b[R],2)*a+2*(1-b[R])*b[R]*l+b[R]*b[R]*f,k=Math.pow(C-t,2)+Math.pow(T-n,2),w>=0?k<w&&(w=k):w=k;return w},MX=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],p=o[0]*f[0]+o[1]*f[1],m=p*p/c;return p<0?d:m>c?(t-i)*(t-i)+(n-l)*(n-l):d-m},Ur=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},Ji=function(t,n,r,a,i,l,o,f,c){var d=new Array(r.length),p;f[0]!=null?(p=Math.atan(f[1]/f[0]),f[0]<0?p=p+Math.PI/2:p=-p-Math.PI/2):p=f;for(var m=Math.cos(-p),y=Math.sin(-p),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 b;if(c>0){var S=mp(d,-c);b=pp(S)}else b=d;return Ur(t,n,b)},OX=function(t,n,r,a,i,l,o,f){for(var c=new Array(r.length*2),d=0;d<f.length;d++){var p=f[d];c[d*4+0]=p.startX,c[d*4+1]=p.startY,c[d*4+2]=p.stopX,c[d*4+3]=p.stopY;var m=Math.pow(p.cx-t,2)+Math.pow(p.cy-n,2);if(m<=Math.pow(p.radius,2))return!0}return Ur(t,n,c)},pp=function(t){for(var n=new Array(t.length/2),r,a,i,l,o,f,c,d,p=0;p<t.length/4;p++){r=t[p*4],a=t[p*4+1],i=t[p*4+2],l=t[p*4+3],p<t.length/4-1?(o=t[(p+1)*4],f=t[(p+1)*4+1],c=t[(p+1)*4+2],d=t[(p+1)*4+3]):(o=t[0],f=t[1],c=t[2],d=t[3]);var m=el(r,a,i,l,o,f,c,d,!0);n[p*2]=m[0],n[p*2+1]=m[1]}return n},mp=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),p=Math.sqrt(c*c+d*d),m=c/p,y=d/p;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},LX=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 p=d/c;return[(r-t)*p+t,(a-n)*p+n]},Ql=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},Bf=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],p=2*(c[0]*f[0]+c[1]*f[1]),m=c[0]*c[0]+c[1]*c[1]-o*o,y=p*p-4*d*m;if(y<0)return[];var x=(-p+Math.sqrt(y))/(2*d),b=(-p-Math.sqrt(y))/(2*d),S=Math.min(x,b),w=Math.max(x,b),C=[];if(S>=0&&S<=1&&C.push(S),w>=0&&w<=1&&C.push(w),C.length===0)return[];var T=C[0]*f[0]+t,k=C[0]*f[1]+n;if(C.length>1){if(C[0]==C[1])return[T,k];var R=C[1]*f[0]+t,A=C[1]*f[1]+n;return[T,k,R,A]}else return[T,k]},kx=function(t,n,r){return n<=t&&t<=r||r<=t&&t<=n?t:t<=n&&n<=r||r<=n&&n<=t?n:r},el=function(t,n,r,a,i,l,o,f,c){var d=t-i,p=r-t,m=o-i,y=n-l,x=a-n,b=f-l,S=m*y-b*d,w=p*y-x*d,C=b*p-m*x;if(C!==0){var T=S/C,k=w/C,R=.001,A=0-R,D=1+R;return A<=T&&T<=D&&A<=k&&k<=D?[t+T*p,n+T*x]:c?[t+T*p,n+T*x]:[]}else return S===0||w===0?kx(t,r,o)===o?[o,f]:kx(t,r,i)===i?[i,l]:kx(i,o,r)===r?[r,a]:[]:[]},_X=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 p=1;p<t.length/2;p++)l.push({x:c+o*t[p*2],y:d+f*t[p*2+1]});return l},rd=function(t,n,r,a,i,l,o,f){var c=[],d,p=new Array(r.length),m=!0;l==null&&(m=!1);var y;if(m){for(var x=0;x<p.length/2;x++)p[x*2]=r[x*2]*l+a,p[x*2+1]=r[x*2+1]*o+i;if(f>0){var b=mp(p,-f);y=pp(b)}else y=p}else y=r;for(var S,w,C,T,k=0;k<y.length/2;k++)S=y[k*2],w=y[k*2+1],k<y.length/2-1?(C=y[(k+1)*2],T=y[(k+1)*2+1]):(C=y[0],T=y[1]),d=el(t,n,a,i,S,w,C,T),d.length!==0&&c.push(d[0],d[1]);return c},BX=function(t,n,r,a,i,l,o,f,c){var d=[],p,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,p=Bf(t,n,a,i,C.cx,C.cy,C.radius),p.length!==0&&d.push(p[0],p[1])});for(var y=0;y<m.length/4;y++)p=el(t,n,a,i,m[y*4],m[y*4+1],m[y*4+2],m[y*4+3],!1),p.length!==0&&d.push(p[0],p[1]);if(d.length>2){for(var x=[d[0],d[1]],b=Math.pow(x[0]-t,2)+Math.pow(x[1]-n,2),S=1;S<d.length/2;S++){var w=Math.pow(d[S*2]-t,2)+Math.pow(d[S*2+1]-n,2);w<=b&&(x[0]=d[S*2],x[1]=d[S*2+1],b=w)}return x}return d},xv=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]]},Cr=function(t,n){var r=Ib(t,n);return r=hL(r),r},hL=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),p=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]*p,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},Ib=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},dl=function(t,n){return Math.min(t/4,n/4,8)},vL=function(t,n){return Math.min(t/10,n/10,8)},Aw=function(){return 8},PX=function(t,n,r){return[t-2*n+r,2*(n-t),t]},Fb=function(t,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}};function jx(e,t){function n(p){for(var m=[],y=0;y<p.length;y++){var x=p[y],b=p[(y+1)%p.length],S={x:b.x-x.x,y:b.y-x.y},w={x:-S.y,y:S.x},C=Math.sqrt(w.x*w.x+w.y*w.y);m.push({x:w.x/C,y:w.y/C})}return m}function r(p,m){var y=1/0,x=-1/0,b=Vr(p),S;try{for(b.s();!(S=b.n()).done;){var w=S.value,C=w.x*m.x+w.y*m.y;y=Math.min(y,C),x=Math.max(x,C)}}catch(T){b.e(T)}finally{b.f()}return{min:y,max:x}}function a(p,m){return!(p.max<m.min||m.max<p.min)}var i=[].concat(fp(n(e)),fp(n(t))),l=Vr(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(p){l.e(p)}finally{l.f()}return!0}var zX=ur({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(t){return 1}}),IX={pageRank:function(t){for(var n=zX(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,p=c.length,m=p*p,y=d.length,x=new Array(m),b=new Array(p),S=(1-r)/p,w=0;w<p;w++){for(var C=0;C<p;C++){var T=w*p+C;x[T]=0}b[w]=0}for(var k=0;k<y;k++){var R=d[k],A=R.data("source"),D=R.data("target");if(A!==D){var L=c.indexOfId(A),P=c.indexOfId(D),M=l(R),_=P*p+L;x[_]+=M,b[L]+=M}}for(var B=1/p+S,q=0;q<p;q++)if(b[q]===0)for(var V=0;V<p;V++){var G=V*p+q;x[G]=B}else for(var F=0;F<p;F++){var H=F*p+q;x[H]=x[H]/b[q]+S}for(var Y=new Array(p),Q=new Array(p),z,I=0;I<p;I++)Y[I]=1;for(var X=0;X<i;X++){for(var U=0;U<p;U++)Q[U]=0;for(var te=0;te<p;te++)for(var ie=0;ie<p;ie++){var oe=te*p+ie;Q[te]+=x[oe]*Y[ie]}xX(Q),z=Y,Y=Q,Q=z;for(var ae=0,we=0;we<p;we++){var fe=z[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}},ik=ur({root:null,weight:function(t){return 1},directed:!1,alpha:0}),Lu={degreeCentralityNormalized:function(t){t=ik(t);var n=this.cy(),r=this.nodes(),a=r.length;if(t.directed){for(var d={},p={},m=0,y=0,x=0;x<a;x++){var b=r[x],S=b.id();t.root=b;var w=this.degreeCentrality(t);m<w.indegree&&(m=w.indegree),y<w.outdegree&&(y=w.outdegree),d[S]=w.indegree,p[S]=w.outdegree}return{indegree:function(T){return m==0?0:(tt(T)&&(T=n.filter(T)),d[T.id()]/m)},outdegree:function(T){return y===0?0:(tt(T)&&(T=n.filter(T)),p[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:(tt(T)&&(T=n.filter(T)),i[T.id()]/l)}}}},degreeCentrality:function(t){t=ik(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(A){return A.target().same(i)&&r.has(A)}),b=y.filter(function(A){return A.source().same(i)&&r.has(A)}),S=x.length,w=b.length,C=0,T=0,k=0;k<x.length;k++)C+=l(x[k]);for(var R=0;R<b.length;R++)T+=l(b[R]);return{indegree:Math.pow(S,1-f)*Math.pow(C,f),outdegree:Math.pow(w,1-f)*Math.pow(T,f)}}else{for(var c=i.connectedEdges().intersection(r),d=c.length,p=0,m=0;m<c.length;m++)p+=l(c[m]);return{degree:Math.pow(d,1-f)*Math.pow(p,f)}}}};Lu.dc=Lu.degreeCentrality;Lu.dcn=Lu.degreeCentralityNormalised=Lu.degreeCentralityNormalized;var sk=ur({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),_u={closenessCentralityNormalized:function(t){for(var n=sk(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}),p=0;p<c.length;p++){for(var m=0,y=c[p],x=0;x<c.length;x++)if(p!==x){var b=d.distance(y,c[x]);r?m+=1/b:m+=b}r||(m=1/m),f<m&&(f=m),o[y.id()]=m}return{closeness:function(w){return f==0?0:(tt(w)?w=l.filter(w)[0].id():w=w.id(),o[w]/f)}}},closenessCentrality:function(t){var n=sk(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 p=c[d];if(!p.same(r)){var m=o.distanceTo(p);l?f+=1/m:f+=m}}return l?f:1/f}};_u.cc=_u.closenessCentrality;_u.ccn=_u.closenessCentralityNormalised=_u.closenessCentralityNormalized;var FX=ur({weight:null,directed:!1}),Ub={betweennessCentrality:function(t){for(var n=FX(t),r=n.directed,a=n.weight,i=a!=null,l=this.cy(),o=this.nodes(),f={},c={},d=0,p={set:function(T,k){c[T]=k,k>d&&(d=k)},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(),p.set(x,0)}for(var b=function(){for(var T=o[S].id(),k=[],R={},A={},D={},L=new Pd(function(te,ie){return D[te]-D[ie]}),P=0;P<o.length;P++){var M=o[P].id();R[M]=[],A[M]=0,D[M]=1/0}for(A[T]=1,D[T]=0,L.push(T);!L.empty();){var _=L.pop();if(k.push(_),i)for(var B=0;B<f[_].length;B++){var q=f[_][B],V=l.getElementById(_),G=void 0;V.edgesTo(q).length>0?G=V.edgesTo(q)[0]:G=q.edgesTo(V)[0];var F=a(G);q=q.id(),D[q]>D[_]+F&&(D[q]=D[_]+F,L.nodes.indexOf(q)<0?L.push(q):L.updateItem(q),A[q]=0,R[q]=[]),D[q]==D[_]+F&&(A[q]=A[q]+A[_],R[q].push(_))}else for(var H=0;H<f[_].length;H++){var Y=f[_][H].id();D[Y]==1/0&&(L.push(Y),D[Y]=D[_]+1),D[Y]==D[_]+1&&(A[Y]=A[Y]+A[_],R[Y].push(_))}}for(var Q={},z=0;z<o.length;z++)Q[o[z].id()]=0;for(;k.length>0;){for(var I=k.pop(),X=0;X<R[I].length;X++){var U=R[I][X];Q[U]=Q[U]+A[U]/A[I]*(1+Q[I])}I!=o[S].id()&&p.set(I,p.get(I)+Q[I])}},S=0;S<o.length;S++)b();var w={betweenness:function(T){var k=l.collection(T).id();return p.get(k)},betweennessNormalized:function(T){if(d==0)return 0;var k=l.collection(T).id();return p.get(k)/d}};return w.betweennessNormalised=w.betweennessNormalized,w}};Ub.bc=Ub.betweennessCentrality;var UX=ur({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),qX=function(t){return UX(t)},VX=function(t,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](t);return r},HX=function(t,n,r){for(var a=0;a<n;a++)t[a*n+a]=r},pL=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}},GX=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},$X=function(t,n,r){for(var a=t.slice(0),i=1;i<r;i++)t=GX(t,a,n);return t},KX=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 pL(a,n),a},YX=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},XX=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},QX=function(t,n){for(var r=0;r<t.length;r++)if(!n[r]||t[r].id()!==n[r].id())return!1;return!0},WX=function(t){for(var n=0;n<t.length;n++)for(var r=0;r<t.length;r++)n!=r&&QX(t[n],t[r])&&t.splice(r,1);return t},lk=function(t){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=qX(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),p,m=0;m<c;m++)d[m]=0;for(var y=0;y<r.length;y++){var x=r[y],b=l[x.source().id()],S=l[x.target().id()],w=VX(x,i.attributes);d[b*f+S]+=w,d[S*f+b]+=w}HX(d,f,i.multFactor),pL(d,f);for(var C=!0,T=0;C&&T<i.maxIterations;)C=!1,p=$X(d,f,i.expandFactor),d=KX(p,f,i.inflateFactor),YX(d,p,c,4)||(C=!0),T++;var k=XX(d,f,n,a);return k=WX(k),k},ZX={markovClustering:lk,mcl:lk},JX=function(t){return t},mL=function(t,n){return Math.abs(n-t)},ok=function(t,n,r){return t+mL(n,r)},uk=function(t,n,r){return t+Math.pow(r-n,2)},eQ=function(t){return Math.sqrt(t)},tQ=function(t,n,r){return Math.max(t,mL(n,r))},Tf=function(t,n,r,a,i){for(var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:JX,o=a,f,c,d=0;d<t;d++)f=n(d),c=r(d),o=i(o,f,c);return l(o)},ec={euclidean:function(t,n,r){return t>=2?Tf(t,n,r,0,uk,eQ):Tf(t,n,r,0,ok)},squaredEuclidean:function(t,n,r){return Tf(t,n,r,0,uk)},manhattan:function(t,n,r){return Tf(t,n,r,0,ok)},max:function(t,n,r){return Tf(t,n,r,-1/0,tQ)}};ec["squared-euclidean"]=ec.squaredEuclidean;ec.squaredeuclidean=ec.squaredEuclidean;function em(e,t,n,r,a,i){var l;return mn(e)?l=e:l=ec[e]||ec.euclidean,t===0&&mn(e)?l(a,i):l(t,n,r,a,i)}var nQ=ur({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Rw=function(t){return nQ(t)},gp=function(t,n,r,a,i){var l=i!=="kMedoids",o=l?function(p){return r[p]}:function(p){return a[p](r)},f=function(m){return a[m](n)},c=r,d=n;return em(t,a.length,o,f,c,d)},Ax=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 p=0;p<a;p++)f[p]=Math.random()*(l[p]-i[p])+i[p];o[d]=f}return o},gL=function(t,n,r,a,i){for(var l=1/0,o=0,f=0;f<n.length;f++){var c=gp(r,t,n[f],a,i);c<l&&(l=c,o=f)}return o},yL=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},rQ=function(t,n,r){return Math.abs(n-t)<=r},aQ=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},iQ=function(t,n,r){for(var a=0;a<r;a++)if(t===n[a])return!0;return!1},ck=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)];iQ(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},fk=function(t,n,r){for(var a=0,i=0;i<n.length;i++)a+=gp("manhattan",n[i],t,r,"kMedoids");return a},sQ=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Rw(t),l=new Array(i.k),o={},f;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,f=Ax(r,i.k,i.attributes)):Un(i.testCentroids)==="object"?f=i.testCentroids:f=Ax(r,i.k,i.attributes):f=Ax(r,i.k,i.attributes);for(var c=!0,d=0;c&&d<i.maxIterations;){for(var p=0;p<r.length;p++)a=r[p],o[a.id()]=gL(a,f,i.distance,i.attributes,"kMeans");c=!1;for(var m=0;m<i.k;m++){var y=yL(m,r,o);if(y.length!==0){for(var x=i.attributes.length,b=f[m],S=new Array(x),w=new Array(x),C=0;C<x;C++){w[C]=0;for(var T=0;T<y.length;T++)a=y[T],w[C]+=i.attributes[C](a);S[C]=w[C]/y.length,rQ(S[C],b[C],i.sensitivityThreshold)||(c=!0)}f[m]=S,l[m]=n.collection(y)}}d++}return l},lQ=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Rw(t),l=new Array(i.k),o,f={},c,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Un(i.testCentroids)==="object"?o=i.testCentroids:o=ck(r,i.k)):o=ck(r,i.k);for(var p=!0,m=0;p&&m<i.maxIterations;){for(var y=0;y<r.length;y++)a=r[y],f[a.id()]=gL(a,o,i.distance,i.attributes,"kMedoids");p=!1;for(var x=0;x<o.length;x++){var b=yL(x,r,f);if(b.length!==0){d[x]=fk(o[x],b,i.attributes);for(var S=0;S<b.length;S++)c=fk(b[S],b,i.attributes),c<d[x]&&(d[x]=c,o[x]=b[S],p=!0);l[x]=n.collection(b)}}m++}return l},oQ=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 p=0;p<i.attributes.length;p++){l=0,o=0;for(var m=0;m<n.length;m++)l+=a[m][d]*i.attributes[p](n[m]),o+=a[m][d];t[d][p]=l/o}},uQ=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),p=0;p<r.length;p++)for(var m=0;m<a.length;m++){o=0;for(var y=0;y<r.length;y++)f=gp(i.distance,a[m],r[p],i.attributes,"cmeans"),c=gp(i.distance,a[m],r[y],i.attributes,"cmeans"),o+=Math.pow(f/c,d);t[m][p]=1/o}},cQ=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 p=0;p<i.length;p++)i[p]=a.collection(i[p]);return i},dk=function(t){var n=this.cy(),r=this.nodes(),a=Rw(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 p=0;p<r.length;p++)o[p]=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 b=0;b<a.k;b++)o[m][b]=o[m][b]/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 w=0;w<r.length;w++)c[w]=new Array(a.k);for(var C=!0,T=0;C&&T<a.maxIterations;)C=!1,oQ(l,r,o,c,a),uQ(o,f,l,r,a),aQ(o,f,a.sensitivityThreshold)||(C=!0),T++;return i=cQ(r,o,a,n),{clusters:i,degreeOfMembership:o}},fQ={kMeans:sQ,kMedoids:lQ,fuzzyCMeans:dk,fcm:dk},dQ=ur({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),hQ={single:"min",complete:"max"},vQ=function(t){var n=dQ(t),r=hQ[n.linkage];return r!=null&&(n.linkage=r),n},hk=function(t,n,r,a,i){for(var l=0,o=1/0,f,c=i.attributes,d=function(P,M){return em(i.distance,c.length,function(_){return c[_](P)},function(_){return c[_](M)},P,M)},p=0;p<t.length;p++){var m=t[p].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],b=n[a[l]],S;i.mode==="dendrogram"?S={left:x,right:b,key:x.key}:S={value:x.value.concat(b.value),key:x.key},t[x.index]=S,t.splice(b.index,1),n[x.key]=S;for(var w=0;w<t.length;w++){var C=t[w];x.key===C.key?f=1/0:i.linkage==="min"?(f=r[x.key][C.key],r[x.key][C.key]>r[b.key][C.key]&&(f=r[b.key][C.key])):i.linkage==="max"?(f=r[x.key][C.key],r[x.key][C.key]<r[b.key][C.key]&&(f=r[b.key][C.key])):i.linkage==="mean"?f=(r[x.key][C.key]*x.size+r[b.key][C.key]*b.size)/(x.size+b.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 k=t[T].key;if(a[k]===x.key||a[k]===b.key){for(var R=k,A=0;A<t.length;A++){var D=t[A].key;r[k][D]<r[k][R]&&(R=D)}a[k]=R}t[T].index=T}return x.key=b.key=x.index=b.index=null,!0},Nu=function(t,n,r){t&&(t.value?n.push(t.value):(t.left&&Nu(t.left,n),t.right&&Nu(t.right,n)))},qb=function(t,n){if(!t)return"";if(t.left&&t.right){var r=qb(t.left,n),a=qb(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()},Vb=function(t,n,r){if(!t)return[];var a=[],i=[],l=[];return n===0?(t.left&&Nu(t.left,a),t.right&&Nu(t.right,i),l=a.concat(i),[r.collection(l)]):n===1?t.value?[r.collection(t.value)]:(t.left&&Nu(t.left,a),t.right&&Nu(t.right,i),[r.collection(a),r.collection(i)]):t.value?[r.collection(t.value)]:(t.left&&(a=Vb(t.left,n-1,r)),t.right&&(i=Vb(t.right,n-1,r)),a.concat(i))},vk=function(t){for(var n=this.cy(),r=this.nodes(),a=vQ(t),i=a.attributes,l=function(T,k){return em(a.distance,i.length,function(R){return i[R](T)},function(R){return i[R](k)},T,k)},o=[],f=[],c=[],d=[],p=0;p<r.length;p++){var m={value:a.mode==="dendrogram"?r[p]:[r[p]],key:p,index:p};o[p]=m,d[p]=m,f[p]=[],c[p]=0}for(var y=0;y<o.length;y++)for(var x=0;x<=y;x++){var b=void 0;a.mode==="dendrogram"?b=y===x?1/0:l(o[y].value,o[x].value):b=y===x?1/0:l(o[y].value[0],o[x].value[0]),f[y][x]=b,f[x][y]=b,b<f[y][c[y]]&&(c[y]=x)}for(var S=hk(o,d,f,c,a);S;)S=hk(o,d,f,c,a);var w;return a.mode==="dendrogram"?(w=Vb(o[0],a.dendrogramDepth,n),a.addDendrogram&&qb(o[0],n)):(w=new Array(o.length),o.forEach(function(C,T){C.key=C.index=null,w[T]=n.collection(C.value)})),w},pQ={hierarchicalClustering:vk,hca:vk},mQ=ur({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),gQ=function(t){var n=t.damping,r=t.preference;.5<=n&&n<1||un("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||Ae(r)||un("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),mQ(t)},yQ=function(t,n,r,a){var i=function(o,f){return a[f](o)};return-em(t,a.length,function(l){return i(n,l)},function(l){return i(r,l)},n,r)},xQ=function(t,n){var r=null;return n==="median"?r=gX(t):n==="mean"?r=mX(t):n==="min"?r=vX(t):n==="max"?r=pX(t):r=n,r},bQ=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},pk=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},wQ=function(t,n,r){for(var a=pk(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 p=0,m=0;m<l.length;m++)p+=n[l[m]*t+l[d]];p>c&&(f=d,c=p)}r[i]=l[f]}return a=pk(t,n,r),a},mk=function(t){for(var n=this.cy(),r=this.nodes(),a=gQ(t),i={},l=0;l<r.length;l++)i[r[l].id()]=l;var o,f,c,d,p,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 b=0;b<o;b++)x!==b&&(c[x*o+b]=yQ(a.distance,r[x],r[b],a.attributes));d=xQ(c,a.preference);for(var S=0;S<o;S++)c[S*o+S]=d;p=new Array(f);for(var w=0;w<f;w++)p[w]=0;m=new Array(f);for(var C=0;C<f;C++)m[C]=0;for(var T=new Array(o),k=new Array(o),R=new Array(o),A=0;A<o;A++)T[A]=0,k[A]=0,R[A]=0;for(var D=new Array(o*a.minIterations),L=0;L<D.length;L++)D[L]=0;var P;for(P=0;P<a.maxIterations;P++){for(var M=0;M<o;M++){for(var _=-1/0,B=-1/0,q=-1,V=0,G=0;G<o;G++)T[G]=p[M*o+G],V=m[M*o+G]+c[M*o+G],V>=_?(B=_,_=V,q=G):V>B&&(B=V);for(var F=0;F<o;F++)p[M*o+F]=(1-a.damping)*(c[M*o+F]-_)+a.damping*T[F];p[M*o+q]=(1-a.damping)*(c[M*o+q]-B)+a.damping*T[q]}for(var H=0;H<o;H++){for(var Y=0,Q=0;Q<o;Q++)T[Q]=m[Q*o+H],k[Q]=Math.max(0,p[Q*o+H]),Y+=k[Q];Y-=k[H],k[H]=p[H*o+H],Y+=k[H];for(var z=0;z<o;z++)m[z*o+H]=(1-a.damping)*Math.min(0,Y-k[z])+a.damping*T[z];m[H*o+H]=(1-a.damping)*(Y-k[H])+a.damping*T[H]}for(var I=0,X=0;X<o;X++){var U=m[X*o+X]+p[X*o+X]>0?1:0;D[P%a.minIterations*o+X]=U,I+=U}if(I>0&&(P>=a.minIterations-1||P==a.maxIterations-1)){for(var te=0,ie=0;ie<o;ie++){R[ie]=0;for(var oe=0;oe<a.minIterations;oe++)R[ie]+=D[oe*o+ie];(R[ie]===0||R[ie]===a.minIterations)&&te++}if(te===o)break}}for(var ae=bQ(o,p,m),we=wQ(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 Ne=new Array(ae.length),Be=0;Be<ae.length;Be++)Ne[Be]=n.collection(fe[ae[Be]]);return Ne},SQ={affinityPropagation:mk,ap:mk},EQ=ur({root:void 0,directed:!1}),CQ={hierholzer:function(t){if(!Dt(t)){var n=arguments;t={root:n[0],directed:n[1]}}var r=EQ(t),a=r.root,i=r.directed,l=this,o=!1,f,c,d;a&&(d=tt(a)?this.filter(a)[0].id():a[0].id());var p={},m={};i?l.forEach(function(C){var T=C.id();if(C.isNode()){var k=C.indegree(!0),R=C.outdegree(!0),A=k-R,D=R-k;A==1?f?o=!0:f=T:D==1?c?o=!0:c=T:(D>1||A>1)&&(o=!0),p[T]=[],C.outgoers().forEach(function(L){L.isEdge()&&p[T].push(L.id())})}else m[T]=[void 0,C.target().id()]}):l.forEach(function(C){var T=C.id();if(C.isNode()){var k=C.degree(!0);k%2&&(f?c?o=!0:c=T:f=T),p[T]=[],C.connectedEdges().forEach(function(R){return p[T].push(R.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 k=T,R=[T],A,D,L;p[k].length;)A=p[k].shift(),D=m[A][0],L=m[A][1],k!=L?(p[L]=p[L].filter(function(P){return P!=A}),k=L):!i&&k!=D&&(p[D]=p[D].filter(function(P){return P!=A}),k=D),R.unshift(A),R.unshift(k);return R},b=[],S=[];for(S=x(d);S.length!=1;)p[S[0]].length==0?(b.unshift(l.getElementById(S.shift())),b.unshift(l.getElementById(S.shift()))):S=x(S.shift()).concat(S);b.unshift(l.getElementById(S.shift()));for(var w in p)if(p[w].length)return y;return y.found=!0,y.trail=this.spawn(b,!0),y}},bv=function(){var t=this,n={},r=0,a=0,i=[],l=[],o={},f=function(m,y){for(var x=l.length-1,b=[],S=t.spawn();l[x].x!=m||l[x].y!=y;)b.push(l.pop().edge),x--;b.push(l.pop().edge),b.forEach(function(w){var C=w.connectedNodes().intersection(t);S.merge(w),C.forEach(function(T){var k=T.id(),R=T.connectedEdges().intersection(t);S.merge(T),n[k].cutVertex?S.merge(R.filter(function(A){return A.isLoop()})):S.merge(R)})}),i.push(S)},c=function(m,y,x){m===x&&(a+=1),n[y]={id:r,low:r++,cutVertex:!1};var b=t.getElementById(y).connectedEdges().intersection(t);if(b.size()===0)i.push(t.spawn(t.getElementById(y)));else{var S,w,C,T;b.forEach(function(k){S=k.source().id(),w=k.target().id(),C=S===y?w:S,C!==x&&(T=k.id(),o[T]||(o[T]=!0,l.push({x:y,y:C,edge:k})),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(p){if(p.isNode()){var m=p.id();m in n||(a=0,c(m,m),n[m].cutVertex=a>1)}});var d=Object.keys(n).filter(function(p){return n[p].cutVertex}).map(function(p){return t.getElementById(p)});return{cut:t.spawn(d),components:i}},TQ={hopcroftTarjanBiconnected:bv,htbc:bv,htb:bv,hopcroftTarjanBiconnectedComponents:bv},wv=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(b){var S=b.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 p=t.spawn();;){var m=i.pop();if(p.merge(t.getElementById(m)),n[m].low=n[c].index,n[m].explored=!0,m===c)break}var y=p.edgesWith(p),x=p.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}},NQ={tarjanStronglyConnected:wv,tsc:wv,tscc:wv,tarjanStronglyConnectedComponents:wv},xL={};[td,nX,rX,iX,lX,uX,dX,IX,Lu,_u,Ub,ZX,fQ,pQ,SQ,CQ,TQ,NQ].forEach(function(e){at(xL,e)});/*!
|
|
486
|
+
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
487
|
+
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
488
|
+
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
489
|
+
*/var bL=0,wL=1,SL=2,Ha=function(t){if(!(this instanceof Ha))return new Ha(t);this.id="Thenable/1.0.7",this.state=bL,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))};Ha.prototype={fulfill:function(t){return gk(this,wL,"fulfillValue",t)},reject:function(t){return gk(this,SL,"rejectReason",t)},then:function(t,n){var r=this,a=new Ha;return r.onFulfilled.push(xk(t,a,"fulfill")),r.onRejected.push(xk(n,a,"reject")),EL(r),a.proxy}};var gk=function(t,n,r,a){return t.state===bL&&(t.state=n,t[r]=a,EL(t)),t},EL=function(t){t.state===wL?yk(t,"onFulfilled",t.fulfillValue):t.state===SL&&yk(t,"onRejected",t.rejectReason)},yk=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)}},xk=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}CL(n,i)}}},CL=function(t,n){if(t===n||t.proxy===n){t.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(Un(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")):CL(t,i))},function(i){a||(a=!0,t.reject(i))})}catch(i){a||t.reject(i)}return}t.fulfill(n)};Ha.all=function(e){return new Ha(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(p){i(o,p)},function(p){n(p)});else{var d=f;i(o,d)}})(l)})};Ha.resolve=function(e){return new Ha(function(t,n){t(e)})};Ha.reject=function(e){return new Ha(function(t,n){n(e)})};var xc=typeof Promise<"u"?Promise:Ha,Hb=function(t,n,r){var a=bw(t),i=!a,l=this._private=at({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&&mn(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},bo=Hb.prototype;at(bo,{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),ia(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 p=t[c];p!=null&&(t[c]=t[d],t[d]=p)};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 xc(function(a,i){r.push(function(){a()})})}});bo.complete=bo.completed;bo.run=bo.play;bo.running=bo.playing;var kQ={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=at({},n,r);var p=Object.keys(n).length===0;if(p)return new Hb(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=uL(m,x,y)}if(f&&n.panBy!=null){var b=n.panBy,S=o.pan();n.pan={x:S.x+b.x,y:S.y+b.y}}var w=n.center||n.centre;if(f&&w!=null){var C=o.getCenterPan(w.eles,n.zoom);C!=null&&(n.pan=C)}if(f&&n.fit!=null){var T=n.fit,k=o.getFitViewport(T.eles||T.boundingBox,T.padding);k!=null&&(n.pan=k.pan,n.zoom=k.zoom)}if(f&&Dt(n.zoom)){var R=o.getZoomedViewport(n.zoom);R!=null?(R.zoomed&&(n.zoom=R.zoom),R.panned&&(n.pan=R.pan)):n.zoom=null}return new Hb(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=at({},n,r));for(var f=0;f<l.length;f++){var c=l[f],d=c.animated()&&(n.queue===void 0||n.queue),p=c.animation(n,d?{queue:!0}:void 0);p.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,p=d.animation.current,m=0;m<p.length;m++){var y=p[m],x=y._private;r&&(x.duration=0)}n&&(d.animation.queue=[]),r||(d.animation.current=[])}return o.notify("draw"),this}}},Rx,bk;function tm(){if(bk)return Rx;bk=1;var e=Array.isArray;return Rx=e,Rx}var Dx,wk;function jQ(){if(wk)return Dx;wk=1;var e=tm(),t=_d(),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 Dx=a,Dx}var Mx,Sk;function AQ(){if(Sk)return Mx;Sk=1;var e=eL(),t=Ld(),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 Mx=l,Mx}var Ox,Ek;function RQ(){if(Ek)return Ox;Ek=1;var e=Wp(),t=e["__core-js_shared__"];return Ox=t,Ox}var Lx,Ck;function DQ(){if(Ck)return Lx;Ck=1;var e=RQ(),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 Lx=n,Lx}var _x,Tk;function MQ(){if(Tk)return _x;Tk=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 _x=n,_x}var Bx,Nk;function OQ(){if(Nk)return Bx;Nk=1;var e=AQ(),t=DQ(),n=Ld(),r=MQ(),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 p(m){if(!n(m)||t(m))return!1;var y=e(m)?d:i;return y.test(r(m))}return Bx=p,Bx}var Px,kk;function LQ(){if(kk)return Px;kk=1;function e(t,n){return t==null?void 0:t[n]}return Px=e,Px}var zx,jk;function Dw(){if(jk)return zx;jk=1;var e=OQ(),t=LQ();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return zx=n,zx}var Ix,Ak;function nm(){if(Ak)return Ix;Ak=1;var e=Dw(),t=e(Object,"create");return Ix=t,Ix}var Fx,Rk;function _Q(){if(Rk)return Fx;Rk=1;var e=nm();function t(){this.__data__=e?e(null):{},this.size=0}return Fx=t,Fx}var Ux,Dk;function BQ(){if(Dk)return Ux;Dk=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Ux=e,Ux}var qx,Mk;function PQ(){if(Mk)return qx;Mk=1;var e=nm(),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 qx=a,qx}var Vx,Ok;function zQ(){if(Ok)return Vx;Ok=1;var e=nm(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Vx=r,Vx}var Hx,Lk;function IQ(){if(Lk)return Hx;Lk=1;var e=nm(),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 Hx=n,Hx}var Gx,_k;function FQ(){if(_k)return Gx;_k=1;var e=_Q(),t=BQ(),n=PQ(),r=zQ(),a=IQ();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,Gx=i,Gx}var $x,Bk;function UQ(){if(Bk)return $x;Bk=1;function e(){this.__data__=[],this.size=0}return $x=e,$x}var Kx,Pk;function TL(){if(Pk)return Kx;Pk=1;function e(t,n){return t===n||t!==t&&n!==n}return Kx=e,Kx}var Yx,zk;function rm(){if(zk)return Yx;zk=1;var e=TL();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Yx=t,Yx}var Xx,Ik;function qQ(){if(Ik)return Xx;Ik=1;var e=rm(),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 Xx=r,Xx}var Qx,Fk;function VQ(){if(Fk)return Qx;Fk=1;var e=rm();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Qx=t,Qx}var Wx,Uk;function HQ(){if(Uk)return Wx;Uk=1;var e=rm();function t(n){return e(this.__data__,n)>-1}return Wx=t,Wx}var Zx,qk;function GQ(){if(qk)return Zx;qk=1;var e=rm();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 Zx=t,Zx}var Jx,Vk;function $Q(){if(Vk)return Jx;Vk=1;var e=UQ(),t=qQ(),n=VQ(),r=HQ(),a=GQ();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,Jx=i,Jx}var e0,Hk;function KQ(){if(Hk)return e0;Hk=1;var e=Dw(),t=Wp(),n=e(t,"Map");return e0=n,e0}var t0,Gk;function YQ(){if(Gk)return t0;Gk=1;var e=FQ(),t=$Q(),n=KQ();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return t0=r,t0}var n0,$k;function XQ(){if($k)return n0;$k=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return n0=e,n0}var r0,Kk;function am(){if(Kk)return r0;Kk=1;var e=XQ();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return r0=t,r0}var a0,Yk;function QQ(){if(Yk)return a0;Yk=1;var e=am();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return a0=t,a0}var i0,Xk;function WQ(){if(Xk)return i0;Xk=1;var e=am();function t(n){return e(this,n).get(n)}return i0=t,i0}var s0,Qk;function ZQ(){if(Qk)return s0;Qk=1;var e=am();function t(n){return e(this,n).has(n)}return s0=t,s0}var l0,Wk;function JQ(){if(Wk)return l0;Wk=1;var e=am();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 l0=t,l0}var o0,Zk;function eW(){if(Zk)return o0;Zk=1;var e=YQ(),t=QQ(),n=WQ(),r=ZQ(),a=JQ();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,o0=i,o0}var u0,Jk;function tW(){if(Jk)return u0;Jk=1;var e=eW(),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,u0=n,u0}var c0,ej;function nW(){if(ej)return c0;ej=1;var e=tW(),t=500;function n(r){var a=e(r,function(l){return i.size===t&&i.clear(),l}),i=a.cache;return a}return c0=n,c0}var f0,tj;function NL(){if(tj)return f0;tj=1;var e=nW(),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 f0=r,f0}var d0,nj;function kL(){if(nj)return d0;nj=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 d0=e,d0}var h0,rj;function rW(){if(rj)return h0;rj=1;var e=Sw(),t=kL(),n=tm(),r=_d(),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 h0=l,h0}var v0,aj;function jL(){if(aj)return v0;aj=1;var e=rW();function t(n){return n==null?"":e(n)}return v0=t,v0}var p0,ij;function AL(){if(ij)return p0;ij=1;var e=tm(),t=jQ(),n=NL(),r=jL();function a(i,l){return e(i)?i:t(i,l)?[i]:n(r(i))}return p0=a,p0}var m0,sj;function Mw(){if(sj)return m0;sj=1;var e=_d();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return m0=t,m0}var g0,lj;function aW(){if(lj)return g0;lj=1;var e=AL(),t=Mw();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 g0=n,g0}var y0,oj;function iW(){if(oj)return y0;oj=1;var e=aW();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return y0=t,y0}var sW=iW(),lW=Od(sW),x0,uj;function oW(){if(uj)return x0;uj=1;var e=Dw(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return x0=t,x0}var b0,cj;function uW(){if(cj)return b0;cj=1;var e=oW();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return b0=t,b0}var w0,fj;function cW(){if(fj)return w0;fj=1;var e=uW(),t=TL(),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 w0=a,w0}var S0,dj;function fW(){if(dj)return S0;dj=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 S0=n,S0}var E0,hj;function dW(){if(hj)return E0;hj=1;var e=cW(),t=AL(),n=fW(),r=Ld(),a=Mw();function i(l,o,f,c){if(!r(l))return l;o=t(o,l);for(var d=-1,p=o.length,m=p-1,y=l;y!=null&&++d<p;){var x=a(o[d]),b=f;if(x==="__proto__"||x==="constructor"||x==="prototype")return l;if(d!=m){var S=y[x];b=c?c(S,x,y):void 0,b===void 0&&(b=r(S)?S:n(o[d+1])?[]:{})}e(y,x,b),y=y[x]}return l}return E0=i,E0}var C0,vj;function hW(){if(vj)return C0;vj=1;var e=dW();function t(n,r,a){return n==null?n:e(n,r,a)}return C0=t,C0}var vW=hW(),pW=Od(vW),T0,pj;function mW(){if(pj)return T0;pj=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 T0=e,T0}var N0,mj;function gW(){if(mj)return N0;mj=1;var e=kL(),t=mW(),n=tm(),r=_d(),a=NL(),i=Mw(),l=jL();function o(f){return n(f)?e(f,i):r(f)?[f]:t(a(l(f)))}return N0=o,N0}var yW=gW(),xW=Od(yW),bW={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=at({},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(tt(a)){var p=a.indexOf(".")!==-1,m=p&&xW(a);if(l.allowGetting&&i===void 0){var y;return d&&(l.beforeGet(d),m&&d._private[l.field][a]===void 0?y=lW(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 b=HO({},a,i);l.beforeSet(o,b);for(var S=0,w=c.length;S<w;S++){var C=c[S];l.canSet(C)&&(m&&d._private[l.field][a]===void 0?pW(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&&Dt(a)){var T=a,k,R,A=Object.keys(T);l.beforeSet(o,T);for(var D=0;D<A.length;D++){k=A[D],R=T[k];var L=!l.immutableKeys[k];if(L)for(var P=0;P<c.length;P++){var M=c[P];l.canSet(M)&&(M._private[l.field][k]=R)}}l.updateStyle&&o.updateStyle(),l.onSet(o),l.settingTriggersEvent&&o[l.triggerFnName](l.settingEvent)}else if(l.allowBinding&&mn(a)){var _=a;o.on(l.bindingEvent,_)}else if(l.allowGetting&&a===void 0){var B;return d&&(l.beforeGet(d),B=d._private[l.field]),B}return o}},removeData:function(t){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=at({},n,t),function(a){var i=t,l=this,o=l.length!==void 0,f=o?l:[l];if(tt(a)){for(var c=a.split(/\s+/),d=c.length,p=0;p<d;p++){var m=c[p];if(!cl(m)){var y=!i.immutableKeys[m];if(y)for(var x=0,b=f.length;x<b;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,w=f.length;S<w;S++)for(var C=f[S]._private[i.field],T=Object.keys(C),k=0;k<T.length;k++){var R=T[k],A=!i.immutableKeys[R];A&&(C[R]=void 0)}i.triggerEvent&&l[i.triggerFnName](i.event)}return l}}},wW={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 xc(function(o,f){var c=function(y){i.off.apply(i,p),o(y)},d=l.concat([c]),p=d.concat([]);i.on.apply(i,d)})}}},Bt={};[kQ,bW,wW].forEach(function(e){at(Bt,e)});var SW={animate:Bt.animate(),animation:Bt.animation(),animated:Bt.animated(),clearQueue:Bt.clearQueue(),delay:Bt.delay(),delayAnimation:Bt.delayAnimation(),stop:Bt.stop()},qv={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 Yt(t)||(t=(t||"").match(/\S+/g)||[]);for(var a=[],i=new yc(t),l=0;l<n.length;l++){for(var o=n[l],f=o._private,c=f.classes,d=!1,p=0;p<t.length;p++){var m=t[p],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){Yt(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,p=0;p<t.length;p++){var m=t[p],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}};qv.className=qv.classNames=qv.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 $t=function(){return{checks:[]}},Ue={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},Gb=[{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 bY(e.selector,t.selector)}),EW=(function(){for(var e={},t,n=0;n<Gb.length;n++)t=Gb[n],e[t.selector]=t.matches;return e})(),CW=function(t,n){return EW[t](n)},TW="("+Gb.map(function(e){return e.selector}).join("|")+")",vu=function(t){return t.replace(new RegExp("\\\\("+Rt.metaChar+")","g"),function(n,r){return r})},zs=function(t,n,r){t[t.length-1]=r},$b=[{name:"group",query:!0,regex:"("+Rt.group+")",populate:function(t,n,r){var a=Ln(r,1),i=a[0];n.checks.push({type:Ue.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:TW,populate:function(t,n,r){var a=Ln(r,1),i=a[0];n.checks.push({type:Ue.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Rt.id+")",populate:function(t,n,r){var a=Ln(r,1),i=a[0];n.checks.push({type:Ue.ID,value:vu(i)})}},{name:"className",query:!0,regex:"\\.("+Rt.className+")",populate:function(t,n,r){var a=Ln(r,1),i=a[0];n.checks.push({type:Ue.CLASS,value:vu(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Rt.variable+")\\s*\\]",populate:function(t,n,r){var a=Ln(r,1),i=a[0];n.checks.push({type:Ue.DATA_EXIST,field:vu(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Rt.variable+")\\s*("+Rt.comparatorOp+")\\s*("+Rt.value+")\\s*\\]",populate:function(t,n,r){var a=Ln(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:Ue.DATA_COMPARE,field:vu(i),operator:l,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Rt.boolOp+")\\s*("+Rt.variable+")\\s*\\]",populate:function(t,n,r){var a=Ln(r,2),i=a[0],l=a[1];n.checks.push({type:Ue.DATA_BOOL,field:vu(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=Ln(r,3),i=a[0],l=a[1],o=a[2];n.checks.push({type:Ue.META_COMPARE,field:vu(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++]=$t();return o}},{name:"directedEdge",separator:!0,regex:Rt.directedEdge,populate:function(t,n){if(t.currentSubject==null){var r=$t(),a=n,i=$t();return r.checks.push({type:Ue.DIRECTED_EDGE,source:a,target:i}),zs(t,n,r),t.edgeCount++,i}else{var l=$t(),o=n,f=$t();return l.checks.push({type:Ue.NODE_SOURCE,source:o,target:f}),zs(t,n,l),t.edgeCount++,f}}},{name:"undirectedEdge",separator:!0,regex:Rt.undirectedEdge,populate:function(t,n){if(t.currentSubject==null){var r=$t(),a=n,i=$t();return r.checks.push({type:Ue.UNDIRECTED_EDGE,nodes:[a,i]}),zs(t,n,r),t.edgeCount++,i}else{var l=$t(),o=n,f=$t();return l.checks.push({type:Ue.NODE_NEIGHBOR,node:o,neighbor:f}),zs(t,n,l),f}}},{name:"child",separator:!0,regex:Rt.child,populate:function(t,n){if(t.currentSubject==null){var r=$t(),a=$t(),i=t[t.length-1];return r.checks.push({type:Ue.CHILD,parent:i,child:a}),zs(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=$t(),o=t[t.length-1],f=$t(),c=$t(),d=$t(),p=$t();return l.checks.push({type:Ue.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:Ue.TRUE}],p.checks.push({type:Ue.TRUE}),f.checks.push({type:Ue.PARENT,parent:p,child:d}),zs(t,o,l),t.currentSubject=c,t.compoundCount++,d}else{var m=$t(),y=$t(),x=[{type:Ue.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=$t(),a=$t(),i=t[t.length-1];return r.checks.push({type:Ue.DESCENDANT,ancestor:i,descendant:a}),zs(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=$t(),o=t[t.length-1],f=$t(),c=$t(),d=$t(),p=$t();return l.checks.push({type:Ue.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:Ue.TRUE}],p.checks.push({type:Ue.TRUE}),f.checks.push({type:Ue.ANCESTOR,ancestor:p,descendant:d}),zs(t,o,l),t.currentSubject=c,t.compoundCount++,d}else{var m=$t(),y=$t(),x=[{type:Ue.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 Pt("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===Ue.DIRECTED_EDGE?a.type=Ue.NODE_TARGET:i===Ue.UNDIRECTED_EDGE&&(a.type=Ue.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];$b.forEach(function(e){return e.regexObj=new RegExp("^"+e.regex)});var NW=function(t){for(var n,r,a,i=0;i<$b.length;i++){var l=$b[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}},kW=function(t){var n=t.match(/^\s+/);if(n){var r=n[0];t=t.substring(r.length)}return t},jW=function(t){var n=this,r=n.inputText=t,a=n[0]=$t();for(n.length=1,r=kW(r);;){var i=NW(r);if(i.expr==null)return Pt("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 Pt("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Pt("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Pt("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},AW=function(){if(this.toStringCache!=null)return this.toStringCache;for(var t=function(d){return d??""},n=function(d){return tt(d)?'"'+d+'"':t(d)},r=function(d){return" "+d+" "},a=function(d,p){var m=d.type,y=d.value;switch(m){case Ue.GROUP:{var x=t(y);return x.substring(0,x.length-1)}case Ue.DATA_COMPARE:{var b=d.field,S=d.operator;return"["+b+r(t(S))+n(y)+"]"}case Ue.DATA_BOOL:{var w=d.operator,C=d.field;return"["+t(w)+C+"]"}case Ue.DATA_EXIST:{var T=d.field;return"["+T+"]"}case Ue.META_COMPARE:{var k=d.operator,R=d.field;return"[["+R+r(t(k))+n(y)+"]]"}case Ue.STATE:return y;case Ue.ID:return"#"+y;case Ue.CLASS:return"."+y;case Ue.PARENT:case Ue.CHILD:return i(d.parent,p)+r(">")+i(d.child,p);case Ue.ANCESTOR:case Ue.DESCENDANT:return i(d.ancestor,p)+" "+i(d.descendant,p);case Ue.COMPOUND_SPLIT:{var A=i(d.left,p),D=i(d.subject,p),L=i(d.right,p);return A+(A.length>0?" ":"")+D+L}case Ue.TRUE:return""}},i=function(d,p){return d.checks.reduce(function(m,y,x){return m+(p===d&&x===0?"$":"")+a(y,p)},"")},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},RW={parse:jW,toString:AW},RL=function(t,n,r){var a,i=tt(t),l=Ae(t),o=tt(r),f,c,d=!1,p=!1,m=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),p=!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 p&&(t!=null||!m)&&(a=!a),a},DW=function(t,n){switch(n){case"?":return!!t;case"!":return!t;case"^":return t===void 0}},MW=function(t){return t!==void 0},Ow=function(t,n){return t.data(n)},OW=function(t,n){return t[n]()},wn=[],sn=function(t,n){return t.checks.every(function(r){return wn[r.type](r,n)})};wn[Ue.GROUP]=function(e,t){var n=e.value;return n==="*"||n===t.group()};wn[Ue.STATE]=function(e,t){var n=e.value;return CW(n,t)};wn[Ue.ID]=function(e,t){var n=e.value;return t.id()===n};wn[Ue.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)};wn[Ue.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return RL(OW(t,n),r,a)};wn[Ue.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return RL(Ow(t,n),r,a)};wn[Ue.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return DW(Ow(t,n),r)};wn[Ue.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,MW(Ow(t,n))};wn[Ue.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],a=t.source(),i=t.target();return sn(n,a)&&sn(r,i)||sn(r,a)&&sn(n,i)};wn[Ue.NODE_NEIGHBOR]=function(e,t){return sn(e.node,t)&&t.neighborhood().some(function(n){return n.isNode()&&sn(e.neighbor,n)})};wn[Ue.DIRECTED_EDGE]=function(e,t){return sn(e.source,t.source())&&sn(e.target,t.target())};wn[Ue.NODE_SOURCE]=function(e,t){return sn(e.source,t)&&t.outgoers().some(function(n){return n.isNode()&&sn(e.target,n)})};wn[Ue.NODE_TARGET]=function(e,t){return sn(e.target,t)&&t.incomers().some(function(n){return n.isNode()&&sn(e.source,n)})};wn[Ue.CHILD]=function(e,t){return sn(e.child,t)&&sn(e.parent,t.parent())};wn[Ue.PARENT]=function(e,t){return sn(e.parent,t)&&t.children().some(function(n){return sn(e.child,n)})};wn[Ue.DESCENDANT]=function(e,t){return sn(e.descendant,t)&&t.ancestors().some(function(n){return sn(e.ancestor,n)})};wn[Ue.ANCESTOR]=function(e,t){return sn(e.ancestor,t)&&t.descendants().some(function(n){return sn(e.descendant,n)})};wn[Ue.COMPOUND_SPLIT]=function(e,t){return sn(e.subject,t)&&sn(e.left,t)&&sn(e.right,t)};wn[Ue.TRUE]=function(){return!0};wn[Ue.COLLECTION]=function(e,t){var n=e.value;return n.has(t)};wn[Ue.FILTER]=function(e,t){var n=e.value;return n(t)};var LW=function(t){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===Ue.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(sn(o,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),t.filter(r)},_W=function(t){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(sn(a,t))return!0}return!1},BW={matches:_W,filter:LW},hl=function(t){this.inputText=t,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,t==null||tt(t)&&t.match(/^\s*$/)||(ia(t)?this.addQuery({checks:[{type:Ue.COLLECTION,value:t.collection()}]}):mn(t)?this.addQuery({checks:[{type:Ue.FILTER,value:t}]}):tt(t)?this.parse(t)||(this.invalid=!0):un("A selector must be created from a string; found "))},vl=hl.prototype;[RW,BW].forEach(function(e){return at(vl,e)});vl.text=function(){return this.inputText};vl.size=function(){return this.length};vl.eq=function(e){return this[e]};vl.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()};vl.addQuery=function(e){this[this.length++]=e};vl.selector=vl.toString;var sl={allAre:function(t){var n=new hl(t);return this.every(function(r){return n.matches(r)})},is:function(t){var n=new hl(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())})}};sl.allAreNeighbours=sl.allAreNeighbors;sl.has=sl.contains;sl.equal=sl.equals=sl.same;var Aa=function(t,n){return function(a,i,l,o){var f=a,c=this,d;if(f==null?d="":ia(f)&&f.length===1&&(d=f.id()),c.length===1&&d){var p=c[0]._private,m=p.traversalCache=p.traversalCache||{},y=m[n]=m[n]||[],x=yo(d),b=y[x];return b||(y[x]=t.call(c,a,i,l,o))}else return t.call(c,a,i,l,o)}},tc={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:Aa(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 Lw(e,t,n,r){for(var a=[],i=new yc,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 DL(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)}}tc.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Lw(this,e,t,DL)};function ML(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}tc.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Lw(this,e,t,ML)};function PW(e,t,n){ML(e,t,n),DL(e,t,n)}tc.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Lw(this,e,t,PW)};tc.ancestors=tc.parents;var ad,OL;ad=OL={data:Bt.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:Bt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Bt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Bt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Bt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Bt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var t=this[0];if(t)return t._private.data.id}};ad.attr=ad.data;ad.removeAttr=ad.removeData;var zW=OL,im={};function k0(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}}at(im,{degree:k0(function(e,t){return t.source().same(t.target())?2:1}),indegree:k0(function(e,t){return t.target().same(e)?1:0}),outdegree:k0(function(e,t){return t.source().same(e)?1:0})});function pu(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}}at(im,{minDegree:pu("degree",function(e,t){return e<t}),maxDegree:pu("degree",function(e,t){return e>t}),minIndegree:pu("indegree",function(e,t){return e<t}),maxIndegree:pu("indegree",function(e,t){return e>t}),minOutdegree:pu("outdegree",function(e,t){return e<t}),maxOutdegree:pu("outdegree",function(e,t){return e>t})});at(im,{totalDegree:function(t){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(t);return n}});var Fa,LL,_L=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()}}},gj={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){_L(t,n,!1)},onSet:function(t){t.dirtyCompoundBoundsCache()},canSet:function(t){return!t.locked()}};Fa=LL={position:Bt.data(gj),silentPosition:Bt.data(at({},gj,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(t,n){_L(t,n,!0)},onSet:function(t){t.dirtyCompoundBoundsCache()}})),positions:function(t,n){if(Dt(t))n?this.silentPosition(t):this.position(t);else if(mn(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(Dt(t)?(a={x:Ae(t.x)?t.x:0,y:Ae(t.y)?t.y:0},r=n):tt(t)&&Ae(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 Dt(t)?this.shift(t,!0):tt(t)&&Ae(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=Dt(t)?t:void 0,f=o!==void 0||n!==void 0&&tt(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(uL(o,i,l))}else{var p=r.position();return o=Jp(p,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=Dt(t)?t:void 0,l=i!==void 0||n!==void 0&&tt(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,p=d&&d.length>0,m=p;p&&(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(),b=o?r.parent():null,S=b&&b.length>0,w=S;S&&(b=b[0]);var C=w?b.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}};Fa.modelPosition=Fa.point=Fa.position;Fa.modelPositions=Fa.points=Fa.positions;Fa.renderedPoint=Fa.renderedPosition;Fa.relativePoint=Fa.relativePosition;var IW=LL,Bu,wl;Bu=wl={};wl.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}};wl.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)};wl.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")}},p=f.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),m=o.position;(p.w===0||p.h===0)&&(p={w:l.pstyle("width").pfValue,h:l.pstyle("height").pfValue},p.x1=m.x-p.w/2,p.x2=m.x+p.w/2,p.y1=m.y-p.h/2,p.y2=m.y+p.h/2);function y(P,M,_){var B=0,q=0,V=M+_;return P>0&&V>0&&(B=M/V*P,q=_/V*P),{biasDiff:B,biasComplementDiff:q}}function x(P,M,_,B){if(_.units==="%")switch(B){case"width":return P>0?_.pfValue*P:0;case"height":return M>0?_.pfValue*M:0;case"average":return P>0&&M>0?_.pfValue*(P+M)/2:0;case"min":return P>0&&M>0?P>M?_.pfValue*M:_.pfValue*P:0;case"max":return P>0&&M>0?P>M?_.pfValue*P:_.pfValue*M:0;default:return 0}else return _.units==="px"?_.pfValue:0}var b=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(b=b*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 w=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(w=w*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-p.w,b,S),k=T.biasDiff,R=T.biasComplementDiff,A=y(d.height.val-p.h,w,C),D=A.biasDiff,L=A.biasComplementDiff;o.autoPadding=x(p.w,p.h,l.pstyle("padding"),l.pstyle("padding-relative-to").value),o.autoWidth=Math.max(p.w,d.width.val),m.x=(-k+p.x1+p.x2+R)/2,o.autoHeight=Math.max(p.h,d.height.val),m.y=(-D+p.y1+p.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 ka=function(t){return t===1/0||t===-1/0?0:t},za=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)},qs=function(t,n){return n==null?t:za(t,n.x1,n.y1,n.x2,n.y2)},Nf=function(t,n,r){return Fr(t,n,r)},Sv=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||{},p=d[r]=d[r]||{};p.x1=f-l,p.y1=c-l,p.x2=f+l,p.y2=c+l,p.w=p.x2-p.x1,p.h=p.y2-p.y1,Fv(p,1),za(t,p.x1,p.y1,p.x2,p.y2)}}},j0=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=Nf(l,"labelWidth",r),p=Nf(l,"labelHeight",r),m=Nf(l,"labelX",r),y=Nf(l,"labelY",r),x=n.pstyle(a+"text-margin-x").pfValue,b=n.pstyle(a+"text-margin-y").pfValue,S=n.isEdge(),w=n.pstyle(a+"text-rotation"),C=n.pstyle("text-outline-width").pfValue,T=n.pstyle("text-border-width").pfValue,k=T/2,R=n.pstyle("text-background-padding").pfValue,A=2,D=p,L=d,P=L/2,M=D/2,_,B,q,V;if(S)_=m-P,B=m+P,q=y-M,V=y+M;else{switch(f.value){case"left":_=m-L,B=m;break;case"center":_=m-P,B=m+P;break;case"right":_=m,B=m+L;break}switch(c.value){case"top":q=y-D,V=y;break;case"center":q=y-M,V=y+M;break;case"bottom":q=y,V=y+D;break}}var G=x-Math.max(C,k)-R-A,F=x+Math.max(C,k)+R+A,H=b-Math.max(C,k)-R-A,Y=b+Math.max(C,k)+R+A;_+=G,B+=F,q+=H,V+=Y;var Q=r||"main",z=i.labelBounds,I=z[Q]=z[Q]||{};I.x1=_,I.y1=q,I.x2=B,I.y2=V,I.w=B-_,I.h=V-q,I.leftPad=G,I.rightPad=F,I.topPad=H,I.botPad=Y;var X=S&&w.strValue==="autorotate",U=w.pfValue!=null&&w.pfValue!==0;if(X||U){var te=X?Nf(i.rstyle,"labelAngle",r):w.pfValue,ie=Math.cos(te),oe=Math.sin(te),ae=(_+B)/2,we=(q+V)/2;if(!S){switch(f.value){case"left":ae=B;break;case"right":ae=_;break}switch(c.value){case"top":we=V;break;case"bottom":we=q;break}}var fe=function(Je,Qe){return Je=Je-ae,Qe=Qe-we,{x:Je*ie-Qe*oe+ae,y:Je*oe+Qe*ie+we}},J=fe(_,q),ne=fe(_,V),re=fe(B,q),ge=fe(B,V);_=Math.min(J.x,ne.x,re.x,ge.x),B=Math.max(J.x,ne.x,re.x,ge.x),q=Math.min(J.y,ne.y,re.y,ge.y),V=Math.max(J.y,ne.y,re.y,ge.y)}var Ne=Q+"Rot",Be=z[Ne]=z[Ne]||{};Be.x1=_,Be.y1=q,Be.x2=B,Be.y2=V,Be.w=B-_,Be.h=V-q,za(t,_,q,B,V),za(i.labelBounds.all,_,q,B,V)}return t}},yj=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;BL(t,n,r,l,"outside",l/2)}},BL=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(),p=d.x,m=d.y,y=n.width(),x=n.height();if(c.hasMiterBounds){i==="center"&&(a/=2);var b=c.miterBounds(p,m,y,x,a);qs(t,b)}else l!=null&&l>0&&Uv(t,[l,l,l,l])}},FW=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;BL(t,n,r,a,i)}},UW=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,p,m,y,x,b,S=o.rstyle,w=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 k=0,R=0;a&&n.includeOverlays&&(k=t.pstyle("overlay-opacity").value,k!==0&&(R=t.pstyle("overlay-padding").value));var A=0,D=0;a&&n.includeUnderlays&&(A=t.pstyle("underlay-opacity").value,A!==0&&(D=t.pstyle("underlay-padding").value));var L=Math.max(R,D),P=0,M=0;if(a&&(P=t.pstyle("width").pfValue,M=P/2),f&&n.includeNodes){var _=t.position();x=_.x,b=_.y;var B=t.outerWidth(),q=B/2,V=t.outerHeight(),G=V/2;d=x-q,p=x+q,m=b-G,y=b+G,za(l,d,m,p,y),a&&yj(l,t),a&&n.includeOutlines&&!i&&yj(l,t),a&&FW(l,t)}else if(c&&n.includeEdges)if(a&&!i){var F=t.pstyle("curve-style").strValue;if(d=Math.min(S.srcX,S.midX,S.tgtX),p=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,p+=M,m-=M,y+=M,za(l,d,m,p,y),F==="haystack"){var H=S.haystackPts;if(H&&H.length===2){if(d=H[0].x,m=H[0].y,p=H[1].x,y=H[1].y,d>p){var Y=d;d=p,p=Y}if(m>y){var Q=m;m=y,y=Q}za(l,d-M,m-M,p+M,y+M)}}else if(F==="bezier"||F==="unbundled-bezier"||Zs(F,"segments")||Zs(F,"taxi")){var z;switch(F){case"bezier":case"unbundled-bezier":z=S.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=S.linePts;break}if(z!=null)for(var I=0;I<z.length;I++){var X=z[I];d=X.x-M,p=X.x+M,m=X.y-M,y=X.y+M,za(l,d,m,p,y)}}}else{var U=t.source(),te=U.position(),ie=t.target(),oe=ie.position();if(d=te.x,p=oe.x,m=te.y,y=oe.y,d>p){var ae=d;d=p,p=ae}if(m>y){var we=m;m=y,y=we}d-=M,p+=M,m-=M,y+=M,za(l,d,m,p,y)}if(a&&n.includeEdges&&c&&(Sv(l,t,"mid-source"),Sv(l,t,"mid-target"),Sv(l,t,"source"),Sv(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;za(l,l.x1+J,l.y1+ne,l.x2+J,l.y2+ne)}}var re=o.bodyBounds=o.bodyBounds||{};rk(re,l),Uv(re,w),Fv(re,1),a&&(d=l.x1,p=l.x2,m=l.y1,y=l.y2,za(l,d-L,m-L,p+L,y+L));var ge=o.overlayBounds=o.overlayBounds||{};rk(ge,l),Uv(ge,w),Fv(ge,1);var Ne=o.labelBounds=o.labelBounds||{};Ne.all!=null?SX(Ne.all):Ne.all=kr(),a&&n.includeLabels&&(n.includeMainLabels&&j0(l,t,null),c&&(n.includeSourceLabels&&j0(l,t,"source"),n.includeTargetLabels&&j0(l,t,"target")))}return l.x1=ka(l.x1),l.y1=ka(l.y1),l.x2=ka(l.x2),l.y2=ka(l.y2),l.w=ka(l.x2-l.x1),l.h=ka(l.y2-l.y1),l.w>0&&l.h>0&&T&&(Uv(l,w),Fv(l,1)),l},PL=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},zL=function(t){var n=function(o){return Math.round(o)};if(t.isEdge()){var r=t.source().position(),a=t.target().position();return WN([n(r.x),n(r.y),n(a.x),n(a.y)])}else{var i=t.position();return WN([n(i.x),n(i.y)])}},xj=function(t,n){var r=t._private,a,i=t.isEdge(),l=n==null?bj:PL(n),o=l===bj;if(r.bbCache==null?(a=UW(t,id),r.bbCache=a,r.bbCachePosKey=zL(t)):a=r.bbCache,!o){var f=t.isNode();a=kr(),(n.includeNodes&&f||n.includeEdges&&!f)&&(n.includeOverlays?qs(a,r.overlayBounds):qs(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?qs(a,r.labelBounds.all):(n.includeMainLabels&&qs(a,r.labelBounds.mainRot),n.includeSourceLabels&&qs(a,r.labelBounds.sourceRot),n.includeTargetLabels&&qs(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},id={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},bj=PL(id),wj=ur(id);wl.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=Ju(function(d){var p=d._private;return p.bbCache==null||p.styleDirty||p.bbCachePosKey!==zL(d)},function(d){return d.id()});if(n&&this.length===1&&!r(this[0]))e===void 0?e=id:e=wj(e),t=xj(this[0],e);else{t=kr(),e=e||id;var a=wj(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(),qs(t,xj(c,a))}}return t.x1=ka(t.x1),t.y1=ka(t.y1),t.x2=ka(t.x2),t.y2=ka(t.y2),t.w=ka(t.x2-t.x1),t.h=ka(t.y2-t.y1),t};wl.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};wl.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)),Dt(e)){var i=e;e=function(){return i}}var l=function(d,p){return d._private.bbAtOldPos=e(d,p)},o=function(d){return d._private.bbAtOldPos};n.startBatch(),t.forEach(l).silentPositions(e),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var f=wX(this.boundingBox({useCache:!1}));return t.silentPositions(o),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),f};Bu.boundingbox=Bu.bb=Bu.boundingBox;Bu.renderedBoundingbox=Bu.renderedBoundingBox;var qW=wl,Pf,zd;Pf=zd={};var IL=function(t){t.uppercaseName=BN(t.name),t.autoName="auto"+t.uppercaseName,t.labelName="label"+t.uppercaseName,t.outerName="outer"+t.uppercaseName,t.uppercaseOuterName=BN(t.outerName),Pf[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},Pf["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},Pf["rendered"+t.uppercaseName]=function(){var r=this[0];if(r){var a=r[t.name]();return a*this.cy().zoom()}},Pf["rendered"+t.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[t.outerName]();return a*this.cy().zoom()}}};IL({name:"width"});IL({name:"height"});zd.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};zd.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()};zd.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var VW=zd,HW=function(t,n){if(t.isEdge()&&t.takesUpSpace())return n(t)},GW=function(t,n){if(t.isEdge()&&t.takesUpSpace()){var r=t.cy();return Jp(n(t),r.zoom(),r.pan())}},$W=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 Jp(l,i,a)})}},KW=function(t){return t.renderer().getControlPoints(t)},YW=function(t){return t.renderer().getSegmentPoints(t)},XW=function(t){return t.renderer().getSourceEndpoint(t)},QW=function(t){return t.renderer().getTargetEndpoint(t)},WW=function(t){return t.renderer().getEdgeMidpoint(t)},Sj={controlPoints:{get:KW,mult:!0},segmentPoints:{get:YW,mult:!0},sourceEndpoint:{get:XW},targetEndpoint:{get:QW},midpoint:{get:WW}},ZW=function(t){return"rendered"+t[0].toUpperCase()+t.substr(1)},JW=Object.keys(Sj).reduce(function(e,t){var n=Sj[t],r=ZW(t);return e[t]=function(){return HW(this,n.get)},n.mult?e[r]=function(){return $W(this,n.get)}:e[r]=function(){return GW(this,n.get)},e},{}),eZ=at({},IW,qW,VW,JW);/*!
|
|
490
|
+
Event object based on jQuery events, MIT license
|
|
491
|
+
|
|
492
|
+
https://jquery.org/license/
|
|
493
|
+
https://tldrlegal.com/license/mit-license
|
|
494
|
+
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
495
|
+
*/var FL=function(t,n){this.recycle(t,n)};function kf(){return!1}function Ev(){return!0}FL.prototype={instanceString:function(){return"event"},recycle:function(t,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=kf,t!=null&&t.preventDefault?(this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?Ev:kf):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=Ev;var t=this.originalEvent;t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ev;var t=this.originalEvent;t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ev,this.stopPropagation()},isDefaultPrevented:kf,isPropagationStopped:kf,isImmediatePropagationStopped:kf};var UL=/^([^.]+)(\.(?:[^.]+))?$/,tZ=".*",qL={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},Ej=Object.keys(qL),nZ={};function sm(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nZ,t=arguments.length>1?arguments[1]:void 0,n=0;n<Ej.length;n++){var r=Ej[n];this[r]=e[r]||qL[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var pl=sm.prototype,VL=function(t,n,r,a,i,l,o){mn(a)&&(i=a,a=null),o&&(l==null?l=o:l=at({},l,o));for(var f=Yt(r)?r:r.split(/\s+/),c=0;c<f.length;c++){var d=f[c];if(!cl(d)){var p=d.match(UL);if(p){var m=p[1],y=p[2]?p[2]:null,x=n(t,d,m,y,a,i,l);if(x===!1)break}}}},Cj=function(t,n){return t.addEventFields(t.context,n),new FL(n.type,n)},rZ=function(t,n,r){if(uY(r)){n(t,r);return}else if(Dt(r)){n(t,Cj(t,r));return}for(var a=Yt(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var l=a[i];if(!cl(l)){var o=l.match(UL);if(o){var f=o[1],c=o[2]?o[2]:null,d=Cj(t,{type:f,namespace:c,target:t.context});n(t,d)}}}};pl.on=pl.addListener=function(e,t,n,r,a){return VL(this,function(i,l,o,f,c,d,p){mn(d)&&i.listeners.push({event:l,callback:d,type:o,namespace:f,qualifier:c,conf:p})},e,t,n,r,a),this};pl.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})};pl.removeListener=pl.off=function(e,t,n,r){var a=this;this.emitting!==0&&(this.listeners=GY(this.listeners));for(var i=this.listeners,l=function(c){var d=i[c];VL(a,function(p,m,y,x,b,S){if((d.type===y||e==="*")&&(!x&&d.namespace!==".*"||d.namespace===x)&&(!b||p.qualifierCompare(d.qualifier,b))&&(!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};pl.removeAllListeners=function(){return this.removeListener("*")};pl.emit=pl.trigger=function(e,t,n){var r=this.listeners,a=r.length;return this.emitting++,Yt(t)||(t=[t]),rZ(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===tZ)&&i.eventMatches(i.context,d,l)){var p=[l];t!=null&&KY(p,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,p);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 aZ={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&&Md(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()}},Cv=function(t){return tt(t)?new hl(t):t},HL={createEmitter:function(){for(var t=0;t<this.length;t++){var n=this[t],r=n._private;r.emitter||(r.emitter=new sm(aZ,n))}return this},emitter:function(){return this._private.emitter},on:function(t,n,r){for(var a=Cv(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=Cv(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=Cv(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=Cv(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}};Bt.eventAliasesOn(HL);var GL={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(tt(t)||ia(t))return new hl(t).filter(this);if(mn(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){tt(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(tt(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;tt(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 p=f[d],m=p._private.data.id,y=c.hasElementWithId(m);y||r.push(p)}};return l(a,i),l(i,a),r},diff:function(t){var n=this._private.cy;tt(t)&&(t=n.$(t));var r=this.spawn(),a=this.spawn(),i=this.spawn(),l=this,o=t,f=function(d,p,m){for(var y=0;y<d.length;y++){var x=d[y],b=x._private.data.id,S=p.hasElementWithId(b);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(tt(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&&tt(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&&tt(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}}},Lt=GL;Lt.u=Lt["|"]=Lt["+"]=Lt.union=Lt.or=Lt.add;Lt["\\"]=Lt["!"]=Lt["-"]=Lt.difference=Lt.relativeComplement=Lt.subtract=Lt.not;Lt.n=Lt["&"]=Lt["."]=Lt.and=Lt.intersection=Lt.intersect;Lt["^"]=Lt["(+)"]=Lt["(-)"]=Lt.symmetricDifference=Lt.symdiff=Lt.xor;Lt.fnFilter=Lt.filterFn=Lt.stdFilter=Lt.filter;Lt.complement=Lt.abscomp=Lt.absoluteComplement;var iZ={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}},$L=function(t,n){var r=t.cy(),a=r.hasCompoundNodes();function i(d){var p=d.pstyle("z-compound-depth");return p.value==="auto"?a?d.zDepth():0:p.value==="bottom"?-1:p.value==="top"?Ew:0}var l=i(t)-i(n);if(l!==0)return l;function o(d){var p=d.pstyle("z-index-compare");return p.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()},yp={forEach:function(t,n){if(mn(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(!mn(t))return this;var n=this.toArray().sort(t);return this.spawn(n)},sortByZIndex:function(){return this.sort($L)},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:Ew-1}else{var i=n.source,l=n.target,o=i.zDepth(),f=l.zDepth();return Math.max(o,f,0)}}}};yp.each=yp.forEach;var sZ=function(){var t="undefined",n=(typeof Symbol>"u"?"undefined":Un(Symbol))!=t&&Un(Symbol.iterator)!=t;n&&(yp[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,l=this.length;return HO({next:function(){return i<l?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};sZ();var lZ=ur({nodeDimensionsIncludeLabels:!1}),Vv={layoutDimensions:function(t){t=lZ(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(R){return!R.isParent()}),i=this.cy(),l=n.eles,o=function(A){return A.id()},f=Ju(r,o);t.emit({type:"layoutstart",layout:t}),t.animations=[];var c=function(A,D,L){var P={x:D.x1+D.w/2,y:D.y1+D.h/2},M={x:(L.x-P.x)*A,y:(L.y-P.y)*A};return{x:P.x+M.x,y:P.y+M.y}},d=n.spacingFactor&&n.spacingFactor!==1,p=function(){if(!d)return null;for(var A=kr(),D=0;D<a.length;D++){var L=a[D],P=f(L,D);cL(A,P.x,P.y)}return A},m=p(),y=Ju(function(R,A){var D=f(R,A);if(d){var L=Math.abs(n.spacingFactor);D=c(L,m,D)}return n.transform!=null&&(D=n.transform(R,D)),D},o);if(n.animate){for(var x=0;x<a.length;x++){var b=a[x],S=y(b,x),w=n.animateFilter==null||n.animateFilter(b,x);if(w){var C=b.animation({position:S,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(C)}else b.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 k=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(k)}t.animations.forEach(function(R){return R.play()}),t.one("layoutready",n.ready),t.emit({type:"layoutready",layout:t}),xc.all(t.animations.map(function(R){return R.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(at({},t,{eles:this}))}};Vv.createLayout=Vv.makeLayout=Vv.layout;function KL(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 lm(e,t){return e=yo(e),function(r){return KL(e,t,r)}}function om(e,t){e=yo(e);var n=function(a){return t.call(a)};return function(){var a=this[0];if(a)return KL(e,n,a)}}var lr={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(Dt(t)){var l=t;i.applyBypass(this,l,a),this.emitAndNotify("style")}else if(tt(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 A0(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 _w(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||A0(i,r);var f=o.source,c=o.target;return n(f)&&(!l||A0(f,n))&&(f===c||n(c)&&(!l||A0(c,n)))}}}var bc=lm("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});lr.takesUpSpace=om("takesUpSpace",_w({ok:bc}));var oZ=lm("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&bc(e)}),uZ=lm("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&bc(e)});lr.interactive=om("interactive",_w({ok:oZ,parentOk:uZ,edgeOkViaNode:bc}));lr.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var cZ=lm("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&bc(e)}),fZ=bc;lr.visible=om("visible",_w({ok:cZ,edgeOkViaNode:fZ}));lr.hidden=function(){var e=this[0];if(e)return!e.visible()};lr.isBundledBezier=om("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});lr.bypass=lr.css=lr.style;lr.renderedCss=lr.renderedStyle;lr.removeBypass=lr.removeCss=lr.removeStyle;lr.pstyle=lr.parsedStyle;var ll={};function Tj(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&&mn(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&Yt(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 p=e.overrideAble(f);if(p!==void 0&&(c=p,!p))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 wc(e){ll[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]}},ll[e.on]=Tj({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),ll[e.off]=Tj({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}wc({field:"locked",overrideField:function(t){return t.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});wc({field:"grabbable",overrideField:function(t){return t.cy().autoungrabify()||t.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});wc({field:"selected",ableField:"selectable",overrideAble:function(t){return t.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});wc({field:"selectable",overrideField:function(t){return t.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});ll.deselect=ll.unselect;ll.grabbed=function(){var e=this[0];if(e)return e._private.grabbed};wc({field:"active",on:"activate",off:"unactivate"});wc({field:"pannable",on:"panify",off:"unpanify"});ll.inactive=function(){var e=this[0];if(e)return!e._private.active};var gr={},Nj=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 p=c[d],m=p.source(),y=p.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)}},kj=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(),p=c.target();t.outgoing&&d===l?(a.push(c),a.push(p)):t.incoming&&p===l&&(a.push(c),a.push(d))}}return this.spawn(a,!0).filter(n)}},jj=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)}};gr.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null};at(gr,{roots:Nj({noIncomingEdges:!0}),leaves:Nj({noOutgoingEdges:!0}),outgoers:Aa(kj({outgoing:!0}),"outgoers"),successors:jj({outgoing:!0}),incomers:Aa(kj({incoming:!0}),"incomers"),predecessors:jj({})});at(gr,{neighborhood:Aa(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)}});gr.neighbourhood=gr.neighborhood;gr.closedNeighbourhood=gr.closedNeighborhood;gr.openNeighbourhood=gr.openNeighborhood;at(gr,{source:Aa(function(t){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&t?r.filter(t):r},"source"),target:Aa(function(t){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&t?r.filter(t):r},"target"),sources:Aj({attr:"source"}),targets:Aj({attr:"target"})});function Aj(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)}}at(gr,{edgesWith:Aa(Rj(),"edgesWith"),edgesTo:Aa(Rj({thisIsSrc:!0}),"edgesTo")});function Rj(e){return function(n){var r=[],a=this._private.cy,i=e||{};tt(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,p=this.hasElementWithId(d.source)&&n.hasElementWithId(d.target),m=n.hasElementWithId(d.source)&&this.hasElementWithId(d.target),y=p||m;y&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!p||i.thisIsTgt&&!m)||r.push(c))}return this.spawn(r,!0)}}at(gr,{connectedEdges:Aa(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:Aa(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:Aa(Dj(),"parallelEdges"),codirectedEdges:Aa(Dj({codirected:!0}),"codirectedEdges")});function Dj(e){var t={codirected:!1};return e=at({},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,p=d._private.data.id,m=c.data.target,y=d._private.edges,x=0;x<y.length;x++){var b=y[x],S=b._private.data,w=S.target,C=S.source,T=w===m&&C===p,k=p===w&&m===C;(l.codirected&&T||!l.codirected&&(T||k))&&a.push(b)}return this.spawn(a,!0).filter(r)}}at(gr,{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,p){a.merge(d),i.unmerge(d),p.merge(d)};if(i.empty())return n.spawn();var f=function(){var d=r.collection();l.push(d);var p=i[0];o(p,d),n.bfs({directed:!1,roots:p,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]}});gr.componentsOf=gr.components;var or=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){un("A collection must have a reference to the core");return}var i=new Ki,l=!1;if(!n)n=[];else if(n.length>0&&Dt(n[0])&&!Md(n[0])){l=!0;for(var o=[],f=new yc,c=0,d=n.length;c<d;c++){var p=n[c];p.data==null&&(p.data={});var m=p.data;if(m.id==null)m.id=lL();else if(t.hasElementWithId(m.id)||f.has(m.id))continue;var y=new Zp(t,p,!1);o.push(y),f.add(m.id)}n=o}this.length=0;for(var x=0,b=n.length;x<b;x++){var S=n[x][0];if(S!=null){var w=S._private.data.id;(!r||!i.has(w))&&(r&&i.set(w,{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 Ki,k=this.eles,R=0;R<k.length;R++){var A=k[R];T.set(A.id(),{index:R,ele:A})}}},r&&(this._private.map=i),l&&!a&&this.restore()},en=Zp.prototype=or.prototype=Object.create(Array.prototype);en.instanceString=function(){return"collection"};en.spawn=function(e,t){return new or(this.cy(),e,t)};en.spawnSelf=function(){return this.spawn(this)};en.cy=function(){return this._private.cy};en.renderer=function(){return this._private.cy.renderer()};en.element=function(){return this[0]};en.collection=function(){return KO(this)?this:new or(this._private.cy,[this])};en.unique=function(){return new or(this._private.cy,this,!0)};en.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)};en.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new or(t)};en.$id=en.getElementById;en.poolIndex=function(){var e=this._private.cy,t=e._private.elements,n=this[0]._private.data.id;return t._private.map.get(n).index};en.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index};en.indexOfId=function(e){return e=""+e,this._private.map.get(e).index};en.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(Dt(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 p=function(b,S,w){var C=e[b];C!=null&&C!==r[b]&&(C?t[S]():t[w]())};return p("removed","remove","restore"),p("selected","select","unselect"),p("selectable","selectify","unselectify"),p("locked","lock","unlock"),p("grabbable","grabify","ungrabify"),p("pannable","panify","unpanify"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var m={data:oi(r.data),position:oi(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}}};en.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t],r=n.json();e.push(r)}return e};en.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new Zp(e,a,!1);t.push(i)}return new or(e,t)};en.copy=en.clone;en.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 p,m=function(){o.splice(p,1),p--};for(p=0;p<o.length;p++){var y=o[p],x=y._private,b=x.data;if(y.clearTraversalCache(),!(!t&&!x.removed)){if(b.id===void 0)b.id=lL();else if(Ae(b.id))b.id=""+b.id;else if(cl(b.id)||!tt(b.id)){un("Can not create element with invalid string ID `"+b.id+"`"),m();continue}else if(r.hasElementWithId(b.id)){un("Can not create second element with ID `"+b.id+"`"),m();continue}}var S=b.id;if(y.isNode()){var w=x.position;w.x==null&&(w.x=0),w.y==null&&(w.y=0)}if(y.isEdge()){for(var C=y,T=["source","target"],k=T.length,R=!1,A=0;A<k;A++){var D=T[A],L=b[D];Ae(L)&&(L=b[D]=""+b[D]),L==null||L===""?(un("Can not create edge `"+S+"` with unspecified "+D),R=!0):r.hasElementWithId(L)||(un("Can not create edge `"+S+"` with nonexistant "+D+" `"+L+"`"),R=!0)}if(R){m();continue}var P=r.getElementById(b.source),M=r.getElementById(b.target);P.same(M)?P._private.edges.push(C):(P._private.edges.push(C),M._private.edges.push(C)),C._private.source=P,C._private.target=M}x.map=new Ki,x.map.set(S,{ele:y,index:0}),x.removed=!1,t&&r.addToPool(y)}for(var _=0;_<i.length;_++){var B=i[_],q=B._private.data;Ae(q.parent)&&(q.parent=""+q.parent);var V=q.parent,G=V!=null;if(G||B._private.parent){var F=B._private.parent?r.collection().merge(B._private.parent):r.getElementById(V);if(F.empty())q.parent=void 0;else if(F[0].removed())Pt("Node added with missing parent, reference to parent removed"),q.parent=void 0,B._private.parent=null;else{for(var H=!1,Y=F;!Y.empty();){if(B.same(Y)){H=!0,q.parent=void 0;break}Y=Y.parent()}H||(F[0]._private.children.push(B),B._private.parent=F[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var Q=o.length===n.length?n:new or(r,o),z=0;z<Q.length;z++){var I=Q[z];I.isNode()||(I.parallelEdges().clearTraversalCache(),I.source().clearTraversalCache(),I.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};en.removed=function(){var e=this[0];return e&&e._private.removed};en.inside=function(){var e=this[0];return e&&!e._private.removed};en.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(V){for(var G=V._private.edges,F=0;F<G.length;F++)f(G[F])}function o(V){for(var G=V._private.children,F=0;F<G.length;F++)f(G[F])}function f(V){var G=a[V.id()];t&&V.removed()||G||(a[V.id()]=!0,V.isNode()?(r.push(V),l(V),o(V)):r.unshift(V))}for(var c=0,d=n.length;c<d;c++){var p=n[c];f(p)}function m(V,G){var F=V._private.edges;fl(F,G),V.clearTraversalCache()}function y(V){V.clearTraversalCache()}var x=[];x.ids={};function b(V,G){G=G[0],V=V[0];var F=V._private.children,H=V.id();fl(F,G),G._private.parent=null,x.ids[H]||(x.ids[H]=!0,x.push(V))}n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(r);for(var S=0;S<r.length;S++){var w=r[S];if(w.isEdge()){var C=w.source()[0],T=w.target()[0];m(C,w),m(T,w);for(var k=w.parallelEdges(),R=0;R<k.length;R++){var A=k[R];y(A),A.isBundledBezier()&&A.dirtyBoundingBoxCache()}}else{var D=w.parent();D.length!==0&&b(D,w)}t&&(w._private.removed=!0)}var L=i._private.elements;i._private.hasCompoundNodes=!1;for(var P=0;P<L.length;P++){var M=L[P];if(M.isParent()){i._private.hasCompoundNodes=!0;break}}var _=new or(this.cy(),r);_.size()>0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var B=0;B<x.length;B++){var q=x[B];(!t||!q.removed())&&q.updateStyle()}return _};en.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],b=x._private.data;x.isEdge()&&(f&&(b.source=l),c&&(b.target=o))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var d=i(e.parent),p=d===null||t.hasElementWithId(d);if(p){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 b=n[x],S=b._private.data;b.isNode()&&(S.parent=m)}y.restore(r,a)}),n.emitAndNotify("move")}}return this};[xL,SW,qv,sl,tc,zW,im,eZ,HL,GL,iZ,yp,Vv,lr,ll,gr].forEach(function(e){at(en,e)});var dZ={add:function(t){var n,r=this;if(ia(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 or(r,i)}}else if(Yt(t)){var f=t;n=new or(r,f)}else if(Dt(t)&&(Yt(t.nodes)||Yt(t.edges))){for(var c=t,d=[],p=["nodes","edges"],m=0,y=p.length;m<y;m++){var x=p[m],b=c[x];if(Yt(b))for(var S=0,w=b.length;S<w;S++){var C=at({group:x},b[S]);d.push(C)}}n=new or(r,d)}else{var T=t;n=new Zp(r,T).collection()}return n},remove:function(t){if(!ia(t)){if(tt(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 hZ(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 p=0;p<4;++p)if(typeof arguments[p]!="number"||isNaN(arguments[p])||!isFinite(arguments[p]))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,_){return 1-3*_+3*M}function x(M,_){return 3*_-6*M}function b(M){return 3*M}function S(M,_,B){return((y(_,B)*M+x(_,B))*M+b(_))*M}function w(M,_,B){return 3*y(_,B)*M*M+2*x(_,B)*M+b(_)}function C(M,_){for(var B=0;B<a;++B){var q=w(_,e,n);if(q===0)return _;var V=S(_,e,n)-M;_-=V/q}return _}function T(){for(var M=0;M<f;++M)m[M]=S(M*c,e,n)}function k(M,_,B){var q,V,G=0;do V=_+(B-_)/2,q=S(V,e,n)-M,q>0?B=V:_=V;while(Math.abs(q)>l&&++G<o);return V}function R(M){for(var _=0,B=1,q=f-1;B!==q&&m[B]<=M;++B)_+=c;--B;var V=(M-m[B])/(m[B+1]-m[B]),G=_+V*c,F=w(G,e,n);return F>=i?C(M,G):F===0?G:k(M,_,_+c)}var A=!1;function D(){A=!0,(e!==t||n!==r)&&T()}var L=function(_){return A||D(),e===t&&n===r?_:_===0?0:_===1?1:S(R(_),t,r)};L.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var P="generateBezier("+[e,t,n,r]+")";return L.toString=function(){return P},L}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var vZ=(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,p=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*p):y=p;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(b){return f[b*(f.length-1)|0]}:c}})(),Wt=function(t,n,r,a){var i=hZ(t,n,r,a);return function(l,o,f){return l+(o-l)*i(f)}},Hv={linear:function(t,n,r){return t+(n-t)*r},ease:Wt(.25,.1,.25,1),"ease-in":Wt(.42,0,1,1),"ease-out":Wt(0,0,.58,1),"ease-in-out":Wt(.42,0,.58,1),"ease-in-sine":Wt(.47,0,.745,.715),"ease-out-sine":Wt(.39,.575,.565,1),"ease-in-out-sine":Wt(.445,.05,.55,.95),"ease-in-quad":Wt(.55,.085,.68,.53),"ease-out-quad":Wt(.25,.46,.45,.94),"ease-in-out-quad":Wt(.455,.03,.515,.955),"ease-in-cubic":Wt(.55,.055,.675,.19),"ease-out-cubic":Wt(.215,.61,.355,1),"ease-in-out-cubic":Wt(.645,.045,.355,1),"ease-in-quart":Wt(.895,.03,.685,.22),"ease-out-quart":Wt(.165,.84,.44,1),"ease-in-out-quart":Wt(.77,0,.175,1),"ease-in-quint":Wt(.755,.05,.855,.06),"ease-out-quint":Wt(.23,1,.32,1),"ease-in-out-quint":Wt(.86,0,.07,1),"ease-in-expo":Wt(.95,.05,.795,.035),"ease-out-expo":Wt(.19,1,.22,1),"ease-in-out-expo":Wt(1,0,0,1),"ease-in-circ":Wt(.6,.04,.98,.335),"ease-out-circ":Wt(.075,.82,.165,1),"ease-in-out-circ":Wt(.785,.135,.15,.86),spring:function(t,n,r){if(r===0)return Hv.linear;var a=vZ(t,n,r);return function(i,l,o){return i+(l-i)*a(o)}},"cubic-bezier":Wt};function Mj(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 Oj(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function mu(e,t,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var l=Oj(e,a),o=Oj(t,a);if(Ae(l)&&Ae(o))return Mj(i,l,o,n,r);if(Yt(l)&&Yt(o)){for(var f=[],c=0;c<o.length;c++){var d=l[c],p=o[c];if(d!=null&&p!=null){var m=Mj(i,d,p,n,r);f.push(m)}else f.push(p)}return f}}function pZ(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=Hv.linear;else{var p;if(tt(o)){var m=d.parse("transition-timing-function",o);p=m.value}else p=o;var y,x;tt(p)?(y=p,x=[]):(y=p[1],x=p.slice(2).map(function(Q){return+Q})),x.length>0?(y==="spring"&&x.push(l.duration),l.easingImpl=Hv[y].apply(null,x)):l.easingImpl=Hv[y]}var b=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 w=l.startPosition,C=l.position;if(C&&a&&!e.locked()){var T={};jf(w.x,C.x)&&(T.x=mu(w.x,C.x,S,b)),jf(w.y,C.y)&&(T.y=mu(w.y,C.y,S,b)),e.position(T)}var k=l.startPan,R=l.pan,A=i.pan,D=R!=null&&r;D&&(jf(k.x,R.x)&&(A.x=mu(k.x,R.x,S,b)),jf(k.y,R.y)&&(A.y=mu(k.y,R.y,S,b)),e.emit("pan"));var L=l.startZoom,P=l.zoom,M=P!=null&&r;M&&(jf(L,P)&&(i.zoom=nd(i.minZoom,mu(L,P,S,b),i.maxZoom)),e.emit("zoom")),(D||M)&&e.emit("viewport");var _=l.style;if(_&&_.length>0&&a){for(var B=0;B<_.length;B++){var q=_[B],V=q.name,G=q,F=l.startStyle[V],H=d.properties[F.name],Y=mu(F,G,S,b,H);d.overrideBypass(e,V,Y)}e.emit("style")}}return l.progress=S,S}function jf(e,t){return e==null||t==null?!1:Ae(e)&&Ae(t)?!0:!!(e&&t)}function mZ(e,t,n,r){var a=t._private;a.started=!0,a.startTime=n-a.progress*a.duration}function Lj(e,t){var n=t._private.aniEles,r=[];function a(d,p){var m=d._private,y=m.animation.current,x=m.animation.queue,b=!1;if(y.length===0){var S=x.shift();S&&y.push(S)}for(var w=function(A){for(var D=A.length-1;D>=0;D--){var L=A[D];L()}A.splice(0,A.length)},C=y.length-1;C>=0;C--){var T=y[C],k=T._private;if(k.stopped){y.splice(C,1),k.hooked=!1,k.playing=!1,k.started=!1,w(k.frames);continue}!k.playing&&!k.applying||(k.playing&&k.applying&&(k.applying=!1),k.started||mZ(d,T,e),pZ(d,T,e,p),k.applying&&(k.applying=!1),w(k.frames),k.step!=null&&k.step(e),T.completed()&&(y.splice(C,1),k.hooked=!1,k.playing=!1,k.started=!1,w(k.completes)),b=!0)}return!p&&y.length===0&&x.length===0&&r.push(d),b}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 gZ={animate:Bt.animate(),animation:Bt.animation(),animated:Bt.animated(),clearQueue:Bt.clearQueue(),delay:Bt.delay(),delayAnimation:Bt.delayAnimation(),stop:Bt.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&&hp(function(i){Lj(i,t),n()})}var r=t.renderer();r&&r.beforeRender?r.beforeRender(function(i,l){Lj(l,t)},r.beforeRenderPriorities.animations):n()}},yZ={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&&Md(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}},Tv=function(t){return tt(t)?new hl(t):t},YL={createEmitter:function(){var t=this._private;return t.emitter||(t.emitter=new sm(yZ,this)),this},emitter:function(){return this._private.emitter},on:function(t,n,r){return this.emitter().on(t,Tv(n),r),this},removeListener:function(t,n,r){return this.emitter().removeListener(t,Tv(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(t,n,r){return this.emitter().one(t,Tv(n),r),this},once:function(t,n,r){return this.emitter().one(t,Tv(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}};Bt.eventAliasesOn(YL);var Kb={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)}};Kb.jpeg=Kb.jpg;var Gv={layout:function(t){var n=this;if(t==null){un("Layout options must be specified to make a layout");return}if(t.name==null){un("A `name` must be specified to make a layout");return}var r=t.name,a=n.extension("layout",r);if(a==null){un("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;tt(t.eles)?i=n.$(t.eles):i=t.eles!=null?t.eles:n.$();var l=new a(at({},t,{cy:n,eles:i}));return l}};Gv.createLayout=Gv.makeLayout=Gv.layout;var xZ={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)}})}},bZ=ur({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]}),Yb={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){un("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&&Pt("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=bZ(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)}};Yb.invalidateDimensions=Yb.resize;var $v={collection:function(t,n){return tt(t)?this.$(t):ia(t)?t.collection():Yt(t)?(n||(n={}),new or(this,t,n.unique,n.removed)):new or(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}};$v.elements=$v.filter=$v.$;var Jn={},Vf="t",wZ="f";Jn.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};Jn.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]===Vf,p=t[f]===Vf,m=d!==p,y=c.mappedProperties.length>0;if(m||p&&y){var x=void 0;m&&y||m?x=c.properties:y&&(x=c.mappedProperties);for(var b=0;b<x.length;b++){for(var S=x[b],w=S.name,C=!1,T=f+1;T<n.length;T++){var k=n[T],R=t[T]===Vf;if(R&&(C=k.properties[S.name]!=null,C))break}!o[w]&&!C&&(o[w]=!0,l.push(w))}}}return r[a]=l,l};Jn.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+=Vf:n+=wZ}return r=t.getPropertiesDiff(a,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}};Jn.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]===Vf;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};Jn.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 p=d.mapping,m=p.fnValue=c.value(n);if(m===p.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}};Jn.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(re,ge,Ne){return n.getPropertiesHash(re,ge,Ne)},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]=[Kl,Eu]}for(var p=function(re,ge){return t.styleKeys[ge][0]=Jf(re,t.styleKeys[ge][0])},m=function(re,ge){return t.styleKeys[ge][1]=ed(re,t.styleKeys[ge][1])},y=function(re,ge){p(re,ge),m(re,ge)},x=function(re,ge){for(var Ne=0;Ne<re.length;Ne++){var Be=re.charCodeAt(Ne);p(Be,ge),m(Be,ge)}},b=2e9,S=function(re){return-128<re&&re<128&&Math.floor(re)!==re?b-(re*1024|0):re},w=0;w<r.length;w++){var C=r[w],T=f[C];if(T!=null){var k=this.properties[C],R=k.type,A=k.groupKey,D=void 0;k.hashOverride!=null?D=k.hashOverride(e,T):T.pfValue!=null&&(D=T.pfValue);var L=k.enums==null?T.value:null,P=D!=null,M=L!=null,_=P||M,B=T.units;if(R.number&&_&&!R.multiple){var q=P?D:L;y(S(q),A),!P&&B!=null&&x(B,A)}else x(T.strValue,A)}}for(var V=[Kl,Eu],G=0;G<a.length;G++){var F=a[G],H=t.styleKeys[F];V[0]=Jf(H[0],V[0]),V[1]=ed(H[1],V[1])}t.styleKey=PY(V[0],V[1]);var Y=t.styleKeys;t.labelDimsKey=Ps(Y.labelDimensions);var Q=i(e,["label"],Y.labelDimensions);if(t.labelKey=Ps(Q),t.labelStyleKey=Ps(gv(Y.commonLabel,Q)),!o){var z=i(e,["source-label"],Y.labelDimensions);t.sourceLabelKey=Ps(z),t.sourceLabelStyleKey=Ps(gv(Y.commonLabel,z));var I=i(e,["target-label"],Y.labelDimensions);t.targetLabelKey=Ps(I),t.targetLabelStyleKey=Ps(gv(Y.commonLabel,I))}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(gv,[Kl,Eu]);t.nodeKey=Ps(J),t.hasPie=we!=null&&we[0]!==Kl&&we[1]!==Eu,t.hasStripe=fe!=null&&fe[0]!==Kl&&fe[1]!==Eu}return l!==t.styleKey};Jn.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};Jn.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,p=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 b=function(){Pt("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("."),w=p.data,C=0;C<S.length&&w;C++){var T=S[C];w=w[T]}if(w==null)return b(),!1;var k;if(Ae(w)){var R=r.fieldMax-r.fieldMin;R===0?k=0:k=(w-r.fieldMin)/R}else return Pt("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+w+"` for `"+e.id()+"` is non-numeric)"),!1;if(k<0?k=0:k>1&&(k=1),o.color){var A=r.valueMin[0],D=r.valueMax[0],L=r.valueMin[1],P=r.valueMax[1],M=r.valueMin[2],_=r.valueMax[2],B=r.valueMin[3]==null?1:r.valueMin[3],q=r.valueMax[3]==null?1:r.valueMax[3],V=[Math.round(A+(D-A)*k),Math.round(L+(P-L)*k),Math.round(M+(_-M)*k),Math.round(B+(q-B)*k)];i={bypass:r.bypass,name:r.name,value:V,strValue:"rgb("+V[0]+", "+V[1]+", "+V[2]+")"}}else if(o.number){var G=r.valueMin+(r.valueMax-r.valueMin)*k;i=this.parse(r.name,G,r.bypass,m)}else return!1;if(!i)return b(),!1;i.mapping=r,r=i;break}case l.data:{for(var F=r.field.split("."),H=p.data,Y=0;Y<F.length&&H;Y++){var Q=F[Y];H=H[Q]}if(H!=null&&(i=this.parse(r.name,H,r.bypass,m)),!i)return b(),!1;i.mapping=r,r=i;break}case l.fn:{var z=r.value,I=r.fnValue!=null?r.fnValue:z(e);if(r.prevFnValue=I,I==null)return Pt("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(i=this.parse(r.name,I,r.bypass,m),!i)return Pt("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=oi(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};Jn.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)}}};Jn.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()};Jn.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],p=e.pstyle(d),m=t[d];if(m){var y=m.prev,x=y,b=m.next!=null?m.next:p,S=!1,w=void 0,C=1e-6;x&&(Ae(x.pfValue)&&Ae(b.pfValue)?(S=b.pfValue-x.pfValue,w=x.pfValue+C*S):Ae(x.value)&&Ae(b.value)?(S=b.value-x.value,w=x.value+C*S):Yt(x.value)&&Yt(b.value)&&(S=x.value[0]!==b.value[0]||x.value[1]!==b.value[1]||x.value[2]!==b.value[2],w=x.strValue),S&&(o[d]=b.strValue,this.applyBypass(e,d,w),f=!0))}}if(!f)return;r.transitioning=!0,new xc(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)};Jn.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)};Jn.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)})};Jn.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBounds},function(a){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})};Jn.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()})})};Jn.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()})})};Jn.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 Id={};Id.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(tt(t)){var p=this.parse(t,n,!0);p&&i.push(p)}else if(Dt(t)){var m=t;r=n;for(var y=Object.keys(m),x=0;x<y.length;x++){var b=y[x],S=m[b];if(S===void 0&&(S=m[Qp(b)]),S!==void 0){var w=this.parse(b,S,!0);w&&i.push(w)}}}else return!1;if(i.length===0)return!1;for(var C=!1,T=0;T<e.length;T++){for(var k=e[T],R={},A=void 0,D=0;D<i.length;D++){var L=i[D];if(r){var P=k.pstyle(L.name);A=R[L.name]={prev:P}}C=this.applyParsedProperty(k,oi(L))||C,r&&(A.next=k.pstyle(L.name))}C&&this.updateStyleHints(k),r&&this.updateTransitions(k,R,l)}return C};Id.overrideBypass=function(e,t,n){t=ww(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)}};Id.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)};Id.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 p="",m=this.parse(f,p,!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 Bw={};Bw.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1};Bw.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 pi={};pi.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)};pi.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[Qp(i.name)]=l)}return r}};pi.getIndexedStyle=function(e,t,n,r){var a=e.pstyle(t)[n][r];return a??e.cy().style().getDefaultProperty(t)[n][0]};pi.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&&Ae(o)){var d=e.cy().zoom(),p=function(S){return S*d},m=function(S,w){return p(S)+w},y=Yt(o),x=y?f.every(function(b){return b!=null}):f!=null;return x?y?o.map(function(b,S){return m(b,f[S])}).join(" "):m(o,f):y?o.map(function(b){return tt(b)?b:""+p(b)}).join(" "):""+p(o)}else if(c!=null)return c}return null}};pi.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&&(Dt(l)?l=this.parse(i,l.strValue):l=this.parse(i,l)),l&&(n[i]=l)}return n};pi.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[ww(o)],d=this.parse(c.name,f);d&&n.push(d)}return n};pi.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]=Jf(o,r[0]),r[1]=ed(o,r[1]);else for(l=i.strValue,c=0;c<l.length;c++)o=l.charCodeAt(c),r[0]=Jf(o,r[0]),r[1]=ed(o,r[1]);return r};pi.getPropertiesHash=pi.getNonDefaultPropertiesHash;var um={};um.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};um.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t};um.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 Pw={};Pw.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){Pt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=d[0];var p=d[1];if(p!=="core"){var m=new hl(p);if(m.invalid){Pt("Skipping parsing of block: Invalid selector found in string stylesheet: "+p),o();continue}}var y=d[2],x=!1;i=y;for(var b=[];;){var S=i.match(/^\s*$/);if(S)break;var w=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!w){Pt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+y),x=!0;break}l=w[0];var C=w[1],T=w[2],k=t.properties[C];if(!k){Pt("Skipping property: Invalid property name in: "+l),f();continue}var R=n.parse(C,T);if(!R){Pt("Skipping property: Invalid property definition in: "+l),f();continue}b.push({name:C,val:T}),f()}if(x){o();break}n.selector(p);for(var A=0;A<b.length;A++){var D=b[A];n.css(D.name,D.val)}o()}return n};Pw.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var On={};(function(){var e=In,t=pY,n=gY,r=yY,a=xY,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)$","^(.+)$"];On.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 tt(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=cl(ne),Ne=cl(re);return ge&&!Ne||!ge&&Ne}},c=On.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}],p=[{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}],b=[{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}],w=[{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}],k=function(ne,re){return re.value==="label"?-ne.poolIndex():re.pfValue},R=[{name:"height",type:c.nodeSize,triggersBounds:f.any,hashOverride:k},{name:"width",type:c.nodeSize,triggersBounds:f.any,hashOverride:k},{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}],A=[{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}],P=[{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}],_=[{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}],B=[{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}],q=[];On.pieBackgroundN=16,q.push({name:"pie-size",type:c.sizeMaybePercent}),q.push({name:"pie-hole",type:c.sizeMaybePercent}),q.push({name:"pie-start-angle",type:c.angle});for(var V=1;V<=On.pieBackgroundN;V++)q.push({name:"pie-"+V+"-background-color",type:c.color}),q.push({name:"pie-"+V+"-background-size",type:c.percent}),q.push({name:"pie-"+V+"-background-opacity",type:c.zeroOneNumber});var G=[];On.stripeBackgroundN=16,G.push({name:"stripe-size",type:c.sizeMaybePercent}),G.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var F=1;F<=On.stripeBackgroundN;F++)G.push({name:"stripe-"+F+"-background-color",type:c.color}),G.push({name:"stripe-"+F+"-background-size",type:c.percent}),G.push({name:"stripe-"+F+"-background-opacity",type:c.zeroOneNumber});var H=[],Y=On.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,Ne=J.triggersBounds;H.push({name:re,type:ge,triggersBounds:Ne})})},{});var Q=On.properties=[].concat(b,T,S,w,C,_,x,y,d,p,m,R,A,D,L,q,G,P,M,H,B),z=On.propertyGroups={behavior:b,transition:T,visibility:S,overlay:w,underlay:C,ghost:_,commonLabel:x,labelDimensions:y,mainLabel:d,sourceLabel:p,targetLabel:m,nodeBody:R,nodeBorder:A,nodeOutline:D,backgroundImage:L,pie:q,stripe:G,compound:P,edgeLine:M,edgeArrow:H,core:B},I=On.propertyGroupNames={},X=On.propertyGroupKeys=Object.keys(z);X.forEach(function(J){I[J]=z[J].map(function(ne){return ne.name}),z[J].forEach(function(ne){return ne.groupKey=J})});var U=On.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"}];On.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}})();On.getDefaultProperty=function(e){return this.getDefaultProperties()[e]};On.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=at({"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<=On.pieBackgroundN;d++){var p=c.name.replace("{{i}}",d),m=c.value;f[p]=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<=On.stripeBackgroundN;d++){var p=c.name.replace("{{i}}",d),m=c.value;f[p]=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 On.arrowPrefixes.forEach(function(d){var p=d+"-"+c.name,m=c.value;f[p]=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};On.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 cm={};cm.parse=function(e,t,n,r){var a=this;if(mn(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=aL(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=oi(d),d&&(d.value=oi(d.value))),d};cm.parseImplWarn=function(e,t,n,r){var a=this.parseImpl(e,t,n,r);return!a&&t!=null&&Pt("The style property `".concat(e,": ").concat(t,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&t==="label"&&Pt("The style value of `label` is deprecated for `"+a.name+"`"),a};cm.parseImpl=function(e,t,n,r){var a=this;e=ww(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=tt(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(mn(t))return{name:e,value:t,strValue:"fn",mapped:o.fn,bypass:n};var d,p;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"&&(p=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,p[4]);if(!x||x.mapped)return!1;var b=this.parse(e,p[5]);if(!b||b.mapped)return!1;if(x.pfValue===b.pfValue||x.strValue===b.strValue)return Pt("`"+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,w=b.value,C=S[0]===w[0]&&S[1]===w[1]&&S[2]===w[2]&&(S[3]===w[3]||(S[3]==null||S[3]===1)&&(w[3]==null||w[3]===1));if(C)return!1}return{name:e,value:p,strValue:""+t,mapped:y,field:p[1],fieldMin:parseFloat(p[2]),fieldMax:parseFloat(p[3]),valueMin:x.value,valueMax:b.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var T;if(f?T=t.split(/\s+/):Yt(t)?T=t:T=[t],c.evenMultiple&&T.length%2!==0)return null;for(var k=[],R=[],A=[],D="",L=!1,P=0;P<T.length;P++){var M=a.parse(e,T[P],n,"multiple");L=L||tt(M.value),k.push(M.value),A.push(M.pfValue!=null?M.pfValue:M.value),R.push(M.units),D+=(P>0?" ":"")+M.strValue}return c.validate&&!c.validate(k,R)?null:c.singleEnum&&L?k.length===1&&tt(k[0])?{name:e,value:k[0],strValue:k[0],bypass:n}:null:{name:e,value:k,pfValue:A,strValue:D,bypass:n,units:R}}var _=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 B,q="px";if(c.units&&(B=c.units),c.implicitUnits&&(q=c.implicitUnits),!c.unitless)if(f){var V="px|em"+(c.allowPercent?"|\\%":"");B&&(V=B);var G=t.match("^("+In+")("+V+")?$");G&&(t=G[1],B=G[2]||q)}else(!B||c.implicitUnits)&&(B=q);if(t=parseFloat(t),isNaN(t)&&c.enums===void 0)return null;if(isNaN(t)&&c.enums!==void 0)return t=l,_();if(c.integer&&!oY(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 F={name:e,value:t,strValue:""+t+(B||""),units:B,bypass:n};return c.unitless||B!=="px"&&B!=="em"?F.pfValue=t:F.pfValue=B==="px"||!B?t:this.getEmSizeInPixels()*t,(B==="ms"||B==="s")&&(F.pfValue=B==="ms"?t:1e3*t),(B==="deg"||B==="rad")&&(F.pfValue=B==="rad"?t:yX(t)),B==="%"&&(F.pfValue=t/100),F}else if(c.propList){var H=[],Y=""+t;if(Y!=="none"){for(var Q=Y.split(/\s*,\s*|\s+/),z=0;z<Q.length;z++){var I=Q[z].trim();a.properties[I]?H.push(I):Pt("`"+I+"` 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=WO(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=_();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?_():null};var Zn=function(t){if(!(this instanceof Zn))return new Zn(t);if(!bw(t)){un("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},yr=Zn.prototype;yr.instanceString=function(){return"style"};yr.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};yr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};yr.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)};yr.selector=function(e){var t=e==="core"?null:new hl(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this};yr.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[Qp(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else t.length===2&&this.cssRule(t[0],t[1]);return this};yr.style=yr.css;yr.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};yr.append=function(e){return YO(e)?e.appendToStyle(this):Yt(e)?this.appendFromJson(e):tt(e)&&this.appendFromString(e),this};Zn.fromJson=function(e,t){var n=new Zn(e);return n.fromJson(t),n};Zn.fromString=function(e,t){return new Zn(e).fromString(t)};[Jn,Id,Bw,pi,um,Pw,On,cm].forEach(function(e){at(yr,e)});Zn.types=yr.types;Zn.properties=yr.properties;Zn.propertyGroups=yr.propertyGroups;Zn.propertyGroupNames=yr.propertyGroupNames;Zn.propertyGroupKeys=yr.propertyGroupKeys;var SZ={style:function(t){if(t){var n=this.setStyle(t);n.update()}return this._private.style},setStyle:function(t){var n=this._private;return YO(t)?n.style=t.generateStyle(this):Yt(t)?n.style=Zn.fromJson(this,t):tt(t)?n.style=Zn.fromString(this,t):n.style=Zn(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},EZ="single",wo={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=EZ),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(tt(t[0]))return r=t[0],n[r];if(Dt(t[0])){if(!this._private.panningEnabled)return this;i=t[0],l=i.x,o=i.y,Ae(l)&&(n.x=l),Ae(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")&&Ae(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:Dt(t)&&(o=r[0],f=o.x,c=o.y,Ae(f)&&(a.x+=f),Ae(c)&&(a.y+=c),this.emit("pan viewport"));break;case 2:i=t,l=n,(i==="x"||i==="y")&&Ae(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(Ae(t)&&n===void 0&&(n=t,t=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(tt(t)){var a=t;t=this.$(a)}else if(fY(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 ia(t)||(t=this.mutableElements());if(!(ia(t)&&t.empty())){r=r||t.boundingBox();var l=this.width(),o=this.height(),f;if(n=Ae(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 Ae(t)&&Ae(n)&&t<=n?(r.minZoom=t,r.maxZoom=n):Ae(t)&&n===void 0&&t<=r.maxZoom?r.minZoom=t:Ae(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),Ae(t)?l=t:Dt(t)&&(l=t.level,t.position!=null?i=Jp(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||!Ae(l)||l===a||i!=null&&(!Ae(i.x)||!Ae(i.y)))return null;if(i!=null){var f=r,c=a,d=l,p={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:p}}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(Ae(t.zoom)||(r=!1),Dt(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;Ae(c.x)&&(n.pan.x=c.x,o=!1),Ae(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(tt(t)){var r=t;t=this.mutableElements().filter(r)}else ia(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}};wo.centre=wo.center;wo.autolockNodes=wo.autolock;wo.autoungrabifyNodes=wo.autoungrabify;var sd={data:Bt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Bt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Bt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Bt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sd.attr=sd.data;sd.removeAttr=sd.removeData;var ld=function(t){var n=this;t=at({},t);var r=t.container;r&&!dp(r)&&dp(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=at({name:l?"grid":"null"},o.layout),o.renderer=at({name:l?"canvas":"null"},o.renderer);var f=function(x,b,S){return b!==void 0?b:S!==void 0?S:x},c=this._private={container:r,ready:!1,options:o,elements:new or(this),listeners:[],aniEles:new or(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:Ae(o.zoom)?o.zoom:1,pan:{x:Dt(o.pan)&&Ae(o.pan.x)?o.pan.x:0,y:Dt(o.pan)&&Ae(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,b){var S=x.some(dY);if(S)return xc.all(x).then(b);b(x)};c.styleEnabled&&n.setStyle([]);var p=at({},o,o.renderer);n.initRenderer(p);var m=function(x,b,S){n.notifications(!1);var w=n.mutableElements();w.length>0&&w.remove(),x!=null&&(Dt(x)||Yt(x))&&n.add(x),n.one("layoutready",function(T){n.notifications(!0),n.emit(T),n.one("load",b),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",S),n.emit("done")});var C=at({},n._private.options.layout);C.eles=n.elements(),n.layout(C).run()};d([o.style,o.elements],function(y){var x=y[0],b=y[1];c.styleEnabled&&n.style().append(x),m(b,function(){n.startAnimationLoop(),c.ready=!0,mn(o.ready)&&n.on("ready",o.ready);for(var S=0;S<i.length;S++){var w=i[S];n.on("ready",w)}a&&(a.readies=[]),n.emit("ready")},o.done)})},xp=ld.prototype;at(xp,{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!dp(t)&&dp(t[0])&&(t=t[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=t,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(at({},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 oi(this._private.options)},json:function(t){var n=this,r=n._private,a=n.mutableElements(),i=function(k){return n.getElementById(k.id())};if(Dt(t)){if(n.startBatch(),t.elements){var l={},o=function(k,R){for(var A=[],D=[],L=0;L<k.length;L++){var P=k[L];if(!P.data.id){Pt("cy.json() cannot handle elements without an ID attribute");continue}var M=""+P.data.id,_=n.getElementById(M);l[M]=!0,_.length!==0?D.push({ele:_,json:P}):(R&&(P.group=R),A.push(P))}n.add(A);for(var B=0;B<D.length;B++){var q=D[B],V=q.ele,G=q.json;V.json(G)}};if(Yt(t.elements))o(t.elements);else for(var f=["nodes","edges"],c=0;c<f.length;c++){var d=f[c],p=t.elements[d];Yt(p)&&o(p,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 b=y[x];t[b]!=null&&n[b](t[b])}return n.endBatch(),this}else{var S=!!t,w={};S?w.elements=this.elements().map(function(T){return T.json()}):(w.elements={},a.forEach(function(T){var k=T.group();w.elements[k]||(w.elements[k]=[]),w.elements[k].push(T.json())})),this._private.styleEnabled&&(w.style=n.style().json()),w.data=oi(n.data());var C=r.options;return w.zoomingEnabled=r.zoomingEnabled,w.userZoomingEnabled=r.userZoomingEnabled,w.zoom=r.zoom,w.minZoom=r.minZoom,w.maxZoom=r.maxZoom,w.panningEnabled=r.panningEnabled,w.userPanningEnabled=r.userPanningEnabled,w.pan=oi(r.pan),w.boxSelectionEnabled=r.boxSelectionEnabled,w.renderer=oi(C.renderer),w.hideEdgesOnViewport=C.hideEdgesOnViewport,w.textureOnViewport=C.textureOnViewport,w.wheelSensitivity=C.wheelSensitivity,w.motionBlur=C.motionBlur,w.multiClickDebounceTime=C.multiClickDebounceTime,w}}});xp.$id=xp.getElementById;[dZ,gZ,YL,Kb,Gv,xZ,Yb,$v,SZ,wo,sd].forEach(function(e){at(xp,e)});var CZ={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}},TZ={maximal:!1,acyclic:!1},gu=function(t){return t.scratch("breadthfirst")},_j=function(t,n){return t.scratch("breadthfirst",n)};function XL(e){this.options=at({},CZ,TZ,e)}XL.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().filter(function(Ve){return Ve.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(ia(e.roots))c=e.roots;else if(Yt(e.roots)){for(var d=[],p=0;p<e.roots.length;p++){var m=e.roots[p],y=t.getElementById(m);d.push(y)}c=t.collection(d)}else if(tt(e.roots))c=t.$(e.roots);else if(i)c=r.roots();else{var x=n.components();c=t.collection();for(var b=function(){var Re=x[S],Ke=Re.maxDegree(!1),Xe=Re.filter(function(st){return st.degree(!1)===Ke});c=c.add(Xe)},S=0;S<x.length;S++)b()}var w=[],C={},T=function(Re,Ke){w[Ke]==null&&(w[Ke]=[]);var Xe=w[Ke].length;w[Ke].push(Re),_j(Re,{index:Xe,depth:Ke})},k=function(Re,Ke){var Xe=gu(Re),st=Xe.depth,Pe=Xe.index;w[st][Pe]=null,Re.isChildless()&&T(Re,Ke)};a.bfs({roots:c,directed:e.directed,visit:function(Re,Ke,Xe,st,Pe){var ft=Re[0],he=ft.id();ft.isChildless()&&T(ft,Pe),C[he]=!0}});for(var R=[],A=0;A<r.length;A++){var D=r[A];C[D.id()]||R.push(D)}var L=function(Re){for(var Ke=w[Re],Xe=0;Xe<Ke.length;Xe++){var st=Ke[Xe];if(st==null){Ke.splice(Xe,1),Xe--;continue}_j(st,{depth:Re,index:Xe})}},P=function(Re,Ke){for(var Xe=gu(Re),st=Re.incomers().filter(function(Me){return Me.isNode()&&n.has(Me)}),Pe=-1,ft=Re.id(),he=0;he<st.length;he++){var Ce=st[he],De=gu(Ce);Pe=Math.max(Pe,De.depth)}if(Xe.depth<=Pe){if(!e.acyclic&&Ke[ft])return null;var Ie=Pe+1;return k(Re,Ie),Ke[ft]=Ie,!0}return!1};if(i&&l){var M=[],_={},B=function(Re){return M.push(Re)},q=function(){return M.shift()};for(r.forEach(function(Ve){return M.push(Ve)});M.length>0;){var V=q(),G=P(V,_);if(G)V.outgoers().filter(function(Ve){return Ve.isNode()&&n.has(Ve)}).forEach(B);else if(G===null){Pt("Detected double maximal shift for node `"+V.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var F=0;if(e.avoidOverlap)for(var H=0;H<r.length;H++){var Y=r[H],Q=Y.layoutDimensions(e),z=Q.w,I=Q.h;F=Math.max(F,z,I)}var X={},U=function(Re){if(X[Re.id()])return X[Re.id()];for(var Ke=gu(Re).depth,Xe=Re.neighborhood(),st=0,Pe=0,ft=0;ft<Xe.length;ft++){var he=Xe[ft];if(!(he.isEdge()||he.isParent()||!r.has(he))){var Ce=gu(he);if(Ce!=null){var De=Ce.index,Ie=Ce.depth;if(!(De==null||Ie==null)){var Me=w[Ie].length;Ie<Ke&&(st+=De/Me,Pe++)}}}}return Pe=Math.max(1,Pe),st=st/Pe,Pe===0&&(st=0),X[Re.id()]=st,st},te=function(Re,Ke){var Xe=U(Re),st=U(Ke),Pe=Xe-st;return Pe===0?QO(Re.id(),Ke.id()):Pe};e.depthSort!==void 0&&(te=e.depthSort);for(var ie=w.length,oe=0;oe<ie;oe++)w[oe].sort(te),L(oe);for(var ae=[],we=0;we<R.length;we++)ae.push(R[we]);var fe=function(){for(var Re=0;Re<ie;Re++)L(Re)};ae.length&&(w.unshift(ae),ie=w.length,fe());for(var J=0,ne=0;ne<ie;ne++)J=Math.max(w[ne].length,J);var re={x:f.x1+f.w/2,y:f.y1+f.h/2},ge=r.reduce(function(Ve,Re){return(function(Ke){return{w:Ve.w===-1?Ke.w:(Ve.w+Ke.w)/2,h:Ve.h===-1?Ke.h:(Ve.h+Ke.h)/2}})(Re.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Ne=Math.max(ie===1?0:o?(f.h-e.padding*2-ge.h)/(ie-1):(f.h-e.padding*2-ge.h)/(ie+1),F),Be=w.reduce(function(Ve,Re){return Math.max(Ve,Re.length)},0),lt=function(Re){var Ke=gu(Re),Xe=Ke.depth,st=Ke.index;if(e.circle){var Pe=Math.min(f.w/2/ie,f.h/2/ie);Pe=Math.max(Pe,F);var ft=Pe*Xe+Pe-(ie>0&&w[0].length<=3?Pe/2:0),he=2*Math.PI/w[Xe].length*st;return Xe===0&&w[0].length===1&&(ft=1),{x:re.x+ft*Math.cos(he),y:re.y+ft*Math.sin(he)}}else{var Ce=w[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),F),Ie={x:re.x+(st+1-(Ce+1)/2)*De,y:re.y+(Xe+1-(ie+1)/2)*Ne};return Ie}},Je={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Je).indexOf(e.direction)===-1&&un("Invalid direction '".concat(e.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Je).join(", ")));var Qe=function(Re){return UY(lt(Re),f,Je[e.direction])};return n.nodes().layoutPositions(this,e,Qe),this};var NZ={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 QL(e){this.options=at({},NZ,e)}QL.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,p=0,m=0;m<i.length;m++){var y=i[m],x=y.layoutDimensions(t),b=x.w,S=x.h;p=Math.max(p,b,S)}if(Ae(t.radius)?d=t.radius:i.length<=1?d=0:d=Math.min(l.h,l.w)/2-p,i.length>1&&t.avoidOverlap){p*=1.75;var w=Math.cos(c)-Math.cos(0),C=Math.sin(c)-Math.sin(0),T=Math.sqrt(p*p/(w*w+C*C));d=Math.max(T,d)}var k=function(A,D){var L=t.startAngle+D*c*(a?1:-1),P=d*Math.cos(L),M=d*Math.sin(L),_={x:o.x+P,y:o.y+M};return _};return r.nodes().layoutPositions(this,t,k),this};var kZ={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 WL(e){this.options=at({},kZ,e)}WL.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 p=i[d],m=void 0;m=t.concentric(p),f.push({value:m,node:p}),p._private.scratch.concentric=m}i.updateStyle();for(var y=0;y<i.length;y++){var x=i[y],b=x.layoutDimensions(t);c=Math.max(c,b.w,b.h)}f.sort(function(Ne,Be){return Be.value-Ne.value});for(var S=t.levelWidth(i),w=[[]],C=w[0],T=0;T<f.length;T++){var k=f[T];if(C.length>0){var R=Math.abs(C[0].value-k.value);R>=S&&(C=[],w.push(C))}C.push(k)}var A=c+t.minNodeSpacing;if(!t.avoidOverlap){var D=w.length>0&&w[0].length>1,L=Math.min(l.w,l.h)/2-A,P=L/(w.length+D?1:0);A=Math.min(A,P)}for(var M=0,_=0;_<w.length;_++){var B=w[_],q=t.sweep===void 0?2*Math.PI-2*Math.PI/B.length:t.sweep,V=B.dTheta=q/Math.max(1,B.length-1);if(B.length>1&&t.avoidOverlap){var G=Math.cos(V)-Math.cos(0),F=Math.sin(V)-Math.sin(0),H=Math.sqrt(A*A/(G*G+F*F));M=Math.max(H,M)}B.r=M,M+=A}if(t.equidistant){for(var Y=0,Q=0,z=0;z<w.length;z++){var I=w[z],X=I.r-Q;Y=Math.max(Y,X)}Q=0;for(var U=0;U<w.length;U++){var te=w[U];U===0&&(Q=te.r),te.r=Q,Q+=Y}}for(var ie={},oe=0;oe<w.length;oe++)for(var ae=w[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(Ne){var Be=Ne.id();return ie[Be]}),this};var R0,jZ={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 fm(e){this.options=at({},jZ,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)}fm.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?R0=!0:R0=!1;var r=AZ(t,n,e);R0&&DZ(r),e.randomize&&MZ(r);var a=Zi(),i=function(){OZ(r,t,e),e.fit===!0&&t.fit(e.padding)},l=function(m){return!(n.stopped||m>=e.numIter||(LZ(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=JL(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)Pj(r,e),o();else{var y=Zi();y-a>=e.animationThreshold&&i(),hp(d)}};d()}else{for(;c;)c=l(f),f++;Pj(r,e),o()}return this};fm.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};fm.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var AZ=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 p=f[d],m=0;m<p.length;m++){var y=p[m];c[y.id()]=d}for(var d=0;d<o.nodeSize;d++){var x=i[d],b=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=b.w,S.width=b.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=mn(r.nodeRepulsion)?r.nodeRepulsion(x):r.nodeRepulsion,o.layoutNodes.push(S),o.idToIndex[S.id]=d}for(var w=[],C=0,T=-1,k=[],d=0;d<o.nodeSize;d++){var x=o.layoutNodes[d],R=x.parentId;R!=null?o.layoutNodes[o.idToIndex[R]].children.push(x.id):(w[++T]=x.id,k.push(x.id))}for(o.graphSet.push(k);C<=T;){var A=w[C++],D=o.idToIndex[A],y=o.layoutNodes[D],L=y.children;if(L.length>0){o.graphSet.push(L);for(var d=0;d<L.length;d++)w[++T]=L[d]}}for(var d=0;d<o.graphSet.length;d++)for(var P=o.graphSet[d],m=0;m<P.length;m++){var M=o.idToIndex[P[m]];o.indexToGraph[M]=d}for(var d=0;d<o.edgeSize;d++){var _=a[d],B={};B.id=_.data("id"),B.sourceId=_.data("source"),B.targetId=_.data("target");var q=mn(r.idealEdgeLength)?r.idealEdgeLength(_):r.idealEdgeLength,V=mn(r.edgeElasticity)?r.edgeElasticity(_):r.edgeElasticity,G=o.idToIndex[B.sourceId],F=o.idToIndex[B.targetId],H=o.indexToGraph[G],Y=o.indexToGraph[F];if(H!=Y){for(var Q=RZ(B.sourceId,B.targetId,o),z=o.graphSet[Q],I=0,S=o.layoutNodes[G];z.indexOf(S.id)===-1;)S=o.layoutNodes[o.idToIndex[S.parentId]],I++;for(S=o.layoutNodes[F];z.indexOf(S.id)===-1;)S=o.layoutNodes[o.idToIndex[S.parentId]],I++;q*=I*r.nestingFactor}B.idealLength=q,B.elasticity=V,o.layoutEdges.push(B)}return o},RZ=function(t,n,r){var a=ZL(t,n,0,r);return 2>a.count?0:a.graph},ZL=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 p=a.indexToGraph[a.idToIndex[d[0]]],m=ZL(t,n,p,a);if(m.count!==0)if(m.count===1){if(l++,l===2)break}else return m}}return{count:l,graph:r}},DZ,MZ=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)}},JL=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}}},OZ=function(t,n,r){var a=r.layout,i=r.eles.nodes(),l=JL(t,r,i);i.positions(l),t.ready!==!0&&(t.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},LZ=function(t,n,r){_Z(t,n),zZ(t),IZ(t,n),FZ(t),UZ(t)},_Z=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]]];BZ(o,c,t,n)}},Bj=function(t){return-1+2*t*Math.random()},BZ=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=Bj(c),f=Bj(c));var d=PZ(t,n,o,f);if(d>0)var p=a.nodeOverlap*d,m=Math.sqrt(o*o+f*f),y=p*o/m,x=p*f/m;else var b=bp(t,o,f),S=bp(n,-1*o,-1*f),w=S.x-b.x,C=S.y-b.y,T=w*w+C*C,m=Math.sqrt(T),p=(t.nodeRepulsion+n.nodeRepulsion)/T,y=p*w/m,x=p*C/m;t.isLocked||(t.offsetX-=y,t.offsetY-=x),n.isLocked||(n.offsetX+=y,n.offsetY+=x)}},PZ=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},bp=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)},zZ=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 p=bp(l,c,d),m=bp(f,-1*c,-1*d),y=m.x-p.x,x=m.y-p.y,b=Math.sqrt(y*y+x*x),S=Math.pow(a.idealLength-b,2)/a.elasticity;if(b!==0)var w=S*y/b,C=S*x/b;else var w=0,C=0;l.isLocked||(l.offsetX+=w,l.offsetY+=C),f.isLocked||(f.offsetX-=w,f.offsetY-=C)}}},IZ=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 p=0;p<l;p++){var m=t.layoutNodes[t.idToIndex[i[p]]];if(!m.isLocked){var y=o-m.positionX,x=f-m.positionY,b=Math.sqrt(y*y+x*x);if(b>r){var S=n.gravity*y/b,w=n.gravity*x/b;m.offsetX+=S,m.offsetY+=w}}}}},FZ=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,p=f.offsetY,m=0;m<c.length;m++){var y=t.layoutNodes[t.idToIndex[c[m]]];y.offsetX+=d,y.offsetY+=p,r[++i]=c[m]}f.offsetX=0,f.offsetY=0}}},UZ=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=qZ(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,e_(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)}},qZ=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},e_=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 e_(a,n)}},Pj=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 p=0;p<d.length;p++){var m=d[p];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,b=0,S=0,w=Math.sqrt(c)*t.clientWidth/t.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var p=0;p<d.length;p++){var m=d[p];m.isLocked||(m.positionX+=y-d.x1,m.positionY+=x-d.y1)}y+=d.w+n.componentSpacing,b+=d.w+n.componentSpacing,S=Math.max(S,d.h),b>w&&(x+=S+n.componentSpacing,y=0,b=0,S=0)}}},VZ={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 t_(e){this.options=at({},VZ,e)}t_.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},p=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(),b=p();(x-1)*b>=l?d(x-1):(b-1)*x>=l&&p(b-1)}else for(;c*f<l;){var S=d(),w=p();(w+1)*S>=l?p(w+1):d(S+1)}var C=i.w/c,T=i.h/f;if(t.condense&&(C=0,T=0),t.avoidOverlap)for(var k=0;k<a.length;k++){var R=a[k],A=R._private.position;(A.x==null||A.y==null)&&(A.x=0,A.y=0);var D=R.layoutDimensions(t),L=t.avoidOverlapPadding,P=D.w+L,M=D.h+L;C=Math.max(C,P),T=Math.max(T,M)}for(var _={},B=function(te,ie){return!!_["c-"+te+"-"+ie]},q=function(te,ie){_["c-"+te+"-"+ie]=!0},V=0,G=0,F=function(){G++,G>=c&&(G=0,V++)},H={},Y=0;Y<a.length;Y++){var Q=a[Y],z=t.position(Q);if(z&&(z.row!==void 0||z.col!==void 0)){var I={row:z.row,col:z.col};if(I.col===void 0)for(I.col=0;B(I.row,I.col);)I.col++;else if(I.row===void 0)for(I.row=0;B(I.row,I.col);)I.row++;H[Q.id()]=I,q(I.row,I.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(;B(V,G);)F();oe=G*C+C/2+i.x1,ae=V*T+T/2+i.y1,q(V,G),F()}return{x:oe,y:ae}};a.layoutPositions(this,t,X)}return this};var HZ={ready:function(){},stop:function(){}};function zw(e){this.options=at({},HZ,e)}zw.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};zw.prototype.stop=function(){return this};var GZ={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 n_(e){this.options=at({},GZ,e)}n_.prototype.run=function(){var e=this.options,t=e.eles,n=t.nodes(),r=mn(e.positions);function a(i){if(e.positions==null)return hX(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 $Z={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 r_(e){this.options=at({},$Z,e)}r_.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 KZ=[{name:"breadthfirst",impl:XL},{name:"circle",impl:QL},{name:"concentric",impl:WL},{name:"cose",impl:fm},{name:"grid",impl:t_},{name:"null",impl:zw},{name:"preset",impl:n_},{name:"random",impl:r_}];function a_(e){this.options=e,this.notifications=0}var zj=function(){},Ij=function(){throw new Error("A headless instance can not render images")};a_.prototype={recalculateRenderedStyle:zj,notify:function(){this.notifications++},init:zj,isHeadless:function(){return!0},png:Ij,jpg:Ij};var Iw={};Iw.arrowShapeWidth=.3;Iw.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(c,d,p,m,y,x,b){var S=y.x-p/2-b,w=y.x+p/2+b,C=y.y-p/2-b,T=y.y+p/2+b,k=S<=c&&c<=w&&C<=d&&d<=T;return k},r=function(c,d,p,m,y){var x=c*Math.cos(m)-d*Math.sin(m),b=c*Math.sin(m)+d*Math.cos(m),S=x*p,w=b*p,C=S+y.x,T=w+y.y;return{x:C,y:T}},a=function(c,d,p,m){for(var y=[],x=0;x<c.length;x+=2){var b=c[x],S=c[x+1];y.push(r(b,S,d,p,m))}return y},i=function(c){for(var d=[],p=0;p<c.length;p++){var m=c[p];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){tt(d)&&(d=e[d]),e[c]=at({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(m,y,x,b,S,w){var C=i(a(this.points,x+2*w,b,S)),T=Ur(m,y,C);return T},roughCollide:n,draw:function(m,y,x,b){var S=a(this.points,y,x,b);t.arrowShapeImpl("polygon")(m,S)},spacing:function(m){return 0},gap:l},d)};o("none",{collide:vp,roughCollide:vp,draw:Cw,spacing:JN,gap:JN}),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,p,m,y){var x=a(this.points,d,p,m),b=this.controlPoint,S=r(b[0],b[1],d,p,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,p,m,y,x,b){var S=i(a(this.points,p+2*b,m,y)),w=i(a(this.pointsTee,p+2*b,m,y)),C=Ur(c,d,S)||Ur(c,d,w);return C},draw:function(c,d,p,m,y){var x=a(this.points,d,p,m),b=a(this.pointsTee,d,p,m);t.arrowShapeImpl(this.name)(c,x,b)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,p,m,y,x,b){var S=y,w=Math.pow(S.x-c,2)+Math.pow(S.y-d,2)<=Math.pow((p+2*b)*this.radius,2),C=i(a(this.points,p+2*b,m,y));return Ur(c,d,C)||w},draw:function(c,d,p,m,y){var x=a(this.pointsTr,d,p,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 p=this.baseCrossLinePts.slice(),m=d/c,y=3,x=5;return p[y]=p[y]-m,p[x]=p[x]-m,p},collide:function(c,d,p,m,y,x,b){var S=i(a(this.points,p+2*b,m,y)),w=i(a(this.crossLinePts(p,x),p+2*b,m,y)),C=Ur(c,d,S)||Ur(c,d,w);return C},draw:function(c,d,p,m,y){var x=a(this.points,d,p,m),b=a(this.crossLinePts(d,y),d,p,m);t.arrowShapeImpl(this.name)(c,x,b)}}),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,p,m,y,x,b){var S=y,w=Math.pow(S.x-c,2)+Math.pow(S.y-d,2)<=Math.pow((p+2*b)*this.radius,2);return w},draw:function(c,d,p,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 To={};To.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]};To.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(w){return parseFloat(n.getPropertyValue(w))},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,p=t.width/(l+d),m=l-f,y=o-c,x=t.left+a.left+i.left,b=t.top+a.top+i.top;return this.containerBB=[x,b,m,y,p]};To.invalidateContainerClientCoordsCache=function(){this.containerBB=null};To.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]};To.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,p=(r?8:2)/f,m=(r?8:2)/f,y=1/0,x,b;n&&(l=l.interactive);function S(D,L){if(D.isNode()){if(b)return;b=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 P=0;P<o.length;P++)if(o[P].isEdge()){o[P]=D,x=D,y=L??y;break}}}else o.push(D),x=D,y=L??y}function w(D){var L=D.outerWidth()+2*p,P=D.outerHeight()+2*p,M=L/2,_=P/2,B=D.position(),q=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,V=D._private.rscratch;if(B.x-M<=e&&e<=B.x+M&&B.y-_<=t&&t<=B.y+_){var G=i.nodeShapes[a.getNodeShape(D)];if(G.checkPoint(e,t,0,L,P,B.x,B.y,q,V))return S(D,0),!0}}function C(D){var L=D._private,P=L.rscratch,M=D.pstyle("width").pfValue,_=D.pstyle("arrow-scale").value,B=M/2+d,q=B*B,V=B*2,Y=L.source,Q=L.target,G;if(P.edgeType==="segments"||P.edgeType==="straight"||P.edgeType==="haystack"){for(var F=P.allpts,H=0;H+3<F.length;H+=2)if(kX(e,t,F[H],F[H+1],F[H+2],F[H+3],V)&&q>(G=MX(e,t,F[H],F[H+1],F[H+2],F[H+3])))return S(D,G),!0}else if(P.edgeType==="bezier"||P.edgeType==="multibezier"||P.edgeType==="self"||P.edgeType==="compound"){for(var F=P.allpts,H=0;H+5<P.allpts.length;H+=4)if(jX(e,t,F[H],F[H+1],F[H+2],F[H+3],F[H+4],F[H+5],V)&&q>(G=DX(e,t,F[H],F[H+1],F[H+2],F[H+3],F[H+4],F[H+5])))return S(D,G),!0}for(var Y=Y||L.source,Q=Q||L.target,z=a.getArrowWidth(M,_),I=[{name:"source",x:P.arrowStartX,y:P.arrowStartY,angle:P.srcArrowAngle},{name:"target",x:P.arrowEndX,y:P.arrowEndY,angle:P.tgtArrowAngle},{name:"mid-source",x:P.midX,y:P.midY,angle:P.midsrcArrowAngle},{name:"mid-target",x:P.midX,y:P.midY,angle:P.midtgtArrowAngle}],H=0;H<I.length;H++){var X=I[H],U=i.arrowShapes[D.pstyle(X.name+"-arrow-shape").value],te=D.pstyle("width").pfValue;if(U.roughCollide(e,t,z,X.angle,{x:X.x,y:X.y},te,d)&&U.collide(e,t,z,X.angle,{x:X.x,y:X.y},te,d))return S(D),!0}c&&o.length>0&&(w(Y),w(Q))}function T(D,L,P){return Fr(D,L,P)}function k(D,L){var P=D._private,M=m,_;L?_=L+"-":_="",D.boundingBox();var B=P.labelBounds[L||"main"],q=D.pstyle(_+"label").value,V=D.pstyle("text-events").strValue==="yes";if(!(!V||!q)){var G=T(P.rscratch,"labelX",L),F=T(P.rscratch,"labelY",L),H=T(P.rscratch,"labelAngle",L),Y=D.pstyle(_+"text-margin-x").pfValue,Q=D.pstyle(_+"text-margin-y").pfValue,z=B.x1-M-Y,I=B.x2+M-Y,X=B.y1-M-Q,U=B.y2+M-Q;if(H){var te=Math.cos(H),ie=Math.sin(H),oe=function(ge,Ne){return ge=ge-G,Ne=Ne-F,{x:ge*te-Ne*ie+G,y:ge*ie+Ne*te+F}},ae=oe(z,X),we=oe(z,U),fe=oe(I,X),J=oe(I,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(Ur(e,t,ne))return S(D),!0}else if(Js(B,e,t))return S(D),!0}}for(var R=l.length-1;R>=0;R--){var A=l[R];A.isNode()?w(A)||k(A):C(A)||k(A)||k(A,"source")||k(A,"target")}return o};To.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),p=Math.max(t,r);e=f,n=c,t=d,r=p;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 b(ge,Ne,Be){return Fr(ge,Ne,Be)}function S(ge,Ne){var Be=ge._private,lt=l,Je="";ge.boundingBox();var Qe=Be.labelBounds.main;if(!Qe)return null;var Ve=b(Be.rscratch,"labelX",Ne),Re=b(Be.rscratch,"labelY",Ne),Ke=b(Be.rscratch,"labelAngle",Ne),Xe=ge.pstyle(Je+"text-margin-x").pfValue,st=ge.pstyle(Je+"text-margin-y").pfValue,Pe=Qe.x1-lt-Xe,ft=Qe.x2+lt-Xe,he=Qe.y1-lt-st,Ce=Qe.y2+lt-st;if(Ke){var De=Math.cos(Ke),Ie=Math.sin(Ke),Me=function(ye,K){return ye=ye-Ve,K=K-Re,{x:ye*De-K*Ie+Ve,y:ye*Ie+K*De+Re}};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 w(ge,Ne,Be,lt){function Je(Qe,Ve,Re){return(Re.y-Qe.y)*(Ve.x-Qe.x)>(Ve.y-Qe.y)*(Re.x-Qe.x)}return Je(ge,Be,lt)!==Je(Ne,Be,lt)&&Je(ge,Ne,Be)!==Je(ge,Ne,lt)}for(var C=0;C<a.length;C++){var T=a[C];if(T.isNode()){var k=T,R=k.pstyle("text-events").strValue==="yes",A=k.pstyle("box-selection").strValue,D=k.pstyle("box-select-labels").strValue==="yes";if(A==="none")continue;var L=(A==="overlap"||D)&&R,P=k.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:L});if(A==="contain"){var M=!1;if(D&&R){var _=S(k);_&&jx(_,y)&&(o.push(k),M=!0)}!M&&fL(m,P)&&o.push(k)}else if(A==="overlap"&&jw(m,P)){var B=k.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),q=[{x:B.x1,y:B.y1},{x:B.x2,y:B.y1},{x:B.x2,y:B.y2},{x:B.x1,y:B.y2}];if(jx(q,y))o.push(k);else{var V=S(k);V&&jx(V,y)&&o.push(k)}}}else{var G=T,F=G._private,H=F.rscratch,Y=G.pstyle("box-selection").strValue;if(Y==="none")continue;if(Y==="contain"){if(H.startX!=null&&H.startY!=null&&!Js(m,H.startX,H.startY)||H.endX!=null&&H.endY!=null&&!Js(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=F.rstyle.bezierPts||F.rstyle.linePts||F.rstyle.haystackPts,z=!0,I=0;I<Q.length;I++)if(!ak(m,Q[I])){z=!1;break}z&&o.push(G)}else H.edgeType==="straight"&&o.push(G)}else if(Y==="overlap"){var X=!1;if(H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(Js(m,H.startX,H.startY)||Js(m,H.endX,H.endY)))o.push(G),X=!0;else if(!X&&H.edgeType==="haystack"){for(var U=F.rstyle.haystackPts,te=0;te<U.length;te++)if(ak(m,U[te])){o.push(G),X=!0;break}}if(!X){var ie=F.rstyle.bezierPts||F.rstyle.linePts||F.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=Ln(x[fe],2),ne=J[0],re=J[1];if(w(ae,we,ne,re)){o.push(G),X=!0;break}}if(X)break}}}}}return o};var wp={};wp.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,p,m,y,w,C;if(n?(d=t.haystackPts[0],p=t.haystackPts[1],m=t.haystackPts[2],y=t.haystackPts[3]):(d=t.arrowStartX,p=t.arrowStartY,m=t.arrowEndX,y=t.arrowEndY),w=t.midX,C=t.midY,i)f=d-t.segpts[0],c=p-t.segpts[1];else if(a||l||o||r){var x=t.allpts,b=Qn(x[0],x[2],x[4],.1),S=Qn(x[1],x[3],x[5],.1);f=d-b,c=p-S}else f=d-w,c=p-C;t.srcArrowAngle=yv(f,c);var w=t.midX,C=t.midY;if(n&&(w=(d+m)/2,C=(p+y)/2),f=m-d,c=y-p,i){var x=t.allpts;if(x.length/2%2===0){var T=x.length/2,k=T-2;f=x[T]-x[k],c=x[T+1]-x[k+1]}else if(t.isRound)f=t.midVector[1],c=-t.midVector[0];else{var T=x.length/2-1,k=T-2;f=x[T]-x[k],c=x[T+1]-x[k+1]}}else if(a||l||o){var x=t.allpts,R=t.ctrlpts,A,D,L,P;if(R.length/2%2===0){var M=x.length/2-1,_=M+2,B=_+2;A=Qn(x[M],x[_],x[B],0),D=Qn(x[M+1],x[_+1],x[B+1],0),L=Qn(x[M],x[_],x[B],1e-4),P=Qn(x[M+1],x[_+1],x[B+1],1e-4)}else{var _=x.length/2-1,M=_-2,B=_+2;A=Qn(x[M],x[_],x[B],.4999),D=Qn(x[M+1],x[_+1],x[B+1],.4999),L=Qn(x[M],x[_],x[B],.5),P=Qn(x[M+1],x[_+1],x[B+1],.5)}f=L-A,c=P-D}if(t.midtgtArrowAngle=yv(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,q=T+2;f=-(x[q]-x[T]),c=-(x[q+1]-x[T+1])}}}if(t.midsrcArrowAngle=yv(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,V=x.length,b=Qn(x[V-6],x[V-4],x[V-2],.9),S=Qn(x[V-5],x[V-3],x[V-1],.9);f=m-b,c=y-S}else f=m-w,c=y-C;t.tgtArrowAngle=yv(f,c)};wp.getArrowWidth=wp.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 Xb,Qb,ti={},Sa={},Fj,Uj,Yl,Kv,zi,Vl,$l,Za,yu,Nv,i_,s_,Wb,Zb,qj,Vj=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)},YZ=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},XZ=function(t,n,r,a,i){if(t!==qj?Vj(n,t,ti):YZ(Sa,ti),Vj(n,r,Sa),Fj=ti.nx*Sa.ny-ti.ny*Sa.nx,Uj=ti.nx*Sa.nx-ti.ny*-Sa.ny,zi=Math.asin(Math.max(-1,Math.min(1,Fj))),Math.abs(zi)<1e-6){Xb=n.x,Qb=n.y,$l=yu=0;return}Yl=1,Kv=!1,Uj<0?zi<0?zi=Math.PI+zi:(zi=Math.PI-zi,Yl=-1,Kv=!0):zi>0&&(Yl=-1,Kv=!0),n.radius!==void 0?yu=n.radius:yu=a,Vl=zi/2,Nv=Math.min(ti.len/2,Sa.len/2),i?(Za=Math.abs(Math.cos(Vl)*yu/Math.sin(Vl)),Za>Nv?(Za=Nv,$l=Math.abs(Za*Math.sin(Vl)/Math.cos(Vl))):$l=yu):(Za=Math.min(Nv,yu),$l=Math.abs(Za*Math.sin(Vl)/Math.cos(Vl))),Wb=n.x+Sa.nx*Za,Zb=n.y+Sa.ny*Za,Xb=Wb-Sa.ny*$l*Yl,Qb=Zb+Sa.nx*$l*Yl,i_=n.x+ti.nx*Za,s_=n.y+ti.ny*Za,qj=n};function l_(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 Fw(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}:(XZ(e,t,n,r,a),{cx:Xb,cy:Qb,radius:$l,startX:i_,startY:s_,stopX:Wb,stopY:Zb,startAngle:ti.ang+Math.PI/2*Yl,endAngle:Sa.ang-Math.PI/2*Yl,counterClockwise:Kv})}var od=.01,QZ=Math.sqrt(2*od),wr={};wr.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(R,A,D,L){var P=L-A,M=D-R,_=Math.sqrt(M*M+P*P);return{x:-P/_,y:M/_}},d=e.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(f){var p=this.manualEndptToPx(e.source()[0],l),m=Ln(p,2),y=m[0],x=m[1],b=this.manualEndptToPx(e.target()[0],o),S=Ln(b,2),w=S[0],C=S[1],T={x1:y,y1:x,x2:w,y2:C};a=c(y,x,w,C),i=T}else Pt("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}};wr.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(),p=o.width(),m=l.height(),y=o.height(),x=n.pstyle("haystack-radius").value,b=x/2;a.haystackPts=a.allpts=[a.source.x*d*b+f.x,a.source.y*m*b+f.y,a.target.x*p*b+c.x,a.target.y*y*b+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)}};wr.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 p=r.pfValue[d],m=a.pfValue[d],y=1-p,x=p,b=this.findMidptPtsEtc(e,t),S=b.midptPts,w=b.vectorNormInverse,C={x:S.x1*y+S.x2*x,y:S.y1*y+S.y2*x};n.segpts.push(C.x+w.x*m,C.y+w.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")}};wr.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,p=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var m=n,y=p;r&&(m=0,y=f);var x=c-Math.PI/2,b=x-d/2,S=x+d/2,w=c+"_"+d;m=i[w]===void 0?i[w]=0:++i[w],a.ctrlpts=[l.x+Math.cos(b)*1.4*y*(m/3+1),l.y+Math.sin(b)*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)]};wr.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,p=e.pstyle("control-point-step-size").pfValue,m=e.pstyle("control-point-distances"),y=m?m.pfValue[0]:void 0,x=n,b=p;r&&(x=0,b=y);var S=50,w={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(w.x,C.x),y:Math.min(w.y,C.y)},k=.5,R=Math.max(k,Math.log(o*od)),A=Math.max(k,Math.log(c*od));a.ctrlpts=[T.x,T.y-(1+Math.pow(S,1.12)/100)*b*(x/3+1)*R,T.x-(1+Math.pow(S,1.12)/100)*b*(x/3+1)*A,T.y]};wr.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"};wr.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,p=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),b=void 0,S=kw(x);m&&(d=o?o.pfValue[y]:l,p=f.value[y]),r?b=d:b=d!==void 0?S*d:void 0;var w=b!==void 0?b:x,C=1-p,T=p,k=this.findMidptPtsEtc(e,t),R=k.midptPts,A=k.vectorNormInverse,D={x:R.x1*C+R.x2*T,y:R.y1*C+R.y2*T};i.ctrlpts.push(D.x+A.x*w,D.y+A.y*w)}};wr.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,p=t.srcW,m=t.srcH,y=t.tgtW,x=t.tgtH,b=e.pstyle("edge-distances").value,S=b!=="node-position",w=e.pstyle("taxi-direction").value,C=w,T=e.pstyle("taxi-turn"),k=T.units==="%",R=T.pfValue,A=R<0,D=e.pstyle("taxi-turn-min-distance").pfValue,L=S?(p+y)/2:0,P=S?(m+x)/2:0,M=d.x2-d.x1,_=d.y2-d.y1,B=function(K,le){return K>0?Math.max(K-le,0):Math.min(K+le,0)},q=B(M,L),V=B(_,P),G=!1;C===c?w=Math.abs(q)>Math.abs(V)?a:r:C===f||C===o?(w=r,G=!0):(C===i||C===l)&&(w=a,G=!0);var F=w===r,H=F?V:q,Y=F?_:M,Q=kw(Y),z=!1;!(G&&(k||A))&&(C===o&&Y<0||C===f&&Y>0||C===i&&Y>0||C===l&&Y<0)&&(Q*=-1,H=Q*Math.abs(H),z=!0);var I;if(k){var X=R<0?1+R:R;I=X*H}else{var U=R<0?H:0;I=U+R*Q}var te=function(K){return Math.abs(K)<D||Math.abs(K)>=Math.abs(H)},ie=te(I),oe=te(Math.abs(H)-Math.abs(I)),ae=ie||oe;if(ae&&!z)if(F){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,Ne=d.x1,Be=d.x2;n.segpts=[Ne,ge,Be,ge]}else n.segpts=[d.x1,d.y2]}else{var lt=Math.abs(Y)<=p/2,Je=Math.abs(_)<=x/2;if(lt){var Qe=(d.y1+d.y2)/2,Ve=d.x1,Re=d.x2;n.segpts=[Ve,Qe,Re,Qe]}else if(Je){var Ke=(d.x1+d.x2)/2,Xe=d.y1,st=d.y2;n.segpts=[Ke,Xe,Ke,st]}else n.segpts=[d.x2,d.y1]}else if(F){var Pe=d.y1+I+(S?m/2*Q:0),ft=d.x1,he=d.x2;n.segpts=[ft,Pe,he,Pe]}else{var Ce=d.x1+I+(S?p/2*Q:0),De=d.y1,Ie=d.y2;n.segpts=[Ce,De,Ce,Ie]}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)}};wr.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,p=t.srcCornerRadius,m=t.tgtCornerRadius,y=t.srcRs,x=t.tgtRs,b=!Ae(n.startX)||!Ae(n.startY),S=!Ae(n.arrowStartX)||!Ae(n.arrowStartY),w=!Ae(n.endX)||!Ae(n.endY),C=!Ae(n.arrowEndX)||!Ae(n.arrowEndY),T=3,k=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,R=T*k,A=xo({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),D=A<R,L=xo({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),P=L<R,M=!1;if(b||S||D){M=!0;var _={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},B=Math.sqrt(_.x*_.x+_.y*_.y),q={x:_.x/B,y:_.y/B},V=Math.max(i,l),G={x:n.ctrlpts[0]+q.x*2*V,y:n.ctrlpts[1]+q.y*2*V},F=c.intersectLine(r.x,r.y,i,l,G.x,G.y,0,p,y);D?(n.ctrlpts[0]=n.ctrlpts[0]+q.x*(R-A),n.ctrlpts[1]=n.ctrlpts[1]+q.y*(R-A)):(n.ctrlpts[0]=F[0]+q.x*R,n.ctrlpts[1]=F[1]+q.y*R)}if(w||C||P){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},z=Math.max(i,l),I={x:n.ctrlpts[0]+Q.x*2*z,y:n.ctrlpts[1]+Q.y*2*z},X=d.intersectLine(a.x,a.y,o,f,I.x,I.y,0,m,x);P?(n.ctrlpts[0]=n.ctrlpts[0]+Q.x*(R-L),n.ctrlpts[1]=n.ctrlpts[1]+Q.y*(R-L)):(n.ctrlpts[0]=X[0]+Q.x*R,n.ctrlpts[1]=X[1]+Q.y*R)}M&&this.findEndpoints(e)}};wr.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=Qn(t.allpts[r],t.allpts[r+2],t.allpts[r+4],a),t.midY=Qn(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(Fw({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 p={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=p.x,t.midY=p.y,t.midVector=[p.y-y.y,y.x-p.x]}else{var x=[p.x-m.cx,p.y-m.cy],b=m.radius/Math.sqrt(Math.pow(x[0],2)+Math.pow(x[1],2));x=x.map(function(S){return S*b}),t.midX=m.cx+x[0],t.midY=m.cy+x[1],t.midVector=x}}}}};wr.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Ae(t.startX)&&Ae(t.startY)&&Ae(t.endX)&&Ae(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Pt("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."))};wr.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i=new Ki,l=function(P,M){return[].concat(fp(P),[M?1:0]).join("-")},o=[],f=[],c=0;c<e.length;c++){var d=e[c],p=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"||Zs(m,"segments")||m==="straight"||m==="straight-triangle"||Zs(m,"taxi"),x=m==="unbundled-bezier"||m==="bezier",b=p.source,S=p.target,w=b.poolIndex(),C=S.poolIndex(),T=[w,C].sort(),k=l(T,y),R=i.get(k);R==null&&(R={eles:[]},o.push({pairId:T,edgeIsUnbundled:y}),i.set(k,R)),R.eles.push(d),y&&(R.hasUnbundled=!0),x&&(R.hasBezier=!0)}}for(var A=function(){var P=o[D],M=P.pairId,_=P.edgeIsUnbundled,B=l(M,_),q=i.get(B),V;if(!q.hasUnbundled){var G=q.eles[0].parallelEdges().filter(function(Oe){return Oe.isBundledBezier()});Tw(q.eles),G.forEach(function(Oe){return q.eles.push(Oe)}),q.eles.sort(function(Oe,ye){return Oe.poolIndex()-ye.poolIndex()})}var F=q.eles[0],H=F.source(),Y=F.target();if(H.poolIndex()>Y.poolIndex()){var Q=H;H=Y,Y=Q}var z=q.srcPos=H.position(),I=q.tgtPos=Y.position(),X=q.srcW=H.outerWidth(),U=q.srcH=H.outerHeight(),te=q.tgtW=Y.outerWidth(),ie=q.tgtH=Y.outerHeight(),oe=q.srcShape=n.nodeShapes[t.getNodeShape(H)],ae=q.tgtShape=n.nodeShapes[t.getNodeShape(Y)],we=q.srcCornerRadius=H.pstyle("corner-radius").value==="auto"?"auto":H.pstyle("corner-radius").pfValue,fe=q.tgtCornerRadius=Y.pstyle("corner-radius").value==="auto"?"auto":Y.pstyle("corner-radius").pfValue,J=q.tgtRs=Y._private.rscratch,ne=q.srcRs=H._private.rscratch;q.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re<q.eles.length;re++){var ge=q.eles[re],Ne=ge[0]._private.rscratch,Be=ge.pstyle("curve-style").value,lt=Be==="unbundled-bezier"||Zs(Be,"segments")||Zs(Be,"taxi"),Je=!H.same(ge.source());if(!q.calculatedIntersection&&H!==Y&&(q.hasBezier||q.hasUnbundled)){q.calculatedIntersection=!0;var Qe=oe.intersectLine(z.x,z.y,X,U,I.x,I.y,0,we,ne),Ve=q.srcIntn=Qe,Re=ae.intersectLine(I.x,I.y,te,ie,z.x,z.y,0,fe,J),Ke=q.tgtIntn=Re,Xe=q.intersectionPts={x1:Qe[0],x2:Re[0],y1:Qe[1],y2:Re[1]},st=q.posPts={x1:z.x,x2:I.x,y1:z.y,y2:I.y},Pe=Re[1]-Qe[1],ft=Re[0]-Qe[0],he=Math.sqrt(ft*ft+Pe*Pe);Ae(he)&&he>=QZ||(he=Math.sqrt(Math.max(ft*ft,od)+Math.max(Pe*Pe,od)));var Ce=q.vector={x:ft,y:Pe},De=q.vectorNorm={x:Ce.x/he,y:Ce.y/he},Ie={x:-De.y,y:De.x};q.nodesOverlap=!Ae(he)||ae.checkPoint(Qe[0],Qe[1],0,te,ie,I.x,I.y,fe,J)||oe.checkPoint(Re[0],Re[1],0,X,U,z.x,z.y,we,ne),q.vectorNormInverse=Ie,V={nodesOverlap:q.nodesOverlap,dirCounts:q.dirCounts,calculatedIntersection:!0,hasBezier:q.hasBezier,hasUnbundled:q.hasUnbundled,eles:q.eles,srcPos:I,srcRs:J,tgtPos:z,tgtRs:ne,srcW:te,srcH:ie,tgtW:X,tgtH:U,srcIntn:Ke,tgtIntn:Ve,srcShape:ae,tgtShape:oe,posPts:{x1:st.x2,y1:st.y2,x2:st.x1,y2:st.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:-Ie.x,y:-Ie.y}}}var Me=Je?V:q;Ne.nodesOverlap=Me.nodesOverlap,Ne.srcIntn=Me.srcIntn,Ne.tgtIntn=Me.tgtIntn,Ne.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&&q.eles.length%2===1&&re===Math.floor(q.eles.length/2)?t.findStraightEdgePoints(ge):t.findBezierPoints(ge,Me,re,lt,Je),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++)A();this.findHaystackPoints(f)}};function o_(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}}wr.getSegmentPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n==="segments")return o_(t.segpts)};wr.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 o_(t.ctrlpts)};wr.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Fd={};Fd.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)}};Fd.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(),p=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,b=o._private.rscratch,S=f._private.rscratch,w=e.pstyle("curve-style").value,C=e._private.rscratch,T=C.edgeType,k=Zs(w,"taxi"),R=T==="self"||T==="compound",A=T==="bezier"||T==="multibezier"||R,D=T!=="bezier",L=T==="straight"||T==="segments",P=T==="segments",M=A||D||L,_=R||k,B=e.pstyle("source-endpoint"),q=_?"outside-to-node":B.value,V=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,G=e.pstyle("target-endpoint"),F=_?"outside-to-node":G.value,H=f.pstyle("corner-radius").value==="auto"?"auto":f.pstyle("corner-radius").pfValue;C.srcManEndpt=B,C.tgtManEndpt=G;var Y,Q,z,I,X=(t=(G==null||(n=G.pfValue)===null||n===void 0?void 0:n.length)===2?G.pfValue:null)!==null&&t!==void 0?t:[0,0],U=(r=(B==null||(a=B.pfValue)===null||a===void 0?void 0:a.length)===2?B.pfValue:null)!==null&&r!==void 0?r:[0,0];if(A){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=P?C.segpts.slice(0,2):[d.x+X[0],d.y+X[1]],ae=P?C.segpts.slice(C.segpts.length-2):[c.x+U[0],c.y+U[1]];Y=ae,Q=oe}if(F==="inside-to-node")l=[d.x,d.y];else if(G.units)l=this.manualEndptToPx(f,G);else if(F==="outside-to-line")l=C.tgtIntn;else if(F==="outside-to-node"||F==="outside-to-node-or-label"?z=Y:(F==="outside-to-line"||F==="outside-to-line-or-label")&&(z=[c.x,c.y]),l=i.nodeShapes[this.getNodeShape(f)].intersectLine(d.x,d.y,f.outerWidth(),f.outerHeight(),z[0],z[1],0,H,S),F==="outside-to-node-or-label"||F==="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,Ne=J/2,Be=f.pstyle("text-valign").value;Be==="top"?re-=Ne:Be==="bottom"&&(re+=Ne);var lt=f.pstyle("text-halign").value;lt==="left"?ne-=ge:lt==="right"&&(ne+=ge);var Je=rd(z[0],z[1],[ne-ge,re-Ne,ne+ge,re-Ne,ne+ge,re+Ne,ne-ge,re+Ne],d.x,d.y);if(Je.length>0){var Qe=c,Ve=Gl(Qe,Tu(l)),Re=Gl(Qe,Tu(Je)),Ke=Ve;if(Re<Ve&&(l=Je,Ke=Re),Je.length>2){var Xe=Gl(Qe,{x:Je[2],y:Je[3]});Xe<Ke&&(l=[Je[2],Je[3]])}}}var st=xv(l,Y,i.arrowShapes[p].spacing(e)+y),Pe=xv(l,Y,i.arrowShapes[p].gap(e)+y);if(C.endX=Pe[0],C.endY=Pe[1],C.arrowEndX=st[0],C.arrowEndY=st[1],q==="inside-to-node")l=[c.x,c.y];else if(B.units)l=this.manualEndptToPx(o,B);else if(q==="outside-to-line")l=C.srcIntn;else if(q==="outside-to-node"||q==="outside-to-node-or-label"?I=Q:(q==="outside-to-line"||q==="outside-to-line-or-label")&&(I=[d.x,d.y]),l=i.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),I[0],I[1],0,V,b),q==="outside-to-node-or-label"||q==="outside-to-line-or-label"){var ft=o._private.rscratch,he=ft.labelWidth,Ce=ft.labelHeight,De=ft.labelX,Ie=ft.labelY,Me=he/2,Oe=Ce/2,ye=o.pstyle("text-valign").value;ye==="top"?Ie-=Oe:ye==="bottom"&&(Ie+=Oe);var K=o.pstyle("text-halign").value;K==="left"?De-=Me:K==="right"&&(De+=Me);var le=rd(I[0],I[1],[De-Me,Ie-Oe,De+Me,Ie-Oe,De+Me,Ie+Oe,De-Me,Ie+Oe],c.x,c.y);if(le.length>0){var pe=d,de=Gl(pe,Tu(l)),xe=Gl(pe,Tu(le)),Le=de;if(xe<de&&(l=[le[0],le[1]],Le=xe),le.length>2){var Te=Gl(pe,{x:le[2],y:le[3]});Te<Le&&(l=[le[2],le[3]])}}}var $e=xv(l,Q,i.arrowShapes[m].spacing(e)+x),Fe=xv(l,Q,i.arrowShapes[m].gap(e)+x);C.startX=Fe[0],C.startY=Fe[1],C.arrowStartX=$e[0],C.arrowStartY=$e[1],M&&(!Ae(C.startX)||!Ae(C.startY)||!Ae(C.endX)||!Ae(C.endY)?C.badLine=!0:C.badLine=!1)};Fd.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}}};Fd.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 Uw={};function WZ(e,t,n){for(var r=function(c,d,p,m){return Qn(c,d,p,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)})}}Uw.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)WZ(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};Uw.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var yi={};yi.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!cl(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,p=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}p.labelX=n,p.labelY=r,m.labelX=n,m.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var u_=function(t,n){var r=Math.atan(n/t);return t===0&&r<0&&(r=r*-1),r},c_=function(t,n){var r=n.x-t.x,a=n.y-t.y;return u_(r,a)},ZZ=function(t,n,r,a){var i=nd(0,a-.001,1),l=nd(0,a+.001,1),o=Ou(t,n,r,i),f=Ou(t,n,r,l);return c_(o,f)};yi.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(p,m,y){qi(n.rscratch,p,m,y),qi(n.rstyle,p,m,y)};l("labelX",null,t.x),l("labelY",null,t.y);var o=u_(r.midDispX,r.midDispY);l("labelAutoAngle",null,o);var f=function(){if(f.cache)return f.cache;for(var p=[],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]},b={x:r.allpts[m+4],y:r.allpts[m+5]};p.push({p0:y,p1:x,p2:b,startDist:0,length:0,segments:[]})}var S=n.rstyle.bezierPts,w=a.bezierProjPcts.length;function C(D,L,P,M,_){var B=xo(L,P),q=D.segments[D.segments.length-1],V={p0:L,p1:P,t0:M,t1:_,startDist:q?q.startDist+q.length:0,length:B};D.segments.push(V),D.length+=B}for(var T=0;T<p.length;T++){var k=p[T],R=p[T-1];R&&(k.startDist=R.startDist+R.length),C(k,k.p0,S[T*w],0,a.bezierProjPcts[0]);for(var A=0;A<w-1;A++)C(k,S[T*w+A],S[T*w+A+1],a.bezierProjPcts[A],a.bezierProjPcts[A+1]);C(k,S[T*w+w-1],k.p2,a.bezierProjPcts[w-1],1)}return f.cache=p},c=function(p){var m,y=p==="source";if(i[p]){var x=e.pstyle(p+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var b=f(),S,w=0,C=0,T=0;T<b.length;T++){for(var k=b[y?T:b.length-1-T],R=0;R<k.segments.length;R++){var A=k.segments[y?R:k.segments.length-1-R],D=T===b.length-1&&R===k.segments.length-1;if(w=C,C+=A.length,C>=x||D){S={cp:k,segment:A};break}}if(S)break}var L=S.cp,P=S.segment,M=(x-w)/P.length,_=P.t1-P.t0,B=y?P.t0+_*M:P.t1-_*M;B=nd(0,B,1),t=Ou(L.p0,L.p1,L.p2,B),m=ZZ(L.p0,L.p1,L.p2,B);break}case"straight":case"segments":case"haystack":{for(var q=0,V,G,F,H,Y=r.allpts.length,Q=0;Q+3<Y&&(y?(F={x:r.allpts[Q],y:r.allpts[Q+1]},H={x:r.allpts[Q+2],y:r.allpts[Q+3]}):(F={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]}),V=xo(F,H),G=q,q+=V,!(q>=x));Q+=2);var z=x-G,I=z/V;I=nd(0,I,1),t=bX(F,H,I),m=c_(F,H);break}}l("labelX",p,t.x),l("labelY",p,t.y),l("labelAutoAngle",p,m)}};c("source"),c("target"),this.applyLabelDimensions(e)}};yi.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))};yi.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),a=yo(r,e._private.labelDimsKey);if(Fr(n.rscratch,"prefixedLabelDimsKey",t)!==a){qi(n.rscratch,"prefixedLabelDimsKey",t,a);var i=this.calculateLabelDimensions(e,r),l=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,f=Fr(n.rscratch,"labelWrapCachedLines",t)||[],c=o!=="wrap"?1:Math.max(f.length,1),d=i.height/c,p=d*l,m=i.width,y=i.height+(c-1)*(l-1)*d;qi(n.rstyle,"labelWidth",t,m),qi(n.rscratch,"labelWidth",t,m),qi(n.rstyle,"labelHeight",t,y),qi(n.rscratch,"labelHeight",t,y),qi(n.rscratch,"labelLineHeight",t,p)}};yi.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?(qi(n.rscratch,U,t,te),te):Fr(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(`
|
|
496
|
+
`),p=e.pstyle("text-max-width").pfValue,m=e.pstyle("text-overflow-wrap").value,y=m==="anywhere",x=[],b=/[\s\u200b]+|$/g,S=0;S<d.length;S++){var w=d[S],C=this.calculateLabelDimensions(e,w),T=C.width;if(y){var k=w.split("").join(c);w=k}if(T>p){var R=w.matchAll(b),A="",D=0,L=Vr(R),P;try{for(L.s();!(P=L.n()).done;){var M=P.value,_=M[0],B=w.substring(D,M.index);D=M.index+_.length;var q=A.length===0?B:A+B+_,V=this.calculateLabelDimensions(e,q),G=V.width;G<=p?A+=B+_:(A&&x.push(A),A=B+_)}}catch(X){L.e(X)}finally{L.f()}A.match(/^[\s\u200b]+$/)||x.push(A)}else x.push(w)}l("labelWrapCachedLines",x),a=l("labelWrapCachedText",x.join(`
|
|
497
|
+
`)),l("labelWrapKey",f)}else if(o==="ellipsis"){var F=e.pstyle("text-max-width").pfValue,H="",Y="…",Q=!1;if(this.calculateLabelDimensions(e,a).width<F)return a;for(var z=0;z<a.length;z++){var I=this.calculateLabelDimensions(e,H+a[z]+Y).width;if(I>F)break;H+=a[z],z===a.length-1&&(Q=!0)}return Q||(H+=Y),H}return a};yi.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};yi.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,p=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=a.createElement("canvas"),p=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"}p.font="".concat(l," ").concat(c," ").concat(o,"px ").concat(f);for(var y=0,x=0,b=t.split(`
|
|
498
|
+
`),S=0;S<b.length;S++){var w=b[S],C=p.measureText(w),T=Math.ceil(C.width),k=o;y=Math.max(T,y),x+=k}return y+=i,x+=i,{width:y,height:x}};yi.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};yi.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 f_={},Hj=28,Gj=!1;f_.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<Hj||e.height()<Hj))return Gj||(Pt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Gj=!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 dm={};dm.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,p=d.rstyle;p.clean=!1,p.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 p=0;p<o.length;p++){var m=o[p];m(l,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)};dm.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)};dm.recalculateRenderedStyle=function(e,t){var n=function(k){return k._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],p=d._private,m=p.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 b=r[x],S=b._private,w=S.rstyle,C=S.rscratch;w.srcX=C.arrowStartX,w.srcY=C.arrowStartY,w.tgtX=C.arrowEndX,w.tgtY=C.arrowEndY,w.midX=C.midX,w.midY=C.midY,w.labelAngle=C.labelAngle,w.sourceLabelAngle=C.sourceLabelAngle,w.targetLabelAngle=C.targetLabelAngle}}}};var hm={};hm.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)}}};hm.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};hm.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort($L),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var d_={};[To,wp,wr,Fd,Uw,yi,f_,dm,hm].forEach(function(e){at(d_,e)});var h_={};h_.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 Sc={};Sc.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)};Sc.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||cY(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 p=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(p[2]={capture:d??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:p}),(e.addEventListener||e.on).apply(e,p),this};return{on:l,addEventListener:l,addListener:l,bind:l}};Sc.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()};Sc.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()};Sc.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},p=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)}},b=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=b,w=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()},k=typeof MutationObserver<"u",R=typeof ResizeObserver<"u";k?(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 A=Bd(function(){e.cy.resize()},100);k&&(e.styleObserver=new MutationObserver(A),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",A),R&&(e.resizeObserver=new ResizeObserver(A),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 P=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],$e=!1,Fe=0;Fe<Te.length;Fe++){var We=Te[Fe];if(pe<=We.clientX&&We.clientX<=pe+xe&&de<=We.clientY&&We.clientY<=de+Le){$e=!0;break}}if(!$e)return!1;for(var ot=e.container,ut=K.target,He=ut.parentNode,xt=!1;He;){if(He===ot){xt=!0;break}He=He.parentNode}return!!xt};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],$e=e.dragData.possibleDragElements;e.hoverData.mdownPos=de,e.hoverData.mdownGPos=pe;var Fe=function(vt){return{originalEvent:K,type:vt,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 vt=e.hoverData.down;vt?vt.emit(Fe("taphold")):le.emit(Fe("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(vt){vt.emit(Fe("grab"))};if(p(Te),!Te.selected())$e=e.dragData.possibleDragElements=le.collection(),S(Te,{addToList:$e}),Te.emit(Fe("grabon")).emit(Fe("grab"));else{$e=e.dragData.possibleDragElements=le.collection();var He=le.$(function(xt){return xt.isNode()&&xt.selected()&&e.nodeIsGrabbable(xt)});b(He,{addToList:$e}),Te.emit(Fe("grabon")),He.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 _=r(e.container);e.registerBinding([t,_],"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]),$e=e.hoverData.mdownPos,Fe=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,He=e.hoverData.down,xt=[Te[0]-We[2],Te[1]-We[3]],vt=e.dragData.possibleDragElements,fn;if(Fe){var qt=Le[0]-Fe[0],er=qt*qt,dn=Le[1]-Fe[1],Sn=dn*dn,gn=er+Sn;e.hoverData.isOverThresholdDrag=fn=gn>=e.desktopTapThreshold2}var En=i(K);fn&&(e.hoverData.tapholdCancelled=!0);var ua=function(){var $n=e.hoverData.dragDelta=e.hoverData.dragDelta||[];$n.length===0?($n.push(xt[0]),$n.push(xt[1])):($n[0]+=xt[0],$n[1]+=xt[1])};pe=!0,a(ot,["mousemove","vmousemove","tapdrag"],K,{x:Te[0],y:Te[1]});var hn=function($n){return{originalEvent:K,type:$n,position:{x:Te[0],y:Te[1]}}},ca=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||de.emit(hn("boxstart")),We[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(fn){var Vn=hn("cxtdrag");He?He.emit(Vn):de.emit(Vn),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||ot!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(hn("cxtdragout")),e.hoverData.cxtOver=ot,ot&&ot.emit(hn("cxtdragover")))}}else if(e.hoverData.dragging){if(pe=!0,de.panningEnabled()&&de.userPanningEnabled()){var ln;if(e.hoverData.justStartedPan){var _n=e.hoverData.mdownPos;ln={x:(Te[0]-_n[0])*xe,y:(Te[1]-_n[1])*xe},e.hoverData.justStartedPan=!1}else ln={x:xt[0]*xe,y:xt[1]*xe};de.panBy(ln),de.emit(hn("dragpan")),e.hoverData.dragged=!0}Te=e.projectIntoViewport(K.clientX,K.clientY)}else if(We[4]==1&&(He==null||He.pannable())){if(fn){if(!e.hoverData.dragging&&de.boxSelectionEnabled()&&(En||!de.panningEnabled()||!de.userPanningEnabled()))ca();else if(!e.hoverData.selecting&&de.panningEnabled()&&de.userPanningEnabled()){var Ar=l(He,e.hoverData.downs);Ar&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,We[4]=0,e.data.bgActivePosistion=Tu($e),e.redrawHint("select",!0),e.redraw())}He&&He.pannable()&&He.active()&&He.unactivate()}}else{if(He&&He.pannable()&&He.active()&&He.unactivate(),(!He||!He.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),He)if(fn){if(de.boxSelectionEnabled()&&En)He&&He.grabbed()&&(w(vt),He.emit(hn("freeon")),vt.emit(hn("free")),e.dragData.didDrag&&(He.emit(hn("dragfreeon")),vt.emit(hn("dragfree")))),ca();else if(He&&He.grabbed()&&e.nodeIsDraggable(He)){var Hn=!e.dragData.didDrag;Hn&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||b(vt,{inDragLayer:!0});var Gn={x:0,y:0};if(Ae(xt[0])&&Ae(xt[1])&&(Gn.x+=xt[0],Gn.y+=xt[1],Hn)){var fr=e.hoverData.dragDelta;fr&&Ae(fr[0])&&Ae(fr[1])&&(Gn.x+=fr[0],Gn.y+=fr[1])}e.hoverData.draggingEles=!0,vt.silentShift(Gn).emit(hn("position")).emit(hn("drag")),e.redrawHint("drag",!0),e.redraw()}}else ua();pe=!0}if(We[2]=Te[0],We[3]=Te[1],pe)return K.stopPropagation&&K.stopPropagation(),K.preventDefault&&K.preventDefault(),!1}},!1);var B,q,V;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,$e=e.hoverData.down,Fe=i(K);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,$e&&$e.unactivate();var We=function(qt){return{originalEvent:K,type:qt,position:{x:de[0],y:de[1]}}};if(e.hoverData.which===3){var ot=We("cxttapend");if($e?$e.emit(ot):pe.emit(ot),!e.hoverData.cxtDragged){var ut=We("cxttap");$e?$e.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($e,["click","tap","vclick"],K,{x:de[0],y:de[1]}),q=!1,K.timeStamp-V<=pe.multiClickDebounceTime()?(B&&clearTimeout(B),q=!0,V=null,a($e,["dblclick","dbltap","vdblclick"],K,{x:de[0],y:de[1]})):(B=setTimeout(function(){q||a($e,["oneclick","onetap","voneclick"],K,{x:de[0],y:de[1]})},pe.multiClickDebounceTime()),V=K.timeStamp)),$e==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==$e&&!e.dragData.didDrag&&!e.hoverData.selecting&&Le!=null&&Le._private.selectable&&(e.hoverData.dragging||(pe.selectionType()==="additive"||Fe?Le.selected()?Le.unselect(["tapunselect"]):Le.select(["tapselect"]):Fe||(pe.$(n).unmerge(Le).unselect(["tapunselect"]),Le.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var He=pe.collection(e.getAllInBox(xe[0],xe[1],xe[2],xe[3]));e.redrawHint("select",!0),He.length>0&&e.redrawHint("eles",!0),pe.emit(We("boxend"));var xt=function(qt){return qt.selectable()&&!qt.selected()};pe.selectionType()==="additive"||Fe||pe.$(n).unmerge(He).unselect(),He.emit(We("box")).stdFilter(xt).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 vt=$e&&$e.grabbed();w(Te),vt&&($e.emit(We("freeon")),Te.emit(We("free")),e.dragData.didDrag&&($e.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 G=[],F=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},z=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},I=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(G.length>=F){var de=G;if(H=Q(de,5),!H){var xe=Math.abs(de[0]);H=z(de)&&xe>5}if(H)for(var Le=0;Le<de.length;Le++)Y=Math.min(Math.abs(de[Le]),Y)}else G.push(pe),le=!0;else H&&(Y=Math.min(Math.abs(pe),Y));if(!e.scrollingPage){var Te=e.cy,$e=Te.zoom(),Fe=Te.pan(),We=e.projectIntoViewport(K.clientX,K.clientY),ot=[We[0]*$e+Fe.x,We[1]*$e+Fe.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||P()){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=kw(pe)*5),ut=pe/-250,H&&(ut/=Y,ut*=3),ut=ut*e.wheelSensitivity;var He=K.deltaMode===1;He&&(ut*=33);var xt=Te.zoom()*Math.pow(10,ut);K.type==="gesturechange"&&(xt=e.gestureStartZoom*K.scale),Te.zoom({level:xt,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",I,!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||I(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,Ne,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)},Je;e.registerBinding(e.container,"touchstart",Je=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(En){return{originalEvent:K,type:En,position:{x:pe[0],y:pe[1]}}};if(K.touches[1]){e.touchData.singleTouchMoved=!0,w(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,Ne=0<=X&&X<=re&&0<=te&&te<=re&&0<=U&&U<=ge&&0<=ie&&ie<=ge;var $e=le.pan(),Fe=le.zoom();oe=Be(X,U,te,ie),ae=lt(X,U,te,ie),we=[(X+te)/2,(U+ie)/2],fe=[(we[0]-$e.x)/Fe,(we[1]-$e.y)/Fe];var We=200,ot=We*We;if(ae<ot&&!K.touches[2]){var ut=e.findNearestElement(pe[0],pe[1],!0,!0),He=e.findNearestElement(pe[2],pe[3],!0,!0);ut&&ut.isNode()?(ut.activate().emit(Le("cxttapstart")),e.touchData.start=ut):He&&He.isNode()?(He.activate().emit(Le("cxttapstart")),e.touchData.start=He):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 xt=e.findNearestElements(pe[0],pe[1],!0,!0),vt=xt[0];if(vt!=null&&(vt.activate(),e.touchData.start=vt,e.touchData.starts=xt,e.nodeIsGrabbable(vt))){var fn=e.dragData.touchDragEles=le.collection(),qt=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),vt.selected()?(qt=le.$(function(gn){return gn.selected()&&e.nodeIsGrabbable(gn)}),b(qt,{addToList:fn})):S(vt,{addToList:fn}),p(vt),vt.emit(Le("grabon")),qt?qt.forEach(function(gn){gn.emit(Le("grab"))}):vt.emit(Le("grab"))}a(vt,["touchstart","tapstart","vmousedown"],K,{x:pe[0],y:pe[1]}),vt==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 er=e.touchData.startPosition=[null,null,null,null,null,null],dn=0;dn<pe.length;dn++)er[dn]=de[dn]=pe[dn];var Sn=K.touches[0];e.touchData.startGPosition=[Sn.clientX,Sn.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 $e=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);xe[0]=$e[0],xe[1]=$e[1]}if(K.touches[1]){var $e=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);xe[2]=$e[0],xe[3]=$e[1]}if(K.touches[2]){var $e=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);xe[4]=$e[0],xe[5]=$e[1]}var Fe=function($d){return{originalEvent:K,type:$d,position:{x:xe[0],y:xe[1]}}},We=e.touchData.startGPosition,ot;if(le&&K.touches[0]&&We){for(var ut=[],He=0;He<xe.length;He++)ut[He]=xe[He]-Le[He];var xt=K.touches[0].clientX-We[0],vt=xt*xt,fn=K.touches[0].clientY-We[1],qt=fn*fn,er=vt+qt;ot=er>=e.touchTapThreshold2}if(le&&e.touchData.cxt){K.preventDefault();var dn=K.touches[0].clientX-J,Sn=K.touches[0].clientY-ne,gn=K.touches[1].clientX-J,En=K.touches[1].clientY-ne,ua=lt(dn,Sn,gn,En),hn=ua/ae,ca=150,Vn=ca*ca,ln=1.5,_n=ln*ln;if(hn>=_n||ua>=Vn){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Ar=Fe("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit(Ar),e.touchData.start=null):de.emit(Ar)}}if(le&&e.touchData.cxt){var Ar=Fe("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 Hn=e.findNearestElement(xe[0],xe[1],!0,!0);(!e.touchData.cxtOver||Hn!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(Fe("cxtdragout")),e.touchData.cxtOver=Hn,Hn&&Hn.emit(Fe("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(Fe("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 Gn=e.dragData.touchDragEles;if(Gn){e.redrawHint("drag",!0);for(var fr=0;fr<Gn.length;fr++){var ss=Gn[fr]._private;ss.grabbed=!1,ss.rscratch.inDragLayer=!1}}var $n=e.touchData.start,dn=K.touches[0].clientX-J,Sn=K.touches[0].clientY-ne,gn=K.touches[1].clientX-J,En=K.touches[1].clientY-ne,ko=Be(dn,Sn,gn,En),ls=ko/oe;if(Ne){var os=dn-X,Cl=Sn-U,us=gn-te,kn=En-ie,Vd=(os+us)/2,Hd=(Cl+kn)/2,$r=de.zoom(),Ka=$r*ls,jo=de.pan(),Cc=fe[0]*$r+jo.x,Tc=fe[1]*$r+jo.y,vm={x:-Ka/$r*(Cc-jo.x-Vd)+Cc,y:-Ka/$r*(Tc-jo.y-Hd)+Tc};if($n&&$n.active()){var Gn=e.dragData.touchDragEles;w(Gn),e.redrawHint("drag",!0),e.redrawHint("eles",!0),$n.unactivate().emit(Fe("freeon")),Gn.emit(Fe("free")),e.dragData.didDrag&&($n.emit(Fe("dragfreeon")),Gn.emit(Fe("dragfree")))}de.viewport({zoom:Ka,pan:vm,cancelOnFailedZoom:!0}),de.emit(Fe("pinchzoom")),oe=ko,X=dn,U=Sn,te=gn,ie=En,e.pinching=!0}if(K.touches[0]){var $e=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);xe[0]=$e[0],xe[1]=$e[1]}if(K.touches[1]){var $e=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);xe[2]=$e[0],xe[3]=$e[1]}if(K.touches[2]){var $e=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);xe[4]=$e[0],xe[5]=$e[1]}}else if(K.touches[0]&&!e.touchData.didSelect){var dr=e.touchData.start,cs=e.touchData.last,Hn;if(!e.hoverData.draggingEles&&!e.swipePanning&&(Hn=e.findNearestElement(xe[0],xe[1],!0,!0)),le&&dr!=null&&K.preventDefault(),le&&dr!=null&&e.nodeIsDraggable(dr))if(ot){var Gn=e.dragData.touchDragEles,fa=!e.dragData.didDrag;fa&&b(Gn,{inDragLayer:!0}),e.dragData.didDrag=!0;var Kn={x:0,y:0};if(Ae(ut[0])&&Ae(ut[1])&&(Kn.x+=ut[0],Kn.y+=ut[1],fa)){e.redrawHint("eles",!0);var Rr=e.touchData.dragDelta;Rr&&Ae(Rr[0])&&Ae(Rr[1])&&(Kn.x+=Rr[0],Kn.y+=Rr[1])}e.hoverData.draggingEles=!0,Gn.silentShift(Kn).emit(Fe("position")).emit(Fe("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(dr||Hn,["touchmove","tapdrag","vmousemove"],K,{x:xe[0],y:xe[1]}),(!dr||!dr.grabbed())&&Hn!=cs&&(cs&&cs.emit(Fe("tapdragout")),Hn&&Hn.emit(Fe("tapdragover"))),e.touchData.last=Hn,le)for(var fr=0;fr<xe.length;fr++)xe[fr]&&e.touchData.startPosition[fr]&&ot&&(e.touchData.singleTouchMoved=!0);if(le&&(dr==null||dr.pannable())&&de.panningEnabled()&&de.userPanningEnabled()){var pm=l(dr,e.touchData.starts);pm&&(K.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=Tu(e.touchData.startPosition)),e.swipePanning?(de.panBy({x:ut[0]*Te,y:ut[1]*Te}),de.emit(Fe("dragpan"))):ot&&(e.swipePanning=!0,de.panBy({x:xt*Te,y:fn*Te}),de.emit(Fe("dragpan")),dr&&(dr.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var $e=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);xe[0]=$e[0],xe[1]=$e[1]}}for(var He=0;He<xe.length;He++)Le[He]=xe[He];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 Ve;e.registerBinding(t,"touchcancel",Ve=function(K){var le=e.touchData.start;e.touchData.capture=!1,le&&le.unactivate()});var Re,Ke,Xe,st;if(e.registerBinding(t,"touchend",Re=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,$e=e.touchData.earlier;if(K.touches[0]){var Fe=e.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);Te[0]=Fe[0],Te[1]=Fe[1]}if(K.touches[1]){var Fe=e.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);Te[2]=Fe[0],Te[3]=Fe[1]}if(K.touches[2]){var Fe=e.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);Te[4]=Fe[0],Te[5]=Fe[1]}var We=function(Vn){return{originalEvent:K,type:Vn,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 He=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 xt=function(Vn){return Vn.selectable()&&!Vn.selected()};He.emit(We("box")).stdFilter(xt).select().emit(We("boxselect")),He.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 vt=e.dragData.touchDragEles;if(le!=null){var fn=le._private.grabbed;w(vt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),fn&&(le.emit(We("freeon")),vt.emit(We("free")),e.dragData.didDrag&&(le.emit(We("dragfreeon")),vt.emit(We("dragfree")))),a(le,["touchend","tapend","vmouseup","tapdragout"],K,{x:Te[0],y:Te[1]}),le.unactivate(),e.touchData.start=null}else{var qt=e.findNearestElement(Te[0],Te[1],!0,!0);a(qt,["touchend","tapend","vmouseup","tapdragout"],K,{x:Te[0],y:Te[1]})}var er=e.touchData.startPosition[0]-Te[0],dn=er*er,Sn=e.touchData.startPosition[1]-Te[1],gn=Sn*Sn,En=dn+gn,ua=En*Le*Le;e.touchData.singleTouchMoved||(le||xe.$(":selected").unselect(["tapunselect"]),a(le,["tap","vclick"],K,{x:Te[0],y:Te[1]}),Ke=!1,K.timeStamp-st<=xe.multiClickDebounceTime()?(Xe&&clearTimeout(Xe),Ke=!0,st=null,a(le,["dbltap","vdblclick"],K,{x:Te[0],y:Te[1]})):(Xe=setTimeout(function(){Ke||a(le,["onetap","voneclick"],K,{x:Te[0],y:Te[1]})},xe.multiClickDebounceTime()),st=K.timeStamp)),le!=null&&!e.dragData.didDrag&&le._private.selectable&&ua<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 hn=0;hn<Te.length;hn++)$e[hn]=Te[hn];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}}},Ie=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),Je(ye))}),e.registerBinding(e.container,"pointerup",function(ye){Oe(ye)||(De(ye),Me(ye),Re(ye))}),e.registerBinding(e.container,"pointercancel",function(ye){Oe(ye)||(De(ye),Me(ye),Ve(ye))}),e.registerBinding(e.container,"pointermove",function(ye){Oe(ye)||(ye.preventDefault(),Ie(ye),Me(ye),Qe(ye))})}};var as={};as.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 rd(o,f,this.points,r,a,i/2,l/2,c)},checkPoint:function(r,a,i,l,o,f,c,d){return Ji(r,a,this.points,f,c,l,o,[0,-1],i)},hasMiterBounds:e!=="rectangle",miterBounds:function(r,a,i,l,o,f){return NX(this.points,r,a,i,l,o)}}};as.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 LX(i,l,t,n,r/2+o,a/2+o)},checkPoint:function(t,n,r,a,i,l,o,f){return Ql(t,n,a,i,l,o,r)}}};as.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,p=l/2;o=o==="auto"?vL(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+p*t[y*2+1]};var x,b,S,w,C=m.length;for(b=m[C-1],x=0;x<C;x++)S=m[x%C],w=m[(x+1)%C],f[c][x]=Fw(b,S,w,o),b=S,S=w;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,p){return BX(o,f,this.points,r,a,i,l,c,this.getOrCreateCorners(r,a,i,l,d,p,"corners"))},checkPoint:function(r,a,i,l,o,f,c,d,p){return OX(r,a,this.points,f,c,l,o,this.getOrCreateCorners(f,c,l,o,d,p,"corners"))}}};as.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Cr(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 dL(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"?dl(a,i):f,f=Math.min(c,d,f);var p=f*2;return!!(Ji(t,n,this.points,l,o,a,i-p,[0,-1],r)||Ji(t,n,this.points,l,o,a-p,i,[0,-1],r)||Ql(t,n,p,p,l-c+f,o-d+f,r)||Ql(t,n,p,p,l+c-f,o-d+f,r)||Ql(t,n,p,p,l+c-f,o+d-f,r)||Ql(t,n,p,p,l-c+f,o+d-f,r))}}};as.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Aw(),points:Cr(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,p=a-o,m=a+o;return{topLeft:[c,p+l,c+l,p,c+l,p+l],topRight:[d-l,p,d,p+l,d-l,p+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 rd(i,l,d,t,n)},checkPoint:function(t,n,r,a,i,l,o,f){var c=f==="auto"?this.cornerLength:f;if(Ji(t,n,this.points,l,o,a,i-2*c,[0,-1],r)||Ji(t,n,this.points,l,o,a-2*c,i,[0,-1],r))return!0;var d=this.generateCutTrianglePts(a,i,l,o);return Ur(t,n,d.topLeft)||Ur(t,n,d.topRight)||Ur(t,n,d.bottomRight)||Ur(t,n,d.bottomLeft)}}};as.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Cr(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,p=.85,m=this.generateBarrelBezierPts(r+2*o,a+2*o,t,n),y=function(S){var w=Ou({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},c),C=Ou({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},d),T=Ou({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},p);return[S[0],S[1],w.x,w.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 rd(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,p=Fb(t,n),m=p.heightOffset,y=p.widthOffset,x=p.ctrlPtOffsetPct*t,b={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 b.topLeft.isTop=!0,b.topRight.isTop=!0,b.bottomLeft.isBottom=!0,b.bottomRight.isBottom=!0,b},checkPoint:function(t,n,r,a,i,l,o,f){var c=Fb(a,i),d=c.heightOffset,p=c.widthOffset;if(Ji(t,n,this.points,l,o,a,i-2*d,[0,-1],r)||Ji(t,n,this.points,l,o,a-2*p,i,[0,-1],r))return!0;for(var m=this.generateBarrelBezierPts(a,i,l,o),y=function(L,P,M){var _=M[4],B=M[2],q=M[0],V=M[5],G=M[1],F=Math.min(_,q),H=Math.max(_,q),Y=Math.min(V,G),Q=Math.max(V,G);if(F<=L&&L<=H&&Y<=P&&P<=Q){var z=PX(_,B,q),I=AX(z[0],z[1],z[2],L),X=I.filter(function(U){return 0<=U&&U<=1});if(X.length>0)return X[0]}return null},x=Object.keys(m),b=0;b<x.length;b++){var S=x[b],w=m[S],C=y(t,n,w);if(C!=null){var T=w[5],k=w[3],R=w[1],A=Qn(T,k,R,C);if(w.isTop&&A<=n||w.isBottom&&n<=A)return!0}}return!1}}};as.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Cr(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),p=d,m=t+(r/2+o),y=el(i,l,t,n,c,d,m,p,!1);return y.length>0?y:dL(i,l,t,n,r,a,o,f)},checkPoint:function(t,n,r,a,i,l,o,f){f=f==="auto"?dl(a,i):f;var c=2*f;if(Ji(t,n,this.points,l,o,a,i-c,[0,-1],r)||Ji(t,n,this.points,l,o,a-c,i,[0,-1],r))return!0;var d=a/2+2*r,p=i/2+2*r,m=[l-d,o-p,l-d,o,l+d,o,l+d,o-p];return!!(Ur(t,n,m)||Ql(t,n,c,c,l+a/2-f,o+i/2-f,r)||Ql(t,n,c,c,l-a/2+f,o+i/2-f,r))}}};as.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Cr(3,0)),this.generateRoundPolygon("round-triangle",Cr(3,0)),this.generatePolygon("rectangle",Cr(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",Cr(5,0)),this.generateRoundPolygon("round-pentagon",Cr(5,0)),this.generatePolygon("hexagon",Cr(6,0)),this.generateRoundPolygon("round-hexagon",Cr(6,0)),this.generatePolygon("heptagon",Cr(7,0)),this.generateRoundPolygon("round-heptagon",Cr(7,0)),this.generatePolygon("octagon",Cr(8,0)),this.generateRoundPolygon("round-octagon",Cr(8,0));var r=new Array(20);{var a=Ib(5,0),i=Ib(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=hL(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("$"),p="polygon-"+d,m;return(m=this[p])?m:t.generatePolygon(p,c)}};var Ud={};Ud.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Ud.redraw=function(e){e=e||oL();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};Ud.beforeRender=function(e,t){if(!this.destroyed){t==null&&un("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 $j=function(t,n,r){for(var a=t.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};Ud.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){$j(e,!0,a);var i=Zi();e.render(e.renderOptions);var l=e.lastDrawTime=Zi();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 $j(e,!1,a);e.skipFrame=!1,hp(n)}};hp(n)}};var JZ=function(t){this.init(t)},v_=JZ,Ec=v_.prototype;Ec.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Ec.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),p=d.getPropertyValue("position");p==="static"&&Pt("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=Ae(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()};Ec.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()}};Ec.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{}};Ec.isHeadless=function(){return!1};[Iw,d_,h_,Sc,as,Ud].forEach(function(e){at(Ec,e)});var D0=1e3/60,p_={setupDequeueing:function(t){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=Bd(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},t.deqRedrawThreshold),l=function(c,d){var p=Zi(),m=a.averageRedrawTime,y=a.lastRedrawTime,x=[],b=a.cy.extent(),S=a.getPixelRatio();for(c||a.flushRenderedStyleQueue();;){var w=Zi(),C=w-p,T=w-d;if(y<D0){var k=D0-(c?m:0);if(T>=t.deqFastCost*k)break}else if(c){if(C>=t.deqCost*y||C>=t.deqAvgCost*m)break}else if(T>=t.deqNoDrawCost*D0)break;var R=t.deq(r,S,b);if(R.length>0)for(var A=0;A<R.length;A++)x.push(R[A]);else break}x.length>0&&(t.onDeqd(r,x),!c&&t.shouldRedraw(r,x,S,b)&&i())},o=t.priority||Cw;a.beforeRender(l,o(r))}}}},eJ=(function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vp;xl(this,e),this.idsByKey=new Ki,this.keyForId=new Ki,this.cachesByLvl=new Ki,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return bl(e,[{key:"getIdsFor",value:function(n){n==null&&un("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new yc,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 Ki,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}}])})(),Kj=25,kv=50,Yv=-4,Jb=3,m_=7.99,tJ=8,nJ=1024,rJ=1024,aJ=1024,iJ=.2,sJ=.8,lJ=10,oJ=.15,uJ=.1,cJ=.9,fJ=.9,dJ=100,hJ=1,ku={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},vJ=ur({getKey:null,doesEleInvalidateKey:vp,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:iL,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),zf=function(t,n){var r=this;r.renderer=t,r.onDequeues=[];var a=vJ(n);at(r,a),r.lookup=new eJ(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},qn=zf.prototype;qn.reasons=ku;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 Pd(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(Nw(o*n))),r<Yv)r=Yv;else if(o>=m_||r>Jb)return null;var c=Math.pow(2,r),d=t.h*c,p=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<=Kj?x=Kj:d<=kv?x=kv:x=Math.ceil(d/kv)*kv,d>aJ||p>rJ)return null;var b=i.getTextureQueue(x),S=b[b.length-2],w=function(){return i.recycleTexture(x,p)||i.addTexture(x,p)};S||(S=b[b.length-1]),S||(S=w()),S.width-S.usedWidth<p&&(S=w());for(var C=function(F){return F&&F.scaledLabelShown===m},T=a&&a===ku.dequeue,k=a&&a===ku.highQuality,R=a&&a===ku.downscale,A,D=r+1;D<=Jb;D++){var L=f.get(e,D);if(L){A=L;break}}var P=A&&A.level===r+1?A:null,M=function(){S.context.drawImage(P.texture.canvas,P.x,0,P.width,P.height,S.usedWidth,0,p,d)};if(S.context.setTransform(1,0,0,1,0,0),S.context.clearRect(S.usedWidth,0,p,x),C(P))M();else if(C(A))if(k){for(var _=A.level;_>r;_--)P=i.getElement(e,t,n,_,ku.downscale);M()}else return i.queueElement(e,A.level-1),A;else{var B;if(!T&&!k&&!R)for(var q=r-1;q>=Yv;q--){var V=f.get(e,q);if(V){B=V;break}}if(C(B))return i.queueElement(e,r),B;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:p,height:d,scaledLabelShown:m},S.usedWidth+=Math.ceil(p+tJ),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=Yv;i<=Jb;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>=iJ*e.width&&this.retireTexture(e)};qn.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>sJ&&e.fullnessChecks>=lJ?fl(n,e):e.fullnessChecks++};qn.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),a=this.lookup;fl(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)}Tw(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(nJ,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,Tw(l.eleCaches),l.context.setTransform(1,0,0,1,0,0),l.context.clearRect(0,0,l.width,l.height),fl(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<hJ&&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 p=t.getBoundingBox(c);t.getElement(c,p,e,o.level,ku.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=Ew,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(e))};qn.onDequeue=function(e){this.onDequeues.push(e)};qn.offDequeue=function(e){fl(this.onDequeues,e)};qn.setupDequeueing=p_.setupDequeueing({deqRedrawThreshold:dJ,deqCost:oJ,deqAvgCost:uJ,deqNoDrawCost:cJ,deqFastCost:fJ,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(jw(f,a))return!0}return!1},priority:function(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}});var pJ=1,Hf=-4,Sp=2,mJ=3.99,gJ=50,yJ=50,xJ=.15,bJ=.1,wJ=.9,SJ=.9,EJ=1,Yj=250,CJ=4e3*4e3,Xj=32767,TJ=!0,g_=function(t){var n=this,r=n.renderer=t,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Zi()-2*Yj,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=Bd(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},yJ),r.beforeRender(function(l,o){o-n.lastInvalidationTime<=Yj?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(o,f){return f.reqs-o.reqs};n.layersQueue=new Pd(i),n.setupDequeueing()},cr=g_.prototype,Qj=0,NJ=Math.pow(2,53)-1;cr.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:Qj=++Qj%NJ,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};cr.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(Nw(l*t)),n<Hf)n=Hf;else if(l>=mJ||n>Sp)return null}r.validateLayersElesOrdering(n,e);var f=r.layersByLevel,c=Math.pow(2,n),d=f[n]=f[n]||[],p,m=r.levelIsComplete(n,e),y,x=function(){var M=function(G){if(r.validateLayersElesOrdering(G,e),r.levelIsComplete(G,e))return y=f[G],!0},_=function(G){if(!y)for(var F=n+G;Hf<=F&&F<=Sp&&!M(F);F+=G);};_(1),_(-1);for(var B=d.length-1;B>=0;B--){var q=d[B];q.invalid&&fl(d,q)}};if(!m)x();else return d;var b=function(){if(!p){p=kr();for(var M=0;M<e.length;M++)EX(p,e[M].boundingBox())}return p},S=function(M){M=M||{};var _=M.after;b();var B=Math.ceil(p.w*c),q=Math.ceil(p.h*c);if(B>Xj||q>Xj)return null;var V=B*q;if(V>CJ)return null;var G=r.makeLayer(p,n);if(_!=null){var F=d.indexOf(_)+1;d.splice(F,0,G)}else(M.insert===void 0||M.insert)&&d.unshift(G);return G};if(r.skipping&&!o)return null;for(var w=null,C=e.length/pJ,T=!o,k=0;k<e.length;k++){var R=e[k],A=R._private.rscratch,D=A.imgLayerCaches=A.imgLayerCaches||{},L=D[n];if(L){w=L;continue}if((!w||w.eles.length>=C||!fL(w.bb,R.boundingBox()))&&(w=S({insert:!0,after:w}),!w))return null;y||T?r.queueLayer(w,R):r.drawEleInLayer(w,R,n,t),w.eles.push(R),D[n]=w}return y||(T?null:d)};cr.getEleLevelForLayerLevel=function(e,t){return e};cr.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,TJ),i.setImgSmoothing(l,!0))};cr.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};cr.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}}};cr.updateElementsInLayers=function(e,t){for(var n=this,r=Md(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=Hf;c<=Sp;c++){var d=f[c];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||t(d,l,i))}};cr.haveLayers=function(){for(var e=this,t=!1,n=Hf;n<=Sp;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t};cr.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=Zi(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(r,a,i){t.invalidateLayer(r)}))};cr.invalidateLayer=function(e){if(this.lastInvalidationTime=Zi(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];fl(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)}}};cr.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])})};cr.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()};cr.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))}};cr.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],a=0;a<EJ&&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};cr.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()}};cr.requestRedraw=Bd(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100);cr.setupDequeueing=p_.setupDequeueing({deqRedrawThreshold:gJ,deqCost:xJ,deqAvgCost:bJ,deqNoDrawCost:wJ,deqFastCost:SJ,deq:function(t,n){return t.dequeue(n)},onDeqd:Cw,shouldRedraw:iL,priority:function(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}});var y_={},Wj;function kJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function jJ(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 Zj(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 AJ(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 RJ(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}y_.arrowShapeImpl=function(e){return(Wj||(Wj={polygon:kJ,"triangle-backcurve":jJ,"triangle-tee":Zj,"circle-triangle":AJ,"triangle-cross":Zj,circle:RJ}))[e]};var xi={};xi.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)};xi.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)};xi.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)};xi.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 p=o(f,t);if(p===0)return;var m=l(f,t),y=c.x1,x=c.y1,b=c.w,S=c.h,w,C,T,k,R;if(m!==0){var A=n.getRotationPoint(t);T=A.x,k=A.y,e.translate(T,k),e.rotate(m),R=f.getImgSmoothing(e),R||f.setImgSmoothing(e,!0);var D=n.getRotationOffset(t);w=D.x,C=D.y}else w=y,C=x;var L;p!==1&&(L=e.globalAlpha,e.globalAlpha=L*p),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,w,C,b,S),p!==1&&(e.globalAlpha=L),m!==0&&(e.rotate(-m),e.translate(-T,-k),R||f.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var DJ=function(){return 0},MJ=function(t,n){return t.getTextAngle(n,null)},OJ=function(t,n){return t.getTextAngle(n,"source")},LJ=function(t,n){return t.getTextAngle(n,"target")},_J=function(t,n){return n.effectiveOpacity()},M0=function(t,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};xi.drawCachedElement=function(e,t,n,r,a,i){var l=this,o=l.data,f=o.eleTxrCache,c=o.lblTxrCache,d=o.slbTxrCache,p=o.tlbTxrCache,m=t.boundingBox(),y=i===!0?f.reasons.highQuality:null;if(!(m.w===0||m.h===0||!t.visible())&&(!r||jw(m,r))){var x=t.isEdge(),b=t.element()._private.rscratch.badLine;l.drawElementUnderlay(e,t),l.drawCachedElementPortion(e,t,f,n,a,y,DJ,_J),(!x||!b)&&l.drawCachedElementPortion(e,t,c,n,a,y,MJ,M0),x&&!b&&(l.drawCachedElementPortion(e,t,d,n,a,y,OJ,M0),l.drawCachedElementPortion(e,t,p,n,a,y,LJ,M0)),l.drawElementOverlay(e,t)}};xi.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var a=t[r];n.drawElement(e,a)}};xi.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)}};xi.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)}};xi.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 is={};is.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,p=t.pstyle("curve-style").value,m=t.pstyle("line-style").value,y=t.pstyle("width").pfValue,x=t.pstyle("line-cap").value,b=t.pstyle("line-outline-width").value,S=t.pstyle("line-outline-color").value,w=c*d,C=c*d,T=function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;p==="straight-triangle"?(l.eleStrokeStyle(e,t,G),l.drawEdgeTrianglePath(t,e,o.allpts)):(e.lineWidth=y,e.lineCap=x,l.eleStrokeStyle(e,t,G),l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},k=function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;if(e.lineWidth=y+b,e.lineCap=x,b>0)l.colorStrokeStyle(e,S[0],S[1],S[2],G);else{e.lineCap="butt";return}p==="straight-triangle"?l.drawEdgeTrianglePath(t,e,o.allpts):(l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},R=function(){a&&l.drawEdgeOverlay(e,t)},A=function(){a&&l.drawEdgeUnderlay(e,t)},D=function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C;l.drawArrowheads(e,t,G)},L=function(){l.drawElementText(e,t,null,r)};e.lineJoin="round";var P=t.pstyle("ghost").value==="yes";if(P){var M=t.pstyle("ghost-offset-x").pfValue,_=t.pstyle("ghost-offset-y").pfValue,B=t.pstyle("ghost-opacity").value,q=w*B;e.translate(M,_),T(q),D(q),e.translate(-M,-_)}else k();A(),T(),D(),R(),L(),n&&e.translate(f.x1,f.y1)}};var x_=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")}}}};is.drawEdgeOverlay=x_("overlay");is.drawEdgeUnderlay=x_("underlay");is.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 p=n.join("$"),m=a.pathCacheKey&&a.pathCacheKey===p;m?(l=t=a.pathCache,o=!0):(l=t=new Path2D,a.pathCacheKey=p,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 b=Vr(a.roundCorners),S;try{for(b.s();!(S=b.n()).done;){var w=S.value;l_(t,w)}}catch(T){b.e(T)}finally{b.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([])};is.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()}};is.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)};is.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,p=t.pstyle("width").pfValue,m=t.pstyle(n+"-arrow-width"),y=m.value==="match-line"?p:m.pfValue;m.units==="%"&&(y*=p);var x=t.pstyle("opacity").value;l===void 0&&(l=x);var b=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,p,f,y,r,a,i),e.globalCompositeOperation=b);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,p,f,y,r,a,i)}}};is.drawArrowShape=function(e,t,n,r,a,i,l,o,f){var c=this,d=this.usePaths()&&a!=="triangle-cross",p=!1,m,y=t,x={x:l,y:o},b=e.pstyle("arrow-scale").value,S=this.getArrowWidth(r,b),w=c.arrowShapes[a];if(d){var C=c.arrowPathCache=c.arrowPathCache||[],T=yo(a),k=C[T];k!=null?(m=t=k,p=!0):(m=t=new Path2D,C[T]=m)}p||(t.beginPath&&t.beginPath(),d?w.draw(t,1,0,{x:0,y:0},1):w.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 qw={};qw.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){Pt(d)}};qw.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),p=d(n,"background-fit","value",r),m=d(n,"background-repeat","value",r),y=n.width(),x=n.height(),b=n.padding()*2,S=y+(d(n,"background-width-relative-to","value",r)==="inner"?0:b),w=x+(d(n,"background-height-relative-to","value",r)==="inner"?0:b),C=n._private.rscratch,T=d(n,"background-clip","value",r),k=T==="node",R=d(n,"background-image-opacity","value",r)*a,A=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,P=t.height||t.cachedH;(L==null||P==null)&&(document.body.appendChild(t),L=t.cachedW=t.width||t.offsetWidth,P=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var M=L,_=P;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)==="%"?_=d(n,"background-height","pfValue",r)*w:_=d(n,"background-height","pfValue",r)),!(M===0||_===0)){if(p==="contain"){var B=Math.min(S/M,w/_);M*=B,_*=B}else if(p==="cover"){var B=Math.max(S/M,w/_);M*=B,_*=B}var q=o-S/2,V=d(n,"background-position-x","units",r),G=d(n,"background-position-x","pfValue",r);V==="%"?q+=(S-M)*G:q+=G;var F=d(n,"background-offset-x","units",r),H=d(n,"background-offset-x","pfValue",r);F==="%"?q+=(S-M)*H:q+=H;var Y=f-w/2,Q=d(n,"background-position-y","units",r),z=d(n,"background-position-y","pfValue",r);Q==="%"?Y+=(w-_)*z:Y+=z;var I=d(n,"background-offset-y","units",r),X=d(n,"background-offset-y","pfValue",r);I==="%"?Y+=(w-_)*X:Y+=X,C.pathCache&&(q-=o,Y-=f,o=0,f=0);var U=e.globalAlpha;e.globalAlpha=R;var te=i.getImgSmoothing(e),ie=!1;if(A==="no"&&te?(i.setImgSmoothing(e,!1),ie=!0):A==="yes"&&!te&&(i.setImgSmoothing(e,!0),ie=!0),m==="no-repeat")k&&(e.save(),C.pathCache?e.clip(C.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,S,w,D,C),e.clip())),i.safeDrawImage(e,t,0,0,L,P,q,Y,M,_),k&&e.restore();else{var oe=e.createPattern(t,m);e.fillStyle=oe,i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,S,w,D,C),e.translate(q,Y),e.fill(),e.translate(-q,-Y)}e.globalAlpha=U,ie&&i.setImgSmoothing(e,te)}};var No={};No.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(Nw(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)};No.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"),p=t.pstyle("source-label"),m=t.pstyle("target-label");if(c||(!d||!d.value)&&(!p||!p.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)};No.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};No.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 BJ(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 Jj(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()}No.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=Fr(a,"labelAngle",t);n=e.isEdge()?o:0}else l.strValue==="none"?n=0:n=l.pfValue;return n};No.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=Fr(l,"labelX",n),c=Fr(l,"labelY",n),d,p,m=this.getLabelText(t,n);if(m!=null&&m!==""&&!isNaN(f)&&!isNaN(c)){this.setupTextStyle(e,t,a);var y=n?n+"-":"",x=Fr(l,"labelWidth",n),b=Fr(l,"labelHeight",n),S=t.pstyle(y+"text-margin-x").pfValue,w=t.pstyle(y+"text-margin-y").pfValue,C=t.isEdge(),T=t.pstyle("text-halign").value,k=t.pstyle("text-valign").value;C&&(T="center",k="center"),f+=S,c+=w;var R;switch(r?R=this.getTextAngle(t,n):R=0,R!==0&&(d=f,p=c,e.translate(d,p),e.rotate(R),f=0,c=0),k){case"top":break;case"center":c+=b/2;break;case"bottom":c+=b;break}var A=t.pstyle("text-background-opacity").value,D=t.pstyle("text-border-opacity").value,L=t.pstyle("text-border-width").pfValue,P=t.pstyle("text-background-padding").pfValue,M=t.pstyle("text-background-shape").strValue,_=M==="round-rectangle"||M==="roundrectangle",B=M==="circle",q=2;if(A>0||L>0&&D>0){var V=e.fillStyle,G=e.strokeStyle,F=e.lineWidth,H=t.pstyle("text-background-color").value,Y=t.pstyle("text-border-color").value,Q=t.pstyle("text-border-style").value,z=A>0,I=L>0&&D>0,X=f-P;switch(T){case"left":X-=x;break;case"center":X-=x/2;break}var U=c-b-P,te=x+2*P,ie=b+2*P;if(z&&(e.fillStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[2],",").concat(A*o,")")),I&&(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(_?(e.beginPath(),Jj(e,X,U,te,ie,q)):B?(e.beginPath(),BJ(e,X,U,te,ie)):(e.beginPath(),e.rect(X,U,te,ie)),z&&e.fill(),I&&e.stroke(),I&&Q==="double"){var oe=L/2;e.beginPath(),_?Jj(e,X+oe,U+oe,te-2*oe,ie-2*oe,q):e.rect(X+oe,U+oe,te-2*oe,ie-2*oe),e.stroke()}e.fillStyle=V,e.strokeStyle=G,e.lineWidth=F,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=Fr(l,"labelWrapCachedLines",n),fe=Fr(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))),k){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);R!==0&&(e.rotate(-R),e.translate(-d,-p))}}};var Sl={};Sl.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,p=t.position();if(!(!Ae(p.x)||!Ae(p.y))&&!(i&&!t.visible())){var m=i?t.effectiveOpacity():1,y=l.usePaths(),x,b=!1,S=t.padding();o=t.width()+2*S,f=t.height()+2*S;var w;n&&(w=n,e.translate(-w.x1,-w.y1));for(var C=t.pstyle("background-image"),T=C.value,k=new Array(T.length),R=new Array(T.length),A=0,D=0;D<T.length;D++){var L=T[D],P=k[D]=L!=null&&L!=="none";if(P){var M=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",D);A++,R[D]=l.getCachedImage(L,M,function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var _=t.pstyle("background-blacken").value,B=t.pstyle("border-width").pfValue,q=t.pstyle("background-opacity").value*m,V=t.pstyle("border-color").value,G=t.pstyle("border-style").value,F=t.pstyle("border-join").value,H=t.pstyle("border-cap").value,Y=t.pstyle("border-position").value,Q=t.pstyle("border-dash-pattern").pfValue,z=t.pstyle("border-dash-offset").pfValue,I=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]:q;l.eleFillStyle(e,t,Oe)},fe=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;l.colorStrokeStyle(e,V[0],V[1],V[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=aL(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(p.x,p.y);var Ne=ne(o,f,re,ge);x=Ne.path,b=Ne.cacheHit}var Be=function(){if(!b){var Oe=p;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<R.length;pe++){var de=t.cy().style().getIndexedStyle(t,"background-image-containment","value",pe);if(ye&&de==="over"||!ye&&de==="inside"){le++;continue}k[pe]&&R[pe].complete&&!R[pe].error&&(le++,l.drawInscribedImage(e,R[pe],t,pe,Oe))}c.backgrounding=le!==A,K!==c.backgrounding&&t.updateStyle(!1)},Je=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,p.x,p.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,p.x,p.y,o,f,ae,d),e.clip()),l.drawStripe(e,t,ye),e.restore(),Oe&&(y||l.nodeShapes[l.getNodeShape(t)].draw(e,p.x,p.y,o,f,ae,d)))},Ve=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,ye=(_>0?_:-_)*Oe,K=_>0?0:255;_!==0&&(l.colorFillStyle(e,K,K,K,ye),y?e.fill(x):e.fill())},Re=function(){if(B>0){if(e.lineWidth=B,e.lineCap=H,e.lineJoin=F,e.setLineDash)switch(G){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(Q),e.lineDashOffset=z;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-B,-f/2-B,o+2*B,f+2*B),Oe.addPath(x),e.clip(Oe,"evenodd")}y?e.stroke(x):e.stroke(),e.restore()}else y?e.stroke(x):e.stroke();if(G==="double"){e.lineWidth=B/3;var ye=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(x):e.stroke(),e.globalCompositeOperation=ye}e.setLineDash&&e.setLineDash([])}},Ke=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=p;y&&(Oe={x:0,y:0});var ye=l.getNodeShape(t),K=B;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 $e=ne(de,xe,ye,Le);Te=$e.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 Fe=0,We=0,ot=0;ye==="round-diamond"?Fe=(K+oe+X)*1.4:ye==="round-heptagon"?(Fe=(K+oe+X)*1.075,ot=-(K/2+oe+X)/35):ye==="round-hexagon"?Fe=(K+oe+X)*1.12:ye==="round-pentagon"?(Fe=(K+oe+X)*1.13,ot=-(K/2+oe+X)/15):ye==="round-tag"?(Fe=(K+oe+X)*1.12,We=(K/2+X+oe)*.07):ye==="round-triangle"&&(Fe=(K+oe+X)*(Math.PI/2),ot=-(K+oe/2+X)/Math.PI),Fe!==0&&(le=(o+Fe)/o,de=o*le,["round-hexagon","round-tag"].includes(ye)||(pe=(f+Fe)/f,xe=f*pe)),ae=ae==="auto"?vL(de,xe):ae;for(var ut=de/2,He=xe/2,xt=ae+(K+X+oe)/2,vt=new Array(Le.length/2),fn=new Array(Le.length/2),qt=0;qt<Le.length/2;qt++)vt[qt]={x:Oe.x+We+ut*Le[qt*2],y:Oe.y+ot+He*Le[qt*2+1]};var er,dn,Sn,gn,En=vt.length;for(dn=vt[En-1],er=0;er<En;er++)Sn=vt[er%En],gn=vt[(er+1)%En],fn[er]=Fw(dn,Sn,gn,xt),dn=Sn,Sn=gn;l.drawRoundPolygonPath(Te||e,Oe.x+We,Oe.y+ot,o*le,f*pe,Le,fn)}else if(["roundrectangle","round-rectangle"].includes(ye))ae=ae==="auto"?dl(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"?Aw():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"?dl(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 ua=(K+X+oe)/o;Le=pp(mp(Le,ua)),l.drawPolygonPath(Te||e,Oe.x,Oe.y,o,f,Le)}else{var hn=(K+X+oe)/o;Le=pp(mp(Le,-hn)),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 ca=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(Te):e.stroke(),e.globalCompositeOperation=ca}e.setLineDash&&e.setLineDash([])}},Xe=function(){a&&l.drawNodeOverlay(e,t,p,o,f)},st=function(){a&&l.drawNodeUnderlay(e,t,p,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,Ie=De*m;e.translate(he,Ce),J(),Ke(),we(De*q),Be(),lt(Ie,!0),fe(De*I),Re(),Je(_!==0||B!==0),Qe(_!==0||B!==0),lt(Ie,!1),Ve(Ie),e.translate(-he,-Ce)}y&&e.translate(-p.x,-p.y),st(),y&&e.translate(p.x,p.y),J(),Ke(),we(),Be(),lt(m,!0),fe(),Re(),Je(_!==0||B!==0),Qe(_!==0||B!==0),lt(m,!1),Ve(),y&&e.translate(-p.x,-p.y),Pe(),Xe(),n&&e.translate(w.x1,w.y1)}};var b_=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,p=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[p].draw(n,a.x,a.y,i+f*2,l+f*2,m),n.fill()}}}};Sl.drawNodeOverlay=b_("overlay");Sl.drawNodeUnderlay=b_("underlay");Sl.hasPie=function(e){return e=e[0],e._private.hasPie};Sl.hasStripe=function(e){return e=e[0],e._private.hasStripe};Sl.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(),p=t.height(),m=Math.min(d,p)/2,y,x=0,b=this.usePaths();if(b&&(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 w=t.pstyle("pie-"+S+"-background-size").value,C=t.pstyle("pie-"+S+"-background-color").value,T=t.pstyle("pie-"+S+"-background-opacity").value*n,k=w/100;k+x>1&&(k=1-x);var R=1.5*Math.PI+2*Math.PI*x;R+=o;var A=2*Math.PI*k,D=R+A;w===0||x>=1||x+k>1||(y===0?(e.beginPath(),e.moveTo(f,c),e.arc(f,c,m,R,D),e.closePath()):(e.beginPath(),e.arc(f,c,m,R,D),e.arc(f,c,y,D,R,!0),e.closePath()),this.colorFillStyle(e,C[0],C[1],C[2],T),e.fill(),x+=k)}};Sl.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 p=t.pstyle("stripe-direction").value,m=t.pstyle("stripe-size");switch(p){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 b=1;b<=a.stripeBackgroundN;b++){var S=t.pstyle("stripe-"+b+"-background-size").value,w=t.pstyle("stripe-"+b+"-background-color").value,C=t.pstyle("stripe-"+b+"-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,w[0],w[1],w[2],C),e.fill(),c+=T)}e.restore()};var jr={},PJ=100;jr.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};jr.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};jr.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(),p=n.midpoint(),m=xo(c,p),y=xo(d,p);i=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(m,y))}else{var x=l?{x:0,y:0}:n.position(),b=n.paddedWidth(),S=n.paddedHeight();i=e.createRadialGradient(x.x,x.y,0,x.x,x.y,Math.max(b,S))}else if(n.isEdge()){var w=n.sourceEndpoint(),C=n.targetEndpoint();i=e.createLinearGradient(w.x,w.y,C.x,C.y)}else{var T=l?{x:0,y:0}:n.position(),k=n.paddedWidth(),R=n.paddedHeight(),A=k/2,D=R/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+A,T.y,T.x-A,T.y);break;case"to-right":i=e.createLinearGradient(T.x-A,T.y,T.x+A,T.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(T.x-A,T.y-D,T.x+A,T.y+D);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(T.x-A,T.y+D,T.x+A,T.y-D);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(T.x+A,T.y-D,T.x-A,T.y+D);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(T.x+A,T.y+D,T.x-A,T.y-D);break}}if(!i)return null;for(var P=f.length===o.length,M=o.length,_=0;_<M;_++)i.addColorStop(P?f[_]:_/(M-1),"rgba("+o[_][0]+","+o[_][1]+","+o[_][2]+","+a+")");return i};jr.gradientFillStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"background",t,n,r);if(!a)return null;e.fillStyle=a};jr.colorFillStyle=function(e,t,n,r,a){e.fillStyle="rgba("+t+","+n+","+r+","+a+")"};jr.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)}};jr.gradientStrokeStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"line",t,n,r);if(!a)return null;e.strokeStyle=a};jr.colorStrokeStyle=function(e,t,n,r,a){e.strokeStyle="rgba("+t+","+n+","+r+","+a+")"};jr.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)}};jr.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 p=n.canvasContainer;p.style.width=a+"px",p.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}};jr.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})};jr.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])};jr.render=function(e){var t=this;e=e||oL();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,p=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(),b=t.hoverData.draggingEles,S=!!(t.hoverData.selecting||t.touchData.selecting);m=m&&!r&&t.motionBlurEnabled&&!S;var w=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&&(w=!1),t.mbFrames>t.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!p&&(d[t.NODE]=!0,d[t.SELECT_BOX]=!0);var C=n.style(),T=n.zoom(),k=l!==void 0?l:T,R=n.pan(),A={x:R.x,y:R.y},D={zoom:T,pan:{x:R.x,y:R.y}},L=t.prevViewport,P=L===void 0||D.zoom!==L.zoom||D.pan.x!==L.pan.x||D.pan.y!==L.pan.y;!P&&!(b&&!x)&&(t.motionBlurPxRatio=1),o&&(A=o),k*=f,A.x*=f,A.y*=f;var M=t.getCachedZSortedEles();function _(fe,J,ne,re,ge){var Ne=fe.globalCompositeOperation;fe.globalCompositeOperation="destination-out",t.colorFillStyle(fe,255,255,255,t.motionBlurTransparency),fe.fillRect(J,ne,re,ge),fe.globalCompositeOperation=Ne}function B(fe,J){var ne,re,ge,Ne;!t.clearingMotionBlur&&(fe===c.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||fe===c.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(ne={x:R.x*y,y:R.y*y},re=T*y,ge=t.canvasWidth*y,Ne=t.canvasHeight*y):(ne=A,re=k,ge=t.canvasWidth,Ne=t.canvasHeight),fe.setTransform(1,0,0,1,0,0),J==="motionBlur"?_(fe,0,0,ge,Ne):!r&&(J===void 0||J)&&fe.clearRect(0,0,ge,Ne),a||(fe.translate(ne.x,ne.y),fe.scale(re,re)),o&&fe.translate(o.x,o.y),l&&fe.scale(l,l)}if(p||(t.textureDrawLastFrame=!1),p){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var q=t.data.bufferContexts[t.TEXTURE_BUFFER];q.setTransform(1,0,0,1,0,0),q.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:q,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 V=c.contexts[t.NODE],G=t.textureCache.texture,D=t.textureCache.viewport;V.setTransform(1,0,0,1,0,0),m?_(V,0,0,D.width,D.height):V.clearRect(0,0,D.width,D.height);var F=C.core("outside-texture-bg-color").value,H=C.core("outside-texture-bg-opacity").value;t.colorFillStyle(V,F[0],F[1],F[2],H),V.fillRect(0,0,D.width,D.height);var T=n.zoom();B(V,!1),V.clearRect(D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f),V.drawImage(G,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(),z=t.hideEdgesOnViewport&&Q,I=[];if(I[t.NODE]=!d[t.NODE]&&m&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,I[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),I[t.DRAG]=!d[t.DRAG]&&m&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,I[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),d[t.NODE]||a||i||I[t.NODE]){var X=m&&!I[t.NODE]&&y!==1,V=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:c.contexts[t.NODE]),U=m&&!X?"motionBlur":void 0;B(V,U),z?t.drawCachedNodes(V,M.nondrag,f,Y):t.drawLayeredElements(V,M.nondrag,f,Y),t.debug&&t.drawDebugPoints(V,M.nondrag),!a&&!m&&(d[t.NODE]=!1)}if(!i&&(d[t.DRAG]||a||I[t.DRAG])){var X=m&&!I[t.DRAG]&&y!==1,V=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:c.contexts[t.DRAG]);B(V,m&&!X?"motionBlur":void 0),z?t.drawCachedNodes(V,M.drag,f,Y):t.drawCachedElements(V,M.drag,f,Y),t.debug&&t.drawDebugPoints(V,M.drag),!a&&!m&&(d[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,B),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||!w?J.clearRect(0,0,t.canvasWidth,t.canvasHeight):_(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]||I[t.NODE])&&(we(te,ie,I[t.NODE]),d[t.NODE]=!1),(d[t.DRAG]||I[t.DRAG])&&(we(oe,ae,I[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=!p,t.mbFrames=0,d[t.NODE]=!0,d[t.DRAG]=!0,t.redraw()},PJ)),r||n.emit("render")};var Af;jr.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 p=n.cy.zoom(),m=i.core("selection-box-border-width").value/p;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 p=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/p,0,2*Math.PI),d.fill()}var x=n.lastRedrawTime;if(n.showFps&&x){x=Math.round(x);var b=Math.round(1e3/x),S="1 frame = "+x+" ms = "+b+" 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",!Af){var w=d.measureText(S);Af=w.actualBoundingBoxAscent}d.fillText(S,0,Af);var C=60;d.strokeRect(0,Af+10,250,20),d.fillRect(0,Af+10,250*Math.min(b/C,1),20)}o||(f[n.SELECT_BOX]=!1)}};function eA(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 zJ(e,t,n){var r=eA(e,e.VERTEX_SHADER,t),a=eA(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 IJ(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 Vw(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 FJ(e){var t=e.pixelRatio,n=e.cy.zoom();return n*t}function UJ(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 qJ(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 VJ(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 Hl(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 xu(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 HJ(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function GJ(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 w_(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 S_(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function $J(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 KJ(e,t,n,r){var a=w_(e,t),i=Ln(a,2),l=i[0],o=i[1],f=S_(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 Ja(e,t,n,r){var a=w_(e,n),i=Ln(a,3),l=i[0],o=i[1],f=i[2],c=S_(e,o,t*l),d=l*f,p=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,p),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]=$J(e,o,c,d,l,y);return p.dataArray=c,p.stride=d,p.size=l,p.getView=function(x){return m[x]},p.setPoint=function(x,b,S){var w=m[x];w[0]=b,w[1]=S},p.bufferSubData=function(x){e.bindBuffer(e.ARRAY_BUFFER,p),x?e.bufferSubData(e.ARRAY_BUFFER,0,c,0,x*l):e.bufferSubData(e.ARRAY_BUFFER,0,c)},p}function YJ(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(p){return i[p]},f.setData=function(p,m){i[m].set(p,0)},f.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferSubData(e.ARRAY_BUFFER,0,a)},f}function XJ(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 tA=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 O0(){var e=new tA(9);return tA!=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 nA(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 QJ(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],p=t[8],m=n[0],y=n[1],x=n[2],b=n[3],S=n[4],w=n[5],C=n[6],T=n[7],k=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*p,e[3]=b*r+S*l+w*c,e[4]=b*a+S*o+w*d,e[5]=b*i+S*f+w*p,e[6]=C*r+T*l+k*c,e[7]=C*a+T*o+k*d,e[8]=C*i+T*f+k*p,e}function Xv(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],p=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+p,e}function rA(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],p=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]=p,e}function e1(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 WJ(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 ZJ=(function(){function e(t,n,r,a){xl(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 bl(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,p=c.texW,m=c.texH,y=function(T,k){if(a&&k){var R=k.context,A=T.x,D=T.row,L=A,P=f*D;R.save(),R.translate(L,P),R.scale(d,d),a(R,r),R.restore()}},x=[null,null],b=function(){y(i.freePointer,i.canvas),x[0]={x:i.freePointer.x,y:i.freePointer.row*f,w:p,h:m},x[1]={x:i.freePointer.x+p,y:i.freePointer.row*f,w:0,h:m},i.freePointer.x+=p,i.freePointer.x==l&&(i.freePointer.x=0,i.freePointer.row++)},S=function(){var T=i.scratch,k=i.canvas;T.clear(),y({x:0,row:0},T);var R=l-i.freePointer.x,A=p-R,D=f;{var L=i.freePointer.x,P=i.freePointer.row*f,M=R;k.context.drawImage(T,0,0,M,D,L,P,M,D),x[0]={x:L,y:P,w:M,h:m}}{var _=R,B=(i.freePointer.row+1)*f,q=A;k&&k.context.drawImage(T,_,0,q,D,0,B,q,D),x[1]={x:0,y:B,w:q,h:m}}i.freePointer.x=A,i.freePointer.row++},w=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+p<=l)b();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===l?(w(),b()):this.enableWrapping?S():(w(),b())}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=GJ(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}}])})(),JJ=(function(){function e(t,n,r,a){xl(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 bl(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 ZJ(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=Vr(this.atlases),f;try{var c=function(){var p=f.value,m=p.getKeys(),y=eee(r,m);if(y.size===0)return a.push(p),m.forEach(function(R){return i.set(R,p)}),1;l||(l=n._createAtlas(),a.push(l));var x=Vr(m),b;try{for(x.s();!(b=x.n()).done;){var S=b.value;if(!y.has(S)){var w=p.getOffsets(S),C=Ln(w,2),T=C[0],k=C[1];l.canFit({w:T.w+k.w,h:T.h})||(l.lock(),l=n._createAtlas(),a.push(l)),p.canvas&&(n._copyTextureToNewAtlas(S,p,l),i.set(S,l))}}}catch(R){x.e(R)}finally{x.f()}p.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=Ln(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,p=o.h;a.draw(n,{w:d,h:p},function(m){m.drawImage(c,0,0,d,p,0,0,d,p)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function eee(e,t){return e.intersection?e.intersection(t):new Set(fp(e).filter(function(n){return t.has(n)}))}var tee=(function(){function e(t,n){xl(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 bl(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 JJ(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=at({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,p=!1,m=!1,y=Vr(n),x;try{for(y.s();!(x=y.n()).done;){var b=x.value;if(f(b)){var S=Vr(this.renderTypes.values()),w;try{var C=function(){var k=w.value,R=k.type;if(d(R)){var A=r.collections.get(k.collection),D=k.getKey(b),L=Array.isArray(D)?D:[D];if(l)L.forEach(function(B){return A.markKeyForGC(B)}),m=!0;else{var P=k.getID?k.getID(b):b.id(),M=r._key(R,P),_=r.typeAndIdToKey.get(M);_!==void 0&&!VJ(L,_)&&(p=!0,r.typeAndIdToKey.delete(M),_.forEach(function(B){return A.markKeyForGC(B)}))}}};for(S.s();!(w=S.n()).done;)C()}catch(T){S.e(T)}finally{S.f()}}}}catch(T){y.e(T)}finally{y.f()}return m&&(this.gc(),p=!1),p}},{key:"gc",value:function(){var n=Vr(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(),p=this._key(r,d);this.typeAndIdToKey.has(p)?this.typeAndIdToKey.get(p).push(i):this.typeAndIdToKey.set(p,[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),p=d.getOffsets(f),m=Ln(p,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=Vr(this.collections),a;try{for(r.s();!(a=r.n()).done;){var i=Ln(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(p){r.e(p)}finally{r.f()}return n}}])})(),nee=(function(){function e(t){xl(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return bl(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}}])})(),ree=`
|
|
499
|
+
float circleSD(vec2 p, float r) {
|
|
500
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
501
|
+
}
|
|
502
|
+
`,aee=`
|
|
503
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
504
|
+
vec2 d = abs(p)-b;
|
|
505
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
506
|
+
}
|
|
507
|
+
`,iee=`
|
|
508
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
509
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
510
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
511
|
+
vec2 q = abs(p) - b + cr.x;
|
|
512
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
513
|
+
}
|
|
514
|
+
`,see=`
|
|
515
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
516
|
+
p = abs( p ); // symmetry
|
|
517
|
+
|
|
518
|
+
// find root with Newton solver
|
|
519
|
+
vec2 q = ab*(p-ab);
|
|
520
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
521
|
+
for( int i=0; i<5; i++ ) {
|
|
522
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
523
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
524
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
525
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// compute final point and distance
|
|
529
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
530
|
+
|
|
531
|
+
// return signed distance
|
|
532
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
533
|
+
}
|
|
534
|
+
`,Gf={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Ep={IGNORE:1,USE_BB:2},L0=0,aA=1,iA=2,_0=3,bu=4,jv=5,Rf=6,Df=7,lee=(function(){function e(t,n,r){xl(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=IJ,this.atlasManager=new tee(t,r),this.batchManager=new nee(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Gf.SCREEN),this.pickingProgram=this._createShaderProgram(Gf.PICKING),this.vao=this._createVAO()}return bl(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
|
|
535
|
+
precision highp float;
|
|
536
|
+
|
|
537
|
+
uniform mat3 uPanZoomMatrix;
|
|
538
|
+
uniform int uAtlasSize;
|
|
539
|
+
|
|
540
|
+
// instanced
|
|
541
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
542
|
+
|
|
543
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
544
|
+
in int aVertType; // the type of thing we are rendering
|
|
545
|
+
|
|
546
|
+
// the z-index that is output when using picking mode
|
|
547
|
+
in vec4 aIndex;
|
|
548
|
+
|
|
549
|
+
// For textures
|
|
550
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
551
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
552
|
+
|
|
553
|
+
// for edges
|
|
554
|
+
in vec4 aPointAPointB;
|
|
555
|
+
in vec4 aPointCPointD;
|
|
556
|
+
in vec2 aLineWidth; // also used for node border width
|
|
557
|
+
|
|
558
|
+
// simple shapes
|
|
559
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
560
|
+
in vec4 aColor; // also used for edges
|
|
561
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
562
|
+
|
|
563
|
+
// output values passed to the fragment shader
|
|
564
|
+
out vec2 vTexCoord;
|
|
565
|
+
out vec4 vColor;
|
|
566
|
+
out vec2 vPosition;
|
|
567
|
+
// flat values are not interpolated
|
|
568
|
+
flat out int vAtlasId;
|
|
569
|
+
flat out int vVertType;
|
|
570
|
+
flat out vec2 vTopRight;
|
|
571
|
+
flat out vec2 vBotLeft;
|
|
572
|
+
flat out vec4 vCornerRadius;
|
|
573
|
+
flat out vec4 vBorderColor;
|
|
574
|
+
flat out vec2 vBorderWidth;
|
|
575
|
+
flat out vec4 vIndex;
|
|
576
|
+
|
|
577
|
+
void main(void) {
|
|
578
|
+
int vid = gl_VertexID;
|
|
579
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
580
|
+
|
|
581
|
+
if(aVertType == `.concat(L0,`) {
|
|
582
|
+
float texX = aTex.x; // texture coordinates
|
|
583
|
+
float texY = aTex.y;
|
|
584
|
+
float texW = aTex.z;
|
|
585
|
+
float texH = aTex.w;
|
|
586
|
+
|
|
587
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
588
|
+
texX += texW;
|
|
589
|
+
}
|
|
590
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
591
|
+
texY += texH;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
float d = float(uAtlasSize);
|
|
595
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
596
|
+
|
|
597
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
598
|
+
}
|
|
599
|
+
else if(aVertType == `).concat(bu," || aVertType == ").concat(Df,`
|
|
600
|
+
|| aVertType == `).concat(jv," || aVertType == ").concat(Rf,`) { // simple shapes
|
|
601
|
+
|
|
602
|
+
// the bounding box is needed by the fragment shader
|
|
603
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
604
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
605
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
606
|
+
|
|
607
|
+
// calculations are done in the fragment shader, just pass these along
|
|
608
|
+
vColor = aColor;
|
|
609
|
+
vCornerRadius = aCornerRadius;
|
|
610
|
+
vBorderColor = aBorderColor;
|
|
611
|
+
vBorderWidth = aLineWidth;
|
|
612
|
+
|
|
613
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
614
|
+
}
|
|
615
|
+
else if(aVertType == `).concat(aA,`) {
|
|
616
|
+
vec2 source = aPointAPointB.xy;
|
|
617
|
+
vec2 target = aPointAPointB.zw;
|
|
618
|
+
|
|
619
|
+
// adjust the geometry so that the line is centered on the edge
|
|
620
|
+
position.y = position.y - 0.5;
|
|
621
|
+
|
|
622
|
+
// stretch the unit square into a long skinny rectangle
|
|
623
|
+
vec2 xBasis = target - source;
|
|
624
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
625
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
626
|
+
|
|
627
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
628
|
+
vColor = aColor;
|
|
629
|
+
}
|
|
630
|
+
else if(aVertType == `).concat(iA,`) {
|
|
631
|
+
vec2 pointA = aPointAPointB.xy;
|
|
632
|
+
vec2 pointB = aPointAPointB.zw;
|
|
633
|
+
vec2 pointC = aPointCPointD.xy;
|
|
634
|
+
vec2 pointD = aPointCPointD.zw;
|
|
635
|
+
|
|
636
|
+
// adjust the geometry so that the line is centered on the edge
|
|
637
|
+
position.y = position.y - 0.5;
|
|
638
|
+
|
|
639
|
+
vec2 p0, p1, p2, pos;
|
|
640
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
641
|
+
p0 = pointA;
|
|
642
|
+
p1 = pointB;
|
|
643
|
+
p2 = pointC;
|
|
644
|
+
pos = position;
|
|
645
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
646
|
+
p0 = pointD;
|
|
647
|
+
p1 = pointC;
|
|
648
|
+
p2 = pointB;
|
|
649
|
+
pos = vec2(0.0, -position.y);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
vec2 p01 = p1 - p0;
|
|
653
|
+
vec2 p12 = p2 - p1;
|
|
654
|
+
vec2 p21 = p1 - p2;
|
|
655
|
+
|
|
656
|
+
// Find the normal vector.
|
|
657
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
658
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
659
|
+
|
|
660
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
661
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
662
|
+
|
|
663
|
+
// Determine the bend direction.
|
|
664
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
665
|
+
float width = aLineWidth[0];
|
|
666
|
+
|
|
667
|
+
if(sign(pos.y) == -sigma) {
|
|
668
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
669
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
670
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
671
|
+
} else {
|
|
672
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
673
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
674
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
vColor = aColor;
|
|
678
|
+
}
|
|
679
|
+
else if(aVertType == `).concat(_0,` && vid < 3) {
|
|
680
|
+
// massage the first triangle into an edge arrow
|
|
681
|
+
if(vid == 0)
|
|
682
|
+
position = vec2(-0.15, -0.3);
|
|
683
|
+
if(vid == 1)
|
|
684
|
+
position = vec2( 0.0, 0.0);
|
|
685
|
+
if(vid == 2)
|
|
686
|
+
position = vec2( 0.15, -0.3);
|
|
687
|
+
|
|
688
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
689
|
+
vColor = aColor;
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
vAtlasId = aAtlasId;
|
|
696
|
+
vVertType = aVertType;
|
|
697
|
+
vIndex = aIndex;
|
|
698
|
+
}
|
|
699
|
+
`),i=this.batchManager.getIndexArray(),l=`#version 300 es
|
|
700
|
+
precision highp float;
|
|
701
|
+
|
|
702
|
+
// declare texture unit for each texture atlas in the batch
|
|
703
|
+
`.concat(i.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(`
|
|
704
|
+
`),`
|
|
705
|
+
|
|
706
|
+
uniform vec4 uBGColor;
|
|
707
|
+
uniform float uZoom;
|
|
708
|
+
|
|
709
|
+
in vec2 vTexCoord;
|
|
710
|
+
in vec4 vColor;
|
|
711
|
+
in vec2 vPosition; // model coordinates
|
|
712
|
+
|
|
713
|
+
flat in int vAtlasId;
|
|
714
|
+
flat in vec4 vIndex;
|
|
715
|
+
flat in int vVertType;
|
|
716
|
+
flat in vec2 vTopRight;
|
|
717
|
+
flat in vec2 vBotLeft;
|
|
718
|
+
flat in vec4 vCornerRadius;
|
|
719
|
+
flat in vec4 vBorderColor;
|
|
720
|
+
flat in vec2 vBorderWidth;
|
|
721
|
+
|
|
722
|
+
out vec4 outColor;
|
|
723
|
+
|
|
724
|
+
`).concat(ree,`
|
|
725
|
+
`).concat(aee,`
|
|
726
|
+
`).concat(iee,`
|
|
727
|
+
`).concat(see,`
|
|
728
|
+
|
|
729
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
730
|
+
return vec4(
|
|
731
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
732
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
737
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
738
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
739
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
void main(void) {
|
|
743
|
+
if(vVertType == `).concat(L0,`) {
|
|
744
|
+
// look up the texel from the texture unit
|
|
745
|
+
`).concat(i.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
|
|
746
|
+
else `),`
|
|
747
|
+
}
|
|
748
|
+
else if(vVertType == `).concat(_0,`) {
|
|
749
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
750
|
+
outColor = blend(vColor, uBGColor);
|
|
751
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
752
|
+
}
|
|
753
|
+
else if(vVertType == `).concat(bu,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
754
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
755
|
+
}
|
|
756
|
+
else if(vVertType == `).concat(bu," || vVertType == ").concat(Df,`
|
|
757
|
+
|| vVertType == `).concat(jv," || vVertType == ").concat(Rf,`) { // use SDF
|
|
758
|
+
|
|
759
|
+
float outerBorder = vBorderWidth[0];
|
|
760
|
+
float innerBorder = vBorderWidth[1];
|
|
761
|
+
float borderPadding = outerBorder * 2.0;
|
|
762
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
763
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
764
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
765
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
766
|
+
|
|
767
|
+
float d; // signed distance
|
|
768
|
+
if(vVertType == `).concat(bu,`) {
|
|
769
|
+
d = rectangleSD(p, b);
|
|
770
|
+
} else if(vVertType == `).concat(Df,` && w == h) {
|
|
771
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
772
|
+
} else if(vVertType == `).concat(Df,`) {
|
|
773
|
+
d = ellipseSD(p, b);
|
|
774
|
+
} else {
|
|
775
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
779
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
780
|
+
if(d > 0.0) {
|
|
781
|
+
if(d > outerBorder) {
|
|
782
|
+
discard;
|
|
783
|
+
} else {
|
|
784
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
785
|
+
}
|
|
786
|
+
} else {
|
|
787
|
+
if(d > innerBorder) {
|
|
788
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
789
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
790
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
vec4 outerColor;
|
|
794
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
795
|
+
outerColor = vec4(0);
|
|
796
|
+
} else if(innerBorder == 0.0) {
|
|
797
|
+
outerColor = vBorderColor;
|
|
798
|
+
} else {
|
|
799
|
+
outerColor = blend(vBorderColor, vColor);
|
|
800
|
+
}
|
|
801
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
outColor = vColor;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
`).concat(n.picking?`if(outColor.a == 0.0) discard;
|
|
810
|
+
else outColor = vIndex;`:"",`
|
|
811
|
+
}
|
|
812
|
+
`),o=zJ(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),KJ(a,"vec2",i.aPosition,n),this.transformBuffer=YJ(a,r,i.aTransform),this.indexBuffer=Ja(a,r,"vec4",i.aIndex),this.vertTypeBuffer=Ja(a,r,"int",i.aVertType),this.atlasIdBuffer=Ja(a,r,"int",i.aAtlasId),this.texBuffer=Ja(a,r,"vec4",i.aTex),this.pointAPointBBuffer=Ja(a,r,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Ja(a,r,"vec4",i.aPointCPointD),this.lineWidthBuffer=Ja(a,r,"vec2",i.aLineWidth),this.colorBuffer=Ja(a,r,"vec4",i.aColor),this.cornerRadiusBuffer=Ja(a,r,"vec4",i.aCornerRadius),this.borderColorBuffer=Ja(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 Zs(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]:Gf.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===Ep.IGNORE)return;if(f==Ep.USE_BB){this.drawPickingRectangle(n,r,a);return}}var c=i.getAtlasInfo(n,a),d=Vr(c),p;try{for(d.s();!(p=d.n()).done;){var m=p.value,y=m.atlas,x=m.tex1,b=m.tex2;l.canAddToCurrentBatch(y)||this.endBatch();for(var S=l.getAtlasIndexForBatch(y),w=0,C=[[x,!0],[b,!1]];w<C.length;w++){var T=Ln(C[w],2),k=T[0],R=T[1];if(k.w!=0){var A=this.instanceCount;this.vertTypeBuffer.getView(A)[0]=L0;var D=this.indexBuffer.getView(A);xu(r,D);var L=this.atlasIdBuffer.getView(A);L[0]=S;var P=this.texBuffer.getView(A);P[0]=k.x,P[1]=k.y,P[2]=k.w,P[3]=k.h;var M=this.transformBuffer.getMatrixView(A);this.setTransformMatrix(n,M,o,m,R),this.instanceCount++,R||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(_){d.e(_)}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,p=c.w/(c.w+d.w);l||(p=1-p);var m=this._getAdjustedBB(f,o,l,p);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;nA(n);var f=a.getRotation?a.getRotation(i):0;if(f!==0){var c=a.getRotationPoint(i),d=c.x,p=c.y;Xv(n,n,[d,p]),rA(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;Xv(n,n,[l,o]),e1(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 p=0,m=f*i;return a&&i<1?f=m:!a&&i<1&&(p=f-m,l+=p,f=m),{x1:l,y1:o,w:f,h:c,xOffset:p,yOffset:d}}},{key:"drawPickingRectangle",value:function(n,r,a){var i=this.atlasManager.getRenderTypeOpts(a),l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=bu;var o=this.indexBuffer.getView(l);xu(r,o);var f=this.colorBuffer.getView(l);Hl([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===jv||o===Rf){var c=i.getBoundingBox(n),d=this._getCornerRadius(n,l.radius,c),p=this.cornerRadiusBuffer.getView(f);p[0]=d,p[1]=d,p[2]=d,p[3]=d,o===Rf&&(p[0]=0,p[2]=0)}var m=this.indexBuffer.getView(f);xu(r,m);var y=n.pstyle(l.color).value,x=n.pstyle(l.opacity).value,b=this.colorBuffer.getView(f);Hl(y,x,b);var S=this.lineWidthBuffer.getView(f);if(S[0]=0,S[1]=0,l.border){var w=n.pstyle("border-width").value;if(w>0){var C=n.pstyle("border-color").value,T=n.pstyle("border-opacity").value,k=this.borderColorBuffer.getView(f);Hl(C,T,k);var R=n.pstyle("border-position").value;if(R==="inside")S[0]=0,S[1]=-w;else if(R==="outside")S[0]=w,S[1]=0;else{var A=w/2;S[0]=A,S[1]=-A}}}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 bu;case"ellipse":return Df;case"roundrectangle":case"round-rectangle":return jv;case"bottom-round-rectangle":return Rf;default:return}}},{key:"_getCornerRadius",value:function(n,r,a){var i=a.w,l=a.h;if(n.pstyle(r).value==="auto")return dl(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,p=n.pstyle("opacity").value,m=n.pstyle("line-opacity").value,y=p*m,x=n.pstyle("width").pfValue,b=n.pstyle("arrow-scale").value,S=this.r.getArrowWidth(x,b),w=this.instanceCount,C=this.transformBuffer.getMatrixView(w);nA(C),Xv(C,C,[l,o]),e1(C,C,[S,S]),rA(C,C,f),this.vertTypeBuffer.getView(w)[0]=_0;var T=this.indexBuffer.getView(w);xu(r,T);var k=this.colorBuffer.getView(w);Hl(d,y,k),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]=aA;var p=this.indexBuffer.getView(d);xu(r,p);var m=this.colorBuffer.getView(d);Hl(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 b=0;b<a.length-2;b+=2){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=iA;var w=this.indexBuffer.getView(S);xu(r,w);var C=this.colorBuffer.getView(S);Hl(f,c,C);var T=this.lineWidthBuffer.getView(S);T[0]=o;var k=a[b-2],R=a[b-1],A=a[b],D=a[b+1],L=a[b+2],P=a[b+3],M=a[b+4],_=a[b+5];b==0&&(k=2*A-L+.001,R=2*D-P+.001),b==a.length-4&&(M=2*L-A+.001,_=2*P-D+.001);var B=this.pointAPointBBuffer.getView(S);B[0]=k,B[1]=R,B[2]=A,B[3]=D;var q=this.pointCPointDBuffer.getView(S);q[0]=L,q[1]=P,q[2]=M,q[3]=_,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=Vr(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(),p=0;p<d.length;p++)d[p].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,FJ(this.r)),n.uniformMatrix3fv(l.uPanZoomMatrix,!1,this.panZoomMatrix),n.uniform1i(l.uAtlasSize,this.batchManager.getAtlasSize());var y=Hl(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}}}])})(),E_={};E_.initWebgl=function(e,t){var n=this,r=n.data.contexts[n.WEBGL];e.bgColor=oee(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=XJ(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new lee(n,r,e);var a=function(p){return function(m){return n.getTextAngle(m,p)}},i=function(p){return function(m){var y=m.pstyle(p);return y&&y.value}},l=function(p){return function(m){return m.pstyle("".concat(p,"-opacity")).value>0}},o=function(p){var m=p.pstyle("text-events").strValue==="yes";return m?Ep.USE_BB:Ep.IGNORE},f=function(p){var m=p.position(),y=m.x,x=m.y,b=p.outerWidth(),S=p.outerHeight();return{w:b,h:S,x1:y-b/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:qJ,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:B0(t.getLabelKey,null),getBoundingBox:P0(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:B0(t.getSourceLabelKey,"source"),getBoundingBox:P0(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:B0(t.getTargetLabelKey,"target"),getBoundingBox:P0(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:a("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:i("target-label")});var c=Bd(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(d,p){var m=!1;p&&p.length>0&&(m|=n.drawing.invalidate(p)),m&&c()}),uee(n)};function oee(e){var t=e.cy.container(),n=t&&t.style&&t.style.backgroundColor||"white";return WO(n)}function C_(e,t){var n=e._private.rscratch;return Fr(n,"labelWrapCachedLines",t)||[]}var B0=function(t,n){return function(r){var a=t(r),i=C_(r,n);return i.length>1?i.map(function(l,o){return"".concat(a,"_").concat(o)}):a}},P0=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=C_(r,n),c=i.h/f.length,d=c*o,p=i.y1+d;return{x1:i.x1,w:i.w,y1:p,h:c,yOffset:d}}}return i}};function uee(e){{var t=e.render;e.render=function(i){i=i||{};var l=e.cy;e.webgl&&(l.zoom()>m_?(cee(e),t.call(e,i)):(fee(e),N_(e,i,Gf.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 gee(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 cee(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function fee(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 dee(e){var t=e.canvasWidth,n=e.canvasHeight,r=Vw(e),a=r.pan,i=r.zoom,l=O0();Xv(l,l,[a.x,a.y]),e1(l,l,[i,i]);var o=O0();WJ(o,t,n);var f=O0();return QJ(f,o,l),f}function T_(e,t){var n=e.canvasWidth,r=e.canvasHeight,a=Vw(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 hee(e,t){e.drawSelectionRectangle(t,function(n){return T_(e,n)})}function vee(e){var t=e.data.contexts[e.NODE];t.save(),T_(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 pee(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 p=c[d],m=p.canvas;if(m){var y=m.width,x=m.height,b=y*d,S=m.height*l,w=.4;f.save(),f.scale(w,w),f.drawImage(m,b,S),f.strokeStyle="black",f.rect(b,S,y,x),f.stroke(),f.restore()}}},n=0;t(e.drawing,"node",n++),t(e.drawing,"label",n++)}function mee(e,t,n,r,a){var i,l,o,f,c=Vw(e),d=c.pan,p=c.zoom;{var m=UJ(e,d,p,t,n),y=Ln(m,2),x=y[0],b=y[1],S=6;i=x-S/2,l=b-S/2,o=S,f=S}if(o===0||f===0)return[];var w=e.data.contexts[e.WEBGL];w.bindFramebuffer(w.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(w.viewport(0,0,w.canvas.width,w.canvas.height),N_(e,null,Gf.PICKING),e.pickingFrameBuffer.needsDraw=!1);var C=o*f,T=new Uint8Array(C*4);w.readPixels(i,l,o,f,w.RGBA,w.UNSIGNED_BYTE,T),w.bindFramebuffer(w.FRAMEBUFFER,null);for(var k=new Set,R=0;R<C;R++){var A=T.slice(R*4,R*4+4),D=HJ(A)-1;D>=0&&k.add(D)}return k}function gee(e,t,n){var r=mee(e,t,n),a=e.getCachedZSortedEles(),i,l,o=Vr(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(p){o.e(p)}finally{o.f()}return[i,l].filter(Boolean)}function z0(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 N_(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]&&hee(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=dee(e),f=e.getCachedZSortedEles();if(i=f.length,a.startFrame(o,n),n.screen){for(var c=0;c<f.nondrag.length;c++)z0(e,c,f.nondrag[c]);for(var d=0;d<f.drag.length;d++)z0(e,d,f.drag[d])}else if(n.picking)for(var p=0;p<f.length;p++)z0(e,p,f[p]);a.endFrame(),n.screen&&e.webglDebugShowAtlases&&(vee(e),pee(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),b=a.getDebugInfo(),S=["".concat(i," elements"),"".concat(b.totalInstances," instances"),"".concat(b.batchCount," batches"),"".concat(b.totalAtlases," atlases"),"".concat(b.wrappedCount," wrapped textures"),"".concat(b.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 w=b.atlasInfo,C=Vr(w),T;try{for(C.s();!(T=C.n()).done;){var k=T.value;console.log(" ".concat(k.type,": ").concat(k.keyCount," keys, ").concat(k.atlasCount," atlases"))}}catch(R){C.e(R)}finally{C.f()}console.log("")}}e.data.gc&&(console.log("Garbage Collect!"),e.data.gc=!1,a.gc())}var El={};El.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()};El.drawRoundPolygonPath=function(e,t,n,r,a,i,l){l.forEach(function(o){return l_(e,o)}),e.closePath()};El.drawRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?dl(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()};El.drawBottomRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?dl(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()};El.drawCutRectanglePath=function(e,t,n,r,a,i,l){var o=r/2,f=a/2,c=l==="auto"?Aw():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()};El.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,p=Fb(r,a),m=p.widthOffset,y=p.heightOffset,x=p.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 sA=Math.sin(0),lA=Math.cos(0),t1={},n1={},k_=Math.PI/40;for(var wu=0*Math.PI;wu<2*Math.PI;wu+=k_)t1[wu]=Math.sin(wu),n1[wu]=Math.cos(wu);El.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+=k_)i=t-o*t1[c]*sA+o*n1[c]*lA,l=n+f*n1[c]*sA+f*t1[c]*lA,c===0?e.moveTo(i,l):e.lineTo(i,l);e.closePath()};var qd={};qd.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]};qd.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=Ae(e.maxWidth)||Ae(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,p=1/0;Ae(e.maxWidth)&&(d=c*e.maxWidth/i),Ae(e.maxHeight)&&(p=c*e.maxHeight/l),c=Math.min(d,p),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 b=t.pan(),S={x:b.x*c,y:b.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 yee(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 oA(e){var t=e.indexOf(",");return e.substr(t+1)}function j_(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new xc(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 yee(oA(r()),n);case"base64":return oA(r());case"base64uri":default:return r()}}qd.png=function(e){return j_(e,this.bufferCanvasImage(e),"image/png")};qd.jpg=function(e){return j_(e,this.bufferCanvasImage(e),"image/jpeg")};var A_={};A_.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 xee=R_,bt=R_.prototype;bt.CANVAS_LAYERS=3;bt.SELECT_BOX=0;bt.DRAG=1;bt.NODE=2;bt.WEBGL=3;bt.CANVAS_TYPES=["2d","2d","2d","webgl2"];bt.BUFFER_COUNT=3;bt.TEXTURE_BUFFER=0;bt.MOTIONBLUR_BUFFER_NODE=1;bt.MOTIONBLUR_BUFFER_DRAG=2;function R_(e){var t=this,n=t.cy.window(),r=n.document;e.webgl&&(bt.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:new Array(bt.CANVAS_LAYERS),contexts:new Array(bt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(bt.CANVAS_LAYERS),bufferCanvases:new Array(bt.BUFFER_COUNT),bufferContexts:new Array(bt.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"};hY()&&(f["-ms-touch-action"]="none",f["touch-action"]="none");for(var c=0;c<bt.CANVAS_LAYERS;c++){var d=t.data.canvases[c]=r.createElement("canvas"),p=bt.CANVAS_TYPES[c];t.data.contexts[c]=d.getContext(p),t.data.contexts[c]||un("Could not create canvas of type "+p),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(bt.CANVAS_LAYERS-c),t.data.canvasContainer.appendChild(d),t.data.canvasNeedsRedraw[c]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[bt.NODE].setAttribute("data-id","layer"+bt.NODE+"-node"),t.data.canvases[bt.SELECT_BOX].setAttribute("data-id","layer"+bt.SELECT_BOX+"-selectbox"),t.data.canvases[bt.DRAG].setAttribute("data-id","layer"+bt.DRAG+"-drag"),t.data.canvases[bt.WEBGL]&&t.data.canvases[bt.WEBGL].setAttribute("data-id","layer"+bt.WEBGL+"-webgl");for(var c=0;c<bt.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}},b=function(J){var ne=J[0]._private,re=ne.oldBackgroundTimestamp===ne.backgroundTimestamp;return!re},S=function(J){return J[0]._private.nodeKey},w=function(J){return J[0]._private.labelStyleKey},C=function(J){return J[0]._private.sourceLabelStyleKey},T=function(J){return J[0]._private.targetLabelStyleKey},k=function(J,ne,re,ge,Ne){return t.drawElement(J,ne,re,!1,!1,Ne)},R=function(J,ne,re,ge,Ne){return t.drawElementText(J,ne,re,ge,"main",Ne)},A=function(J,ne,re,ge,Ne){return t.drawElementText(J,ne,re,ge,"source",Ne)},D=function(J,ne,re,ge,Ne){return t.drawElementText(J,ne,re,ge,"target",Ne)},L=function(J){return J.boundingBox(),J[0]._private.bodyBounds},P=function(J){return J.boundingBox(),J[0]._private.labelBounds.main||m},M=function(J){return J.boundingBox(),J[0]._private.labelBounds.source||m},_=function(J){return J.boundingBox(),J[0]._private.labelBounds.target||m},B=function(J,ne){return ne},q=function(J){return y(L(J))},V=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}},G=function(J,ne,re){var ge=J[0]._private.rscratch;return{x:ge[ne],y:ge[re]}},F=function(J){return V("",G(J,"labelX","labelY"),J)},H=function(J){return V("source",G(J,"sourceLabelX","sourceLabelY"),J)},Y=function(J){return V("target",G(J,"targetLabelX","targetLabelY"),J)},Q=function(J){return x(L(J))},z=function(J){return x(M(J))},I=function(J){return x(_(J))},X=function(J){var ne=P(J),re=x(P(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 zf(t,{getKey:S,doesEleInvalidateKey:b,drawElement:k,getBoundingBox:L,getRotationPoint:q,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),te=t.data.lblTxrCache=new zf(t,{getKey:w,drawElement:R,getBoundingBox:P,getRotationPoint:F,getRotationOffset:X,isVisible:B}),ie=t.data.slbTxrCache=new zf(t,{getKey:C,drawElement:A,getBoundingBox:M,getRotationPoint:H,getRotationOffset:z,isVisible:B}),oe=t.data.tlbTxrCache=new zf(t,{getKey:T,drawElement:D,getBoundingBox:_,getRotationPoint:Y,getRotationOffset:I,isVisible:B}),ae=t.data.lyrTxrCache=new g_(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:w,getSourceLabelKey:C,getTargetLabelKey:T,drawElement:k,drawLabel:R,drawSourceLabel:A,drawTargetLabel:D,getElementBox:L,getLabelBox:P,getSourceLabelBox:M,getTargetLabelBox:_,getElementRotationPoint:q,getElementRotationOffset:Q,getLabelRotationPoint:F,getSourceLabelRotationPoint:H,getTargetLabelRotationPoint:Y,getLabelRotationOffset:X,getSourceLabelRotationOffset:z,getTargetLabelRotationOffset:I})}bt.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[bt.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[bt.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[bt.SELECT_BOX]=t;break;case"gc":n.data.gc=!0;break}};var bee=typeof Path2D<"u";bt.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e};bt.usePaths=function(){return bee&&this.pathsEnabled};bt.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)};bt.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled};bt.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":Un(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};[y_,xi,is,qw,No,Sl,jr,E_,El,qd,A_].forEach(function(e){at(bt,e)});var wee=[{name:"null",impl:a_},{name:"base",impl:v_},{name:"canvas",impl:xee}],See=[{type:"layout",extensions:KZ},{type:"renderer",extensions:wee}],D_={},M_={};function O_(e,t,n){var r=n,a=function(L){Pt("Can not register `"+t+"` for `"+e+"` since `"+L+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(ld.prototype[t])return a(t);ld.prototype[t]=n}else if(e==="collection"){if(or.prototype[t])return a(t);or.prototype[t]=n}else if(e==="layout"){for(var i=function(L){this.options=L,n.call(this,L),Dt(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 P=0;P<L.length;P++)L[P].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 p=function(L){return L._private.cy},m={addEventFields:function(L,P){P.layout=L,P.cy=p(L),P.target=L},bubble:function(){return!0},parent:function(L){return p(L)}};at(l,{createEmitter:function(){return this._private.emitter=new sm(m,this),this},emitter:function(){return this._private.emitter},on:function(L,P){return this.emitter().on(L,P),this},one:function(L,P){return this.emitter().one(L,P),this},once:function(L,P){return this.emitter().one(L,P),this},removeListener:function(L,P){return this.emitter().removeListener(L,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(L,P){return this.emitter().emit(L,P),this}}),Bt.eventAliasesOn(l),r=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var y=L_("renderer","base"),x=y.prototype,b=n,S=n.prototype,w=function(){y.apply(this,arguments),b.apply(this,arguments)},C=w.prototype;for(var T in x){var k=x[T],R=S[T]!=null;if(R)return a(T);C[T]=k}for(var A in S)C[A]=S[A];x.clientFunctions.forEach(function(D){C[D]=C[D]||function(){un("Renderer does not implement `renderer."+D+"()` on its prototype")}}),r=w}else if(e==="__proto__"||e==="constructor"||e==="prototype")return un(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return ZO({map:D_,keys:[e,t],value:r})}function L_(e,t){return JO({map:D_,keys:[e,t]})}function Eee(e,t,n,r,a){return ZO({map:M_,keys:[e,t,n,r],value:a})}function Cee(e,t,n,r){return JO({map:M_,keys:[e,t,n,r]})}var r1=function(){if(arguments.length===2)return L_.apply(null,arguments);if(arguments.length===3)return O_.apply(null,arguments);if(arguments.length===4)return Cee.apply(null,arguments);if(arguments.length===5)return Eee.apply(null,arguments);un("Invalid extension access syntax")};ld.prototype.extension=r1;See.forEach(function(e){e.extensions.forEach(function(t){O_(e.type,t.name,t.impl)})});var Cp=function(){if(!(this instanceof Cp))return new Cp;this.length=0},So=Cp.prototype;So.instanceString=function(){return"stylesheet"};So.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this};So.css=function(e,t){var n=this.length-1;if(tt(e))this[n].properties.push({name:e,value:t});else if(Dt(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=Zn.properties[l]||Zn.properties[Qp(l)];if(f!=null){var c=f.name,d=o;this[n].properties.push({name:c,value:d})}}}return this};So.style=So.css;So.generateStyle=function(e){var t=new Zn(e);return this.appendToStyle(t)};So.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 Tee="3.33.1",Eo=function(t){if(t===void 0&&(t={}),Dt(t))return new ld(t);if(tt(t))return r1.apply(r1,arguments)};Eo.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(Eo),e.apply(null,t),this};Eo.warnings=function(e){return sL(e)};Eo.version=Tee;Eo.stylesheet=Eo.Stylesheet=Cp;const ir={sage:"#abcfb8",ochre:"#edbf7f",terracotta:"#ffb4a1",neutral:"#8b928c",dimNeutral:"#6e7370",onSurface:"#e5e2e1",surface:"#111111"},Nee={concept:ir.sage,component:ir.ochre,bug:ir.terracotta,tool:ir.neutral,file:ir.neutral,spore:ir.sage,session:ir.ochre,other:ir.dimNeutral},kee=ir.dimNeutral,uA=24,jee=60,Aee=12,Ree=10,Dee=8,I0=1.5,Av=.25,F0=.7,Mee=9,Oee=.7,Lee=4,_ee=.6,Bee=1e4,Pee=120,zee=.2,Iee=600,U0=50,cA=20,fA={concept:"Concept",component:"Component",bug:"Bug",tool:"Tool",file:"File",spore:"Spore",session:"Session",other:"Other"};function Fee(e){const t=Math.min(e/Aee,1);return uA+t*(jee-uA)}function Uee(e){return e.length<=cA?e:e.slice(0,cA-1)+"…"}function dA(e){return Nee[e==null?void 0:e.toLowerCase()]??kee}function qee({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 b;const x=fA[(b=y.type)==null?void 0:b.toLowerCase()]??fA.other;return{data:{id:y.id,label:`${Uee(y.name)}
|
|
813
|
+
${x}`,fullLabel:y.name,type:y.type,degree:f.get(y.id)??0,nodeSize:Fee(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 p=Eo({container:r.current,elements:c,style:[{selector:"node",style:{label:"data(label)","background-color":y=>dA(y.data("type")),"background-opacity":.9,color:ir.onSurface,"font-size":Ree,"font-family":"Inter, system-ui, sans-serif","text-valign":"bottom","text-margin-y":Dee,"text-outline-color":ir.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":ir.sage,"border-opacity":0,"overlay-opacity":0}},{selector:"node:active",style:{"overlay-opacity":.08,"overlay-color":ir.sage}},{selector:"node:selected",style:{"border-width":Lee,"border-color":y=>dA(y.data("type")),"border-opacity":_ee,"background-opacity":1}},{selector:"edge",style:{width:I0,"line-color":ir.neutral,"line-opacity":Av,"curve-style":"unbundled-bezier","control-point-distances":[40],"control-point-weights":[.5],"target-arrow-shape":"triangle","target-arrow-color":ir.neutral,"arrow-scale":Oee,label:"data(label)","font-size":Mee,"font-family":"Inter, system-ui, sans-serif",color:ir.neutral,"text-opacity":0,"text-rotation":"autorotate","text-margin-y":-8,"text-outline-color":ir.surface,"text-outline-width":2,"text-outline-opacity":.7}},{selector:"edge:active",style:{"text-opacity":1,"line-opacity":F0}},{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=p.layout({name:"cose",animate:!0,animationDuration:Iee,nodeRepulsion:()=>Bee,idealEdgeLength:()=>Pee,gravity:zee,nodeDimensionsIncludeLabels:!0,fit:!0,padding:U0});return m.on("layoutstop",()=>{const y=p.nodes().maxDegree(!1);y.degree(!1)>2&&p.nodes().length>20?p.animate({center:{eles:y},zoom:1.2,duration:300,easing:"ease-out"}):p.fit(void 0,U0)}),m.run(),p.on("tap","node",y=>{var C;const x=y.target,b=x.data();p.elements().removeClass("faded");const S=x.closedNeighborhood();p.elements().not(S).addClass("faded"),x.connectedEdges().style({"line-opacity":F0,"text-opacity":.9,width:2});const w=o.get(b.id);(C=i.current)==null||C.call(i,w??{id:b.id,name:b.fullLabel??b.label,type:b.type})}),p.on("tap",y=>{var x;y.target===p&&(p.elements().removeClass("faded"),p.edges().style({"line-opacity":Av,"text-opacity":0,width:I0}),(x=i.current)==null||x.call(i,null))}),p.on("mouseover","edge",y=>{y.target.style("text-opacity",1),y.target.style("line-opacity",F0)}),p.on("mouseout","edge",y=>{const x=p.$("node:selected");x.length>0&&x.connectedEdges().contains(y.target)||(y.target.style("text-opacity",0),y.target.style("line-opacity",Av))}),a.current=p,()=>{p.destroy(),a.current=null}},[e,t]);const l=j.useCallback(()=>{const o=a.current;o&&(o.elements().removeClass("faded"),o.edges().style({"line-opacity":Av,"text-opacity":0,width:I0}),o.fit(void 0,U0))},[]);return{containerRef:r,resetView:l}}function Vee({nodes:e,edges:t,onNodeSelect:n}){const{containerRef:r,resetView:a}=qee({nodes:e,edges:t,onNodeSelect:n});return v.jsxs("div",{className:"absolute inset-0",children:[v.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"}}),v.jsx("div",{ref:r,className:"absolute inset-0 rounded-md"}),v.jsx("div",{className:"absolute top-3 right-3 z-10 flex items-center gap-2",children:v.jsxs(ze,{variant:"ghost",size:"sm",onClick:a,className:"gap-1.5",children:[v.jsx(w1,{className:"h-3.5 w-3.5"}),"Reset"]})}),e.length>0&&v.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:[v.jsxs("span",{children:[e.length," nodes"]}),v.jsxs("span",{children:[t.length," edges"]})]}),e.length===0&&v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No nodes to display"})})]})}const hA=[{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"}],Hee=[{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 Gee({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((p,m)=>p+m,0),d=hA.length-t.size;return v.jsxs("div",{className:"absolute top-3 left-3 z-10",children:[!o&&v.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:[v.jsx(sz,{className:"h-3.5 w-3.5"}),v.jsx("span",{className:"font-sans text-xs font-medium",children:"Filters"}),d>0&&v.jsx("span",{className:"font-mono text-[10px] bg-primary/20 text-primary rounded-full px-1.5 py-0.5 leading-none",children:d}),v.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/50",children:c})]}),o&&v.jsxs("div",{className:"w-52 rounded-md bg-surface-container/95 backdrop-blur-md shadow-lg border border-outline-variant/20 overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-outline-variant/10",children:[v.jsx("span",{className:"font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",children:"Filters"}),v.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:v.jsx(sc,{className:"h-3.5 w-3.5"})})]}),v.jsxs("div",{className:"p-3 space-y-4",children:[v.jsxs("div",{className:"relative",children:[v.jsx(ic,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-on-surface-variant/50"}),v.jsx(vn,{placeholder:"Search nodes...",value:r,onChange:p=>a(p.target.value),className:"text-xs pl-7 h-7"})]}),v.jsx("div",{className:"space-y-1",children:hA.map(p=>{const m=e[p.type]??0,y=t.has(p.type);return v.jsxs("label",{className:"flex items-center gap-2 py-1 cursor-pointer group",children:[v.jsx("input",{type:"checkbox",checked:y,onChange:()=>n(p.type),className:"sr-only"}),v.jsx("div",{className:je("h-3 w-3 rounded-sm flex items-center justify-center transition-colors",y?"bg-surface-container-high":"bg-surface-container-lowest"),children:y&&v.jsx("div",{className:je("h-1.5 w-1.5 rounded-full",p.dotColor)})}),v.jsx("span",{className:je("font-sans text-xs transition-colors",y?"text-on-surface":"text-on-surface-variant/50"),children:p.label}),v.jsx("span",{className:"ml-auto font-mono text-[10px] text-on-surface-variant/50",children:m})]},p.type)})}),i&&l&&v.jsxs("div",{className:"space-y-1 pt-1 border-t border-outline-variant/10",children:[v.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant/60 pt-1",children:"Edges"}),Hee.map(p=>{const m=i.has(p.type);return v.jsxs("label",{className:"flex items-center gap-2 py-0.5 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:()=>l(p.type),className:"sr-only"}),v.jsx("div",{className:je("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&&v.jsx("div",{className:"h-1 w-1 rounded-full bg-outline"})}),v.jsx("span",{className:je("font-sans text-[11px] transition-colors",m?"text-on-surface-variant":"text-on-surface-variant/40"),children:p.label})]},p.type)})]})]})]})]})}const vA=400,$ee={concept:"default",component:"warning",bug:"destructive",tool:"secondary",file:"secondary",spore:"default",session:"warning"},pA={concept:"bg-primary",component:"bg-secondary",bug:"bg-tertiary",tool:"bg-outline",file:"bg-outline",spore:"bg-primary",session:"bg-secondary"};function Is({label:e,value:t}){return v.jsxs("div",{className:"flex justify-between items-baseline py-1",children:[v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:e}),v.jsx("span",{className:"font-mono text-xs text-on-surface text-right max-w-[160px] truncate",children:t})]})}function mA(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function Kee({node:e,edges:t,nodes:n,metadata:r,markdownPreview:a,connectedSpores:i,onClose:l,onNodeSelect:o}){const f=ts();if(!e)return null;const c=e.type.toLowerCase(),d=$ee[c]??"secondary",p=pA[c]??"bg-outline",m=new Map((n??[]).map(w=>[w.id,w])),y=[];for(const w of t??[])if(w.source_id===e.id){const C=m.get(w.target_id);C&&y.push({nodeId:C.id,nodeName:C.name,nodeType:C.type,edgeLabel:w.label??"connected",direction:"outgoing"})}else if(w.target_id===e.id){const C=m.get(w.source_id);C&&y.push({nodeId:C.id,nodeName:C.name,nodeType:C.type,edgeLabel:w.label??"connected",direction:"incoming"})}const x=a??e.content,b=x&&x.length>vA?x.slice(0,vA)+"…":x,S=e.type==="spore"?"Observation":e.type==="session"?"Summary":"Notes";return v.jsxs(Ze,{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:[v.jsx("div",{className:"p-4 pb-3",children:v.jsxs("div",{className:"flex items-start justify-between gap-2",children:[v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[v.jsx("div",{className:`h-2 w-2 rounded-full ${p} shrink-0`}),v.jsx(Ct,{variant:d,className:"text-[10px] uppercase",children:e.observation_type??e.type})]}),v.jsx("h2",{className:"font-serif text-lg text-on-surface leading-tight break-words",children:e.name}),mA(e)&&v.jsxs("button",{onClick:()=>f(mA(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:[v.jsxs("span",{children:["View ",e.type]}),v.jsx(Sd,{className:"h-3 w-3 group-hover:translate-x-0.5 transition-transform"})]})]}),l&&v.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:v.jsx(sc,{className:"h-4 w-4"})})]})}),v.jsx("div",{className:"h-px bg-surface-container-high/50"}),v.jsxs("div",{className:"px-4 py-3 space-y-0.5",children:[v.jsx(zt,{children:"Metadata"}),v.jsxs("div",{className:"mt-1.5",children:[v.jsx(Is,{label:"Type",value:e.observation_type??e.type}),v.jsx(Is,{label:"ID",value:e.id.slice(0,12)+"…"}),e.status&&v.jsx(Is,{label:"Status",value:e.status}),e.created_at!=null&&v.jsx(Is,{label:"Created",value:new Date(e.created_at).toLocaleDateString()}),e.mention_count!=null&&e.mention_count>0&&v.jsx(Is,{label:"Mentions",value:String(e.mention_count)}),v.jsx(Is,{label:"Connections",value:String(y.length)}),e.depth!==void 0&&v.jsx(Is,{label:"Depth",value:String(e.depth)}),r&&Object.entries(r).map(([w,C])=>v.jsx(Is,{label:w,value:C},w))]})]}),b&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"h-px bg-surface-container-high/50"}),v.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[v.jsx(zt,{children:S}),v.jsx(Ze,{level:"lowest",className:"p-3 font-sans text-xs text-on-surface-variant whitespace-pre-wrap leading-relaxed",children:b})]})]}),y.length>0&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"h-px bg-surface-container-high/50"}),v.jsxs("div",{className:"px-4 py-3 space-y-2",children:[v.jsxs(zt,{children:["Connections (",y.length,")"]}),v.jsx("div",{className:"space-y-1",children:y.map((w,C)=>{const T=w.nodeType.toLowerCase(),k=pA[T]??"bg-outline",R=m.get(w.nodeId);return v.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:()=>R&&(o==null?void 0:o(R)),children:[v.jsx("div",{className:`h-2 w-2 rounded-full ${k} shrink-0`}),v.jsx("span",{className:"font-sans text-xs text-on-surface truncate flex-1 group-hover:text-primary transition-colors",children:w.nodeName}),v.jsx(ob,{className:`h-3 w-3 shrink-0 ${w.direction==="incoming"?"rotate-180":""} text-on-surface-variant/50`}),v.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 shrink-0 max-w-[80px] truncate",children:w.edgeLabel})]},`${w.nodeId}-${w.edgeLabel}-${C}`)})})]})]}),i&&i.length>0&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"h-px bg-surface-container-high/50"}),v.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[v.jsx(zt,{children:"Connected Spores"}),v.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(w=>v.jsx(Ct,{variant:"secondary",className:"cursor-pointer text-[10px] hover:bg-surface-container-highest transition-colors",children:w.name},w.id))})]})]})]})}const Yee=15e3,Xee=3e4,Qee=3e4,Wee=6e4;function Zee(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 cn({queryKey:["spores",e],queryFn:({signal:a})=>dt(r,{signal:a}),staleTime:Yee})}function Jee(e){return cn({queryKey:["spore",e],queryFn:({signal:t})=>dt(`/spores/${e}`,{signal:t}),enabled:e!==void 0,staleTime:Xee})}function ete(){return cn({queryKey:["full-graph"],queryFn:({signal:e})=>dt("/graph",{signal:e}),staleTime:Qee})}function tte(e){const t=e?`/digest?agent_id=${encodeURIComponent(e)}`:"/digest";return cn({queryKey:["digest",e],queryFn:({signal:n})=>dt(t,{signal:n}),staleTime:Wee})}function __(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 B_(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 oo(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}const gA=120,nte=1e3,rte=8,ate=[Fn,"gotcha","decision","discovery","trade_off","bug_fix"],ite=[Fn,"active","superseded","consolidated"],ste=[{key:"type",label:"Type",options:ate.map(e=>({value:e,label:e===Fn?"All types":oo(e)}))},{key:"status",label:"Status",options:ite.map(e=>({value:e,label:e===Fn?"All statuses":oo(e)}))}];function lte(e){return new Date(e*nte).toLocaleDateString()}function ote({spore:e,onClick:t,isSelected:n}){return v.jsx(Ze,{level:n?"high":"low",className:je("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":`${oo(e.observation_type)} spore: ${pb(e.content,gA)}`,"aria-pressed":n,children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[v.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[v.jsx("span",{className:je("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",__(e.observation_type)),children:oo(e.observation_type)}),v.jsx("span",{className:je("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",B_(e.status)),children:oo(e.status)}),e.importance!==null&&v.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.importance.toFixed(1)})]}),v.jsx("p",{className:"font-sans text-sm text-on-surface",children:pb(e.content,gA)})]}),v.jsxs("div",{className:"shrink-0 text-right space-y-1",children:[e.session_id&&v.jsx("div",{className:"font-mono text-xs text-on-surface-variant",children:e.session_id.slice(0,rte)}),v.jsx("div",{className:"font-sans text-xs text-on-surface-variant",children:lte(e.created_at)})]})]})})}function ute(){return v.jsx(Ze,{level:"low",className:"p-4 rounded-lg",children:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsxs("div",{className:"flex-1 space-y-2",children:[v.jsxs("div",{className:"flex gap-2",children:[v.jsx("div",{className:"h-5 w-16 animate-pulse rounded bg-surface-container"}),v.jsx("div",{className:"h-5 w-14 animate-pulse rounded bg-surface-container"})]}),v.jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-surface-container"})]}),v.jsxs("div",{className:"shrink-0 space-y-1",children:[v.jsx("div",{className:"h-3 w-14 animate-pulse rounded bg-surface-container"}),v.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-surface-container"})]})]})})}function cte({onSelectSpore:e,selectedSporeId:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=kd({initialFilters:{type:Fn,status:Fn}}),d=c("type"),p=c("status"),{data:m,isLoading:y,isError:x,error:b}=Zee({type:d,status:p,search:r,limit:qr,offset:i}),S=(m==null?void 0:m.spores)??[],w=(m==null?void 0:m.total)??0;return v.jsxs("div",{className:"space-y-3",children:[v.jsx(Nd,{searchPlaceholder:"Search spores...",searchValue:n,onSearchChange:o,filters:ste,filterValues:a,onFilterChange:f}),x?v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Failed to load spores"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:b instanceof Error?b.message:"Unknown error"})]}):v.jsx("div",{className:"space-y-2",children:y?[1,2,3,4,5].map(C=>v.jsx(ute,{},C)):S.length===0?v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[v.jsx(Ez,{className:"h-8 w-8 opacity-30"}),v.jsx("span",{className:"font-sans text-sm",children:w===0&&!r&&!d&&!p?"No spores yet":"No matching spores"}),w===0&&!r&&!d&&!p&&v.jsx("span",{className:"font-sans text-xs",children:"Spores are extracted from session activity by the agent"})]}):S.map(C=>v.jsx(ote,{spore:C,onClick:()=>e(C),isSelected:C.id===t},C.id))}),v.jsx(pc,{total:w,offset:i,limit:qr,onPageChange:l})]})}const fte=12,yA=8;function dte({type:e}){return v.jsx("span",{className:je("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",__(e)),children:oo(e)})}function hte({status:e}){return v.jsx("span",{className:je("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",B_(e)),children:oo(e)})}function Mf({label:e,value:t,children:n}){return v.jsxs("div",{className:"flex items-start justify-between gap-3 py-1.5",children:[v.jsx("span",{className:"shrink-0 font-sans text-xs text-on-surface-variant",children:e}),n??v.jsx("span",{className:"font-mono text-xs text-on-surface text-right break-all",children:t})]})}function vte({id:e,onBack:t,onNavigateToSpore:n,onNavigateToGraph:r}){const a=ts(),{data:i,isLoading:l,isError:o,error:f}=Jee(e);if(l)return v.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[v.jsx(Wn,{className:"h-5 w-5 animate-spin"}),v.jsx("span",{className:"font-sans",children:"Loading spore..."})]});if(o||!i)return v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Spore not found"}),v.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 v.jsxs("div",{className:"space-y-6",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),"Spores"]}),v.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[v.jsx(dte,{type:i.observation_type}),v.jsx(hte,{status:i.status}),i.importance!==null&&v.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Importance: ",v.jsx("span",{className:"text-on-surface font-medium",children:i.importance.toFixed(1)})]}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant ml-auto",children:hi(i.created_at)})]}),v.jsxs(Ze,{level:"low",className:"p-5",children:[v.jsx(zt,{className:"mb-2",children:"Observation"}),v.jsx(Ra,{content:i.content})]}),i.context&&v.jsxs(Ze,{level:"low",className:"p-5",children:[v.jsx(zt,{className:"mb-2",children:"Context"}),v.jsx(Ra,{content:i.context})]}),c.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map(d=>v.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)&&v.jsxs(Ze,{level:"low",className:"p-5 space-y-2",children:[v.jsx(zt,{children:"Resolution History"}),i.predecessor_id&&v.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[v.jsx("span",{children:"Supersedes"}),v.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,yA),v.jsx(ob,{className:"h-3 w-3"})]})]}),i.successor_id&&v.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[v.jsx("span",{children:"Superseded by"}),v.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,yA),v.jsx(ob,{className:"h-3 w-3"})]})]})]}),v.jsxs(Ze,{glass:!0,className:"p-5",children:[v.jsx(zt,{className:"mb-2",children:"Metadata"}),v.jsxs("div",{className:"text-sm",children:[v.jsx(Mf,{label:"ID",value:i.id}),v.jsx(Mf,{label:"Created",value:vb(i.created_at)}),v.jsx(Mf,{label:"Updated",value:vb(i.updated_at)}),i.session_id&&v.jsx(Mf,{label:"Session",children:v.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,fte),v.jsx(Sd,{className:"h-3 w-3"})]})}),i.agent_id&&v.jsx(Mf,{label:"Agent",value:i.agent_id})]})]})]})}const q0=200,pte={1500:"T1500 — Compact",5e3:"T5000 — Standard",1e4:"T10000 — Full"};function mte(e){return pte[e]??`T${e}`}function gte({tier:e}){const[t,n]=j.useState(!1),r=e.content.length>q0,a=r&&!t?e.content.slice(0,q0)+"…":e.content;return v.jsxs(Ze,{level:"low",className:"p-5 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[v.jsx("span",{className:"font-mono text-sm text-on-surface font-medium",children:mte(e.tier)}),v.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Generated ",hi(e.generated_at)]})]}),v.jsx(Ra,{content:a}),r&&v.jsx(ze,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-xs text-on-surface-variant",onClick:()=>n(!t),children:t?v.jsxs(v.Fragment,{children:[v.jsx(ZP,{className:"h-3 w-3"}),"Show less"]}):v.jsxs(v.Fragment,{children:[v.jsx(Ua,{className:"h-3 w-3"}),"Show more (",e.content.length-q0," more chars)"]})})]})}function yte(){return v.jsxs(Ze,{level:"low",className:"p-5",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-surface-container"}),v.jsx("div",{className:"h-3 w-20 animate-pulse rounded bg-surface-container"})]}),v.jsxs("div",{className:"space-y-2 mt-3",children:[v.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container"}),v.jsx("div",{className:"h-3 w-4/5 animate-pulse rounded bg-surface-container"}),v.jsx("div",{className:"h-3 w-3/5 animate-pulse rounded bg-surface-container"})]})]})}function xte({agentId:e}){const{data:t,isLoading:n,isError:r,error:a}=tte(e),i=(t==null?void 0:t.tiers)??[];return n?v.jsx("div",{className:"space-y-4",children:[1,2,3].map(l=>v.jsx(yte,{},l))}):r?v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Failed to load digest"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:a instanceof Error?a.message:"Unknown error"})]}):i.length===0?v.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[v.jsx(lz,{className:"h-8 w-8 opacity-30"}),v.jsx("span",{className:"font-sans text-sm",children:"No digest generated yet"}),v.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."})]}):v.jsxs("div",{className:"space-y-4",children:[v.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=>v.jsx(gte,{tier:l},l.tier))]})}const V0=new Set(["concept","component","bug","tool","file","spore","session","other"]),bte=[{id:"graph",label:"Graph"},{id:"spores",label:"Spores"},{id:"digest",label:"Digest"}],P_="tab",z_="spore",wte=new Set(["graph","spores","digest"]);function Ste(){const e=new URLSearchParams(window.location.search),t=e.get(P_),n=e.get(z_)??void 0;return{tab:n?"spores":t&&wte.has(t)?t:"graph",sporeId:n}}function Ete(e,t){const n=new URLSearchParams;e!=="graph"&&n.set(P_,e),t&&n.set(z_,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.replaceState(null,"",a)}function Cte(){const[e,t]=j.useState(new Set(V0)),[n,r]=j.useState(""),[a,i]=j.useState(null),{data:l}=ete(),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 b=x.type.toLowerCase(),S=V0.has(b)?b:"other";y[S]=(y[S]??0)+1}return y},[o]),c=j.useMemo(()=>{const y=n.toLowerCase();return o.filter(x=>{const b=x.type.toLowerCase(),S=V0.has(b)?b:"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(b=>b.id));return y.filter(b=>x.has(b.source_id)&&x.has(b.target_id))},[l==null?void 0:l.edges,c]),p=j.useCallback(y=>{t(x=>{const b=new Set(x);return b.has(y)?b.delete(y):b.add(y),b})},[]),m=j.useCallback(y=>{i(y)},[]);return v.jsxs("div",{className:"relative h-[calc(100vh-180px)]",children:[v.jsx(Vee,{nodes:c,edges:d,onNodeSelect:m,selectedNode:a}),v.jsx(Gee,{entityCounts:f,enabledTypes:e,onToggleType:p,searchQuery:n,onSearchChange:r}),v.jsx(Kee,{node:a,edges:d,nodes:c,onClose:()=>i(null),onNodeSelect:y=>i(y)})]})}function Tte(){const e=Ste(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.sporeId?{id:e.sporeId}:null);j.useEffect(()=>{Ete(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 v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsx(vi,{title:"Mycelium",subtitle:"Derived intelligence — spores, entity graph, and synthesized context.",tabs:bte,activeTab:t,onTabChange:c=>f(c)}),t==="graph"&&v.jsx(Cte,{}),t==="spores"&&(r?v.jsx(vte,{id:r.id,onBack:l,onNavigateToSpore:o}):v.jsx(cte,{onSelectSpore:i})),t==="digest"&&v.jsx(xte,{})]})}const Nte=[{value:Fn,label:"All statuses"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}];function kte({status:e}){const t=_D(e);return v.jsx("span",{className:je("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:I1(e)})}function jte(){return v.jsx("tr",{className:"border-b border-outline-variant/20",children:[200,80,100,80,80].map((e,t)=>v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:je("h-4 animate-pulse rounded bg-surface-container"),style:{width:e}})},t))})}function Ate({run:e,onClick:t,taskNameMap:n}){const r=e.task?n.get(e.task)??e.task:PD;return v.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:[v.jsx("td",{className:"px-4 py-3",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(xd,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),v.jsx("span",{className:"text-sm font-medium text-on-surface truncate max-w-xs",children:r})]})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx(kte,{status:e.status})}),v.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:Pp(e.started_at)}),v.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:Bp(e.started_at,e.completed_at)}),v.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:H1(e.tokens_used)}),v.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:V1(e.cost_usd)})]})}function Rte({onSelectRun:e,onTriggerRun:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=kd({initialFilters:{status:Fn,task:Fn}}),{data:d}=fc(),p=j.useMemo(()=>{const L=new Map;for(const P of(d==null?void 0:d.tasks)??[])L.set(P.name,P.displayName);return L},[d]),m=j.useMemo(()=>{const L=[{value:Fn,label:"All tasks"}];for(const P of(d==null?void 0:d.tasks)??[])L.push({value:P.name,label:P.displayName});return L},[d]),y=j.useMemo(()=>[{key:"status",label:"Status",options:Nte},{key:"task",label:"Task",options:m}],[m]),x=c("status"),b=c("task"),{data:S,isLoading:w,isError:C,error:T}=LD({limit:qr,offset:i,search:r,status:x,task:b}),k=(S==null?void 0:S.runs)??[],R=(S==null?void 0:S.total)??0,A=v.jsx(Nd,{searchPlaceholder:"Search runs...",searchValue:n,onSearchChange:o,filters:y,filterValues:a,onFilterChange:f}),D=v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-outline-variant/20 bg-surface-container/50",children:[v.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Task"}),v.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Status"}),v.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Started"}),v.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Duration"}),v.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Tokens"}),v.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?v.jsxs("div",{className:"space-y-4",children:[A,v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Failed to load runs"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:T instanceof Error?T.message:"Unknown error"})]})]}):v.jsxs("div",{className:"space-y-4",children:[A,w?v.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:v.jsxs("table",{className:"w-full",children:[D,v.jsx("tbody",{children:[1,2,3].map(L=>v.jsx(jte,{},L))})]})}):k.length===0?v.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:[v.jsx(xd,{className:"h-10 w-10 opacity-30"}),v.jsxs("div",{className:"text-center font-sans",children:[v.jsx("p",{className:"text-sm",children:R===0&&!r&&!x&&!b?"No agent runs yet":"No matching runs"}),R===0&&!r&&!x&&!b&&v.jsx("p",{className:"text-xs mt-1",children:"Trigger the first run to see the agent at work"})]}),R===0&&!r&&!x&&!b&&v.jsxs(ze,{variant:"outline",size:"sm",className:"gap-2 mt-2",onClick:t,children:[v.jsx(Xu,{className:"h-3.5 w-3.5"}),"Run Now"]})]}):v.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:v.jsxs("table",{className:"w-full","aria-label":"Agent runs",children:[D,v.jsx("tbody",{children:k.map(L=>v.jsx(Ate,{run:L,taskNameMap:p,onClick:()=>e(L.id)},L.id))})]})}),v.jsx(pc,{total:R,offset:i,limit:qr,onPageChange:l})]})}function Dte({text:e}){const[t,n]=j.useState(!1),r=e.length>200||e.includes(`
|
|
814
|
+
`);return v.jsxs("div",{className:"mt-1",children:[v.jsx("div",{className:!t&&r?"line-clamp-2":void 0,children:v.jsx(Ra,{content:e,className:"text-on-surface-variant [&>*]:text-on-surface-variant"})}),r&&v.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?v.jsxs(v.Fragment,{children:[v.jsx(Ua,{className:"h-3 w-3"})," Show less"]}):v.jsxs(v.Fragment,{children:[v.jsx(sa,{className:"h-3 w-3"})," Show more"]})})]})}function Mte({phases:e}){return v.jsxs("div",{className:"space-y-3",children:[v.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Phase Execution"}),e.map((t,n)=>v.jsxs("div",{className:"flex items-start gap-3",children:[v.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}),v.jsxs(Ze,{level:"default",className:"flex-1 p-3",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:t.name}),v.jsx(Ct,{variant:_D(t.status),children:t.status})]}),v.jsxs("div",{className:"flex gap-3 font-mono text-xs text-on-surface-variant",children:[v.jsxs("span",{children:[t.turnsUsed," turns"]}),v.jsx("span",{children:H1(t.tokensUsed)}),v.jsx("span",{children:V1(t.costUsd)})]})]}),t.summary&&v.jsx(Dte,{text:t.summary})]})]},t.name))]})}const xA=80,Ote=1e3;function Lte(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 _te(e){return e===null?"—":new Date(e*Ote).toLocaleTimeString()}function Bte(e,t){return e&&pb(e,t)||"—"}function Pte({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(`
|
|
815
|
+
`);let o=null;if(i)try{o=JSON.parse(e.details)}catch{o=e.details}return v.jsxs(Ze,{level:"low",className:"p-4 space-y-2",children:[v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx(Ct,{variant:Lte(e.action),children:e.action}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("div",{className:!r&&l?"line-clamp-3":void 0,children:v.jsx(Ra,{content:e.summary})}),l&&v.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?v.jsxs(v.Fragment,{children:[v.jsx(Ua,{className:"h-3 w-3"})," Show less"]}):v.jsxs(v.Fragment,{children:[v.jsx(sa,{className:"h-3 w-3"})," Show more"]})})]}),v.jsx("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:_te(e.created_at)})]}),i&&v.jsxs("div",{children:[v.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?v.jsx(Ua,{className:"h-3.5 w-3.5"}):v.jsx(sa,{className:"h-3.5 w-3.5"}),t?"Hide details":"Show details"]}),t&&v.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 zte({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?Bte(e.tool_input,xA):"—",i=e.tool_input!==null&&e.tool_input.length>xA;return v.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:v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsx("span",{className:"font-mono text-xs text-on-surface-variant w-5 shrink-0 pt-0.5 text-right",children:e.turn_number}),v.jsx("span",{className:"font-mono text-xs font-medium text-on-surface shrink-0 pt-0.5 min-w-[140px]",children:e.tool_name}),v.jsxs("div",{className:"flex-1 min-w-0",children:[i?v.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?v.jsx(Ua,{className:"h-3 w-3 mt-0.5 shrink-0"}):v.jsx(sa,{className:"h-3 w-3 mt-0.5 shrink-0"}),v.jsx("span",{className:t?void 0:"truncate",children:a})]}):v.jsx("span",{className:"font-mono text-xs text-on-surface-variant truncate block",children:a}),t&&r!==null&&v.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 Ite({runId:e,onBack:t}){var k;const[n,r]=j.useState(!1),{data:a,isLoading:i,isError:l}=lU(e),o=(k=a==null?void 0:a.run)==null?void 0:k.status,{data:f,isLoading:c}=oU(e,o),{data:d,isLoading:p}=uU(n?e:void 0,o),{data:m}=fc(),y=j.useMemo(()=>(m==null?void 0:m.tasks)??[],[m]);if(i)return v.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[v.jsx(Wn,{className:"h-5 w-5 animate-spin"}),v.jsx("span",{className:"font-sans",children:"Loading run..."})]});if(l||!(a!=null&&a.run))return v.jsxs("div",{className:"space-y-4",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),"Runs"]}),v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Run not found"})]})]});const x=a.run,b=(f==null?void 0:f.reports)??[],S=d??[];let w=null,C,T;if(x.actions_taken)try{const R=JSON.parse(x.actions_taken);R!=null&&R.phases&&Array.isArray(R.phases)&&(w=R.phases),typeof(R==null?void 0:R.model)=="string"&&(C=R.model),typeof(R==null?void 0:R.provider)=="string"&&(T=R.provider)}catch{}return v.jsxs("div",{className:"space-y-6",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),"Runs"]}),v.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[v.jsx(an,{label:"Status",value:I1(x.status),accent:"sage"}),v.jsx(an,{label:"Task",value:zD(x.task,y),accent:"outline"}),v.jsx(an,{label:"Started",value:Pp(x.started_at),accent:"outline"}),v.jsx(an,{label:"Duration",value:Bp(x.started_at,x.completed_at),accent:"outline"}),v.jsx(an,{label:"Tokens",value:H1(x.tokens_used),accent:"ochre"}),v.jsx(an,{label:"Cost",value:V1(x.cost_usd),accent:"ochre"})]}),(C||T)&&v.jsxs("div",{className:"flex items-center gap-4 px-1",children:[T&&v.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Provider: ",v.jsx("span",{className:"font-mono text-on-surface",children:T})]}),C&&v.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Model: ",v.jsx("span",{className:"font-mono text-on-surface",children:C})]})]}),x.error&&v.jsx("div",{className:"rounded-md bg-tertiary/10 px-3 py-2",children:v.jsx("p",{className:"font-mono text-xs text-tertiary",children:x.error})}),w&&w.length>0&&v.jsx(Ze,{level:"low",className:"p-4",children:v.jsx(Mte,{phases:w})}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Decisions",b.length>0&&v.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[b.length," ",b.length===1?"action":"actions"]})]}),c?v.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant py-4",children:[v.jsx(Wn,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{className:"font-sans text-sm",children:"Loading decisions..."})]}):b.length===0?v.jsx(Ze,{level:"low",className:"flex h-24 items-center justify-center",children:v.jsx("span",{className:"font-sans text-sm text-on-surface-variant",children:"No decisions recorded for this run"})}):v.jsx("div",{className:"space-y-2",children:b.map(R=>v.jsx(Pte,{report:R},R.id))})]}),v.jsxs("div",{className:"space-y-3",children:[v.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?v.jsx(Ua,{className:"h-4 w-4"}):v.jsx(sa,{className:"h-4 w-4"}),"Audit Trail",v.jsx("span",{className:"normal-case font-normal text-xs",children:"(diagnostics)"})]}),n&&v.jsxs(Ze,{level:"low",className:je("overflow-hidden"),children:[v.jsx("div",{className:"p-4 pb-2",children:v.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Turn-by-turn trace"})}),v.jsx("div",{className:"p-0",children:p?v.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant p-4",children:[v.jsx(Wn,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{className:"font-sans text-sm",children:"Loading turns..."})]}):S.length===0?v.jsx("p",{className:"font-sans text-sm text-on-surface-variant p-4",children:"No turns recorded."}):v.jsx("div",{children:S.map(R=>v.jsx(zte,{turn:R},R.id))})})]})]})]})}function Fte(e){return e.displayName??e.name}function Ute({open:e,onOpenChange:t,onTriggered:n}){var S;const[r,a]=j.useState(void 0),[i,l]=j.useState(""),{data:o,isLoading:f}=fc(),{mutate:c,isPending:d,error:p}=q1(),m=(o==null?void 0:o.tasks)??[],y=m.find(w=>w.isDefault),x=r??(y==null?void 0:y.name)??((S=m[0])==null?void 0:S.name)??"";function b(){const w={task:x||void 0,instruction:i.trim()||void 0};c(w,{onSuccess:()=>{t(!1),a(void 0),l(""),n==null||n()}})}return v.jsx(Ed,{open:e,onOpenChange:t,children:v.jsxs(uc,{className:"sm:max-w-md",children:[v.jsxs(Cd,{children:[v.jsx(cc,{children:"Trigger Agent Run"}),v.jsx(_p,{children:"Run the Myco agent now. It will process unprocessed sessions and update the vault."})]}),v.jsxs("div",{className:"space-y-4 py-2",children:[v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Task"}),f?v.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[v.jsx(Wn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):v.jsxs(so,{value:x,onValueChange:a,children:[v.jsx(rl,{children:v.jsx(lo,{})}),v.jsx(al,{children:m.map(w=>v.jsxs(il,{value:w.name,children:[Fte(w),w.isDefault&&v.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant",children:"(default)"})]},w.name))})]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",v.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),v.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:w=>l(w.target.value),disabled:d})]}),p&&v.jsx("p",{className:"font-sans text-xs text-tertiary",children:p instanceof Error?p.message:"Failed to trigger run"})]}),v.jsxs(Lp,{children:[v.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>t(!1),disabled:d,children:"Cancel"}),v.jsx(ze,{size:"sm",className:"gap-2",onClick:b,disabled:d,children:d?v.jsxs(v.Fragment,{children:[v.jsx(Wn,{className:"h-3.5 w-3.5 animate-spin"}),"Starting..."]}):v.jsxs(v.Fragment,{children:[v.jsx(Xu,{className:"h-3.5 w-3.5"}),"Run Now"]})})]})]})})}function qte(e){return!e.phases||e.phases.length===0?"Single query":`${e.phases.length} phases`}function Vte(e){return e===C1?"User":"Built-in"}function Hte({task:e,onClick:t}){return v.jsxs(Ze,{level:"low",interactive:!0,className:je("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:[v.jsxs("div",{className:"flex items-start gap-3",children:[v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.displayName}),e.isDefault&&v.jsx(Cz,{className:"h-3.5 w-3.5 text-primary shrink-0 fill-primary/30"})]}),e.description&&v.jsx("p",{className:"font-sans text-xs text-on-surface-variant mt-1 line-clamp-2",children:e.description})]}),v.jsx("div",{className:"flex items-center gap-2 shrink-0",children:v.jsx(Ct,{variant:BD(e.source),children:Vte(e.source)})})]}),v.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[v.jsxs("div",{className:"flex items-center gap-1.5 text-on-surface-variant",children:[v.jsx(cz,{className:"h-3 w-3"}),v.jsx("span",{className:"font-mono text-xs",children:qte(e)})]}),e.model&&v.jsx("span",{className:"font-mono text-xs text-on-surface-variant/70 truncate max-w-[160px]",children:e.model}),e.maxTurns!==void 0&&v.jsxs("span",{className:"font-mono text-xs text-on-surface-variant/70",children:["max ",e.maxTurns," turns"]})]})]})}function Gte({onSelect:e}){const{data:t,isLoading:n}=fc(),r=(t==null?void 0:t.tasks)??[];return n?v.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)=>v.jsx("div",{className:"h-28 rounded-md animate-pulse bg-surface-container-low"},i))}):r.length===0?v.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No tasks found."}):v.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:r.map(a=>v.jsx(Hte,{task:a,onClick:()=>e(a.name)},a.name))})}const $te=new Set(["instruction"]),Kte={session_id:"Session ID"},Yte={session_id:"e.g. 36858a44-4ef7-4448-96e8-382e992e8ba4"};function Xte(e){const t=e.matchAll(/\{\{(\w+)\}\}/g),n=new Set;for(const r of t){const a=r[1];$te.has(a)||n.add(a)}return[...n]}function bA(e){return Kte[e]??e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Qte({task:e,onRunTriggered:t,onDeleted:n,onCustomized:r}){const a=q1(),i=fU(),l=dU(),[o,f]=j.useState(!1),[c,d]=j.useState({}),[p,m]=j.useState(""),y=j.useMemo(()=>Xte(e.prompt??""),[e.prompt]),x=y.length>0;function b(){var k;const w=[];for(const R of y){const A=(k=c[R])==null?void 0:k.trim();A&&w.push(`${R}: ${A}`)}const C=p.trim();C&&w.push(C);const T=w.length>0?w.join(`
|
|
816
|
+
`):void 0;a.mutate({task:e.name,instruction:T},{onSuccess:R=>{f(!1),d({}),m(""),t==null||t(R.runId)}})}function S(w,C){d(T=>({...T,[w]:C}))}return v.jsxs("div",{className:"flex gap-2",children:[v.jsx(ze,{size:"sm",onClick:()=>{f(!0)},children:"Run Now"}),e.source===zz&&v.jsx(ze,{variant:"outline",size:"sm",onClick:()=>i.mutate({taskId:e.name},{onSuccess:w=>{var T;const C=(T=w==null?void 0:w.task)==null?void 0:T.name;C&&r&&r(C)}}),children:"Customize"}),e.source===C1&&v.jsx(ze,{variant:"destructive",size:"sm",onClick:()=>{l.mutate(e.name,{onSuccess:()=>n==null?void 0:n()})},children:"Delete"}),v.jsx(Ed,{open:o,onOpenChange:f,children:v.jsxs(uc,{className:"sm:max-w-md",children:[v.jsx(Cd,{children:v.jsxs(cc,{children:["Run ",e.displayName]})}),v.jsxs("div",{className:"space-y-4 py-2",children:[y.map(w=>v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:bA(w)}),v.jsx(vn,{value:c[w]??"",onChange:C=>S(w,C.target.value),placeholder:Yte[w]??`Enter ${bA(w).toLowerCase()}`,className:"font-mono",autoFocus:y.indexOf(w)===0})]},w)),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",v.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),v.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:p,onChange:w=>m(w.target.value),disabled:a.isPending})]})]}),v.jsxs(Lp,{children:[v.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>f(!1),children:"Cancel"}),v.jsxs(ze,{size:"sm",disabled:a.isPending,onClick:b,className:"gap-2",children:[a.isPending?v.jsx(Wn,{className:"h-3.5 w-3.5 animate-spin"}):v.jsx(Xu,{className:"h-3.5 w-3.5"}),"Run"]})]})]})})]})}const Wte=20;function Zte({taskId:e,onSaved:t}){const{data:n,isLoading:r,isError:a}=hU(e),i=vU(),[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 p(){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 v.jsx("div",{className:"h-64 animate-pulse rounded-md bg-surface-container-low"});if(a)return v.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 v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Task Definition ",y&&"(read-only)"]}),!y&&v.jsxs("div",{className:"flex gap-2",children:[v.jsx(ze,{variant:"ghost",size:"sm",onClick:m,disabled:!f,children:"Reset"}),v.jsx(ze,{size:"sm",onClick:p,disabled:!f||i.isPending,children:i.isPending?"Saving...":"Save"})]})]}),v.jsx("textarea",{value:l,onChange:x=>d(x.target.value),readOnly:y,rows:Wte,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&&v.jsx("div",{className:"rounded-md bg-tertiary-container/20 p-3 font-sans text-sm text-tertiary",children:i.error.message}),i.isSuccess&&!f&&v.jsx("div",{className:"rounded-md bg-primary-container/20 p-3 font-sans text-sm text-primary",children:"Task saved successfully."})]})}function I_({checked:e,onCheckedChange:t}){return v.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:v.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 F_=3e4;function Jte(e){return cn({queryKey:["task-config",e],queryFn:({signal:t})=>dt(`/agent/tasks/${e}/config`,{signal:t}),enabled:e!==void 0,staleTime:F_})}function ene(){return cn({queryKey:["providers"],queryFn:({signal:e})=>dt("/providers",{signal:e}),staleTime:F_})}function tne(){return la({mutationFn:e=>sr("/providers/test",e)})}function nne(){const e=xr();return la({mutationFn:({taskId:t,config:n})=>lc(`/agent/tasks/${t}/config`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["task-config",n.taskId]})}})}const rne={cloud:"Anthropic Cloud",ollama:"Ollama",lmstudio:"LM Studio"},ane={cloud:tz,ollama:xz,lmstudio:b1};function U_({providerType:e,model:t,baseUrl:n,contextLength:r,modelPlaceholder:a,providers:i,isLoadingProviders:l,onProviderChange:o,onModelChange:f,onBaseUrlChange:c,onContextLengthChange:d}){const p=i.find(x=>x.type===e),m=e==="ollama"||e==="lmstudio",y=(p==null?void 0:p.models)??[];return v.jsxs("div",{className:"space-y-3",children:[v.jsx("div",{className:"grid grid-cols-3 gap-2",children:["cloud","ollama","lmstudio"].map(x=>{const b=ane[x],S=i.find(C=>C.type===x),w=e===x;return v.jsxs("button",{onClick:()=>o(x),className:`
|
|
817
|
+
flex flex-col items-center gap-1.5 rounded-md border px-3 py-2.5 transition-colors
|
|
818
|
+
${w?"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"}
|
|
819
|
+
`,children:[v.jsx(b,{className:"h-4 w-4"}),v.jsx("span",{className:"font-sans text-xs font-medium",children:rne[x]}),!l&&v.jsx(Ct,{variant:S!=null&&S.available?"secondary":"destructive",className:"text-[10px] px-1.5 py-0",children:S!=null&&S.available?"online":"offline"})]},x)})}),m&&v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),v.jsx(vn,{value:n,onChange:x=>c(x.target.value),placeholder:(p==null?void 0:p.baseUrl)??""})]}),m&&v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Context Length"}),v.jsx(vn,{type:"number",value:r,onChange:x=>d(x.target.value),placeholder:"32768"})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),y.length>0?v.jsxs(so,{value:t,onValueChange:f,children:[v.jsx(rl,{children:v.jsx(lo,{placeholder:a??"Select a model"})}),v.jsx(al,{children:y.map(x=>v.jsx(il,{value:x,children:v.jsx("span",{className:"font-mono text-sm",children:x})},x))})]}):v.jsx(vn,{value:t,onChange:x=>f(x.target.value),placeholder:(p==null?void 0:p.available)===!1?"Provider offline":"Enter model name",disabled:(p==null?void 0:p.available)===!1})]})]})}function ine({phase:e,override:t,taskModel:n,providers:r,isLoadingProviders:a,onChange:i}){var c,d,p,m;const[l,o]=j.useState(!1),f=t.provider!==void 0||t.model!==void 0||t.maxTurns!==void 0;return v.jsxs("div",{className:"border border-[var(--ghost-border)] rounded-md",children:[v.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?v.jsx(Ua,{className:"h-3.5 w-3.5 text-on-surface-variant"}):v.jsx(sa,{className:"h-3.5 w-3.5 text-on-surface-variant"}),v.jsx("span",{className:"font-sans text-sm text-on-surface",children:e.name}),v.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:["max ",t.maxTurns??e.maxTurns," turns"]}),f&&v.jsx(Ct,{variant:"secondary",className:"text-[10px] ml-auto",children:"override"})]}),l&&v.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-[var(--ghost-border)]",children:[v.jsx("div",{className:"pt-3",children:v.jsx(U_,{providerType:((c=t.provider)==null?void 0:c.type)??"cloud",model:((d=t.provider)==null?void 0:d.model)??t.model??"",baseUrl:((p=t.provider)==null?void 0:p.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 b;const x=(b=r.find(S=>S.type===y))==null?void 0:b.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})})}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),v.jsx(vn,{type:"number",value:t.maxTurns??"",onChange:y=>i({...t,maxTurns:y.target.value?Number(y.target.value):void 0}),placeholder:String(e.maxTurns)})]}),f&&v.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>i(null),className:"text-xs text-on-surface-variant",children:"Clear Phase Override"})]})]})}const sne=["active","idle","sleep"],lne={active:"Active",idle:"Idle",sleep:"Sleep"};function one({taskId:e,phases:t,defaults:n,schedule:r}){const{data:a,isPending:i}=ene(),{data:l}=Jte(e),o=tne(),f=nne(),c=l==null?void 0:l.config,[d,p]=j.useState("cloud"),[m,y]=j.useState(""),[x,b]=j.useState(""),[S,w]=j.useState(""),[C,T]=j.useState(""),[k,R]=j.useState(""),[A,D]=j.useState({}),[L,P]=j.useState({}),[M,_]=j.useState(!1);j.useEffect(()=>{var z,I,X,U;c&&(p(((z=c.provider)==null?void 0:z.type)??"cloud"),y(((I=c.provider)==null?void 0:I.model)??c.model??""),b(((X=c.provider)==null?void 0:X.base_url)??""),w(((U=c.provider)==null?void 0:U.context_length)!=null?String(c.provider.context_length):""),T(c.maxTurns!=null?String(c.maxTurns):""),R(c.timeoutSeconds!=null?String(c.timeoutSeconds):""),D(c.phases??{}),P(c.schedule??{}),_(!1))},[c]);const B=L.enabled??(r==null?void 0:r.enabled)??!1,q=L.runIn??(r==null?void 0:r.runIn)??[],V=(a==null?void 0:a.providers)??[];function G(z){var I;p(z),y(""),b(((I=V.find(X=>X.type===z))==null?void 0:I.baseUrl)??""),w(""),_(!0),o.reset()}function F(z,I){D(X=>{const U={...X};return I===null?delete U[z]:U[z]=I,U}),_(!0)}function H(){const z=d==="ollama"||d==="lmstudio",I={type:d,...m?{model:m}:{},...z&&x?{base_url:x}:{},...z&&S?{context_length:Number(S)}:{}},X=r?Object.keys(L).length>0?{schedule:L}:{schedule:null}:{};f.mutate({taskId:e,config:{provider:I,...C?{maxTurns:Number(C)}:{maxTurns:null},...k?{timeoutSeconds:Number(k)}:{timeoutSeconds:null},...Object.keys(A).length>0?{phases:A}:{phases:null},...X}},{onSuccess:()=>_(!1)})}function Y(){f.mutate({taskId:e,config:{provider:null,model:null,maxTurns:null,timeoutSeconds:null,phases:null,schedule:null}},{onSuccess:()=>{p("cloud"),y(""),b(""),w(""),T(""),R(""),D({}),P({}),_(!1)}})}function Q(){const I={type:d,...(d==="ollama"||d==="lmstudio")&&x?{base_url:x}:{}};o.mutate(I)}return v.jsxs(Ze,{level:"low",className:"p-4 space-y-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Task Config"}),c&&v.jsx(ze,{variant:"ghost",size:"sm",onClick:Y,className:"text-xs text-on-surface-variant",children:"Clear All Overrides"})]}),v.jsx(U_,{providerType:d,model:m,baseUrl:x,contextLength:S,modelPlaceholder:n==null?void 0:n.model,providers:V,isLoadingProviders:i,onProviderChange:G,onModelChange:z=>{y(z),_(!0)},onBaseUrlChange:z=>{b(z),_(!0)},onContextLengthChange:z=>{w(z),_(!0)}}),v.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),v.jsx(vn,{type:"number",value:C,onChange:z=>{T(z.target.value),_(!0)},placeholder:(n==null?void 0:n.maxTurns)!=null?String(n.maxTurns):"—"})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout (seconds)"}),v.jsx(vn,{type:"number",value:k,onChange:z=>{R(z.target.value),_(!0)},placeholder:(n==null?void 0:n.timeoutSeconds)!=null?String(n.timeoutSeconds):"—"})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:Q,disabled:o.isPending,className:"gap-1.5 text-on-surface-variant",children:[o.isPending?v.jsx(Wn,{className:"h-3.5 w-3.5 animate-spin"}):v.jsx(Rz,{className:"h-3.5 w-3.5"}),"Test"]}),o.isSuccess&&v.jsx("span",{className:"flex items-center gap-1 text-xs",children:o.data.ok?v.jsxs(v.Fragment,{children:[v.jsx(x1,{className:"h-3.5 w-3.5 text-green-500"}),v.jsxs("span",{className:"text-green-500 font-mono",children:[o.data.latency_ms,"ms"]})]}):v.jsxs(v.Fragment,{children:[v.jsx(wd,{className:"h-3.5 w-3.5 text-red-400"}),v.jsx("span",{className:"text-red-400",children:o.data.error})]})}),v.jsx("div",{className:"flex-1"}),v.jsxs(ze,{size:"sm",onClick:H,disabled:!M||f.isPending,className:"gap-1.5",children:[f.isPending&&v.jsx(Wn,{className:"h-3.5 w-3.5 animate-spin"}),"Save"]})]}),r&&v.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(jR,{className:"h-3.5 w-3.5 text-on-surface-variant"}),v.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Scheduling"}),v.jsx(Ct,{variant:B?"secondary":"outline",className:"text-[10px] px-1.5 py-0",children:B?"active":"off"})]}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface",children:"Auto-run"}),v.jsx("p",{className:"font-sans text-[11px] text-on-surface-variant",children:"Automatically run this task on a schedule"})]}),v.jsx(I_,{checked:B,onCheckedChange:z=>{P(I=>({...I,enabled:z})),_(!0)}})]}),B&&v.jsxs("div",{className:"space-y-3 pl-0.5",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run every (seconds)"}),v.jsx(vn,{type:"number",min:10,value:L.intervalSeconds??"",onChange:z=>{const I=z.target.value;P(X=>({...X,intervalSeconds:I?Number(I):void 0})),_(!0)},placeholder:r.intervalSeconds!=null?String(r.intervalSeconds):"300"})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run in states"}),v.jsx("div",{className:"flex gap-2",children:sne.map(z=>{const I=q.includes(z);return v.jsx("button",{onClick:()=>{const X=I?q.filter(U=>U!==z):[...q,z];P(U=>({...U,runIn:X.length>0?X:void 0})),_(!0)},className:`
|
|
820
|
+
rounded-md border px-3 py-1.5 font-sans text-xs font-medium transition-colors
|
|
821
|
+
${I?"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"}
|
|
822
|
+
`,children:lne[z]},z)})})]})]})]}),t&&t.length>0&&v.jsxs("div",{className:"space-y-2 pt-2 border-t border-[var(--ghost-border)]",children:[v.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Per-Phase Overrides"}),t.map(z=>v.jsx(ine,{phase:z,override:A[z.name]??{},taskModel:m||"claude-sonnet-4-6",providers:V,isLoadingProviders:i,onChange:I=>F(z.name,I)},z.name))]})]})}const une=3;function cne(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 fne(){return v.jsxs("div",{className:"space-y-6",children:[v.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),v.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[v.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),v.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),v.jsx("div",{className:"h-8 w-32 animate-pulse rounded bg-surface-container-high"})]}),v.jsx("div",{className:"rounded-md bg-surface-container-low p-4 space-y-2",children:Array.from({length:une}).map((e,t)=>v.jsx("div",{className:"h-5 animate-pulse rounded bg-surface-container-high"},t))})]})}function dne({phase:e,index:t}){return v.jsxs(Ze,{level:"low",className:"p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.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}),v.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:e.name}),!e.required&&v.jsx(Ct,{variant:"secondary",children:"optional"})]}),v.jsxs("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:["max ",e.maxTurns," turns"]})]}),e.tools.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1",children:e.tools.map(n=>v.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))}),v.jsx(Ze,{level:"lowest",className:"p-3 overflow-auto max-h-40",children:v.jsx(Ra,{content:e.prompt})})]})}function hne({taskId:e,onBack:t,onNavigate:n,onRunTriggered:r}){const{data:a,isPending:i,isError:l}=cU(e);if(i)return v.jsx(fne,{});if(l||!(a!=null&&a.task))return v.jsxs("div",{className:"space-y-4",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),"Tasks"]}),v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Task not found"})]})]});const o=a.task,f=o.phases??[],c=cne(o);return v.jsxs("div",{className:"space-y-6",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),"Tasks"]}),v.jsxs(Ze,{level:"low",className:"p-4 space-y-4",children:[v.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[v.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[v.jsx("h1",{className:"font-serif text-lg text-on-surface",children:o.displayName}),o.description&&v.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:o.description})]}),v.jsx(Ct,{variant:BD(o.source),className:"shrink-0",children:I1(o.source??"built-in")})]}),v.jsx(Qte,{task:o,onDeleted:t,onCustomized:d=>n==null?void 0:n(d),onRunTriggered:r})]}),v.jsx(one,{taskId:e,phases:f,defaults:{model:c.model,maxTurns:c.maxTurns,timeoutSeconds:c.timeoutSeconds},schedule:o.schedule}),(c.model!==void 0||c.maxTurns!==void 0||c.timeoutSeconds!==void 0)&&v.jsxs(Ze,{level:"low",className:"p-4 space-y-3",children:[v.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Execution Config"}),v.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.model!==void 0&&v.jsxs("div",{children:[v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),v.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.model})]}),c.maxTurns!==void 0&&v.jsxs("div",{children:[v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),v.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.maxTurns})]}),c.timeoutSeconds!==void 0&&v.jsxs("div",{children:[v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout"}),v.jsxs("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:[c.timeoutSeconds,"s"]})]})]})]}),f.length>0?v.jsxs("div",{className:"space-y-3",children:[v.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Phases",v.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[f.length," ",f.length===1?"phase":"phases"]})]}),f.map((d,p)=>v.jsx(dne,{phase:d,index:p},d.name))]}):v.jsxs("div",{className:"space-y-3",children:[v.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Prompt"}),v.jsx(Ze,{level:"lowest",className:"p-4 overflow-auto max-h-96",children:v.jsx(Ra,{content:o.prompt??""})})]}),v.jsx(Zte,{taskId:e})]})}function q_(){const e=xr(),t=cn({queryKey:["config"],queryFn:({signal:r})=>dt("/config",{signal:r})}),n=la({mutationFn:r=>lc("/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 V_(e,t){var n;return{summaryBatchInterval:String(((n=e.agent)==null?void 0:n.summary_batch_interval)??ub),defaultTask:t??""}}function vne(e,t,n){const r=V_(t,n);return e.summaryBatchInterval!==r.summaryBatchInterval||e.defaultTask!==r.defaultTask}function wA({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 v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsxs("div",{className:"relative h-20 w-20",children:[v.jsxs("svg",{className:"h-20 w-20 -rotate-90",viewBox:"0 0 80 80",children:[v.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:"currentColor",className:"text-surface-container/30",strokeWidth:"6"}),v.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"})]}),v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsxs("span",{className:"text-sm font-semibold font-mono text-on-surface",children:[a,"%"]})})]}),v.jsx("span",{className:"text-xs text-on-surface-variant text-center font-sans",children:e})]})}function Ii({label:e,value:t}){return v.jsxs("div",{className:"flex items-center justify-between py-1",children:[v.jsx("span",{className:"text-xs text-on-surface-variant font-sans",children:e}),v.jsx("span",{className:"text-xs font-mono text-on-surface",children:t})]})}function pne({stats:e}){const t=e.embedding.total_embeddable>0?e.embedding.embedded_count:0,n=e.embedding.total_embeddable;return v.jsxs("div",{className:"space-y-4",children:[v.jsxs("h2",{className:"text-xs font-semibold text-on-surface-variant uppercase tracking-widest flex items-center gap-2 font-sans",children:[v.jsx(lb,{className:"h-3.5 w-3.5"}),"System Health"]}),v.jsxs("div",{className:"flex justify-center gap-8 py-2",children:[v.jsx(wA,{label:"Embedding Coverage",value:t,max:n,color:"#abcfb8"}),v.jsx(wA,{label:"Queue Health",value:Math.max(0,n-e.embedding.queue_depth),max:n,color:"#edbf7f"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-0",children:[v.jsx(Ii,{label:"Sessions",value:String(e.vault.session_count)}),v.jsx(Ii,{label:"Spores",value:String(e.vault.spore_count)}),v.jsx(Ii,{label:"Entities",value:String(e.vault.entity_count)}),v.jsx(Ii,{label:"Graph edges",value:String(e.vault.edge_count)}),v.jsx(Ii,{label:"Uptime",value:P1(e.daemon.uptime_seconds)}),v.jsx(Ii,{label:"Daemon",value:`v${e.daemon.version} :${e.daemon.port}`}),e.agent.last_run_at!==null&&v.jsxs(v.Fragment,{children:[v.jsx(Ii,{label:"Last run",value:hi(e.agent.last_run_at)}),v.jsx(Ii,{label:"Total runs",value:String(e.agent.total_runs)})]}),e.digest.freshest_tier!==null&&v.jsx(Ii,{label:"Digest tier",value:`T${e.digest.freshest_tier}`})]})]})}function mne(){var L;const{config:e,isLoading:t,saveConfig:n,isSaving:r}=q_(),{data:a,isLoading:i}=jp(),{data:l,isLoading:o}=fc(),{restart:f}=k1(),[c,d]=j.useState(null),[p,m]=j.useState(null),[y,x]=j.useState("idle"),[b,S]=j.useState(""),w=(l==null?void 0:l.tasks)??[],C=((L=w.find(P=>P.isDefault))==null?void 0:L.name)??"",T=j.useRef(!1);e&&!o&&!T.current&&(T.current=!0,c===null&&d(V_(e,C)));const k=c&&e?vne(c,e,C):!1,R=j.useCallback((P,M)=>{d(_=>_&&{..._,[P]:M}),m(null)},[]),A=async()=>{if(!(!c||!e)){m(null);try{const P={...e,agent:{...e.agent,summary_batch_interval:mb(c.summaryBatchInterval,ub)}};await n(P),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 P=new URLSearchParams({provider:e.embedding.provider,type:"embedding"});e.embedding.base_url&&P.set("base_url",e.embedding.base_url);const _=(await dt(`/models?${P.toString()}`)).models.length;x("success"),S(`Connected -- ${_} model${_!==1?"s":""} available.`)}catch(P){x("error"),S(P instanceof Error?P.message:"Connection failed.")}}};return t||!e||!c?v.jsx("div",{className:"space-y-4",children:[1,2,3].map(P=>v.jsx("div",{className:"h-32 rounded-md animate-pulse bg-surface-container-low"},P))}):v.jsxs("div",{className:"space-y-6",children:[v.jsxs(Ze,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[v.jsx(zt,{children:v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx(bz,{className:"h-4 w-4 text-primary"}),"Agent Operations"]})}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Title & Summary Batch Interval"}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(vn,{type:"number",min:0,placeholder:String(ub),value:c.summaryBatchInterval,onChange:P=>R("summaryBatchInterval",P.target.value),className:"w-32 font-mono"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"batches"})]}),v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Run the Title & Summary task every N batches to keep active sessions properly titled. Set to 0 to disable."})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Default Task"}),o?v.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[v.jsx(Wn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):v.jsxs(so,{value:c.defaultTask,onValueChange:P=>R("defaultTask",P),children:[v.jsx(rl,{children:v.jsx(lo,{placeholder:"Select default task"})}),v.jsx(al,{children:w.map(P=>v.jsx(il,{value:P.name,children:P.displayName},P.name))})]}),v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"The task used when Run Now is clicked or no task is specified."})]}),v.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[v.jsxs(ze,{onClick:A,disabled:!k||r,size:"sm",children:[r?v.jsx(Wn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Save Changes"]}),p&&v.jsx("span",{className:p.type==="success"?"font-sans text-xs text-primary":"font-sans text-xs text-tertiary",children:p.text})]})]}),v.jsxs(Ze,{level:"low",className:"p-6 space-y-4 border-t-2 border-t-ochre",children:[v.jsx(zt,{children:v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx(b1,{className:"h-4 w-4 text-secondary"}),"Embedding Configuration"]})}),v.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:[v.jsxs("div",{children:[v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Provider"}),v.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5",children:e.embedding.provider})]}),v.jsxs("div",{children:[v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),v.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&&v.jsxs("div",{className:"col-span-2",children:[v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),v.jsx("p",{className:"text-sm font-mono text-on-surface mt-0.5 truncate",title:e.embedding.base_url,children:e.embedding.base_url})]})]}),v.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[v.jsxs(ze,{type:"button",variant:"ghost",size:"sm",onClick:D,disabled:y==="testing",children:[y==="testing"?v.jsx(Wn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Test Connection"]}),v.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:[v.jsx(Sd,{className:"h-3 w-3"}),"Edit in Settings"]}),y==="success"&&v.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-primary",children:[v.jsx(kR,{className:"h-3.5 w-3.5"}),b]}),y==="error"&&v.jsxs("span",{className:"flex items-center gap-1 font-sans text-xs text-tertiary",children:[v.jsx(wd,{className:"h-3.5 w-3.5"}),b]})]})]}),i?v.jsx(Ze,{level:"low",className:"p-6",children:v.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-container"})}):a?v.jsx(Ze,{level:"low",className:"p-6",children:v.jsx(pne,{stats:a})}):null]})}const H_="tab",G_="run",$_="task",gne=new Set(["runs","tasks","config"]);function yne(){const e=new URLSearchParams(window.location.search),t=e.get(H_);return{tab:t&&gne.has(t)?t:"runs",runId:e.get(G_)??void 0,taskId:e.get($_)??void 0}}function xne(e,t,n){const r=new URLSearchParams;e!=="runs"&&r.set(H_,e),t&&r.set(G_,t),n&&r.set($_,n);const a=r.toString(),i=a?`${window.location.pathname}?${a}`:window.location.pathname;window.history.replaceState(null,"",i)}const bne=[{id:"runs",label:"Runs"},{id:"tasks",label:"Tasks"},{id:"config",label:"Config"}];function wne(){const e=yne(),[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(()=>{xne(t,r,i)},[t,r,i]);const c=j.useCallback(d=>{const p=d;n(p),p!=="runs"&&a(void 0),p!=="tasks"&&l(void 0)},[]);return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsx(vi,{title:"Agent",subtitle:"Intelligence runs, task configuration, and operational settings",tabs:bne,activeTab:t,onTabChange:c,actions:t==="runs"?v.jsxs(ze,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>f(!0),children:[v.jsx(Xu,{className:"h-3.5 w-3.5"}),"Run Now"]}):void 0}),t==="runs"&&(r?v.jsx(Ite,{runId:r,onBack:()=>a(void 0)}):v.jsx(Rte,{onSelectRun:a,onTriggerRun:()=>f(!0)})),t==="tasks"&&(i?v.jsx(hne,{taskId:i,onBack:()=>l(void 0),onNavigate:l,onRunTriggered:d=>{l(void 0),n("runs"),d&&a(d)}}):v.jsx(Gte,{onSelect:l})),t==="config"&&v.jsx(mne,{}),v.jsx(Ute,{open:o,onOpenChange:f,onTriggered:()=>a(void 0)})]})}function K_(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(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?`/skill-candidates?${n}`:"/skill-candidates";return cn({queryKey:["skill-candidates",e],queryFn:({signal:a})=>dt(r,{signal:a})})}function Sne(){const e=xr();return la({mutationFn:({id:t,...n})=>lc(`/skill-candidates/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-candidates"]})}})}function Y_(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(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?`/skill-records?${n}`:"/skill-records";return cn({queryKey:["skill-records",e],queryFn:({signal:a})=>dt(r,{signal:a})})}function Ene(e){return cn({queryKey:["skill-record",e],queryFn:({signal:t})=>dt(`/skill-records/${e}`,{signal:t}),enabled:!!e})}function Cne(){const e=xr();return la({mutationFn:t=>E1(`/skill-records/${encodeURIComponent(t)}`),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-records"]}),e.invalidateQueries({queryKey:["skill-record"]})}})}const Tne=[{key:"status",label:"Status",options:[{value:Fn,label:"All statuses"},{value:"identified",label:"Identified"},{value:"approved",label:"Approved"},{value:"generated",label:"Generated"},{value:"dismissed",label:"Dismissed"}]}];function Nne(e){const t=`${(e*100).toFixed(0)}%`;return e>=.85?{text:t,variant:"default"}:e>=.7?{text:t,variant:"secondary"}:{text:t,variant:"outline"}}function kne(e){const t=Math.floor(Date.now()/1e3)-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function jne(e){switch(e){case"identified":return v.jsx(Ct,{variant:"outline",children:"Identified"});case"approved":return v.jsx(Ct,{variant:"secondary",children:"Approved"});case"generated":return v.jsx(Ct,{variant:"default",children:"Generated"});case"dismissed":return v.jsx(Ct,{variant:"outline",className:"opacity-50",children:"Dismissed"});default:return v.jsx(Ct,{variant:"outline",children:e})}}function Ane({candidate:e,onApprove:t,onDismiss:n,isApproving:r,isDismissing:a}){const i=Nne(e.confidence),l=e.status==="identified"||e.status==="approved";return v.jsxs(Ze,{level:"low",className:"p-5 space-y-3",children:[v.jsxs("div",{className:"flex items-start justify-between gap-4",children:[v.jsx("div",{className:"flex-1 min-w-0",children:v.jsx("h3",{className:"font-serif text-lg text-on-surface leading-tight",children:e.topic})}),v.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[jne(e.status),v.jsx(Ct,{variant:i.variant,children:i.text}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:kne(e.created_at)})]})]}),v.jsx(Ra,{content:e.rationale,className:"text-sm text-on-surface-variant"}),l&&v.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.status==="identified"&&v.jsxs(v.Fragment,{children:[v.jsxs(ze,{size:"sm",variant:"default",onClick:t,disabled:r,children:[v.jsx(bd,{className:"h-3.5 w-3.5 mr-1.5"}),r?"Approving...":"Approve"]}),v.jsxs(ze,{size:"sm",variant:"ghost",onClick:n,disabled:a,className:"text-on-surface-variant",children:[v.jsx(wd,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Dismissing...":"Dismiss"]})]}),e.status==="approved"&&v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"Awaiting generation"})]})]})}function Rne(){return v.jsxs(Ze,{level:"low",className:"p-5 space-y-3",children:[v.jsxs("div",{className:"flex items-start justify-between",children:[v.jsx("div",{className:"h-5 w-64 rounded bg-surface-container-high animate-pulse"}),v.jsx("div",{className:"h-5 w-20 rounded bg-surface-container-high animate-pulse"})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("div",{className:"h-3 w-full rounded bg-surface-container-high animate-pulse"}),v.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high animate-pulse"})]}),v.jsx("div",{className:"h-8 w-32 rounded bg-surface-container-high animate-pulse"})]})}function Dne(){const e=Sne(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=kd({initialFilters:{status:Fn}}),c=f("status"),{data:d,isLoading:p,isError:m,error:y}=K_({status:c,limit:qr,offset:a}),x=(d==null?void 0:d.candidates)??[],b=(d==null?void 0:d.total)??0,S=j.useMemo(()=>{if(!n)return x;const k=n.toLowerCase();return x.filter(R=>R.topic.toLowerCase().includes(k)||R.rationale.toLowerCase().includes(k))},[x,n]);function w(k){e.mutate({id:k.id,status:"approved"})}function C(k){e.mutate({id:k.id,status:"dismissed"})}const T=v.jsx(Nd,{searchPlaceholder:"Search candidates...",searchValue:t,onSearchChange:l,filters:Tne,filterValues:r,onFilterChange:o});return m?v.jsxs("div",{className:"space-y-3",children:[T,v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Failed to load candidates"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):p?v.jsxs("div",{className:"space-y-3",children:[T,Array.from({length:3}).map((k,R)=>v.jsx(Rne,{},R))]}):v.jsxs("div",{className:"space-y-3",children:[T,S.length===0?v.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant",children:[v.jsx(dz,{className:"h-10 w-10 opacity-20"}),b===0&&!c&&!n?v.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[v.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skill candidates discovered yet"}),v.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Candidates are procedural patterns discovered from your vault knowledge. Review and approve them here, then Myco generates full skills from them."}),v.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",v.jsx(ja,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically during idle periods and discovers candidates from session history, decisions, and gotchas."]}),v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",v.jsxs(ja,{to:"/agent?tab=tasks&task=skill-survey",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[v.jsx(Sd,{className:"h-3 w-3"}),"Skill Survey"]})," ","from the Agent page to discover candidates on demand."]})]})]}):v.jsx("span",{className:"font-sans text-sm",children:"No matching candidates"})]}):v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:n?`${S.length} of ${b} candidate${b!==1?"s":""}`:`${b} candidate${b!==1?"s":""}`}),S.map(k=>{var R,A,D,L;return v.jsx(Ane,{candidate:k,onApprove:()=>w(k),onDismiss:()=>C(k),isApproving:e.isPending&&((R=e.variables)==null?void 0:R.id)===k.id&&((A=e.variables)==null?void 0:A.status)==="approved",isDismissing:e.isPending&&((D=e.variables)==null?void 0:D.id)===k.id&&((L=e.variables)==null?void 0:L.status)==="dismissed"},k.id)})]}),v.jsx(pc,{total:n?S.length:b,offset:a,limit:qr,onPageChange:i})]})}const Mne=5,One=[{key:"status",label:"Status",options:[{value:Fn,label:"All statuses"},{value:"active",label:"Active"},{value:"stale",label:"Stale"},{value:"retired",label:"Retired"}]}];function Lne(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function Of({children:e,className:t}){return v.jsx("th",{className:je("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function _ne(){return v.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-12 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-10 rounded bg-surface-container-high animate-pulse"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function Bne({record:e,onClick:t}){return v.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 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:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Skill: ${e.display_name}`,children:[v.jsxs("td",{className:"px-4 py-3",children:[v.jsx("span",{className:"font-sans text-sm font-medium text-on-surface block",children:e.display_name}),v.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant block mt-0.5",children:e.name})]}),v.jsx("td",{className:"px-4 py-3",children:v.jsxs(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["gen ",e.generation]})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx(Ct,{variant:Lne(e.status),children:e.status})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.usage_count})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:Pp(e.updated_at)})})]})}function Pne({onSelectSkill:e}){const{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=kd({initialFilters:{status:Fn}}),c=f("status"),{data:d,isLoading:p,isError:m,error:y}=Y_({status:c,limit:qr,offset:a}),x=(d==null?void 0:d.records)??[],b=(d==null?void 0:d.total)??0,S=n?x.filter(T=>T.display_name.toLowerCase().includes(n.toLowerCase())||T.name.toLowerCase().includes(n.toLowerCase())||T.description.toLowerCase().includes(n.toLowerCase())):x,w=v.jsx(Nd,{searchPlaceholder:"Search skills...",searchValue:t,onSearchChange:l,filters:One,filterValues:r,onFilterChange:o}),C=v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[v.jsx(Of,{children:"Name"}),v.jsx(Of,{children:"Generation"}),v.jsx(Of,{children:"Status"}),v.jsx(Of,{children:"Usage"}),v.jsx(Of,{children:"Last Evolved"})]})});return m?v.jsxs("div",{children:[w,v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Failed to load skills"}),v.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):v.jsxs("div",{children:[w,p?v.jsx(Ze,{level:"low",className:"rounded-md overflow-hidden mt-4",children:v.jsxs("table",{className:"w-full",children:[C,v.jsx("tbody",{children:Array.from({length:Mne}).map((T,k)=>v.jsx(_ne,{},k))})]})}):S.length===0?v.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant mt-4",children:[v.jsx(WP,{className:"h-10 w-10 opacity-20"}),b===0&&!n&&!c?v.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[v.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skills generated yet"}),v.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in this codebase."}),v.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",v.jsx(ja,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically and discovers candidates from your vault. Approve candidates in the"," ",v.jsx(ja,{to:"/skills?tab=candidates",className:"text-primary hover:underline",children:"Candidates tab"}),", then enable the"," ",v.jsx(ja,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","task to produce skills automatically."]}),v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",v.jsx(ja,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","from the Agent page to generate a skill on demand."]})]})]}):v.jsx("span",{className:"font-sans text-sm",children:"No matching skills"})]}):v.jsx(Ze,{level:"low",className:"rounded-md overflow-hidden mt-4",children:v.jsxs("table",{className:"w-full","aria-label":"Skills",children:[C,v.jsx("tbody",{children:S.map(T=>v.jsx(Bne,{record:T,onClick:()=>e(T.name)},T.id))})]})}),v.jsx(pc,{total:b,offset:a,limit:qr,onPageChange:i})]})}const zne={created:"default",updated:"secondary",split:"warning",retired:"outline"};function Ine({entry:e}){const[t,n]=j.useState(!1);return v.jsxs("div",{className:"relative pl-6",children:[v.jsx("div",{className:"absolute left-0 top-2 h-2.5 w-2.5 rounded-full border-2 border-outline-variant bg-surface-container"}),v.jsxs("button",{type:"button",className:"w-full text-left group cursor-pointer",onClick:()=>n(r=>!r),"aria-expanded":t,children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsxs(Ct,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["v",e.generation]}),v.jsx(Ct,{variant:zne[e.action]??"outline",children:e.action}),v.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant ml-auto shrink-0",children:Pp(e.created_at)}),v.jsx(sa,{className:je("h-3.5 w-3.5 text-on-surface-variant transition-transform duration-150",t&&"rotate-90")})]}),e.rationale&&v.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-1 leading-relaxed",children:e.rationale})]}),t&&e.content_snapshot&&v.jsx(Ze,{level:"lowest",className:"mt-2 p-3 overflow-auto max-h-96",children:v.jsx("pre",{className:"font-mono text-xs text-on-surface whitespace-pre-wrap break-words",children:e.content_snapshot})})]})}function Fne({entries:e}){return e.length===0?v.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No evolution history."}):v.jsxs("div",{className:"relative space-y-4",children:[v.jsx("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-outline-variant/30"}),e.map(t=>v.jsx(Ine,{entry:t},t.id))]})}function Une(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function qne(e){if(!e)return 0;try{const t=JSON.parse(e);return Array.isArray(t)?t.length:0}catch{return 0}}function Vne(){return v.jsxs("div",{className:"space-y-6",children:[v.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),v.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[v.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),v.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),v.jsx("div",{className:"h-5 w-32 animate-pulse rounded bg-surface-container-high"})]}),v.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:Array.from({length:3}).map((e,t)=>v.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-container-high"},t))})]})}function Hne({skillName:e,onBack:t}){var m,y;const{data:n,isPending:r,isError:a}=Ene(e),i=Cne(),[l,o]=j.useState(!1);if(r)return v.jsx(Vne,{});if(a||!n)return v.jsxs("div",{className:"space-y-4",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),"Skills"]}),v.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-5 w-5"}),v.jsx("span",{className:"font-sans text-sm",children:"Skill not found"})]})]});const f=qne(n.source_ids),c=((y=(m=n.lineage)==null?void 0:m[0])==null?void 0:y.content_snapshot)??null,d=n.frontmatter??{},p=(c==null?void 0:c.replace(/^---\n[\s\S]*?\n---\n*/,""))??null;return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[v.jsx(ci,{className:"h-4 w-4"}),"Skills"]}),v.jsxs(ze,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>o(!0),children:[v.jsx(co,{className:"h-4 w-4"}),"Delete"]})]}),v.jsx(Ze,{level:"low",className:"p-4 space-y-3",children:v.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[v.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[v.jsx("h1",{className:"font-serif text-lg text-on-surface",children:n.display_name}),n.description&&v.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:n.description}),n.path&&v.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant mt-1",children:n.path}),Object.keys(d).length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[d["user-invocable"]==="true"&&v.jsx(Ct,{variant:"secondary",children:"user-invocable"}),d["allowed-tools"]&&v.jsxs(Ct,{variant:"outline",children:["tools: ",d["allowed-tools"]]})]})]}),v.jsx(Ct,{variant:Une(n.status),className:"shrink-0",children:n.status})]})}),v.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[v.jsx(an,{label:"Generation",value:`v${n.generation}`,accent:"sage"}),v.jsx(an,{label:"Usage",value:`${n.usage_total??n.usage_count??0}`,sublabel:"sessions",accent:"ochre"}),v.jsx(an,{label:"Sources",value:`${f}`,accent:"outline"})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsx(zt,{children:"Evolution History"}),v.jsx(Fne,{entries:n.lineage??[]})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsx(zt,{children:"Current Content"}),p?v.jsx(Ra,{content:p}):v.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No content snapshot available."})]}),v.jsx(G1,{open:l,onOpenChange:o,title:"Delete Skill",description:"This will permanently delete the skill record, evolution history, and the SKILL.md file from disk.",icon:v.jsx(co,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"Name",value:n.name},{label:"Title",value:n.display_name}]:[],confirmLabel:"Delete Skill",variant:"destructive",onConfirm:()=>{i.mutate(n.name,{onSuccess:()=>{o(!1),t()}})},isPending:i.isPending})]})}const X_="tab",Q_="skill",Gne=new Set(["candidates","skills"]);function $ne(){const e=new URLSearchParams(window.location.search),t=e.get(X_);return{tab:t&&Gne.has(t)?t:"skills",skill:e.get(Q_)??void 0}}function Kne(e,t){const n=new URLSearchParams;e!=="skills"&&n.set(X_,e),t&&n.set(Q_,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.replaceState(null,"",a)}const Yne=[{id:"skills",label:"Skills"},{id:"candidates",label:"Candidates"}];function Xne(){return v.jsxs(Ed,{children:[v.jsx(J6,{asChild:!0,children:v.jsx(ze,{variant:"ghost",size:"sm",className:"text-on-surface-variant",children:v.jsx(JP,{className:"h-4 w-4"})})}),v.jsxs(uc,{className:"max-w-lg",children:[v.jsxs(Cd,{children:[v.jsx(cc,{children:"How Skills Work"}),v.jsx(_p,{children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in your codebase."})]}),v.jsxs("div",{className:"space-y-4 font-sans text-sm text-on-surface-variant",children:[v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("h4",{className:"font-medium text-on-surface",children:"The Pipeline"}),v.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[v.jsxs("li",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Survey"})," — discovers candidate skills from vault knowledge (sessions, decisions, gotchas)"]}),v.jsxs("li",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Approve"})," — you review candidates and approve the ones worth generating"]}),v.jsxs("li",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Generate"})," — produces a SKILL.md file from the approved candidate's source material"]}),v.jsxs("li",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Evolve"})," — updates existing skills when new knowledge makes them stale"]})]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("h4",{className:"font-medium text-on-surface",children:"Scheduling"}),v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-on-surface",children:"Skill Survey"})," runs automatically during idle periods. Skill Generate and Skill Evolve are off by default — enable them in the"," ",v.jsxs(ja,{to:"/agent?tab=tasks",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Agent Tasks",v.jsx(Sd,{className:"h-3 w-3"})]})," ","page for fully automatic operation, or trigger them manually with Run Now."]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("h4",{className:"font-medium text-on-surface",children:"Quick Start"}),v.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[v.jsx("li",{children:"Wait for the survey to discover candidates (or run it manually)"}),v.jsx("li",{children:"Review candidates in the Candidates tab and approve the best ones"}),v.jsxs("li",{children:["Run"," ",v.jsx(ja,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","to produce skills from approved candidates"]})]})]})]})]})]})}function Qne(){const e=$ne(),[t,n]=j.useState(e.tab),[r,a]=j.useState(e.skill),{data:i}=K_({status:"identified"}),{data:l}=Y_({status:"active"}),o=(i==null?void 0:i.total)??0,f=(l==null?void 0:l.total)??0;j.useEffect(()=>{Kne(t,r)},[t,r]);const c=j.useCallback(p=>{const m=p;n(m),m!=="skills"&&a(void 0)},[]),d=j.useCallback(p=>{n("skills"),a(p)},[]);return v.jsxs("div",{className:"p-6 space-y-4",children:[v.jsx(vi,{title:"Skills",subtitle:"Discovered skill candidates and promoted skill records",tabs:Yne,activeTab:t,onTabChange:c,actions:v.jsxs("div",{className:"flex items-center gap-2",children:[o>0&&v.jsxs(Ct,{variant:"secondary",children:[o," pending"]}),f>0&&v.jsxs(Ct,{variant:"default",children:[f," active"]}),v.jsx(Xne,{})]})}),t==="candidates"&&v.jsx(Dne,{}),t==="skills"&&!r&&v.jsx(Pne,{onSelectSkill:d}),t==="skills"&&r&&v.jsx(Hne,{skillName:r,onBack:()=>a(void 0)})]})}function Wne(){const[e,t]=j.useState({}),[n,r]=j.useState([]),[a,i]=j.useState([]),[l,o]=j.useState(""),[f,c]=j.useState(!1),[d,p]=j.useState(null),[m,y]=j.useState(!0);j.useEffect(()=>{dt("/config/plan-dirs").then(k=>{t(k.symbiont),r(k.custom),i(k.custom)}).catch(()=>{}).finally(()=>y(!1))},[]);const x=n.length!==a.length||n.some((k,R)=>k!==a[R]),b=j.useCallback(()=>{const k=l.trim();!k||n.includes(k)||(r(R=>[...R,k]),o(""),p(null))},[l,n]),S=j.useCallback(k=>{r(R=>R.filter(A=>A!==k)),p(null)},[]),w=j.useCallback(async()=>{c(!0),p(null);try{const k=await sr("/config/plan-dirs",{plan_dirs:n});i(k.custom),r(k.custom),p({type:"success",text:"Plan directories saved."})}catch{p({type:"error",text:"Failed to save plan directories."})}finally{c(!1)}},[n]),C=j.useCallback(k=>{k.key==="Enter"&&b()},[b]),T=Object.entries(e);return v.jsxs(Ze,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-amber-500",children:[v.jsx(zt,{children:"Plan Capture"}),m?v.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"Loading..."}):v.jsxs("div",{className:"space-y-5",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Agent Directories"}),v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Directories monitored by connected agents. Managed by symbiont manifests."}),T.length===0?v.jsx("p",{className:"font-sans text-xs text-on-surface-variant italic",children:"No agent directories configured."}):v.jsx("div",{className:"space-y-3",children:T.map(([k,R])=>v.jsxs("div",{className:"space-y-1",children:[v.jsx("p",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:k}),v.jsx("div",{className:"space-y-1",children:R.map(A=>v.jsx("div",{className:"rounded bg-surface-container px-3 py-1.5 font-mono text-xs text-on-surface-variant",children:A},A))})]},k))})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Custom Directories"}),v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Additional directories to watch for plan files."}),n.length>0&&v.jsx("div",{className:"space-y-1",children:n.map(k=>v.jsxs("div",{className:"flex items-center gap-2 rounded bg-surface-container px-3 py-1.5",children:[v.jsx("span",{className:"flex-1 font-mono text-xs text-on-surface",children:k}),v.jsx("button",{type:"button",onClick:()=>S(k),className:"font-sans text-xs text-on-surface-variant hover:text-tertiary transition-colors leading-none","aria-label":`Remove ${k}`,children:"x"})]},k))}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(vn,{placeholder:"/path/to/plans",value:l,onChange:k=>o(k.target.value),onKeyDown:C,className:"flex-1 font-mono text-xs"}),v.jsx(ze,{type:"button",size:"sm",onClick:b,disabled:!l.trim(),children:"Add"})]})]}),x&&v.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[v.jsx(ze,{onClick:w,disabled:f,size:"sm",children:f?"Saving...":"Save"}),d&&v.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"&&v.jsx("p",{className:"font-sans text-sm text-primary",children:d.text})]})]})}const Zne=["debug","info","warn","error"],Jne=[{value:"ollama",label:"Ollama"},{value:"openai-compatible",label:"OpenAI-compatible"}],ere=[{value:"1500",label:"1.5K — Executive briefing"},{value:"5000",label:"5K — Deep onboarding"},{value:"10000",label:"10K — Full institutional"}];function W_(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)??_R),contextPromptSearch:((n=e.context)==null?void 0:n.prompt_search)??!0,contextMaxSpores:String(((r=e.context)==null?void 0:r.prompt_max_spores)??BR)}}function tre(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:mb(e.contextDigestTier,_R),prompt_search:e.contextPromptSearch,prompt_max_spores:mb(e.contextMaxSpores,BR)}}}function nre(e,t){const n=W_(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 ei({children:e,hint:t}){return v.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&v.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function Rv({children:e}){return v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function rre(){const{config:e,isLoading:t,saveConfig:n,isSaving:r}=q_(),{data:a}=jp(),{restart:i}=k1(),l=j.useRef(!1),[o,f]=j.useState(null);e&&!l.current&&(l.current=!0,o===null&&f(W_(e)));const[c,d]=j.useState(null),[p,m]=j.useState("idle"),[y,x]=j.useState(""),b=o&&e?nre(o,e):!1,S=j.useCallback((k,R)=>{f(A=>A&&{...A,[k]:R}),d(null)},[]),w=j.useCallback(async()=>{if(!(!o||!e)){d(null);try{await n(tre(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 k=new URLSearchParams({provider:o.embeddingProvider,type:"embedding"});o.embeddingBaseUrl&&k.set("base_url",o.embeddingBaseUrl);const A=(await dt(`/models?${k.toString()}`)).models.length;m("success"),x(`Connected -- ${A} model${A!==1?"s":""} available.`)}catch(k){m("error"),x(k instanceof Error?k.message:"Connection failed.")}}},[o]);if(t||!o||!e)return v.jsxs("div",{className:"p-6",children:[v.jsx(vi,{title:"Settings"}),v.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 v.jsxs("div",{className:"p-6",children:[v.jsx(vi,{title:"Settings",subtitle:"Vault configuration and daemon settings"}),v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsxs(Ze,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[v.jsx(zt,{children:"Project"}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Vault Name"}),v.jsx(vn,{value:T,readOnly:!0,disabled:!0,className:"text-on-surface-variant bg-surface-container-lowest"})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Daemon Port"}),v.jsx(vn,{type:"number",placeholder:"Auto",value:o.daemonPort,onChange:k=>S("daemonPort",k.target.value)}),v.jsx(Rv,{children:"Leave blank to use a random available port."})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Log Level"}),v.jsxs(so,{value:o.logLevel,onValueChange:k=>S("logLevel",k),children:[v.jsx(rl,{children:v.jsx(lo,{})}),v.jsx(al,{children:Zne.map(k=>v.jsx(il,{value:k,children:k},k))})]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Log Retention (days)"}),v.jsx(vn,{type:"number",min:1,max:365,className:"w-24",value:o.logRetentionDays,onChange:k=>S("logRetentionDays",k.target.value)})]})]})]}),v.jsxs(Ze,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre h-fit",children:[v.jsx(zt,{children:"Embedding"}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Provider"}),v.jsxs(so,{value:o.embeddingProvider,onValueChange:k=>{S("embeddingProvider",k),m("idle"),x("")},children:[v.jsx(rl,{children:v.jsx(lo,{})}),v.jsx(al,{children:Jne.map(k=>v.jsx(il,{value:k.value,children:k.label},k.value))})]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Model"}),v.jsx(vn,{placeholder:"bge-m3",value:o.embeddingModel,onChange:k=>S("embeddingModel",k.target.value)})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{hint:"optional",children:"Base URL"}),v.jsx(vn,{type:"url",placeholder:"http://localhost:11434",value:o.embeddingBaseUrl,onChange:k=>{S("embeddingBaseUrl",k.target.value),m("idle"),x("")}})]}),v.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[v.jsxs(ze,{type:"button",variant:"ghost",size:"sm",onClick:C,disabled:p==="testing",children:[p==="testing"?v.jsx(Wn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Test Connection"]}),p==="success"&&v.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-primary",children:[v.jsx(kR,{className:"h-4 w-4"}),y]}),p==="error"&&v.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[v.jsx(wd,{className:"h-4 w-4"}),y]})]})]})]})]}),v.jsxs(Ze,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre",children:[v.jsx(zt,{children:"Context Injection"}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Digest Tier"}),v.jsxs(so,{value:o.contextDigestTier,onValueChange:k=>S("contextDigestTier",k),children:[v.jsx(rl,{children:v.jsx(lo,{})}),v.jsx(al,{children:ere.map(k=>v.jsx(il,{value:k.value,children:k.label},k.value))})]}),v.jsx(Rv,{children:"Token budget for digest context injected at session start."})]}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(ei,{children:"Prompt Search"}),v.jsx(Rv,{children:"Search vault for relevant observations on each prompt."})]}),v.jsx(I_,{checked:o.contextPromptSearch,onCheckedChange:k=>S("contextPromptSearch",k)})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsx(ei,{children:"Max Spores per Prompt"}),v.jsx(vn,{type:"number",min:"0",max:"10",placeholder:"3",value:o.contextMaxSpores,onChange:k=>S("contextMaxSpores",k.target.value)}),v.jsx(Rv,{children:"Maximum observations injected per prompt. Lower = leaner context."})]})]})]}),v.jsx(Wne,{}),v.jsxs(Ze,{level:"low",className:"p-4 flex items-center gap-4 border-t-2 border-t-sage",children:[v.jsxs(ze,{onClick:w,disabled:!b||r,children:[r?v.jsx(Wn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Settings"]}),c&&v.jsx("span",{className:c.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:c.text})]})]})]})}function are(){return Ma({queryKey:["embedding-details"],queryFn:({signal:e})=>dt("/embedding/details",{signal:e}),refetchInterval:Hr.STATS,pollCategory:"standard"})}const Dv=1024;function SA(e){if(e<Dv)return`${e} B`;const t=e/Dv;return t<Dv?`${t.toFixed(1)} KB`:`${(t/Dv).toFixed(1)} MB`}function ire(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function sre(){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,p]=j.useState(""),[m,y]=j.useState(!1);j.useEffect(()=>{dt("/backup/config").then(T=>{p(T.dir??"")}).catch(()=>{})},[]);const x=j.useCallback(async()=>{y(!0);try{await lc("/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{y(!1)}},[d]),b=j.useCallback(async()=>{try{const T=await dt("/backups");t(T.backups),r(!0)}catch(T){o({type:"error",text:`Failed to load backups: ${T.message}`})}},[]);!n&&!a&&(i(!0),b().finally(()=>i(!1)));async function S(){o(null),c(null);try{const T=await sr("/backup");o({type:"success",text:`Backup created: ${T.machine_id} (${SA(T.size_bytes)})`}),await b()}catch(T){o({type:"error",text:`Backup failed: ${T.message}`})}}async function w(T){o(null),c(null);try{const k=await sr("/restore/preview",{machine_id:T});c(k)}catch(k){o({type:"error",text:`Preview failed: ${k.message}`})}}async function C(T){o(null),c(null);try{const k=await sr("/restore",{machine_id:T});o({type:"success",text:`Restored ${k.total_restored} records, skipped ${k.total_skipped} duplicates`})}catch(k){o({type:"error",text:`Restore failed: ${k.message}`})}}return v.jsxs(Ze,{level:"low",className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uz,{className:"h-4 w-4 text-primary"}),v.jsx(zt,{children:"Backup & Restore"})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:b,children:[v.jsx(Qu,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]}),v.jsxs(ze,{variant:"default",size:"sm",onClick:S,children:[v.jsx(nz,{className:"mr-1.5 h-3.5 w-3.5"}),"Backup Now"]})]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("label",{className:"font-sans text-xs text-on-surface-variant flex items-center gap-1.5",children:[v.jsx(oz,{className:"h-3.5 w-3.5"}),"Backup Directory"]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("input",{type:"text",value:d,onChange:T=>p(T.target.value),placeholder:".myco/backups",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"}),v.jsx(ze,{variant:"ghost",size:"sm",onClick:x,disabled:m,children:m?"Saving...":"Save"})]}),v.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Override where backups are stored. Leave empty for default (.myco/backups). Supports ~ for home directory. Useful for network shares or git-tracked directories."})]}),l&&v.jsx("p",{className:je("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),e.length>0?v.jsx("div",{className:"space-y-2",children:e.map(T=>v.jsxs("div",{className:je("flex items-center justify-between rounded-md px-4 py-3","bg-surface-container-lowest transition-colors"),children:[v.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[v.jsx("span",{className:"font-mono text-sm text-on-surface truncate",children:T.machine_id}),v.jsx(Ct,{variant:"secondary",children:SA(T.size_bytes)}),v.jsx("span",{className:"text-xs text-on-surface-variant",children:ire(T.modified_at)})]}),v.jsxs("div",{className:"flex gap-2 flex-shrink-0 ml-3",children:[v.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>w(T.machine_id),children:"Preview"}),v.jsxs(ze,{variant:"secondary",size:"sm",onClick:()=>C(T.machine_id),children:[v.jsx(kz,{className:"mr-1.5 h-3.5 w-3.5"}),"Restore"]})]})]},T.machine_id))}):n?v.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:'No backups yet. Click "Backup Now" to create one.'}):null,f&&v.jsxs(Ze,{level:"lowest",className:"p-4 space-y-3",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(zt,{children:"Restore Preview"}),v.jsx(Ct,{variant:"outline",children:f.machine_id})]}),v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Restore preview",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"text-left text-on-surface-variant",children:[v.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),v.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"New"}),v.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Existing"})]})}),v.jsx("tbody",{children:f.tables.map((T,k)=>v.jsxs("tr",{className:je("transition-colors hover:bg-surface-container-high/50",k%2===1?"bg-surface-container-low/30":""),children:[v.jsx("td",{className:"py-2 pr-4",children:T.table}),v.jsx("td",{className:"py-2 pr-4 text-right",children:T.new>0?v.jsx("span",{className:"text-primary",children:T.new}):0}),v.jsx("td",{className:"py-2 text-right text-on-surface-variant",children:T.existing})]},T.table))})]})}),v.jsxs("div",{className:"flex gap-4 font-sans text-sm text-on-surface-variant",children:[v.jsxs("span",{children:["New: ",v.jsx("strong",{className:"text-primary",children:f.total_new})]}),v.jsxs("span",{children:["Existing: ",v.jsx("strong",{children:f.total_existing})]})]})]})]})}const lre=["stable","beta"],EA=500,ore=6e4;function ure(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"}function cre(){const{data:e}=zR(),t=Iz(),n=Fz(),r=Uz(),[a,i]=j.useState("idle"),[l,o]=j.useState(null),f=j.useCallback(async()=>{i("applying"),o(null);try{await n.mutateAsync(),i("restarting");const b=Date.now()+ore;await new Promise((S,w)=>{const C=async()=>{if(Date.now()>b){w(new Error("timeout"));return}try{if((await fetch("/health")).ok){S();return}}catch{}setTimeout(C,EA)};setTimeout(C,EA)}),window.location.reload()}catch(b){i("error");const S=b.message==="timeout"?"Daemon did not restart within the expected time. Check the terminal.":b.message;o(S)}},[n]),c=j.useCallback(()=>{t.mutate()},[t]),d=j.useCallback(b=>{r.mutate(b)},[r]);if(!e)return null;const p=t.isPending,m=a==="applying"||a==="restarting",y=e.update_available===!0,x=e.channel??"stable";return e.exempt?v.jsxs(Ze,{level:"low",className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Sz,{className:"h-4 w-4 text-primary"}),v.jsx(zt,{children:"Updates"})]}),v.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Updates are disabled in development mode."," ",v.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version})]})]}):v.jsxs(Ze,{level:"low",className:"p-6 space-y-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(lT,{className:je("h-4 w-4",y?"text-secondary":"text-primary")}),v.jsx(zt,{children:"Updates"})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version}),y&&e.latest_version&&v.jsx(Ct,{variant:"warning",children:e.latest_version})]})]}),v.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[y?v.jsx(ze,{variant:"default",size:"sm",onClick:f,disabled:m,children:m?v.jsxs(v.Fragment,{children:[v.jsx(Qu,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),a==="restarting"?"Restarting…":"Updating…"]}):v.jsxs(v.Fragment,{children:[v.jsx(lT,{className:"mr-1.5 h-3.5 w-3.5"}),"Update & Restart"]})}):v.jsxs("div",{className:"flex items-center gap-1.5 text-primary",children:[v.jsx(x1,{className:"h-4 w-4"}),v.jsx("span",{className:"font-sans text-sm",children:"Up to date"})]}),v.jsxs(ze,{variant:"ghost",size:"sm",onClick:c,disabled:p||m,children:[v.jsx(Qu,{className:je("mr-1.5 h-3.5 w-3.5",p&&"animate-spin")}),"Check Now"]})]}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{className:"flex items-center gap-1",children:lre.map(b=>v.jsx(ze,{variant:x===b?"default":"ghost",className:"text-xs capitalize h-6 px-2",onClick:()=>d(b),disabled:r.isPending||m,children:b},b))}),v.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Checked: ",ure(e.last_check)]})]}),(a==="error"||e.error)&&v.jsxs("div",{className:"flex items-start gap-2 text-tertiary",children:[v.jsx(oa,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),v.jsx("span",{className:"font-sans text-sm",children:l??e.error})]})]})}const fre=["sessions","spores","plans","artifacts"],CA="embedding",dre=100,TA=2e3,hre=40,NA=20,vre=[{id:"embedding",label:"Embedding"},{id:"system",label:"System"}],pre=new Set(["embedding","system"]),Z_="tab";function mre(){const t=new URLSearchParams(window.location.search).get(Z_);return t&&pre.has(t)?t:"embedding"}function gre(e){const t=new URLSearchParams;e!=="embedding"&&t.set(Z_,e);const n=t.toString(),r=n?`${window.location.pathname}?${n}`:window.location.pathname;window.history.replaceState(null,"",r)}function yre(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"processing":"idle":"unavailable"}function xre(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"bg-secondary":"bg-primary":"bg-tertiary"}function bre(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 wre(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=hre}function Sre({data:e}){return v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Embedding namespace breakdown",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"text-left text-on-surface-variant",children:[v.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Namespace"}),v.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Embedded"}),v.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Pending"}),v.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Stale"}),v.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Total"})]})}),v.jsx("tbody",{children:fre.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 v.jsxs("tr",{className:je("transition-colors hover:bg-surface-container-high/50",n%2===1?"bg-surface-container-low/30":""),children:[v.jsx("td",{className:"py-2.5 pr-4",children:t}),v.jsx("td",{className:"py-2.5 pr-4 text-right",children:a}),v.jsx("td",{className:"py-2.5 pr-4 text-right",children:l>0?v.jsx("span",{className:"text-secondary",children:l}):l}),v.jsx("td",{className:"py-2.5 pr-4 text-right",children:i>0?v.jsx("span",{className:"text-tertiary",children:i}):i}),v.jsx("td",{className:"py-2.5 text-right",children:o})]},t)})})]})})}function Ere({entry:e}){return v.jsxs("tr",{className:"hover:bg-surface-container-high/30 transition-colors",children:[v.jsx("td",{className:"whitespace-nowrap py-1.5 pl-4 pr-3 text-on-surface-variant/60 align-top w-[68px]",children:bre(e.timestamp)}),v.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[20px]",children:v.jsx("div",{className:je("h-2 w-2 rounded-full mt-1",T1(e.level))})}),v.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[54px]",children:v.jsx(Ct,{variant:PR(e.level),className:"px-1.5 py-0 text-[10px] uppercase",children:e.level})}),v.jsx("td",{className:"py-1.5 pr-4 text-on-surface align-top break-words",children:e.message})]})}function Cre({data:e}){const t=xr(),[n,r]=j.useState(null),[a,i]=j.useState([]);j.useEffect(()=>{i(_=>{const B=[..._,e.total];return B.length>NA?B.slice(-NA):B})},[e]);const[l,o]=j.useState([]),[f,c]=j.useState(void 0),[d,p]=j.useState(!0),[m,y]=j.useState(!1),x=j.useRef(null),b=j.useRef(d);b.current=d;const S=j.useRef(f);S.current=f;const{data:w}=Ma({queryKey:["embedding-logs"],queryFn:({signal:_})=>{const B=new URLSearchParams({limit:String(dre),category:CA});return S.current&&B.set("since",S.current),dt(`/logs?${B.toString()}`,{signal:_})},refetchInterval:Hr.LOGS,pollCategory:"standard"});j.useEffect(()=>{w!=null&&w.entries.length&&(o(_=>{let B;if(w.cursor_reset){const q=new Set(_.map(G=>`${G.timestamp}|${G.message}`)),V=w.entries.filter(G=>!q.has(`${G.timestamp}|${G.message}`));B=V.length?[..._,...V]:_}else B=[..._,...w.entries];return B.length>TA?B.slice(-TA):B}),c(w.cursor),b.current||y(!0))},[w]),j.useEffect(()=>{!d||!x.current||(x.current.scrollTop=x.current.scrollHeight,y(!1))},[l,d]);const C=j.useCallback(()=>{const _=x.current;_&&(wre(_)?(p(!0),y(!1)):p(!1))},[]),T=j.useCallback(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight,p(!0),y(!1))},[]),k=j.useMemo(()=>{const _=Jv.debug;return l.filter(B=>!(Jv[B.level]<_||B.category!==CA))},[l]);async function R(){r(null);try{const _=await sr("/embedding/reembed-stale");r({type:"success",text:`Re-embedded ${_.reembedded} stale vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}async function A(){if(confirm("This will re-embed all vectors. Continue?")){r(null);try{const _=await sr("/embedding/rebuild");r({type:"success",text:`Rebuild queued: ${_.queued} vectors to re-embed`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}}async function D(){r(null);try{const _=await sr("/embedding/clean-orphans");r({type:"success",text:`Cleaned ${_.orphans_cleaned} orphan vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}async function L(){r(null);try{const _=await sr("/embedding/reconcile");r({type:"success",text:`Reconcile complete: ${_.embedded} embedded, ${_.orphans_cleaned} orphans cleaned (${_.duration_ms}ms)`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(_){r({type:"error",text:`Error: ${_.message}`})}}const P=Object.values(e.pending).reduce((_,B)=>_+B,0),M=Object.values(e.by_namespace).reduce((_,B)=>_+B.stale,0);return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(b1,{className:"h-4 w-4 text-primary"}),v.jsx("span",{className:"text-on-surface-variant",children:"Provider"}),v.jsx("span",{className:"font-mono text-on-surface",children:e.provider.name})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-on-surface-variant",children:"Model"}),v.jsx("span",{className:"font-mono text-xs text-on-surface truncate max-w-[200px]",title:e.provider.model,children:e.provider.model})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:je("h-2 w-2 rounded-full",xre(e))}),v.jsx("span",{className:"text-on-surface-variant capitalize",children:yre(e)})]})]}),v.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[v.jsx(an,{label:"Total Vectors",value:String(e.total),sparklineData:a,accent:"sage"}),v.jsx(an,{label:"Pending",value:String(P),accent:P>0?"ochre":"outline"}),v.jsx(an,{label:"Stale",value:String(M),accent:M>0?"terracotta":"outline"})]}),v.jsxs(Ze,{level:"low",className:"p-6 space-y-4",children:[v.jsx(zt,{children:"Namespace Breakdown"}),v.jsx(Sre,{data:e})]}),v.jsxs(Ze,{level:"low",className:"p-6 space-y-3",children:[v.jsx(zt,{children:"Actions"}),v.jsxs("div",{className:"flex flex-wrap gap-2",children:[v.jsxs(ze,{variant:"ghost",size:"sm",onClick:R,children:[v.jsx(Qu,{className:"mr-2 h-4 w-4"}),"Re-embed stale"]}),v.jsxs(ze,{variant:"ghost",size:"sm",onClick:D,children:[v.jsx(co,{className:"mr-2 h-4 w-4"}),"Clean orphans"]}),v.jsxs(ze,{variant:"secondary",size:"sm",onClick:L,children:[v.jsx(Xu,{className:"mr-2 h-4 w-4"}),"Force reconcile"]}),v.jsxs(ze,{variant:"destructive",size:"sm",onClick:A,children:[v.jsx(w1,{className:"mr-2 h-4 w-4"}),"Rebuild all"]})]}),n&&v.jsx("p",{className:je("font-sans text-sm",n.type==="success"?"text-primary":"text-tertiary"),children:n.text})]}),v.jsxs(Ze,{level:"low",className:"flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[v.jsx(zt,{children:"Activity Log"}),v.jsxs(ze,{size:"sm",variant:d?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{d?p(!1):T()},title:d?"Pause auto-scroll":"Resume auto-scroll",children:[d?v.jsx(gz,{className:"h-3 w-3"}):v.jsx(Xu,{className:"h-3 w-3"}),d?"Pause":"Resume"]})]}),v.jsxs("div",{className:"relative flex-1 p-0",children:[v.jsx("div",{ref:x,onScroll:C,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:k.length===0?v.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No embedding log entries"}):v.jsx("table",{className:"w-full border-collapse","aria-label":"Embedding activity log",children:v.jsx("tbody",{children:k.map((_,B)=>v.jsx(Ere,{entry:_},`${_.timestamp}-${B}`))})})}),m&&!d&&v.jsxs("button",{type:"button",onClick:T,className:je("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:[v.jsx(QP,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}function Tre(){return v.jsxs("div",{className:"space-y-6",children:[v.jsx(cre,{}),v.jsx(sre,{})]})}const Nre={embedding:"Embedding health, maintenance actions, and activity log",system:"Software updates and backup management"};function kre(){const{data:e,isLoading:t,isError:n,error:r}=are(),[a,i]=j.useState(mre),l=j.useCallback(o=>{const f=o;i(f),gre(f)},[]);return v.jsx(B1,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Loading operations...",children:e&&v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsx("div",{className:"px-6 pt-6",children:v.jsx(vi,{title:"Operations",subtitle:Nre[a],tabs:vre,activeTab:a,onTabChange:l})}),v.jsx("div",{className:"flex-1 overflow-auto",children:v.jsxs("div",{className:"px-6 pb-6",children:[a==="embedding"&&v.jsx(Cre,{data:e}),a==="system"&&v.jsx(Tre,{})]})})]})})}function jre(){return Ma({queryKey:["team-status"],queryFn:({signal:e})=>dt("/team/status",{signal:e}),refetchInterval:Hr.STATS,pollCategory:"standard"})}function H0({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 v.jsxs("div",{className:"space-y-1",children:[v.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),v.jsxs("div",{className:"flex items-center gap-2 group",children:[v.jsx("span",{className:`text-sm text-on-surface break-all ${n?"font-mono":""}`,children:t}),v.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?v.jsx(bd,{className:"h-3.5 w-3.5 text-primary"}):v.jsx(AR,{className:"h-3.5 w-3.5"})})]})]})}function Are({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 v.jsxs("div",{className:"space-y-1",children:[v.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),v.jsxs("div",{className:"flex items-center gap-2 group",children:[v.jsx("span",{className:"text-sm text-on-surface font-mono break-all",children:n?t:o}),v.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?v.jsx(rz,{className:"h-3.5 w-3.5"}):v.jsx(az,{className:"h-3.5 w-3.5"})}),v.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?v.jsx(bd,{className:"h-3.5 w-3.5 text-primary"}):v.jsx(AR,{className:"h-3.5 w-3.5"})})]})]})}function Rre({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 sr("/team/connect",{url:t,api_key:r}),e()}catch(p){l(p instanceof Error?p.message:"Connection failed")}finally{f(!1)}};return v.jsxs(Ze,{level:"low",ghostBorder:!0,className:"p-6",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[v.jsx(OR,{className:"h-4 w-4 text-on-surface-variant"}),v.jsx(zt,{children:"Connect to team"})]}),v.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."}),v.jsxs("form",{onSubmit:c,className:"space-y-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"Worker URL"}),v.jsx(vn,{type:"url",placeholder:"https://myco-team.your-account.workers.dev",value:t,onChange:d=>n(d.target.value),required:!0})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"API Key"}),v.jsx(vn,{type:"password",placeholder:"your-api-key",value:r,onChange:d=>a(d.target.value),required:!0})]}),i&&v.jsx("p",{className:"text-sm text-tertiary",children:i}),v.jsx(ze,{type:"submit",size:"sm",disabled:o||!t||!r,children:o?v.jsxs(v.Fragment,{children:[v.jsx(Qu,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Connecting..."]}):"Connect"})]})]})}function Dre({status:e}){const t=xr(),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),f=async()=>{r(!0);try{await sr("/team/disconnect"),t.invalidateQueries({queryKey:["team-status"]})}finally{r(!1)}},c=j.useCallback(async()=>{i(!0),o(null);try{const d=await sr("/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 v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[v.jsx(an,{label:"Status",value:e.healthy?"Connected":"Unhealthy",icon:e.healthy?Az:OR}),v.jsx(an,{label:"Pending sync",value:e.pending_sync_count}),v.jsx(an,{label:"Protocol",value:`v${e.sync_protocol_version}`}),v.jsx(an,{label:"Schema",value:`v${e.schema_version}`})]}),v.jsxs(Ze,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx(zt,{children:"Team Credentials"}),v.jsx(Ct,{variant:e.healthy?"default":"destructive",children:e.healthy?"healthy":"unhealthy"})]}),v.jsx("p",{className:"text-xs text-on-surface-variant",children:"Share these with teammates so they can connect from the Team page."}),v.jsxs("div",{className:"space-y-3",children:[e.worker_url&&v.jsx(H0,{label:"Worker URL",value:e.worker_url}),e.api_key&&v.jsx(Are,{label:"API Key",value:e.api_key})]})]}),v.jsxs(Ze,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[v.jsx(zt,{children:"This Node"}),v.jsxs("div",{className:"grid gap-3",children:[v.jsx(H0,{label:"Machine ID",value:e.machine_id}),v.jsx(H0,{label:"Package Version",value:e.package_version})]}),e.health_error&&v.jsx("p",{className:"text-sm text-tertiary mt-2",children:e.health_error})]}),v.jsxs(Ze,{level:"low",ghostBorder:!0,className:"p-5 space-y-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx(zt,{children:"Sync"}),v.jsx(ze,{variant:"default",size:"sm",onClick:c,disabled:a,children:a?v.jsxs(v.Fragment,{children:[v.jsx(Qu,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Syncing..."]}):"Sync All"})]}),v.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&&v.jsx("p",{className:"text-sm text-primary",children:l})]}),v.jsx("div",{className:"flex justify-end",children:v.jsx(ze,{variant:"outline",size:"sm",onClick:f,disabled:n,children:n?"Disconnecting...":"Disconnect"})})]})}function Mre(){const{data:e,isLoading:t}=jre(),n=xr();if(t)return v.jsx(B1,{});const r=(e==null?void 0:e.enabled)&&(e==null?void 0:e.worker_url);return v.jsxs("div",{className:"p-6 max-w-4xl",children:[v.jsx(vi,{title:"Team",subtitle:"Share knowledge across machines with team sync"}),r&&e?v.jsx(Dre,{status:e}):v.jsxs("div",{className:"space-y-4",children:[v.jsxs(Ze,{level:"low",ghostBorder:!0,className:"p-6 space-y-4",children:[v.jsx(zt,{children:"Getting Started"}),v.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."}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"1. Install Wrangler"}),v.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"})]}),v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"2. Provision the team"}),v.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"myco team init"}),v.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."})]}),v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"3. Connect"}),v.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Paste the Worker URL and API key below, or if you ran ",v.jsx("code",{className:"font-mono",children:"myco team init"}),", you're already connected."]})]})]})]}),v.jsx(Rre,{onConnected:()=>n.invalidateQueries({queryKey:["team-status"]})})]})]})}const Ore=[{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 Lre({mode:e,onModeChange:t,searchValue:n,onSearchChange:r,onSearchSubmit:a,activeLevel:i,onLevelChange:l,components:o,activeComponents:f,onComponentToggle:c,onComponentsClear:d,timeRange:p,onTimeRangeChange:m,totalResults:y}){return v.jsxs(Ze,{level:"default",className:"rounded-md p-3 space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("div",{className:"flex items-center rounded-md bg-surface-container-low",children:[v.jsxs(ze,{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:[v.jsx(DR,{className:"h-3 w-3"}),"Live"]}),v.jsxs(ze,{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:[v.jsx(ic,{className:"h-3 w-3"}),"Search"]})]}),e==="search"&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"h-5 w-px bg-outline-variant/30"}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(jR,{className:"h-3 w-3 text-on-surface-variant/50"}),Ore.map(x=>v.jsx(ze,{size:"sm",variant:p===x.value?"default":"ghost",className:"h-6 px-1.5 text-[10px]",onClick:()=>m(x.value),children:x.label},x.value))]})]}),v.jsx("form",{className:"ml-auto flex items-center gap-1.5",onSubmit:x=>{x.preventDefault(),a()},children:v.jsx(vn,{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&&v.jsxs("span",{className:"text-[10px] font-mono text-on-surface-variant/50 tabular-nums whitespace-nowrap",children:[y.toLocaleString()," results"]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"flex items-center gap-1",children:Pz.map(x=>v.jsxs(ze,{size:"sm",variant:i===x?"default":"ghost",className:"h-6 px-2 text-[10px] capitalize gap-1.5",onClick:()=>l(x),children:[v.jsx("div",{className:je("h-1.5 w-1.5 rounded-full",T1(x))}),x]},x))}),o.length>0&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"h-4 w-px bg-outline-variant/20"}),v.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[o.map(x=>v.jsx(ze,{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&&v.jsx(ze,{size:"sm",variant:"ghost",className:"h-5 px-1.5 text-[10px] text-on-surface-variant",onClick:d,children:"clear"})]})]})]})]})}const _re={debug:"border-l-outline/30",info:"border-l-primary/50",warn:"border-l-secondary/70",error:"border-l-tertiary/80"},Bre={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 Pre(e,t){if(t)return z1(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 zre({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]),v.jsx("div",{ref:l,className:"flex-1 overflow-y-auto bg-surface-container-lowest font-mono text-xs",children:e.length===0?v.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"}):v.jsx("table",{className:"w-full border-collapse","aria-label":"Log entries",children:v.jsx("tbody",{children:e.map(o=>v.jsx(Ire,{entry:o,selected:o.id===t,onSelect:n,relativeTime:a,compact:i},o.id))})})})}const Ire=j.memo(function({entry:t,selected:n,onSelect:r,relativeTime:a,compact:i}){const l=i?"py-0.5":"py-1.5";return v.jsxs("tr",{className:je("cursor-pointer transition-colors border-l-2",_re[t.level],n?"bg-primary/10":"hover:bg-surface-container-high/30"),onClick:()=>r(t),children:[v.jsx("td",{className:je("whitespace-nowrap pl-3 pr-2 text-on-surface-variant/50 align-top w-[68px] tabular-nums",l),children:Pre(t.timestamp,a)}),v.jsx("td",{className:je("whitespace-nowrap pr-1 align-top w-[12px]",l),children:v.jsx("div",{className:je("h-1.5 w-1.5 rounded-full mt-1",T1(t.level))})}),v.jsx("td",{className:je("whitespace-nowrap pr-2 align-top w-[48px]",l),children:v.jsx(Ct,{variant:PR(t.level),className:"px-1 py-0 text-[9px] uppercase",children:t.level})}),v.jsx("td",{className:je("whitespace-nowrap pr-2 align-top w-[90px] truncate max-w-[90px]",l,Bre[t.component]??"text-on-surface-variant/60"),children:t.component}),v.jsx("td",{className:je("pr-3 text-on-surface align-top break-words",l),children:t.message})]})});function Fre({value:e}){const t=String(e),n=t.slice(0,8);return v.jsxs(ja,{to:`/sessions/${t}`,className:"font-mono text-primary hover:underline",children:[n,"..."]})}function Ure({value:e}){return Array.isArray(e)?v.jsx("span",{className:"flex flex-wrap gap-1",children:e.map((t,n)=>v.jsx(Ct,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:String(t)},n))}):v.jsx("span",{children:String(e)})}function qre({value:e}){return Array.isArray(e)?v.jsx("span",{className:"flex gap-1",children:e.map((t,n)=>v.jsx(Ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 tabular-nums",children:String(t)},n))}):v.jsx("span",{children:String(e)})}function Vre({value:e}){return v.jsx("span",{className:"rounded bg-tertiary/10 px-2 py-0.5 text-tertiary font-mono text-[11px]",children:String(e)})}function kA({value:e}){return v.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 Hre({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`,v.jsx("span",{className:"tabular-nums",title:t.toISOString(),children:o})}function Gre({value:e}){return typeof e=="object"&&e!==null?v.jsx("pre",{className:"text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):v.jsx("span",{children:String(e)})}const $re={session_id:Fre,spore_titles:Ure,scores:qre,error:Vre,preview:kA,generated_at:Hre,text:kA},Kre=new Set(["id","timestamp","level","kind","component","message"]);function jA(e,t){const n=$re[e]??Gre;return v.jsx(n,{value:t})}function Yre(e){return Kre.has(e)}function Xre(e){return e?Object.entries(e).filter(([t])=>!Yre(t)):[]}const Qre={debug:"text-on-surface-variant/60",info:"text-primary",warn:"text-secondary",error:"text-tertiary"};function Wre({entry:e,resolved:t,onClose:n}){const r=Xre(e.data);return v.jsxs("div",{className:"flex h-full flex-col bg-surface-container-low",children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/10",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-mono",children:e.kind}),v.jsx("span",{className:je("text-xs font-medium",Qre[e.level]),children:e.level.toUpperCase()})]}),v.jsx(ze,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:n,"aria-label":"Close detail panel",children:v.jsx(sc,{className:"h-3.5 w-3.5"})})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Timestamp"}),v.jsx("div",{className:"font-mono text-xs tabular-nums",children:new Date(e.timestamp).toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Message"}),v.jsx("div",{className:"text-sm text-on-surface leading-relaxed",children:e.message})]}),e.session_id&&v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Session"}),v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[jA("session_id",e.session_id),(t==null?void 0:t.session_title)&&v.jsx("span",{className:"text-on-surface-variant/70",children:String(t.session_title)})]})]}),r.length>0&&v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-1.5",children:"Metadata"}),v.jsx("div",{className:"space-y-2",children:r.map(([a,i])=>v.jsxs("div",{children:[v.jsx("div",{className:"text-[10px] text-on-surface-variant/40 mb-0.5",children:a}),v.jsx("div",{className:"text-xs",children:jA(a,i)})]},a))})]})]}),v.jsx("div",{className:"px-4 py-2 border-t border-outline-variant/10",children:v.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/40 tabular-nums",children:["id: ",e.id]})})]})}const AA=5e3;function Zre(){const[e,t]=j.useState([]),n=j.useRef(0),{data:r}=cn({queryKey:["logs-stream"],queryFn:({signal:i})=>dt(`/logs/stream?since=${n.current}`,{signal:i}),refetchInterval:Hr.LOGS});j.useEffect(()=>{r!=null&&r.entries.length&&(n.current=r.cursor,t(i=>{const l=[...i,...r.entries];return l.length>AA?l.slice(-AA):l}))},[r]);const a=j.useCallback(()=>{t([])},[]);return{entries:e,clear:a}}function Jre(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)),cn({queryKey:["logs-search",Object.fromEntries(n)],queryFn:({signal:r})=>dt(`/logs/search?${n.toString()}`,{signal:r}),enabled:t})}function eae(e){return cn({queryKey:["log-detail",e],queryFn:({signal:t})=>dt(`/logs/${e}`,{signal:t}),enabled:e!==null})}function tae(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 nae(){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,p]=j.useState("24h"),[m,y]=j.useState(1),[x,b]=j.useState(null),{entries:S}=Zre(),w=j.useMemo(()=>({q:a||void 0,level:l!=="debug"?l:void 0,component:f.size>0?Array.from(f).join(","):void 0,from:tae(d),page:m,page_size:qr}),[a,l,f,d,m]),{data:C}=Jre(w,e==="search"),{data:T}=eae((x==null?void 0:x.id)??null),[k,R]=j.useState([]);j.useEffect(()=>{const V=e==="live"?S:(C==null?void 0:C.entries)??[];R(G=>{const F=new Set(G);let H=!1;for(const Y of V)F.has(Y.component)||(F.add(Y.component),H=!0);return H?Array.from(F).sort():G})},[S,C,e]);const A=j.useMemo(()=>{const V=Jv[l]??0,G=n.trim().toLowerCase();return S.filter(F=>!((Jv[F.level]??0)<V||f.size>0&&!f.has(F.component)||G&&!F.message.toLowerCase().includes(G)))},[S,l,f,n]),D=e==="live"?A:(C==null?void 0:C.entries)??[],L=j.useCallback(V=>{t(V),b(null)},[]),P=j.useCallback(()=>{i(n),y(1)},[n]),M=j.useCallback(V=>{b(G=>(G==null?void 0:G.id)===V.id?null:V)},[]),_=j.useCallback(V=>{c(G=>{const F=new Set(G);return F.has(V)?F.delete(V):F.add(V),F}),y(1)},[]),B=j.useCallback(V=>{o(V),y(1)},[]),q=x!==null;return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsx("div",{className:"px-6 pt-6",children:v.jsx(vi,{title:"Logs",subtitle:"Daemon log explorer"})}),v.jsx("div",{className:"px-6 mb-3",children:v.jsx(Lre,{mode:e,onModeChange:L,searchValue:n,onSearchChange:r,onSearchSubmit:P,activeLevel:l,onLevelChange:B,components:k,activeComponents:f,onComponentToggle:_,onComponentsClear:()=>{c(new Set),y(1)},timeRange:d,onTimeRangeChange:V=>{p(V),y(1)},totalResults:e==="search"?C==null?void 0:C.total:void 0})}),v.jsxs("div",{className:"flex flex-1 overflow-hidden mx-6 mb-6 rounded-lg border border-outline-variant/10",children:[v.jsxs("div",{className:je("flex flex-col",q?"w-3/5":"w-full"),children:[v.jsx(zre,{entries:D,selectedId:(x==null?void 0:x.id)??null,onSelect:M,autoScroll:e==="live",relativeTime:e==="live",compact:!0}),e==="search"&&C&&v.jsx("div",{className:"border-t border-outline-variant/10 px-3 py-2 bg-surface-container-low",children:v.jsx(pc,{total:C.total,offset:(m-1)*qr,limit:qr,onPageChange:V=>y(Math.floor(V/qr)+1)})})]}),q&&x&&v.jsx("div",{className:"w-2/5 border-l border-outline-variant/10",children:v.jsx(Wre,{entry:x,resolved:T==null?void 0:T.resolved,onClose:()=>b(null)})})]})]})}function rae(){return v.jsx(JB,{children:v.jsxs(wa,{element:v.jsx(OF,{}),children:[v.jsx(wa,{path:"/",element:v.jsx(AU,{})}),v.jsx(wa,{path:"/sessions",element:v.jsx(LN,{})}),v.jsx(wa,{path:"/sessions/:id",element:v.jsx(LN,{})}),v.jsx(wa,{path:"/mycelium",element:v.jsx(Tte,{})}),v.jsx(wa,{path:"/agent",element:v.jsx(wne,{})}),v.jsx(wa,{path:"/skills",element:v.jsx(Qne,{})}),v.jsx(wa,{path:"/settings",element:v.jsx(rre,{})}),v.jsx(wa,{path:"/operations",element:v.jsx(kre,{})}),v.jsx(wa,{path:"/team",element:v.jsx(Mre,{})}),v.jsx(wa,{path:"/logs",element:v.jsx(nae,{})})]})})}const aae=new F4({defaultOptions:{queries:{staleTime:Bz}}});p4.createRoot(document.getElementById("root")).render(v.jsx(Ui.StrictMode,{children:v.jsx(_P,{children:v.jsx(UP,{children:v.jsx(GP,{children:v.jsx(U4,{client:aae,children:v.jsx(EP,{children:v.jsx(rae,{})})})})})})}));
|