@marktoflow/gui 2.0.0-alpha.4 → 2.0.0-alpha.5
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/.turbo/turbo-build.log +24 -8
- package/README.md +11 -1
- package/dist/client/assets/index-CM44OayM.js +704 -0
- package/dist/client/assets/index-CM44OayM.js.map +1 -0
- package/dist/client/assets/index-Dru63gi6.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/{server/index.js → index.js} +22 -1
- package/dist/server/index.js.map +1 -0
- package/dist/server/routes/executions.js +125 -0
- package/dist/server/routes/executions.js.map +1 -0
- package/dist/server/{server/routes → routes}/workflows.js +37 -1
- package/dist/server/routes/workflows.js.map +1 -0
- package/dist/server/{server/services → services}/WorkflowService.js +158 -15
- package/dist/server/services/WorkflowService.js.map +1 -0
- package/dist/server/{server/websocket → websocket}/index.js +12 -0
- package/dist/server/{server/websocket → websocket}/index.js.map +1 -1
- package/marktoflow-gui-2.0.0-alpha.5.tgz +0 -0
- package/package.json +19 -5
- package/scripts/flatten-dist.js +69 -0
- package/src/client/components/Canvas/Canvas.tsx +3 -1
- package/src/client/components/Canvas/ExecutionOverlay.tsx +120 -32
- package/src/client/components/Canvas/ForEachNode.tsx +27 -3
- package/src/client/components/Canvas/IfElseNode.tsx +22 -7
- package/src/client/components/Canvas/NodeContextMenu.tsx +8 -4
- package/src/client/components/Canvas/ParallelNode.tsx +25 -8
- package/src/client/components/Canvas/SwitchNode.tsx +41 -20
- package/src/client/components/Canvas/Toolbar.tsx +59 -21
- package/src/client/components/Canvas/TransformNode.tsx +9 -0
- package/src/client/components/Canvas/WhileNode.tsx +35 -3
- package/src/client/components/Debug/VariableInspector.tsx +148 -0
- package/src/client/components/Prompt/PromptInput.tsx +3 -1
- package/src/client/components/Settings/ProviderSwitcher.tsx +228 -0
- package/src/client/components/Sidebar/ImportDialog.tsx +257 -0
- package/src/client/components/Sidebar/Sidebar.tsx +21 -2
- package/src/client/components/common/KeyboardShortcuts.tsx +8 -2
- package/src/client/stores/agentStore.ts +109 -0
- package/src/client/stores/executionStore.ts +64 -2
- package/src/client/stores/workflowStore.ts +10 -2
- package/src/client/styles/globals.css +106 -0
- package/src/client/utils/platform.ts +46 -0
- package/src/client/utils/workflowToGraph.ts +245 -21
- package/src/server/index.ts +24 -1
- package/src/server/routes/executions.ts +136 -0
- package/src/server/routes/workflows.ts +42 -1
- package/src/server/services/WorkflowService.ts +176 -16
- package/src/server/websocket/index.ts +13 -0
- package/tests/unit/ForEachNode.test.tsx +96 -6
- package/tests/unit/IfElseNode.test.tsx +47 -0
- package/tests/unit/ParallelNode.test.tsx +80 -0
- package/tests/unit/SwitchNode.test.tsx +75 -0
- package/tests/unit/WhileNode.test.tsx +12 -8
- package/tests/unit/agentStore.test.ts +218 -0
- package/tests/unit/executionStore.test.ts +40 -0
- package/tests/unit/platform.test.ts +118 -0
- package/tests/unit/workflowToGraph.test.ts +22 -0
- package/dist/client/assets/index-C90Y_aBX.js +0 -678
- package/dist/client/assets/index-C90Y_aBX.js.map +0 -1
- package/dist/client/assets/index-CRWeQ3NN.css +0 -1
- package/dist/server/server/index.js.map +0 -1
- package/dist/server/server/routes/workflows.js.map +0 -1
- package/dist/server/server/services/WorkflowService.js.map +0 -1
- /package/dist/server/{server/routes → routes}/ai.js +0 -0
- /package/dist/server/{server/routes → routes}/ai.js.map +0 -0
- /package/dist/server/{server/routes → routes}/execute.js +0 -0
- /package/dist/server/{server/routes → routes}/execute.js.map +0 -0
- /package/dist/server/{server/routes → routes}/tools.js +0 -0
- /package/dist/server/{server/routes → routes}/tools.js.map +0 -0
- /package/dist/server/{server/services → services}/AIService.js +0 -0
- /package/dist/server/{server/services → services}/AIService.js.map +0 -0
- /package/dist/server/{server/services → services}/FileWatcher.js +0 -0
- /package/dist/server/{server/services → services}/FileWatcher.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/claude-code-provider.js +0 -0
- /package/dist/server/{server/services → services}/agents/claude-code-provider.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/claude-provider.js +0 -0
- /package/dist/server/{server/services → services}/agents/claude-provider.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/codex-provider.js +0 -0
- /package/dist/server/{server/services → services}/agents/codex-provider.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/copilot-provider.js +0 -0
- /package/dist/server/{server/services → services}/agents/copilot-provider.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/demo-provider.js +0 -0
- /package/dist/server/{server/services → services}/agents/demo-provider.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/index.js +0 -0
- /package/dist/server/{server/services → services}/agents/index.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/ollama-provider.js +0 -0
- /package/dist/server/{server/services → services}/agents/ollama-provider.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/prompts.js +0 -0
- /package/dist/server/{server/services → services}/agents/prompts.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/registry.js +0 -0
- /package/dist/server/{server/services → services}/agents/registry.js.map +0 -0
- /package/dist/server/{server/services → services}/agents/types.js +0 -0
- /package/dist/server/{server/services → services}/agents/types.js.map +0 -0
- /package/dist/{server/shared → shared}/constants.js +0 -0
- /package/dist/{server/shared → shared}/constants.js.map +0 -0
- /package/dist/{server/shared → shared}/types.js +0 -0
- /package/dist/{server/shared → shared}/types.js.map +0 -0
|
@@ -0,0 +1,704 @@
|
|
|
1
|
+
function g3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var iu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hp={exports:{}},Ca={},pp={exports:{}},Oe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 h_;function y3(){if(h_)return Oe;h_=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function g(P){return P===null||typeof P!="object"?null:(P=m&&P[m]||P["@@iterator"],typeof P=="function"?P:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function w(P,W,oe){this.props=P,this.context=W,this.refs=x,this.updater=oe||v}w.prototype.isReactComponent={},w.prototype.setState=function(P,W){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,W,"setState")},w.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function S(){}S.prototype=w.prototype;function C(P,W,oe){this.props=P,this.context=W,this.refs=x,this.updater=oe||v}var k=C.prototype=new S;k.constructor=C,b(k,w.prototype),k.isPureReactComponent=!0;var N=Array.isArray,j=Object.prototype.hasOwnProperty,A={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function O(P,W,oe){var K,J={},te=null,Y=null;if(W!=null)for(K in W.ref!==void 0&&(Y=W.ref),W.key!==void 0&&(te=""+W.key),W)j.call(W,K)&&!R.hasOwnProperty(K)&&(J[K]=W[K]);var ee=arguments.length-2;if(ee===1)J.children=oe;else if(1<ee){for(var ie=Array(ee),ue=0;ue<ee;ue++)ie[ue]=arguments[ue+2];J.children=ie}if(P&&P.defaultProps)for(K in ee=P.defaultProps,ee)J[K]===void 0&&(J[K]=ee[K]);return{$$typeof:e,type:P,key:te,ref:Y,props:J,_owner:A.current}}function L(P,W){return{$$typeof:e,type:P.type,key:W,ref:P.ref,props:P.props,_owner:P._owner}}function B(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function M(P){var W={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(oe){return W[oe]})}var $=/\/+/g;function U(P,W){return typeof P=="object"&&P!==null&&P.key!=null?M(""+P.key):W.toString(36)}function D(P,W,oe,K,J){var te=typeof P;(te==="undefined"||te==="boolean")&&(P=null);var Y=!1;if(P===null)Y=!0;else switch(te){case"string":case"number":Y=!0;break;case"object":switch(P.$$typeof){case e:case t:Y=!0}}if(Y)return Y=P,J=J(Y),P=K===""?"."+U(Y,0):K,N(J)?(oe="",P!=null&&(oe=P.replace($,"$&/")+"/"),D(J,W,oe,"",function(ue){return ue})):J!=null&&(B(J)&&(J=L(J,oe+(!J.key||Y&&Y.key===J.key?"":(""+J.key).replace($,"$&/")+"/")+P)),W.push(J)),1;if(Y=0,K=K===""?".":K+":",N(P))for(var ee=0;ee<P.length;ee++){te=P[ee];var ie=K+U(te,ee);Y+=D(te,W,oe,ie,J)}else if(ie=g(P),typeof ie=="function")for(P=ie.call(P),ee=0;!(te=P.next()).done;)te=te.value,ie=K+U(te,ee++),Y+=D(te,W,oe,ie,J);else if(te==="object")throw W=String(P),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return Y}function V(P,W,oe){if(P==null)return P;var K=[],J=0;return D(P,K,"","",function(te){return W.call(oe,te,J++)}),K}function z(P){if(P._status===-1){var W=P._result;W=W(),W.then(function(oe){(P._status===0||P._status===-1)&&(P._status=1,P._result=oe)},function(oe){(P._status===0||P._status===-1)&&(P._status=2,P._result=oe)}),P._status===-1&&(P._status=0,P._result=W)}if(P._status===1)return P._result.default;throw P._result}var Q={current:null},F={transition:null},q={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:F,ReactCurrentOwner:A};function G(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:V,forEach:function(P,W,oe){V(P,function(){W.apply(this,arguments)},oe)},count:function(P){var W=0;return V(P,function(){W++}),W},toArray:function(P){return V(P,function(W){return W})||[]},only:function(P){if(!B(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},Oe.Component=w,Oe.Fragment=n,Oe.Profiler=s,Oe.PureComponent=C,Oe.StrictMode=r,Oe.Suspense=u,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Oe.act=G,Oe.cloneElement=function(P,W,oe){if(P==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+P+".");var K=b({},P.props),J=P.key,te=P.ref,Y=P._owner;if(W!=null){if(W.ref!==void 0&&(te=W.ref,Y=A.current),W.key!==void 0&&(J=""+W.key),P.type&&P.type.defaultProps)var ee=P.type.defaultProps;for(ie in W)j.call(W,ie)&&!R.hasOwnProperty(ie)&&(K[ie]=W[ie]===void 0&&ee!==void 0?ee[ie]:W[ie])}var ie=arguments.length-2;if(ie===1)K.children=oe;else if(1<ie){ee=Array(ie);for(var ue=0;ue<ie;ue++)ee[ue]=arguments[ue+2];K.children=ee}return{$$typeof:e,type:P.type,key:J,ref:te,props:K,_owner:Y}},Oe.createContext=function(P){return P={$$typeof:a,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},P.Provider={$$typeof:o,_context:P},P.Consumer=P},Oe.createElement=O,Oe.createFactory=function(P){var W=O.bind(null,P);return W.type=P,W},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(P){return{$$typeof:c,render:P}},Oe.isValidElement=B,Oe.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:z}},Oe.memo=function(P,W){return{$$typeof:d,type:P,compare:W===void 0?null:W}},Oe.startTransition=function(P){var W=F.transition;F.transition={};try{P()}finally{F.transition=W}},Oe.unstable_act=G,Oe.useCallback=function(P,W){return Q.current.useCallback(P,W)},Oe.useContext=function(P){return Q.current.useContext(P)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(P){return Q.current.useDeferredValue(P)},Oe.useEffect=function(P,W){return Q.current.useEffect(P,W)},Oe.useId=function(){return Q.current.useId()},Oe.useImperativeHandle=function(P,W,oe){return Q.current.useImperativeHandle(P,W,oe)},Oe.useInsertionEffect=function(P,W){return Q.current.useInsertionEffect(P,W)},Oe.useLayoutEffect=function(P,W){return Q.current.useLayoutEffect(P,W)},Oe.useMemo=function(P,W){return Q.current.useMemo(P,W)},Oe.useReducer=function(P,W,oe){return Q.current.useReducer(P,W,oe)},Oe.useRef=function(P){return Q.current.useRef(P)},Oe.useState=function(P){return Q.current.useState(P)},Oe.useSyncExternalStore=function(P,W,oe){return Q.current.useSyncExternalStore(P,W,oe)},Oe.useTransition=function(){return Q.current.useTransition()},Oe.version="18.3.1",Oe}var p_;function yl(){return p_||(p_=1,pp.exports=y3()),pp.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 m_;function v3(){if(m_)return Ca;m_=1;var e=yl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(c,u,d){var p,m={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(p in u)r.call(u,p)&&!o.hasOwnProperty(p)&&(m[p]=u[p]);if(c&&c.defaultProps)for(p in u=c.defaultProps,u)m[p]===void 0&&(m[p]=u[p]);return{$$typeof:t,type:c,key:g,ref:v,props:m,_owner:s.current}}return Ca.Fragment=n,Ca.jsx=a,Ca.jsxs=a,Ca}var g_;function x3(){return g_||(g_=1,hp.exports=v3()),hp.exports}var h=x3(),T=yl();const pt=gl(T),cA=g3({__proto__:null,default:pt},[T]);var ou={},mp={exports:{}},Xt={},gp={exports:{}},yp={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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 y_;function w3(){return y_||(y_=1,(function(e){function t(F,q){var G=F.length;F.push(q);e:for(;0<G;){var P=G-1>>>1,W=F[P];if(0<s(W,q))F[P]=q,F[G]=W,G=P;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var q=F[0],G=F.pop();if(G!==q){F[0]=G;e:for(var P=0,W=F.length,oe=W>>>1;P<oe;){var K=2*(P+1)-1,J=F[K],te=K+1,Y=F[te];if(0>s(J,G))te<W&&0>s(Y,J)?(F[P]=Y,F[te]=G,P=te):(F[P]=J,F[K]=G,P=K);else if(te<W&&0>s(Y,G))F[P]=Y,F[te]=G,P=te;else break e}}return q}function s(F,q){var G=F.sortIndex-q.sortIndex;return G!==0?G:F.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],d=[],p=1,m=null,g=3,v=!1,b=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(F){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=F)r(d),q.sortIndex=q.expirationTime,t(u,q);else break;q=n(d)}}function N(F){if(x=!1,k(F),!b)if(n(u)!==null)b=!0,z(j);else{var q=n(d);q!==null&&Q(N,q.startTime-F)}}function j(F,q){b=!1,x&&(x=!1,S(O),O=-1),v=!0;var G=g;try{for(k(q),m=n(u);m!==null&&(!(m.expirationTime>q)||F&&!M());){var P=m.callback;if(typeof P=="function"){m.callback=null,g=m.priorityLevel;var W=P(m.expirationTime<=q);q=e.unstable_now(),typeof W=="function"?m.callback=W:m===n(u)&&r(u),k(q)}else r(u);m=n(u)}if(m!==null)var oe=!0;else{var K=n(d);K!==null&&Q(N,K.startTime-q),oe=!1}return oe}finally{m=null,g=G,v=!1}}var A=!1,R=null,O=-1,L=5,B=-1;function M(){return!(e.unstable_now()-B<L)}function $(){if(R!==null){var F=e.unstable_now();B=F;var q=!0;try{q=R(!0,F)}finally{q?U():(A=!1,R=null)}}else A=!1}var U;if(typeof C=="function")U=function(){C($)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,V=D.port2;D.port1.onmessage=$,U=function(){V.postMessage(null)}}else U=function(){w($,0)};function z(F){R=F,A||(A=!0,U())}function Q(F,q){O=w(function(){F(e.unstable_now())},q)}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_continueExecution=function(){b||v||(b=!0,z(j))},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 g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(F){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var G=g;g=q;try{return F()}finally{g=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var G=g;g=F;try{return q()}finally{g=G}},e.unstable_scheduleCallback=function(F,q,G){var P=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?P+G:P):G=P,F){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=G+W,F={id:p++,callback:q,priorityLevel:F,startTime:G,expirationTime:W,sortIndex:-1},G>P?(F.sortIndex=G,t(d,F),n(u)===null&&F===n(d)&&(x?(S(O),O=-1):x=!0,Q(N,G-P))):(F.sortIndex=W,t(u,F),b||v||(b=!0,z(j))),F},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(F){var q=g;return function(){var G=g;g=q;try{return F.apply(this,arguments)}finally{g=G}}}})(yp)),yp}var v_;function b3(){return v_||(v_=1,gp.exports=w3()),gp.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 x_;function S3(){if(x_)return Xt;x_=1;var e=yl(),t=b3();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function o(i,l){a(i,l),a(i+"Capture",l)}function a(i,l){for(s[i]=l,i=0;i<l.length;i++)r.add(l[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function g(i){return u.call(m,i)?!0:u.call(p,i)?!1:d.test(i)?m[i]=!0:(p[i]=!0,!1)}function v(i,l,f,y){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,l,f,y){if(l===null||typeof l>"u"||v(i,l,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function x(i,l,f,y,_,E,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=_,this.mustUseProperty=f,this.propertyName=i,this.type=l,this.sanitizeURL=E,this.removeEmptyString=I}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){w[i]=new x(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];w[l]=new x(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){w[i]=new x(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){w[i]=new x(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){w[i]=new x(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){w[i]=new x(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){w[i]=new x(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){w[i]=new x(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){w[i]=new x(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var l=i.replace(S,C);w[l]=new x(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(S,C);w[l]=new x(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(S,C);w[l]=new x(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){w[i]=new x(i,1,!1,i.toLowerCase(),null,!1,!1)}),w.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){w[i]=new x(i,1,!1,i.toLowerCase(),null,!0,!0)});function k(i,l,f,y){var _=w.hasOwnProperty(l)?w[l]:null;(_!==null?_.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(b(l,f,_,y)&&(f=null),y||_===null?g(l)&&(f===null?i.removeAttribute(l):i.setAttribute(l,""+f)):_.mustUseProperty?i[_.propertyName]=f===null?_.type===3?!1:"":f:(l=_.attributeName,y=_.attributeNamespace,f===null?i.removeAttribute(l):(_=_.type,f=_===3||_===4&&f===!0?"":""+f,y?i.setAttributeNS(y,l,f):i.setAttribute(l,f))))}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,j=Symbol.for("react.element"),A=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),M=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),F=Symbol.iterator;function q(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var G=Object.assign,P;function W(i){if(P===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);P=l&&l[1]||""}return`
|
|
34
|
+
`+P+i}var oe=!1;function K(i,l){if(!i||oe)return"";oe=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(se){var y=se}Reflect.construct(i,[],l)}else{try{l.call()}catch(se){y=se}i.call(l.prototype)}else{try{throw Error()}catch(se){y=se}i()}}catch(se){if(se&&y&&typeof se.stack=="string"){for(var _=se.stack.split(`
|
|
35
|
+
`),E=y.stack.split(`
|
|
36
|
+
`),I=_.length-1,H=E.length-1;1<=I&&0<=H&&_[I]!==E[H];)H--;for(;1<=I&&0<=H;I--,H--)if(_[I]!==E[H]){if(I!==1||H!==1)do if(I--,H--,0>H||_[I]!==E[H]){var X=`
|
|
37
|
+
`+_[I].replace(" at new "," at ");return i.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",i.displayName)),X}while(1<=I&&0<=H);break}}}finally{oe=!1,Error.prepareStackTrace=f}return(i=i?i.displayName||i.name:"")?W(i):""}function J(i){switch(i.tag){case 5:return W(i.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return i=K(i.type,!1),i;case 11:return i=K(i.type.render,!1),i;case 1:return i=K(i.type,!0),i;default:return""}}function te(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case R:return"Fragment";case A:return"Portal";case L:return"Profiler";case O:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case M:return(i.displayName||"Context")+".Consumer";case B:return(i._context.displayName||"Context")+".Provider";case $:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return l=i.displayName||null,l!==null?l:te(i.type)||"Memo";case z:l=i._payload,i=i._init;try{return te(i(l))}catch{}}return null}function Y(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(l);case 8:return l===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ee(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ie(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ue(i){var l=ie(i)?"checked":"value",f=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),y=""+i[l];if(!i.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var _=f.get,E=f.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return _.call(this)},set:function(I){y=""+I,E.call(this,I)}}),Object.defineProperty(i,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(I){y=""+I},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function me(i){i._valueTracker||(i._valueTracker=ue(i))}function ye(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return i&&(y=ie(i)?i.checked?"true":"false":i.value),i=y,i!==f?(l.setValue(i),!0):!1}function pe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function _e(i,l){var f=l.checked;return G({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??i._wrapperState.initialChecked})}function xe(i,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ee(l.value!=null?l.value:f),i._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ce(i,l){l=l.checked,l!=null&&k(i,"checked",l,!1)}function Ne(i,l){Ce(i,l);var f=ee(l.value),y=l.type;if(f!=null)y==="number"?(f===0&&i.value===""||i.value!=f)&&(i.value=""+f):i.value!==""+f&&(i.value=""+f);else if(y==="submit"||y==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?Le(i,l.type,f):l.hasOwnProperty("defaultValue")&&Le(i,l.type,ee(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function tt(i,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,f||l===i.value||(i.value=l),i.defaultValue=l}f=i.name,f!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,f!==""&&(i.name=f)}function Le(i,l,f){(l!=="number"||pe(i.ownerDocument)!==i)&&(f==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+f&&(i.defaultValue=""+f))}var vt=Array.isArray;function xt(i,l,f,y){if(i=i.options,l){l={};for(var _=0;_<f.length;_++)l["$"+f[_]]=!0;for(f=0;f<i.length;f++)_=l.hasOwnProperty("$"+i[f].value),i[f].selected!==_&&(i[f].selected=_),_&&y&&(i[f].defaultSelected=!0)}else{for(f=""+ee(f),l=null,_=0;_<i.length;_++){if(i[_].value===f){i[_].selected=!0,y&&(i[_].defaultSelected=!0);return}l!==null||i[_].disabled||(l=i[_])}l!==null&&(l.selected=!0)}}function it(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return G({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function We(i,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(n(92));if(vt(f)){if(1<f.length)throw Error(n(93));f=f[0]}l=f}l==null&&(l=""),f=l}i._wrapperState={initialValue:ee(f)}}function It(i,l){var f=ee(l.value),y=ee(l.defaultValue);f!=null&&(f=""+f,f!==i.value&&(i.value=f),l.defaultValue==null&&i.defaultValue!==f&&(i.defaultValue=f)),y!=null&&(i.defaultValue=""+y)}function Mt(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Vt(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ie(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Vt(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var be,ot=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,_){MSApp.execUnsafeLocalFunction(function(){return i(l,f,y,_)})}:i})(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(be=be||document.createElement("div"),be.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=be.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function Ve(i,l){if(l){var f=i.firstChild;if(f&&f===i.lastChild&&f.nodeType===3){f.nodeValue=l;return}}i.textContent=l}var Ut={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hn=["Webkit","ms","Moz","O"];Object.keys(Ut).forEach(function(i){hn.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),Ut[l]=Ut[i]})});function Ot(i,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||Ut.hasOwnProperty(i)&&Ut[i]?(""+l).trim():l+"px"}function Pt(i,l){i=i.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,_=Ot(f,l[f],y);f==="float"&&(f="cssFloat"),y?i.setProperty(f,_):i[f]=_}}var hi=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Lt(i,l){if(l){if(hi[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function tn(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){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 $o=null;function qo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Fo=null,Br=null,zr=null;function Ul(i){if(i=da(i)){if(typeof Fo!="function")throw Error(n(280));var l=i.stateNode;l&&(l=wc(l),Fo(i.stateNode,i.type,l))}}function Hl(i){Br?zr?zr.push(i):zr=[i]:Br=i}function Wl(){if(Br){var i=Br,l=zr;if(zr=Br=null,Ul(i),l)for(i=0;i<l.length;i++)Ul(l[i])}}function Kl(i,l){return i(l)}function Gl(){}var Bo=!1;function Yl(i,l,f){if(Bo)return i(l,f);Bo=!0;try{return Kl(i,l,f)}finally{Bo=!1,(Br!==null||zr!==null)&&(Gl(),Wl())}}function Cs(i,l){var f=i.stateNode;if(f===null)return null;var y=wc(f);if(y===null)return null;f=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(i=i.type,y=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!y;break e;default:i=!1}if(i)return null;if(f&&typeof f!="function")throw Error(n(231,l,typeof f));return f}var zo=!1;if(c)try{var Es={};Object.defineProperty(Es,"passive",{get:function(){zo=!0}}),window.addEventListener("test",Es,Es),window.removeEventListener("test",Es,Es)}catch{zo=!1}function _f(i,l,f,y,_,E,I,H,X){var se=Array.prototype.slice.call(arguments,3);try{l.apply(f,se)}catch(le){this.onError(le)}}var js=!1,pi=null,mi=!1,Vo=null,kf={onError:function(i){js=!0,pi=i}};function Nf(i,l,f,y,_,E,I,H,X){js=!1,pi=null,_f.apply(kf,arguments)}function Cf(i,l,f,y,_,E,I,H,X){if(Nf.apply(this,arguments),js){if(js){var se=pi;js=!1,pi=null}else throw Error(n(198));mi||(mi=!0,Vo=se)}}function Yn(i){var l=i,f=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(f=l.return),i=l.return;while(i)}return l.tag===3?f:null}function Uo(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function Ho(i){if(Yn(i)!==i)throw Error(n(188))}function Ef(i){var l=i.alternate;if(!l){if(l=Yn(i),l===null)throw Error(n(188));return l!==i?null:i}for(var f=i,y=l;;){var _=f.return;if(_===null)break;var E=_.alternate;if(E===null){if(y=_.return,y!==null){f=y;continue}break}if(_.child===E.child){for(E=_.child;E;){if(E===f)return Ho(_),i;if(E===y)return Ho(_),l;E=E.sibling}throw Error(n(188))}if(f.return!==y.return)f=_,y=E;else{for(var I=!1,H=_.child;H;){if(H===f){I=!0,f=_,y=E;break}if(H===y){I=!0,y=_,f=E;break}H=H.sibling}if(!I){for(H=E.child;H;){if(H===f){I=!0,f=E,y=_;break}if(H===y){I=!0,y=E,f=_;break}H=H.sibling}if(!I)throw Error(n(189))}}if(f.alternate!==y)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?i:l}function Xl(i){return i=Ef(i),i!==null?Ql(i):null}function Ql(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Ql(i);if(l!==null)return l;i=i.sibling}return null}var Jl=t.unstable_scheduleCallback,Zl=t.unstable_cancelCallback,jf=t.unstable_shouldYield,ec=t.unstable_requestPaint,nt=t.unstable_now,Tf=t.unstable_getCurrentPriorityLevel,Wo=t.unstable_ImmediatePriority,tc=t.unstable_UserBlockingPriority,gi=t.unstable_NormalPriority,Af=t.unstable_LowPriority,nc=t.unstable_IdlePriority,Ts=null,pn=null;function Rf(i){if(pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(Ts,i,void 0,(i.current.flags&128)===128)}catch{}}var nn=Math.clz32?Math.clz32:Of,If=Math.log,Mf=Math.LN2;function Of(i){return i>>>=0,i===0?32:31-(If(i)/Mf|0)|0}var yi=64,vi=4194304;function Xn(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function xi(i,l){var f=i.pendingLanes;if(f===0)return 0;var y=0,_=i.suspendedLanes,E=i.pingedLanes,I=f&268435455;if(I!==0){var H=I&~_;H!==0?y=Xn(H):(E&=I,E!==0&&(y=Xn(E)))}else I=f&~_,I!==0?y=Xn(I):E!==0&&(y=Xn(E));if(y===0)return 0;if(l!==0&&l!==y&&(l&_)===0&&(_=y&-y,E=l&-l,_>=E||_===16&&(E&4194240)!==0))return l;if((y&4)!==0&&(y|=f&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=y;0<l;)f=31-nn(l),_=1<<f,y|=i[f],l&=~_;return y}function rc(i,l){switch(i){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pf(i,l){for(var f=i.suspendedLanes,y=i.pingedLanes,_=i.expirationTimes,E=i.pendingLanes;0<E;){var I=31-nn(E),H=1<<I,X=_[I];X===-1?((H&f)===0||(H&y)!==0)&&(_[I]=rc(H,l)):X<=l&&(i.expiredLanes|=H),E&=~H}}function Ko(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function wi(){var i=yi;return yi<<=1,(yi&4194240)===0&&(yi=64),i}function Go(i){for(var l=[],f=0;31>f;f++)l.push(i);return l}function As(i,l,f){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-nn(l),i[l]=f}function sc(i,l){var f=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var y=i.eventTimes;for(i=i.expirationTimes;0<f;){var _=31-nn(f),E=1<<_;l[_]=0,y[_]=-1,i[_]=-1,f&=~E}}function Lf(i,l){var f=i.entangledLanes|=l;for(i=i.entanglements;f;){var y=31-nn(f),_=1<<y;_&l|i[y]&l&&(i[y]|=l),f&=~_}}var ze=0;function Hb(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Wb,Df,Kb,Gb,Yb,$f=!1,ic=[],Vr=null,Ur=null,Hr=null,Yo=new Map,Xo=new Map,Wr=[],$4="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 submit".split(" ");function Xb(i,l){switch(i){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":Yo.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xo.delete(l.pointerId)}}function Qo(i,l,f,y,_,E){return i===null||i.nativeEvent!==E?(i={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:E,targetContainers:[_]},l!==null&&(l=da(l),l!==null&&Df(l)),i):(i.eventSystemFlags|=y,l=i.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),i)}function q4(i,l,f,y,_){switch(l){case"focusin":return Vr=Qo(Vr,i,l,f,y,_),!0;case"dragenter":return Ur=Qo(Ur,i,l,f,y,_),!0;case"mouseover":return Hr=Qo(Hr,i,l,f,y,_),!0;case"pointerover":var E=_.pointerId;return Yo.set(E,Qo(Yo.get(E)||null,i,l,f,y,_)),!0;case"gotpointercapture":return E=_.pointerId,Xo.set(E,Qo(Xo.get(E)||null,i,l,f,y,_)),!0}return!1}function Qb(i){var l=Rs(i.target);if(l!==null){var f=Yn(l);if(f!==null){if(l=f.tag,l===13){if(l=Uo(f),l!==null){i.blockedOn=l,Yb(i.priority,function(){Kb(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){i.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}i.blockedOn=null}function oc(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var f=Ff(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(f===null){f=i.nativeEvent;var y=new f.constructor(f.type,f);$o=y,f.target.dispatchEvent(y),$o=null}else return l=da(f),l!==null&&Df(l),i.blockedOn=f,!1;l.shift()}return!0}function Jb(i,l,f){oc(i)&&f.delete(l)}function F4(){$f=!1,Vr!==null&&oc(Vr)&&(Vr=null),Ur!==null&&oc(Ur)&&(Ur=null),Hr!==null&&oc(Hr)&&(Hr=null),Yo.forEach(Jb),Xo.forEach(Jb)}function Jo(i,l){i.blockedOn===l&&(i.blockedOn=null,$f||($f=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,F4)))}function Zo(i){function l(_){return Jo(_,i)}if(0<ic.length){Jo(ic[0],i);for(var f=1;f<ic.length;f++){var y=ic[f];y.blockedOn===i&&(y.blockedOn=null)}}for(Vr!==null&&Jo(Vr,i),Ur!==null&&Jo(Ur,i),Hr!==null&&Jo(Hr,i),Yo.forEach(l),Xo.forEach(l),f=0;f<Wr.length;f++)y=Wr[f],y.blockedOn===i&&(y.blockedOn=null);for(;0<Wr.length&&(f=Wr[0],f.blockedOn===null);)Qb(f),f.blockedOn===null&&Wr.shift()}var bi=N.ReactCurrentBatchConfig,ac=!0;function B4(i,l,f,y){var _=ze,E=bi.transition;bi.transition=null;try{ze=1,qf(i,l,f,y)}finally{ze=_,bi.transition=E}}function z4(i,l,f,y){var _=ze,E=bi.transition;bi.transition=null;try{ze=4,qf(i,l,f,y)}finally{ze=_,bi.transition=E}}function qf(i,l,f,y){if(ac){var _=Ff(i,l,f,y);if(_===null)rh(i,l,y,lc,f),Xb(i,y);else if(q4(_,i,l,f,y))y.stopPropagation();else if(Xb(i,y),l&4&&-1<$4.indexOf(i)){for(;_!==null;){var E=da(_);if(E!==null&&Wb(E),E=Ff(i,l,f,y),E===null&&rh(i,l,y,lc,f),E===_)break;_=E}_!==null&&y.stopPropagation()}else rh(i,l,y,null,f)}}var lc=null;function Ff(i,l,f,y){if(lc=null,i=qo(y),i=Rs(i),i!==null)if(l=Yn(i),l===null)i=null;else if(f=l.tag,f===13){if(i=Uo(l),i!==null)return i;i=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return lc=i,null}function Zb(i){switch(i){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Tf()){case Wo:return 1;case tc:return 4;case gi:case Af:return 16;case nc:return 536870912;default:return 16}default:return 16}}var Kr=null,Bf=null,cc=null;function e1(){if(cc)return cc;var i,l=Bf,f=l.length,y,_="value"in Kr?Kr.value:Kr.textContent,E=_.length;for(i=0;i<f&&l[i]===_[i];i++);var I=f-i;for(y=1;y<=I&&l[f-y]===_[E-y];y++);return cc=_.slice(i,1<y?1-y:void 0)}function uc(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function dc(){return!0}function t1(){return!1}function rn(i){function l(f,y,_,E,I){this._reactName=f,this._targetInst=_,this.type=y,this.nativeEvent=E,this.target=I,this.currentTarget=null;for(var H in i)i.hasOwnProperty(H)&&(f=i[H],this[H]=f?f(E):E[H]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?dc:t1,this.isPropagationStopped=t1,this}return G(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=dc)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),l}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zf=rn(Si),ea=G({},Si,{view:0,detail:0}),V4=rn(ea),Vf,Uf,ta,fc=G({},ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ta&&(ta&&i.type==="mousemove"?(Vf=i.screenX-ta.screenX,Uf=i.screenY-ta.screenY):Uf=Vf=0,ta=i),Vf)},movementY:function(i){return"movementY"in i?i.movementY:Uf}}),n1=rn(fc),U4=G({},fc,{dataTransfer:0}),H4=rn(U4),W4=G({},ea,{relatedTarget:0}),Hf=rn(W4),K4=G({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),G4=rn(K4),Y4=G({},Si,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),X4=rn(Y4),Q4=G({},Si,{data:0}),r1=rn(Q4),J4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Z4={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"},eL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tL(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=eL[i])?!!l[i]:!1}function Wf(){return tL}var nL=G({},ea,{key:function(i){if(i.key){var l=J4[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=uc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Z4[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wf,charCode:function(i){return i.type==="keypress"?uc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?uc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),rL=rn(nL),sL=G({},fc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s1=rn(sL),iL=G({},ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wf}),oL=rn(iL),aL=G({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),lL=rn(aL),cL=G({},fc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),uL=rn(cL),dL=[9,13,27,32],Kf=c&&"CompositionEvent"in window,na=null;c&&"documentMode"in document&&(na=document.documentMode);var fL=c&&"TextEvent"in window&&!na,i1=c&&(!Kf||na&&8<na&&11>=na),o1=" ",a1=!1;function l1(i,l){switch(i){case"keyup":return dL.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var _i=!1;function hL(i,l){switch(i){case"compositionend":return c1(l);case"keypress":return l.which!==32?null:(a1=!0,o1);case"textInput":return i=l.data,i===o1&&a1?null:i;default:return null}}function pL(i,l){if(_i)return i==="compositionend"||!Kf&&l1(i,l)?(i=e1(),cc=Bf=Kr=null,_i=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return i1&&l.locale!=="ko"?null:l.data;default:return null}}var mL={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 u1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!mL[i.type]:l==="textarea"}function d1(i,l,f,y){Hl(y),l=yc(l,"onChange"),0<l.length&&(f=new zf("onChange","change",null,f,y),i.push({event:f,listeners:l}))}var ra=null,sa=null;function gL(i){T1(i,0)}function hc(i){var l=ji(i);if(ye(l))return i}function yL(i,l){if(i==="change")return l}var f1=!1;if(c){var Gf;if(c){var Yf="oninput"in document;if(!Yf){var h1=document.createElement("div");h1.setAttribute("oninput","return;"),Yf=typeof h1.oninput=="function"}Gf=Yf}else Gf=!1;f1=Gf&&(!document.documentMode||9<document.documentMode)}function p1(){ra&&(ra.detachEvent("onpropertychange",m1),sa=ra=null)}function m1(i){if(i.propertyName==="value"&&hc(sa)){var l=[];d1(l,sa,i,qo(i)),Yl(gL,l)}}function vL(i,l,f){i==="focusin"?(p1(),ra=l,sa=f,ra.attachEvent("onpropertychange",m1)):i==="focusout"&&p1()}function xL(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return hc(sa)}function wL(i,l){if(i==="click")return hc(l)}function bL(i,l){if(i==="input"||i==="change")return hc(l)}function SL(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var jn=typeof Object.is=="function"?Object.is:SL;function ia(i,l){if(jn(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var f=Object.keys(i),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var _=f[y];if(!u.call(l,_)||!jn(i[_],l[_]))return!1}return!0}function g1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function y1(i,l){var f=g1(i);i=0;for(var y;f;){if(f.nodeType===3){if(y=i+f.textContent.length,i<=l&&y>=l)return{node:f,offset:l-i};i=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=g1(f)}}function v1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?v1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function x1(){for(var i=window,l=pe();l instanceof i.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)i=l.contentWindow;else break;l=pe(i.document)}return l}function Xf(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function _L(i){var l=x1(),f=i.focusedElem,y=i.selectionRange;if(l!==f&&f&&f.ownerDocument&&v1(f.ownerDocument.documentElement,f)){if(y!==null&&Xf(f)){if(l=y.start,i=y.end,i===void 0&&(i=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(i,f.value.length);else if(i=(l=f.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var _=f.textContent.length,E=Math.min(y.start,_);y=y.end===void 0?E:Math.min(y.end,_),!i.extend&&E>y&&(_=y,y=E,E=_),_=y1(f,E);var I=y1(f,y);_&&I&&(i.rangeCount!==1||i.anchorNode!==_.node||i.anchorOffset!==_.offset||i.focusNode!==I.node||i.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(_.node,_.offset),i.removeAllRanges(),E>y?(i.addRange(l),i.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),i.addRange(l)))}}for(l=[],i=f;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)i=l[f],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var kL=c&&"documentMode"in document&&11>=document.documentMode,ki=null,Qf=null,oa=null,Jf=!1;function w1(i,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Jf||ki==null||ki!==pe(y)||(y=ki,"selectionStart"in y&&Xf(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),oa&&ia(oa,y)||(oa=y,y=yc(Qf,"onSelect"),0<y.length&&(l=new zf("onSelect","select",null,l,f),i.push({event:l,listeners:y}),l.target=ki)))}function pc(i,l){var f={};return f[i.toLowerCase()]=l.toLowerCase(),f["Webkit"+i]="webkit"+l,f["Moz"+i]="moz"+l,f}var Ni={animationend:pc("Animation","AnimationEnd"),animationiteration:pc("Animation","AnimationIteration"),animationstart:pc("Animation","AnimationStart"),transitionend:pc("Transition","TransitionEnd")},Zf={},b1={};c&&(b1=document.createElement("div").style,"AnimationEvent"in window||(delete Ni.animationend.animation,delete Ni.animationiteration.animation,delete Ni.animationstart.animation),"TransitionEvent"in window||delete Ni.transitionend.transition);function mc(i){if(Zf[i])return Zf[i];if(!Ni[i])return i;var l=Ni[i],f;for(f in l)if(l.hasOwnProperty(f)&&f in b1)return Zf[i]=l[f];return i}var S1=mc("animationend"),_1=mc("animationiteration"),k1=mc("animationstart"),N1=mc("transitionend"),C1=new Map,E1="abort auxClick 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(" ");function Gr(i,l){C1.set(i,l),o(l,[i])}for(var eh=0;eh<E1.length;eh++){var th=E1[eh],NL=th.toLowerCase(),CL=th[0].toUpperCase()+th.slice(1);Gr(NL,"on"+CL)}Gr(S1,"onAnimationEnd"),Gr(_1,"onAnimationIteration"),Gr(k1,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(N1,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var aa="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(" "),EL=new Set("cancel close invalid load scroll toggle".split(" ").concat(aa));function j1(i,l,f){var y=i.type||"unknown-event";i.currentTarget=f,Cf(y,l,void 0,i),i.currentTarget=null}function T1(i,l){l=(l&4)!==0;for(var f=0;f<i.length;f++){var y=i[f],_=y.event;y=y.listeners;e:{var E=void 0;if(l)for(var I=y.length-1;0<=I;I--){var H=y[I],X=H.instance,se=H.currentTarget;if(H=H.listener,X!==E&&_.isPropagationStopped())break e;j1(_,H,se),E=X}else for(I=0;I<y.length;I++){if(H=y[I],X=H.instance,se=H.currentTarget,H=H.listener,X!==E&&_.isPropagationStopped())break e;j1(_,H,se),E=X}}}if(mi)throw i=Vo,mi=!1,Vo=null,i}function Ke(i,l){var f=l[ch];f===void 0&&(f=l[ch]=new Set);var y=i+"__bubble";f.has(y)||(A1(l,i,2,!1),f.add(y))}function nh(i,l,f){var y=0;l&&(y|=4),A1(f,i,y,l)}var gc="_reactListening"+Math.random().toString(36).slice(2);function la(i){if(!i[gc]){i[gc]=!0,r.forEach(function(f){f!=="selectionchange"&&(EL.has(f)||nh(f,!1,i),nh(f,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[gc]||(l[gc]=!0,nh("selectionchange",!1,l))}}function A1(i,l,f,y){switch(Zb(l)){case 1:var _=B4;break;case 4:_=z4;break;default:_=qf}f=_.bind(null,l,f,i),_=void 0,!zo||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(_=!0),y?_!==void 0?i.addEventListener(l,f,{capture:!0,passive:_}):i.addEventListener(l,f,!0):_!==void 0?i.addEventListener(l,f,{passive:_}):i.addEventListener(l,f,!1)}function rh(i,l,f,y,_){var E=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var I=y.tag;if(I===3||I===4){var H=y.stateNode.containerInfo;if(H===_||H.nodeType===8&&H.parentNode===_)break;if(I===4)for(I=y.return;I!==null;){var X=I.tag;if((X===3||X===4)&&(X=I.stateNode.containerInfo,X===_||X.nodeType===8&&X.parentNode===_))return;I=I.return}for(;H!==null;){if(I=Rs(H),I===null)return;if(X=I.tag,X===5||X===6){y=E=I;continue e}H=H.parentNode}}y=y.return}Yl(function(){var se=E,le=qo(f),ce=[];e:{var ae=C1.get(i);if(ae!==void 0){var ge=zf,we=i;switch(i){case"keypress":if(uc(f)===0)break e;case"keydown":case"keyup":ge=rL;break;case"focusin":we="focus",ge=Hf;break;case"focusout":we="blur",ge=Hf;break;case"beforeblur":case"afterblur":ge=Hf;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=n1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=H4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=oL;break;case S1:case _1:case k1:ge=G4;break;case N1:ge=lL;break;case"scroll":ge=V4;break;case"wheel":ge=uL;break;case"copy":case"cut":case"paste":ge=X4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=s1}var Se=(l&4)!==0,ct=!Se&&i==="scroll",ne=Se?ae!==null?ae+"Capture":null:ae;Se=[];for(var Z=se,re;Z!==null;){re=Z;var de=re.stateNode;if(re.tag===5&&de!==null&&(re=de,ne!==null&&(de=Cs(Z,ne),de!=null&&Se.push(ca(Z,de,re)))),ct)break;Z=Z.return}0<Se.length&&(ae=new ge(ae,we,null,f,le),ce.push({event:ae,listeners:Se}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ge=i==="mouseout"||i==="pointerout",ae&&f!==$o&&(we=f.relatedTarget||f.fromElement)&&(Rs(we)||we[yr]))break e;if((ge||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,ge?(we=f.relatedTarget||f.toElement,ge=se,we=we?Rs(we):null,we!==null&&(ct=Yn(we),we!==ct||we.tag!==5&&we.tag!==6)&&(we=null)):(ge=null,we=se),ge!==we)){if(Se=n1,de="onMouseLeave",ne="onMouseEnter",Z="mouse",(i==="pointerout"||i==="pointerover")&&(Se=s1,de="onPointerLeave",ne="onPointerEnter",Z="pointer"),ct=ge==null?ae:ji(ge),re=we==null?ae:ji(we),ae=new Se(de,Z+"leave",ge,f,le),ae.target=ct,ae.relatedTarget=re,de=null,Rs(le)===se&&(Se=new Se(ne,Z+"enter",we,f,le),Se.target=re,Se.relatedTarget=ct,de=Se),ct=de,ge&&we)t:{for(Se=ge,ne=we,Z=0,re=Se;re;re=Ci(re))Z++;for(re=0,de=ne;de;de=Ci(de))re++;for(;0<Z-re;)Se=Ci(Se),Z--;for(;0<re-Z;)ne=Ci(ne),re--;for(;Z--;){if(Se===ne||ne!==null&&Se===ne.alternate)break t;Se=Ci(Se),ne=Ci(ne)}Se=null}else Se=null;ge!==null&&R1(ce,ae,ge,Se,!1),we!==null&&ct!==null&&R1(ce,ct,we,Se,!0)}}e:{if(ae=se?ji(se):window,ge=ae.nodeName&&ae.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ae.type==="file")var ke=yL;else if(u1(ae))if(f1)ke=bL;else{ke=xL;var Ee=vL}else(ge=ae.nodeName)&&ge.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(ke=wL);if(ke&&(ke=ke(i,se))){d1(ce,ke,f,le);break e}Ee&&Ee(i,ae,se),i==="focusout"&&(Ee=ae._wrapperState)&&Ee.controlled&&ae.type==="number"&&Le(ae,"number",ae.value)}switch(Ee=se?ji(se):window,i){case"focusin":(u1(Ee)||Ee.contentEditable==="true")&&(ki=Ee,Qf=se,oa=null);break;case"focusout":oa=Qf=ki=null;break;case"mousedown":Jf=!0;break;case"contextmenu":case"mouseup":case"dragend":Jf=!1,w1(ce,f,le);break;case"selectionchange":if(kL)break;case"keydown":case"keyup":w1(ce,f,le)}var je;if(Kf)e:{switch(i){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else _i?l1(i,f)&&(Te="onCompositionEnd"):i==="keydown"&&f.keyCode===229&&(Te="onCompositionStart");Te&&(i1&&f.locale!=="ko"&&(_i||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&_i&&(je=e1()):(Kr=le,Bf="value"in Kr?Kr.value:Kr.textContent,_i=!0)),Ee=yc(se,Te),0<Ee.length&&(Te=new r1(Te,i,null,f,le),ce.push({event:Te,listeners:Ee}),je?Te.data=je:(je=c1(f),je!==null&&(Te.data=je)))),(je=fL?hL(i,f):pL(i,f))&&(se=yc(se,"onBeforeInput"),0<se.length&&(le=new r1("onBeforeInput","beforeinput",null,f,le),ce.push({event:le,listeners:se}),le.data=je))}T1(ce,l)})}function ca(i,l,f){return{instance:i,listener:l,currentTarget:f}}function yc(i,l){for(var f=l+"Capture",y=[];i!==null;){var _=i,E=_.stateNode;_.tag===5&&E!==null&&(_=E,E=Cs(i,f),E!=null&&y.unshift(ca(i,E,_)),E=Cs(i,l),E!=null&&y.push(ca(i,E,_))),i=i.return}return y}function Ci(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function R1(i,l,f,y,_){for(var E=l._reactName,I=[];f!==null&&f!==y;){var H=f,X=H.alternate,se=H.stateNode;if(X!==null&&X===y)break;H.tag===5&&se!==null&&(H=se,_?(X=Cs(f,E),X!=null&&I.unshift(ca(f,X,H))):_||(X=Cs(f,E),X!=null&&I.push(ca(f,X,H)))),f=f.return}I.length!==0&&i.push({event:l,listeners:I})}var jL=/\r\n?/g,TL=/\u0000|\uFFFD/g;function I1(i){return(typeof i=="string"?i:""+i).replace(jL,`
|
|
38
|
+
`).replace(TL,"")}function vc(i,l,f){if(l=I1(l),I1(i)!==l&&f)throw Error(n(425))}function xc(){}var sh=null,ih=null;function oh(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var ah=typeof setTimeout=="function"?setTimeout:void 0,AL=typeof clearTimeout=="function"?clearTimeout:void 0,M1=typeof Promise=="function"?Promise:void 0,RL=typeof queueMicrotask=="function"?queueMicrotask:typeof M1<"u"?function(i){return M1.resolve(null).then(i).catch(IL)}:ah;function IL(i){setTimeout(function(){throw i})}function lh(i,l){var f=l,y=0;do{var _=f.nextSibling;if(i.removeChild(f),_&&_.nodeType===8)if(f=_.data,f==="/$"){if(y===0){i.removeChild(_),Zo(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=_}while(f);Zo(l)}function Yr(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function O1(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var f=i.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return i;l--}else f==="/$"&&l++}i=i.previousSibling}return null}var Ei=Math.random().toString(36).slice(2),Qn="__reactFiber$"+Ei,ua="__reactProps$"+Ei,yr="__reactContainer$"+Ei,ch="__reactEvents$"+Ei,ML="__reactListeners$"+Ei,OL="__reactHandles$"+Ei;function Rs(i){var l=i[Qn];if(l)return l;for(var f=i.parentNode;f;){if(l=f[yr]||f[Qn]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(i=O1(i);i!==null;){if(f=i[Qn])return f;i=O1(i)}return l}i=f,f=i.parentNode}return null}function da(i){return i=i[Qn]||i[yr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function ji(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function wc(i){return i[ua]||null}var uh=[],Ti=-1;function Xr(i){return{current:i}}function Ge(i){0>Ti||(i.current=uh[Ti],uh[Ti]=null,Ti--)}function Ue(i,l){Ti++,uh[Ti]=i.current,i.current=l}var Qr={},jt=Xr(Qr),Ht=Xr(!1),Is=Qr;function Ai(i,l){var f=i.type.contextTypes;if(!f)return Qr;var y=i.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var _={},E;for(E in f)_[E]=l[E];return y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=_),_}function Wt(i){return i=i.childContextTypes,i!=null}function bc(){Ge(Ht),Ge(jt)}function P1(i,l,f){if(jt.current!==Qr)throw Error(n(168));Ue(jt,l),Ue(Ht,f)}function L1(i,l,f){var y=i.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var _ in y)if(!(_ in l))throw Error(n(108,Y(i)||"Unknown",_));return G({},f,y)}function Sc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Qr,Is=jt.current,Ue(jt,i),Ue(Ht,Ht.current),!0}function D1(i,l,f){var y=i.stateNode;if(!y)throw Error(n(169));f?(i=L1(i,l,Is),y.__reactInternalMemoizedMergedChildContext=i,Ge(Ht),Ge(jt),Ue(jt,i)):Ge(Ht),Ue(Ht,f)}var vr=null,_c=!1,dh=!1;function $1(i){vr===null?vr=[i]:vr.push(i)}function PL(i){_c=!0,$1(i)}function Jr(){if(!dh&&vr!==null){dh=!0;var i=0,l=ze;try{var f=vr;for(ze=1;i<f.length;i++){var y=f[i];do y=y(!0);while(y!==null)}vr=null,_c=!1}catch(_){throw vr!==null&&(vr=vr.slice(i+1)),Jl(Wo,Jr),_}finally{ze=l,dh=!1}}return null}var Ri=[],Ii=0,kc=null,Nc=0,mn=[],gn=0,Ms=null,xr=1,wr="";function Os(i,l){Ri[Ii++]=Nc,Ri[Ii++]=kc,kc=i,Nc=l}function q1(i,l,f){mn[gn++]=xr,mn[gn++]=wr,mn[gn++]=Ms,Ms=i;var y=xr;i=wr;var _=32-nn(y)-1;y&=~(1<<_),f+=1;var E=32-nn(l)+_;if(30<E){var I=_-_%5;E=(y&(1<<I)-1).toString(32),y>>=I,_-=I,xr=1<<32-nn(l)+_|f<<_|y,wr=E+i}else xr=1<<E|f<<_|y,wr=i}function fh(i){i.return!==null&&(Os(i,1),q1(i,1,0))}function hh(i){for(;i===kc;)kc=Ri[--Ii],Ri[Ii]=null,Nc=Ri[--Ii],Ri[Ii]=null;for(;i===Ms;)Ms=mn[--gn],mn[gn]=null,wr=mn[--gn],mn[gn]=null,xr=mn[--gn],mn[gn]=null}var sn=null,on=null,Xe=!1,Tn=null;function F1(i,l){var f=wn(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=i,l=i.deletions,l===null?(i.deletions=[f],i.flags|=16):l.push(f)}function B1(i,l){switch(i.tag){case 5:var f=i.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,sn=i,on=Yr(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,sn=i,on=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Ms!==null?{id:xr,overflow:wr}:null,i.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=wn(18,null,null,0),f.stateNode=l,f.return=i,i.child=f,sn=i,on=null,!0):!1;default:return!1}}function ph(i){return(i.mode&1)!==0&&(i.flags&128)===0}function mh(i){if(Xe){var l=on;if(l){var f=l;if(!B1(i,l)){if(ph(i))throw Error(n(418));l=Yr(f.nextSibling);var y=sn;l&&B1(i,l)?F1(y,f):(i.flags=i.flags&-4097|2,Xe=!1,sn=i)}}else{if(ph(i))throw Error(n(418));i.flags=i.flags&-4097|2,Xe=!1,sn=i}}}function z1(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;sn=i}function Cc(i){if(i!==sn)return!1;if(!Xe)return z1(i),Xe=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!oh(i.type,i.memoizedProps)),l&&(l=on)){if(ph(i))throw V1(),Error(n(418));for(;l;)F1(i,l),l=Yr(l.nextSibling)}if(z1(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var f=i.data;if(f==="/$"){if(l===0){on=Yr(i.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}i=i.nextSibling}on=null}}else on=sn?Yr(i.stateNode.nextSibling):null;return!0}function V1(){for(var i=on;i;)i=Yr(i.nextSibling)}function Mi(){on=sn=null,Xe=!1}function gh(i){Tn===null?Tn=[i]:Tn.push(i)}var LL=N.ReactCurrentBatchConfig;function fa(i,l,f){if(i=f.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var y=f.stateNode}if(!y)throw Error(n(147,i));var _=y,E=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===E?l.ref:(l=function(I){var H=_.refs;I===null?delete H[E]:H[E]=I},l._stringRef=E,l)}if(typeof i!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,i))}return i}function Ec(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function U1(i){var l=i._init;return l(i._payload)}function H1(i){function l(ne,Z){if(i){var re=ne.deletions;re===null?(ne.deletions=[Z],ne.flags|=16):re.push(Z)}}function f(ne,Z){if(!i)return null;for(;Z!==null;)l(ne,Z),Z=Z.sibling;return null}function y(ne,Z){for(ne=new Map;Z!==null;)Z.key!==null?ne.set(Z.key,Z):ne.set(Z.index,Z),Z=Z.sibling;return ne}function _(ne,Z){return ne=os(ne,Z),ne.index=0,ne.sibling=null,ne}function E(ne,Z,re){return ne.index=re,i?(re=ne.alternate,re!==null?(re=re.index,re<Z?(ne.flags|=2,Z):re):(ne.flags|=2,Z)):(ne.flags|=1048576,Z)}function I(ne){return i&&ne.alternate===null&&(ne.flags|=2),ne}function H(ne,Z,re,de){return Z===null||Z.tag!==6?(Z=ap(re,ne.mode,de),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function X(ne,Z,re,de){var ke=re.type;return ke===R?le(ne,Z,re.props.children,de,re.key):Z!==null&&(Z.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===z&&U1(ke)===Z.type)?(de=_(Z,re.props),de.ref=fa(ne,Z,re),de.return=ne,de):(de=Qc(re.type,re.key,re.props,null,ne.mode,de),de.ref=fa(ne,Z,re),de.return=ne,de)}function se(ne,Z,re,de){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=lp(re,ne.mode,de),Z.return=ne,Z):(Z=_(Z,re.children||[]),Z.return=ne,Z)}function le(ne,Z,re,de,ke){return Z===null||Z.tag!==7?(Z=zs(re,ne.mode,de,ke),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function ce(ne,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=ap(""+Z,ne.mode,re),Z.return=ne,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case j:return re=Qc(Z.type,Z.key,Z.props,null,ne.mode,re),re.ref=fa(ne,null,Z),re.return=ne,re;case A:return Z=lp(Z,ne.mode,re),Z.return=ne,Z;case z:var de=Z._init;return ce(ne,de(Z._payload),re)}if(vt(Z)||q(Z))return Z=zs(Z,ne.mode,re,null),Z.return=ne,Z;Ec(ne,Z)}return null}function ae(ne,Z,re,de){var ke=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return ke!==null?null:H(ne,Z,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case j:return re.key===ke?X(ne,Z,re,de):null;case A:return re.key===ke?se(ne,Z,re,de):null;case z:return ke=re._init,ae(ne,Z,ke(re._payload),de)}if(vt(re)||q(re))return ke!==null?null:le(ne,Z,re,de,null);Ec(ne,re)}return null}function ge(ne,Z,re,de,ke){if(typeof de=="string"&&de!==""||typeof de=="number")return ne=ne.get(re)||null,H(Z,ne,""+de,ke);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case j:return ne=ne.get(de.key===null?re:de.key)||null,X(Z,ne,de,ke);case A:return ne=ne.get(de.key===null?re:de.key)||null,se(Z,ne,de,ke);case z:var Ee=de._init;return ge(ne,Z,re,Ee(de._payload),ke)}if(vt(de)||q(de))return ne=ne.get(re)||null,le(Z,ne,de,ke,null);Ec(Z,de)}return null}function we(ne,Z,re,de){for(var ke=null,Ee=null,je=Z,Te=Z=0,kt=null;je!==null&&Te<re.length;Te++){je.index>Te?(kt=je,je=null):kt=je.sibling;var qe=ae(ne,je,re[Te],de);if(qe===null){je===null&&(je=kt);break}i&&je&&qe.alternate===null&&l(ne,je),Z=E(qe,Z,Te),Ee===null?ke=qe:Ee.sibling=qe,Ee=qe,je=kt}if(Te===re.length)return f(ne,je),Xe&&Os(ne,Te),ke;if(je===null){for(;Te<re.length;Te++)je=ce(ne,re[Te],de),je!==null&&(Z=E(je,Z,Te),Ee===null?ke=je:Ee.sibling=je,Ee=je);return Xe&&Os(ne,Te),ke}for(je=y(ne,je);Te<re.length;Te++)kt=ge(je,ne,Te,re[Te],de),kt!==null&&(i&&kt.alternate!==null&&je.delete(kt.key===null?Te:kt.key),Z=E(kt,Z,Te),Ee===null?ke=kt:Ee.sibling=kt,Ee=kt);return i&&je.forEach(function(as){return l(ne,as)}),Xe&&Os(ne,Te),ke}function Se(ne,Z,re,de){var ke=q(re);if(typeof ke!="function")throw Error(n(150));if(re=ke.call(re),re==null)throw Error(n(151));for(var Ee=ke=null,je=Z,Te=Z=0,kt=null,qe=re.next();je!==null&&!qe.done;Te++,qe=re.next()){je.index>Te?(kt=je,je=null):kt=je.sibling;var as=ae(ne,je,qe.value,de);if(as===null){je===null&&(je=kt);break}i&&je&&as.alternate===null&&l(ne,je),Z=E(as,Z,Te),Ee===null?ke=as:Ee.sibling=as,Ee=as,je=kt}if(qe.done)return f(ne,je),Xe&&Os(ne,Te),ke;if(je===null){for(;!qe.done;Te++,qe=re.next())qe=ce(ne,qe.value,de),qe!==null&&(Z=E(qe,Z,Te),Ee===null?ke=qe:Ee.sibling=qe,Ee=qe);return Xe&&Os(ne,Te),ke}for(je=y(ne,je);!qe.done;Te++,qe=re.next())qe=ge(je,ne,Te,qe.value,de),qe!==null&&(i&&qe.alternate!==null&&je.delete(qe.key===null?Te:qe.key),Z=E(qe,Z,Te),Ee===null?ke=qe:Ee.sibling=qe,Ee=qe);return i&&je.forEach(function(m3){return l(ne,m3)}),Xe&&Os(ne,Te),ke}function ct(ne,Z,re,de){if(typeof re=="object"&&re!==null&&re.type===R&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case j:e:{for(var ke=re.key,Ee=Z;Ee!==null;){if(Ee.key===ke){if(ke=re.type,ke===R){if(Ee.tag===7){f(ne,Ee.sibling),Z=_(Ee,re.props.children),Z.return=ne,ne=Z;break e}}else if(Ee.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===z&&U1(ke)===Ee.type){f(ne,Ee.sibling),Z=_(Ee,re.props),Z.ref=fa(ne,Ee,re),Z.return=ne,ne=Z;break e}f(ne,Ee);break}else l(ne,Ee);Ee=Ee.sibling}re.type===R?(Z=zs(re.props.children,ne.mode,de,re.key),Z.return=ne,ne=Z):(de=Qc(re.type,re.key,re.props,null,ne.mode,de),de.ref=fa(ne,Z,re),de.return=ne,ne=de)}return I(ne);case A:e:{for(Ee=re.key;Z!==null;){if(Z.key===Ee)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){f(ne,Z.sibling),Z=_(Z,re.children||[]),Z.return=ne,ne=Z;break e}else{f(ne,Z);break}else l(ne,Z);Z=Z.sibling}Z=lp(re,ne.mode,de),Z.return=ne,ne=Z}return I(ne);case z:return Ee=re._init,ct(ne,Z,Ee(re._payload),de)}if(vt(re))return we(ne,Z,re,de);if(q(re))return Se(ne,Z,re,de);Ec(ne,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Z!==null&&Z.tag===6?(f(ne,Z.sibling),Z=_(Z,re),Z.return=ne,ne=Z):(f(ne,Z),Z=ap(re,ne.mode,de),Z.return=ne,ne=Z),I(ne)):f(ne,Z)}return ct}var Oi=H1(!0),W1=H1(!1),jc=Xr(null),Tc=null,Pi=null,yh=null;function vh(){yh=Pi=Tc=null}function xh(i){var l=jc.current;Ge(jc),i._currentValue=l}function wh(i,l,f){for(;i!==null;){var y=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),i===f)break;i=i.return}}function Li(i,l){Tc=i,yh=Pi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(Kt=!0),i.firstContext=null)}function yn(i){var l=i._currentValue;if(yh!==i)if(i={context:i,memoizedValue:l,next:null},Pi===null){if(Tc===null)throw Error(n(308));Pi=i,Tc.dependencies={lanes:0,firstContext:i}}else Pi=Pi.next=i;return l}var Ps=null;function bh(i){Ps===null?Ps=[i]:Ps.push(i)}function K1(i,l,f,y){var _=l.interleaved;return _===null?(f.next=f,bh(l)):(f.next=_.next,_.next=f),l.interleaved=f,br(i,y)}function br(i,l){i.lanes|=l;var f=i.alternate;for(f!==null&&(f.lanes|=l),f=i,i=i.return;i!==null;)i.childLanes|=l,f=i.alternate,f!==null&&(f.childLanes|=l),f=i,i=i.return;return f.tag===3?f.stateNode:null}var Zr=!1;function Sh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function G1(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Sr(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function es(i,l,f){var y=i.updateQueue;if(y===null)return null;if(y=y.shared,($e&2)!==0){var _=y.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),y.pending=l,br(i,f)}return _=y.interleaved,_===null?(l.next=l,bh(y)):(l.next=_.next,_.next=l),y.interleaved=l,br(i,f)}function Ac(i,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var y=l.lanes;y&=i.pendingLanes,f|=y,l.lanes=f,Lf(i,f)}}function Y1(i,l){var f=i.updateQueue,y=i.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var _=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var I={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};E===null?_=E=I:E=E.next=I,f=f.next}while(f!==null);E===null?_=E=l:E=E.next=l}else _=E=l;f={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:E,shared:y.shared,effects:y.effects},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=l:i.next=l,f.lastBaseUpdate=l}function Rc(i,l,f,y){var _=i.updateQueue;Zr=!1;var E=_.firstBaseUpdate,I=_.lastBaseUpdate,H=_.shared.pending;if(H!==null){_.shared.pending=null;var X=H,se=X.next;X.next=null,I===null?E=se:I.next=se,I=X;var le=i.alternate;le!==null&&(le=le.updateQueue,H=le.lastBaseUpdate,H!==I&&(H===null?le.firstBaseUpdate=se:H.next=se,le.lastBaseUpdate=X))}if(E!==null){var ce=_.baseState;I=0,le=se=X=null,H=E;do{var ae=H.lane,ge=H.eventTime;if((y&ae)===ae){le!==null&&(le=le.next={eventTime:ge,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var we=i,Se=H;switch(ae=l,ge=f,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){ce=we.call(ge,ce,ae);break e}ce=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,ae=typeof we=="function"?we.call(ge,ce,ae):we,ae==null)break e;ce=G({},ce,ae);break e;case 2:Zr=!0}}H.callback!==null&&H.lane!==0&&(i.flags|=64,ae=_.effects,ae===null?_.effects=[H]:ae.push(H))}else ge={eventTime:ge,lane:ae,tag:H.tag,payload:H.payload,callback:H.callback,next:null},le===null?(se=le=ge,X=ce):le=le.next=ge,I|=ae;if(H=H.next,H===null){if(H=_.shared.pending,H===null)break;ae=H,H=ae.next,ae.next=null,_.lastBaseUpdate=ae,_.shared.pending=null}}while(!0);if(le===null&&(X=ce),_.baseState=X,_.firstBaseUpdate=se,_.lastBaseUpdate=le,l=_.shared.interleaved,l!==null){_=l;do I|=_.lane,_=_.next;while(_!==l)}else E===null&&(_.shared.lanes=0);$s|=I,i.lanes=I,i.memoizedState=ce}}function X1(i,l,f){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var y=i[l],_=y.callback;if(_!==null){if(y.callback=null,y=f,typeof _!="function")throw Error(n(191,_));_.call(y)}}}var ha={},Jn=Xr(ha),pa=Xr(ha),ma=Xr(ha);function Ls(i){if(i===ha)throw Error(n(174));return i}function _h(i,l){switch(Ue(ma,l),Ue(pa,i),Ue(Jn,ha),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Ie(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Ie(l,i)}Ge(Jn),Ue(Jn,l)}function Di(){Ge(Jn),Ge(pa),Ge(ma)}function Q1(i){Ls(ma.current);var l=Ls(Jn.current),f=Ie(l,i.type);l!==f&&(Ue(pa,i),Ue(Jn,f))}function kh(i){pa.current===i&&(Ge(Jn),Ge(pa))}var rt=Xr(0);function Ic(i){for(var l=i;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Nh=[];function Ch(){for(var i=0;i<Nh.length;i++)Nh[i]._workInProgressVersionPrimary=null;Nh.length=0}var Mc=N.ReactCurrentDispatcher,Eh=N.ReactCurrentBatchConfig,Ds=0,st=null,wt=null,St=null,Oc=!1,ga=!1,ya=0,DL=0;function Tt(){throw Error(n(321))}function jh(i,l){if(l===null)return!1;for(var f=0;f<l.length&&f<i.length;f++)if(!jn(i[f],l[f]))return!1;return!0}function Th(i,l,f,y,_,E){if(Ds=E,st=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Mc.current=i===null||i.memoizedState===null?BL:zL,i=f(y,_),ga){E=0;do{if(ga=!1,ya=0,25<=E)throw Error(n(301));E+=1,St=wt=null,l.updateQueue=null,Mc.current=VL,i=f(y,_)}while(ga)}if(Mc.current=Dc,l=wt!==null&&wt.next!==null,Ds=0,St=wt=st=null,Oc=!1,l)throw Error(n(300));return i}function Ah(){var i=ya!==0;return ya=0,i}function Zn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?st.memoizedState=St=i:St=St.next=i,St}function vn(){if(wt===null){var i=st.alternate;i=i!==null?i.memoizedState:null}else i=wt.next;var l=St===null?st.memoizedState:St.next;if(l!==null)St=l,wt=i;else{if(i===null)throw Error(n(310));wt=i,i={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},St===null?st.memoizedState=St=i:St=St.next=i}return St}function va(i,l){return typeof l=="function"?l(i):l}function Rh(i){var l=vn(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=i;var y=wt,_=y.baseQueue,E=f.pending;if(E!==null){if(_!==null){var I=_.next;_.next=E.next,E.next=I}y.baseQueue=_=E,f.pending=null}if(_!==null){E=_.next,y=y.baseState;var H=I=null,X=null,se=E;do{var le=se.lane;if((Ds&le)===le)X!==null&&(X=X.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),y=se.hasEagerState?se.eagerState:i(y,se.action);else{var ce={lane:le,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};X===null?(H=X=ce,I=y):X=X.next=ce,st.lanes|=le,$s|=le}se=se.next}while(se!==null&&se!==E);X===null?I=y:X.next=H,jn(y,l.memoizedState)||(Kt=!0),l.memoizedState=y,l.baseState=I,l.baseQueue=X,f.lastRenderedState=y}if(i=f.interleaved,i!==null){_=i;do E=_.lane,st.lanes|=E,$s|=E,_=_.next;while(_!==i)}else _===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function Ih(i){var l=vn(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=i;var y=f.dispatch,_=f.pending,E=l.memoizedState;if(_!==null){f.pending=null;var I=_=_.next;do E=i(E,I.action),I=I.next;while(I!==_);jn(E,l.memoizedState)||(Kt=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),f.lastRenderedState=E}return[E,y]}function J1(){}function Z1(i,l){var f=st,y=vn(),_=l(),E=!jn(y.memoizedState,_);if(E&&(y.memoizedState=_,Kt=!0),y=y.queue,Mh(nS.bind(null,f,y,i),[i]),y.getSnapshot!==l||E||St!==null&&St.memoizedState.tag&1){if(f.flags|=2048,xa(9,tS.bind(null,f,y,_,l),void 0,null),_t===null)throw Error(n(349));(Ds&30)!==0||eS(f,l,_)}return _}function eS(i,l,f){i.flags|=16384,i={getSnapshot:l,value:f},l=st.updateQueue,l===null?(l={lastEffect:null,stores:null},st.updateQueue=l,l.stores=[i]):(f=l.stores,f===null?l.stores=[i]:f.push(i))}function tS(i,l,f,y){l.value=f,l.getSnapshot=y,rS(l)&&sS(i)}function nS(i,l,f){return f(function(){rS(l)&&sS(i)})}function rS(i){var l=i.getSnapshot;i=i.value;try{var f=l();return!jn(i,f)}catch{return!0}}function sS(i){var l=br(i,1);l!==null&&Mn(l,i,1,-1)}function iS(i){var l=Zn();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:i},l.queue=i,i=i.dispatch=FL.bind(null,st,i),[l.memoizedState,i]}function xa(i,l,f,y){return i={tag:i,create:l,destroy:f,deps:y,next:null},l=st.updateQueue,l===null?(l={lastEffect:null,stores:null},st.updateQueue=l,l.lastEffect=i.next=i):(f=l.lastEffect,f===null?l.lastEffect=i.next=i:(y=f.next,f.next=i,i.next=y,l.lastEffect=i)),i}function oS(){return vn().memoizedState}function Pc(i,l,f,y){var _=Zn();st.flags|=i,_.memoizedState=xa(1|l,f,void 0,y===void 0?null:y)}function Lc(i,l,f,y){var _=vn();y=y===void 0?null:y;var E=void 0;if(wt!==null){var I=wt.memoizedState;if(E=I.destroy,y!==null&&jh(y,I.deps)){_.memoizedState=xa(l,f,E,y);return}}st.flags|=i,_.memoizedState=xa(1|l,f,E,y)}function aS(i,l){return Pc(8390656,8,i,l)}function Mh(i,l){return Lc(2048,8,i,l)}function lS(i,l){return Lc(4,2,i,l)}function cS(i,l){return Lc(4,4,i,l)}function uS(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function dS(i,l,f){return f=f!=null?f.concat([i]):null,Lc(4,4,uS.bind(null,l,i),f)}function Oh(){}function fS(i,l){var f=vn();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&jh(l,y[1])?y[0]:(f.memoizedState=[i,l],i)}function hS(i,l){var f=vn();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&jh(l,y[1])?y[0]:(i=i(),f.memoizedState=[i,l],i)}function pS(i,l,f){return(Ds&21)===0?(i.baseState&&(i.baseState=!1,Kt=!0),i.memoizedState=f):(jn(f,l)||(f=wi(),st.lanes|=f,$s|=f,i.baseState=!0),l)}function $L(i,l){var f=ze;ze=f!==0&&4>f?f:4,i(!0);var y=Eh.transition;Eh.transition={};try{i(!1),l()}finally{ze=f,Eh.transition=y}}function mS(){return vn().memoizedState}function qL(i,l,f){var y=ss(i);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},gS(i))yS(l,f);else if(f=K1(i,l,f,y),f!==null){var _=$t();Mn(f,i,y,_),vS(f,l,y)}}function FL(i,l,f){var y=ss(i),_={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(gS(i))yS(l,_);else{var E=i.alternate;if(i.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var I=l.lastRenderedState,H=E(I,f);if(_.hasEagerState=!0,_.eagerState=H,jn(H,I)){var X=l.interleaved;X===null?(_.next=_,bh(l)):(_.next=X.next,X.next=_),l.interleaved=_;return}}catch{}finally{}f=K1(i,l,_,y),f!==null&&(_=$t(),Mn(f,i,y,_),vS(f,l,y))}}function gS(i){var l=i.alternate;return i===st||l!==null&&l===st}function yS(i,l){ga=Oc=!0;var f=i.pending;f===null?l.next=l:(l.next=f.next,f.next=l),i.pending=l}function vS(i,l,f){if((f&4194240)!==0){var y=l.lanes;y&=i.pendingLanes,f|=y,l.lanes=f,Lf(i,f)}}var Dc={readContext:yn,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},BL={readContext:yn,useCallback:function(i,l){return Zn().memoizedState=[i,l===void 0?null:l],i},useContext:yn,useEffect:aS,useImperativeHandle:function(i,l,f){return f=f!=null?f.concat([i]):null,Pc(4194308,4,uS.bind(null,l,i),f)},useLayoutEffect:function(i,l){return Pc(4194308,4,i,l)},useInsertionEffect:function(i,l){return Pc(4,2,i,l)},useMemo:function(i,l){var f=Zn();return l=l===void 0?null:l,i=i(),f.memoizedState=[i,l],i},useReducer:function(i,l,f){var y=Zn();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},y.queue=i,i=i.dispatch=qL.bind(null,st,i),[y.memoizedState,i]},useRef:function(i){var l=Zn();return i={current:i},l.memoizedState=i},useState:iS,useDebugValue:Oh,useDeferredValue:function(i){return Zn().memoizedState=i},useTransition:function(){var i=iS(!1),l=i[0];return i=$L.bind(null,i[1]),Zn().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,f){var y=st,_=Zn();if(Xe){if(f===void 0)throw Error(n(407));f=f()}else{if(f=l(),_t===null)throw Error(n(349));(Ds&30)!==0||eS(y,l,f)}_.memoizedState=f;var E={value:f,getSnapshot:l};return _.queue=E,aS(nS.bind(null,y,E,i),[i]),y.flags|=2048,xa(9,tS.bind(null,y,E,f,l),void 0,null),f},useId:function(){var i=Zn(),l=_t.identifierPrefix;if(Xe){var f=wr,y=xr;f=(y&~(1<<32-nn(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=ya++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=DL++,l=":"+l+"r"+f.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},zL={readContext:yn,useCallback:fS,useContext:yn,useEffect:Mh,useImperativeHandle:dS,useInsertionEffect:lS,useLayoutEffect:cS,useMemo:hS,useReducer:Rh,useRef:oS,useState:function(){return Rh(va)},useDebugValue:Oh,useDeferredValue:function(i){var l=vn();return pS(l,wt.memoizedState,i)},useTransition:function(){var i=Rh(va)[0],l=vn().memoizedState;return[i,l]},useMutableSource:J1,useSyncExternalStore:Z1,useId:mS,unstable_isNewReconciler:!1},VL={readContext:yn,useCallback:fS,useContext:yn,useEffect:Mh,useImperativeHandle:dS,useInsertionEffect:lS,useLayoutEffect:cS,useMemo:hS,useReducer:Ih,useRef:oS,useState:function(){return Ih(va)},useDebugValue:Oh,useDeferredValue:function(i){var l=vn();return wt===null?l.memoizedState=i:pS(l,wt.memoizedState,i)},useTransition:function(){var i=Ih(va)[0],l=vn().memoizedState;return[i,l]},useMutableSource:J1,useSyncExternalStore:Z1,useId:mS,unstable_isNewReconciler:!1};function An(i,l){if(i&&i.defaultProps){l=G({},l),i=i.defaultProps;for(var f in i)l[f]===void 0&&(l[f]=i[f]);return l}return l}function Ph(i,l,f,y){l=i.memoizedState,f=f(y,l),f=f==null?l:G({},l,f),i.memoizedState=f,i.lanes===0&&(i.updateQueue.baseState=f)}var $c={isMounted:function(i){return(i=i._reactInternals)?Yn(i)===i:!1},enqueueSetState:function(i,l,f){i=i._reactInternals;var y=$t(),_=ss(i),E=Sr(y,_);E.payload=l,f!=null&&(E.callback=f),l=es(i,E,_),l!==null&&(Mn(l,i,_,y),Ac(l,i,_))},enqueueReplaceState:function(i,l,f){i=i._reactInternals;var y=$t(),_=ss(i),E=Sr(y,_);E.tag=1,E.payload=l,f!=null&&(E.callback=f),l=es(i,E,_),l!==null&&(Mn(l,i,_,y),Ac(l,i,_))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var f=$t(),y=ss(i),_=Sr(f,y);_.tag=2,l!=null&&(_.callback=l),l=es(i,_,y),l!==null&&(Mn(l,i,y,f),Ac(l,i,y))}};function xS(i,l,f,y,_,E,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(y,E,I):l.prototype&&l.prototype.isPureReactComponent?!ia(f,y)||!ia(_,E):!0}function wS(i,l,f){var y=!1,_=Qr,E=l.contextType;return typeof E=="object"&&E!==null?E=yn(E):(_=Wt(l)?Is:jt.current,y=l.contextTypes,E=(y=y!=null)?Ai(i,_):Qr),l=new l(f,E),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=$c,i.stateNode=l,l._reactInternals=i,y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=_,i.__reactInternalMemoizedMaskedChildContext=E),l}function bS(i,l,f,y){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==i&&$c.enqueueReplaceState(l,l.state,null)}function Lh(i,l,f,y){var _=i.stateNode;_.props=f,_.state=i.memoizedState,_.refs={},Sh(i);var E=l.contextType;typeof E=="object"&&E!==null?_.context=yn(E):(E=Wt(l)?Is:jt.current,_.context=Ai(i,E)),_.state=i.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(Ph(i,l,E,f),_.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(l=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),l!==_.state&&$c.enqueueReplaceState(_,_.state,null),Rc(i,f,_,y),_.state=i.memoizedState),typeof _.componentDidMount=="function"&&(i.flags|=4194308)}function $i(i,l){try{var f="",y=l;do f+=J(y),y=y.return;while(y);var _=f}catch(E){_=`
|
|
39
|
+
Error generating stack: `+E.message+`
|
|
40
|
+
`+E.stack}return{value:i,source:l,stack:_,digest:null}}function Dh(i,l,f){return{value:i,source:null,stack:f??null,digest:l??null}}function $h(i,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var UL=typeof WeakMap=="function"?WeakMap:Map;function SS(i,l,f){f=Sr(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){Hc||(Hc=!0,Zh=y),$h(i,l)},f}function _S(i,l,f){f=Sr(-1,f),f.tag=3;var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var _=l.value;f.payload=function(){return y(_)},f.callback=function(){$h(i,l)}}var E=i.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(f.callback=function(){$h(i,l),typeof y!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),f}function kS(i,l,f){var y=i.pingCache;if(y===null){y=i.pingCache=new UL;var _=new Set;y.set(l,_)}else _=y.get(l),_===void 0&&(_=new Set,y.set(l,_));_.has(f)||(_.add(f),i=s3.bind(null,i,l,f),l.then(i,i))}function NS(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function CS(i,l,f,y,_){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Sr(-1,1),l.tag=2,es(f,l,1))),f.lanes|=1),i):(i.flags|=65536,i.lanes=_,i)}var HL=N.ReactCurrentOwner,Kt=!1;function Dt(i,l,f,y){l.child=i===null?W1(l,null,f,y):Oi(l,i.child,f,y)}function ES(i,l,f,y,_){f=f.render;var E=l.ref;return Li(l,_),y=Th(i,l,f,y,E,_),f=Ah(),i!==null&&!Kt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,_r(i,l,_)):(Xe&&f&&fh(l),l.flags|=1,Dt(i,l,y,_),l.child)}function jS(i,l,f,y,_){if(i===null){var E=f.type;return typeof E=="function"&&!op(E)&&E.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=E,TS(i,l,E,y,_)):(i=Qc(f.type,null,y,l,l.mode,_),i.ref=l.ref,i.return=l,l.child=i)}if(E=i.child,(i.lanes&_)===0){var I=E.memoizedProps;if(f=f.compare,f=f!==null?f:ia,f(I,y)&&i.ref===l.ref)return _r(i,l,_)}return l.flags|=1,i=os(E,y),i.ref=l.ref,i.return=l,l.child=i}function TS(i,l,f,y,_){if(i!==null){var E=i.memoizedProps;if(ia(E,y)&&i.ref===l.ref)if(Kt=!1,l.pendingProps=y=E,(i.lanes&_)!==0)(i.flags&131072)!==0&&(Kt=!0);else return l.lanes=i.lanes,_r(i,l,_)}return qh(i,l,f,y,_)}function AS(i,l,f){var y=l.pendingProps,_=y.children,E=i!==null?i.memoizedState:null;if(y.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(Fi,an),an|=f;else{if((f&1073741824)===0)return i=E!==null?E.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,Ue(Fi,an),an|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=E!==null?E.baseLanes:f,Ue(Fi,an),an|=y}else E!==null?(y=E.baseLanes|f,l.memoizedState=null):y=f,Ue(Fi,an),an|=y;return Dt(i,l,_,f),l.child}function RS(i,l){var f=l.ref;(i===null&&f!==null||i!==null&&i.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function qh(i,l,f,y,_){var E=Wt(f)?Is:jt.current;return E=Ai(l,E),Li(l,_),f=Th(i,l,f,y,E,_),y=Ah(),i!==null&&!Kt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,_r(i,l,_)):(Xe&&y&&fh(l),l.flags|=1,Dt(i,l,f,_),l.child)}function IS(i,l,f,y,_){if(Wt(f)){var E=!0;Sc(l)}else E=!1;if(Li(l,_),l.stateNode===null)Fc(i,l),wS(l,f,y),Lh(l,f,y,_),y=!0;else if(i===null){var I=l.stateNode,H=l.memoizedProps;I.props=H;var X=I.context,se=f.contextType;typeof se=="object"&&se!==null?se=yn(se):(se=Wt(f)?Is:jt.current,se=Ai(l,se));var le=f.getDerivedStateFromProps,ce=typeof le=="function"||typeof I.getSnapshotBeforeUpdate=="function";ce||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(H!==y||X!==se)&&bS(l,I,y,se),Zr=!1;var ae=l.memoizedState;I.state=ae,Rc(l,y,I,_),X=l.memoizedState,H!==y||ae!==X||Ht.current||Zr?(typeof le=="function"&&(Ph(l,f,le,y),X=l.memoizedState),(H=Zr||xS(l,f,H,y,ae,X,se))?(ce||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=X),I.props=y,I.state=X,I.context=se,y=H):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{I=l.stateNode,G1(i,l),H=l.memoizedProps,se=l.type===l.elementType?H:An(l.type,H),I.props=se,ce=l.pendingProps,ae=I.context,X=f.contextType,typeof X=="object"&&X!==null?X=yn(X):(X=Wt(f)?Is:jt.current,X=Ai(l,X));var ge=f.getDerivedStateFromProps;(le=typeof ge=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(H!==ce||ae!==X)&&bS(l,I,y,X),Zr=!1,ae=l.memoizedState,I.state=ae,Rc(l,y,I,_);var we=l.memoizedState;H!==ce||ae!==we||Ht.current||Zr?(typeof ge=="function"&&(Ph(l,f,ge,y),we=l.memoizedState),(se=Zr||xS(l,f,se,y,ae,we,X)||!1)?(le||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(y,we,X),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(y,we,X)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=we),I.props=y,I.state=we,I.context=X,y=se):(typeof I.componentDidUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||H===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),y=!1)}return Fh(i,l,f,y,E,_)}function Fh(i,l,f,y,_,E){RS(i,l);var I=(l.flags&128)!==0;if(!y&&!I)return _&&D1(l,f,!1),_r(i,l,E);y=l.stateNode,HL.current=l;var H=I&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,i!==null&&I?(l.child=Oi(l,i.child,null,E),l.child=Oi(l,null,H,E)):Dt(i,l,H,E),l.memoizedState=y.state,_&&D1(l,f,!0),l.child}function MS(i){var l=i.stateNode;l.pendingContext?P1(i,l.pendingContext,l.pendingContext!==l.context):l.context&&P1(i,l.context,!1),_h(i,l.containerInfo)}function OS(i,l,f,y,_){return Mi(),gh(_),l.flags|=256,Dt(i,l,f,y),l.child}var Bh={dehydrated:null,treeContext:null,retryLane:0};function zh(i){return{baseLanes:i,cachePool:null,transitions:null}}function PS(i,l,f){var y=l.pendingProps,_=rt.current,E=!1,I=(l.flags&128)!==0,H;if((H=I)||(H=i!==null&&i.memoizedState===null?!1:(_&2)!==0),H?(E=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(_|=1),Ue(rt,_&1),i===null)return mh(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=y.children,i=y.fallback,E?(y=l.mode,E=l.child,I={mode:"hidden",children:I},(y&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=I):E=Jc(I,y,0,null),i=zs(i,y,f,null),E.return=l,i.return=l,E.sibling=i,l.child=E,l.child.memoizedState=zh(f),l.memoizedState=Bh,i):Vh(l,I));if(_=i.memoizedState,_!==null&&(H=_.dehydrated,H!==null))return WL(i,l,I,y,H,_,f);if(E){E=y.fallback,I=l.mode,_=i.child,H=_.sibling;var X={mode:"hidden",children:y.children};return(I&1)===0&&l.child!==_?(y=l.child,y.childLanes=0,y.pendingProps=X,l.deletions=null):(y=os(_,X),y.subtreeFlags=_.subtreeFlags&14680064),H!==null?E=os(H,E):(E=zs(E,I,f,null),E.flags|=2),E.return=l,y.return=l,y.sibling=E,l.child=y,y=E,E=l.child,I=i.child.memoizedState,I=I===null?zh(f):{baseLanes:I.baseLanes|f,cachePool:null,transitions:I.transitions},E.memoizedState=I,E.childLanes=i.childLanes&~f,l.memoizedState=Bh,y}return E=i.child,i=E.sibling,y=os(E,{mode:"visible",children:y.children}),(l.mode&1)===0&&(y.lanes=f),y.return=l,y.sibling=null,i!==null&&(f=l.deletions,f===null?(l.deletions=[i],l.flags|=16):f.push(i)),l.child=y,l.memoizedState=null,y}function Vh(i,l){return l=Jc({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function qc(i,l,f,y){return y!==null&&gh(y),Oi(l,i.child,null,f),i=Vh(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function WL(i,l,f,y,_,E,I){if(f)return l.flags&256?(l.flags&=-257,y=Dh(Error(n(422))),qc(i,l,I,y)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(E=y.fallback,_=l.mode,y=Jc({mode:"visible",children:y.children},_,0,null),E=zs(E,_,I,null),E.flags|=2,y.return=l,E.return=l,y.sibling=E,l.child=y,(l.mode&1)!==0&&Oi(l,i.child,null,I),l.child.memoizedState=zh(I),l.memoizedState=Bh,E);if((l.mode&1)===0)return qc(i,l,I,null);if(_.data==="$!"){if(y=_.nextSibling&&_.nextSibling.dataset,y)var H=y.dgst;return y=H,E=Error(n(419)),y=Dh(E,y,void 0),qc(i,l,I,y)}if(H=(I&i.childLanes)!==0,Kt||H){if(y=_t,y!==null){switch(I&-I){case 4:_=2;break;case 16:_=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(y.suspendedLanes|I))!==0?0:_,_!==0&&_!==E.retryLane&&(E.retryLane=_,br(i,_),Mn(y,i,_,-1))}return ip(),y=Dh(Error(n(421))),qc(i,l,I,y)}return _.data==="$?"?(l.flags|=128,l.child=i.child,l=i3.bind(null,i),_._reactRetry=l,null):(i=E.treeContext,on=Yr(_.nextSibling),sn=l,Xe=!0,Tn=null,i!==null&&(mn[gn++]=xr,mn[gn++]=wr,mn[gn++]=Ms,xr=i.id,wr=i.overflow,Ms=l),l=Vh(l,y.children),l.flags|=4096,l)}function LS(i,l,f){i.lanes|=l;var y=i.alternate;y!==null&&(y.lanes|=l),wh(i.return,l,f)}function Uh(i,l,f,y,_){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:_}:(E.isBackwards=l,E.rendering=null,E.renderingStartTime=0,E.last=y,E.tail=f,E.tailMode=_)}function DS(i,l,f){var y=l.pendingProps,_=y.revealOrder,E=y.tail;if(Dt(i,l,y.children,f),y=rt.current,(y&2)!==0)y=y&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&LS(i,f,l);else if(i.tag===19)LS(i,f,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}y&=1}if(Ue(rt,y),(l.mode&1)===0)l.memoizedState=null;else switch(_){case"forwards":for(f=l.child,_=null;f!==null;)i=f.alternate,i!==null&&Ic(i)===null&&(_=f),f=f.sibling;f=_,f===null?(_=l.child,l.child=null):(_=f.sibling,f.sibling=null),Uh(l,!1,_,f,E);break;case"backwards":for(f=null,_=l.child,l.child=null;_!==null;){if(i=_.alternate,i!==null&&Ic(i)===null){l.child=_;break}i=_.sibling,_.sibling=f,f=_,_=i}Uh(l,!0,f,null,E);break;case"together":Uh(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Fc(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function _r(i,l,f){if(i!==null&&(l.dependencies=i.dependencies),$s|=l.lanes,(f&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,f=os(i,i.pendingProps),l.child=f,f.return=l;i.sibling!==null;)i=i.sibling,f=f.sibling=os(i,i.pendingProps),f.return=l;f.sibling=null}return l.child}function KL(i,l,f){switch(l.tag){case 3:MS(l),Mi();break;case 5:Q1(l);break;case 1:Wt(l.type)&&Sc(l);break;case 4:_h(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,_=l.memoizedProps.value;Ue(jc,y._currentValue),y._currentValue=_;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Ue(rt,rt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?PS(i,l,f):(Ue(rt,rt.current&1),i=_r(i,l,f),i!==null?i.sibling:null);Ue(rt,rt.current&1);break;case 19:if(y=(f&l.childLanes)!==0,(i.flags&128)!==0){if(y)return DS(i,l,f);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Ue(rt,rt.current),y)break;return null;case 22:case 23:return l.lanes=0,AS(i,l,f)}return _r(i,l,f)}var $S,Hh,qS,FS;$S=function(i,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Hh=function(){},qS=function(i,l,f,y){var _=i.memoizedProps;if(_!==y){i=l.stateNode,Ls(Jn.current);var E=null;switch(f){case"input":_=_e(i,_),y=_e(i,y),E=[];break;case"select":_=G({},_,{value:void 0}),y=G({},y,{value:void 0}),E=[];break;case"textarea":_=it(i,_),y=it(i,y),E=[];break;default:typeof _.onClick!="function"&&typeof y.onClick=="function"&&(i.onclick=xc)}Lt(f,y);var I;f=null;for(se in _)if(!y.hasOwnProperty(se)&&_.hasOwnProperty(se)&&_[se]!=null)if(se==="style"){var H=_[se];for(I in H)H.hasOwnProperty(I)&&(f||(f={}),f[I]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?E||(E=[]):(E=E||[]).push(se,null));for(se in y){var X=y[se];if(H=_!=null?_[se]:void 0,y.hasOwnProperty(se)&&X!==H&&(X!=null||H!=null))if(se==="style")if(H){for(I in H)!H.hasOwnProperty(I)||X&&X.hasOwnProperty(I)||(f||(f={}),f[I]="");for(I in X)X.hasOwnProperty(I)&&H[I]!==X[I]&&(f||(f={}),f[I]=X[I])}else f||(E||(E=[]),E.push(se,f)),f=X;else se==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,H=H?H.__html:void 0,X!=null&&H!==X&&(E=E||[]).push(se,X)):se==="children"?typeof X!="string"&&typeof X!="number"||(E=E||[]).push(se,""+X):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(X!=null&&se==="onScroll"&&Ke("scroll",i),E||H===X||(E=[])):(E=E||[]).push(se,X))}f&&(E=E||[]).push("style",f);var se=E;(l.updateQueue=se)&&(l.flags|=4)}},FS=function(i,l,f,y){f!==y&&(l.flags|=4)};function wa(i,l){if(!Xe)switch(i.tailMode){case"hidden":l=i.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i.tail=null:f.sibling=null;break;case"collapsed":f=i.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:y.sibling=null}}function At(i){var l=i.alternate!==null&&i.alternate.child===i.child,f=0,y=0;if(l)for(var _=i.child;_!==null;)f|=_.lanes|_.childLanes,y|=_.subtreeFlags&14680064,y|=_.flags&14680064,_.return=i,_=_.sibling;else for(_=i.child;_!==null;)f|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=i,_=_.sibling;return i.subtreeFlags|=y,i.childLanes=f,l}function GL(i,l,f){var y=l.pendingProps;switch(hh(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(l),null;case 1:return Wt(l.type)&&bc(),At(l),null;case 3:return y=l.stateNode,Di(),Ge(Ht),Ge(jt),Ch(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(i===null||i.child===null)&&(Cc(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Tn!==null&&(np(Tn),Tn=null))),Hh(i,l),At(l),null;case 5:kh(l);var _=Ls(ma.current);if(f=l.type,i!==null&&l.stateNode!=null)qS(i,l,f,y,_),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(n(166));return At(l),null}if(i=Ls(Jn.current),Cc(l)){y=l.stateNode,f=l.type;var E=l.memoizedProps;switch(y[Qn]=l,y[ua]=E,i=(l.mode&1)!==0,f){case"dialog":Ke("cancel",y),Ke("close",y);break;case"iframe":case"object":case"embed":Ke("load",y);break;case"video":case"audio":for(_=0;_<aa.length;_++)Ke(aa[_],y);break;case"source":Ke("error",y);break;case"img":case"image":case"link":Ke("error",y),Ke("load",y);break;case"details":Ke("toggle",y);break;case"input":xe(y,E),Ke("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!E.multiple},Ke("invalid",y);break;case"textarea":We(y,E),Ke("invalid",y)}Lt(f,E),_=null;for(var I in E)if(E.hasOwnProperty(I)){var H=E[I];I==="children"?typeof H=="string"?y.textContent!==H&&(E.suppressHydrationWarning!==!0&&vc(y.textContent,H,i),_=["children",H]):typeof H=="number"&&y.textContent!==""+H&&(E.suppressHydrationWarning!==!0&&vc(y.textContent,H,i),_=["children",""+H]):s.hasOwnProperty(I)&&H!=null&&I==="onScroll"&&Ke("scroll",y)}switch(f){case"input":me(y),tt(y,E,!0);break;case"textarea":me(y),Mt(y);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(y.onclick=xc)}y=_,l.updateQueue=y,y!==null&&(l.flags|=4)}else{I=_.nodeType===9?_:_.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Vt(f)),i==="http://www.w3.org/1999/xhtml"?f==="script"?(i=I.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=I.createElement(f,{is:y.is}):(i=I.createElement(f),f==="select"&&(I=i,y.multiple?I.multiple=!0:y.size&&(I.size=y.size))):i=I.createElementNS(i,f),i[Qn]=l,i[ua]=y,$S(i,l,!1,!1),l.stateNode=i;e:{switch(I=tn(f,y),f){case"dialog":Ke("cancel",i),Ke("close",i),_=y;break;case"iframe":case"object":case"embed":Ke("load",i),_=y;break;case"video":case"audio":for(_=0;_<aa.length;_++)Ke(aa[_],i);_=y;break;case"source":Ke("error",i),_=y;break;case"img":case"image":case"link":Ke("error",i),Ke("load",i),_=y;break;case"details":Ke("toggle",i),_=y;break;case"input":xe(i,y),_=_e(i,y),Ke("invalid",i);break;case"option":_=y;break;case"select":i._wrapperState={wasMultiple:!!y.multiple},_=G({},y,{value:void 0}),Ke("invalid",i);break;case"textarea":We(i,y),_=it(i,y),Ke("invalid",i);break;default:_=y}Lt(f,_),H=_;for(E in H)if(H.hasOwnProperty(E)){var X=H[E];E==="style"?Pt(i,X):E==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&ot(i,X)):E==="children"?typeof X=="string"?(f!=="textarea"||X!=="")&&Ve(i,X):typeof X=="number"&&Ve(i,""+X):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(s.hasOwnProperty(E)?X!=null&&E==="onScroll"&&Ke("scroll",i):X!=null&&k(i,E,X,I))}switch(f){case"input":me(i),tt(i,y,!1);break;case"textarea":me(i),Mt(i);break;case"option":y.value!=null&&i.setAttribute("value",""+ee(y.value));break;case"select":i.multiple=!!y.multiple,E=y.value,E!=null?xt(i,!!y.multiple,E,!1):y.defaultValue!=null&&xt(i,!!y.multiple,y.defaultValue,!0);break;default:typeof _.onClick=="function"&&(i.onclick=xc)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return At(l),null;case 6:if(i&&l.stateNode!=null)FS(i,l,i.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(f=Ls(ma.current),Ls(Jn.current),Cc(l)){if(y=l.stateNode,f=l.memoizedProps,y[Qn]=l,(E=y.nodeValue!==f)&&(i=sn,i!==null))switch(i.tag){case 3:vc(y.nodeValue,f,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&vc(y.nodeValue,f,(i.mode&1)!==0)}E&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[Qn]=l,l.stateNode=y}return At(l),null;case 13:if(Ge(rt),y=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Xe&&on!==null&&(l.mode&1)!==0&&(l.flags&128)===0)V1(),Mi(),l.flags|=98560,E=!1;else if(E=Cc(l),y!==null&&y.dehydrated!==null){if(i===null){if(!E)throw Error(n(318));if(E=l.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Qn]=l}else Mi(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;At(l),E=!1}else Tn!==null&&(np(Tn),Tn=null),E=!0;if(!E)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(y=y!==null,y!==(i!==null&&i.memoizedState!==null)&&y&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(rt.current&1)!==0?bt===0&&(bt=3):ip())),l.updateQueue!==null&&(l.flags|=4),At(l),null);case 4:return Di(),Hh(i,l),i===null&&la(l.stateNode.containerInfo),At(l),null;case 10:return xh(l.type._context),At(l),null;case 17:return Wt(l.type)&&bc(),At(l),null;case 19:if(Ge(rt),E=l.memoizedState,E===null)return At(l),null;if(y=(l.flags&128)!==0,I=E.rendering,I===null)if(y)wa(E,!1);else{if(bt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(I=Ic(i),I!==null){for(l.flags|=128,wa(E,!1),y=I.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.child;f!==null;)E=f,i=y,E.flags&=14680066,I=E.alternate,I===null?(E.childLanes=0,E.lanes=i,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=I.childLanes,E.lanes=I.lanes,E.child=I.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=I.memoizedProps,E.memoizedState=I.memoizedState,E.updateQueue=I.updateQueue,E.type=I.type,i=I.dependencies,E.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),f=f.sibling;return Ue(rt,rt.current&1|2),l.child}i=i.sibling}E.tail!==null&&nt()>Bi&&(l.flags|=128,y=!0,wa(E,!1),l.lanes=4194304)}else{if(!y)if(i=Ic(I),i!==null){if(l.flags|=128,y=!0,f=i.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),wa(E,!0),E.tail===null&&E.tailMode==="hidden"&&!I.alternate&&!Xe)return At(l),null}else 2*nt()-E.renderingStartTime>Bi&&f!==1073741824&&(l.flags|=128,y=!0,wa(E,!1),l.lanes=4194304);E.isBackwards?(I.sibling=l.child,l.child=I):(f=E.last,f!==null?f.sibling=I:l.child=I,E.last=I)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=nt(),l.sibling=null,f=rt.current,Ue(rt,y?f&1|2:f&1),l):(At(l),null);case 22:case 23:return sp(),y=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(l.flags|=8192),y&&(l.mode&1)!==0?(an&1073741824)!==0&&(At(l),l.subtreeFlags&6&&(l.flags|=8192)):At(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function YL(i,l){switch(hh(l),l.tag){case 1:return Wt(l.type)&&bc(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Di(),Ge(Ht),Ge(jt),Ch(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return kh(l),null;case 13:if(Ge(rt),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Mi()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Ge(rt),null;case 4:return Di(),null;case 10:return xh(l.type._context),null;case 22:case 23:return sp(),null;case 24:return null;default:return null}}var Bc=!1,Rt=!1,XL=typeof WeakSet=="function"?WeakSet:Set,ve=null;function qi(i,l){var f=i.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){at(i,l,y)}else f.current=null}function Wh(i,l,f){try{f()}catch(y){at(i,l,y)}}var BS=!1;function QL(i,l){if(sh=ac,i=x1(),Xf(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var _=y.anchorOffset,E=y.focusNode;y=y.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var I=0,H=-1,X=-1,se=0,le=0,ce=i,ae=null;t:for(;;){for(var ge;ce!==f||_!==0&&ce.nodeType!==3||(H=I+_),ce!==E||y!==0&&ce.nodeType!==3||(X=I+y),ce.nodeType===3&&(I+=ce.nodeValue.length),(ge=ce.firstChild)!==null;)ae=ce,ce=ge;for(;;){if(ce===i)break t;if(ae===f&&++se===_&&(H=I),ae===E&&++le===y&&(X=I),(ge=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=ge}f=H===-1||X===-1?null:{start:H,end:X}}else f=null}f=f||{start:0,end:0}}else f=null;for(ih={focusedElem:i,selectionRange:f},ac=!1,ve=l;ve!==null;)if(l=ve,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ve=i;else for(;ve!==null;){l=ve;try{var we=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,ct=we.memoizedState,ne=l.stateNode,Z=ne.getSnapshotBeforeUpdate(l.elementType===l.type?Se:An(l.type,Se),ct);ne.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var re=l.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){at(l,l.return,de)}if(i=l.sibling,i!==null){i.return=l.return,ve=i;break}ve=l.return}return we=BS,BS=!1,we}function ba(i,l,f){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var _=y=y.next;do{if((_.tag&i)===i){var E=_.destroy;_.destroy=void 0,E!==void 0&&Wh(l,f,E)}_=_.next}while(_!==y)}}function zc(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&i)===i){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function Kh(i){var l=i.ref;if(l!==null){var f=i.stateNode;switch(i.tag){case 5:i=f;break;default:i=f}typeof l=="function"?l(i):l.current=i}}function zS(i){var l=i.alternate;l!==null&&(i.alternate=null,zS(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[Qn],delete l[ua],delete l[ch],delete l[ML],delete l[OL])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function VS(i){return i.tag===5||i.tag===3||i.tag===4}function US(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||VS(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Gh(i,l,f){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(i,l):f.insertBefore(i,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(i,f)):(l=f,l.appendChild(i)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=xc));else if(y!==4&&(i=i.child,i!==null))for(Gh(i,l,f),i=i.sibling;i!==null;)Gh(i,l,f),i=i.sibling}function Yh(i,l,f){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?f.insertBefore(i,l):f.appendChild(i);else if(y!==4&&(i=i.child,i!==null))for(Yh(i,l,f),i=i.sibling;i!==null;)Yh(i,l,f),i=i.sibling}var Nt=null,Rn=!1;function ts(i,l,f){for(f=f.child;f!==null;)HS(i,l,f),f=f.sibling}function HS(i,l,f){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(Ts,f)}catch{}switch(f.tag){case 5:Rt||qi(f,l);case 6:var y=Nt,_=Rn;Nt=null,ts(i,l,f),Nt=y,Rn=_,Nt!==null&&(Rn?(i=Nt,f=f.stateNode,i.nodeType===8?i.parentNode.removeChild(f):i.removeChild(f)):Nt.removeChild(f.stateNode));break;case 18:Nt!==null&&(Rn?(i=Nt,f=f.stateNode,i.nodeType===8?lh(i.parentNode,f):i.nodeType===1&&lh(i,f),Zo(i)):lh(Nt,f.stateNode));break;case 4:y=Nt,_=Rn,Nt=f.stateNode.containerInfo,Rn=!0,ts(i,l,f),Nt=y,Rn=_;break;case 0:case 11:case 14:case 15:if(!Rt&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){_=y=y.next;do{var E=_,I=E.destroy;E=E.tag,I!==void 0&&((E&2)!==0||(E&4)!==0)&&Wh(f,l,I),_=_.next}while(_!==y)}ts(i,l,f);break;case 1:if(!Rt&&(qi(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(H){at(f,l,H)}ts(i,l,f);break;case 21:ts(i,l,f);break;case 22:f.mode&1?(Rt=(y=Rt)||f.memoizedState!==null,ts(i,l,f),Rt=y):ts(i,l,f);break;default:ts(i,l,f)}}function WS(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var f=i.stateNode;f===null&&(f=i.stateNode=new XL),l.forEach(function(y){var _=o3.bind(null,i,y);f.has(y)||(f.add(y),y.then(_,_))})}}function In(i,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var _=f[y];try{var E=i,I=l,H=I;e:for(;H!==null;){switch(H.tag){case 5:Nt=H.stateNode,Rn=!1;break e;case 3:Nt=H.stateNode.containerInfo,Rn=!0;break e;case 4:Nt=H.stateNode.containerInfo,Rn=!0;break e}H=H.return}if(Nt===null)throw Error(n(160));HS(E,I,_),Nt=null,Rn=!1;var X=_.alternate;X!==null&&(X.return=null),_.return=null}catch(se){at(_,l,se)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)KS(l,i),l=l.sibling}function KS(i,l){var f=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(In(l,i),er(i),y&4){try{ba(3,i,i.return),zc(3,i)}catch(Se){at(i,i.return,Se)}try{ba(5,i,i.return)}catch(Se){at(i,i.return,Se)}}break;case 1:In(l,i),er(i),y&512&&f!==null&&qi(f,f.return);break;case 5:if(In(l,i),er(i),y&512&&f!==null&&qi(f,f.return),i.flags&32){var _=i.stateNode;try{Ve(_,"")}catch(Se){at(i,i.return,Se)}}if(y&4&&(_=i.stateNode,_!=null)){var E=i.memoizedProps,I=f!==null?f.memoizedProps:E,H=i.type,X=i.updateQueue;if(i.updateQueue=null,X!==null)try{H==="input"&&E.type==="radio"&&E.name!=null&&Ce(_,E),tn(H,I);var se=tn(H,E);for(I=0;I<X.length;I+=2){var le=X[I],ce=X[I+1];le==="style"?Pt(_,ce):le==="dangerouslySetInnerHTML"?ot(_,ce):le==="children"?Ve(_,ce):k(_,le,ce,se)}switch(H){case"input":Ne(_,E);break;case"textarea":It(_,E);break;case"select":var ae=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!E.multiple;var ge=E.value;ge!=null?xt(_,!!E.multiple,ge,!1):ae!==!!E.multiple&&(E.defaultValue!=null?xt(_,!!E.multiple,E.defaultValue,!0):xt(_,!!E.multiple,E.multiple?[]:"",!1))}_[ua]=E}catch(Se){at(i,i.return,Se)}}break;case 6:if(In(l,i),er(i),y&4){if(i.stateNode===null)throw Error(n(162));_=i.stateNode,E=i.memoizedProps;try{_.nodeValue=E}catch(Se){at(i,i.return,Se)}}break;case 3:if(In(l,i),er(i),y&4&&f!==null&&f.memoizedState.isDehydrated)try{Zo(l.containerInfo)}catch(Se){at(i,i.return,Se)}break;case 4:In(l,i),er(i);break;case 13:In(l,i),er(i),_=i.child,_.flags&8192&&(E=_.memoizedState!==null,_.stateNode.isHidden=E,!E||_.alternate!==null&&_.alternate.memoizedState!==null||(Jh=nt())),y&4&&WS(i);break;case 22:if(le=f!==null&&f.memoizedState!==null,i.mode&1?(Rt=(se=Rt)||le,In(l,i),Rt=se):In(l,i),er(i),y&8192){if(se=i.memoizedState!==null,(i.stateNode.isHidden=se)&&!le&&(i.mode&1)!==0)for(ve=i,le=i.child;le!==null;){for(ce=ve=le;ve!==null;){switch(ae=ve,ge=ae.child,ae.tag){case 0:case 11:case 14:case 15:ba(4,ae,ae.return);break;case 1:qi(ae,ae.return);var we=ae.stateNode;if(typeof we.componentWillUnmount=="function"){y=ae,f=ae.return;try{l=y,we.props=l.memoizedProps,we.state=l.memoizedState,we.componentWillUnmount()}catch(Se){at(y,f,Se)}}break;case 5:qi(ae,ae.return);break;case 22:if(ae.memoizedState!==null){XS(ce);continue}}ge!==null?(ge.return=ae,ve=ge):XS(ce)}le=le.sibling}e:for(le=null,ce=i;;){if(ce.tag===5){if(le===null){le=ce;try{_=ce.stateNode,se?(E=_.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(H=ce.stateNode,X=ce.memoizedProps.style,I=X!=null&&X.hasOwnProperty("display")?X.display:null,H.style.display=Ot("display",I))}catch(Se){at(i,i.return,Se)}}}else if(ce.tag===6){if(le===null)try{ce.stateNode.nodeValue=se?"":ce.memoizedProps}catch(Se){at(i,i.return,Se)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===i)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===i)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===i)break e;le===ce&&(le=null),ce=ce.return}le===ce&&(le=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:In(l,i),er(i),y&4&&WS(i);break;case 21:break;default:In(l,i),er(i)}}function er(i){var l=i.flags;if(l&2){try{e:{for(var f=i.return;f!==null;){if(VS(f)){var y=f;break e}f=f.return}throw Error(n(160))}switch(y.tag){case 5:var _=y.stateNode;y.flags&32&&(Ve(_,""),y.flags&=-33);var E=US(i);Yh(i,E,_);break;case 3:case 4:var I=y.stateNode.containerInfo,H=US(i);Gh(i,H,I);break;default:throw Error(n(161))}}catch(X){at(i,i.return,X)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function JL(i,l,f){ve=i,GS(i)}function GS(i,l,f){for(var y=(i.mode&1)!==0;ve!==null;){var _=ve,E=_.child;if(_.tag===22&&y){var I=_.memoizedState!==null||Bc;if(!I){var H=_.alternate,X=H!==null&&H.memoizedState!==null||Rt;H=Bc;var se=Rt;if(Bc=I,(Rt=X)&&!se)for(ve=_;ve!==null;)I=ve,X=I.child,I.tag===22&&I.memoizedState!==null?QS(_):X!==null?(X.return=I,ve=X):QS(_);for(;E!==null;)ve=E,GS(E),E=E.sibling;ve=_,Bc=H,Rt=se}YS(i)}else(_.subtreeFlags&8772)!==0&&E!==null?(E.return=_,ve=E):YS(i)}}function YS(i){for(;ve!==null;){var l=ve;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Rt||zc(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!Rt)if(f===null)y.componentDidMount();else{var _=l.elementType===l.type?f.memoizedProps:An(l.type,f.memoizedProps);y.componentDidUpdate(_,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var E=l.updateQueue;E!==null&&X1(l,E,y);break;case 3:var I=l.updateQueue;if(I!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}X1(l,I,f)}break;case 5:var H=l.stateNode;if(f===null&&l.flags&4){f=H;var X=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&f.focus();break;case"img":X.src&&(f.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var se=l.alternate;if(se!==null){var le=se.memoizedState;if(le!==null){var ce=le.dehydrated;ce!==null&&Zo(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Rt||l.flags&512&&Kh(l)}catch(ae){at(l,l.return,ae)}}if(l===i){ve=null;break}if(f=l.sibling,f!==null){f.return=l.return,ve=f;break}ve=l.return}}function XS(i){for(;ve!==null;){var l=ve;if(l===i){ve=null;break}var f=l.sibling;if(f!==null){f.return=l.return,ve=f;break}ve=l.return}}function QS(i){for(;ve!==null;){var l=ve;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{zc(4,l)}catch(X){at(l,f,X)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var _=l.return;try{y.componentDidMount()}catch(X){at(l,_,X)}}var E=l.return;try{Kh(l)}catch(X){at(l,E,X)}break;case 5:var I=l.return;try{Kh(l)}catch(X){at(l,I,X)}}}catch(X){at(l,l.return,X)}if(l===i){ve=null;break}var H=l.sibling;if(H!==null){H.return=l.return,ve=H;break}ve=l.return}}var ZL=Math.ceil,Vc=N.ReactCurrentDispatcher,Xh=N.ReactCurrentOwner,xn=N.ReactCurrentBatchConfig,$e=0,_t=null,ht=null,Ct=0,an=0,Fi=Xr(0),bt=0,Sa=null,$s=0,Uc=0,Qh=0,_a=null,Gt=null,Jh=0,Bi=1/0,kr=null,Hc=!1,Zh=null,ns=null,Wc=!1,rs=null,Kc=0,ka=0,ep=null,Gc=-1,Yc=0;function $t(){return($e&6)!==0?nt():Gc!==-1?Gc:Gc=nt()}function ss(i){return(i.mode&1)===0?1:($e&2)!==0&&Ct!==0?Ct&-Ct:LL.transition!==null?(Yc===0&&(Yc=wi()),Yc):(i=ze,i!==0||(i=window.event,i=i===void 0?16:Zb(i.type)),i)}function Mn(i,l,f,y){if(50<ka)throw ka=0,ep=null,Error(n(185));As(i,f,y),(($e&2)===0||i!==_t)&&(i===_t&&(($e&2)===0&&(Uc|=f),bt===4&&is(i,Ct)),Yt(i,y),f===1&&$e===0&&(l.mode&1)===0&&(Bi=nt()+500,_c&&Jr()))}function Yt(i,l){var f=i.callbackNode;Pf(i,l);var y=xi(i,i===_t?Ct:0);if(y===0)f!==null&&Zl(f),i.callbackNode=null,i.callbackPriority=0;else if(l=y&-y,i.callbackPriority!==l){if(f!=null&&Zl(f),l===1)i.tag===0?PL(ZS.bind(null,i)):$1(ZS.bind(null,i)),RL(function(){($e&6)===0&&Jr()}),f=null;else{switch(Hb(y)){case 1:f=Wo;break;case 4:f=tc;break;case 16:f=gi;break;case 536870912:f=nc;break;default:f=gi}f=a_(f,JS.bind(null,i))}i.callbackPriority=l,i.callbackNode=f}}function JS(i,l){if(Gc=-1,Yc=0,($e&6)!==0)throw Error(n(327));var f=i.callbackNode;if(zi()&&i.callbackNode!==f)return null;var y=xi(i,i===_t?Ct:0);if(y===0)return null;if((y&30)!==0||(y&i.expiredLanes)!==0||l)l=Xc(i,y);else{l=y;var _=$e;$e|=2;var E=t_();(_t!==i||Ct!==l)&&(kr=null,Bi=nt()+500,Fs(i,l));do try{n3();break}catch(H){e_(i,H)}while(!0);vh(),Vc.current=E,$e=_,ht!==null?l=0:(_t=null,Ct=0,l=bt)}if(l!==0){if(l===2&&(_=Ko(i),_!==0&&(y=_,l=tp(i,_))),l===1)throw f=Sa,Fs(i,0),is(i,y),Yt(i,nt()),f;if(l===6)is(i,y);else{if(_=i.current.alternate,(y&30)===0&&!e3(_)&&(l=Xc(i,y),l===2&&(E=Ko(i),E!==0&&(y=E,l=tp(i,E))),l===1))throw f=Sa,Fs(i,0),is(i,y),Yt(i,nt()),f;switch(i.finishedWork=_,i.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:Bs(i,Gt,kr);break;case 3:if(is(i,y),(y&130023424)===y&&(l=Jh+500-nt(),10<l)){if(xi(i,0)!==0)break;if(_=i.suspendedLanes,(_&y)!==y){$t(),i.pingedLanes|=i.suspendedLanes&_;break}i.timeoutHandle=ah(Bs.bind(null,i,Gt,kr),l);break}Bs(i,Gt,kr);break;case 4:if(is(i,y),(y&4194240)===y)break;for(l=i.eventTimes,_=-1;0<y;){var I=31-nn(y);E=1<<I,I=l[I],I>_&&(_=I),y&=~E}if(y=_,y=nt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*ZL(y/1960))-y,10<y){i.timeoutHandle=ah(Bs.bind(null,i,Gt,kr),y);break}Bs(i,Gt,kr);break;case 5:Bs(i,Gt,kr);break;default:throw Error(n(329))}}}return Yt(i,nt()),i.callbackNode===f?JS.bind(null,i):null}function tp(i,l){var f=_a;return i.current.memoizedState.isDehydrated&&(Fs(i,l).flags|=256),i=Xc(i,l),i!==2&&(l=Gt,Gt=f,l!==null&&np(l)),i}function np(i){Gt===null?Gt=i:Gt.push.apply(Gt,i)}function e3(i){for(var l=i;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var _=f[y],E=_.getSnapshot;_=_.value;try{if(!jn(E(),_))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function is(i,l){for(l&=~Qh,l&=~Uc,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var f=31-nn(l),y=1<<f;i[f]=-1,l&=~y}}function ZS(i){if(($e&6)!==0)throw Error(n(327));zi();var l=xi(i,0);if((l&1)===0)return Yt(i,nt()),null;var f=Xc(i,l);if(i.tag!==0&&f===2){var y=Ko(i);y!==0&&(l=y,f=tp(i,y))}if(f===1)throw f=Sa,Fs(i,0),is(i,l),Yt(i,nt()),f;if(f===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Bs(i,Gt,kr),Yt(i,nt()),null}function rp(i,l){var f=$e;$e|=1;try{return i(l)}finally{$e=f,$e===0&&(Bi=nt()+500,_c&&Jr())}}function qs(i){rs!==null&&rs.tag===0&&($e&6)===0&&zi();var l=$e;$e|=1;var f=xn.transition,y=ze;try{if(xn.transition=null,ze=1,i)return i()}finally{ze=y,xn.transition=f,$e=l,($e&6)===0&&Jr()}}function sp(){an=Fi.current,Ge(Fi)}function Fs(i,l){i.finishedWork=null,i.finishedLanes=0;var f=i.timeoutHandle;if(f!==-1&&(i.timeoutHandle=-1,AL(f)),ht!==null)for(f=ht.return;f!==null;){var y=f;switch(hh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&bc();break;case 3:Di(),Ge(Ht),Ge(jt),Ch();break;case 5:kh(y);break;case 4:Di();break;case 13:Ge(rt);break;case 19:Ge(rt);break;case 10:xh(y.type._context);break;case 22:case 23:sp()}f=f.return}if(_t=i,ht=i=os(i.current,null),Ct=an=l,bt=0,Sa=null,Qh=Uc=$s=0,Gt=_a=null,Ps!==null){for(l=0;l<Ps.length;l++)if(f=Ps[l],y=f.interleaved,y!==null){f.interleaved=null;var _=y.next,E=f.pending;if(E!==null){var I=E.next;E.next=_,y.next=I}f.pending=y}Ps=null}return i}function e_(i,l){do{var f=ht;try{if(vh(),Mc.current=Dc,Oc){for(var y=st.memoizedState;y!==null;){var _=y.queue;_!==null&&(_.pending=null),y=y.next}Oc=!1}if(Ds=0,St=wt=st=null,ga=!1,ya=0,Xh.current=null,f===null||f.return===null){bt=1,Sa=l,ht=null;break}e:{var E=i,I=f.return,H=f,X=l;if(l=Ct,H.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var se=X,le=H,ce=le.tag;if((le.mode&1)===0&&(ce===0||ce===11||ce===15)){var ae=le.alternate;ae?(le.updateQueue=ae.updateQueue,le.memoizedState=ae.memoizedState,le.lanes=ae.lanes):(le.updateQueue=null,le.memoizedState=null)}var ge=NS(I);if(ge!==null){ge.flags&=-257,CS(ge,I,H,E,l),ge.mode&1&&kS(E,se,l),l=ge,X=se;var we=l.updateQueue;if(we===null){var Se=new Set;Se.add(X),l.updateQueue=Se}else we.add(X);break e}else{if((l&1)===0){kS(E,se,l),ip();break e}X=Error(n(426))}}else if(Xe&&H.mode&1){var ct=NS(I);if(ct!==null){(ct.flags&65536)===0&&(ct.flags|=256),CS(ct,I,H,E,l),gh($i(X,H));break e}}E=X=$i(X,H),bt!==4&&(bt=2),_a===null?_a=[E]:_a.push(E),E=I;do{switch(E.tag){case 3:E.flags|=65536,l&=-l,E.lanes|=l;var ne=SS(E,X,l);Y1(E,ne);break e;case 1:H=X;var Z=E.type,re=E.stateNode;if((E.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(ns===null||!ns.has(re)))){E.flags|=65536,l&=-l,E.lanes|=l;var de=_S(E,H,l);Y1(E,de);break e}}E=E.return}while(E!==null)}r_(f)}catch(ke){l=ke,ht===f&&f!==null&&(ht=f=f.return);continue}break}while(!0)}function t_(){var i=Vc.current;return Vc.current=Dc,i===null?Dc:i}function ip(){(bt===0||bt===3||bt===2)&&(bt=4),_t===null||($s&268435455)===0&&(Uc&268435455)===0||is(_t,Ct)}function Xc(i,l){var f=$e;$e|=2;var y=t_();(_t!==i||Ct!==l)&&(kr=null,Fs(i,l));do try{t3();break}catch(_){e_(i,_)}while(!0);if(vh(),$e=f,Vc.current=y,ht!==null)throw Error(n(261));return _t=null,Ct=0,bt}function t3(){for(;ht!==null;)n_(ht)}function n3(){for(;ht!==null&&!jf();)n_(ht)}function n_(i){var l=o_(i.alternate,i,an);i.memoizedProps=i.pendingProps,l===null?r_(i):ht=l,Xh.current=null}function r_(i){var l=i;do{var f=l.alternate;if(i=l.return,(l.flags&32768)===0){if(f=GL(f,l,an),f!==null){ht=f;return}}else{if(f=YL(f,l),f!==null){f.flags&=32767,ht=f;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{bt=6,ht=null;return}}if(l=l.sibling,l!==null){ht=l;return}ht=l=i}while(l!==null);bt===0&&(bt=5)}function Bs(i,l,f){var y=ze,_=xn.transition;try{xn.transition=null,ze=1,r3(i,l,f,y)}finally{xn.transition=_,ze=y}return null}function r3(i,l,f,y){do zi();while(rs!==null);if(($e&6)!==0)throw Error(n(327));f=i.finishedWork;var _=i.finishedLanes;if(f===null)return null;if(i.finishedWork=null,i.finishedLanes=0,f===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var E=f.lanes|f.childLanes;if(sc(i,E),i===_t&&(ht=_t=null,Ct=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Wc||(Wc=!0,a_(gi,function(){return zi(),null})),E=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||E){E=xn.transition,xn.transition=null;var I=ze;ze=1;var H=$e;$e|=4,Xh.current=null,QL(i,f),KS(f,i),_L(ih),ac=!!sh,ih=sh=null,i.current=f,JL(f),ec(),$e=H,ze=I,xn.transition=E}else i.current=f;if(Wc&&(Wc=!1,rs=i,Kc=_),E=i.pendingLanes,E===0&&(ns=null),Rf(f.stateNode),Yt(i,nt()),l!==null)for(y=i.onRecoverableError,f=0;f<l.length;f++)_=l[f],y(_.value,{componentStack:_.stack,digest:_.digest});if(Hc)throw Hc=!1,i=Zh,Zh=null,i;return(Kc&1)!==0&&i.tag!==0&&zi(),E=i.pendingLanes,(E&1)!==0?i===ep?ka++:(ka=0,ep=i):ka=0,Jr(),null}function zi(){if(rs!==null){var i=Hb(Kc),l=xn.transition,f=ze;try{if(xn.transition=null,ze=16>i?16:i,rs===null)var y=!1;else{if(i=rs,rs=null,Kc=0,($e&6)!==0)throw Error(n(331));var _=$e;for($e|=4,ve=i.current;ve!==null;){var E=ve,I=E.child;if((ve.flags&16)!==0){var H=E.deletions;if(H!==null){for(var X=0;X<H.length;X++){var se=H[X];for(ve=se;ve!==null;){var le=ve;switch(le.tag){case 0:case 11:case 15:ba(8,le,E)}var ce=le.child;if(ce!==null)ce.return=le,ve=ce;else for(;ve!==null;){le=ve;var ae=le.sibling,ge=le.return;if(zS(le),le===se){ve=null;break}if(ae!==null){ae.return=ge,ve=ae;break}ve=ge}}}var we=E.alternate;if(we!==null){var Se=we.child;if(Se!==null){we.child=null;do{var ct=Se.sibling;Se.sibling=null,Se=ct}while(Se!==null)}}ve=E}}if((E.subtreeFlags&2064)!==0&&I!==null)I.return=E,ve=I;else e:for(;ve!==null;){if(E=ve,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:ba(9,E,E.return)}var ne=E.sibling;if(ne!==null){ne.return=E.return,ve=ne;break e}ve=E.return}}var Z=i.current;for(ve=Z;ve!==null;){I=ve;var re=I.child;if((I.subtreeFlags&2064)!==0&&re!==null)re.return=I,ve=re;else e:for(I=Z;ve!==null;){if(H=ve,(H.flags&2048)!==0)try{switch(H.tag){case 0:case 11:case 15:zc(9,H)}}catch(ke){at(H,H.return,ke)}if(H===I){ve=null;break e}var de=H.sibling;if(de!==null){de.return=H.return,ve=de;break e}ve=H.return}}if($e=_,Jr(),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Ts,i)}catch{}y=!0}return y}finally{ze=f,xn.transition=l}}return!1}function s_(i,l,f){l=$i(f,l),l=SS(i,l,1),i=es(i,l,1),l=$t(),i!==null&&(As(i,1,l),Yt(i,l))}function at(i,l,f){if(i.tag===3)s_(i,i,f);else for(;l!==null;){if(l.tag===3){s_(l,i,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ns===null||!ns.has(y))){i=$i(f,i),i=_S(l,i,1),l=es(l,i,1),i=$t(),l!==null&&(As(l,1,i),Yt(l,i));break}}l=l.return}}function s3(i,l,f){var y=i.pingCache;y!==null&&y.delete(l),l=$t(),i.pingedLanes|=i.suspendedLanes&f,_t===i&&(Ct&f)===f&&(bt===4||bt===3&&(Ct&130023424)===Ct&&500>nt()-Jh?Fs(i,0):Qh|=f),Yt(i,l)}function i_(i,l){l===0&&((i.mode&1)===0?l=1:(l=vi,vi<<=1,(vi&130023424)===0&&(vi=4194304)));var f=$t();i=br(i,l),i!==null&&(As(i,l,f),Yt(i,f))}function i3(i){var l=i.memoizedState,f=0;l!==null&&(f=l.retryLane),i_(i,f)}function o3(i,l){var f=0;switch(i.tag){case 13:var y=i.stateNode,_=i.memoizedState;_!==null&&(f=_.retryLane);break;case 19:y=i.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(l),i_(i,f)}var o_;o_=function(i,l,f){if(i!==null)if(i.memoizedProps!==l.pendingProps||Ht.current)Kt=!0;else{if((i.lanes&f)===0&&(l.flags&128)===0)return Kt=!1,KL(i,l,f);Kt=(i.flags&131072)!==0}else Kt=!1,Xe&&(l.flags&1048576)!==0&&q1(l,Nc,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;Fc(i,l),i=l.pendingProps;var _=Ai(l,jt.current);Li(l,f),_=Th(null,l,y,i,_,f);var E=Ah();return l.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Wt(y)?(E=!0,Sc(l)):E=!1,l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,Sh(l),_.updater=$c,l.stateNode=_,_._reactInternals=l,Lh(l,y,i,f),l=Fh(null,l,y,!0,E,f)):(l.tag=0,Xe&&E&&fh(l),Dt(null,l,_,f),l=l.child),l;case 16:y=l.elementType;e:{switch(Fc(i,l),i=l.pendingProps,_=y._init,y=_(y._payload),l.type=y,_=l.tag=l3(y),i=An(y,i),_){case 0:l=qh(null,l,y,i,f);break e;case 1:l=IS(null,l,y,i,f);break e;case 11:l=ES(null,l,y,i,f);break e;case 14:l=jS(null,l,y,An(y.type,i),f);break e}throw Error(n(306,y,""))}return l;case 0:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:An(y,_),qh(i,l,y,_,f);case 1:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:An(y,_),IS(i,l,y,_,f);case 3:e:{if(MS(l),i===null)throw Error(n(387));y=l.pendingProps,E=l.memoizedState,_=E.element,G1(i,l),Rc(l,y,null,f);var I=l.memoizedState;if(y=I.element,E.isDehydrated)if(E={element:y,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){_=$i(Error(n(423)),l),l=OS(i,l,y,f,_);break e}else if(y!==_){_=$i(Error(n(424)),l),l=OS(i,l,y,f,_);break e}else for(on=Yr(l.stateNode.containerInfo.firstChild),sn=l,Xe=!0,Tn=null,f=W1(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Mi(),y===_){l=_r(i,l,f);break e}Dt(i,l,y,f)}l=l.child}return l;case 5:return Q1(l),i===null&&mh(l),y=l.type,_=l.pendingProps,E=i!==null?i.memoizedProps:null,I=_.children,oh(y,_)?I=null:E!==null&&oh(y,E)&&(l.flags|=32),RS(i,l),Dt(i,l,I,f),l.child;case 6:return i===null&&mh(l),null;case 13:return PS(i,l,f);case 4:return _h(l,l.stateNode.containerInfo),y=l.pendingProps,i===null?l.child=Oi(l,null,y,f):Dt(i,l,y,f),l.child;case 11:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:An(y,_),ES(i,l,y,_,f);case 7:return Dt(i,l,l.pendingProps,f),l.child;case 8:return Dt(i,l,l.pendingProps.children,f),l.child;case 12:return Dt(i,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,_=l.pendingProps,E=l.memoizedProps,I=_.value,Ue(jc,y._currentValue),y._currentValue=I,E!==null)if(jn(E.value,I)){if(E.children===_.children&&!Ht.current){l=_r(i,l,f);break e}}else for(E=l.child,E!==null&&(E.return=l);E!==null;){var H=E.dependencies;if(H!==null){I=E.child;for(var X=H.firstContext;X!==null;){if(X.context===y){if(E.tag===1){X=Sr(-1,f&-f),X.tag=2;var se=E.updateQueue;if(se!==null){se=se.shared;var le=se.pending;le===null?X.next=X:(X.next=le.next,le.next=X),se.pending=X}}E.lanes|=f,X=E.alternate,X!==null&&(X.lanes|=f),wh(E.return,f,l),H.lanes|=f;break}X=X.next}}else if(E.tag===10)I=E.type===l.type?null:E.child;else if(E.tag===18){if(I=E.return,I===null)throw Error(n(341));I.lanes|=f,H=I.alternate,H!==null&&(H.lanes|=f),wh(I,f,l),I=E.sibling}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===l){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}Dt(i,l,_.children,f),l=l.child}return l;case 9:return _=l.type,y=l.pendingProps.children,Li(l,f),_=yn(_),y=y(_),l.flags|=1,Dt(i,l,y,f),l.child;case 14:return y=l.type,_=An(y,l.pendingProps),_=An(y.type,_),jS(i,l,y,_,f);case 15:return TS(i,l,l.type,l.pendingProps,f);case 17:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:An(y,_),Fc(i,l),l.tag=1,Wt(y)?(i=!0,Sc(l)):i=!1,Li(l,f),wS(l,y,_),Lh(l,y,_,f),Fh(null,l,y,!0,i,f);case 19:return DS(i,l,f);case 22:return AS(i,l,f)}throw Error(n(156,l.tag))};function a_(i,l){return Jl(i,l)}function a3(i,l,f,y){this.tag=i,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(i,l,f,y){return new a3(i,l,f,y)}function op(i){return i=i.prototype,!(!i||!i.isReactComponent)}function l3(i){if(typeof i=="function")return op(i)?1:0;if(i!=null){if(i=i.$$typeof,i===$)return 11;if(i===V)return 14}return 2}function os(i,l){var f=i.alternate;return f===null?(f=wn(i.tag,l,i.key,i.mode),f.elementType=i.elementType,f.type=i.type,f.stateNode=i.stateNode,f.alternate=i,i.alternate=f):(f.pendingProps=l,f.type=i.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=i.flags&14680064,f.childLanes=i.childLanes,f.lanes=i.lanes,f.child=i.child,f.memoizedProps=i.memoizedProps,f.memoizedState=i.memoizedState,f.updateQueue=i.updateQueue,l=i.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=i.sibling,f.index=i.index,f.ref=i.ref,f}function Qc(i,l,f,y,_,E){var I=2;if(y=i,typeof i=="function")op(i)&&(I=1);else if(typeof i=="string")I=5;else e:switch(i){case R:return zs(f.children,_,E,l);case O:I=8,_|=8;break;case L:return i=wn(12,f,l,_|2),i.elementType=L,i.lanes=E,i;case U:return i=wn(13,f,l,_),i.elementType=U,i.lanes=E,i;case D:return i=wn(19,f,l,_),i.elementType=D,i.lanes=E,i;case Q:return Jc(f,_,E,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:I=10;break e;case M:I=9;break e;case $:I=11;break e;case V:I=14;break e;case z:I=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=wn(I,f,l,_),l.elementType=i,l.type=y,l.lanes=E,l}function zs(i,l,f,y){return i=wn(7,i,y,l),i.lanes=f,i}function Jc(i,l,f,y){return i=wn(22,i,y,l),i.elementType=Q,i.lanes=f,i.stateNode={isHidden:!1},i}function ap(i,l,f){return i=wn(6,i,null,l),i.lanes=f,i}function lp(i,l,f){return l=wn(4,i.children!==null?i.children:[],i.key,l),l.lanes=f,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function c3(i,l,f,y,_){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Go(0),this.expirationTimes=Go(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Go(0),this.identifierPrefix=y,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function cp(i,l,f,y,_,E,I,H,X){return i=new c3(i,l,f,H,X),l===1?(l=1,E===!0&&(l|=8)):l=0,E=wn(3,null,null,l),i.current=E,E.stateNode=i,E.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sh(E),i}function u3(i,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:y==null?null:""+y,children:i,containerInfo:l,implementation:f}}function l_(i){if(!i)return Qr;i=i._reactInternals;e:{if(Yn(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Wt(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var f=i.type;if(Wt(f))return L1(i,f,l)}return l}function c_(i,l,f,y,_,E,I,H,X){return i=cp(f,y,!0,i,_,E,I,H,X),i.context=l_(null),f=i.current,y=$t(),_=ss(f),E=Sr(y,_),E.callback=l??null,es(f,E,_),i.current.lanes=_,As(i,_,y),Yt(i,y),i}function Zc(i,l,f,y){var _=l.current,E=$t(),I=ss(_);return f=l_(f),l.context===null?l.context=f:l.pendingContext=f,l=Sr(E,I),l.payload={element:i},y=y===void 0?null:y,y!==null&&(l.callback=y),i=es(_,l,I),i!==null&&(Mn(i,_,I,E),Ac(i,_,I)),I}function eu(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function u_(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var f=i.retryLane;i.retryLane=f!==0&&f<l?f:l}}function up(i,l){u_(i,l),(i=i.alternate)&&u_(i,l)}function d3(){return null}var d_=typeof reportError=="function"?reportError:function(i){console.error(i)};function dp(i){this._internalRoot=i}tu.prototype.render=dp.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));Zc(i,l,null,null)},tu.prototype.unmount=dp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;qs(function(){Zc(null,i,null,null)}),l[yr]=null}};function tu(i){this._internalRoot=i}tu.prototype.unstable_scheduleHydration=function(i){if(i){var l=Gb();i={blockedOn:null,target:i,priority:l};for(var f=0;f<Wr.length&&l!==0&&l<Wr[f].priority;f++);Wr.splice(f,0,i),f===0&&Qb(i)}};function fp(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function nu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function f_(){}function f3(i,l,f,y,_){if(_){if(typeof y=="function"){var E=y;y=function(){var se=eu(I);E.call(se)}}var I=c_(l,y,i,0,null,!1,!1,"",f_);return i._reactRootContainer=I,i[yr]=I.current,la(i.nodeType===8?i.parentNode:i),qs(),I}for(;_=i.lastChild;)i.removeChild(_);if(typeof y=="function"){var H=y;y=function(){var se=eu(X);H.call(se)}}var X=cp(i,0,!1,null,null,!1,!1,"",f_);return i._reactRootContainer=X,i[yr]=X.current,la(i.nodeType===8?i.parentNode:i),qs(function(){Zc(l,X,f,y)}),X}function ru(i,l,f,y,_){var E=f._reactRootContainer;if(E){var I=E;if(typeof _=="function"){var H=_;_=function(){var X=eu(I);H.call(X)}}Zc(l,I,i,_)}else I=f3(f,l,i,_,y);return eu(I)}Wb=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var f=Xn(l.pendingLanes);f!==0&&(Lf(l,f|1),Yt(l,nt()),($e&6)===0&&(Bi=nt()+500,Jr()))}break;case 13:qs(function(){var y=br(i,1);if(y!==null){var _=$t();Mn(y,i,1,_)}}),up(i,1)}},Df=function(i){if(i.tag===13){var l=br(i,134217728);if(l!==null){var f=$t();Mn(l,i,134217728,f)}up(i,134217728)}},Kb=function(i){if(i.tag===13){var l=ss(i),f=br(i,l);if(f!==null){var y=$t();Mn(f,i,l,y)}up(i,l)}},Gb=function(){return ze},Yb=function(i,l){var f=ze;try{return ze=i,l()}finally{ze=f}},Fo=function(i,l,f){switch(l){case"input":if(Ne(i,f),l=f.name,f.type==="radio"&&l!=null){for(f=i;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==i&&y.form===i.form){var _=wc(y);if(!_)throw Error(n(90));ye(y),Ne(y,_)}}}break;case"textarea":It(i,f);break;case"select":l=f.value,l!=null&&xt(i,!!f.multiple,l,!1)}},Kl=rp,Gl=qs;var h3={usingClientEntryPoint:!1,Events:[da,ji,wc,Hl,Wl,rp]},Na={findFiberByHostInstance:Rs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},p3={bundleType:Na.bundleType,version:Na.version,rendererPackageName:Na.rendererPackageName,rendererConfig:Na.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Xl(i),i===null?null:i.stateNode},findFiberByHostInstance:Na.findFiberByHostInstance||d3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!su.isDisabled&&su.supportsFiber)try{Ts=su.inject(p3),pn=su}catch{}}return Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=h3,Xt.createPortal=function(i,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fp(l))throw Error(n(200));return u3(i,l,null,f)},Xt.createRoot=function(i,l){if(!fp(i))throw Error(n(299));var f=!1,y="",_=d_;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),l=cp(i,1,!1,null,null,f,!1,y,_),i[yr]=l.current,la(i.nodeType===8?i.parentNode:i),new dp(l)},Xt.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Xl(l),i=i===null?null:i.stateNode,i},Xt.flushSync=function(i){return qs(i)},Xt.hydrate=function(i,l,f){if(!nu(l))throw Error(n(200));return ru(null,i,l,!0,f)},Xt.hydrateRoot=function(i,l,f){if(!fp(i))throw Error(n(405));var y=f!=null&&f.hydratedSources||null,_=!1,E="",I=d_;if(f!=null&&(f.unstable_strictMode===!0&&(_=!0),f.identifierPrefix!==void 0&&(E=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),l=c_(l,null,i,1,f??null,_,!1,E,I),i[yr]=l.current,la(i),y)for(i=0;i<y.length;i++)f=y[i],_=f._getVersion,_=_(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,_]:l.mutableSourceEagerHydrationData.push(f,_);return new tu(l)},Xt.render=function(i,l,f){if(!nu(l))throw Error(n(200));return ru(null,i,l,!1,f)},Xt.unmountComponentAtNode=function(i){if(!nu(i))throw Error(n(40));return i._reactRootContainer?(qs(function(){ru(null,null,i,!1,function(){i._reactRootContainer=null,i[yr]=null})}),!0):!1},Xt.unstable_batchedUpdates=rp,Xt.unstable_renderSubtreeIntoContainer=function(i,l,f,y){if(!nu(f))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return ru(i,l,f,!1,y)},Xt.version="18.3.1-next-f1338f8080-20240426",Xt}var w_;function uA(){if(w_)return mp.exports;w_=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(),mp.exports=S3(),mp.exports}var b_;function _3(){if(b_)return ou;b_=1;var e=uA();return ou.createRoot=e.createRoot,ou.hydrateRoot=e.hydrateRoot,ou}var k3=_3();const N3=gl(k3);function gt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=gt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var C3={value:()=>{}};function Sd(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Mu(n)}function Mu(e){this._=e}function E3(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Mu.prototype=Sd.prototype={constructor:Mu,on:function(e,t){var n=this._,r=E3(e+"",n),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=j3(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=r[o]).type)n[s]=S_(n[s],e.name,t);else if(t==null)for(s in n)n[s]=S_(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Mu(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function j3(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function S_(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=C3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bx="http://www.w3.org/1999/xhtml";const __={svg:"http://www.w3.org/2000/svg",xhtml:bx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _d(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),__.hasOwnProperty(t)?{space:__[t],local:e}:e}function T3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bx&&t.documentElement.namespaceURI===bx?t.createElement(e):t.createElementNS(n,e)}}function A3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function dA(e){var t=_d(e);return(t.local?A3:T3)(t)}function R3(){}function cw(e){return e==null?R3:function(){return this.querySelector(e)}}function I3(e){typeof e!="function"&&(e=cw(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=new Array(a),u,d,p=0;p<a;++p)(u=o[p])&&(d=e.call(u,u.__data__,p,o))&&("__data__"in u&&(d.__data__=u.__data__),c[p]=d);return new fn(r,this._parents)}function M3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function O3(){return[]}function fA(e){return e==null?O3:function(){return this.querySelectorAll(e)}}function P3(e){return function(){return M3(e.apply(this,arguments))}}function L3(e){typeof e=="function"?e=P3(e):e=fA(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var a=t[o],c=a.length,u,d=0;d<c;++d)(u=a[d])&&(r.push(e.call(u,u.__data__,d,a)),s.push(u));return new fn(r,s)}function hA(e){return function(){return this.matches(e)}}function pA(e){return function(t){return t.matches(e)}}var D3=Array.prototype.find;function $3(e){return function(){return D3.call(this.children,e)}}function q3(){return this.firstElementChild}function F3(e){return this.select(e==null?q3:$3(typeof e=="function"?e:pA(e)))}var B3=Array.prototype.filter;function z3(){return Array.from(this.children)}function V3(e){return function(){return B3.call(this.children,e)}}function U3(e){return this.selectAll(e==null?z3:V3(typeof e=="function"?e:pA(e)))}function H3(e){typeof e!="function"&&(e=hA(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],u,d=0;d<a;++d)(u=o[d])&&e.call(u,u.__data__,d,o)&&c.push(u);return new fn(r,this._parents)}function mA(e){return new Array(e.length)}function W3(){return new fn(this._enter||this._groups.map(mA),this._parents)}function Yu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Yu.prototype={constructor:Yu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function K3(e){return function(){return e}}function G3(e,t,n,r,s,o){for(var a=0,c,u=t.length,d=o.length;a<d;++a)(c=t[a])?(c.__data__=o[a],r[a]=c):n[a]=new Yu(e,o[a]);for(;a<u;++a)(c=t[a])&&(s[a]=c)}function Y3(e,t,n,r,s,o,a){var c,u,d=new Map,p=t.length,m=o.length,g=new Array(p),v;for(c=0;c<p;++c)(u=t[c])&&(g[c]=v=a.call(u,u.__data__,c,t)+"",d.has(v)?s[c]=u:d.set(v,u));for(c=0;c<m;++c)v=a.call(e,o[c],c,o)+"",(u=d.get(v))?(r[c]=u,u.__data__=o[c],d.delete(v)):n[c]=new Yu(e,o[c]);for(c=0;c<p;++c)(u=t[c])&&d.get(g[c])===u&&(s[c]=u)}function X3(e){return e.__data__}function Q3(e,t){if(!arguments.length)return Array.from(this,X3);var n=t?Y3:G3,r=this._parents,s=this._groups;typeof e!="function"&&(e=K3(e));for(var o=s.length,a=new Array(o),c=new Array(o),u=new Array(o),d=0;d<o;++d){var p=r[d],m=s[d],g=m.length,v=J3(e.call(p,p&&p.__data__,d,r)),b=v.length,x=c[d]=new Array(b),w=a[d]=new Array(b),S=u[d]=new Array(g);n(p,m,x,w,S,v,t);for(var C=0,k=0,N,j;C<b;++C)if(N=x[C]){for(C>=k&&(k=C+1);!(j=w[k])&&++k<b;);N._next=j||null}}return a=new fn(a,r),a._enter=c,a._exit=u,a}function J3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Z3(){return new fn(this._exit||this._groups.map(mA),this._parents)}function e5(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function t5(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,a=Math.min(s,o),c=new Array(s),u=0;u<a;++u)for(var d=n[u],p=r[u],m=d.length,g=c[u]=new Array(m),v,b=0;b<m;++b)(v=d[b]||p[b])&&(g[b]=v);for(;u<s;++u)c[u]=n[u];return new fn(c,this._parents)}function n5(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],a;--s>=0;)(a=r[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function r5(e){e||(e=s5);function t(m,g){return m&&g?e(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var a=n[o],c=a.length,u=s[o]=new Array(c),d,p=0;p<c;++p)(d=a[p])&&(u[p]=d);u.sort(t)}return new fn(s,this._parents).order()}function s5(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function i5(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function o5(){return Array.from(this)}function a5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var a=r[s];if(a)return a}return null}function l5(){let e=0;for(const t of this)++e;return e}function c5(){return!this.node()}function u5(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,a=s.length,c;o<a;++o)(c=s[o])&&e.call(c,c.__data__,o,s);return this}function d5(e){return function(){this.removeAttribute(e)}}function f5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function h5(e,t){return function(){this.setAttribute(e,t)}}function p5(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function m5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function g5(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function y5(e,t){var n=_d(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?f5:d5:typeof t=="function"?n.local?g5:m5:n.local?p5:h5)(n,t))}function gA(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function v5(e){return function(){this.style.removeProperty(e)}}function x5(e,t,n){return function(){this.style.setProperty(e,t,n)}}function w5(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function b5(e,t,n){return arguments.length>1?this.each((t==null?v5:typeof t=="function"?w5:x5)(e,t,n??"")):uo(this.node(),e)}function uo(e,t){return e.style.getPropertyValue(t)||gA(e).getComputedStyle(e,null).getPropertyValue(t)}function S5(e){return function(){delete this[e]}}function _5(e,t){return function(){this[e]=t}}function k5(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function N5(e,t){return arguments.length>1?this.each((t==null?S5:typeof t=="function"?k5:_5)(e,t)):this.node()[e]}function yA(e){return e.trim().split(/^|\s+/)}function uw(e){return e.classList||new vA(e)}function vA(e){this._node=e,this._names=yA(e.getAttribute("class")||"")}vA.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function xA(e,t){for(var n=uw(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function wA(e,t){for(var n=uw(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function C5(e){return function(){xA(this,e)}}function E5(e){return function(){wA(this,e)}}function j5(e,t){return function(){(t.apply(this,arguments)?xA:wA)(this,e)}}function T5(e,t){var n=yA(e+"");if(arguments.length<2){for(var r=uw(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?j5:t?C5:E5)(n,t))}function A5(){this.textContent=""}function R5(e){return function(){this.textContent=e}}function I5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function M5(e){return arguments.length?this.each(e==null?A5:(typeof e=="function"?I5:R5)(e)):this.node().textContent}function O5(){this.innerHTML=""}function P5(e){return function(){this.innerHTML=e}}function L5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function D5(e){return arguments.length?this.each(e==null?O5:(typeof e=="function"?L5:P5)(e)):this.node().innerHTML}function $5(){this.nextSibling&&this.parentNode.appendChild(this)}function q5(){return this.each($5)}function F5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function B5(){return this.each(F5)}function z5(e){var t=typeof e=="function"?e:dA(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function V5(){return null}function U5(e,t){var n=typeof e=="function"?e:dA(e),r=t==null?V5:typeof t=="function"?t:cw(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function H5(){var e=this.parentNode;e&&e.removeChild(this)}function W5(){return this.each(H5)}function K5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Y5(e){return this.select(e?G5:K5)}function X5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Q5(e){return function(t){e.call(this,t,this.__data__)}}function J5(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Z5(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function eD(e,t,n){return function(){var r=this.__on,s,o=Q5(t);if(r){for(var a=0,c=r.length;a<c;++a)if((s=r[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function tD(e,t,n){var r=J5(e+""),s,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,d=c.length,p;u<d;++u)for(s=0,p=c[u];s<o;++s)if((a=r[s]).type===p.type&&a.name===p.name)return p.value}return}for(c=t?eD:Z5,s=0;s<o;++s)this.each(c(r[s],t,n));return this}function bA(e,t,n){var r=gA(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function nD(e,t){return function(){return bA(this,e,t)}}function rD(e,t){return function(){return bA(this,e,t.apply(this,arguments))}}function sD(e,t){return this.each((typeof t=="function"?rD:nD)(e,t))}function*iD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,a;s<o;++s)(a=r[s])&&(yield a)}var SA=[null];function fn(e,t){this._groups=e,this._parents=t}function vl(){return new fn([[document.documentElement]],SA)}function oD(){return this}fn.prototype=vl.prototype={constructor:fn,select:I3,selectAll:L3,selectChild:F3,selectChildren:U3,filter:H3,data:Q3,enter:W3,exit:Z3,join:e5,merge:t5,selection:oD,order:n5,sort:r5,call:i5,nodes:o5,node:a5,size:l5,empty:c5,each:u5,attr:y5,style:b5,property:N5,classed:T5,text:M5,html:D5,raise:q5,lower:B5,append:z5,insert:U5,remove:W5,clone:Y5,datum:X5,on:tD,dispatch:sD,[Symbol.iterator]:iD};function un(e){return typeof e=="string"?new fn([[document.querySelector(e)]],[document.documentElement]):new fn([[e]],SA)}function aD(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ln(e,t){if(e=aD(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const lD={passive:!1},Ja={capture:!0,passive:!1};function vp(e){e.stopImmediatePropagation()}function ro(e){e.preventDefault(),e.stopImmediatePropagation()}function _A(e){var t=e.document.documentElement,n=un(e).on("dragstart.drag",ro,Ja);"onselectstart"in t?n.on("selectstart.drag",ro,Ja):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function kA(e,t){var n=e.document.documentElement,r=un(e).on("dragstart.drag",null);t&&(r.on("click.drag",ro,Ja),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const au=e=>()=>e;function Sx(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:a,y:c,dx:u,dy:d,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:p}})}Sx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cD(e){return!e.ctrlKey&&!e.button}function uD(){return this.parentNode}function dD(e,t){return t??{x:e.x,y:e.y}}function fD(){return navigator.maxTouchPoints||"ontouchstart"in this}function NA(){var e=cD,t=uD,n=dD,r=fD,s={},o=Sd("start","drag","end"),a=0,c,u,d,p,m=0;function g(N){N.on("mousedown.drag",v).filter(r).on("touchstart.drag",w).on("touchmove.drag",S,lD).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(N,j){if(!(p||!e.call(this,N,j))){var A=k(this,t.call(this,N,j),N,j,"mouse");A&&(un(N.view).on("mousemove.drag",b,Ja).on("mouseup.drag",x,Ja),_A(N.view),vp(N),d=!1,c=N.clientX,u=N.clientY,A("start",N))}}function b(N){if(ro(N),!d){var j=N.clientX-c,A=N.clientY-u;d=j*j+A*A>m}s.mouse("drag",N)}function x(N){un(N.view).on("mousemove.drag mouseup.drag",null),kA(N.view,d),ro(N),s.mouse("end",N)}function w(N,j){if(e.call(this,N,j)){var A=N.changedTouches,R=t.call(this,N,j),O=A.length,L,B;for(L=0;L<O;++L)(B=k(this,R,N,j,A[L].identifier,A[L]))&&(vp(N),B("start",N,A[L]))}}function S(N){var j=N.changedTouches,A=j.length,R,O;for(R=0;R<A;++R)(O=s[j[R].identifier])&&(ro(N),O("drag",N,j[R]))}function C(N){var j=N.changedTouches,A=j.length,R,O;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),R=0;R<A;++R)(O=s[j[R].identifier])&&(vp(N),O("end",N,j[R]))}function k(N,j,A,R,O,L){var B=o.copy(),M=Ln(L||A,j),$,U,D;if((D=n.call(N,new Sx("beforestart",{sourceEvent:A,target:g,identifier:O,active:a,x:M[0],y:M[1],dx:0,dy:0,dispatch:B}),R))!=null)return $=D.x-M[0]||0,U=D.y-M[1]||0,function V(z,Q,F){var q=M,G;switch(z){case"start":s[O]=V,G=a++;break;case"end":delete s[O],--a;case"drag":M=Ln(F||Q,j),G=a;break}B.call(z,N,new Sx(z,{sourceEvent:Q,subject:D,target:g,identifier:O,active:G,x:M[0]+$,y:M[1]+U,dx:M[0]-q[0],dy:M[1]-q[1],dispatch:B}),R)}}return g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:au(!!N),g):e},g.container=function(N){return arguments.length?(t=typeof N=="function"?N:au(N),g):t},g.subject=function(N){return arguments.length?(n=typeof N=="function"?N:au(N),g):n},g.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:au(!!N),g):r},g.on=function(){var N=o.on.apply(o,arguments);return N===o?g:N},g.clickDistance=function(N){return arguments.length?(m=(N=+N)*N,g):Math.sqrt(m)},g}function dw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function CA(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xl(){}var Za=.7,Xu=1/Za,so="\\s*([+-]?\\d+)\\s*",el="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",or="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hD=/^#([0-9a-f]{3,8})$/,pD=new RegExp(`^rgb\\(${so},${so},${so}\\)$`),mD=new RegExp(`^rgb\\(${or},${or},${or}\\)$`),gD=new RegExp(`^rgba\\(${so},${so},${so},${el}\\)$`),yD=new RegExp(`^rgba\\(${or},${or},${or},${el}\\)$`),vD=new RegExp(`^hsl\\(${el},${or},${or}\\)$`),xD=new RegExp(`^hsla\\(${el},${or},${or},${el}\\)$`),k_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};dw(xl,Xs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:N_,formatHex:N_,formatHex8:wD,formatHsl:bD,formatRgb:C_,toString:C_});function N_(){return this.rgb().formatHex()}function wD(){return this.rgb().formatHex8()}function bD(){return EA(this).formatHsl()}function C_(){return this.rgb().formatRgb()}function Xs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=hD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?E_(t):n===3?new Qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?lu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?lu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pD.exec(e))?new Qt(t[1],t[2],t[3],1):(t=mD.exec(e))?new Qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gD.exec(e))?lu(t[1],t[2],t[3],t[4]):(t=yD.exec(e))?lu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vD.exec(e))?A_(t[1],t[2]/100,t[3]/100,1):(t=xD.exec(e))?A_(t[1],t[2]/100,t[3]/100,t[4]):k_.hasOwnProperty(e)?E_(k_[e]):e==="transparent"?new Qt(NaN,NaN,NaN,0):null}function E_(e){return new Qt(e>>16&255,e>>8&255,e&255,1)}function lu(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qt(e,t,n,r)}function SD(e){return e instanceof xl||(e=Xs(e)),e?(e=e.rgb(),new Qt(e.r,e.g,e.b,e.opacity)):new Qt}function _x(e,t,n,r){return arguments.length===1?SD(e):new Qt(e,t,n,r??1)}function Qt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}dw(Qt,_x,CA(xl,{brighter(e){return e=e==null?Xu:Math.pow(Xu,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Za:Math.pow(Za,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qt(Gs(this.r),Gs(this.g),Gs(this.b),Qu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:j_,formatHex:j_,formatHex8:_D,formatRgb:T_,toString:T_}));function j_(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}`}function _D(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}${Hs((isNaN(this.opacity)?1:this.opacity)*255)}`}function T_(){const e=Qu(this.opacity);return`${e===1?"rgb(":"rgba("}${Gs(this.r)}, ${Gs(this.g)}, ${Gs(this.b)}${e===1?")":`, ${e})`}`}function Qu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hs(e){return e=Gs(e),(e<16?"0":"")+e.toString(16)}function A_(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $n(e,t,n,r)}function EA(e){if(e instanceof $n)return new $n(e.h,e.s,e.l,e.opacity);if(e instanceof xl||(e=Xs(e)),!e)return new $n;if(e instanceof $n)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,c=o-s,u=(o+s)/2;return c?(t===o?a=(n-r)/c+(n<r)*6:n===o?a=(r-t)/c+2:a=(t-n)/c+4,c/=u<.5?o+s:2-o-s,a*=60):c=u>0&&u<1?0:a,new $n(a,c,u,e.opacity)}function kD(e,t,n,r){return arguments.length===1?EA(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}dw($n,kD,CA(xl,{brighter(e){return e=e==null?Xu:Math.pow(Xu,e),new $n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Za:Math.pow(Za,e),new $n(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Qt(xp(e>=240?e-240:e+120,s,r),xp(e,s,r),xp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new $n(R_(this.h),cu(this.s),cu(this.l),Qu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Qu(this.opacity);return`${e===1?"hsl(":"hsla("}${R_(this.h)}, ${cu(this.s)*100}%, ${cu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function R_(e){return e=(e||0)%360,e<0?e+360:e}function cu(e){return Math.max(0,Math.min(1,e||0))}function xp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const fw=e=>()=>e;function ND(e,t){return function(n){return e+n*t}}function CD(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function ED(e){return(e=+e)==1?jA:function(t,n){return n-t?CD(t,n,e):fw(isNaN(t)?n:t)}}function jA(e,t){var n=t-e;return n?ND(e,n):fw(isNaN(e)?t:e)}const Ju=(function e(t){var n=ED(t);function r(s,o){var a=n((s=_x(s)).r,(o=_x(o)).r),c=n(s.g,o.g),u=n(s.b,o.b),d=jA(s.opacity,o.opacity);return function(p){return s.r=a(p),s.g=c(p),s.b=u(p),s.opacity=d(p),s+""}}return r.gamma=e,r})(1);function jD(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function TD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function AD(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)s[a]=Ha(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(c){for(a=0;a<r;++a)o[a]=s[a](c);return o}}function RD(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ID(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Ha(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var kx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wp=new RegExp(kx.source,"g");function MD(e){return function(){return e}}function OD(e){return function(t){return e(t)+""}}function TA(e,t){var n=kx.lastIndex=wp.lastIndex=0,r,s,o,a=-1,c=[],u=[];for(e=e+"",t=t+"";(r=kx.exec(e))&&(s=wp.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),c[a]?c[a]+=o:c[++a]=o),(r=r[0])===(s=s[0])?c[a]?c[a]+=s:c[++a]=s:(c[++a]=null,u.push({i:a,x:tr(r,s)})),n=wp.lastIndex;return n<t.length&&(o=t.slice(n),c[a]?c[a]+=o:c[++a]=o),c.length<2?u[0]?OD(u[0].x):MD(t):(t=u.length,function(d){for(var p=0,m;p<t;++p)c[(m=u[p]).i]=m.x(d);return c.join("")})}function Ha(e,t){var n=typeof t,r;return t==null||n==="boolean"?fw(t):(n==="number"?tr:n==="string"?(r=Xs(t))?(t=r,Ju):TA:t instanceof Xs?Ju:t instanceof Date?RD:TD(t)?jD:Array.isArray(t)?AD:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ID:tr)(e,t)}var I_=180/Math.PI,Nx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function AA(e,t,n,r,s,o){var a,c,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*I_,skewX:Math.atan(u)*I_,scaleX:a,scaleY:c}}var uu;function PD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Nx:AA(t.a,t.b,t.c,t.d,t.e,t.f)}function LD(e){return e==null||(uu||(uu=document.createElementNS("http://www.w3.org/2000/svg","g")),uu.setAttribute("transform",e),!(e=uu.transform.baseVal.consolidate()))?Nx:(e=e.matrix,AA(e.a,e.b,e.c,e.d,e.e,e.f))}function RA(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function o(d,p,m,g,v,b){if(d!==m||p!==g){var x=v.push("translate(",null,t,null,n);b.push({i:x-4,x:tr(d,m)},{i:x-2,x:tr(p,g)})}else(m||g)&&v.push("translate("+m+t+g+n)}function a(d,p,m,g){d!==p?(d-p>180?p+=360:p-d>180&&(d+=360),g.push({i:m.push(s(m)+"rotate(",null,r)-2,x:tr(d,p)})):p&&m.push(s(m)+"rotate("+p+r)}function c(d,p,m,g){d!==p?g.push({i:m.push(s(m)+"skewX(",null,r)-2,x:tr(d,p)}):p&&m.push(s(m)+"skewX("+p+r)}function u(d,p,m,g,v,b){if(d!==m||p!==g){var x=v.push(s(v)+"scale(",null,",",null,")");b.push({i:x-4,x:tr(d,m)},{i:x-2,x:tr(p,g)})}else(m!==1||g!==1)&&v.push(s(v)+"scale("+m+","+g+")")}return function(d,p){var m=[],g=[];return d=e(d),p=e(p),o(d.translateX,d.translateY,p.translateX,p.translateY,m,g),a(d.rotate,p.rotate,m,g),c(d.skewX,p.skewX,m,g),u(d.scaleX,d.scaleY,p.scaleX,p.scaleY,m,g),d=p=null,function(v){for(var b=-1,x=g.length,w;++b<x;)m[(w=g[b]).i]=w.x(v);return m.join("")}}}var DD=RA(PD,"px, ","px)","deg)"),$D=RA(LD,", ",")",")"),qD=1e-12;function M_(e){return((e=Math.exp(e))+1/e)/2}function FD(e){return((e=Math.exp(e))-1/e)/2}function BD(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ou=(function e(t,n,r){function s(o,a){var c=o[0],u=o[1],d=o[2],p=a[0],m=a[1],g=a[2],v=p-c,b=m-u,x=v*v+b*b,w,S;if(x<qD)S=Math.log(g/d)/t,w=function(R){return[c+R*v,u+R*b,d*Math.exp(t*R*S)]};else{var C=Math.sqrt(x),k=(g*g-d*d+r*x)/(2*d*n*C),N=(g*g-d*d-r*x)/(2*g*n*C),j=Math.log(Math.sqrt(k*k+1)-k),A=Math.log(Math.sqrt(N*N+1)-N);S=(A-j)/t,w=function(R){var O=R*S,L=M_(j),B=d/(n*C)*(L*BD(t*O+j)-FD(j));return[c+B*v,u+B*b,d*L/M_(t*O+j)]}}return w.duration=S*1e3*t/Math.SQRT2,w}return s.rho=function(o){var a=Math.max(.001,+o),c=a*a,u=c*c;return e(a,c,u)},s})(Math.SQRT2,2,4);var fo=0,Oa=0,Ea=0,IA=1e3,Zu,Pa,ed=0,Qs=0,kd=0,tl=typeof performance=="object"&&performance.now?performance:Date,MA=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hw(){return Qs||(MA(zD),Qs=tl.now()+kd)}function zD(){Qs=0}function td(){this._call=this._time=this._next=null}td.prototype=OA.prototype={constructor:td,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?hw():+n)+(t==null?0:+t),!this._next&&Pa!==this&&(Pa?Pa._next=this:Zu=this,Pa=this),this._call=e,this._time=n,Cx()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cx())}};function OA(e,t,n){var r=new td;return r.restart(e,t,n),r}function VD(){hw(),++fo;for(var e=Zu,t;e;)(t=Qs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fo}function O_(){Qs=(ed=tl.now())+kd,fo=Oa=0;try{VD()}finally{fo=0,HD(),Qs=0}}function UD(){var e=tl.now(),t=e-ed;t>IA&&(kd-=t,ed=e)}function HD(){for(var e,t=Zu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Zu=n);Pa=e,Cx(r)}function Cx(e){if(!fo){Oa&&(Oa=clearTimeout(Oa));var t=e-Qs;t>24?(e<1/0&&(Oa=setTimeout(O_,e-tl.now()-kd)),Ea&&(Ea=clearInterval(Ea))):(Ea||(ed=tl.now(),Ea=setInterval(UD,IA)),fo=1,MA(O_))}}function P_(e,t,n){var r=new td;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var WD=Sd("start","end","cancel","interrupt"),KD=[],PA=0,L_=1,Ex=2,Pu=3,D_=4,jx=5,Lu=6;function Nd(e,t,n,r,s,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;GD(e,n,{name:t,index:r,group:s,on:WD,tween:KD,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:PA})}function pw(e,t){var n=Un(e,t);if(n.state>PA)throw new Error("too late; already scheduled");return n}function pr(e,t){var n=Un(e,t);if(n.state>Pu)throw new Error("too late; already running");return n}function Un(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function GD(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=OA(o,0,n.time);function o(d){n.state=L_,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var p,m,g,v;if(n.state!==L_)return u();for(p in r)if(v=r[p],v.name===n.name){if(v.state===Pu)return P_(a);v.state===D_?(v.state=Lu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[p]):+p<t&&(v.state=Lu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[p])}if(P_(function(){n.state===Pu&&(n.state=D_,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=Ex,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ex){for(n.state=Pu,s=new Array(g=n.tween.length),p=0,m=-1;p<g;++p)(v=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(s[++m]=v);s.length=m+1}}function c(d){for(var p=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=jx,1),m=-1,g=s.length;++m<g;)s[m].call(e,p);n.state===jx&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Lu,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Du(e,t){var n=e.__transition,r,s,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}s=r.state>Ex&&r.state<jx,r.state=Lu,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function YD(e){return this.each(function(){Du(this,e)})}function XD(e,t){var n,r;return function(){var s=pr(this,e),o=s.tween;if(o!==n){r=n=o;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function QD(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=pr(this,e),a=o.tween;if(a!==r){s=(r=a).slice();for(var c={name:t,value:n},u=0,d=s.length;u<d;++u)if(s[u].name===t){s[u]=c;break}u===d&&s.push(c)}o.tween=s}}function JD(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Un(this.node(),n).tween,s=0,o=r.length,a;s<o;++s)if((a=r[s]).name===e)return a.value;return null}return this.each((t==null?XD:QD)(n,e,t))}function mw(e,t,n){var r=e._id;return e.each(function(){var s=pr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Un(s,r).value[t]}}function LA(e,t){var n;return(typeof t=="number"?tr:t instanceof Xs?Ju:(n=Xs(t))?(t=n,Ju):TA)(e,t)}function ZD(e){return function(){this.removeAttribute(e)}}function e$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t$(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===r?o:o=t(r=a,n)}}function n$(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===r?o:o=t(r=a,n)}}function r$(e,t,n){var r,s,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=c+"",a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c)))}}function s$(e,t,n){var r,s,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=c+"",a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c)))}}function i$(e,t){var n=_d(e),r=n==="transform"?$D:LA;return this.attrTween(e,typeof t=="function"?(n.local?s$:r$)(n,r,mw(this,"attr."+e,t)):t==null?(n.local?e$:ZD)(n):(n.local?n$:t$)(n,r,t))}function o$(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function a$(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function l$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&a$(e,o)),n}return s._value=t,s}function c$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&o$(e,o)),n}return s._value=t,s}function u$(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=_d(e);return this.tween(n,(r.local?l$:c$)(r,t))}function d$(e,t){return function(){pw(this,e).delay=+t.apply(this,arguments)}}function f$(e,t){return t=+t,function(){pw(this,e).delay=t}}function h$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?d$:f$)(t,e)):Un(this.node(),t).delay}function p$(e,t){return function(){pr(this,e).duration=+t.apply(this,arguments)}}function m$(e,t){return t=+t,function(){pr(this,e).duration=t}}function g$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?p$:m$)(t,e)):Un(this.node(),t).duration}function y$(e,t){if(typeof t!="function")throw new Error;return function(){pr(this,e).ease=t}}function v$(e){var t=this._id;return arguments.length?this.each(y$(t,e)):Un(this.node(),t).ease}function x$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pr(this,e).ease=n}}function w$(e){if(typeof e!="function")throw new Error;return this.each(x$(this._id,e))}function b$(e){typeof e!="function"&&(e=hA(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],u,d=0;d<a;++d)(u=o[d])&&e.call(u,u.__data__,d,o)&&c.push(u);return new Ir(r,this._parents,this._name,this._id)}function S$(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),a=new Array(r),c=0;c<o;++c)for(var u=t[c],d=n[c],p=u.length,m=a[c]=new Array(p),g,v=0;v<p;++v)(g=u[v]||d[v])&&(m[v]=g);for(;c<r;++c)a[c]=t[c];return new Ir(a,this._parents,this._name,this._id)}function _$(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function k$(e,t,n){var r,s,o=_$(t)?pw:pr;return function(){var a=o(this,e),c=a.on;c!==r&&(s=(r=c).copy()).on(t,n),a.on=s}}function N$(e,t){var n=this._id;return arguments.length<2?Un(this.node(),n).on.on(e):this.each(k$(n,e,t))}function C$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function E$(){return this.on("end.remove",C$(this._id))}function j$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cw(e));for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a)for(var c=r[a],u=c.length,d=o[a]=new Array(u),p,m,g=0;g<u;++g)(p=c[g])&&(m=e.call(p,p.__data__,g,c))&&("__data__"in p&&(m.__data__=p.__data__),d[g]=m,Nd(d[g],t,n,g,d,Un(p,n)));return new Ir(o,this._parents,t,n)}function T$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fA(e));for(var r=this._groups,s=r.length,o=[],a=[],c=0;c<s;++c)for(var u=r[c],d=u.length,p,m=0;m<d;++m)if(p=u[m]){for(var g=e.call(p,p.__data__,m,u),v,b=Un(p,n),x=0,w=g.length;x<w;++x)(v=g[x])&&Nd(v,t,n,x,g,b);o.push(g),a.push(p)}return new Ir(o,a,t,n)}var A$=vl.prototype.constructor;function R$(){return new A$(this._groups,this._parents)}function I$(e,t){var n,r,s;return function(){var o=uo(this,e),a=(this.style.removeProperty(e),uo(this,e));return o===a?null:o===n&&a===r?s:s=t(n=o,r=a)}}function DA(e){return function(){this.style.removeProperty(e)}}function M$(e,t,n){var r,s=n+"",o;return function(){var a=uo(this,e);return a===s?null:a===r?o:o=t(r=a,n)}}function O$(e,t,n){var r,s,o;return function(){var a=uo(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),uo(this,e))),a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c))}}function P$(e,t){var n,r,s,o="style."+t,a="end."+o,c;return function(){var u=pr(this,e),d=u.on,p=u.value[o]==null?c||(c=DA(t)):void 0;(d!==n||s!==p)&&(r=(n=d).copy()).on(a,s=p),u.on=r}}function L$(e,t,n){var r=(e+="")=="transform"?DD:LA;return t==null?this.styleTween(e,I$(e,r)).on("end.style."+e,DA(e)):typeof t=="function"?this.styleTween(e,O$(e,r,mw(this,"style."+e,t))).each(P$(this._id,e)):this.styleTween(e,M$(e,r,t),n).on("end.style."+e,null)}function D$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function $$(e,t,n){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&D$(e,a,n)),r}return o._value=t,o}function q$(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,$$(e,t,n??""))}function F$(e){return function(){this.textContent=e}}function B$(e){return function(){var t=e(this);this.textContent=t??""}}function z$(e){return this.tween("text",typeof e=="function"?B$(mw(this,"text",e)):F$(e==null?"":e+""))}function V$(e){return function(t){this.textContent=e.call(this,t)}}function U$(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&V$(s)),t}return r._value=e,r}function H$(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,U$(e))}function W$(){for(var e=this._name,t=this._id,n=$A(),r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,u,d=0;d<c;++d)if(u=a[d]){var p=Un(u,t);Nd(u,e,n,d,a,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Ir(r,this._parents,e,n)}function K$(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,a){var c={value:a},u={value:function(){--s===0&&o()}};n.each(function(){var d=pr(this,r),p=d.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),d.on=t}),s===0&&o()})}var G$=0;function Ir(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function $A(){return++G$}var Nr=vl.prototype;Ir.prototype={constructor:Ir,select:j$,selectAll:T$,selectChild:Nr.selectChild,selectChildren:Nr.selectChildren,filter:b$,merge:S$,selection:R$,transition:W$,call:Nr.call,nodes:Nr.nodes,node:Nr.node,size:Nr.size,empty:Nr.empty,each:Nr.each,on:N$,attr:i$,attrTween:u$,style:L$,styleTween:q$,text:z$,textTween:H$,remove:E$,tween:JD,delay:h$,duration:g$,ease:v$,easeVarying:w$,end:K$,[Symbol.iterator]:Nr[Symbol.iterator]};function Y$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var X$={time:null,delay:0,duration:250,ease:Y$};function Q$(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function J$(e){var t,n;e instanceof Ir?(t=e._id,e=e._name):(t=$A(),(n=X$).time=hw(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,u,d=0;d<c;++d)(u=a[d])&&Nd(u,e,t,d,a,n||Q$(u,t));return new Ir(r,this._parents,e,t)}vl.prototype.interrupt=YD;vl.prototype.transition=J$;const du=e=>()=>e;function Z$(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function jr(e,t,n){this.k=e,this.x=t,this.y=n}jr.prototype={constructor:jr,scale:function(e){return e===1?this:new jr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new jr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Cd=new jr(1,0,0);qA.prototype=jr.prototype;function qA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Cd;return e.__zoom}function bp(e){e.stopImmediatePropagation()}function ja(e){e.preventDefault(),e.stopImmediatePropagation()}function eq(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tq(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function $_(){return this.__zoom||Cd}function nq(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rq(){return navigator.maxTouchPoints||"ontouchstart"in this}function sq(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function FA(){var e=eq,t=tq,n=sq,r=nq,s=rq,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Ou,d=Sd("start","zoom","end"),p,m,g,v=500,b=150,x=0,w=10;function S(D){D.property("__zoom",$_).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(D,V,z,Q){var F=D.selection?D.selection():D;F.property("__zoom",$_),D!==F?j(D,V,z,Q):F.interrupt().each(function(){A(this,arguments).event(Q).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},S.scaleBy=function(D,V,z,Q){S.scaleTo(D,function(){var F=this.__zoom.k,q=typeof V=="function"?V.apply(this,arguments):V;return F*q},z,Q)},S.scaleTo=function(D,V,z,Q){S.transform(D,function(){var F=t.apply(this,arguments),q=this.__zoom,G=z==null?N(F):typeof z=="function"?z.apply(this,arguments):z,P=q.invert(G),W=typeof V=="function"?V.apply(this,arguments):V;return n(k(C(q,W),G,P),F,a)},z,Q)},S.translateBy=function(D,V,z,Q){S.transform(D,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),a)},null,Q)},S.translateTo=function(D,V,z,Q,F){S.transform(D,function(){var q=t.apply(this,arguments),G=this.__zoom,P=Q==null?N(q):typeof Q=="function"?Q.apply(this,arguments):Q;return n(Cd.translate(P[0],P[1]).scale(G.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof z=="function"?-z.apply(this,arguments):-z),q,a)},Q,F)};function C(D,V){return V=Math.max(o[0],Math.min(o[1],V)),V===D.k?D:new jr(V,D.x,D.y)}function k(D,V,z){var Q=V[0]-z[0]*D.k,F=V[1]-z[1]*D.k;return Q===D.x&&F===D.y?D:new jr(D.k,Q,F)}function N(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function j(D,V,z,Q){D.on("start.zoom",function(){A(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(Q).end()}).tween("zoom",function(){var F=this,q=arguments,G=A(F,q).event(Q),P=t.apply(F,q),W=z==null?N(P):typeof z=="function"?z.apply(F,q):z,oe=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),K=F.__zoom,J=typeof V=="function"?V.apply(F,q):V,te=u(K.invert(W).concat(oe/K.k),J.invert(W).concat(oe/J.k));return function(Y){if(Y===1)Y=J;else{var ee=te(Y),ie=oe/ee[2];Y=new jr(ie,W[0]-ee[0]*ie,W[1]-ee[1]*ie)}G.zoom(null,Y)}})}function A(D,V,z){return!z&&D.__zooming||new R(D,V)}function R(D,V){this.that=D,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,V),this.taps=0}R.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,V){return this.mouse&&D!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var V=un(this.that).datum();d.call(D,this.that,new Z$(D,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:d}),V)}};function O(D,...V){if(!e.apply(this,arguments))return;var z=A(this,V).event(D),Q=this.__zoom,F=Math.max(o[0],Math.min(o[1],Q.k*Math.pow(2,r.apply(this,arguments)))),q=Ln(D);if(z.wheel)(z.mouse[0][0]!==q[0]||z.mouse[0][1]!==q[1])&&(z.mouse[1]=Q.invert(z.mouse[0]=q)),clearTimeout(z.wheel);else{if(Q.k===F)return;z.mouse=[q,Q.invert(q)],Du(this),z.start()}ja(D),z.wheel=setTimeout(G,b),z.zoom("mouse",n(k(C(Q,F),z.mouse[0],z.mouse[1]),z.extent,a));function G(){z.wheel=null,z.end()}}function L(D,...V){if(g||!e.apply(this,arguments))return;var z=D.currentTarget,Q=A(this,V,!0).event(D),F=un(D.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",oe,!0),q=Ln(D,z),G=D.clientX,P=D.clientY;_A(D.view),bp(D),Q.mouse=[q,this.__zoom.invert(q)],Du(this),Q.start();function W(K){if(ja(K),!Q.moved){var J=K.clientX-G,te=K.clientY-P;Q.moved=J*J+te*te>x}Q.event(K).zoom("mouse",n(k(Q.that.__zoom,Q.mouse[0]=Ln(K,z),Q.mouse[1]),Q.extent,a))}function oe(K){F.on("mousemove.zoom mouseup.zoom",null),kA(K.view,Q.moved),ja(K),Q.event(K).end()}}function B(D,...V){if(e.apply(this,arguments)){var z=this.__zoom,Q=Ln(D.changedTouches?D.changedTouches[0]:D,this),F=z.invert(Q),q=z.k*(D.shiftKey?.5:2),G=n(k(C(z,q),Q,F),t.apply(this,V),a);ja(D),c>0?un(this).transition().duration(c).call(j,G,Q,D):un(this).call(S.transform,G,Q,D)}}function M(D,...V){if(e.apply(this,arguments)){var z=D.touches,Q=z.length,F=A(this,V,D.changedTouches.length===Q).event(D),q,G,P,W;for(bp(D),G=0;G<Q;++G)P=z[G],W=Ln(P,this),W=[W,this.__zoom.invert(W),P.identifier],F.touch0?!F.touch1&&F.touch0[2]!==W[2]&&(F.touch1=W,F.taps=0):(F.touch0=W,q=!0,F.taps=1+!!p);p&&(p=clearTimeout(p)),q&&(F.taps<2&&(m=W[0],p=setTimeout(function(){p=null},v)),Du(this),F.start())}}function $(D,...V){if(this.__zooming){var z=A(this,V).event(D),Q=D.changedTouches,F=Q.length,q,G,P,W;for(ja(D),q=0;q<F;++q)G=Q[q],P=Ln(G,this),z.touch0&&z.touch0[2]===G.identifier?z.touch0[0]=P:z.touch1&&z.touch1[2]===G.identifier&&(z.touch1[0]=P);if(G=z.that.__zoom,z.touch1){var oe=z.touch0[0],K=z.touch0[1],J=z.touch1[0],te=z.touch1[1],Y=(Y=J[0]-oe[0])*Y+(Y=J[1]-oe[1])*Y,ee=(ee=te[0]-K[0])*ee+(ee=te[1]-K[1])*ee;G=C(G,Math.sqrt(Y/ee)),P=[(oe[0]+J[0])/2,(oe[1]+J[1])/2],W=[(K[0]+te[0])/2,(K[1]+te[1])/2]}else if(z.touch0)P=z.touch0[0],W=z.touch0[1];else return;z.zoom("touch",n(k(G,P,W),z.extent,a))}}function U(D,...V){if(this.__zooming){var z=A(this,V).event(D),Q=D.changedTouches,F=Q.length,q,G;for(bp(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),q=0;q<F;++q)G=Q[q],z.touch0&&z.touch0[2]===G.identifier?delete z.touch0:z.touch1&&z.touch1[2]===G.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(G=Ln(G,this),Math.hypot(m[0]-G[0],m[1]-G[1])<w)){var P=un(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return S.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:du(+D),S):r},S.filter=function(D){return arguments.length?(e=typeof D=="function"?D:du(!!D),S):e},S.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:du(!!D),S):s},S.extent=function(D){return arguments.length?(t=typeof D=="function"?D:du([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),S):t},S.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],S):[o[0],o[1]]},S.translateExtent=function(D){return arguments.length?(a[0][0]=+D[0][0],a[1][0]=+D[1][0],a[0][1]=+D[0][1],a[1][1]=+D[1][1],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function(D){return arguments.length?(n=D,S):n},S.duration=function(D){return arguments.length?(c=+D,S):c},S.interpolate=function(D){return arguments.length?(u=D,S):u},S.on=function(){var D=d.on.apply(d,arguments);return D===d?S:D},S.clickDistance=function(D){return arguments.length?(x=(D=+D)*D,S):Math.sqrt(x)},S.tapDistance=function(D){return arguments.length?(w=+D,S):w},S}const cr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},nl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],BA=["Enter"," ","Escape"],zA={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ho;(function(e){e.Strict="strict",e.Loose="loose"})(ho||(ho={}));var Ys;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ys||(Ys={}));var rl;(function(e){e.Partial="partial",e.Full="full"})(rl||(rl={}));const VA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ms;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ms||(ms={}));var nd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nd||(nd={}));var he;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(he||(he={}));const q_={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function UA(e){return e===null?null:e?"valid":"invalid"}const HA=e=>"id"in e&&"source"in e&&"target"in e,iq=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),gw=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),wl=(e,t=[0,0])=>{const{width:n,height:r}=Lr(e),s=e.origin??t,o=n*s[0],a=r*s[1];return{x:e.position.x-o,y:e.position.y-a}},oq=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let a=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(a=o?t.nodeLookup.get(s):gw(s)?s:t.nodeLookup.get(s.id));const c=a?rd(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ed(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return jd(n)},bl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Ed(n,rd(s)),r=!0)}),r?jd(n):{x:0,y:0,width:0,height:0}},yw=(e,t,[n,r,s]=[0,0,1],o=!1,a=!1)=>{const c={..._l(t,[n,r,s]),width:t.width/s,height:t.height/s},u=[];for(const d of e.values()){const{measured:p,selectable:m=!0,hidden:g=!1}=d;if(a&&!m||g)continue;const v=p.width??d.width??d.initialWidth??null,b=p.height??d.height??d.initialHeight??null,x=sl(c,mo(d)),w=(v??0)*(b??0),S=o&&x>0;(!d.internals.handleBounds||S||x>=w||d.dragging)&&u.push(d)}return u},aq=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function lq(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function cq({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},a){if(e.size===0)return Promise.resolve(!0);const c=lq(e,a),u=bl(c),d=vw(u,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??o,(a==null?void 0:a.padding)??.1);return await r.setViewport(d,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function WA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:u,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},p=a.origin??r;let m=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!c)o==null||o("005",cr.error005());else{const v=c.measured.width,b=c.measured.height;v&&b&&(m=[[u,d],[u+v,d+b]])}else c&&go(a.extent)&&(m=[[a.extent[0][0]+u,a.extent[0][1]+d],[a.extent[1][0]+u,a.extent[1][1]+d]]);const g=go(m)?Js(t,m,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(o==null||o("015",cr.error015())),{position:{x:g.x-u+(a.measured.width??0)*p[0],y:g.y-d+(a.measured.height??0)*p[1]},positionAbsolute:g}}async function uq({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const v=o.has(g.id),b=!v&&g.parentId&&a.find(x=>x.id===g.parentId);(v||b)&&a.push(g)}const c=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),p=aq(a,u);for(const g of u)c.has(g.id)&&!p.find(b=>b.id===g.id)&&p.push(g);if(!s)return{edges:p,nodes:a};const m=await s({nodes:a,edges:p});return typeof m=="boolean"?m?{edges:p,nodes:a}:{edges:[],nodes:[]}:m}const po=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Js=(e={x:0,y:0},t,n)=>({x:po(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:po(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function KA(e,t,n){const{width:r,height:s}=Lr(n),{x:o,y:a}=n.internals.positionAbsolute;return Js(e,[[o,a],[o+r,a+s]],t)}const F_=(e,t,n)=>e<t?po(Math.abs(e-t),1,t)/t:e>n?-po(Math.abs(e-n),1,t)/t:0,GA=(e,t,n=15,r=40)=>{const s=F_(e.x,r,t.width-r)*n,o=F_(e.y,r,t.height-r)*n;return[s,o]},Ed=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Tx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),jd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),mo=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=gw(e)?e.internals.positionAbsolute:wl(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},rd=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=gw(e)?e.internals.positionAbsolute:wl(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},YA=(e,t)=>jd(Ed(Tx(e),Tx(t))),sl=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},B_=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),dq=(e,t)=>{},Sl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),_l=({x:e,y:t},[n,r,s],o=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return o?Sl(c,a):c},sd=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Vi(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function fq(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Vi(e,n),s=Vi(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Vi(e.top??e.y??0,n),s=Vi(e.bottom??e.y??0,n),o=Vi(e.left??e.x??0,t),a=Vi(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:o,x:o+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function hq(e,t,n,r,s,o){const{x:a,y:c}=sd(e,[t,n,r]),{x:u,y:d}=sd({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=s-u,m=o-d;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(p),bottom:Math.floor(m)}}const vw=(e,t,n,r,s,o)=>{const a=fq(o,t,n),c=(t-a.x)/e.width,u=(n-a.y)/e.height,d=Math.min(c,u),p=po(d,r,s),m=e.x+e.width/2,g=e.y+e.height/2,v=t/2-m*p,b=n/2-g*p,x=hq(e,v,b,p,t,n),w={left:Math.min(x.left-a.left,0),top:Math.min(x.top-a.top,0),right:Math.min(x.right-a.right,0),bottom:Math.min(x.bottom-a.bottom,0)};return{x:v-w.left+w.right,y:b-w.top+w.bottom,zoom:p}},il=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function go(e){return e!=null&&e!=="parent"}function Lr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function XA(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function QA(e,t={width:0,height:0},n,r,s){const o={...e},a=r.get(n);if(a){const c=a.origin||s;o.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],o.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return o}function z_(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function pq(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function mq(e){return{...zA,...e||{}}}function Wa(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:a}=Fn(e),c=_l({x:o-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:u,y:d}=n?Sl(c,t):c;return{xSnapped:u,ySnapped:d,...c}}const xw=e=>({width:e.offsetWidth,height:e.offsetHeight}),JA=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},gq=["INPUT","SELECT","TEXTAREA"];function ZA(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:gq.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const eR=e=>"clientX"in e,Fn=(e,t)=>{var o,a;const n=eR(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},V_=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...xw(a)}})};function tR({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:a,targetControlY:c}){const u=e*.125+s*.375+a*.375+n*.125,d=t*.125+o*.375+c*.375+r*.125,p=Math.abs(u-e),m=Math.abs(d-t);return[u,d,p,m]}function fu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function U_({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case he.Left:return[t-fu(t-r,o),n];case he.Right:return[t+fu(r-t,o),n];case he.Top:return[t,n-fu(n-s,o)];case he.Bottom:return[t,n+fu(s-n,o)]}}function nR({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,curvature:a=.25}){const[c,u]=U_({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[d,p]=U_({pos:o,x1:r,y1:s,x2:e,y2:t,c:a}),[m,g,v,b]=tR({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:u,targetControlX:d,targetControlY:p});return[`M${e},${t} C${c},${u} ${d},${p} ${r},${s}`,m,g,v,b]}function rR({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[o,c,s,a]}function yq({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const a=s&&n?r+1e3:r,c=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return a+c}function vq({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Ed(rd(e),rd(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const a={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return sl(a,jd(o))>0}const xq=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,wq=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),sR=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||xq;let s;return HA(e)?s={...e}:s={...e,id:r(e)},wq(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function iR({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,a,c]=rR({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,a,c]}const H_={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},bq=({source:e,sourcePosition:t=he.Bottom,target:n})=>t===he.Left||t===he.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},W_=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Sq({source:e,sourcePosition:t=he.Bottom,target:n,targetPosition:r=he.Top,center:s,offset:o,stepPosition:a}){const c=H_[t],u=H_[r],d={x:e.x+c.x*o,y:e.y+c.y*o},p={x:n.x+u.x*o,y:n.y+u.y*o},m=bq({source:d,sourcePosition:t,target:p}),g=m.x!==0?"x":"y",v=m[g];let b=[],x,w;const S={x:0,y:0},C={x:0,y:0},[,,k,N]=rR({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*u[g]===-1){g==="x"?(x=s.x??d.x+(p.x-d.x)*a,w=s.y??(d.y+p.y)/2):(x=s.x??(d.x+p.x)/2,w=s.y??d.y+(p.y-d.y)*a);const A=[{x,y:d.y},{x,y:p.y}],R=[{x:d.x,y:w},{x:p.x,y:w}];c[g]===v?b=g==="x"?A:R:b=g==="x"?R:A}else{const A=[{x:d.x,y:p.y}],R=[{x:p.x,y:d.y}];if(g==="x"?b=c.x===v?R:A:b=c.y===v?A:R,t===r){const $=Math.abs(e[g]-n[g]);if($<=o){const U=Math.min(o-1,o-$);c[g]===v?S[g]=(d[g]>e[g]?-1:1)*U:C[g]=(p[g]>n[g]?-1:1)*U}}if(t!==r){const $=g==="x"?"y":"x",U=c[g]===u[$],D=d[$]>p[$],V=d[$]<p[$];(c[g]===1&&(!U&&D||U&&V)||c[g]!==1&&(!U&&V||U&&D))&&(b=g==="x"?A:R)}const O={x:d.x+S.x,y:d.y+S.y},L={x:p.x+C.x,y:p.y+C.y},B=Math.max(Math.abs(O.x-b[0].x),Math.abs(L.x-b[0].x)),M=Math.max(Math.abs(O.y-b[0].y),Math.abs(L.y-b[0].y));B>=M?(x=(O.x+L.x)/2,w=b[0].y):(x=b[0].x,w=(O.y+L.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...b,{x:p.x+C.x,y:p.y+C.y},n],x,w,k,N]}function _q(e,t,n,r){const s=Math.min(W_(e,t)/2,W_(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const d=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${o+s*d},${a}Q ${o},${a} ${o},${a+s*p}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${a+s*u}Q ${o},${a} ${o+s*c},${a}`}function Ax({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,borderRadius:a=5,centerX:c,centerY:u,offset:d=20,stepPosition:p=.5}){const[m,g,v,b,x]=Sq({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:c,y:u},offset:d,stepPosition:p});return[m.reduce((S,C,k)=>{let N="";return k>0&&k<m.length-1?N=_q(m[k-1],C,m[k+1],a):N=`${k===0?"M":"L"}${C.x} ${C.y}`,S+=N,S},""),g,v,b,x]}function K_(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function kq(e){var m;const{sourceNode:t,targetNode:n}=e;if(!K_(t)||!K_(n))return null;const r=t.internals.handleBounds||G_(t.handles),s=n.internals.handleBounds||G_(n.handles),o=Y_((r==null?void 0:r.source)??[],e.sourceHandle),a=Y_(e.connectionMode===ho.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!a)return(m=e.onError)==null||m.call(e,"008",cr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(o==null?void 0:o.position)||he.Bottom,u=(a==null?void 0:a.position)||he.Top,d=Zs(t,o,c),p=Zs(n,a,u);return{sourceX:d.x,sourceY:d.y,targetX:p.x,targetY:p.y,sourcePosition:c,targetPosition:u}}function G_(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Zs(e,t,n=he.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??Lr(e);if(r)return{x:s+a/2,y:o+c/2};switch((t==null?void 0:t.position)??n){case he.Top:return{x:s+a/2,y:o};case he.Right:return{x:s+a,y:o+c/2};case he.Bottom:return{x:s+a/2,y:o+c};case he.Left:return{x:s,y:o+c/2}}}function Y_(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Rx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Nq(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const d=Rx(u,t);o.has(d)||(a.push({id:d,color:u.color||n,...u}),o.add(d))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const oR=1e3,Cq=10,ww={nodeOrigin:[0,0],nodeExtent:nl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Eq={...ww,checkEquality:!0};function bw(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function jq(e,t,n){const r=bw(ww,n);for(const s of e.values())if(s.parentId)_w(s,e,t,r);else{const o=wl(s,r.nodeOrigin),a=go(s.extent)?s.extent:r.nodeExtent,c=Js(o,a,Lr(s));s.internals.positionAbsolute=c}}function Tq(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function Sw(e){return e==="manual"}function Ix(e,t,n,r={}){var d,p;const s=bw(Eq,r),o={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!Sw(s.zIndexMode)?oR:0;let u=e.length>0;t.clear(),n.clear();for(const m of e){let g=a.get(m.id);if(s.checkEquality&&m===(g==null?void 0:g.internals.userNode))t.set(m.id,g);else{const v=wl(m,s.nodeOrigin),b=go(m.extent)?m.extent:s.nodeExtent,x=Js(v,b,Lr(m));g={...s.defaults,...m,measured:{width:(d=m.measured)==null?void 0:d.width,height:(p=m.measured)==null?void 0:p.height},internals:{positionAbsolute:x,handleBounds:Tq(m,g),z:aR(m,c,s.zIndexMode),userNode:m}},t.set(m.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),m.parentId&&_w(g,t,n,r,o)}return u}function Aq(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function _w(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:c,zIndexMode:u}=bw(ww,r),d=e.parentId,p=t.get(d);if(!p){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Aq(e,n),s&&!p.parentId&&p.internals.rootParentIndex===void 0&&u==="auto"&&(p.internals.rootParentIndex=++s.i,p.internals.z=p.internals.z+s.i*Cq),s&&p.internals.rootParentIndex!==void 0&&(s.i=p.internals.rootParentIndex);const m=o&&!Sw(u)?oR:0,{x:g,y:v,z:b}=Rq(e,p,a,c,m,u),{positionAbsolute:x}=e.internals,w=g!==x.x||v!==x.y;(w||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:g,y:v}:x,z:b}})}function aR(e,t,n){const r=qn(e.zIndex)?e.zIndex:0;return Sw(n)?r:r+(e.selected?t:0)}function Rq(e,t,n,r,s,o){const{x:a,y:c}=t.internals.positionAbsolute,u=Lr(e),d=wl(e,n),p=go(e.extent)?Js(d,e.extent,u):d;let m=Js({x:a+p.x,y:c+p.y},r,u);e.extent==="parent"&&(m=KA(m,u,t));const g=aR(e,s,o),v=t.internals.z??0;return{x:m.x,y:m.y,z:v>=g?v+1:g}}function kw(e,t,n,r=[0,0]){var a;const s=[],o=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const d=((a=o.get(c.parentId))==null?void 0:a.expandedRect)??mo(u),p=YA(d,c.rect);o.set(c.parentId,{expandedRect:p,parent:u})}return o.size>0&&o.forEach(({expandedRect:c,parent:u},d)=>{var k;const p=u.internals.positionAbsolute,m=Lr(u),g=u.origin??r,v=c.x<p.x?Math.round(Math.abs(p.x-c.x)):0,b=c.y<p.y?Math.round(Math.abs(p.y-c.y)):0,x=Math.max(m.width,Math.round(c.width)),w=Math.max(m.height,Math.round(c.height)),S=(x-m.width)*g[0],C=(w-m.height)*g[1];(v>0||b>0||S||C)&&(s.push({id:d,type:"position",position:{x:u.position.x-v+S,y:u.position.y-b+C}}),(k=n.get(d))==null||k.forEach(N=>{e.some(j=>j.id===N.id)||s.push({id:N.id,type:"position",position:{x:N.position.x+v,y:N.position.y+b}})})),(m.width<c.width||m.height<c.height||v||b)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:x+(v?g[0]*v-S:0),height:w+(b?g[1]*b-C:0)}})}),s}function Iq(e,t,n,r,s,o,a){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const d=[],p=window.getComputedStyle(c),{m22:m}=new window.DOMMatrixReadOnly(p.transform),g=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const x=xw(v.nodeElement),w=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(w||!b.internals.handleBounds||v.force))){const C=v.nodeElement.getBoundingClientRect(),k=go(b.extent)?b.extent:o;let{positionAbsolute:N}=b.internals;b.parentId&&b.extent==="parent"?N=KA(N,x,t.get(b.parentId)):k&&(N=Js(N,k,x));const j={...b,measured:x,internals:{...b.internals,positionAbsolute:N,handleBounds:{source:V_("source",v.nodeElement,C,m,b.id),target:V_("target",v.nodeElement,C,m,b.id)}}};t.set(b.id,j),b.parentId&&_w(j,t,n,{nodeOrigin:s,zIndexMode:a}),u=!0,w&&(d.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:mo(j,s)}))}}if(g.length>0){const v=kw(g,t,n,s);d.push(...v)}return{changes:d,updatedInternals:u}}async function Mq({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),c=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(c)}function X_(e,t,n,r,s,o){let a=s;const c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${s}-${e}`;const u=r.get(a)||new Map;if(r.set(a,u.set(n,t)),o){a=`${s}-${e}-${o}`;const d=r.get(a)||new Map;r.set(a,d.set(n,t))}}function lR(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:a=null,targetHandle:c=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:a,targetHandle:c},d=`${s}-${a}--${o}-${c}`,p=`${o}-${c}--${s}-${a}`;X_("source",u,p,e,s,a),X_("target",u,d,e,o,c),t.set(r.id,r)}}function cR(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:cR(n,t):!1}function Q_(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Oq(e,t,n,r){const s=new Map;for(const[o,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!cR(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(o);c&&s.set(o,{id:o,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function Sp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,c,u;const s=[];for(const[d,p]of t){const m=(a=n.get(d))==null?void 0:a.internals.userNode;m&&s.push({...m,position:p.position,dragging:r})}if(!e)return[s[0],s];const o=(c=n.get(e))==null?void 0:c.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function Pq({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},a=Sl(o,t);return{x:a.x-o.x,y:a.y-o.y}}function Lq({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},a=0,c=new Map,u=!1,d={x:0,y:0},p=null,m=!1,g=null,v=!1,b=!1,x=null;function w({noDragClassName:C,handleSelector:k,domNode:N,isSelectable:j,nodeId:A,nodeClickDistance:R=0}){g=un(N);function O({x:$,y:U}){const{nodeLookup:D,nodeExtent:V,snapGrid:z,snapToGrid:Q,nodeOrigin:F,onNodeDrag:q,onSelectionDrag:G,onError:P,updateNodePositions:W}=t();o={x:$,y:U};let oe=!1;const K=c.size>1,J=K&&V?Tx(bl(c)):null,te=K&&Q?Pq({dragItems:c,snapGrid:z,x:$,y:U}):null;for(const[Y,ee]of c){if(!D.has(Y))continue;let ie={x:$-ee.distance.x,y:U-ee.distance.y};Q&&(ie=te?{x:Math.round(ie.x+te.x),y:Math.round(ie.y+te.y)}:Sl(ie,z));let ue=null;if(K&&V&&!ee.extent&&J){const{positionAbsolute:pe}=ee.internals,_e=pe.x-J.x+V[0][0],xe=pe.x+ee.measured.width-J.x2+V[1][0],Ce=pe.y-J.y+V[0][1],Ne=pe.y+ee.measured.height-J.y2+V[1][1];ue=[[_e,Ce],[xe,Ne]]}const{position:me,positionAbsolute:ye}=WA({nodeId:Y,nextPosition:ie,nodeLookup:D,nodeExtent:ue||V,nodeOrigin:F,onError:P});oe=oe||ee.position.x!==me.x||ee.position.y!==me.y,ee.position=me,ee.internals.positionAbsolute=ye}if(b=b||oe,!!oe&&(W(c,!0),x&&(r||q||!A&&G))){const[Y,ee]=Sp({nodeId:A,dragItems:c,nodeLookup:D});r==null||r(x,c,Y,ee),q==null||q(x,Y,ee),A||G==null||G(x,ee)}}async function L(){if(!p)return;const{transform:$,panBy:U,autoPanSpeed:D,autoPanOnNodeDrag:V}=t();if(!V){u=!1,cancelAnimationFrame(a);return}const[z,Q]=GA(d,p,D);(z!==0||Q!==0)&&(o.x=(o.x??0)-z/$[2],o.y=(o.y??0)-Q/$[2],await U({x:z,y:Q})&&O(o)),a=requestAnimationFrame(L)}function B($){var K;const{nodeLookup:U,multiSelectionActive:D,nodesDraggable:V,transform:z,snapGrid:Q,snapToGrid:F,selectNodesOnDrag:q,onNodeDragStart:G,onSelectionDragStart:P,unselectNodesAndEdges:W}=t();m=!0,(!q||!j)&&!D&&A&&((K=U.get(A))!=null&&K.selected||W()),j&&q&&A&&(e==null||e(A));const oe=Wa($.sourceEvent,{transform:z,snapGrid:Q,snapToGrid:F,containerBounds:p});if(o=oe,c=Oq(U,V,oe,A),c.size>0&&(n||G||!A&&P)){const[J,te]=Sp({nodeId:A,dragItems:c,nodeLookup:U});n==null||n($.sourceEvent,c,J,te),G==null||G($.sourceEvent,J,te),A||P==null||P($.sourceEvent,te)}}const M=NA().clickDistance(R).on("start",$=>{const{domNode:U,nodeDragThreshold:D,transform:V,snapGrid:z,snapToGrid:Q}=t();p=(U==null?void 0:U.getBoundingClientRect())||null,v=!1,b=!1,x=$.sourceEvent,D===0&&B($),o=Wa($.sourceEvent,{transform:V,snapGrid:z,snapToGrid:Q,containerBounds:p}),d=Fn($.sourceEvent,p)}).on("drag",$=>{const{autoPanOnNodeDrag:U,transform:D,snapGrid:V,snapToGrid:z,nodeDragThreshold:Q,nodeLookup:F}=t(),q=Wa($.sourceEvent,{transform:D,snapGrid:V,snapToGrid:z,containerBounds:p});if(x=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||A&&!F.has(A))&&(v=!0),!v){if(!u&&U&&m&&(u=!0,L()),!m){const G=Fn($.sourceEvent,p),P=G.x-d.x,W=G.y-d.y;Math.sqrt(P*P+W*W)>Q&&B($)}(o.x!==q.xSnapped||o.y!==q.ySnapped)&&c&&m&&(d=Fn($.sourceEvent,p),O(q))}}).on("end",$=>{if(!(!m||v)&&(u=!1,m=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:U,updateNodePositions:D,onNodeDragStop:V,onSelectionDragStop:z}=t();if(b&&(D(c,!1),b=!1),s||V||!A&&z){const[Q,F]=Sp({nodeId:A,dragItems:c,nodeLookup:U,dragging:!1});s==null||s($.sourceEvent,c,Q,F),V==null||V($.sourceEvent,Q,F),A||z==null||z($.sourceEvent,F)}}}).filter($=>{const U=$.target;return!$.button&&(!C||!Q_(U,`.${C}`,N))&&(!k||Q_(U,k,N))});g.call(M)}function S(){g==null||g.on(".drag",null)}return{update:w,destroy:S}}function Dq(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())sl(s,mo(o))>0&&r.push(o);return r}const $q=250;function qq(e,t,n,r){var c,u;let s=[],o=1/0;const a=Dq(e,n,t+$q);for(const d of a){const p=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const m of p){if(r.nodeId===m.nodeId&&r.type===m.type&&r.id===m.id)continue;const{x:g,y:v}=Zs(d,m,m.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<o?(s=[{...m,x:g,y:v}],o=b):b===o&&s.push({...m,x:g,y:v}))}}if(!s.length)return null;if(s.length>1){const d=r.type==="source"?"target":"source";return s.find(p=>p.type===d)??s[0]}return s[0]}function uR(e,t,n,r,s,o=!1){var d,p,m;const a=r.get(e);if(!a)return null;const c=s==="strict"?(d=a.internals.handleBounds)==null?void 0:d[t]:[...((p=a.internals.handleBounds)==null?void 0:p.source)??[],...((m=a.internals.handleBounds)==null?void 0:m.target)??[]],u=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return u&&o?{...u,...Zs(a,u,u.position,!0)}:u}function dR(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Fq(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const fR=()=>!0;function Bq(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:a,domNode:c,nodeLookup:u,lib:d,autoPanOnConnect:p,flowId:m,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:x,onConnectEnd:w,isValidConnection:S=fR,onReconnectEnd:C,updateConnection:k,getTransform:N,getFromHandle:j,autoPanSpeed:A,dragThreshold:R=1,handleDomNode:O}){const L=JA(e.target);let B=0,M;const{x:$,y:U}=Fn(e),D=dR(o,O),V=c==null?void 0:c.getBoundingClientRect();let z=!1;if(!V||!D)return;const Q=uR(s,D,r,u,t);if(!Q)return;let F=Fn(e,V),q=!1,G=null,P=!1,W=null;function oe(){if(!p||!V)return;const[me,ye]=GA(F,V,A);g({x:me,y:ye}),B=requestAnimationFrame(oe)}const K={...Q,nodeId:s,type:D,position:Q.position},J=u.get(s);let Y={inProgress:!0,isValid:null,from:Zs(J,K,he.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:J,to:F,toHandle:null,toPosition:q_[K.position],toNode:null,pointer:F};function ee(){z=!0,k(Y),b==null||b(e,{nodeId:s,handleId:r,handleType:D})}R===0&&ee();function ie(me){if(!z){const{x:Ne,y:tt}=Fn(me),Le=Ne-$,vt=tt-U;if(!(Le*Le+vt*vt>R*R))return;ee()}if(!j()||!K){ue(me);return}const ye=N();F=Fn(me,V),M=qq(_l(F,ye,!1,[1,1]),n,u,K),q||(oe(),q=!0);const pe=hR(me,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:S,doc:L,lib:d,flowId:m,nodeLookup:u});W=pe.handleDomNode,G=pe.connection,P=Fq(!!M,pe.isValid);const _e=u.get(s),xe=_e?Zs(_e,K,he.Left,!0):Y.from,Ce={...Y,from:xe,isValid:P,to:pe.toHandle&&P?sd({x:pe.toHandle.x,y:pe.toHandle.y},ye):F,toHandle:pe.toHandle,toPosition:P&&pe.toHandle?pe.toHandle.position:q_[K.position],toNode:pe.toHandle?u.get(pe.toHandle.nodeId):null,pointer:F};k(Ce),Y=Ce}function ue(me){if(!("touches"in me&&me.touches.length>0)){if(z){(M||W)&&G&&P&&(x==null||x(G));const{inProgress:ye,...pe}=Y,_e={...pe,toPosition:Y.toHandle?Y.toPosition:null};w==null||w(me,_e),o&&(C==null||C(me,_e))}v(),cancelAnimationFrame(B),q=!1,P=!1,G=null,W=null,L.removeEventListener("mousemove",ie),L.removeEventListener("mouseup",ue),L.removeEventListener("touchmove",ie),L.removeEventListener("touchend",ue)}}L.addEventListener("mousemove",ie),L.addEventListener("mouseup",ue),L.addEventListener("touchmove",ie),L.addEventListener("touchend",ue)}function hR(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:a,lib:c,flowId:u,isValidConnection:d=fR,nodeLookup:p}){const m=o==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Fn(e),x=a.elementFromPoint(v,b),w=x!=null&&x.classList.contains(`${c}-flow__handle`)?x:g,S={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const C=dR(void 0,w),k=w.getAttribute("data-nodeid"),N=w.getAttribute("data-handleid"),j=w.classList.contains("connectable"),A=w.classList.contains("connectableend");if(!k||!C)return S;const R={source:m?k:r,sourceHandle:m?N:s,target:m?r:k,targetHandle:m?s:N};S.connection=R;const L=j&&A&&(n===ho.Strict?m&&C==="source"||!m&&C==="target":k!==r||N!==s);S.isValid=L&&d(R),S.toHandle=uR(k,C,N,p,n,!0)}return S}const Mx={onPointerDown:Bq,isValid:hR};function zq({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=un(e);function o({translateExtent:c,width:u,height:d,zoomStep:p=1,pannable:m=!0,zoomable:g=!0,inversePan:v=!1}){const b=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const N=n(),j=k.sourceEvent.ctrlKey&&il()?10:1,A=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*p,R=N[2]*Math.pow(2,A*j);t.scaleTo(R)};let x=[0,0];const w=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(x=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},S=k=>{const N=n();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!t)return;const j=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],A=[j[0]-x[0],j[1]-x[1]];x=j;const R=r()*Math.max(N[2],Math.log(N[2]))*(v?-1:1),O={x:N[0]-A[0]*R,y:N[1]-A[1]*R},L=[[0,0],[u,d]];t.setViewportConstrained({x:O.x,y:O.y,zoom:N[2]},L,c)},C=FA().on("start",w).on("zoom",m?S:null).on("zoom.wheel",g?b:null);s.call(C,{})}function a(){s.on("zoom",null)}return{update:o,destroy:a,pointer:Ln}}const Td=e=>({x:e.x,y:e.y,zoom:e.k}),_p=({x:e,y:t,zoom:n})=>Cd.translate(e,t).scale(n),Qi=(e,t)=>e.target.closest(`.${t}`),pR=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Vq=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kp=(e,t=0,n=Vq,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},mR=e=>{const t=e.ctrlKey&&il()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Uq({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:d}){return p=>{if(Qi(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(p.ctrlKey&&a){const w=Ln(p),S=mR(p),C=m*Math.pow(2,S);r.scaleTo(n,C,w,p);return}const g=p.deltaMode===1?20:1;let v=s===Ys.Vertical?0:p.deltaX*g,b=s===Ys.Horizontal?0:p.deltaY*g;!il()&&p.shiftKey&&s!==Ys.Vertical&&(v=p.deltaY*g,b=0),r.translateBy(n,-(v/m)*o,-(b/m)*o,{internal:!0});const x=Td(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(p,x),e.panScrollTimeout=setTimeout(()=>{d==null||d(p,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(p,x))}}function Hq({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",a=!t&&o&&!r.ctrlKey,c=Qi(r,e);if(r.ctrlKey&&o&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,s)}}function Wq({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,a,c;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Td(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function Kq({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var a,c;e.usedRightMouseButton=!!(n&&pR(t,e.mouseButton??0)),(a=o.sourceEvent)!=null&&a.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((c=o.sourceEvent)!=null&&c.internal)&&(s==null||s(o.sourceEvent,Td(o.transform)))}}function Gq({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,o&&pR(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Td(a.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,u)},n?150:0)}}}function Yq({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:p}){return m=>{var w;const g=e||t,v=n&&m.ctrlKey,b=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Qi(m,`${d}-flow__node`)||Qi(m,`${d}-flow__edge`)))return!0;if(!r&&!g&&!s&&!o&&!n||a||p&&!b||Qi(m,c)&&b||Qi(m,u)&&(!b||s&&b&&!e)||!n&&m.ctrlKey&&b)return!1;if(!n&&m.type==="touchstart"&&((w=m.touches)==null?void 0:w.length)>1)return m.preventDefault(),!1;if(!g&&!s&&!v&&b||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||b)&&x}}function Xq({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=FA().scaleExtent([t,n]).translateExtent(r),g=un(e).call(m);C({x:s.x,y:s.y,zoom:po(s.zoom,t,n)},[[0,0],[p.width,p.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");m.wheelDelta(mR);function x(M,$){return g?new Promise(U=>{m==null||m.interpolate(($==null?void 0:$.interpolate)==="linear"?Ha:Ou).transform(kp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),M)}):Promise.resolve(!1)}function w({noWheelClassName:M,noPanClassName:$,onPaneContextMenu:U,userSelectionActive:D,panOnScroll:V,panOnDrag:z,panOnScrollMode:Q,panOnScrollSpeed:F,preventScrolling:q,zoomOnPinch:G,zoomOnScroll:P,zoomOnDoubleClick:W,zoomActivationKeyPressed:oe,lib:K,onTransformChange:J,connectionInProgress:te,paneClickDistance:Y,selectionOnDrag:ee}){D&&!d.isZoomingOrPanning&&S();const ie=V&&!oe&&!D;m.clickDistance(ee?1/0:!qn(Y)||Y<0?0:Y);const ue=ie?Uq({zoomPanValues:d,noWheelClassName:M,d3Selection:g,d3Zoom:m,panOnScrollMode:Q,panOnScrollSpeed:F,zoomOnPinch:G,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:c}):Hq({noWheelClassName:M,preventScrolling:q,d3ZoomHandler:v});if(g.on("wheel.zoom",ue,{passive:!1}),!D){const ye=Wq({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:a});m.on("start",ye);const pe=Kq({zoomPanValues:d,panOnDrag:z,onPaneContextMenu:!!U,onPanZoom:o,onTransformChange:J});m.on("zoom",pe);const _e=Gq({zoomPanValues:d,panOnDrag:z,panOnScroll:V,onPaneContextMenu:U,onPanZoomEnd:c,onDraggingChange:u});m.on("end",_e)}const me=Yq({zoomActivationKeyPressed:oe,panOnDrag:z,zoomOnScroll:P,panOnScroll:V,zoomOnDoubleClick:W,zoomOnPinch:G,userSelectionActive:D,noPanClassName:$,noWheelClassName:M,lib:K,connectionInProgress:te});m.filter(me),W?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function S(){m.on("zoom",null)}async function C(M,$,U){const D=_p(M),V=m==null?void 0:m.constrain()(D,$,U);return V&&await x(V),new Promise(z=>z(V))}async function k(M,$){const U=_p(M);return await x(U,$),new Promise(D=>D(U))}function N(M){if(g){const $=_p(M),U=g.property("__zoom");(U.k!==M.zoom||U.x!==M.x||U.y!==M.y)&&(m==null||m.transform(g,$,null,{sync:!0}))}}function j(){const M=g?qA(g.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function A(M,$){return g?new Promise(U=>{m==null||m.interpolate(($==null?void 0:$.interpolate)==="linear"?Ha:Ou).scaleTo(kp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),M)}):Promise.resolve(!1)}function R(M,$){return g?new Promise(U=>{m==null||m.interpolate(($==null?void 0:$.interpolate)==="linear"?Ha:Ou).scaleBy(kp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),M)}):Promise.resolve(!1)}function O(M){m==null||m.scaleExtent(M)}function L(M){m==null||m.translateExtent(M)}function B(M){const $=!qn(M)||M<0?0:M;m==null||m.clickDistance($)}return{update:w,destroy:S,setViewport:k,setViewportConstrained:C,getViewport:j,scaleTo:A,scaleBy:R,setScaleExtent:O,setTranslateExtent:L,syncViewport:N,setClickDistance:B}}var yo;(function(e){e.Line="line",e.Handle="handle"})(yo||(yo={}));function Qq({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const a=e-t,c=n-r,u=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&s&&(u[0]=u[0]*-1),c&&o&&(u[1]=u[1]*-1),u}function J_(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function ls(e,t){return Math.max(0,t-e)}function cs(e,t){return Math.max(0,e-t)}function hu(e,t,n){return Math.max(0,t-e,e-n)}function Z_(e,t){return e?!t:t}function Jq(e,t,n,r,s,o,a,c){let{affectsX:u,affectsY:d}=t;const{isHorizontal:p,isVertical:m}=t,g=p&&m,{xSnapped:v,ySnapped:b}=n,{minWidth:x,maxWidth:w,minHeight:S,maxHeight:C}=r,{x:k,y:N,width:j,height:A,aspectRatio:R}=e;let O=Math.floor(p?v-e.pointerX:0),L=Math.floor(m?b-e.pointerY:0);const B=j+(u?-O:O),M=A+(d?-L:L),$=-o[0]*j,U=-o[1]*A;let D=hu(B,x,w),V=hu(M,S,C);if(a){let F=0,q=0;u&&O<0?F=ls(k+O+$,a[0][0]):!u&&O>0&&(F=cs(k+B+$,a[1][0])),d&&L<0?q=ls(N+L+U,a[0][1]):!d&&L>0&&(q=cs(N+M+U,a[1][1])),D=Math.max(D,F),V=Math.max(V,q)}if(c){let F=0,q=0;u&&O>0?F=cs(k+O,c[0][0]):!u&&O<0&&(F=ls(k+B,c[1][0])),d&&L>0?q=cs(N+L,c[0][1]):!d&&L<0&&(q=ls(N+M,c[1][1])),D=Math.max(D,F),V=Math.max(V,q)}if(s){if(p){const F=hu(B/R,S,C)*R;if(D=Math.max(D,F),a){let q=0;!u&&!d||u&&!d&&g?q=cs(N+U+B/R,a[1][1])*R:q=ls(N+U+(u?O:-O)/R,a[0][1])*R,D=Math.max(D,q)}if(c){let q=0;!u&&!d||u&&!d&&g?q=ls(N+B/R,c[1][1])*R:q=cs(N+(u?O:-O)/R,c[0][1])*R,D=Math.max(D,q)}}if(m){const F=hu(M*R,x,w)/R;if(V=Math.max(V,F),a){let q=0;!u&&!d||d&&!u&&g?q=cs(k+M*R+$,a[1][0])/R:q=ls(k+(d?L:-L)*R+$,a[0][0])/R,V=Math.max(V,q)}if(c){let q=0;!u&&!d||d&&!u&&g?q=ls(k+M*R,c[1][0])/R:q=cs(k+(d?L:-L)*R,c[0][0])/R,V=Math.max(V,q)}}}L=L+(L<0?V:-V),O=O+(O<0?D:-D),s&&(g?B>M*R?L=(Z_(u,d)?-O:O)/R:O=(Z_(u,d)?-L:L)*R:p?(L=O/R,d=u):(O=L*R,u=d));const z=u?k+O:k,Q=d?N+L:N;return{width:j+(u?-O:O),height:A+(d?-L:L),x:o[0]*O*(u?-1:1)+z,y:o[1]*L*(d?-1:1)+Q}}const gR={width:0,height:0,x:0,y:0},Zq={...gR,pointerX:0,pointerY:0,aspectRatio:1};function eF(e){return[[0,0],[e.measured.width,e.measured.height]]}function tF(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,a=e.measured.height??0,c=n[0]*o,u=n[1]*a;return[[r-c,s-u],[r+o-c,s+a-u]]}function nF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=un(e);let a={controlDirection:J_("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:d,boundaries:p,keepAspectRatio:m,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:x,shouldResize:w}){let S={...gR},C={...Zq};a={boundaries:p,resizeDirection:g,keepAspectRatio:m,controlDirection:J_(d)};let k,N=null,j=[],A,R,O,L=!1;const B=NA().on("start",M=>{const{nodeLookup:$,transform:U,snapGrid:D,snapToGrid:V,nodeOrigin:z,paneDomNode:Q}=n();if(k=$.get(t),!k)return;N=(Q==null?void 0:Q.getBoundingClientRect())??null;const{xSnapped:F,ySnapped:q}=Wa(M.sourceEvent,{transform:U,snapGrid:D,snapToGrid:V,containerBounds:N});S={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},C={...S,pointerX:F,pointerY:q,aspectRatio:S.width/S.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=$.get(k.parentId),R=A&&k.extent==="parent"?eF(A):void 0),j=[],O=void 0;for(const[G,P]of $)if(P.parentId===t&&(j.push({id:G,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const W=tF(P,k,P.origin??z);O?O=[[Math.min(W[0][0],O[0][0]),Math.min(W[0][1],O[0][1])],[Math.max(W[1][0],O[1][0]),Math.max(W[1][1],O[1][1])]]:O=W}v==null||v(M,{...S})}).on("drag",M=>{const{transform:$,snapGrid:U,snapToGrid:D,nodeOrigin:V}=n(),z=Wa(M.sourceEvent,{transform:$,snapGrid:U,snapToGrid:D,containerBounds:N}),Q=[];if(!k)return;const{x:F,y:q,width:G,height:P}=S,W={},oe=k.origin??V,{width:K,height:J,x:te,y:Y}=Jq(C,a.controlDirection,z,a.boundaries,a.keepAspectRatio,oe,R,O),ee=K!==G,ie=J!==P,ue=te!==F&&ee,me=Y!==q&&ie;if(!ue&&!me&&!ee&&!ie)return;if((ue||me||oe[0]===1||oe[1]===1)&&(W.x=ue?te:S.x,W.y=me?Y:S.y,S.x=W.x,S.y=W.y,j.length>0)){const xe=te-F,Ce=Y-q;for(const Ne of j)Ne.position={x:Ne.position.x-xe+oe[0]*(K-G),y:Ne.position.y-Ce+oe[1]*(J-P)},Q.push(Ne)}if((ee||ie)&&(W.width=ee&&(!a.resizeDirection||a.resizeDirection==="horizontal")?K:S.width,W.height=ie&&(!a.resizeDirection||a.resizeDirection==="vertical")?J:S.height,S.width=W.width,S.height=W.height),A&&k.expandParent){const xe=oe[0]*(W.width??0);W.x&&W.x<xe&&(S.x=xe,C.x=C.x-(W.x-xe));const Ce=oe[1]*(W.height??0);W.y&&W.y<Ce&&(S.y=Ce,C.y=C.y-(W.y-Ce))}const ye=Qq({width:S.width,prevWidth:G,height:S.height,prevHeight:P,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),pe={...S,direction:ye};(w==null?void 0:w(M,pe))!==!1&&(L=!0,b==null||b(M,pe),r(W,Q))}).on("end",M=>{L&&(x==null||x(M,{...S}),s==null||s({...S}),L=!1)});o.call(B)}function u(){o.on(".drag",null)}return{update:c,destroy:u}}var Np={exports:{}},Cp={},Ep={exports:{}},jp={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var ek;function rF(){if(ek)return jp;ek=1;var e=yl();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(m,g){var v=g(),b=r({inst:{value:v,getSnapshot:g}}),x=b[0].inst,w=b[1];return o(function(){x.value=v,x.getSnapshot=g,u(x)&&w({inst:x})},[m,v,g]),s(function(){return u(x)&&w({inst:x}),m(function(){u(x)&&w({inst:x})})},[m]),a(v),v}function u(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!n(m,v)}catch{return!0}}function d(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return jp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,jp}var tk;function sF(){return tk||(tk=1,Ep.exports=rF()),Ep.exports}/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var nk;function iF(){if(nk)return Cp;nk=1;var e=yl(),t=sF();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Cp.useSyncExternalStoreWithSelector=function(d,p,m,g,v){var b=o(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=c(function(){function S(A){if(!C){if(C=!0,k=A,A=g(A),v!==void 0&&x.hasValue){var R=x.value;if(v(R,A))return N=R}return N=A}if(R=N,r(k,A))return R;var O=g(A);return v!==void 0&&v(R,O)?(k=A,R):(k=A,N=O)}var C=!1,k,N,j=m===void 0?null:m;return[function(){return S(p())},j===null?void 0:function(){return S(j())}]},[p,m,g,v]);var w=s(d,b[0],b[1]);return a(function(){x.hasValue=!0,x.value=w},[w]),u(w),w},Cp}var rk;function oF(){return rk||(rk=1,Np.exports=iF()),Np.exports}var aF=oF();const lF=gl(aF),cF={},sk=e=>{let t;const n=new Set,r=(p,m)=>{const g=typeof p=="function"?p(t):p;if(!Object.is(g,t)){const v=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(cF?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,s,u);return u},uF=e=>e?sk(e):sk,{useDebugValue:dF}=pt,{useSyncExternalStoreWithSelector:fF}=lF,hF=e=>e;function yR(e,t=hF,n){const r=fF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dF(r),r}const ik=(e,t)=>{const n=uF(e),r=(s,o=t)=>yR(n,s,o);return Object.assign(r,n),r},pF=(e,t)=>e?ik(e,t):ik;function Qe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Nw=uA();const mF=gl(Nw),Ad=T.createContext(null),gF=Ad.Provider,vR=cr.error001();function De(e,t){const n=T.useContext(Ad);if(n===null)throw new Error(vR);return yR(n,e,t)}function Je(){const e=T.useContext(Ad);if(e===null)throw new Error(vR);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ok={display:"none"},yF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xR="react-flow__node-desc",wR="react-flow__edge-desc",vF="react-flow__aria-live",xF=e=>e.ariaLiveMessage,wF=e=>e.ariaLabelConfig;function bF({rfId:e}){const t=De(xF);return h.jsx("div",{id:`${vF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:yF,children:t})}function SF({rfId:e,disableKeyboardA11y:t}){const n=De(wF);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${xR}-${e}`,style:ok,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${wR}-${e}`,style:ok,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(bF,{rfId:e})]})}const Rd=T.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const a=`${e}`.split("-");return h.jsx("div",{className:gt(["react-flow__panel",n,...a]),style:r,ref:o,...s,children:t})});Rd.displayName="Panel";function _F({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(Rd,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const kF=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},pu=e=>e.id;function NF(e,t){return Qe(e.selectedNodes.map(pu),t.selectedNodes.map(pu))&&Qe(e.selectedEdges.map(pu),t.selectedEdges.map(pu))}function CF({onSelectionChange:e}){const t=Je(),{selectedNodes:n,selectedEdges:r}=De(kF,NF);return T.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const EF=e=>!!e.onSelectionChangeHandlers;function jF({onSelectionChange:e}){const t=De(EF);return e||t?h.jsx(CF,{onSelectionChange:e}):null}const bR=[0,0],TF={x:0,y:0,zoom:1},AF=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],ak=[...AF,"rfId"],RF=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),lk={translateExtent:nl,nodeOrigin:bR,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function IF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:u}=De(RF,Qe),d=Je();T.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{p.current=lk,c()}),[]);const p=T.useRef(lk);return T.useEffect(()=>{for(const m of ak){const g=e[m],v=p.current[m];g!==v&&(typeof e[m]>"u"||(m==="nodes"?t(g):m==="edges"?n(g):m==="minZoom"?r(g):m==="maxZoom"?s(g):m==="translateExtent"?o(g):m==="nodeExtent"?a(g):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:mq(g)}):m==="fitView"?d.setState({fitViewQueued:g}):m==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[m]:g})))}p.current=e},ak.map(m=>e[m])),null}function ck(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function MF(e){var r;const[t,n]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){n(e);return}const s=ck(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=ck())!=null&&r.matches?"dark":"light"}const uk=typeof document<"u"?document:null;function ol(e=null,t={target:uk,actInsideInputWithModifier:!0}){const[n,r]=T.useState(!1),s=T.useRef(!1),o=T.useRef(new Set([])),[a,c]=T.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),p=d.reduce((m,g)=>m.concat(...g),[]);return[d,p]}return[[],[]]},[e]);return T.useEffect(()=>{const u=(t==null?void 0:t.target)??uk,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=v=>{var w,S;if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!d)&&ZA(v))return!1;const x=fk(v.code,c);if(o.current.add(v[x]),dk(a,o.current,!1)){const C=((S=(w=v.composedPath)==null?void 0:w.call(v))==null?void 0:S[0])||v.target,k=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(s.current||!k)&&v.preventDefault(),r(!0)}},m=v=>{const b=fk(v.code,c);dk(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(v[b]),v.key==="Meta"&&o.current.clear(),s.current=!1},g=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",p),u==null||u.addEventListener("keyup",m),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",p),u==null||u.removeEventListener("keyup",m),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function dk(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function fk(e,t){return t.includes(e)?"code":"key"}const OF=()=>{const e=Je();return T.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:a,panZoom:c}=e.getState(),u=vw(t,r,s,o,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:c,y:u}=a.getBoundingClientRect(),d={x:t.x-c,y:t.y-u},p=n.snapGrid??s,m=n.snapToGrid??o;return _l(d,r,m,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),a=sd(t,n);return{x:a.x+s,y:a.y+o}}}),[])};function SR(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const a=r.get(o.id);a?a.push(o):r.set(o.id,[o])}for(const o of t){const a=r.get(o.id);if(!a){n.push(o);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...o};for(const u of a)PF(u,c);n.push(c)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function PF(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function _R(e,t){return SR(e,t)}function kR(e,t){return SR(e,t)}function Vs(e,t){return{id:e,type:"select",selected:t}}function Ji(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const a=t.has(s);!(o.selected===void 0&&!a)&&o.selected!==a&&(n&&(o.selected=a),r.push(Vs(o.id,a)))}return r}function hk({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,a]of e.entries()){const c=t.get(a.id),u=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;u!==void 0&&u!==a&&n.push({id:a.id,item:a,type:"replace"}),u===void 0&&n.push({item:a,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function pk(e){return{id:e.id,type:"remove"}}const mk=e=>iq(e),LF=e=>HA(e);function NR(e){return T.forwardRef(e)}const DF=typeof window<"u"?T.useLayoutEffect:T.useEffect;function gk(e){const[t,n]=T.useState(BigInt(0)),[r]=T.useState(()=>$F(()=>n(s=>s+BigInt(1))));return DF(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function $F(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const CR=T.createContext(null);function qF({children:e}){const t=Je(),n=T.useCallback(c=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:p,onNodesChange:m,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let x=u;for(const S of c)x=typeof S=="function"?S(x):S;let w=hk({items:x,lookup:g});for(const S of b.values())w=S(w);p&&d(x),w.length>0?m==null||m(w):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:C,setNodes:k}=t.getState();S&&k(C)})},[]),r=gk(n),s=T.useCallback(c=>{const{edges:u=[],setEdges:d,hasDefaultEdges:p,onEdgesChange:m,edgeLookup:g}=t.getState();let v=u;for(const b of c)v=typeof b=="function"?b(v):b;p?d(v):m&&m(hk({items:v,lookup:g}))},[]),o=gk(s),a=T.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return h.jsx(CR.Provider,{value:a,children:e})}function FF(){const e=T.useContext(CR);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const BF=e=>!!e.panZoom;function _o(){const e=OF(),t=Je(),n=FF(),r=De(BF),s=T.useMemo(()=>{const o=m=>t.getState().nodeLookup.get(m),a=m=>{n.nodeQueue.push(m)},c=m=>{n.edgeQueue.push(m)},u=m=>{var S,C;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=mk(m)?m:g.get(m.id),x=b.parentId?QA(b.position,b.measured,b.parentId,g,v):b.position,w={...b,position:x,width:((S=b.measured)==null?void 0:S.width)??b.width,height:((C=b.measured)==null?void 0:C.height)??b.height};return mo(w)},d=(m,g,v={replace:!1})=>{a(b=>b.map(x=>{if(x.id===m){const w=typeof g=="function"?g(x):g;return v.replace&&mk(w)?w:{...x,...w}}return x}))},p=(m,g,v={replace:!1})=>{c(b=>b.map(x=>{if(x.id===m){const w=typeof g=="function"?g(x):g;return v.replace&&LF(w)?w:{...x,...w}}return x}))};return{getNodes:()=>t.getState().nodes.map(m=>({...m})),getNode:m=>{var g;return(g=o(m))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:m=[]}=t.getState();return m.map(g=>({...g}))},getEdge:m=>t.getState().edgeLookup.get(m),setNodes:a,setEdges:c,addNodes:m=>{const g=Array.isArray(m)?m:[m];n.nodeQueue.push(v=>[...v,...g])},addEdges:m=>{const g=Array.isArray(m)?m:[m];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:m=[],edges:g=[],transform:v}=t.getState(),[b,x,w]=v;return{nodes:m.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x:b,y:x,zoom:w}}},deleteElements:async({nodes:m=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:x,onEdgesDelete:w,triggerNodeChanges:S,triggerEdgeChanges:C,onDelete:k,onBeforeDelete:N}=t.getState(),{nodes:j,edges:A}=await uq({nodesToRemove:m,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:N}),R=A.length>0,O=j.length>0;if(R){const L=A.map(pk);w==null||w(A),C(L)}if(O){const L=j.map(pk);x==null||x(j),S(L)}return(O||R)&&(k==null||k({nodes:j,edges:A})),{deletedNodes:j,deletedEdges:A}},getIntersectingNodes:(m,g=!0,v)=>{const b=B_(m),x=b?m:u(m),w=v!==void 0;return x?(v||t.getState().nodes).filter(S=>{const C=t.getState().nodeLookup.get(S.id);if(C&&!b&&(S.id===m.id||!C.internals.positionAbsolute))return!1;const k=mo(w?S:C),N=sl(k,x);return g&&N>0||N>=k.width*k.height||N>=x.width*x.height}):[]},isNodeIntersecting:(m,g,v=!0)=>{const x=B_(m)?m:u(m);if(!x)return!1;const w=sl(x,g);return v&&w>0||w>=g.width*g.height||w>=x.width*x.height},updateNode:d,updateNodeData:(m,g,v={replace:!1})=>{d(m,b=>{const x=typeof g=="function"?g(b):g;return v.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},v)},updateEdge:p,updateEdgeData:(m,g,v={replace:!1})=>{p(m,b=>{const x=typeof g=="function"?g(b):g;return v.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},v)},getNodesBounds:m=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return oq(m,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:m,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${m}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:m,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${m?g?`-${m}-${g}`:`-${m}`:""}`))==null?void 0:b.values())??[])},fitView:async m=>{const g=t.getState().fitViewResolver??pq();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return T.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const yk=e=>e.selected,zF=typeof window<"u"?window:void 0;function VF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Je(),{deleteElements:r}=_o(),s=ol(e,{actInsideInputWithModifier:!1}),o=ol(t,{target:zF});T.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();r({nodes:c.filter(yk),edges:a.filter(yk)}),n.setState({nodesSelectionActive:!1})}},[s]),T.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function UF(e){const t=Je();T.useEffect(()=>{const n=()=>{var s,o,a,c;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=xw(e.current);(r.height===0||r.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",cr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Id={position:"absolute",width:"100%",height:"100%",top:0,left:0},HF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function WF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Ys.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:p,maxZoom:m,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:x,noPanClassName:w,onViewportChange:S,isControlledViewport:C,paneClickDistance:k,selectionOnDrag:N}){const j=Je(),A=T.useRef(null),{userSelectionActive:R,lib:O,connectionInProgress:L}=De(HF,Qe),B=ol(g),M=T.useRef();UF(A);const $=T.useCallback(U=>{S==null||S({x:U[0],y:U[1],zoom:U[2]}),C||j.setState({transform:U})},[S,C]);return T.useEffect(()=>{if(A.current){M.current=Xq({domNode:A.current,minZoom:p,maxZoom:m,translateExtent:d,viewport:u,onDraggingChange:z=>j.setState({paneDragging:z}),onPanZoomStart:(z,Q)=>{const{onViewportChangeStart:F,onMoveStart:q}=j.getState();q==null||q(z,Q),F==null||F(Q)},onPanZoom:(z,Q)=>{const{onViewportChange:F,onMove:q}=j.getState();q==null||q(z,Q),F==null||F(Q)},onPanZoomEnd:(z,Q)=>{const{onViewportChangeEnd:F,onMoveEnd:q}=j.getState();q==null||q(z,Q),F==null||F(Q)}});const{x:U,y:D,zoom:V}=M.current.getViewport();return j.setState({panZoom:M.current,transform:[U,D,V],domNode:A.current.closest(".react-flow")}),()=>{var z;(z=M.current)==null||z.destroy()}}},[]),T.useEffect(()=>{var U;(U=M.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:w,userSelectionActive:R,noWheelClassName:x,lib:O,onTransformChange:$,connectionInProgress:L,selectionOnDrag:N,paneClickDistance:k})},[e,t,n,r,s,o,a,c,B,v,w,R,x,O,$,L,N,k]),h.jsx("div",{className:"react-flow__renderer",ref:A,style:Id,children:b})}const KF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function GF(){const{userSelectionActive:e,userSelectionRect:t}=De(KF,Qe);return e&&t?h.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Tp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},YF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function XF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=rl.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:a,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:p,onPaneMouseEnter:m,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const x=Je(),{userSelectionActive:w,elementsSelectable:S,dragging:C,connectionInProgress:k}=De(YF,Qe),N=S&&(e||w),j=T.useRef(null),A=T.useRef(),R=T.useRef(new Set),O=T.useRef(new Set),L=T.useRef(!1),B=F=>{if(L.current||k){L.current=!1;return}u==null||u(F),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},M=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}d==null||d(F)},$=p?F=>p(F):void 0,U=F=>{L.current&&(F.stopPropagation(),L.current=!1)},D=F=>{var J,te;const{domNode:q}=x.getState();if(A.current=q==null?void 0:q.getBoundingClientRect(),!A.current)return;const G=F.target===j.current;if(!G&&!!F.target.closest(".nokey")||!e||!(o&&G||t)||F.button!==0||!F.isPrimary)return;(te=(J=F.target)==null?void 0:J.setPointerCapture)==null||te.call(J,F.pointerId),L.current=!1;const{x:oe,y:K}=Fn(F.nativeEvent,A.current);x.setState({userSelectionRect:{width:0,height:0,startX:oe,startY:K,x:oe,y:K}}),G||(F.stopPropagation(),F.preventDefault())},V=F=>{const{userSelectionRect:q,transform:G,nodeLookup:P,edgeLookup:W,connectionLookup:oe,triggerNodeChanges:K,triggerEdgeChanges:J,defaultEdgeOptions:te,resetSelectedElements:Y}=x.getState();if(!A.current||!q)return;const{x:ee,y:ie}=Fn(F.nativeEvent,A.current),{startX:ue,startY:me}=q;if(!L.current){const Ce=t?0:s;if(Math.hypot(ee-ue,ie-me)<=Ce)return;Y(),a==null||a(F)}L.current=!0;const ye={startX:ue,startY:me,x:ee<ue?ee:ue,y:ie<me?ie:me,width:Math.abs(ee-ue),height:Math.abs(ie-me)},pe=R.current,_e=O.current;R.current=new Set(yw(P,ye,G,n===rl.Partial,!0).map(Ce=>Ce.id)),O.current=new Set;const xe=(te==null?void 0:te.selectable)??!0;for(const Ce of R.current){const Ne=oe.get(Ce);if(Ne)for(const{edgeId:tt}of Ne.values()){const Le=W.get(tt);Le&&(Le.selectable??xe)&&O.current.add(tt)}}if(!z_(pe,R.current)){const Ce=Ji(P,R.current,!0);K(Ce)}if(!z_(_e,O.current)){const Ce=Ji(W,O.current);J(Ce)}x.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},z=F=>{var q,G;F.button===0&&((G=(q=F.target)==null?void 0:q.releasePointerCapture)==null||G.call(q,F.pointerId),!w&&F.target===j.current&&x.getState().userSelectionRect&&(B==null||B(F)),x.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(c==null||c(F),x.setState({nodesSelectionActive:R.current.size>0})))},Q=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:gt(["react-flow__pane",{draggable:Q,dragging:C,selection:e}]),onClick:N?void 0:Tp(B,j),onContextMenu:Tp(M,j),onWheel:Tp($,j),onPointerEnter:N?void 0:m,onPointerMove:N?V:g,onPointerUp:N?z:void 0,onPointerDownCapture:N?D:void 0,onClickCapture:N?U:void 0,onPointerLeave:v,ref:j,style:Id,children:[b,h.jsx(GF,{})]})}function Ox({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:a,nodeLookup:c,onError:u}=t.getState(),d=c.get(e);if(!d){u==null||u("012",cr.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([e])}function ER({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:a}){const c=Je(),[u,d]=T.useState(!1),p=T.useRef();return T.useEffect(()=>{p.current=Lq({getStoreItems:()=>c.getState(),onNodeMouseDown:m=>{Ox({id:m,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),T.useEffect(()=>{var m,g;if(t)(m=p.current)==null||m.destroy();else if(e.current)return(g=p.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:a}),()=>{var v;(v=p.current)==null||v.destroy()}},[n,r,t,o,e,s]),u}const QF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function jR(){const e=Je();return T.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:a,onError:c,updateNodePositions:u,nodeLookup:d,nodeOrigin:p}=e.getState(),m=new Map,g=QF(a),v=s?o[0]:5,b=s?o[1]:5,x=n.direction.x*v*n.factor,w=n.direction.y*b*n.factor;for(const[,S]of d){if(!g(S))continue;let C={x:S.internals.positionAbsolute.x+x,y:S.internals.positionAbsolute.y+w};s&&(C=Sl(C,o));const{position:k,positionAbsolute:N}=WA({nodeId:S.id,nextPosition:C,nodeLookup:d,nodeExtent:r,nodeOrigin:p,onError:c});S.position=k,S.internals.positionAbsolute=N,m.set(S.id,S)}u(m)},[])}const Cw=T.createContext(null),JF=Cw.Provider;Cw.Consumer;const TR=()=>T.useContext(Cw),ZF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),eB=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:a}=r,{fromHandle:c,toHandle:u,isValid:d}=a,p=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:p,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===ho.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:p&&d}};function tB({type:e="source",position:t=he.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:a,onConnect:c,children:u,className:d,onMouseDown:p,onTouchStart:m,...g},v){var V,z;const b=a||null,x=e==="target",w=Je(),S=TR(),{connectOnClick:C,noPanClassName:k,rfId:N}=De(ZF,Qe),{connectingFrom:j,connectingTo:A,clickConnecting:R,isPossibleEndHandle:O,connectionInProcess:L,clickConnectionInProcess:B,valid:M}=De(eB(S,b,e),Qe);S||(z=(V=w.getState()).onError)==null||z.call(V,"010",cr.error010());const $=Q=>{const{defaultEdgeOptions:F,onConnect:q,hasDefaultEdges:G}=w.getState(),P={...F,...Q};if(G){const{edges:W,setEdges:oe}=w.getState();oe(sR(P,W))}q==null||q(P),c==null||c(P)},U=Q=>{if(!S)return;const F=eR(Q.nativeEvent);if(s&&(F&&Q.button===0||!F)){const q=w.getState();Mx.onPointerDown(Q.nativeEvent,{handleDomNode:Q.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:x,handleId:b,nodeId:S,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:q.onConnectEnd,updateConnection:q.updateConnection,onConnect:$,isValidConnection:n||q.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}F?p==null||p(Q):m==null||m(Q)},D=Q=>{const{onClickConnectStart:F,onClickConnectEnd:q,connectionClickStartHandle:G,connectionMode:P,isValidConnection:W,lib:oe,rfId:K,nodeLookup:J,connection:te}=w.getState();if(!S||!G&&!s)return;if(!G){F==null||F(Q.nativeEvent,{nodeId:S,handleId:b,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:S,type:e,id:b}});return}const Y=JA(Q.target),ee=n||W,{connection:ie,isValid:ue}=Mx.isValid(Q.nativeEvent,{handle:{nodeId:S,id:b,type:e},connectionMode:P,fromNodeId:G.nodeId,fromHandleId:G.id||null,fromType:G.type,isValidConnection:ee,flowId:K,doc:Y,lib:oe,nodeLookup:J});ue&&ie&&$(ie);const me=structuredClone(te);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,q==null||q(Q,me),w.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":b,"data-nodeid":S,"data-handlepos":t,"data-id":`${N}-${S}-${b}-${e}`,className:gt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,d,{source:!x,target:x,connectable:r,connectablestart:s,connectableend:o,clickconnecting:R,connectingfrom:j,connectingto:A,valid:M,connectionindicator:r&&(!L||O)&&(L||B?o:s)}]),onMouseDown:U,onTouchStart:U,onClick:C?D:void 0,ref:v,...g,children:u})}const Be=T.memo(NR(tB));function nB({data:e,isConnectable:t,sourcePosition:n=he.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Be,{type:"source",position:n,isConnectable:t})]})}function rB({data:e,isConnectable:t,targetPosition:n=he.Top,sourcePosition:r=he.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Be,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Be,{type:"source",position:r,isConnectable:t})]})}function sB(){return null}function iB({data:e,isConnectable:t,targetPosition:n=he.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Be,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const id={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vk={input:nB,default:rB,output:iB,group:sB};function oB(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const aB=e=>{const{width:t,height:n,x:r,y:s}=bl(e.nodeLookup,{filter:o=>!!o.selected});return{width:qn(t)?t:null,height:qn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function lB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Je(),{width:s,height:o,transformString:a,userSelectionActive:c}=De(aB,Qe),u=jR(),d=T.useRef(null);if(T.useEffect(()=>{var g;n||(g=d.current)==null||g.focus({preventScroll:!0})},[n]),ER({nodeRef:d}),c||!s||!o)return null;const p=e?g=>{const v=r.getState().nodes.filter(b=>b.selected);e(g,v)}:void 0,m=g=>{Object.prototype.hasOwnProperty.call(id,g.key)&&(g.preventDefault(),u({direction:id[g.key],factor:g.shiftKey?4:1}))};return h.jsx("div",{className:gt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:s,height:o}})})}const xk=typeof window<"u"?window:void 0,cB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function AR({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:p,selectionMode:m,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:w,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:k,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:A,zoomOnDoubleClick:R,panOnDrag:O,defaultViewport:L,translateExtent:B,minZoom:M,maxZoom:$,preventScrolling:U,onSelectionContextMenu:D,noWheelClassName:V,noPanClassName:z,disableKeyboardA11y:Q,onViewportChange:F,isControlledViewport:q}){const{nodesSelectionActive:G,userSelectionActive:P}=De(cB,Qe),W=ol(d,{target:xk}),oe=ol(x,{target:xk}),K=oe||O,J=oe||N,te=p&&K!==!0,Y=W||P||te;return VF({deleteKeyCode:u,multiSelectionKeyCode:b}),h.jsx(WF,{onPaneContextMenu:o,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:k,panOnScroll:J,panOnScrollSpeed:j,panOnScrollMode:A,zoomOnDoubleClick:R,panOnDrag:!W&&K,defaultViewport:L,translateExtent:B,minZoom:M,maxZoom:$,zoomActivationKeyCode:w,preventScrolling:U,noWheelClassName:V,noPanClassName:z,onViewportChange:F,isControlledViewport:q,paneClickDistance:c,selectionOnDrag:te,children:h.jsxs(XF,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:K,isSelecting:!!Y,selectionMode:m,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:te,children:[e,G&&h.jsx(lB,{onSelectionContextMenu:D,noPanClassName:z,disableKeyboardA11y:Q})]})})}AR.displayName="FlowRenderer";const uB=T.memo(AR),dB=e=>t=>e?yw(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function fB(e){return De(T.useCallback(dB(e),[e]),Qe)}const hB=e=>e.updateNodeInternals;function pB(){const e=De(hB),[t]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return T.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function mB({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Je(),o=T.useRef(null),a=T.useRef(null),c=T.useRef(e.sourcePosition),u=T.useRef(e.targetPosition),d=T.useRef(t),p=n&&!!e.internals.handleBounds;return T.useEffect(()=>{o.current&&!e.hidden&&(!p||a.current!==o.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(o.current),a.current=o.current)},[p,e.hidden]),T.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),T.useEffect(()=>{if(o.current){const m=d.current!==t,g=c.current!==e.sourcePosition,v=u.current!==e.targetPosition;(m||g||v)&&(d.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function gB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:a,nodesDraggable:c,elementsSelectable:u,nodesConnectable:d,nodesFocusable:p,resizeObserver:m,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:x,nodeTypes:w,nodeClickDistance:S,onError:C}){const{node:k,internals:N,isParent:j}=De(ee=>{const ie=ee.nodeLookup.get(e),ue=ee.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:ue}},Qe);let A=k.type||"default",R=(w==null?void 0:w[A])||vk[A];R===void 0&&(C==null||C("003",cr.error003(A)),A="default",R=(w==null?void 0:w.default)||vk.default);const O=!!(k.draggable||c&&typeof k.draggable>"u"),L=!!(k.selectable||u&&typeof k.selectable>"u"),B=!!(k.connectable||d&&typeof k.connectable>"u"),M=!!(k.focusable||p&&typeof k.focusable>"u"),$=Je(),U=XA(k),D=mB({node:k,nodeType:A,hasDimensions:U,resizeObserver:m}),V=ER({nodeRef:D,disabled:k.hidden||!O,noDragClassName:g,handleSelector:k.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:S}),z=jR();if(k.hidden)return null;const Q=Lr(k),F=oB(k),q=L||O||t||n||r||s,G=n?ee=>n(ee,{...N.userNode}):void 0,P=r?ee=>r(ee,{...N.userNode}):void 0,W=s?ee=>s(ee,{...N.userNode}):void 0,oe=o?ee=>o(ee,{...N.userNode}):void 0,K=a?ee=>a(ee,{...N.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:ie,nodeDragThreshold:ue}=$.getState();L&&(!ie||!O||ue>0)&&Ox({id:e,store:$,nodeRef:D}),t&&t(ee,{...N.userNode})},te=ee=>{if(!(ZA(ee.nativeEvent)||b)){if(BA.includes(ee.key)&&L){const ie=ee.key==="Escape";Ox({id:e,store:$,unselect:ie,nodeRef:D})}else if(O&&k.selected&&Object.prototype.hasOwnProperty.call(id,ee.key)){ee.preventDefault();const{ariaLabelConfig:ie}=$.getState();$.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),z({direction:id[ee.key],factor:ee.shiftKey?4:1})}}},Y=()=>{var _e;if(b||!((_e=D.current)!=null&&_e.matches(":focus-visible")))return;const{transform:ee,width:ie,height:ue,autoPanOnNodeFocus:me,setCenter:ye}=$.getState();if(!me)return;yw(new Map([[e,k]]),{x:0,y:0,width:ie,height:ue},ee,!0).length>0||ye(k.position.x+Q.width/2,k.position.y+Q.height/2,{zoom:ee[2]})};return h.jsx("div",{className:gt(["react-flow__node",`react-flow__node-${A}`,{[v]:O},k.className,{selected:k.selected,selectable:L,parent:j,draggable:O,dragging:V}]),ref:D,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:U?"visible":"hidden",...k.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:G,onMouseMove:P,onMouseLeave:W,onContextMenu:oe,onClick:J,onDoubleClick:K,onKeyDown:M?te:void 0,tabIndex:M?0:void 0,onFocus:M?Y:void 0,role:k.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${xR}-${x}`,"aria-label":k.ariaLabel,...k.domAttributes,children:h.jsx(JF,{value:e,children:h.jsx(R,{id:e,data:k.data,type:A,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:k.selected??!1,selectable:L,draggable:O,deletable:k.deletable??!0,isConnectable:B,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:V,dragHandle:k.dragHandle,zIndex:N.z,parentId:k.parentId,...Q})})})}var yB=T.memo(gB);const vB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function RR(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=De(vB,Qe),a=fB(e.onlyRenderVisibleElements),c=pB();return h.jsx("div",{className:"react-flow__nodes",style:Id,children:a.map(u=>h.jsx(yB,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}RR.displayName="NodeRenderer";const xB=T.memo(RR);function wB(e){return De(T.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);o&&a&&vq({sourceNode:o,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Qe)}const bB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},SB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},wk={[nd.Arrow]:bB,[nd.ArrowClosed]:SB};function _B(e){const t=Je();return T.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(wk,e)?wk[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",cr.error009(e)),null)},[e])}const kB=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const u=_B(t);return u?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0",children:h.jsx(u,{color:n,strokeWidth:a})}):null},IR=({defaultColor:e,rfId:t})=>{const n=De(o=>o.edges),r=De(o=>o.defaultEdgeOptions),s=T.useMemo(()=>Nq(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:s.map(o=>h.jsx(kB,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};IR.displayName="MarkerDefinitions";var NB=T.memo(IR);function MR({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...p}){const[m,g]=T.useState({x:1,y:0,width:0,height:0}),v=gt(["react-flow__edge-textwrapper",d]),b=T.useRef(null);return T.useEffect(()=>{if(b.current){const x=b.current.getBBox();g({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:v,visibility:m.width?"visible":"hidden",...p,children:[s&&h.jsx("rect",{width:m.width+2*a[0],x:-a[0],y:-a[1],height:m.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),h.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}MR.displayName="EdgeText";const CB=T.memo(MR);function Md({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:d=20,...p}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...p,d:e,fill:"none",className:gt(["react-flow__edge-path",p.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&qn(t)&&qn(n)?h.jsx(CB,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function bk({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===he.Left||e===he.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function OR({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top}){const[a,c]=bk({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,d]=bk({pos:o,x1:r,y1:s,x2:e,y2:t}),[p,m,g,v]=tR({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${c} ${u},${d} ${r},${s}`,p,m,g,v]}function PR(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a,targetPosition:c,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})=>{const[C,k,N]=OR({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c}),j=e.isInternal?void 0:t;return h.jsx(Md,{id:j,path:C,labelX:k,labelY:N,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})})}const EB=PR({isInternal:!1}),LR=PR({isInternal:!0});EB.displayName="SimpleBezierEdge";LR.displayName="SimpleBezierEdgeInternal";function DR(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,sourcePosition:v=he.Bottom,targetPosition:b=he.Top,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:C})=>{const[k,N,j]=Ax({sourceX:n,sourceY:r,sourcePosition:v,targetX:s,targetY:o,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),A=e.isInternal?void 0:t;return h.jsx(Md,{id:A,path:k,labelX:N,labelY:j,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:w,interactionWidth:C})})}const $R=DR({isInternal:!1}),qR=DR({isInternal:!0});$R.displayName="SmoothStepEdge";qR.displayName="SmoothStepEdgeInternal";function FR(e){return T.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return h.jsx($R,{...n,id:r,pathOptions:T.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const jB=FR({isInternal:!1}),BR=FR({isInternal:!0});jB.displayName="StepEdge";BR.displayName="StepEdgeInternal";function zR(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:v,markerStart:b,interactionWidth:x})=>{const[w,S,C]=iR({sourceX:n,sourceY:r,targetX:s,targetY:o}),k=e.isInternal?void 0:t;return h.jsx(Md,{id:k,path:w,labelX:S,labelY:C,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:g,markerEnd:v,markerStart:b,interactionWidth:x})})}const TB=zR({isInternal:!1}),VR=zR({isInternal:!0});TB.displayName="StraightEdge";VR.displayName="StraightEdgeInternal";function UR(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a=he.Bottom,targetPosition:c=he.Top,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:C})=>{const[k,N,j]=nR({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c,curvature:S==null?void 0:S.curvature}),A=e.isInternal?void 0:t;return h.jsx(Md,{id:A,path:k,labelX:N,labelY:j,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:C})})}const AB=UR({isInternal:!1}),HR=UR({isInternal:!0});AB.displayName="BezierEdge";HR.displayName="BezierEdgeInternal";const Sk={default:HR,straight:VR,step:BR,smoothstep:qR,simplebezier:LR},_k={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},RB=(e,t,n)=>n===he.Left?e-t:n===he.Right?e+t:e,IB=(e,t,n)=>n===he.Top?e-t:n===he.Bottom?e+t:e,kk="react-flow__edgeupdater";function Nk({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:a,type:c}){return h.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:a,className:gt([kk,`${kk}-${c}`]),cx:RB(t,r,e),cy:IB(n,r,e),r,stroke:"transparent",fill:"transparent"})}function MB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:c,targetPosition:u,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,setReconnecting:g,setUpdateHover:v}){const b=Je(),x=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:A,domNode:R,isValidConnection:O,connectionMode:L,connectionRadius:B,lib:M,onConnectStart:$,onConnectEnd:U,cancelConnection:D,nodeLookup:V,rfId:z,panBy:Q,updateConnection:F}=b.getState(),q=j.type==="target",G=(oe,K)=>{g(!1),m==null||m(oe,n,j.type,K)},P=oe=>d==null?void 0:d(n,oe),W=(oe,K)=>{g(!0),p==null||p(N,n,j.type),$==null||$(oe,K)};Mx.onPointerDown(N.nativeEvent,{autoPanOnConnect:A,connectionMode:L,connectionRadius:B,domNode:R,handleId:j.id,nodeId:j.nodeId,nodeLookup:V,isTarget:q,edgeUpdaterType:j.type,lib:M,flowId:z,cancelConnection:D,panBy:Q,isValidConnection:O,onConnect:P,onConnectStart:W,onConnectEnd:U,onReconnectEnd:G,updateConnection:F,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},w=N=>x(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=N=>x(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>v(!0),k=()=>v(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(Nk,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:C,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&h.jsx(Nk,{position:u,centerX:o,centerY:a,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:k,type:"target"})]})}function OB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,reconnectRadius:p,onReconnect:m,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:x,noPanClassName:w,onError:S,disableKeyboardA11y:C}){let k=De(ye=>ye.edgeLookup.get(e));const N=De(ye=>ye.defaultEdgeOptions);k=N?{...N,...k}:k;let j=k.type||"default",A=(x==null?void 0:x[j])||Sk[j];A===void 0&&(S==null||S("011",cr.error011(j)),j="default",A=(x==null?void 0:x.default)||Sk.default);const R=!!(k.focusable||t&&typeof k.focusable>"u"),O=typeof m<"u"&&(k.reconnectable||n&&typeof k.reconnectable>"u"),L=!!(k.selectable||r&&typeof k.selectable>"u"),B=T.useRef(null),[M,$]=T.useState(!1),[U,D]=T.useState(!1),V=Je(),{zIndex:z,sourceX:Q,sourceY:F,targetX:q,targetY:G,sourcePosition:P,targetPosition:W}=De(T.useCallback(ye=>{const pe=ye.nodeLookup.get(k.source),_e=ye.nodeLookup.get(k.target);if(!pe||!_e)return{zIndex:k.zIndex,..._k};const xe=kq({id:e,sourceNode:pe,targetNode:_e,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:ye.connectionMode,onError:S});return{zIndex:yq({selected:k.selected,zIndex:k.zIndex,sourceNode:pe,targetNode:_e,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...xe||_k}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Qe),oe=T.useMemo(()=>k.markerStart?`url('#${Rx(k.markerStart,b)}')`:void 0,[k.markerStart,b]),K=T.useMemo(()=>k.markerEnd?`url('#${Rx(k.markerEnd,b)}')`:void 0,[k.markerEnd,b]);if(k.hidden||Q===null||F===null||q===null||G===null)return null;const J=ye=>{var Ce;const{addSelectedEdges:pe,unselectNodesAndEdges:_e,multiSelectionActive:xe}=V.getState();L&&(V.setState({nodesSelectionActive:!1}),k.selected&&xe?(_e({nodes:[],edges:[k]}),(Ce=B.current)==null||Ce.blur()):pe([e])),s&&s(ye,k)},te=o?ye=>{o(ye,{...k})}:void 0,Y=a?ye=>{a(ye,{...k})}:void 0,ee=c?ye=>{c(ye,{...k})}:void 0,ie=u?ye=>{u(ye,{...k})}:void 0,ue=d?ye=>{d(ye,{...k})}:void 0,me=ye=>{var pe;if(!C&&BA.includes(ye.key)&&L){const{unselectNodesAndEdges:_e,addSelectedEdges:xe}=V.getState();ye.key==="Escape"?((pe=B.current)==null||pe.blur(),_e({edges:[k]})):xe([e])}};return h.jsx("svg",{style:{zIndex:z},children:h.jsxs("g",{className:gt(["react-flow__edge",`react-flow__edge-${j}`,k.className,w,{selected:k.selected,animated:k.animated,inactive:!L&&!s,updating:M,selectable:L}]),onClick:J,onDoubleClick:te,onContextMenu:Y,onMouseEnter:ee,onMouseMove:ie,onMouseLeave:ue,onKeyDown:R?me:void 0,tabIndex:R?0:void 0,role:k.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":R?`${wR}-${b}`:void 0,ref:B,...k.domAttributes,children:[!U&&h.jsx(A,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:L,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:Q,sourceY:F,targetX:q,targetY:G,sourcePosition:P,targetPosition:W,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:oe,markerEnd:K,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),O&&h.jsx(MB,{edge:k,isReconnectable:O,reconnectRadius:p,onReconnect:m,onReconnectStart:g,onReconnectEnd:v,sourceX:Q,sourceY:F,targetX:q,targetY:G,sourcePosition:P,targetPosition:W,setUpdateHover:$,setReconnecting:D})]})})}var PB=T.memo(OB);const LB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function WR({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:p,reconnectRadius:m,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:x}){const{edgesFocusable:w,edgesReconnectable:S,elementsSelectable:C,onError:k}=De(LB,Qe),N=wB(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(NB,{defaultColor:e,rfId:n}),N.map(j=>h.jsx(PB,{id:j,edgesFocusable:w,edgesReconnectable:S,elementsSelectable:C,noPanClassName:s,onReconnect:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:p,reconnectRadius:m,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:k,edgeTypes:r,disableKeyboardA11y:x},j))]})}WR.displayName="EdgeRenderer";const DB=T.memo(WR),$B=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function qB({children:e}){const t=De($B);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function FB(e){const t=_o(),n=T.useRef(!1);T.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const BB=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function zB(e){const t=De(BB),n=Je();return T.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function VB(e){return e.connection.inProgress?{...e.connection,to:_l(e.connection.to,e.transform)}:{...e.connection}}function UB(e){return VB}function HB(e){const t=UB();return De(t,Qe)}const WB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function KB({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:a,isValid:c,inProgress:u}=De(WB,Qe);return!(o&&s&&u)?null:h.jsx("svg",{style:e,width:o,height:a,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:gt(["react-flow__connection",UA(c)]),children:h.jsx(KR,{style:t,type:n,CustomComponent:r,isValid:c})})})}const KR=({style:e,type:t=ms.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:a,fromHandle:c,fromPosition:u,to:d,toNode:p,toHandle:m,toPosition:g,pointer:v}=HB();if(!s)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:o.x,fromY:o.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:UA(r),toNode:p,toHandle:m,pointer:v});let b="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case ms.Bezier:[b]=nR(x);break;case ms.SimpleBezier:[b]=OR(x);break;case ms.Step:[b]=Ax({...x,borderRadius:0});break;case ms.SmoothStep:[b]=Ax(x);break;default:[b]=iR(x)}return h.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};KR.displayName="ConnectionLine";const GB={};function Ck(e=GB){T.useRef(e),Je(),T.useEffect(()=>{},[e])}function YB(){Je(),T.useRef(!1),T.useEffect(()=>{},[])}function GR({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:p,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:w,connectionLineContainerStyle:S,selectionKeyCode:C,selectionOnDrag:k,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:A,zoomActivationKeyCode:R,deleteKeyCode:O,onlyRenderVisibleElements:L,elementsSelectable:B,defaultViewport:M,translateExtent:$,minZoom:U,maxZoom:D,preventScrolling:V,defaultMarkerColor:z,zoomOnScroll:Q,zoomOnPinch:F,panOnScroll:q,panOnScrollSpeed:G,panOnScrollMode:P,zoomOnDoubleClick:W,panOnDrag:oe,onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:te,onPaneMouseLeave:Y,onPaneScroll:ee,onPaneContextMenu:ie,paneClickDistance:ue,nodeClickDistance:me,onEdgeContextMenu:ye,onEdgeMouseEnter:pe,onEdgeMouseMove:_e,onEdgeMouseLeave:xe,reconnectRadius:Ce,onReconnect:Ne,onReconnectStart:tt,onReconnectEnd:Le,noDragClassName:vt,noWheelClassName:xt,noPanClassName:it,disableKeyboardA11y:We,nodeExtent:It,rfId:Mt,viewport:Vt,onViewportChange:Ie}){return Ck(e),Ck(t),YB(),FB(n),zB(Vt),h.jsx(uB,{onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:te,onPaneMouseLeave:Y,onPaneContextMenu:ie,onPaneScroll:ee,paneClickDistance:ue,deleteKeyCode:O,selectionKeyCode:C,selectionOnDrag:k,selectionMode:N,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:j,panActivationKeyCode:A,zoomActivationKeyCode:R,elementsSelectable:B,zoomOnScroll:Q,zoomOnPinch:F,zoomOnDoubleClick:W,panOnScroll:q,panOnScrollSpeed:G,panOnScrollMode:P,panOnDrag:oe,defaultViewport:M,translateExtent:$,minZoom:U,maxZoom:D,onSelectionContextMenu:m,preventScrolling:V,noDragClassName:vt,noWheelClassName:xt,noPanClassName:it,disableKeyboardA11y:We,onViewportChange:Ie,isControlledViewport:!!Vt,children:h.jsxs(qB,{children:[h.jsx(DB,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Ne,onReconnectStart:tt,onReconnectEnd:Le,onlyRenderVisibleElements:L,onEdgeContextMenu:ye,onEdgeMouseEnter:pe,onEdgeMouseMove:_e,onEdgeMouseLeave:xe,reconnectRadius:Ce,defaultMarkerColor:z,noPanClassName:it,disableKeyboardA11y:We,rfId:Mt}),h.jsx(KB,{style:x,type:b,component:w,containerStyle:S}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(xB,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:p,nodeClickDistance:me,onlyRenderVisibleElements:L,noPanClassName:it,noDragClassName:vt,disableKeyboardA11y:We,nodeExtent:It,rfId:Mt}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}GR.displayName="GraphView";const XB=T.memo(GR),Ek=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u=.5,maxZoom:d=2,nodeOrigin:p,nodeExtent:m,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,x=new Map,w=new Map,S=r??t??[],C=n??e??[],k=p??[0,0],N=m??nl;lR(x,w,S);const j=Ix(C,v,b,{nodeOrigin:k,nodeExtent:N,zIndexMode:g});let A=[0,0,1];if(a&&s&&o){const R=bl(v,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:O,y:L,zoom:B}=vw(R,s,o,u,d,(c==null?void 0:c.padding)??.1);A=[O,L,B]}return{rfId:"1",width:s??0,height:o??0,transform:A,nodes:C,nodesInitialized:j,nodeLookup:v,parentLookup:b,edges:S,edgeLookup:w,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:nl,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ho.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:c,fitViewResolver:null,connection:{...VA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:dq,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:zA,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},QB=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:p,nodeExtent:m,zIndexMode:g})=>pF((v,b)=>{async function x(){const{nodeLookup:w,panZoom:S,fitViewOptions:C,fitViewResolver:k,width:N,height:j,minZoom:A,maxZoom:R}=b();S&&(await cq({nodes:w,width:N,height:j,panZoom:S,minZoom:A,maxZoom:R},C),k==null||k.resolve(!0),v({fitViewResolver:null}))}return{...Ek({nodes:e,edges:t,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:p,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:w=>{const{nodeLookup:S,parentLookup:C,nodeOrigin:k,elevateNodesOnSelect:N,fitViewQueued:j,zIndexMode:A}=b(),R=Ix(w,S,C,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:A});j&&R?(x(),v({nodes:w,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:w,nodesInitialized:R})},setEdges:w=>{const{connectionLookup:S,edgeLookup:C}=b();lR(S,C,w),v({edges:w})},setDefaultNodesAndEdges:(w,S)=>{if(w){const{setNodes:C}=b();C(w),v({hasDefaultNodes:!0})}if(S){const{setEdges:C}=b();C(S),v({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:S,nodeLookup:C,parentLookup:k,domNode:N,nodeOrigin:j,nodeExtent:A,debug:R,fitViewQueued:O,zIndexMode:L}=b(),{changes:B,updatedInternals:M}=Iq(w,C,k,N,j,A,L);M&&(jq(C,k,{nodeOrigin:j,nodeExtent:A,zIndexMode:L}),O?(x(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(R&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(w,S=!1)=>{const C=[];let k=[];const{nodeLookup:N,triggerNodeChanges:j,connection:A,updateConnection:R,onNodesChangeMiddlewareMap:O}=b();for(const[L,B]of w){const M=N.get(L),$=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(B!=null&&B.position)),U={id:L,type:"position",position:$?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(M&&A.inProgress&&A.fromNode.id===M.id){const D=Zs(M,A.fromHandle,he.Left,!0);R({...A,from:D})}$&&M.parentId&&C.push({id:L,parentId:M.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),k.push(U)}if(C.length>0){const{parentLookup:L,nodeOrigin:B}=b(),M=kw(C,N,L,B);k.push(...M)}for(const L of O.values())k=L(k);j(k)},triggerNodeChanges:w=>{const{onNodesChange:S,setNodes:C,nodes:k,hasDefaultNodes:N,debug:j}=b();if(w!=null&&w.length){if(N){const A=_R(w,k);C(A)}j&&console.log("React Flow: trigger node changes",w),S==null||S(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:S,setEdges:C,edges:k,hasDefaultEdges:N,debug:j}=b();if(w!=null&&w.length){if(N){const A=kR(w,k);C(A)}j&&console.log("React Flow: trigger edge changes",w),S==null||S(w)}},addSelectedNodes:w=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:k,triggerNodeChanges:N,triggerEdgeChanges:j}=b();if(S){const A=w.map(R=>Vs(R,!0));N(A);return}N(Ji(k,new Set([...w]),!0)),j(Ji(C))},addSelectedEdges:w=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:k,triggerNodeChanges:N,triggerEdgeChanges:j}=b();if(S){const A=w.map(R=>Vs(R,!0));j(A);return}j(Ji(C,new Set([...w]))),N(Ji(k,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:S}={})=>{const{edges:C,nodes:k,nodeLookup:N,triggerNodeChanges:j,triggerEdgeChanges:A}=b(),R=w||k,O=S||C,L=R.map(M=>{const $=N.get(M.id);return $&&($.selected=!1),Vs(M.id,!1)}),B=O.map(M=>Vs(M.id,!1));j(L),A(B)},setMinZoom:w=>{const{panZoom:S,maxZoom:C}=b();S==null||S.setScaleExtent([w,C]),v({minZoom:w})},setMaxZoom:w=>{const{panZoom:S,minZoom:C}=b();S==null||S.setScaleExtent([C,w]),v({maxZoom:w})},setTranslateExtent:w=>{var S;(S=b().panZoom)==null||S.setTranslateExtent(w),v({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:S,triggerNodeChanges:C,triggerEdgeChanges:k,elementsSelectable:N}=b();if(!N)return;const j=S.reduce((R,O)=>O.selected?[...R,Vs(O.id,!1)]:R,[]),A=w.reduce((R,O)=>O.selected?[...R,Vs(O.id,!1)]:R,[]);C(j),k(A)},setNodeExtent:w=>{const{nodes:S,nodeLookup:C,parentLookup:k,nodeOrigin:N,elevateNodesOnSelect:j,nodeExtent:A,zIndexMode:R}=b();w[0][0]===A[0][0]&&w[0][1]===A[0][1]&&w[1][0]===A[1][0]&&w[1][1]===A[1][1]||(Ix(S,C,k,{nodeOrigin:N,nodeExtent:w,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:R}),v({nodeExtent:w}))},panBy:w=>{const{transform:S,width:C,height:k,panZoom:N,translateExtent:j}=b();return Mq({delta:w,panZoom:N,transform:S,translateExtent:j,width:C,height:k})},setCenter:async(w,S,C)=>{const{width:k,height:N,maxZoom:j,panZoom:A}=b();if(!A)return Promise.resolve(!1);const R=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:j;return await A.setViewport({x:k/2-w*R,y:N/2-S*R,zoom:R},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...VA}})},updateConnection:w=>{v({connection:w})},reset:()=>v({...Ek()})}},Object.is);function YR({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:p,nodeExtent:m,zIndexMode:g,children:v}){const[b]=T.useState(()=>QB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:d,minZoom:a,maxZoom:c,fitViewOptions:u,nodeOrigin:p,nodeExtent:m,zIndexMode:g}));return h.jsx(gF,{value:b,children:h.jsx(qF,{children:v})})}function JB({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:v}){return T.useContext(Ad)?h.jsx(h.Fragment,{children:e}):h.jsx(YR,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:a,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:v,children:e})}const ZB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ez({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:a,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:p,onMoveStart:m,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:S,onNodeMouseEnter:C,onNodeMouseMove:k,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:A,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:L,onNodesDelete:B,onEdgesDelete:M,onDelete:$,onSelectionChange:U,onSelectionDragStart:D,onSelectionDrag:V,onSelectionDragStop:z,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:q,onBeforeDelete:G,connectionMode:P,connectionLineType:W=ms.Bezier,connectionLineStyle:oe,connectionLineComponent:K,connectionLineContainerStyle:J,deleteKeyCode:te="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:ee=!1,selectionMode:ie=rl.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:me=il()?"Meta":"Control",zoomActivationKeyCode:ye=il()?"Meta":"Control",snapToGrid:pe,snapGrid:_e,onlyRenderVisibleElements:xe=!1,selectNodesOnDrag:Ce,nodesDraggable:Ne,autoPanOnNodeFocus:tt,nodesConnectable:Le,nodesFocusable:vt,nodeOrigin:xt=bR,edgesFocusable:it,edgesReconnectable:We,elementsSelectable:It=!0,defaultViewport:Mt=TF,minZoom:Vt=.5,maxZoom:Ie=2,translateExtent:be=nl,preventScrolling:ot=!0,nodeExtent:Ve,defaultMarkerColor:Ut="#b1b1b7",zoomOnScroll:hn=!0,zoomOnPinch:Ot=!0,panOnScroll:Pt=!1,panOnScrollSpeed:hi=.5,panOnScrollMode:Lt=Ys.Free,zoomOnDoubleClick:tn=!0,panOnDrag:$o=!0,onPaneClick:qo,onPaneMouseEnter:Fo,onPaneMouseMove:Br,onPaneMouseLeave:zr,onPaneScroll:Ul,onPaneContextMenu:Hl,paneClickDistance:Wl=1,nodeClickDistance:Kl=0,children:Gl,onReconnect:Bo,onReconnectStart:Yl,onReconnectEnd:Cs,onEdgeContextMenu:zo,onEdgeDoubleClick:Es,onEdgeMouseEnter:_f,onEdgeMouseMove:js,onEdgeMouseLeave:pi,reconnectRadius:mi=10,onNodesChange:Vo,onEdgesChange:kf,noDragClassName:Nf="nodrag",noWheelClassName:Cf="nowheel",noPanClassName:Yn="nopan",fitView:Uo,fitViewOptions:Ho,connectOnClick:Ef,attributionPosition:Xl,proOptions:Ql,defaultEdgeOptions:Jl,elevateNodesOnSelect:Zl=!0,elevateEdgesOnSelect:jf=!1,disableKeyboardA11y:ec=!1,autoPanOnConnect:nt,autoPanOnNodeDrag:Tf,autoPanSpeed:Wo,connectionRadius:tc,isValidConnection:gi,onError:Af,style:nc,id:Ts,nodeDragThreshold:pn,connectionDragThreshold:Rf,viewport:nn,onViewportChange:If,width:Mf,height:Of,colorMode:yi="light",debug:vi,onScroll:Xn,ariaLabelConfig:xi,zIndexMode:rc="basic",...Pf},Ko){const wi=Ts||"1",Go=MF(yi),As=T.useCallback(sc=>{sc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Xn==null||Xn(sc)},[Xn]);return h.jsx("div",{"data-testid":"rf__wrapper",...Pf,onScroll:As,style:{...nc,...ZB},ref:Ko,className:gt(["react-flow",s,Go]),id:Ts,role:"application",children:h.jsxs(JB,{nodes:e,edges:t,width:Mf,height:Of,fitView:Uo,fitViewOptions:Ho,minZoom:Vt,maxZoom:Ie,nodeOrigin:xt,nodeExtent:Ve,zIndexMode:rc,children:[h.jsx(XB,{onInit:d,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:C,onNodeMouseMove:k,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:a,connectionLineType:W,connectionLineStyle:oe,connectionLineComponent:K,connectionLineContainerStyle:J,selectionKeyCode:Y,selectionOnDrag:ee,selectionMode:ie,deleteKeyCode:te,multiSelectionKeyCode:me,panActivationKeyCode:ue,zoomActivationKeyCode:ye,onlyRenderVisibleElements:xe,defaultViewport:Mt,translateExtent:be,minZoom:Vt,maxZoom:Ie,preventScrolling:ot,zoomOnScroll:hn,zoomOnPinch:Ot,zoomOnDoubleClick:tn,panOnScroll:Pt,panOnScrollSpeed:hi,panOnScrollMode:Lt,panOnDrag:$o,onPaneClick:qo,onPaneMouseEnter:Fo,onPaneMouseMove:Br,onPaneMouseLeave:zr,onPaneScroll:Ul,onPaneContextMenu:Hl,paneClickDistance:Wl,nodeClickDistance:Kl,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:q,onReconnect:Bo,onReconnectStart:Yl,onReconnectEnd:Cs,onEdgeContextMenu:zo,onEdgeDoubleClick:Es,onEdgeMouseEnter:_f,onEdgeMouseMove:js,onEdgeMouseLeave:pi,reconnectRadius:mi,defaultMarkerColor:Ut,noDragClassName:Nf,noWheelClassName:Cf,noPanClassName:Yn,rfId:wi,disableKeyboardA11y:ec,nodeExtent:Ve,viewport:nn,onViewportChange:If}),h.jsx(IF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:S,nodesDraggable:Ne,autoPanOnNodeFocus:tt,nodesConnectable:Le,nodesFocusable:vt,edgesFocusable:it,edgesReconnectable:We,elementsSelectable:It,elevateNodesOnSelect:Zl,elevateEdgesOnSelect:jf,minZoom:Vt,maxZoom:Ie,nodeExtent:Ve,onNodesChange:Vo,onEdgesChange:kf,snapToGrid:pe,snapGrid:_e,connectionMode:P,translateExtent:be,connectOnClick:Ef,defaultEdgeOptions:Jl,fitView:Uo,fitViewOptions:Ho,onNodesDelete:B,onEdgesDelete:M,onDelete:$,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:L,onSelectionDrag:V,onSelectionDragStart:D,onSelectionDragStop:z,onMove:p,onMoveStart:m,onMoveEnd:g,noPanClassName:Yn,nodeOrigin:xt,rfId:wi,autoPanOnConnect:nt,autoPanOnNodeDrag:Tf,autoPanSpeed:Wo,onError:Af,connectionRadius:tc,isValidConnection:gi,selectNodesOnDrag:Ce,nodeDragThreshold:pn,connectionDragThreshold:Rf,onBeforeDelete:G,debug:vi,ariaLabelConfig:xi,zIndexMode:rc}),h.jsx(jF,{onSelectionChange:U}),Gl,h.jsx(_F,{proOptions:Ql,position:Xl}),h.jsx(SF,{rfId:wi,disableKeyboardA11y:ec})]})})}var tz=NR(ez);function nz({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:gt(["react-flow__background-pattern",n,r])})}function rz({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:gt(["react-flow__background-pattern","dots",t])})}var Ar;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ar||(Ar={}));const sz={[Ar.Dots]:1,[Ar.Lines]:1,[Ar.Cross]:6},iz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function XR({id:e,variant:t=Ar.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:a,bgColor:c,style:u,className:d,patternClassName:p}){const m=T.useRef(null),{transform:g,patternId:v}=De(iz,Qe),b=r||sz[t],x=t===Ar.Dots,w=t===Ar.Cross,S=Array.isArray(n)?n:[n,n],C=[S[0]*g[2]||1,S[1]*g[2]||1],k=b*g[2],N=Array.isArray(o)?o:[o,o],j=w?[k,k]:C,A=[N[0]*g[2]||1+j[0]/2,N[1]*g[2]||1+j[1]/2],R=`${v}${e||""}`;return h.jsxs("svg",{className:gt(["react-flow__background",d]),style:{...u,...Id,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:m,"data-testid":"rf__background",children:[h.jsx("pattern",{id:R,x:g[0]%C[0],y:g[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:x?h.jsx(rz,{radius:k/2,className:p}):h.jsx(nz,{dimensions:j,lineWidth:s,variant:t,className:p})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}XR.displayName="Background";const oz=T.memo(XR);function az(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function lz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function cz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function uz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function dz(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function mu({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:gt(["react-flow__controls-button",t]),...n,children:e})}const fz=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function QR({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:a,onFitView:c,onInteractiveChange:u,className:d,children:p,position:m="bottom-left",orientation:g="vertical","aria-label":v}){const b=Je(),{isInteractive:x,minZoomReached:w,maxZoomReached:S,ariaLabelConfig:C}=De(fz,Qe),{zoomIn:k,zoomOut:N,fitView:j}=_o(),A=()=>{k(),o==null||o()},R=()=>{N(),a==null||a()},O=()=>{j(s),c==null||c()},L=()=>{b.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)},B=g==="horizontal"?"horizontal":"vertical";return h.jsxs(Rd,{className:gt(["react-flow__controls",B,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(mu,{onClick:A,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:S,children:h.jsx(az,{})}),h.jsx(mu,{onClick:R,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:w,children:h.jsx(lz,{})})]}),n&&h.jsx(mu,{className:"react-flow__controls-fitview",onClick:O,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:h.jsx(cz,{})}),r&&h.jsx(mu,{className:"react-flow__controls-interactive",onClick:L,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:x?h.jsx(dz,{}):h.jsx(uz,{})}),p]})}QR.displayName="Controls";const hz=T.memo(QR);function pz({id:e,x:t,y:n,width:r,height:s,style:o,color:a,strokeColor:c,strokeWidth:u,className:d,borderRadius:p,shapeRendering:m,selected:g,onClick:v}){const{background:b,backgroundColor:x}=o||{},w=a||b||x;return h.jsx("rect",{className:gt(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:p,ry:p,width:r,height:s,style:{fill:w,stroke:c,strokeWidth:u},shapeRendering:m,onClick:v?S=>v(S,e):void 0})}const mz=T.memo(pz),gz=e=>e.nodes.map(t=>t.id),Ap=e=>e instanceof Function?e:()=>e;function yz({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=mz,onClick:a}){const c=De(gz,Qe),u=Ap(t),d=Ap(e),p=Ap(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:c.map(g=>h.jsx(xz,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:a,shapeRendering:m},g))})}function vz({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:a,NodeComponent:c,onClick:u}){const{node:d,x:p,y:m,width:g,height:v}=De(b=>{const{internals:x}=b.nodeLookup.get(e),w=x.userNode,{x:S,y:C}=x.positionAbsolute,{width:k,height:N}=Lr(w);return{node:w,x:S,y:C,width:k,height:N}},Qe);return!d||d.hidden||!XA(d)?null:h.jsx(c,{x:p,y:m,width:g,height:v,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:o,shapeRendering:a,onClick:u,id:d.id})}const xz=T.memo(vz);var wz=T.memo(yz);const bz=200,Sz=150,_z=e=>!e.hidden,kz=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?YA(bl(e.nodeLookup,{filter:_z}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Nz="react-flow__minimap-desc";function JR({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:u,maskColor:d,maskStrokeColor:p,maskStrokeWidth:m,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:x=!1,zoomable:w=!1,ariaLabel:S,inversePan:C,zoomStep:k=1,offsetScale:N=5}){const j=Je(),A=T.useRef(null),{boundingRect:R,viewBB:O,rfId:L,panZoom:B,translateExtent:M,flowWidth:$,flowHeight:U,ariaLabelConfig:D}=De(kz,Qe),V=(e==null?void 0:e.width)??bz,z=(e==null?void 0:e.height)??Sz,Q=R.width/V,F=R.height/z,q=Math.max(Q,F),G=q*V,P=q*z,W=N*q,oe=R.x-(G-R.width)/2-W,K=R.y-(P-R.height)/2-W,J=G+W*2,te=P+W*2,Y=`${Nz}-${L}`,ee=T.useRef(0),ie=T.useRef();ee.current=q,T.useEffect(()=>{if(A.current&&B)return ie.current=zq({domNode:A.current,panZoom:B,getTransform:()=>j.getState().transform,getViewScale:()=>ee.current}),()=>{var pe;(pe=ie.current)==null||pe.destroy()}},[B]),T.useEffect(()=>{var pe;(pe=ie.current)==null||pe.update({translateExtent:M,width:$,height:U,inversePan:C,pannable:x,zoomStep:k,zoomable:w})},[x,w,C,k,M,$,U]);const ue=v?pe=>{var Ce;const[_e,xe]=((Ce=ie.current)==null?void 0:Ce.pointer(pe))||[0,0];v(pe,{x:_e,y:xe})}:void 0,me=b?T.useCallback((pe,_e)=>{const xe=j.getState().nodeLookup.get(_e).internals.userNode;b(pe,xe)},[]):void 0,ye=S??D["minimap.ariaLabel"];return h.jsx(Rd,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*q:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:gt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:V,height:z,viewBox:`${oe} ${K} ${J} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:A,onClick:ue,children:[ye&&h.jsx("title",{id:Y,children:ye}),h.jsx(wz,{onClick:me,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${oe-W},${K-W}h${J+W*2}v${te+W*2}h${-J-W*2}z
|
|
62
|
+
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}JR.displayName="MiniMap";const Cz=T.memo(JR),Ez=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,jz={[yo.Line]:"right",[yo.Handle]:"bottom-right"};function Tz({nodeId:e,position:t,variant:n=yo.Handle,className:r,style:s=void 0,children:o,color:a,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:x,onResize:w,onResizeEnd:S}){const C=TR(),k=typeof e=="string"?e:C,N=Je(),j=T.useRef(null),A=n===yo.Handle,R=De(T.useCallback(Ez(A&&v),[A,v]),Qe),O=T.useRef(null),L=t??jz[n];T.useEffect(()=>{if(!(!j.current||!k))return O.current||(O.current=nF({domNode:j.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:M,transform:$,snapGrid:U,snapToGrid:D,nodeOrigin:V,domNode:z}=N.getState();return{nodeLookup:M,transform:$,snapGrid:U,snapToGrid:D,nodeOrigin:V,paneDomNode:z}},onChange:(M,$)=>{const{triggerNodeChanges:U,nodeLookup:D,parentLookup:V,nodeOrigin:z}=N.getState(),Q=[],F={x:M.x,y:M.y},q=D.get(k);if(q&&q.expandParent&&q.parentId){const G=q.origin??z,P=M.width??q.measured.width??0,W=M.height??q.measured.height??0,oe={id:q.id,parentId:q.parentId,rect:{width:P,height:W,...QA({x:M.x??q.position.x,y:M.y??q.position.y},{width:P,height:W},q.parentId,D,G)}},K=kw([oe],D,V,z);Q.push(...K),F.x=M.x?Math.max(G[0]*P,M.x):void 0,F.y=M.y?Math.max(G[1]*W,M.y):void 0}if(F.x!==void 0&&F.y!==void 0){const G={id:k,type:"position",position:{...F}};Q.push(G)}if(M.width!==void 0&&M.height!==void 0){const P={id:k,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};Q.push(P)}for(const G of $){const P={...G,type:"position"};Q.push(P)}U(Q)},onEnd:({width:M,height:$})=>{const U={id:k,type:"dimensions",resizing:!1,dimensions:{width:M,height:$}};N.getState().triggerNodeChanges([U])}})),O.current.update({controlPosition:L,boundaries:{minWidth:c,minHeight:u,maxWidth:d,maxHeight:p},keepAspectRatio:m,resizeDirection:g,onResizeStart:x,onResize:w,onResizeEnd:S,shouldResize:b}),()=>{var M;(M=O.current)==null||M.destroy()}},[L,c,u,d,p,m,x,w,S,b]);const B=L.split("-");return h.jsx("div",{className:gt(["react-flow__resize-control","nodrag",...B,n,r]),ref:j,style:{...s,scale:R,...a&&{[A?"backgroundColor":"borderColor"]:a}},children:o})}T.memo(Tz);/**
|
|
63
|
+
* @license lucide-react v0.468.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const Az=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ZR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
68
|
+
* @license lucide-react v0.468.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/var Rz={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"};/**
|
|
73
|
+
* @license lucide-react v0.468.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const Iz=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},u)=>T.createElement("svg",{ref:u,...Rz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ZR("lucide",s),...c},[...a.map(([d,p])=>T.createElement(d,p)),...Array.isArray(o)?o:[o]]));/**
|
|
78
|
+
* @license lucide-react v0.468.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const fe=(e,t)=>{const n=T.forwardRef(({className:r,...s},o)=>T.createElement(Iz,{ref:o,iconNode:t,className:ZR(`lucide-${Az(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
83
|
+
* @license lucide-react v0.468.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const Mz=fe("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
88
|
+
* @license lucide-react v0.468.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const Oz=fe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
93
|
+
* @license lucide-react v0.468.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const al=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
98
|
+
* @license lucide-react v0.468.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const Pz=fe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
103
|
+
* @license lucide-react v0.468.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const $u=fe("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"}]]);/**
|
|
108
|
+
* @license lucide-react v0.468.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const jk=fe("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
113
|
+
* @license lucide-react v0.468.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Px=fe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
118
|
+
* @license lucide-react v0.468.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const ei=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
123
|
+
* @license lucide-react v0.468.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const gs=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
128
|
+
* @license lucide-react v0.468.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const Lz=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
133
|
+
* @license lucide-react v0.468.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const Jt=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
138
|
+
* @license lucide-react v0.468.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const Dz=fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
143
|
+
* @license lucide-react v0.468.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const kl=fe("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"}]]);/**
|
|
148
|
+
* @license lucide-react v0.468.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const en=fe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
153
|
+
* @license lucide-react v0.468.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const $z=fe("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"}]]);/**
|
|
158
|
+
* @license lucide-react v0.468.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const lt=fe("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"}]]);/**
|
|
163
|
+
* @license lucide-react v0.468.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const Lx=fe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
168
|
+
* @license lucide-react v0.468.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const qz=fe("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"}]]);/**
|
|
173
|
+
* @license lucide-react v0.468.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const Hn=fe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
178
|
+
* @license lucide-react v0.468.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const Fz=fe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
183
|
+
* @license lucide-react v0.468.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const Ew=fe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
188
|
+
* @license lucide-react v0.468.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const vo=fe("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"}]]);/**
|
|
193
|
+
* @license lucide-react v0.468.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const Bz=fe("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
|
|
198
|
+
* @license lucide-react v0.468.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const zz=fe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
203
|
+
* @license lucide-react v0.468.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const Vz=fe("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"}]]);/**
|
|
208
|
+
* @license lucide-react v0.468.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Uz=fe("FileInput",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
|
|
213
|
+
* @license lucide-react v0.468.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const Hz=fe("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);/**
|
|
218
|
+
* @license lucide-react v0.468.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const od=fe("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"}]]);/**
|
|
223
|
+
* @license lucide-react v0.468.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const eI=fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
228
|
+
* @license lucide-react v0.468.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const Wz=fe("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
|
|
233
|
+
* @license lucide-react v0.468.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const ad=fe("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"}]]);/**
|
|
238
|
+
* @license lucide-react v0.468.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const tI=fe("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
|
|
243
|
+
* @license lucide-react v0.468.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const Dx=fe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
248
|
+
* @license lucide-react v0.468.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const Kz=fe("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
253
|
+
* @license lucide-react v0.468.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const Tk=fe("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
258
|
+
* @license lucide-react v0.468.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const Gz=fe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
263
|
+
* @license lucide-react v0.468.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const Ak=fe("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"}]]);/**
|
|
268
|
+
* @license lucide-react v0.468.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const Yz=fe("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
|
|
273
|
+
* @license lucide-react v0.468.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const jw=fe("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
278
|
+
* @license lucide-react v0.468.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const Xz=fe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
283
|
+
* @license lucide-react v0.468.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const Qz=fe("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
288
|
+
* @license lucide-react v0.468.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const Rk=fe("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:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
293
|
+
* @license lucide-react v0.468.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const ws=fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
298
|
+
* @license lucide-react v0.468.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const nI=fe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
303
|
+
* @license lucide-react v0.468.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const Ik=fe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
308
|
+
* @license lucide-react v0.468.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const Jz=fe("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
|
|
313
|
+
* @license lucide-react v0.468.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const Zz=fe("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"}]]);/**
|
|
318
|
+
* @license lucide-react v0.468.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const e6=fe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
323
|
+
* @license lucide-react v0.468.0 - ISC
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the ISC license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/const t6=fe("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"}]]);/**
|
|
328
|
+
* @license lucide-react v0.468.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const n6=fe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
333
|
+
* @license lucide-react v0.468.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/const r6=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
338
|
+
* @license lucide-react v0.468.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const s6=fe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
343
|
+
* @license lucide-react v0.468.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const i6=fe("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/**
|
|
348
|
+
* @license lucide-react v0.468.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const rI=fe("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"}]]);/**
|
|
353
|
+
* @license lucide-react v0.468.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/const o6=fe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
|
|
358
|
+
* @license lucide-react v0.468.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/const Nl=fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
363
|
+
* @license lucide-react v0.468.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the ISC license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/const Od=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
368
|
+
* @license lucide-react v0.468.0 - ISC
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the ISC license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/const a6=fe("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
|
|
373
|
+
* @license lucide-react v0.468.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const l6=fe("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"}]]);/**
|
|
378
|
+
* @license lucide-react v0.468.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const Mk=fe("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
|
|
383
|
+
* @license lucide-react v0.468.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const Ok=fe("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
388
|
+
* @license lucide-react v0.468.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const c6=fe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
393
|
+
* @license lucide-react v0.468.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const $x=fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
398
|
+
* @license lucide-react v0.468.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const sI=fe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
403
|
+
* @license lucide-react v0.468.0 - ISC
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the ISC license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/const Pd=fe("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"}]]);/**
|
|
408
|
+
* @license lucide-react v0.468.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/const Pk=fe("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"}]]);/**
|
|
413
|
+
* @license lucide-react v0.468.0 - ISC
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the ISC license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/const u6=fe("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
|
|
418
|
+
* @license lucide-react v0.468.0 - ISC
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the ISC license.
|
|
421
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
+
*/const iI=fe("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
423
|
+
* @license lucide-react v0.468.0 - ISC
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the ISC license.
|
|
426
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/const d6=fe("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"}]]);/**
|
|
428
|
+
* @license lucide-react v0.468.0 - ISC
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the ISC license.
|
|
431
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/const f6=fe("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
433
|
+
* @license lucide-react v0.468.0 - ISC
|
|
434
|
+
*
|
|
435
|
+
* This source code is licensed under the ISC license.
|
|
436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
+
*/const h6=fe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
438
|
+
* @license lucide-react v0.468.0 - ISC
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the ISC license.
|
|
441
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
+
*/const oI=fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
443
|
+
* @license lucide-react v0.468.0 - ISC
|
|
444
|
+
*
|
|
445
|
+
* This source code is licensed under the ISC license.
|
|
446
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
+
*/const p6=fe("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"}]]);/**
|
|
448
|
+
* @license lucide-react v0.468.0 - ISC
|
|
449
|
+
*
|
|
450
|
+
* This source code is licensed under the ISC license.
|
|
451
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
+
*/const ko=fe("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"}]]);/**
|
|
453
|
+
* @license lucide-react v0.468.0 - ISC
|
|
454
|
+
*
|
|
455
|
+
* This source code is licensed under the ISC license.
|
|
456
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
+
*/const Lk=fe("Trello",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["rect",{width:"3",height:"9",x:"7",y:"7",key:"14n3xi"}],["rect",{width:"3",height:"5",x:"14",y:"7",key:"s4azjd"}]]);/**
|
|
458
|
+
* @license lucide-react v0.468.0 - ISC
|
|
459
|
+
*
|
|
460
|
+
* This source code is licensed under the ISC license.
|
|
461
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
462
|
+
*/const Ld=fe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
463
|
+
* @license lucide-react v0.468.0 - ISC
|
|
464
|
+
*
|
|
465
|
+
* This source code is licensed under the ISC license.
|
|
466
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
467
|
+
*/const m6=fe("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
|
|
468
|
+
* @license lucide-react v0.468.0 - ISC
|
|
469
|
+
*
|
|
470
|
+
* This source code is licensed under the ISC license.
|
|
471
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
472
|
+
*/const aI=fe("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"}]]);/**
|
|
473
|
+
* @license lucide-react v0.468.0 - ISC
|
|
474
|
+
*
|
|
475
|
+
* This source code is licensed under the ISC license.
|
|
476
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
477
|
+
*/const g6=fe("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"}]]);/**
|
|
478
|
+
* @license lucide-react v0.468.0 - ISC
|
|
479
|
+
*
|
|
480
|
+
* This source code is licensed under the ISC license.
|
|
481
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
482
|
+
*/const Dd=fe("Variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]);/**
|
|
483
|
+
* @license lucide-react v0.468.0 - ISC
|
|
484
|
+
*
|
|
485
|
+
* This source code is licensed under the ISC license.
|
|
486
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
487
|
+
*/const y6=fe("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
|
|
488
|
+
* @license lucide-react v0.468.0 - ISC
|
|
489
|
+
*
|
|
490
|
+
* This source code is licensed under the ISC license.
|
|
491
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
492
|
+
*/const Cl=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
493
|
+
* @license lucide-react v0.468.0 - ISC
|
|
494
|
+
*
|
|
495
|
+
* This source code is licensed under the ISC license.
|
|
496
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
497
|
+
*/const ld=fe("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"}]]);/**
|
|
498
|
+
* @license lucide-react v0.468.0 - ISC
|
|
499
|
+
*
|
|
500
|
+
* This source code is licensed under the ISC license.
|
|
501
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
502
|
+
*/const v6=fe("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
|
|
503
|
+
* @license lucide-react v0.468.0 - ISC
|
|
504
|
+
*
|
|
505
|
+
* This source code is licensed under the ISC license.
|
|
506
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
507
|
+
*/const x6=fe("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Dk=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const g=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,g))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,s,c);return c},w6=(e=>e?Dk(e):Dk),b6=e=>e;function S6(e,t=b6){const n=pt.useSyncExternalStore(e.subscribe,pt.useCallback(()=>t(e.getState()),[e,t]),pt.useCallback(()=>t(e.getInitialState()),[e,t]));return pt.useDebugValue(n),n}const $k=e=>{const t=w6(e),n=r=>S6(t,r);return Object.assign(n,t),n},Dr=(e=>e?$k(e):$k),_6=[{id:"trigger",type:"step",position:{x:250,y:0},data:{id:"trigger",name:"PR Opened",action:"github.webhook",status:"completed"}},{id:"fetch_pr",type:"step",position:{x:250,y:120},data:{id:"fetch_pr",name:"Fetch PR Details",action:"github.pulls.get",status:"completed"}},{id:"get_files",type:"step",position:{x:250,y:240},data:{id:"get_files",name:"Get Changed Files",action:"github.pulls.listFiles",status:"running"}},{id:"analyze",type:"step",position:{x:250,y:360},data:{id:"analyze",name:"Analyze Changes",action:"claude.analyze",status:"pending"}},{id:"post_review",type:"step",position:{x:250,y:480},data:{id:"post_review",name:"Post Review",action:"github.pulls.createReview",status:"pending"}}],k6=[{id:"e1",source:"trigger",target:"fetch_pr",animated:!0},{id:"e2",source:"fetch_pr",target:"get_files",animated:!0},{id:"e3",source:"get_files",target:"analyze"},{id:"e4",source:"analyze",target:"post_review"}],xo=Dr((e,t)=>({nodes:_6,edges:k6,past:[],future:[],maxHistorySize:50,clipboard:null,onNodesChange:n=>{n.some(s=>s.type!=="position"&&s.type!=="select"&&s.type!=="dimensions")&&t().saveCheckpoint(),e({nodes:_R(n,t().nodes)})},onEdgesChange:n=>{n.some(s=>s.type!=="select")&&t().saveCheckpoint(),e({edges:kR(n,t().edges)})},onConnect:n=>{t().saveCheckpoint(),e({edges:sR({...n,animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},t().edges)})},setNodes:n=>{t().saveCheckpoint(),e({nodes:n,future:[]})},setEdges:n=>{t().saveCheckpoint(),e({edges:n,future:[]})},updateNodeData:(n,r)=>{t().saveCheckpoint(),e({nodes:t().nodes.map(s=>s.id===n?{...s,data:{...s.data,...r}}:s),future:[]})},clearCanvas:()=>{t().saveCheckpoint(),e({nodes:[],edges:[],future:[]})},saveCheckpoint:()=>{const{nodes:n,edges:r,past:s,maxHistorySize:o}=t();if(s.length>0){const u=s[s.length-1];if(JSON.stringify(u.nodes)===JSON.stringify(n)&&JSON.stringify(u.edges)===JSON.stringify(r))return}const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=[...s,a];c.length>o&&c.shift(),e({past:c})},undo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(s.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=s[s.length-1],u=s.slice(0,-1);e({nodes:c.nodes,edges:c.edges,past:u,future:[a,...o]})},redo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(o.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=o[0],u=o.slice(1);e({nodes:c.nodes,edges:c.edges,past:[...s,a],future:u})},canUndo:()=>t().past.length>0,canRedo:()=>t().future.length>0,copySelected:()=>{const{nodes:n}=t(),r=n.filter(u=>u.selected);if(r.length===0)return;const s=new Set(r.map(u=>u.id)),{edges:o}=t(),a=o.filter(u=>s.has(u.source)&&s.has(u.target)),c={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(a))};e({clipboard:c})},paste:(n={x:50,y:50})=>{const{clipboard:r,nodes:s,edges:o}=t();if(!r||r.nodes.length===0)return;t().saveCheckpoint();const a=new Map,c=Date.now().toString(36),u=r.nodes.map((m,g)=>{const v=`${m.id.split("-copy")[0]}-copy-${c}-${g}`;return a.set(m.id,v),{...m,id:v,position:{x:m.position.x+n.x,y:m.position.y+n.y},selected:!0,data:{...m.data,id:v}}}),d=r.edges.map((m,g)=>({...m,id:`${m.id.split("-copy")[0]}-copy-${c}-${g}`,source:a.get(m.source)||m.source,target:a.get(m.target)||m.target})),p=s.map(m=>({...m,selected:!1}));e({nodes:[...p,...u],edges:[...o,...d],future:[]})},canPaste:()=>{const{clipboard:n}=t();return n!==null&&n.nodes.length>0}})),qk=[{path:"examples/code-review/workflow.md",name:"Code Review"},{path:"examples/daily-standup/workflow.md",name:"Daily Standup"},{path:"examples/incident-response/workflow.md",name:"Incident Response"},{path:"examples/sprint-planning/workflow.md",name:"Sprint Planning"},{path:"examples/dependency-update/workflow.md",name:"Dependency Update"}],N6={metadata:{id:"code-review",name:"Code Review",version:"1.0.0",description:"Automatically review pull requests using Claude AI",author:"Marktoflow",tags:["github","ai","code-review"]},steps:[{id:"fetch_pr",name:"Fetch PR Details",action:"github.pulls.get",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}"},outputVariable:"pr_details"},{id:"get_files",name:"Get Changed Files",action:"github.pulls.listFiles",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}"},outputVariable:"changed_files"},{id:"analyze",name:"Analyze Changes",action:"claude.analyze",inputs:{prompt:"Review the following code changes",context:"{{ changed_files }}"},outputVariable:"analysis"},{id:"post_review",name:"Post Review",action:"github.pulls.createReview",inputs:{owner:"{{ inputs.repo.split('/')[0] }}",repo:"{{ inputs.repo.split('/')[1] }}",pull_number:"{{ inputs.pr_number }}",body:"{{ analysis.summary }}",event:"COMMENT"},outputVariable:"review_result"}]},Mr=Dr((e,t)=>({workflows:qk,selectedWorkflow:null,currentWorkflow:null,isLoading:!1,error:null,loadWorkflows:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/workflows");if(!n.ok)throw new Error("Failed to load workflows");const r=await n.json();console.log("Loaded workflows:",r.workflows.length),e({workflows:r.workflows,isLoading:!1})}catch(n){console.error("Failed to load workflows, using demo data:",n),e({workflows:qk,isLoading:!1})}},fetchWorkflows:async()=>{await t().loadWorkflows()},selectWorkflow:n=>{e({selectedWorkflow:n}),t().loadWorkflow(n)},loadWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch(`/api/workflows/${encodeURIComponent(n)}`);if(!r.ok)throw new Error("Failed to load workflow");const s=await r.json();e({currentWorkflow:s.workflow,isLoading:!1})}catch{e({currentWorkflow:N6,isLoading:!1})}},saveWorkflow:async n=>{const r=t().selectedWorkflow;if(r){e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(r)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow:n})})).ok)throw new Error("Failed to save workflow");e({currentWorkflow:n,isLoading:!1})}catch{e({error:"Failed to save workflow",isLoading:!1})}}},createWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!r.ok)throw new Error("Failed to create workflow");const s=await r.json(),o=[...t().workflows,s.workflow];e({workflows:o,selectedWorkflow:s.workflow.path,isLoading:!1}),t().loadWorkflow(s.workflow.path)}catch{e({error:"Failed to create workflow",isLoading:!1})}},deleteWorkflow:async n=>{var r;e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(n)}`,{method:"DELETE"})).ok)throw new Error("Failed to delete workflow");const o=t().workflows.filter(a=>a.path!==n);e({workflows:o,selectedWorkflow:((r=o[0])==null?void 0:r.path)||null,isLoading:!1})}catch{e({error:"Failed to delete workflow",isLoading:!1})}}})),C6=()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.platform.toUpperCase().includes("MAC"),El=()=>C6()?"⌘":"Ctrl",E6={slack:t6,github:Dx,jira:qz,gmail:Ik,outlook:Px,linear:Lk,notion:od,discord:e6,airtable:zz,confluence:od,http:Gz,claude:$u,opencode:$u,ollama:$u,webhook:ld,schedule:Px,trigger:ld,stripe:Bz,teams:g6,twilio:o6,sendgrid:sI,shopify:u6,zendesk:Yz,mailchimp:Ik,asana:f6,trello:Lk,dropbox:Fz,s3:Ak,"aws-s3":Ak};function qx(e){const t=e.toLowerCase().split(".")[0];return E6[t]||$z}function j6({data:e,selected:t}){var d,p;const n=((d=e.action)==null?void 0:d.split(".")[0])||"unknown",r=((p=e.action)==null?void 0:p.split(".").slice(1).join("."))||e.action,s=qx(n),o={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Nl,color:"text-warning",bgColor:"bg-warning/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:kl,color:"text-gray-500",bgColor:"bg-gray-500/10"}},a=e.status||"pending",c=o[a],u=c.icon;return h.jsxs("div",{className:`step-node p-0 ${t?"selected":""} ${a==="running"?"running":""} ${a==="completed"?"completed":""} ${a==="failed"?"failed":""}`,children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:h.jsx(s,{className:"w-5 h-5 text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),h.jsx("div",{className:"text-xs text-gray-400 truncate",children:n})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${c.bgColor} flex items-center justify-center`,children:h.jsx(u,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3",children:[h.jsx("div",{className:"text-xs text-gray-300 font-mono truncate",children:r}),e.retryCount&&e.retryCount>0&&h.jsxs("div",{className:"mt-2 text-xs text-warning",children:["Retry #",e.retryCount]}),e.error&&h.jsx("div",{className:"mt-2 text-xs text-error truncate",children:e.error})]}),h.jsx(Be,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const T6=T.memo(j6),Tw=Dr((e,t)=>({breadcrumbs:[],pushWorkflow:n=>{e({breadcrumbs:[...t().breadcrumbs,n]})},popToIndex:n=>{const{breadcrumbs:r}=t();n>=0&&n<r.length&&e({breadcrumbs:r.slice(0,n+1)})},popWorkflow:()=>{const{breadcrumbs:n}=t();n.length>1&&e({breadcrumbs:n.slice(0,-1)})},resetNavigation:()=>{e({breadcrumbs:[]})},setRootWorkflow:n=>{e({breadcrumbs:[n]})}}));function A6({data:e,selected:t}){const[n,r]=T.useState(!1),{pushWorkflow:s,breadcrumbs:o,setRootWorkflow:a}=Tw(),{loadWorkflow:c,selectedWorkflow:u,currentWorkflow:d}=Mr(),p=T.useCallback(()=>{var v;o.length===0&&u&&d&&a({id:u,name:((v=d.metadata)==null?void 0:v.name)||"Main Workflow",path:u}),s({id:e.id,name:e.name||e.id,path:e.workflowPath}),c(e.workflowPath)},[e,s,o,a,u,d,c]),m={pending:"border-node-border",running:"border-warning",completed:"border-success",failed:"border-error"},g=e.status||"pending";return h.jsxs("div",{className:`step-node p-0 min-w-[250px] ${t?"selected":""} ${m[g]}`,children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border bg-info/5",children:[h.jsx("button",{onClick:()=>r(!n),className:"w-6 h-6 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:n?h.jsx(gs,{className:"w-4 h-4 text-info"}):h.jsx(Jt,{className:"w-4 h-4 text-info"})}),h.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/10 flex items-center justify-center",children:h.jsx(ad,{className:"w-5 h-5 text-info"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),h.jsx("div",{className:"text-xs text-gray-400",children:"Sub-workflow"})]}),h.jsx("button",{onClick:p,className:"w-6 h-6 rounded flex items-center justify-center hover:bg-info/20 transition-colors",title:"Drill into sub-workflow",children:h.jsx(al,{className:"w-4 h-4 text-info"})})]}),h.jsxs("div",{className:"p-3",children:[h.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",children:e.workflowPath}),e.stepCount!==void 0&&h.jsx("div",{className:"mt-2 flex items-center gap-2",children:h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-info/10 text-info",children:[e.stepCount," steps"]})})]}),n&&h.jsx("div",{className:"border-t border-node-border p-3 bg-black/20",children:h.jsxs("button",{onClick:p,className:"w-full flex items-center justify-center gap-2 px-3 py-2 bg-info/10 hover:bg-info/20 rounded text-sm text-info transition-colors",children:[h.jsx(ad,{className:"w-4 h-4"}),"Open Sub-workflow",h.jsx(al,{className:"w-4 h-4"})]})}),h.jsx(Be,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"})]})}const R6=T.memo(A6),Fk={manual:{icon:Nl,color:"text-primary",bgColor:"bg-primary/10",borderColor:"border-primary",label:"Manual Trigger"},schedule:{icon:Px,color:"text-info",bgColor:"bg-info/10",borderColor:"border-info",label:"Schedule"},webhook:{icon:y6,color:"text-success",bgColor:"bg-success/10",borderColor:"border-success",label:"Webhook"},file:{icon:ad,color:"text-warning",bgColor:"bg-warning/10",borderColor:"border-warning",label:"File Watcher"},event:{icon:ld,color:"text-purple-400",bgColor:"bg-purple-400/10",borderColor:"border-purple-400",label:"Event"}};function I6({data:e,selected:t}){const n=Fk[e.type]||Fk.manual,r=n.icon,s=()=>{var o;switch(e.type){case"schedule":return e.cron||"No schedule set";case"webhook":return`${e.method||"POST"} ${e.path||"/webhook"}`;case"file":return e.pattern||"**/*";case"event":return((o=e.events)==null?void 0:o.join(", "))||"No events";default:return"Click to run"}};return h.jsxs("div",{className:`min-w-[180px] rounded-lg border-2 ${n.borderColor} ${n.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[h.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[h.jsx("div",{className:`w-8 h-8 rounded-full ${n.bgColor} flex items-center justify-center`,children:h.jsx(r,{className:`w-4 h-4 ${n.color}`})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:n.label}),h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Trigger"})]}),e.active!==!1&&h.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-pulse",title:"Active"})]}),h.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[h.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:s(),children:s()}),e.lastTriggered&&h.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Last: ",new Date(e.lastTriggered).toLocaleString()]})]}),h.jsx(Be,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"})]})}const M6=T.memo(I6);function O6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",borderColor:"border-gray-500",bgColor:"bg-gray-500/10"},completed:{icon:en,color:"text-success",borderColor:"border-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",borderColor:"border-error",bgColor:"bg-error/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`min-w-[160px] rounded-lg border-2 ${s.borderColor} ${s.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"}),h.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[h.jsx("div",{className:`w-8 h-8 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(Wz,{className:`w-4 h-4 ${s.color}`})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Output"}),h.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Workflow End"})]}),h.jsx(o,{className:`w-4 h-4 ${s.color}`})]}),e.variables&&e.variables.length>0&&h.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[h.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output Variables"}),h.jsx("div",{className:"flex flex-wrap gap-1",children:e.variables.map(a=>h.jsx("code",{className:"px-1.5 py-0.5 bg-white/5 text-primary text-xs rounded",children:a},a))})]}),e.description&&h.jsx("div",{className:"px-3 py-2 border-t border-white/10",children:h.jsx("div",{className:"text-xs text-gray-400",children:e.description})}),r==="completed"&&e.result!==void 0&&h.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[h.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Result"}),h.jsxs("pre",{className:"text-xs text-success font-mono bg-black/20 rounded p-1.5 overflow-x-auto max-h-20",children:[typeof e.result=="string"?e.result.slice(0,100):JSON.stringify(e.result,null,2).slice(0,100),(typeof e.result=="string"?e.result:JSON.stringify(e.result)).length>100&&"..."]})]})]})}const P6=T.memo(O6);function L6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Dx,color:"text-blue-400",bgColor:"bg-blue-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node if-else-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Dx,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"If/Else"}),h.jsx("div",{className:"text-xs text-white/70",children:"Conditional"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsx("div",{className:"text-xs text-white/90 font-mono mb-3",children:e.condition||"No condition set"}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="then"?"bg-green-500/30 text-green-200 ring-1 ring-green-400/50":e.skippedBranch==="then"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✓ Then",e.skippedBranch==="then"&&h.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]}),h.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="else"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":e.skippedBranch==="else"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✗ Else",e.skippedBranch==="else"&&h.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]})]})]}),h.jsx(Be,{type:"source",position:he.Bottom,id:"then",style:{left:"33%"},className:"!w-3 !h-3 !bg-green-500 !border-2 !border-node-bg"}),h.jsx(Be,{type:"source",position:he.Bottom,id:"else",style:{left:"67%"},className:"!w-3 !h-3 !bg-red-500 !border-2 !border-node-bg"})]})}const D6=T.memo(L6);function $6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Mk,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node for-each-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Mk,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"For Each"}),h.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[h.jsx("span",{className:"text-white/60",children:"Items:"})," ",h.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Variable:"})," ",h.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),e.earlyExit&&h.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[h.jsx(nI,{className:"w-4 h-4 text-orange-200"}),h.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":"Loop stopped on error"})]}),e.totalIterations!==void 0&&h.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs text-white/70",children:"Progress"}),h.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration||0," / ",e.totalIterations,e.earlyExit&&h.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),h.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-pink-400"}`,style:{width:`${(e.currentIteration||0)/e.totalIterations*100}%`}})})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsx("span",{children:"Access: loop.index, loop.first, loop.last"})]})]}),h.jsx(Be,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsx(Be,{id:"loop-back",type:"source",position:he.Left,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const q6=T.memo($6);function F6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Ok,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node while-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #fb923c 0%, #f97316 100%)"},children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Ok,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"While"}),h.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Condition:"})," ",h.jsx("span",{className:"font-mono",children:e.condition||"Not set"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Max Iterations:"})," ",h.jsx("span",{className:"font-medium",children:e.maxIterations||100})]}),e.earlyExit&&h.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[e.exitReason==="max_iterations"?h.jsx(Ld,{className:"w-4 h-4 text-orange-200"}):h.jsx(nI,{className:"w-4 h-4 text-orange-200"}),h.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":e.exitReason==="max_iterations"?"Max iterations reached":"Loop stopped on error"})]}),e.currentIteration!==void 0&&h.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs text-white/70",children:"Iterations"}),h.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration," / ",e.maxIterations||100,e.earlyExit&&h.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),h.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-orange-500"}`,style:{width:`${e.currentIteration/(e.maxIterations||100)*100}%`}})})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"⚠️"}),h.jsx("span",{children:"Exits when condition becomes false"})]})]}),h.jsx(Be,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsx(Be,{id:"loop-back",type:"source",position:he.Left,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const B6=T.memo(F6);function z6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Tk,color:"text-purple-400",bgColor:"bg-purple-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon,a=Object.keys(e.cases||{}),c=a.slice(0,4),u=a.length>4,d=Math.min(a.length,4)+(e.hasDefault?1:0),p=m=>d===1?50:(m+1)/(d+1)*100;return h.jsxs("div",{className:`control-flow-node switch-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #a855f7 0%, #ec4899 100%)"},children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Tk,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Switch"}),h.jsx("div",{className:"text-xs text-white/70",children:"Multi-Branch Router"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Expression:"})," ",h.jsx("span",{className:"font-mono",children:e.expression||"Not set"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("div",{className:"text-xs text-white/70 font-medium mb-1",children:"Cases:"}),c.map((m,g)=>{var x;const v=e.activeCase===m,b=(x=e.skippedBranches)==null?void 0:x.includes(m);return h.jsx("div",{className:"relative",children:h.jsxs("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors relative ${v?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":b?"bg-gray-500/20 text-gray-400 line-through":"bg-white/5 text-white/70"}`,children:[m,b&&h.jsx("span",{className:"ml-2 text-[8px] px-1 py-0.5 rounded bg-gray-500/30",children:"SKIPPED"})]})},m)}),u&&h.jsxs("div",{className:"text-xs px-2 py-1 rounded bg-white/5 text-white/60 text-center",children:["+",a.length-4," more cases"]}),e.hasDefault&&h.jsx("div",{className:"relative",children:h.jsx("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors ${e.activeCase==="default"?"bg-gray-500/30 text-gray-200 ring-1 ring-gray-400/50":"bg-white/5 text-white/70"}`,children:"default"})})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsxs("span",{children:[a.length," case",a.length!==1?"s":"",e.hasDefault?" + default":""]})]})]}),c.map((m,g)=>h.jsx(Be,{type:"source",position:he.Bottom,id:`case-${m}`,style:{left:`${p(g)}%`},className:"!w-2.5 !h-2.5 !bg-purple-400 !border-2 !border-node-bg"},`handle-${m}`)),e.hasDefault&&h.jsx(Be,{type:"source",position:he.Bottom,id:"case-default",style:{left:`${p(c.length)}%`},className:"!w-2.5 !h-2.5 !bg-gray-400 !border-2 !border-node-bg"})]})}const V6=T.memo(z6);function U6({data:e,selected:t}){var a,c;const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Rk,color:"text-green-400",bgColor:"bg-green-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node parallel-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)"},children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Rk,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Parallel"}),h.jsx("div",{className:"text-xs text-white/70",children:"Concurrent Execution"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[e.maxConcurrentExceeded&&h.jsxs("div",{className:"mb-3 p-2 bg-yellow-500/20 border border-yellow-500/30 rounded flex items-center gap-2",children:[h.jsx(Ld,{className:"w-4 h-4 text-yellow-200"}),h.jsx("span",{className:"text-xs text-yellow-200 font-medium",children:"Rate limiting active"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Branches:"})," ",h.jsx("span",{className:"font-medium",children:((a=e.branches)==null?void 0:a.length)||0}),e.maxConcurrent&&h.jsxs(h.Fragment,{children:[" ",h.jsx("span",{className:"text-white/60",children:"• Max Concurrent:"})," ",h.jsx("span",{className:`font-medium ${e.maxConcurrentExceeded?"text-yellow-300":""}`,children:e.maxConcurrent})]})]}),h.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(c=e.branches)==null?void 0:c.slice(0,6).map(u=>{var g,v,b;const d=(g=e.activeBranches)==null?void 0:g.includes(u.id),p=(v=e.completedBranches)==null?void 0:v.includes(u.id),m=(b=e.failedBranches)==null?void 0:b.includes(u.id);return h.jsx("div",{className:`px-2 py-1 rounded text-xs font-medium transition-colors ${m?"bg-red-500/30 text-red-200":p?"bg-green-500/30 text-green-200":d?"bg-blue-500/30 text-blue-200 animate-pulse":"bg-white/10 text-white/60"}`,title:u.name||u.id,children:u.name||`B${u.id.slice(-2)}`},u.id)}),e.branches&&e.branches.length>6&&h.jsxs("div",{className:"px-2 py-1 rounded text-xs font-medium bg-white/10 text-white/60",children:["+",e.branches.length-6]})]}),h.jsxs("div",{className:"text-xs text-white/50 flex items-center gap-1",children:[h.jsx("span",{children:"On Error:"}),h.jsx("span",{className:"font-medium",children:e.onError||"stop"})]})]}),h.jsx(Be,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const H6=T.memo(U6);function W6({data:e,selected:t}){const n={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Pk,color:"text-yellow-400",bgColor:"bg-yellow-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return h.jsxs("div",{className:`control-flow-node try-catch-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%)"},children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(Pk,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Try/Catch"}),h.jsx("div",{className:"text-xs text-white/70",children:"Error Handling"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:h.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[e.errorOccurred&&h.jsxs("div",{className:"mb-3 p-2 bg-red-500/20 border border-red-500/30 rounded flex items-center gap-2",children:[h.jsx(Ld,{className:"w-4 h-4 text-red-200"}),h.jsx("span",{className:"text-xs text-red-200 font-medium",children:"Error occurred"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="try"?"bg-blue-500/30 text-blue-200 ring-1 ring-blue-400/50":"bg-white/5 text-white/60"}`,children:"✓ Try"}),e.hasCatch&&h.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="catch"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":"bg-white/5 text-white/60"}`,children:"⚠ Catch"}),e.hasFinally&&h.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="finally"?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":"bg-white/5 text-white/60"}`,children:"⟳ Finally"})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsx("span",{children:"Finally always executes"})]})]}),h.jsx(Be,{type:"source",position:he.Bottom,id:"try",style:{left:"25%"},className:"!w-2.5 !h-2.5 !bg-blue-500 !border-2 !border-node-bg"}),e.hasCatch&&h.jsx(Be,{type:"source",position:he.Bottom,id:"catch",style:{left:"50%"},className:"!w-2.5 !h-2.5 !bg-red-500 !border-2 !border-node-bg"}),e.hasFinally&&h.jsx(Be,{type:"source",position:he.Bottom,id:"finally",style:{left:"75%"},className:"!w-2.5 !h-2.5 !bg-purple-500 !border-2 !border-node-bg"})]})}const K6=T.memo(W6);function G6({data:e,selected:t}){const n={map:{icon:al,label:"Map",color:"#14b8a6"},filter:{icon:eI,label:"Filter",color:"#10b981"},reduce:{icon:n6,label:"Reduce",color:"#06b6d4"}},r={pending:{icon:Hn,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:n[e.transformType].icon,color:"text-teal-400",bgColor:"bg-teal-400/10",animate:!0},completed:{icon:en,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},s=e.status||"pending",o=r[s],a=o.icon,c=n[e.transformType],u=c.icon,d=e.transformType==="filter"?e.condition:e.transformType==="reduce"?`${e.accumulatorVariable||"acc"}: ${e.expression||"Not set"}`:e.expression;return h.jsxs("div",{className:`control-flow-node transform-node p-0 ${t?"selected":""} ${s==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%)"},children:[h.jsx(Be,{type:"target",position:he.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:h.jsx(u,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white",children:e.name||c.label}),h.jsx("div",{className:"text-xs text-white/70",children:"Transform"})]}),h.jsx("div",{className:`w-6 h-6 rounded-full ${o.bgColor} flex items-center justify-center`,children:h.jsx(a,{className:`w-4 h-4 ${o.color} ${o.animate?"animate-pulse":""}`})})]}),h.jsxs("div",{className:"p-3 bg-white/10",children:[h.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[h.jsx("span",{className:"text-white/60",children:"Items:"})," ",h.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Variable:"})," ",h.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),h.jsxs("div",{className:"mb-3 p-2 bg-white/5 rounded",children:[h.jsx("div",{className:"text-xs text-white/60 mb-1",children:e.transformType==="filter"?"Condition":e.transformType==="reduce"?"Reducer":"Expression"}),h.jsx("div",{className:"text-xs text-white font-mono break-all",children:d||"Not set"})]}),e.transformType==="reduce"&&e.initialValue!==void 0&&h.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[h.jsx("span",{className:"text-white/60",children:"Initial:"})," ",h.jsx("span",{className:"font-mono",children:JSON.stringify(e.initialValue)})]}),(e.inputCount!==void 0||e.outputCount!==void 0)&&h.jsxs("div",{className:"mt-3 p-2 bg-white/5 rounded flex items-center justify-between",children:[h.jsxs("div",{className:"text-xs",children:[h.jsx("span",{className:"text-white/60",children:"In:"})," ",h.jsx("span",{className:"text-white font-medium",children:e.inputCount??"?"})]}),h.jsx("div",{className:"text-white/40",children:"→"}),h.jsxs("div",{className:"text-xs",children:[h.jsx("span",{className:"text-white/60",children:"Out:"})," ",h.jsx("span",{className:"text-white font-medium",children:e.outputCount??"?"})]})]}),h.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[h.jsx("span",{children:"ℹ️"}),h.jsx("span",{children:e.transformType==="map"?"Transforms each item":e.transformType==="filter"?"Selects matching items":"Aggregates to single value"})]})]}),h.jsx(Be,{type:"source",position:he.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),h.jsx(Be,{id:"loop-back",type:"source",position:he.Left,className:"!w-3 !h-3 !bg-teal-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const Rp=T.memo(G6);function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Bk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Aw(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Bk(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Bk(e[s],null)}}}}function Et(...e){return T.useCallback(Aw(...e),e)}function Y6(e,t){const n=T.createContext(t),r=o=>{const{children:a,...c}=o,u=T.useMemo(()=>c,Object.values(c));return h.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function s(o){const a=T.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function ii(e,t=[]){let n=[];function r(o,a){const c=T.createContext(a),u=n.length;n=[...n,a];const d=m=>{var S;const{scope:g,children:v,...b}=m,x=((S=g==null?void 0:g[e])==null?void 0:S[u])||c,w=T.useMemo(()=>b,Object.values(b));return h.jsx(x.Provider,{value:w,children:v})};d.displayName=o+"Provider";function p(m,g){var x;const v=((x=g==null?void 0:g[e])==null?void 0:x[u])||c,b=T.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,p]}const s=()=>{const o=n.map(a=>T.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return T.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[r,X6(s,...t)]}function X6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((c,{useScope:u,scopeName:d})=>{const m=u(o)[`__scope${d}`];return{...c,...m}},{});return T.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var bs=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{},Q6=cA[" useId ".trim().toString()]||(()=>{}),J6=0;function Ka(e){const[t,n]=T.useState(Q6());return bs(()=>{n(r=>r??String(J6++))},[e]),t?`radix-${t}`:""}var Z6=cA[" useInsertionEffect ".trim().toString()]||bs;function Rw({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=e8({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:s;{const p=T.useRef(e!==void 0);T.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"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.`),p.current=c},[c,r])}const d=T.useCallback(p=>{var m;if(c){const g=t8(p)?p(e):p;g!==e&&((m=a.current)==null||m.call(a,g))}else o(p)},[c,e,o,a]);return[u,d]}function e8({defaultProp:e,onChange:t}){const[n,r]=T.useState(e),s=T.useRef(n),o=T.useRef(t);return Z6(()=>{o.current=t},[t]),T.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function t8(e){return typeof e=="function"}function ll(e){const t=n8(e),n=T.forwardRef((r,s)=>{const{children:o,...a}=r,c=T.Children.toArray(o),u=c.find(s8);if(u){const d=u.props.children,p=c.map(m=>m===u?T.Children.count(d)>1?T.Children.only(null):T.isValidElement(d)?d.props.children:null:m);return h.jsx(t,{...a,ref:s,children:T.isValidElement(d)?T.cloneElement(d,void 0,p):null})}return h.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function n8(e){const t=T.forwardRef((n,r)=>{const{children:s,...o}=n;if(T.isValidElement(s)){const a=o8(s),c=i8(o,s.props);return s.type!==T.Fragment&&(c.ref=r?Aw(r,a):a),T.cloneElement(s,c)}return T.Children.count(s)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var r8=Symbol("radix.slottable");function s8(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===r8}function i8(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const u=o(...c);return s(...c),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function o8(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var a8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=a8.reduce((e,t)=>{const n=ll(`Primitive.${t}`),r=T.forwardRef((s,o)=>{const{asChild:a,...c}=s,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lI(e,t){e&&Nw.flushSync(()=>e.dispatchEvent(t))}function ur(e){const t=T.useRef(e);return T.useEffect(()=>{t.current=e}),T.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function l8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e);T.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var c8="DismissableLayer",Fx="dismissableLayer.update",u8="dismissableLayer.pointerDownOutside",d8="dismissableLayer.focusOutside",zk,cI=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Iw=T.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,d=T.useContext(cI),[p,m]=T.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=T.useState({}),b=Et(t,R=>m(R)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(w),C=p?x.indexOf(p):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,N=C>=S,j=p8(R=>{const O=R.target,L=[...d.branches].some(B=>B.contains(O));!N||L||(s==null||s(R),a==null||a(R),R.defaultPrevented||c==null||c())},g),A=m8(R=>{const O=R.target;[...d.branches].some(B=>B.contains(O))||(o==null||o(R),a==null||a(R),R.defaultPrevented||c==null||c())},g);return l8(R=>{C===d.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},g),T.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(zk=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Vk(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=zk)}},[p,g,n,d]),T.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Vk())},[p,d]),T.useEffect(()=>{const R=()=>v({});return document.addEventListener(Fx,R),()=>document.removeEventListener(Fx,R)},[]),h.jsx(Ze.div,{...u,ref:b,style:{pointerEvents:k?N?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,j.onPointerDownCapture)})});Iw.displayName=c8;var f8="DismissableLayerBranch",h8=T.forwardRef((e,t)=>{const n=T.useContext(cI),r=T.useRef(null),s=Et(t,r);return T.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),h.jsx(Ze.div,{...e,ref:s})});h8.displayName=f8;function p8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=T.useRef(!1),s=T.useRef(()=>{});return T.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){uI(u8,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function m8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=T.useRef(!1);return T.useEffect(()=>{const s=o=>{o.target&&!r.current&&uI(d8,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vk(){const e=new CustomEvent(Fx);document.dispatchEvent(e)}function uI(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?lI(s,o):s.dispatchEvent(o)}var Ip="focusScope.autoFocusOnMount",Mp="focusScope.autoFocusOnUnmount",Uk={bubbles:!1,cancelable:!0},g8="FocusScope",Mw=T.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,u]=T.useState(null),d=ur(s),p=ur(o),m=T.useRef(null),g=Et(t,x=>u(x)),v=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(r){let x=function(k){if(v.paused||!c)return;const N=k.target;c.contains(N)?m.current=N:hs(m.current,{select:!0})},w=function(k){if(v.paused||!c)return;const N=k.relatedTarget;N!==null&&(c.contains(N)||hs(m.current,{select:!0}))},S=function(k){if(document.activeElement===document.body)for(const j of k)j.removedNodes.length>0&&hs(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",w);const C=new MutationObserver(S);return c&&C.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w),C.disconnect()}}},[r,c,v.paused]),T.useEffect(()=>{if(c){Wk.add(v);const x=document.activeElement;if(!c.contains(x)){const S=new CustomEvent(Ip,Uk);c.addEventListener(Ip,d),c.dispatchEvent(S),S.defaultPrevented||(y8(S8(dI(c)),{select:!0}),document.activeElement===x&&hs(c))}return()=>{c.removeEventListener(Ip,d),setTimeout(()=>{const S=new CustomEvent(Mp,Uk);c.addEventListener(Mp,p),c.dispatchEvent(S),S.defaultPrevented||hs(x??document.body,{select:!0}),c.removeEventListener(Mp,p),Wk.remove(v)},0)}}},[c,d,p,v]);const b=T.useCallback(x=>{if(!n&&!r||v.paused)return;const w=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,S=document.activeElement;if(w&&S){const C=x.currentTarget,[k,N]=v8(C);k&&N?!x.shiftKey&&S===N?(x.preventDefault(),n&&hs(k,{select:!0})):x.shiftKey&&S===k&&(x.preventDefault(),n&&hs(N,{select:!0})):S===C&&x.preventDefault()}},[n,r,v.paused]);return h.jsx(Ze.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Mw.displayName=g8;function y8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(hs(r,{select:t}),document.activeElement!==n)return}function v8(e){const t=dI(e),n=Hk(t,e),r=Hk(t.reverse(),e);return[n,r]}function dI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Hk(e,t){for(const n of e)if(!x8(n,{upTo:t}))return n}function x8(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 w8(e){return e instanceof HTMLInputElement&&"select"in e}function hs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&w8(e)&&t&&e.select()}}var Wk=b8();function b8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Kk(e,t),e.unshift(t)},remove(t){var n;e=Kk(e,t),(n=e[0])==null||n.resume()}}}function Kk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function S8(e){return e.filter(t=>t.tagName!=="A")}var _8="Portal",Ow=T.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=T.useState(!1);bs(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?mF.createPortal(h.jsx(Ze.div,{...r,ref:t}),a):null});Ow.displayName=_8;function k8(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var $r=e=>{const{present:t,children:n}=e,r=N8(t),s=typeof n=="function"?n({present:r.isPresent}):T.Children.only(n),o=Et(r.ref,C8(s));return typeof n=="function"||r.isPresent?T.cloneElement(s,{ref:o}):null};$r.displayName="Presence";function N8(e){const[t,n]=T.useState(),r=T.useRef(null),s=T.useRef(e),o=T.useRef("none"),a=e?"mounted":"unmounted",[c,u]=k8(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const d=gu(r.current);o.current=c==="mounted"?d:"none"},[c]),bs(()=>{const d=r.current,p=s.current;if(p!==e){const g=o.current,v=gu(d);e?u("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),bs(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=v=>{const x=gu(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&x&&(u("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=v=>{v.target===t&&(o.current=gu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:T.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function gu(e){return(e==null?void 0:e.animationName)||"none"}function C8(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Op=0;function fI(){T.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gk()),document.body.insertAdjacentElement("beforeend",e[1]??Gk()),Op++,()=>{Op===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Op--}},[])}function Gk(){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 sr=function(){return sr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},sr.apply(this,arguments)};function hI(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function E8(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var qu="right-scroll-bar-position",Fu="width-before-scroll-bar",j8="with-scroll-bars-hidden",T8="--removed-body-scroll-bar-size";function Pp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function A8(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var R8=typeof window<"u"?T.useLayoutEffect:T.useEffect,Yk=new WeakMap;function I8(e,t){var n=A8(null,function(r){return e.forEach(function(s){return Pp(s,r)})});return R8(function(){var r=Yk.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(c){o.has(c)||Pp(c,null)}),o.forEach(function(c){s.has(c)||Pp(c,a)})}Yk.set(n,e)},[e]),n}function M8(e){return e}function O8(e,t){t===void 0&&(t=M8);var n=[],r=!1,s={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(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var u=function(){var p=a;a=[],p.forEach(o)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){a.push(p),d()},filter:function(p){return a=a.filter(p),n}}}};return s}function P8(e){e===void 0&&(e={});var t=O8(null);return t.options=sr({async:!0,ssr:!1},e),t}var pI=function(e){var t=e.sideCar,n=hI(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 T.createElement(r,sr({},n))};pI.isSideCarExport=!0;function L8(e,t){return e.useMedium(t),pI}var mI=P8(),Lp=function(){},$d=T.forwardRef(function(e,t){var n=T.useRef(null),r=T.useState({onScrollCapture:Lp,onWheelCapture:Lp,onTouchMoveCapture:Lp}),s=r[0],o=r[1],a=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,x=e.inert,w=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,k=e.gapMode,N=hI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=g,A=I8([n,t]),R=sr(sr({},N),s);return T.createElement(T.Fragment,null,p&&T.createElement(j,{sideCar:mI,removeScrollBar:d,shards:m,noRelative:v,noIsolation:b,inert:x,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:k}),a?T.cloneElement(T.Children.only(c),sr(sr({},R),{ref:A})):T.createElement(C,sr({},R,{className:u,ref:A}),c))});$d.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$d.classNames={fullWidth:Fu,zeroRight:qu};var D8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=D8();return t&&e.setAttribute("nonce",t),e}function q8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function F8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var B8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$8())&&(q8(t,n),F8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},z8=function(){var e=B8();return function(t,n){T.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gI=function(){var e=z8(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},V8={left:0,top:0,right:0,gap:0},Dp=function(e){return parseInt(e||"",10)||0},U8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Dp(n),Dp(r),Dp(s)]},H8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return V8;var t=U8(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])}},W8=gI(),io="data-scroll-locked",K8=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
508
|
+
.`.concat(j8,` {
|
|
509
|
+
overflow: hidden `).concat(r,`;
|
|
510
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
511
|
+
}
|
|
512
|
+
body[`).concat(io,`] {
|
|
513
|
+
overflow: hidden `).concat(r,`;
|
|
514
|
+
overscroll-behavior: contain;
|
|
515
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
516
|
+
padding-left: `.concat(s,`px;
|
|
517
|
+
padding-top: `).concat(o,`px;
|
|
518
|
+
padding-right: `).concat(a,`px;
|
|
519
|
+
margin-left:0;
|
|
520
|
+
margin-top:0;
|
|
521
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
522
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.`).concat(qu,` {
|
|
526
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.`).concat(Fu,` {
|
|
530
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.`).concat(qu," .").concat(qu,` {
|
|
534
|
+
right: 0 `).concat(r,`;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.`).concat(Fu," .").concat(Fu,` {
|
|
538
|
+
margin-right: 0 `).concat(r,`;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
body[`).concat(io,`] {
|
|
542
|
+
`).concat(T8,": ").concat(c,`px;
|
|
543
|
+
}
|
|
544
|
+
`)},Xk=function(){var e=parseInt(document.body.getAttribute(io)||"0",10);return isFinite(e)?e:0},G8=function(){T.useEffect(function(){return document.body.setAttribute(io,(Xk()+1).toString()),function(){var e=Xk()-1;e<=0?document.body.removeAttribute(io):document.body.setAttribute(io,e.toString())}},[])},Y8=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;G8();var o=T.useMemo(function(){return H8(s)},[s]);return T.createElement(W8,{styles:K8(o,!t,s,n?"":"!important")})},Bx=!1;if(typeof window<"u")try{var yu=Object.defineProperty({},"passive",{get:function(){return Bx=!0,!0}});window.addEventListener("test",yu,yu),window.removeEventListener("test",yu,yu)}catch{Bx=!1}var Ui=Bx?{passive:!1}:!1,X8=function(e){return e.tagName==="TEXTAREA"},yI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!X8(e)&&n[t]==="visible")},Q8=function(e){return yI(e,"overflowY")},J8=function(e){return yI(e,"overflowX")},Qk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=vI(e,r);if(s){var o=xI(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Z8=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},vI=function(e,t){return e==="v"?Q8(t):J8(t)},xI=function(e,t){return e==="v"?Z8(t):eV(t)},tV=function(e,t){return e==="h"&&t==="rtl"?-1:1},nV=function(e,t,n,r,s){var o=tV(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),d=!1,p=a>0,m=0,g=0;do{if(!c)break;var v=xI(e,c),b=v[0],x=v[1],w=v[2],S=x-w-o*b;(b||S)&&vI(e,c)&&(m+=S,g+=b);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(g)<1)&&(d=!0),d},vu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jk=function(e){return[e.deltaX,e.deltaY]},Zk=function(e){return e&&"current"in e?e.current:e},rV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sV=function(e){return`
|
|
545
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
546
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
547
|
+
`)},iV=0,Hi=[];function oV(e){var t=T.useRef([]),n=T.useRef([0,0]),r=T.useRef(),s=T.useState(iV++)[0],o=T.useState(gI)[0],a=T.useRef(e);T.useEffect(function(){a.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var x=E8([e.lockRef.current],(e.shards||[]).map(Zk),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=T.useCallback(function(x,w){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var S=vu(x),C=n.current,k="deltaX"in x?x.deltaX:C[0]-S[0],N="deltaY"in x?x.deltaY:C[1]-S[1],j,A=x.target,R=Math.abs(k)>Math.abs(N)?"h":"v";if("touches"in x&&R==="h"&&A.type==="range")return!1;var O=window.getSelection(),L=O&&O.anchorNode,B=L?L===A||L.contains(A):!1;if(B)return!1;var M=Qk(R,A);if(!M)return!0;if(M?j=R:(j=R==="v"?"h":"v",M=Qk(R,A)),!M)return!1;if(!r.current&&"changedTouches"in x&&(k||N)&&(r.current=j),!j)return!0;var $=r.current||j;return nV($,w,x,$==="h"?k:N)},[]),u=T.useCallback(function(x){var w=x;if(!(!Hi.length||Hi[Hi.length-1]!==o)){var S="deltaY"in w?Jk(w):vu(w),C=t.current.filter(function(j){return j.name===w.type&&(j.target===w.target||w.target===j.shadowParent)&&rV(j.delta,S)})[0];if(C&&C.should){w.cancelable&&w.preventDefault();return}if(!C){var k=(a.current.shards||[]).map(Zk).filter(Boolean).filter(function(j){return j.contains(w.target)}),N=k.length>0?c(w,k[0]):!a.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),d=T.useCallback(function(x,w,S,C){var k={name:x,delta:w,target:S,should:C,shadowParent:aV(S)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(N){return N!==k})},1)},[]),p=T.useCallback(function(x){n.current=vu(x),r.current=void 0},[]),m=T.useCallback(function(x){d(x.type,Jk(x),x.target,c(x,e.lockRef.current))},[]),g=T.useCallback(function(x){d(x.type,vu(x),x.target,c(x,e.lockRef.current))},[]);T.useEffect(function(){return Hi.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ui),document.addEventListener("touchmove",u,Ui),document.addEventListener("touchstart",p,Ui),function(){Hi=Hi.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,Ui),document.removeEventListener("touchmove",u,Ui),document.removeEventListener("touchstart",p,Ui)}},[]);var v=e.removeScrollBar,b=e.inert;return T.createElement(T.Fragment,null,b?T.createElement(o,{styles:sV(s)}):null,v?T.createElement(Y8,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lV=L8(mI,oV);var Pw=T.forwardRef(function(e,t){return T.createElement($d,sr({},e,{ref:t,sideCar:lV}))});Pw.classNames=$d.classNames;var cV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wi=new WeakMap,xu=new WeakMap,wu={},$p=0,wI=function(e){return e&&(e.host||wI(e.parentNode))},uV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wI(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})},dV=function(e,t,n,r){var s=uV(t,Array.isArray(e)?e:[e]);wu[n]||(wu[n]=new WeakMap);var o=wu[n],a=[],c=new Set,u=new Set(s),d=function(m){!m||c.has(m)||(c.add(m),d(m.parentNode))};s.forEach(d);var p=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(g){if(c.has(g))p(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",x=(Wi.get(g)||0)+1,w=(o.get(g)||0)+1;Wi.set(g,x),o.set(g,w),a.push(g),x===1&&b&&xu.set(g,!0),w===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return p(t),c.clear(),$p++,function(){a.forEach(function(m){var g=Wi.get(m)-1,v=o.get(m)-1;Wi.set(m,g),o.set(m,v),g||(xu.has(m)||m.removeAttribute(r),xu.delete(m)),v||m.removeAttribute(n)}),$p--,$p||(Wi=new WeakMap,Wi=new WeakMap,xu=new WeakMap,wu={})}},bI=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=cV(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),dV(r,s,n,"aria-hidden")):function(){return null}},qd="Dialog",[SI]=ii(qd),[fV,Wn]=SI(qd),_I=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=T.useRef(null),u=T.useRef(null),[d,p]=Rw({prop:r,defaultProp:s??!1,onChange:o,caller:qd});return h.jsx(fV,{scope:t,triggerRef:c,contentRef:u,contentId:Ka(),titleId:Ka(),descriptionId:Ka(),open:d,onOpenChange:p,onOpenToggle:T.useCallback(()=>p(m=>!m),[p]),modal:a,children:n})};_I.displayName=qd;var kI="DialogTrigger",hV=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(kI,n),o=Et(t,s.triggerRef);return h.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$w(s.open),...r,ref:o,onClick:Re(e.onClick,s.onOpenToggle)})});hV.displayName=kI;var Lw="DialogPortal",[pV,NI]=SI(Lw,{forceMount:void 0}),CI=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Wn(Lw,t);return h.jsx(pV,{scope:t,forceMount:n,children:T.Children.map(r,a=>h.jsx($r,{present:n||o.open,children:h.jsx(Ow,{asChild:!0,container:s,children:a})}))})};CI.displayName=Lw;var cd="DialogOverlay",EI=T.forwardRef((e,t)=>{const n=NI(cd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Wn(cd,e.__scopeDialog);return o.modal?h.jsx($r,{present:r||o.open,children:h.jsx(gV,{...s,ref:t})}):null});EI.displayName=cd;var mV=ll("DialogOverlay.RemoveScroll"),gV=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(cd,n);return h.jsx(Pw,{as:mV,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(Ze.div,{"data-state":$w(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ti="DialogContent",jI=T.forwardRef((e,t)=>{const n=NI(ti,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Wn(ti,e.__scopeDialog);return h.jsx($r,{present:r||o.open,children:o.modal?h.jsx(yV,{...s,ref:t}):h.jsx(vV,{...s,ref:t})})});jI.displayName=ti;var yV=T.forwardRef((e,t)=>{const n=Wn(ti,e.__scopeDialog),r=T.useRef(null),s=Et(t,n.contentRef,r);return T.useEffect(()=>{const o=r.current;if(o)return bI(o)},[]),h.jsx(TI,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),vV=T.forwardRef((e,t)=>{const n=Wn(ti,e.__scopeDialog),r=T.useRef(!1),s=T.useRef(!1);return h.jsx(TI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),TI=T.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=Wn(ti,n),u=T.useRef(null),d=Et(t,u);return fI(),h.jsxs(h.Fragment,{children:[h.jsx(Mw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:h.jsx(Iw,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":$w(c.open),...a,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(xV,{titleId:c.titleId}),h.jsx(bV,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Dw="DialogTitle",AI=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(Dw,n);return h.jsx(Ze.h2,{id:s.titleId,...r,ref:t})});AI.displayName=Dw;var RI="DialogDescription",II=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(RI,n);return h.jsx(Ze.p,{id:s.descriptionId,...r,ref:t})});II.displayName=RI;var MI="DialogClose",OI=T.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(MI,n);return h.jsx(Ze.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});OI.displayName=MI;function $w(e){return e?"open":"closed"}var PI="DialogTitleWarning",[$J,LI]=Y6(PI,{contentName:ti,titleName:Dw,docsSlug:"dialog"}),xV=({titleId:e})=>{const t=LI(PI),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
548
|
+
|
|
549
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
550
|
+
|
|
551
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return T.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},wV="DialogDescriptionWarning",bV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${LI(wV).contentName}}.`;return T.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},SV=_I,_V=CI,kV=EI,NV=jI,CV=AI,EV=II,jV=OI;function DI(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=DI(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function TV(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=DI(e))&&(r&&(r+=" "),r+=t);return r}const qw="-",AV=e=>{const t=IV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(qw);return c[0]===""&&c.length!==1&&c.shift(),$I(c,t)||RV(a)},getConflictingClassGroupIds:(a,c)=>{const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}}},$I=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?$I(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(qw);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId},eN=/^\[(.+)\]$/,RV=e=>{if(eN.test(e)){const t=eN.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},IV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return OV(Object.entries(e.classGroups),n).forEach(([o,a])=>{zx(a,r,o,t)}),r},zx=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:tN(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(MV(s)){zx(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{zx(a,tN(t,o),n,r)})})},tN=(e,t)=>{let n=e;return t.split(qw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},MV=e=>e.isThemeGetter,OV=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,s]}):e,PV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},qI="!",LV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=c=>{const u=[];let d=0,p=0,m;for(let w=0;w<c.length;w++){let S=c[w];if(d===0){if(S===s&&(r||c.slice(w,w+o)===t)){u.push(c.slice(p,w)),p=w+o;continue}if(S==="/"){m=w;continue}}S==="["?d++:S==="]"&&d--}const g=u.length===0?c:c.substring(p),v=g.startsWith(qI),b=v?g.substring(1):g,x=m&&m>p?m-p:void 0;return{modifiers:u,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:x}};return n?c=>n({className:c,parseClassName:a}):a},DV=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},$V=e=>({cache:PV(e.cacheSize),parseClassName:LV(e),...AV(e)}),qV=/\s+/,FV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(qV);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{modifiers:p,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:v}=n(d);let b=!!v,x=r(b?g.substring(0,v):g);if(!x){if(!b){c=d+(c.length>0?" "+c:c);continue}if(x=r(g),!x){c=d+(c.length>0?" "+c:c);continue}b=!1}const w=DV(p).join(":"),S=m?w+qI:w,C=S+x;if(o.includes(C))continue;o.push(C);const k=s(x,b);for(let N=0;N<k.length;++N){const j=k[N];o.push(S+j)}c=d+(c.length>0?" "+c:c)}return c};function BV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=FI(t))&&(r&&(r+=" "),r+=n);return r}const FI=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=FI(e[r]))&&(n&&(n+=" "),n+=t);return n};function zV(e,...t){let n,r,s,o=a;function a(u){const d=t.reduce((p,m)=>m(p),e());return n=$V(d),r=n.cache.get,s=n.cache.set,o=c,c(u)}function c(u){const d=r(u);if(d)return d;const p=FV(u,n);return s(u,p),p}return function(){return o(BV.apply(null,arguments))}}const Ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},BI=/^\[(?:([a-z-]+):)?(.+)\]$/i,VV=/^\d+\/\d+$/,UV=new Set(["px","full","screen"]),HV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WV=/\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$/,KV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,GV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cr=e=>oo(e)||UV.has(e)||VV.test(e),us=e=>No(e,"length",r9),oo=e=>!!e&&!Number.isNaN(Number(e)),qp=e=>No(e,"number",oo),Ta=e=>!!e&&Number.isInteger(Number(e)),XV=e=>e.endsWith("%")&&oo(e.slice(0,-1)),Me=e=>BI.test(e),ds=e=>HV.test(e),QV=new Set(["length","size","percentage"]),JV=e=>No(e,QV,zI),ZV=e=>No(e,"position",zI),e9=new Set(["image","url"]),t9=e=>No(e,e9,i9),n9=e=>No(e,"",s9),Aa=()=>!0,No=(e,t,n)=>{const r=BI.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},r9=e=>WV.test(e)&&!KV.test(e),zI=()=>!1,s9=e=>GV.test(e),i9=e=>YV.test(e),o9=()=>{const e=Ye("colors"),t=Ye("spacing"),n=Ye("blur"),r=Ye("brightness"),s=Ye("borderColor"),o=Ye("borderRadius"),a=Ye("borderSpacing"),c=Ye("borderWidth"),u=Ye("contrast"),d=Ye("grayscale"),p=Ye("hueRotate"),m=Ye("invert"),g=Ye("gap"),v=Ye("gradientColorStops"),b=Ye("gradientColorStopPositions"),x=Ye("inset"),w=Ye("margin"),S=Ye("opacity"),C=Ye("padding"),k=Ye("saturate"),N=Ye("scale"),j=Ye("sepia"),A=Ye("skew"),R=Ye("space"),O=Ye("translate"),L=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Me,t],$=()=>[Me,t],U=()=>["",Cr,us],D=()=>["auto",oo,Me],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Me],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[oo,Me];return{cacheSize:500,separator:":",theme:{colors:[Aa],spacing:[Cr,us],blur:["none","",ds,Me],brightness:P(),borderColor:[e],borderRadius:["none","","full",ds,Me],borderSpacing:$(),borderWidth:U(),contrast:P(),grayscale:q(),hueRotate:P(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[XV,us],inset:M(),margin:M(),opacity:P(),padding:$(),saturate:P(),scale:P(),sepia:q(),skew:P(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[ds]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:[...V(),Me]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ta,Me]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Ta,Me]}],"grid-cols":[{"grid-cols":[Aa]}],"col-start-end":[{col:["auto",{span:["full",Ta,Me]},Me]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Aa]}],"row-start-end":[{row:["auto",{span:[Ta,Me]},Me]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"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:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,t]}],"min-w":[{"min-w":[Me,t,"min","max","fit"]}],"max-w":[{"max-w":[Me,t,"none","full","min","max","fit","prose",{screen:[ds]},ds]}],h:[{h:[Me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ds,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qp]}],"font-family":[{font:[Aa]}],"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",Me]}],"line-clamp":[{"line-clamp":["none",oo,qp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Cr,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Cr,us]}],"underline-offset":[{"underline-offset":["auto",Cr,Me]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],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",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),ZV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",JV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},t9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Cr,Me]}],"outline-w":[{outline:[Cr,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Cr,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ds,n9]}],"shadow-color":[{shadow:[Aa]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",ds,Me]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[k]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Ta,Me]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"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",Me]}],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",Me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",Me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Cr,us,qp]}],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"]}}},a9=zV(o9);function Bt(...e){return a9(TV(e))}const l9={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]"};function Ss({open:e,onOpenChange:t,title:n,description:r,children:s,className:o,size:a="md"}){return h.jsx(SV,{open:e,onOpenChange:t,children:h.jsxs(_V,{children:[h.jsx(kV,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),h.jsxs(NV,{className:Bt("fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]","w-full rounded-lg border border-node-border bg-panel-bg shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","duration-200",l9[a],o),children:[(n||r)&&h.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-node-border",children:[h.jsxs("div",{children:[n&&h.jsx(CV,{className:"text-lg font-semibold text-white",children:n}),r&&h.jsx(EV,{className:"mt-1 text-sm text-gray-400",children:r})]}),h.jsx(jV,{className:"rounded-full p-1 hover:bg-white/10 transition-colors",children:h.jsx(Cl,{className:"w-5 h-5 text-gray-400"})})]}),h.jsx("div",{className:"max-h-[calc(85vh-8rem)] overflow-y-auto",children:s})]})]})})}function ni({children:e,className:t}){return h.jsx("div",{className:Bt("flex items-center justify-end gap-3 p-4 border-t border-node-border",t),children:e})}const c9={primary:"bg-primary hover:bg-primary-dark text-white border-transparent",secondary:"bg-node-bg hover:bg-white/10 text-gray-300 border-node-border hover:border-primary",ghost:"bg-transparent hover:bg-white/10 text-gray-300 border-transparent",destructive:"bg-error/10 hover:bg-error/20 text-error border-error/20 hover:border-error"},u9={sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},Fe=T.forwardRef(({className:e,variant:t="primary",size:n="md",loading:r,icon:s,disabled:o,children:a,...c},u)=>h.jsxs("button",{ref:u,disabled:o||r,className:Bt("inline-flex items-center justify-center gap-2 rounded-lg border font-medium transition-colors","focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2 focus:ring-offset-panel-bg","disabled:opacity-50 disabled:cursor-not-allowed",c9[t],u9[n],e),...c,children:[r?h.jsx(ws,{className:"w-4 h-4 animate-spin"}):s&&h.jsx("span",{className:"flex-shrink-0",children:s}),a]}));Fe.displayName="Button";function VI(e){const t=e+"CollectionProvider",[n,r]=ii(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:w,children:S}=x,C=pt.useRef(null),k=pt.useRef(new Map).current;return h.jsx(s,{scope:w,itemMap:k,collectionRef:C,children:S})};a.displayName=t;const c=e+"CollectionSlot",u=ll(c),d=pt.forwardRef((x,w)=>{const{scope:S,children:C}=x,k=o(c,S),N=Et(w,k.collectionRef);return h.jsx(u,{ref:N,children:C})});d.displayName=c;const p=e+"CollectionItemSlot",m="data-radix-collection-item",g=ll(p),v=pt.forwardRef((x,w)=>{const{scope:S,children:C,...k}=x,N=pt.useRef(null),j=Et(w,N),A=o(p,S);return pt.useEffect(()=>(A.itemMap.set(N,{ref:N,...k}),()=>void A.itemMap.delete(N))),h.jsx(g,{[m]:"",ref:j,children:C})});v.displayName=p;function b(x){const w=o(e+"CollectionConsumer",x);return pt.useCallback(()=>{const C=w.collectionRef.current;if(!C)return[];const k=Array.from(C.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((A,R)=>k.indexOf(A.ref.current)-k.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:d,ItemSlot:v},b,r]}var d9=T.createContext(void 0);function Fw(e){const t=T.useContext(d9);return e||t||"ltr"}var Fp="rovingFocusGroup.onEntryFocus",f9={bubbles:!1,cancelable:!0},jl="RovingFocusGroup",[Vx,UI,h9]=VI(jl),[p9,Fd]=ii(jl,[h9]),[m9,g9]=p9(jl),HI=T.forwardRef((e,t)=>h.jsx(Vx.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Vx.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(y9,{...e,ref:t})})}));HI.displayName=jl;var y9=T.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,g=T.useRef(null),v=Et(t,g),b=Fw(o),[x,w]=Rw({prop:a,defaultProp:c??null,onChange:u,caller:jl}),[S,C]=T.useState(!1),k=ur(d),N=UI(n),j=T.useRef(!1),[A,R]=T.useState(0);return T.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(Fp,k),()=>O.removeEventListener(Fp,k)},[k]),h.jsx(m9,{scope:n,orientation:r,dir:b,loop:s,currentTabStopId:x,onItemFocus:T.useCallback(O=>w(O),[w]),onItemShiftTab:T.useCallback(()=>C(!0),[]),onFocusableItemAdd:T.useCallback(()=>R(O=>O+1),[]),onFocusableItemRemove:T.useCallback(()=>R(O=>O-1),[]),children:h.jsx(Ze.div,{tabIndex:S||A===0?-1:0,"data-orientation":r,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{j.current=!0}),onFocus:Re(e.onFocus,O=>{const L=!j.current;if(O.target===O.currentTarget&&L&&!S){const B=new CustomEvent(Fp,f9);if(O.currentTarget.dispatchEvent(B),!B.defaultPrevented){const M=N().filter(z=>z.focusable),$=M.find(z=>z.active),U=M.find(z=>z.id===x),V=[$,U,...M].filter(Boolean).map(z=>z.ref.current);GI(V,p)}}j.current=!1}),onBlur:Re(e.onBlur,()=>C(!1))})})}),WI="RovingFocusGroupItem",KI=T.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...c}=e,u=Ka(),d=o||u,p=g9(WI,n),m=p.currentTabStopId===d,g=UI(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:x}=p;return T.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),h.jsx(Vx.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:h.jsx(Ze.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:Re(e.onMouseDown,w=>{r?p.onItemFocus(d):w.preventDefault()}),onFocus:Re(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Re(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=w9(w,p.orientation,p.dir);if(S!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=g().filter(N=>N.focusable).map(N=>N.ref.current);if(S==="last")k.reverse();else if(S==="prev"||S==="next"){S==="prev"&&k.reverse();const N=k.indexOf(w.currentTarget);k=p.loop?b9(k,N+1):k.slice(N+1)}setTimeout(()=>GI(k))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:x!=null}):a})})});KI.displayName=WI;var v9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function x9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function w9(e,t,n){const r=x9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return v9[r]}function GI(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function b9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YI=HI,XI=KI,Bd="Tabs",[S9]=ii(Bd,[Fd]),QI=Fd(),[_9,Bw]=S9(Bd),JI=T.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,p=Fw(c),[m,g]=Rw({prop:r,onChange:s,defaultProp:o??"",caller:Bd});return h.jsx(_9,{scope:n,baseId:Ka(),value:m,onValueChange:g,orientation:a,dir:p,activationMode:u,children:h.jsx(Ze.div,{dir:p,"data-orientation":a,...d,ref:t})})});JI.displayName=Bd;var ZI="TabsList",eM=T.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Bw(ZI,n),a=QI(n);return h.jsx(YI,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:h.jsx(Ze.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});eM.displayName=ZI;var tM="TabsTrigger",nM=T.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=Bw(tM,n),c=QI(n),u=iM(a.baseId,r),d=oM(a.baseId,r),p=r===a.value;return h.jsx(XI,{asChild:!0,...c,focusable:!s,active:p,children:h.jsx(Ze.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:Re(e.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:Re(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const m=a.activationMode!=="manual";!p&&!s&&m&&a.onValueChange(r)})})})});nM.displayName=tM;var rM="TabsContent",sM=T.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=Bw(rM,n),u=iM(c.baseId,r),d=oM(c.baseId,r),p=r===c.value,m=T.useRef(p);return T.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),h.jsx($r,{present:s||p,children:({present:g})=>h.jsx(Ze.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:g&&o})})});sM.displayName=rM;function iM(e,t){return`${e}-trigger-${t}`}function oM(e,t){return`${e}-content-${t}`}var k9=JI,aM=eM,lM=nM,cM=sM;const uM=k9,zw=T.forwardRef(({className:e,...t},n)=>h.jsx(aM,{ref:n,className:Bt("inline-flex items-center gap-1 border-b border-node-border w-full px-2",e),...t}));zw.displayName=aM.displayName;const nr=T.forwardRef(({className:e,...t},n)=>h.jsx(lM,{ref:n,className:Bt("inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm font-medium","text-gray-400 transition-all","hover:text-gray-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:text-primary data-[state=active]:border-b-2 data-[state=active]:border-primary data-[state=active]:-mb-px",e),...t}));nr.displayName=lM.displayName;const rr=T.forwardRef(({className:e,...t},n)=>h.jsx(cM,{ref:n,className:Bt("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",e),...t}));rr.displayName=cM.displayName;function nN(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 N9(e){if(Array.isArray(e))return e}function C9(e,t,n){return(t=M9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E9(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,a,c=[],u=!0,d=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(u=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(p){d=!0,s=p}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return c}}function j9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
552
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function sN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rN(Object(n),!0).forEach(function(r){C9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T9(e,t){if(e==null)return{};var n,r,s=A9(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function A9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function R9(e,t){return N9(e)||E9(e,t)||O9(e,t)||j9()}function I9(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(t==="string"?String:Number)(e)}function M9(e){var t=I9(e,"string");return typeof t=="symbol"?t:t+""}function O9(e,t){if(e){if(typeof e=="string")return nN(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)?nN(e,t):void 0}}function P9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function oN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iN(Object(n),!0).forEach(function(r){P9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function L9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,o){return o(s)},r)}}function La(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(s,c))}}}function ud(e){return{}.toString.call(e).includes("Object")}function D9(e){return!Object.keys(e).length}function cl(e){return typeof e=="function"}function $9(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function q9(e,t){return ud(t)||ys("changeType"),Object.keys(t).some(function(n){return!$9(e,n)})&&ys("changeField"),t}function F9(e){cl(e)||ys("selectorType")}function B9(e){cl(e)||ud(e)||ys("handlerType"),ud(e)&&Object.values(e).some(function(t){return!cl(t)})&&ys("handlersType")}function z9(e){e||ys("initialIsRequired"),ud(e)||ys("initialType"),D9(e)&&ys("initialContent")}function V9(e,t){throw new Error(e[t]||e.default)}var U9={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ys=La(V9)(U9),bu={changes:q9,selector:F9,handler:B9,initial:z9};function H9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bu.initial(e),bu.handler(t);var n={current:e},r=La(G9)(n,t),s=La(K9)(n),o=La(bu.changes)(e),a=La(W9)(n);function c(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return bu.selector(d),d(n.current)}function u(d){L9(r,s,o,a)(d)}return[c,u]}function W9(e,t){return cl(t)?t(e.current):t}function K9(e,t){return e.current=oN(oN({},e.current),t),t}function G9(e,t,n){return cl(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var Y9={create:H9},X9={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Q9(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(s,c))}}}function J9(e){return{}.toString.call(e).includes("Object")}function Z9(e){return e||aN("configIsRequired"),J9(e)||aN("configType"),e.urls?(eU(),{paths:{vs:e.urls.monacoBase}}):e}function eU(){console.warn(dM.deprecation)}function tU(e,t){throw new Error(e[t]||e.default)}var dM={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
553
|
+
You are using deprecated way of configuration.
|
|
554
|
+
|
|
555
|
+
Instead of using
|
|
556
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
557
|
+
use
|
|
558
|
+
monaco.config({ paths: { vs: '...' } })
|
|
559
|
+
|
|
560
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
561
|
+
`},aN=Q9(tU)(dM),nU={config:Z9},rU=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,a){return a(o)},s)}};function fM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],fM(e[n],t[n]))}),sN(sN({},e),t)}var sU={type:"cancelation",msg:"operation is manually canceled"};function Bp(e){var t=!1,n=new Promise(function(r,s){e.then(function(o){return t?s(sU):r(o)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var iU=["monaco"],oU=Y9.create({config:X9,isInitialized:!1,resolve:null,reject:null,monaco:null}),hM=R9(oU,2),Tl=hM[0],zd=hM[1];function aU(e){var t=nU.config(e),n=t.monaco,r=T9(t,iU);zd(function(s){return{config:fM(s.config,r),monaco:n}})}function lU(){var e=Tl(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(zd({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Bp(zp);if(window.monaco&&window.monaco.editor)return pM(window.monaco),e.resolve(window.monaco),Bp(zp);rU(cU,dU)(fU)}return Bp(zp)}function cU(e){return document.body.appendChild(e)}function uU(e){var t=document.createElement("script");return e&&(t.src=e),t}function dU(e){var t=Tl(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=uU("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function fU(){var e=Tl(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;pM(r),e.resolve(r)},function(n){e.reject(n)})}function pM(e){Tl().monaco||zd({monaco:e})}function hU(){return Tl(function(e){var t=e.monaco;return t})}var zp=new Promise(function(e,t){return zd({resolve:e,reject:t})}),mM={config:aU,init:lU,__getMonacoInstance:hU},pU={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Vp=pU,mU={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},gU=mU;function yU({children:e}){return pt.createElement("div",{style:gU.container},e)}var vU=yU,xU=vU;function wU({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:a}){return pt.createElement("section",{style:{...Vp.wrapper,width:e,height:t},...a},!n&&pt.createElement(xU,null,r),pt.createElement("div",{ref:s,style:{...Vp.fullWidth,...!n&&Vp.hide},className:o}))}var bU=wU,gM=T.memo(bU);function SU(e){T.useEffect(e,[])}var yM=SU;function _U(e,t,n=!0){let r=T.useRef(!0);T.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ln=_U;function Ga(){}function Zi(e,t,n,r){return kU(e,r)||NU(e,t,n,r)}function kU(e,t){return e.editor.getModel(vM(e,t))}function NU(e,t,n,r){return e.editor.createModel(t,n,r?vM(e,r):void 0)}function vM(e,t){return e.Uri.parse(t)}function CU({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:d="light",loading:p="Loading...",options:m={},height:g="100%",width:v="100%",className:b,wrapperProps:x={},beforeMount:w=Ga,onMount:S=Ga}){let[C,k]=T.useState(!1),[N,j]=T.useState(!0),A=T.useRef(null),R=T.useRef(null),O=T.useRef(null),L=T.useRef(S),B=T.useRef(w),M=T.useRef(!1);yM(()=>{let V=mM.init();return V.then(z=>(R.current=z)&&j(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>A.current?D():V.cancel()}),ln(()=>{if(A.current&&R.current){let V=A.current.getOriginalEditor(),z=Zi(R.current,e||"",r||n||"text",o||"");z!==V.getModel()&&V.setModel(z)}},[o],C),ln(()=>{if(A.current&&R.current){let V=A.current.getModifiedEditor(),z=Zi(R.current,t||"",s||n||"text",a||"");z!==V.getModel()&&V.setModel(z)}},[a],C),ln(()=>{let V=A.current.getModifiedEditor();V.getOption(R.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],C),ln(()=>{var V,z;(z=(V=A.current)==null?void 0:V.getModel())==null||z.original.setValue(e||"")},[e],C),ln(()=>{let{original:V,modified:z}=A.current.getModel();R.current.editor.setModelLanguage(V,r||n||"text"),R.current.editor.setModelLanguage(z,s||n||"text")},[n,r,s],C),ln(()=>{var V;(V=R.current)==null||V.editor.setTheme(d)},[d],C),ln(()=>{var V;(V=A.current)==null||V.updateOptions(m)},[m],C);let $=T.useCallback(()=>{var Q;if(!R.current)return;B.current(R.current);let V=Zi(R.current,e||"",r||n||"text",o||""),z=Zi(R.current,t||"",s||n||"text",a||"");(Q=A.current)==null||Q.setModel({original:V,modified:z})},[n,t,s,e,r,o,a]),U=T.useCallback(()=>{var V;!M.current&&O.current&&(A.current=R.current.editor.createDiffEditor(O.current,{automaticLayout:!0,...m}),$(),(V=R.current)==null||V.editor.setTheme(d),k(!0),M.current=!0)},[m,d,$]);T.useEffect(()=>{C&&L.current(A.current,R.current)},[C]),T.useEffect(()=>{!N&&!C&&U()},[N,C,U]);function D(){var z,Q,F,q;let V=(z=A.current)==null?void 0:z.getModel();c||((Q=V==null?void 0:V.original)==null||Q.dispose()),u||((F=V==null?void 0:V.modified)==null||F.dispose()),(q=A.current)==null||q.dispose()}return pt.createElement(gM,{width:v,height:g,isEditorReady:C,loading:p,_ref:O,className:b,wrapperProps:x})}var EU=CU;T.memo(EU);function jU(e){let t=T.useRef();return T.useEffect(()=>{t.current=e},[e]),t.current}var TU=jU,Su=new Map;function AU({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:o,theme:a="light",line:c,loading:u="Loading...",options:d={},overrideServices:p={},saveViewState:m=!0,keepCurrentModel:g=!1,width:v="100%",height:b="100%",className:x,wrapperProps:w={},beforeMount:S=Ga,onMount:C=Ga,onChange:k,onValidate:N=Ga}){let[j,A]=T.useState(!1),[R,O]=T.useState(!0),L=T.useRef(null),B=T.useRef(null),M=T.useRef(null),$=T.useRef(C),U=T.useRef(S),D=T.useRef(),V=T.useRef(r),z=TU(o),Q=T.useRef(!1),F=T.useRef(!1);yM(()=>{let P=mM.init();return P.then(W=>(L.current=W)&&O(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>B.current?G():P.cancel()}),ln(()=>{var W,oe,K,J;let P=Zi(L.current,e||r||"",t||s||"",o||n||"");P!==((W=B.current)==null?void 0:W.getModel())&&(m&&Su.set(z,(oe=B.current)==null?void 0:oe.saveViewState()),(K=B.current)==null||K.setModel(P),m&&((J=B.current)==null||J.restoreViewState(Su.get(o))))},[o],j),ln(()=>{var P;(P=B.current)==null||P.updateOptions(d)},[d],j),ln(()=>{!B.current||r===void 0||(B.current.getOption(L.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(F.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),F.current=!1))},[r],j),ln(()=>{var W,oe;let P=(W=B.current)==null?void 0:W.getModel();P&&s&&((oe=L.current)==null||oe.editor.setModelLanguage(P,s))},[s],j),ln(()=>{var P;c!==void 0&&((P=B.current)==null||P.revealLine(c))},[c],j),ln(()=>{var P;(P=L.current)==null||P.editor.setTheme(a)},[a],j);let q=T.useCallback(()=>{var P;if(!(!M.current||!L.current)&&!Q.current){U.current(L.current);let W=o||n,oe=Zi(L.current,r||e||"",t||s||"",W||"");B.current=(P=L.current)==null?void 0:P.editor.create(M.current,{model:oe,automaticLayout:!0,...d},p),m&&B.current.restoreViewState(Su.get(W)),L.current.editor.setTheme(a),c!==void 0&&B.current.revealLine(c),A(!0),Q.current=!0}},[e,t,n,r,s,o,d,p,m,a,c]);T.useEffect(()=>{j&&$.current(B.current,L.current)},[j]),T.useEffect(()=>{!R&&!j&&q()},[R,j,q]),V.current=r,T.useEffect(()=>{var P,W;j&&k&&((P=D.current)==null||P.dispose(),D.current=(W=B.current)==null?void 0:W.onDidChangeModelContent(oe=>{F.current||k(B.current.getValue(),oe)}))},[j,k]),T.useEffect(()=>{if(j){let P=L.current.editor.onDidChangeMarkers(W=>{var K;let oe=(K=B.current.getModel())==null?void 0:K.uri;if(oe&&W.find(J=>J.path===oe.path)){let J=L.current.editor.getModelMarkers({resource:oe});N==null||N(J)}});return()=>{P==null||P.dispose()}}return()=>{}},[j,N]);function G(){var P,W;(P=D.current)==null||P.dispose(),g?m&&Su.set(o,B.current.saveViewState()):(W=B.current.getModel())==null||W.dispose(),B.current.dispose()}return pt.createElement(gM,{width:v,height:b,isEditorReady:j,loading:u,_ref:M,className:x,wrapperProps:w})}var RU=AU,IU=T.memo(RU),Ya=IU;const Vw=Symbol.for("yaml.alias"),Ux=Symbol.for("yaml.document"),vs=Symbol.for("yaml.map"),xM=Symbol.for("yaml.pair"),dr=Symbol.for("yaml.scalar"),Co=Symbol.for("yaml.seq"),Nn=Symbol.for("yaml.node.type"),oi=e=>!!e&&typeof e=="object"&&e[Nn]===Vw,Al=e=>!!e&&typeof e=="object"&&e[Nn]===Ux,Rl=e=>!!e&&typeof e=="object"&&e[Nn]===vs,ft=e=>!!e&&typeof e=="object"&&e[Nn]===xM,He=e=>!!e&&typeof e=="object"&&e[Nn]===dr,Il=e=>!!e&&typeof e=="object"&&e[Nn]===Co;function ut(e){if(e&&typeof e=="object")switch(e[Nn]){case vs:case Co:return!0}return!1}function dt(e){if(e&&typeof e=="object")switch(e[Nn]){case Vw:case vs:case dr:case Co:return!0}return!1}const wM=e=>(He(e)||ut(e))&&!!e.anchor,Us=Symbol("break visit"),MU=Symbol("skip children"),Xa=Symbol("remove node");function Eo(e,t){const n=OU(t);Al(e)?eo(null,e.contents,n,Object.freeze([e]))===Xa&&(e.contents=null):eo(null,e,n,Object.freeze([]))}Eo.BREAK=Us;Eo.SKIP=MU;Eo.REMOVE=Xa;function eo(e,t,n,r){const s=PU(e,t,n,r);if(dt(s)||ft(s))return LU(e,r,s),eo(e,s,n,r);if(typeof s!="symbol"){if(ut(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const a=eo(o,t.items[o],n,r);if(typeof a=="number")o=a-1;else{if(a===Us)return Us;a===Xa&&(t.items.splice(o,1),o-=1)}}}else if(ft(t)){r=Object.freeze(r.concat(t));const o=eo("key",t.key,n,r);if(o===Us)return Us;o===Xa&&(t.key=null);const a=eo("value",t.value,n,r);if(a===Us)return Us;a===Xa&&(t.value=null)}}return s}function OU(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function PU(e,t,n,r){var s,o,a,c,u;if(typeof n=="function")return n(e,t,r);if(Rl(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(Il(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,r);if(ft(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,r);if(He(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,r);if(oi(t))return(u=n.Alias)==null?void 0:u.call(n,e,t,r)}function LU(e,t,n){const r=t[t.length-1];if(ut(r))r.items[e]=n;else if(ft(r))e==="key"?r.key=n:r.value=n;else if(Al(r))r.contents=n;else{const s=oi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const DU={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},$U=e=>e.replace(/[!,[\]{}]/g,t=>DU[t]);class qt{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},qt.defaultYaml,t),this.tags=Object.assign({},qt.defaultTags,n)}clone(){const t=new qt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new qt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:qt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},qt.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:qt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},qt.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[o,a]=r;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const a=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const o=this.tags[r];if(o)try{return o+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+$U(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&dt(t.contents)){const o={};Eo(t.contents,(a,c)=>{dt(c)&&c.tag&&(o[c.tag]=!0)}),s=Object.keys(o)}else s=[];for(const[o,a]of r)o==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(c=>c.startsWith(a)))&&n.push(`%TAG ${o} ${a}`);return n.join(`
|
|
562
|
+
`)}}qt.defaultYaml={explicit:!1,version:"1.2"};qt.defaultTags={"!!":"tag:yaml.org,2002:"};function bM(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function SM(e){const t=new Set;return Eo(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function _M(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function qU(e,t){const n=[],r=new Map;let s=null;return{onAnchor:o=>{n.push(o),s??(s=SM(e));const a=_M(t,s);return s.add(a),a},setAnchors:()=>{for(const o of n){const a=r.get(o);if(typeof a=="object"&&a.anchor&&(He(a.node)||ut(a.node)))a.node.anchor=a.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=o,c}}},sourceObjects:r}}function to(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,o=r.length;s<o;++s){const a=r[s],c=to(e,r,String(s),a);c===void 0?delete r[s]:c!==a&&(r[s]=c)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const o=r.get(s),a=to(e,r,s,o);a===void 0?r.delete(s):a!==o&&r.set(s,a)}else if(r instanceof Set)for(const s of Array.from(r)){const o=to(e,r,s,s);o===void 0?r.delete(s):o!==s&&(r.delete(s),r.add(o))}else for(const[s,o]of Object.entries(r)){const a=to(e,r,s,o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}return e.call(t,n,r)}function _n(e,t,n){if(Array.isArray(e))return e.map((r,s)=>_n(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!wM(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Uw{constructor(t){Object.defineProperty(this,Nn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:o}={}){if(!Al(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=_n(this,"",a);if(typeof s=="function")for(const{count:u,res:d}of a.anchors.values())s(d,u);return typeof o=="function"?to(o,{"":c},"",c):c}}class Hw extends Uw{constructor(t){super(Vw),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Eo(t,{Node:(o,a)=>{(oi(a)||wM(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const o of r){if(o===this)break;o.anchor===this.source&&(s=o)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:o}=n,a=this.resolve(s,n);if(!a){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let c=r.get(a);if(c||(_n(a,null,n),c=r.get(a)),(c==null?void 0:c.res)===void 0){const u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(o>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Bu(s,a,r)),c.count*c.aliasCount>o)){const u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(bM(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${s} `}return s}}function Bu(e,t,n){if(oi(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(ut(t)){let r=0;for(const s of t.items){const o=Bu(e,s,n);o>r&&(r=o)}return r}else if(ft(t)){const r=Bu(e,t.key,n),s=Bu(e,t.value,n);return Math.max(r,s)}return 1}const kM=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Uw{constructor(t){super(dr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:_n(this.value,t,n)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const FU="tag:yaml.org,2002:";function BU(e,t,n){if(t){const r=n.filter(o=>o.tag===t),s=r.find(o=>!o.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function ul(e,t,n){var m,g,v;if(Al(e)&&(e=e.contents),dt(e))return e;if(ft(e)){const b=(g=(m=n.schema[vs]).createNode)==null?void 0:g.call(m,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:o,schema:a,sourceObjects:c}=n;let u;if(r&&e&&typeof e=="object"){if(u=c.get(e),u)return u.anchor??(u.anchor=s(e)),new Hw(u.anchor);u={anchor:null,node:null},c.set(e,u)}t!=null&&t.startsWith("!!")&&(t=FU+t.slice(2));let d=BU(e,t,a.tags);if(!d){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new Ae(e);return u&&(u.node=b),b}d=e instanceof Map?a[vs]:Symbol.iterator in Object(e)?a[Co]:a[vs]}o&&(o(d),delete n.onTagObj);const p=d!=null&&d.createNode?d.createNode(n.schema,e,n):typeof((v=d==null?void 0:d.nodeClass)==null?void 0:v.from)=="function"?d.nodeClass.from(n.schema,e,n):new Ae(e);return t?p.tag=t:d.default||(p.tag=d.tag),u&&(u.node=p),p}function dd(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const o=t[s];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const a=[];a[o]=r,r=a}else r=new Map([[o,r]])}return ul(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Da=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let NM=class extends Uw{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>dt(r)||ft(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Da(t))this.add(n);else{const[r,...s]=t,o=this.get(r,!0);if(ut(o))o.addIn(s,n);else if(o===void 0&&this.schema)this.set(r,dd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(ut(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,o=this.get(r,!0);return s.length===0?!n&&He(o)?o.value:o:ut(o)?o.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ft(n))return!1;const r=n.value;return r==null||t&&He(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return ut(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const o=this.get(r,!0);if(ut(o))o.setIn(s,n);else if(o===void 0&&this.schema)this.set(r,dd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};const zU=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Tr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ws=(e,t,n)=>e.endsWith(`
|
|
563
|
+
`)?Tr(n,t):n.includes(`
|
|
564
|
+
`)?`
|
|
565
|
+
`+Tr(n,t):(e.endsWith(" ")?"":" ")+n,CM="flow",Hx="block",zu="quoted";function Vd(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:o=20,onFold:a,onOverflow:c}={}){if(!s||s<0)return e;s<o&&(o=0);const u=Math.max(1+o,1+s-t.length);if(e.length<=u)return e;const d=[],p={};let m=s-t.length;typeof r=="number"&&(r>s-Math.max(2,o)?d.push(0):m=s-r);let g,v,b=!1,x=-1,w=-1,S=-1;n===Hx&&(x=lN(e,x,t.length),x!==-1&&(m=x+u));for(let k;k=e[x+=1];){if(n===zu&&k==="\\"){switch(w=x,e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}S=x}if(k===`
|
|
566
|
+
`)n===Hx&&(x=lN(e,x,t.length)),m=x+t.length+u,g=void 0;else{if(k===" "&&v&&v!==" "&&v!==`
|
|
567
|
+
`&&v!==" "){const N=e[x+1];N&&N!==" "&&N!==`
|
|
568
|
+
`&&N!==" "&&(g=x)}if(x>=m)if(g)d.push(g),m=g+u,g=void 0;else if(n===zu){for(;v===" "||v===" ";)v=k,k=e[x+=1],b=!0;const N=x>S+1?x-2:w-1;if(p[N])return e;d.push(N),p[N]=!0,m=N+u,g=void 0}else b=!0}v=k}if(b&&c&&c(),d.length===0)return e;a&&a();let C=e.slice(0,d[0]);for(let k=0;k<d.length;++k){const N=d[k],j=d[k+1]||e.length;N===0?C=`
|
|
569
|
+
${t}${e.slice(0,j)}`:(n===zu&&p[N]&&(C+=`${e[N]}\\`),C+=`
|
|
570
|
+
${t}${e.slice(N+1,j)}`)}return C}function lN(e,t,n){let r=t,s=t+1,o=e[s];for(;o===" "||o===" ";)if(t<s+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
571
|
+
`);r=t,s=t+1,o=e[s]}return r}const Ud=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Hd=e=>/^(%|---|\.\.\.)/m.test(e);function VU(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let o=0,a=0;o<s;++o)if(e[o]===`
|
|
572
|
+
`){if(o-a>r)return!0;if(a=o+1,s-a<=r)return!1}return!0}function Qa(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Hd(e)?" ":"");let a="",c=0;for(let u=0,d=n[u];d;d=n[++u])if(d===" "&&n[u+1]==="\\"&&n[u+2]==="n"&&(a+=n.slice(c,u)+"\\ ",u+=1,c=u,d="\\"),d==="\\")switch(n[u+1]){case"u":{a+=n.slice(c,u);const p=n.substr(u+2,4);switch(p){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:p.substr(0,2)==="00"?a+="\\x"+p.substr(2):a+=n.substr(u,6)}u+=5,c=u+1}break;case"n":if(r||n[u+2]==='"'||n.length<s)u+=1;else{for(a+=n.slice(c,u)+`
|
|
573
|
+
|
|
574
|
+
`;n[u+2]==="\\"&&n[u+3]==="n"&&n[u+4]!=='"';)a+=`
|
|
575
|
+
`,u+=2;a+=o,n[u+2]===" "&&(a+="\\"),u+=1,c=u+1}break;default:u+=1}return a=c?a+n.slice(c):n,r?a:Vd(a,o,zu,Ud(t,!1))}function Wx(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
576
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Qa(e,t);const n=t.indent||(Hd(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
577
|
+
${n}`)+"'";return t.implicitKey?r:Vd(r,n,CM,Ud(t,!1))}function no(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Qa;else{const s=e.includes('"'),o=e.includes("'");s&&!o?r=Wx:o&&!s?r=Qa:r=n?Wx:Qa}return r(e,t)}let Kx;try{Kx=new RegExp(`(^|(?<!
|
|
578
|
+
))
|
|
579
|
+
+(?!
|
|
580
|
+
|$)`,"g")}catch{Kx=/\n+(?!\n|$)/g}function Vu({comment:e,type:t,value:n},r,s,o){const{blockQuote:a,commentString:c,lineWidth:u}=r.options;if(!a||/\n[\t ]+$/.test(n))return no(n,r);const d=r.indent||(r.forceBlockIndent||Hd(n)?" ":""),p=a==="literal"?!0:a==="folded"||t===Ae.BLOCK_FOLDED?!1:t===Ae.BLOCK_LITERAL?!0:!VU(n,u,d.length);if(!n)return p?`|
|
|
581
|
+
`:`>
|
|
582
|
+
`;let m,g;for(g=n.length;g>0;--g){const j=n[g-1];if(j!==`
|
|
583
|
+
`&&j!==" "&&j!==" ")break}let v=n.substring(g);const b=v.indexOf(`
|
|
584
|
+
`);b===-1?m="-":n===v||b!==v.length-1?(m="+",o&&o()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
585
|
+
`&&(v=v.slice(0,-1)),v=v.replace(Kx,`$&${d}`));let x=!1,w,S=-1;for(w=0;w<n.length;++w){const j=n[w];if(j===" ")x=!0;else if(j===`
|
|
586
|
+
`)S=w;else break}let C=n.substring(0,S<w?S+1:w);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${d}`));let N=(x?d?"2":"1":"")+m;if(e&&(N+=" "+c(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!p){const j=n.replace(/\n+/g,`
|
|
587
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`);let A=!1;const R=Ud(r,!0);a!=="folded"&&t!==Ae.BLOCK_FOLDED&&(R.onOverflow=()=>{A=!0});const O=Vd(`${C}${j}${v}`,d,Hx,R);if(!A)return`>${N}
|
|
588
|
+
${d}${O}`}return n=n.replace(/\n+/g,`$&${d}`),`|${N}
|
|
589
|
+
${d}${C}${n}${v}`}function UU(e,t,n,r){const{type:s,value:o}=e,{actualString:a,implicitKey:c,indent:u,indentStep:d,inFlow:p}=t;if(c&&o.includes(`
|
|
590
|
+
`)||p&&/[[\]{},]/.test(o))return no(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||p||!o.includes(`
|
|
591
|
+
`)?no(o,t):Vu(e,t,n,r);if(!c&&!p&&s!==Ae.PLAIN&&o.includes(`
|
|
592
|
+
`))return Vu(e,t,n,r);if(Hd(o)){if(u==="")return t.forceBlockIndent=!0,Vu(e,t,n,r);if(c&&u===d)return no(o,t)}const m=o.replace(/\n+/g,`$&
|
|
593
|
+
${u}`);if(a){const g=x=>{var w;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((w=x.test)==null?void 0:w.test(m))},{compat:v,tags:b}=t.doc.schema;if(b.some(g)||v!=null&&v.some(g))return no(o,t)}return c?m:Vd(m,u,CM,Ud(t,!1))}function Ww(e,t,n,r){const{implicitKey:s,inFlow:o}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=Ae.QUOTE_DOUBLE);const u=p=>{switch(p){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return s||o?no(a.value,t):Vu(a,t,n,r);case Ae.QUOTE_DOUBLE:return Qa(a.value,t);case Ae.QUOTE_SINGLE:return Wx(a.value,t);case Ae.PLAIN:return UU(a,t,n,r);default:return null}};let d=u(c);if(d===null){const{defaultKeyType:p,defaultStringType:m}=t.options,g=s&&p||m;if(d=u(g),d===null)throw new Error(`Unsupported default string type ${g}`)}return d}function EM(e,t){const n=Object.assign({blockQuote:!0,commentString:zU,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function HU(e,t){var s;if(t.tag){const o=e.filter(a=>a.tag===t.tag);if(o.length>0)return o.find(a=>a.format===t.format)??o[0]}let n,r;if(He(t)){r=t.value;let o=e.filter(a=>{var c;return(c=a.identify)==null?void 0:c.call(a,r)});if(o.length>1){const a=o.filter(c=>c.test);a.length>0&&(o=a)}n=o.find(a=>a.format===t.format)??o.find(a=>!a.format)}else r=t,n=e.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!n){const o=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return n}function WU(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],o=(He(e)||ut(e))&&e.anchor;o&&bM(o)&&(n.add(o),s.push(`&${o}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function wo(e,t,n,r){var u;if(ft(e))return e.toString(t,n,r);if(oi(e)){if(t.doc.directives)return e.toString(t);if((u=t.resolvedAliases)!=null&&u.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const o=dt(e)?e:t.doc.createNode(e,{onTagObj:d=>s=d});s??(s=HU(t.doc.schema.tags,o));const a=WU(o,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const c=typeof s.stringify=="function"?s.stringify(o,t,n,r):He(o)?Ww(o,t,n,r):o.toString(t,n,r);return a?He(o)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
|
|
594
|
+
${t.indent}${c}`:c}function KU({key:e,value:t},n,r,s){const{allNullValues:o,doc:a,indent:c,indentStep:u,options:{commentString:d,indentSeq:p,simpleKeys:m}}=n;let g=dt(e)&&e.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ut(e)||!dt(e)&&typeof e=="object"){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let v=!m&&(!e||g&&t==null&&!n.inFlow||ut(e)||(He(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!o),indent:c+u});let b=!1,x=!1,w=wo(e,n,()=>b=!0,()=>x=!0);if(!v&&!n.inFlow&&w.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(o||t==null)return b&&r&&r(),w===""?"?":v?`? ${w}`:w}else if(o&&!m||t==null&&v)return w=`? ${w}`,g&&!b?w+=Ws(w,n.indent,d(g)):x&&s&&s(),w;b&&(g=null),v?(g&&(w+=Ws(w,n.indent,d(g))),w=`? ${w}
|
|
595
|
+
${c}:`):(w=`${w}:`,g&&(w+=Ws(w,n.indent,d(g))));let S,C,k;dt(t)?(S=!!t.spaceBefore,C=t.commentBefore,k=t.comment):(S=!1,C=null,k=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!v&&!g&&He(t)&&(n.indentAtStart=w.length+1),x=!1,!p&&u.length>=2&&!n.inFlow&&!v&&Il(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let N=!1;const j=wo(t,n,()=>N=!0,()=>x=!0);let A=" ";if(g||S||C){if(A=S?`
|
|
596
|
+
`:"",C){const R=d(C);A+=`
|
|
597
|
+
${Tr(R,n.indent)}`}j===""&&!n.inFlow?A===`
|
|
598
|
+
`&&k&&(A=`
|
|
599
|
+
|
|
600
|
+
`):A+=`
|
|
601
|
+
${n.indent}`}else if(!v&&ut(t)){const R=j[0],O=j.indexOf(`
|
|
602
|
+
`),L=O!==-1,B=n.inFlow??t.flow??t.items.length===0;if(L||!B){let M=!1;if(L&&(R==="&"||R==="!")){let $=j.indexOf(" ");R==="&"&&$!==-1&&$<O&&j[$+1]==="!"&&($=j.indexOf(" ",$+1)),($===-1||O<$)&&(M=!0)}M||(A=`
|
|
603
|
+
${n.indent}`)}}else(j===""||j[0]===`
|
|
604
|
+
`)&&(A="");return w+=A+j,n.inFlow?N&&r&&r():k&&!N?w+=Ws(w,n.indent,d(k)):x&&s&&s(),w}function jM(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const _u="<<",Rr={identify:e=>e===_u||typeof e=="symbol"&&e.description===_u,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(_u)),{addToJSMap:TM}),stringify:()=>_u},GU=(e,t)=>(Rr.identify(t)||He(t)&&(!t.type||t.type===Ae.PLAIN)&&Rr.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Rr.tag&&n.default));function TM(e,t,n){if(n=e&&oi(n)?n.resolve(e.doc):n,Il(n))for(const r of n.items)Up(e,t,r);else if(Array.isArray(n))for(const r of n)Up(e,t,r);else Up(e,t,n)}function Up(e,t,n){const r=e&&oi(n)?n.resolve(e.doc):n;if(!Rl(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[o,a]of s)t instanceof Map?t.has(o)||t.set(o,a):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function AM(e,t,{key:n,value:r}){if(dt(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(GU(e,n))TM(e,t,r);else{const s=_n(n,"",e);if(t instanceof Map)t.set(s,_n(r,s,e));else if(t instanceof Set)t.add(s);else{const o=YU(n,s,e),a=_n(r,o,e);o in t?Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[o]=a}}return t}function YU(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(dt(e)&&(n!=null&&n.doc)){const r=EM(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(s);o.length>40&&(o=o.substring(0,36)+'..."'),jM(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function Kw(e,t,n){const r=ul(e,void 0,n),s=ul(t,void 0,n);return new Ft(r,s)}class Ft{constructor(t,n=null){Object.defineProperty(this,Nn,{value:xM}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return dt(n)&&(n=n.clone(t)),dt(r)&&(r=r.clone(t)),new Ft(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return AM(n,r,this)}toString(t,n,r){return t!=null&&t.doc?KU(this,t,n,r):JSON.stringify(this)}}function RM(e,t,n){return(t.inFlow??e.flow?QU:XU)(e,t,n)}function XU({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:o,onChompKeep:a,onComment:c}){const{indent:u,options:{commentString:d}}=n,p=Object.assign({},n,{indent:o,type:null});let m=!1;const g=[];for(let b=0;b<t.length;++b){const x=t[b];let w=null;if(dt(x))!m&&x.spaceBefore&&g.push(""),fd(n,g,x.commentBefore,m),x.comment&&(w=x.comment);else if(ft(x)){const C=dt(x.key)?x.key:null;C&&(!m&&C.spaceBefore&&g.push(""),fd(n,g,C.commentBefore,m))}m=!1;let S=wo(x,p,()=>w=null,()=>m=!0);w&&(S+=Ws(S,o,d(w))),m&&w&&(m=!1),g.push(r+S)}let v;if(g.length===0)v=s.start+s.end;else{v=g[0];for(let b=1;b<g.length;++b){const x=g[b];v+=x?`
|
|
605
|
+
${u}${x}`:`
|
|
606
|
+
`}}return e?(v+=`
|
|
607
|
+
`+Tr(d(e),u),c&&c()):m&&a&&a(),v}function QU({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:o,flowCollectionPadding:a,options:{commentString:c}}=t;r+=o;const u=Object.assign({},t,{indent:r,inFlow:!0,type:null});let d=!1,p=0;const m=[];for(let b=0;b<e.length;++b){const x=e[b];let w=null;if(dt(x))x.spaceBefore&&m.push(""),fd(t,m,x.commentBefore,!1),x.comment&&(w=x.comment);else if(ft(x)){const C=dt(x.key)?x.key:null;C&&(C.spaceBefore&&m.push(""),fd(t,m,C.commentBefore,!1),C.comment&&(d=!0));const k=dt(x.value)?x.value:null;k?(k.comment&&(w=k.comment),k.commentBefore&&(d=!0)):x.value==null&&(C!=null&&C.comment)&&(w=C.comment)}w&&(d=!0);let S=wo(x,u,()=>w=null);b<e.length-1&&(S+=","),w&&(S+=Ws(S,r,c(w))),!d&&(m.length>p||S.includes(`
|
|
608
|
+
`))&&(d=!0),m.push(S),p=m.length}const{start:g,end:v}=n;if(m.length===0)return g+v;if(!d){const b=m.reduce((x,w)=>x+w.length+2,2);d=t.options.lineWidth>0&&b>t.options.lineWidth}if(d){let b=g;for(const x of m)b+=x?`
|
|
609
|
+
${o}${s}${x}`:`
|
|
610
|
+
`;return`${b}
|
|
611
|
+
${s}${v}`}else return`${g}${a}${m.join(" ")}${a}${v}`}function fd({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const o=Tr(t(r),e);n.push(o.trimStart())}}function Ks(e,t){const n=He(t)?t.value:t;for(const r of e)if(ft(r)&&(r.key===t||r.key===n||He(r.key)&&r.key.value===n))return r}class Sn extends NM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(vs,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:o}=r,a=new this(t),c=(u,d)=>{if(typeof o=="function")d=o.call(n,u,d);else if(Array.isArray(o)&&!o.includes(u))return;(d!==void 0||s)&&a.items.push(Kw(u,d,r))};if(n instanceof Map)for(const[u,d]of n)c(u,d);else if(n&&typeof n=="object")for(const u of Object.keys(n))c(u,n[u]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;ft(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Ft(t,t==null?void 0:t.value):r=new Ft(t.key,t.value);const s=Ks(this.items,r.key),o=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);He(s.value)&&kM(r.value)?s.value.value=r.value:s.value=r.value}else if(o){const c=this.items.findIndex(u=>o(r,u)<0);c===-1?this.items.push(r):this.items.splice(c,0,r)}else this.items.push(r)}delete(t){const n=Ks(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Ks(this.items,t),s=r==null?void 0:r.value;return(!n&&He(s)?s.value:s)??void 0}has(t){return!!Ks(this.items,t)}set(t,n){this.add(new Ft(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const o of this.items)AM(n,s,o);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!ft(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),RM(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const jo={collection:"map",default:!0,nodeClass:Sn,tag:"tag:yaml.org,2002:map",resolve(e,t){return Rl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Sn.from(e,t,n)};class ri extends NM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Co,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ku(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=ku(t);if(typeof r!="number")return;const s=this.items[r];return!n&&He(s)?s.value:s}has(t){const n=ku(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=ku(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];He(s)&&kM(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let s=0;for(const o of this.items)r.push(_n(o,String(s++),n));return r}toString(t,n,r){return t?RM(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof s=="function"){const u=n instanceof Set?c:String(a++);c=s.call(n,u,c)}o.items.push(ul(c,void 0,r))}}return o}}function ku(e){let t=He(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const To={collection:"seq",default:!0,nodeClass:ri,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Il(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ri.from(e,t,n)},Wd={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ww(e,t,n,r)}},Kd={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},t)=>typeof e=="string"&&Kd.test.test(e)?e:t.options.nullStr},Gw={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Gw.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Kn({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let a=o.indexOf(".");a<0&&(a=o.length,o+=".");let c=t-(o.length-a-1);for(;c-- >0;)o+="0"}return o}const IM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Kn},MM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Kn(e)}},OM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Ae(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Kn},Gd=e=>typeof e=="bigint"||Number.isInteger(e),Yw=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function PM(e,t,n){const{value:r}=e;return Gd(r)&&r>=0?n+r.toString(t):Kn(e)}const LM={identify:e=>Gd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Yw(e,2,8,n),stringify:e=>PM(e,8,"0o")},DM={identify:Gd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Yw(e,0,10,n),stringify:Kn},$M={identify:e=>Gd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Yw(e,2,16,n),stringify:e=>PM(e,16,"0x")},JU=[jo,To,Wd,Kd,Gw,LM,DM,$M,IM,MM,OM];function cN(e){return typeof e=="bigint"||Number.isInteger(e)}const Nu=({value:e})=>JSON.stringify(e),ZU=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Nu},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Nu},{identify:cN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>cN(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Nu}],eH={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},tH=[jo,To].concat(ZU,eH),Xw={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,o){if(!n)return"";const a=n;let c;if(typeof btoa=="function"){let u="";for(let d=0;d<a.length;++d)u+=String.fromCharCode(a[d]);c=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Ae.BLOCK_LITERAL),t!==Ae.QUOTE_DOUBLE){const u=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),d=Math.ceil(c.length/u),p=new Array(d);for(let m=0,g=0;m<d;++m,g+=u)p[m]=c.substr(g,u);c=p.join(t===Ae.BLOCK_LITERAL?`
|
|
612
|
+
`:" ")}return Ww({comment:e,type:t,value:c},r,s,o)}};function qM(e,t){if(Il(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ft(r)){if(Rl(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new Ft(new Ae(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
613
|
+
${s.key.commentBefore}`:r.commentBefore),r.comment){const o=s.value??s.key;o.comment=o.comment?`${r.comment}
|
|
614
|
+
${o.comment}`:r.comment}r=s}e.items[n]=ft(r)?r:new Ft(r)}}else t("Expected a sequence for this tag");return e}function FM(e,t,n){const{replacer:r}=n,s=new ri(e);s.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(o++),a));let c,u;if(Array.isArray(a))if(a.length===2)c=a[0],u=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const d=Object.keys(a);if(d.length===1)c=d[0],u=a[c];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else c=a;s.items.push(Kw(c,u,n))}return s}const Qw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qM,createNode:FM};class ao extends ri{constructor(){super(),this.add=Sn.prototype.add.bind(this),this.delete=Sn.prototype.delete.bind(this),this.get=Sn.prototype.get.bind(this),this.has=Sn.prototype.has.bind(this),this.set=Sn.prototype.set.bind(this),this.tag=ao.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let o,a;if(ft(s)?(o=_n(s.key,"",n),a=_n(s.value,o,n)):o=_n(s,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,a)}return r}static from(t,n,r){const s=FM(t,n,r),o=new this;return o.items=s.items,o}}ao.tag="tag:yaml.org,2002:omap";const Jw={collection:"seq",identify:e=>e instanceof Map,nodeClass:ao,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=qM(e,t),r=[];for(const{key:s}of n.items)He(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new ao,n)},createNode:(e,t,n)=>ao.from(e,t,n)};function BM({value:e,source:t},n){return t&&(e?zM:VM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const zM={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:BM},VM={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:BM},nH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Kn},rH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Kn(e)}},sH={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Ae(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Kn},Ml=e=>typeof e=="bigint"||Number.isInteger(e);function Yd(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const o=parseInt(e,n);return s==="-"?-1*o:o}function Zw(e,t,n){const{value:r}=e;if(Ml(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Kn(e)}const iH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Yd(e,2,2,n),stringify:e=>Zw(e,2,"0b")},oH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Yd(e,1,8,n),stringify:e=>Zw(e,8,"0")},aH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Yd(e,0,10,n),stringify:Kn},lH={identify:Ml,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Yd(e,2,16,n),stringify:e=>Zw(e,16,"0x")};class lo extends Sn{constructor(t){super(t),this.tag=lo.tag}add(t){let n;ft(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ft(t.key,null):n=new Ft(t,null),Ks(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ks(this.items,t);return!n&&ft(r)?He(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Ks(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ft(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),o.items.push(Kw(a,null,r));return o}}lo.tag="tag:yaml.org,2002:set";const eb={collection:"map",identify:e=>e instanceof Set,nodeClass:lo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>lo.from(e,t,n),resolve(e,t){if(Rl(e)){if(e.hasAllNullValues(!0))return Object.assign(new lo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function tb(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),o=r.replace(/_/g,"").split(":").reduce((a,c)=>a*s(60)+s(c),s(0));return n==="-"?s(-1)*o:o}function UM(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Kn(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),o=[t%s];return t<60?o.unshift(0):(t=(t-o[0])/s,o.unshift(t%s),t>=60&&(t=(t-o[0])/s,o.unshift(t))),r+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const HM={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>tb(e,n),stringify:UM},WM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>tb(e,!1),stringify:UM},Xd={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Xd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,o,a,c]=t.map(Number),u=t[7]?Number((t[7]+"00").substr(1,3)):0;let d=Date.UTC(n,r-1,s,o||0,a||0,c||0,u);const p=t[8];if(p&&p!=="Z"){let m=tb(p,!1);Math.abs(m)<30&&(m*=60),d-=6e4*m}return new Date(d)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},uN=[jo,To,Wd,Kd,zM,VM,iH,oH,aH,lH,nH,rH,sH,Xw,Rr,Jw,Qw,eb,HM,WM,Xd],dN=new Map([["core",JU],["failsafe",[jo,To,Wd]],["json",tH],["yaml11",uN],["yaml-1.1",uN]]),fN={binary:Xw,bool:Gw,float:OM,floatExp:MM,floatNaN:IM,floatTime:WM,int:DM,intHex:$M,intOct:LM,intTime:HM,map:jo,merge:Rr,null:Kd,omap:Jw,pairs:Qw,seq:To,set:eb,timestamp:Xd},cH={"tag:yaml.org,2002:binary":Xw,"tag:yaml.org,2002:merge":Rr,"tag:yaml.org,2002:omap":Jw,"tag:yaml.org,2002:pairs":Qw,"tag:yaml.org,2002:set":eb,"tag:yaml.org,2002:timestamp":Xd};function Hp(e,t,n){const r=dN.get(t);if(r&&!e)return n&&!r.includes(Rr)?r.concat(Rr):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const o=Array.from(dN.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)s=s.concat(o);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Rr)),s.reduce((o,a)=>{const c=typeof a=="string"?fN[a]:a;if(!c){const u=JSON.stringify(a),d=Object.keys(fN).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return o.includes(c)||o.push(c),o},[])}const uH=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class nb{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:o,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?Hp(t,"compat"):t?Hp(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=s?cH:{},this.tags=Hp(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,vs,{value:jo}),Object.defineProperty(this,dr,{value:Wd}),Object.defineProperty(this,Co,{value:To}),this.sortMapEntries=typeof a=="function"?a:a===!0?uH:null}clone(){const t=Object.create(nb.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function dH(e,t){var u;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=EM(e,t),{commentString:o}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=o(e.commentBefore);n.unshift(Tr(d,""))}let a=!1,c=null;if(e.contents){if(dt(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const m=o(e.contents.commentBefore);n.push(Tr(m,""))}s.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>a=!0;let p=wo(e.contents,s,()=>c=null,d);c&&(p+=Ws(p,"",o(c))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(wo(e.contents,s));if((u=e.directives)!=null&&u.docEnd)if(e.comment){const d=o(e.comment);d.includes(`
|
|
615
|
+
`)?(n.push("..."),n.push(Tr(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&a&&(d=d.replace(/^\n+/,"")),d&&((!a||c)&&n[n.length-1]!==""&&n.push(""),n.push(Tr(o(d),"")))}return n.join(`
|
|
616
|
+
`)+`
|
|
617
|
+
`}class Ol{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Nn,{value:Ux});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:a}=o;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new qt({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Ol.prototype,{[Nn]:{value:Ux}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=dt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Ki(this.contents)&&this.contents.add(t)}addIn(t,n){Ki(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=SM(this);t.anchor=!n||r.has(n)?_M(n||"a",r):n}return new Hw(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=C=>typeof C=="number"||C instanceof String||C instanceof Number,S=n.filter(w).map(String);S.length>0&&(n=n.concat(S)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:o,anchorPrefix:a,flow:c,keepUndefined:u,onTagObj:d,tag:p}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:v}=qU(this,a||"a"),b={aliasDuplicateObjects:o??!0,keepUndefined:u??!1,onAnchor:m,onTagObj:d,replacer:s,schema:this.schema,sourceObjects:v},x=ul(t,p,b);return c&&ut(x)&&(x.flow=!0),g(),x}createPair(t,n,r={}){const s=this.createNode(t,null,r),o=this.createNode(n,null,r);return new Ft(s,o)}delete(t){return Ki(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Da(t)?this.contents==null?!1:(this.contents=null,!0):Ki(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ut(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Da(t)?!n&&He(this.contents)?this.contents.value:this.contents:ut(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ut(this.contents)?this.contents.has(t):!1}hasIn(t){return Da(t)?this.contents!==void 0:ut(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=dd(this.schema,[t],n):Ki(this.contents)&&this.contents.set(t,n)}setIn(t,n){Da(t)?this.contents=n:this.contents==null?this.contents=dd(this.schema,Array.from(t),n):Ki(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new qt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new qt({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new nb(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:o,reviver:a}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},u=_n(this.contents,n??"",c);if(typeof o=="function")for(const{count:d,res:p}of c.anchors.values())o(p,d);return typeof a=="function"?to(a,{"":u},"",u):u}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return dH(this,t)}}function Ki(e){if(ut(e))return!0;throw new Error("Expected a YAML collection as document contents")}class KM extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class $a extends KM{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class fH extends KM{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const hN=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let o=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const c=Math.min(o-39,a.length-79);a="…"+a.substring(c),o-=c-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
618
|
+
`),a=c+a}if(/[^ ]/.test(a)){let c=1;const u=n.linePos[1];(u==null?void 0:u.line)===r&&u.col>s&&(c=Math.max(1,Math.min(u.col-s,80-o)));const d=" ".repeat(o)+"^".repeat(c);n.message+=`:
|
|
619
|
+
|
|
620
|
+
${a}
|
|
621
|
+
${d}
|
|
622
|
+
`}};function bo(e,{flow:t,indicator:n,next:r,offset:s,onError:o,parentIndent:a,startOnNewline:c}){let u=!1,d=c,p=c,m="",g="",v=!1,b=!1,x=null,w=null,S=null,C=null,k=null,N=null,j=null;for(const O of e)switch(b&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&o(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),x&&(d&&O.type!=="comment"&&O.type!=="newline"&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),O.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&O.source.includes(" ")&&(x=O),p=!0;break;case"comment":{p||o(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=O.source.substring(1)||" ";m?m+=g+L:m=L,g="",d=!1;break}case"newline":d?m?m+=O.source:(!N||n!=="seq-item-ind")&&(u=!0):g+=O.source,d=!0,v=!0,(w||S)&&(C=O),p=!0;break;case"anchor":w&&o(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&o(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=O,j??(j=O.offset),d=!1,p=!1,b=!0;break;case"tag":{S&&o(O,"MULTIPLE_TAGS","A node can have at most one tag"),S=O,j??(j=O.offset),d=!1,p=!1,b=!0;break}case n:(w||S)&&o(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),N&&o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),N=O,d=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){k&&o(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=O,d=!1,p=!1;break}default:o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),d=!1,p=!1}const A=e[e.length-1],R=A?A.offset+A.source.length:s;return b&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(d&&x.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:N,spaceBefore:u,comment:m,hasNewline:v,anchor:w,tag:S,newlineAfterProp:C,end:R,start:j??R}}function dl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
623
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(dl(t.key)||dl(t.value))return!0}return!1;default:return!0}}function Gx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&dl(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function GM(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(o,a)=>o===a||He(o)&&He(a)&&o.value===a.value;return t.some(o=>s(o.key,n))}const pN="All mapping items must start at the same column";function hH({composeNode:e,composeEmptyNode:t},n,r,s,o){var p;const a=(o==null?void 0:o.nodeClass)??Sn,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let u=r.offset,d=null;for(const m of r.items){const{start:g,key:v,sep:b,value:x}=m,w=bo(g,{indicator:"explicit-key-ind",next:v??(b==null?void 0:b[0]),offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0}),S=!w.found;if(S){if(v&&(v.type==="block-seq"?s(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==r.indent&&s(u,"BAD_INDENT",pN)),!w.anchor&&!w.tag&&!b){d=w.end,w.comment&&(c.comment?c.comment+=`
|
|
624
|
+
`+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||dl(v))&&s(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=w.found)==null?void 0:p.indent)!==r.indent&&s(u,"BAD_INDENT",pN);n.atKey=!0;const C=w.end,k=v?e(n,v,w,s):t(n,C,g,null,w,s);n.schema.compat&&Gx(r.indent,v,s),n.atKey=!1,GM(n,c.items,k)&&s(C,"DUPLICATE_KEY","Map keys must be unique");const N=bo(b??[],{indicator:"map-value-ind",next:x,offset:k.range[2],onError:s,parentIndent:r.indent,startOnNewline:!v||v.type==="block-scalar"});if(u=N.end,N.found){S&&((x==null?void 0:x.type)==="block-map"&&!N.hasNewline&&s(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<N.found.offset-1024&&s(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const j=x?e(n,x,N,s):t(n,u,b,null,N,s);n.schema.compat&&Gx(r.indent,x,s),u=j.range[2];const A=new Ft(k,j);n.options.keepSourceTokens&&(A.srcToken=m),c.items.push(A)}else{S&&s(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(k.comment?k.comment+=`
|
|
625
|
+
`+N.comment:k.comment=N.comment);const j=new Ft(k);n.options.keepSourceTokens&&(j.srcToken=m),c.items.push(j)}}return d&&d<u&&s(d,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,u,d??u],c}function pH({composeNode:e,composeEmptyNode:t},n,r,s,o){const a=(o==null?void 0:o.nodeClass)??ri,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset,d=null;for(const{start:p,value:m}of r.items){const g=bo(p,{indicator:"seq-item-ind",next:m,offset:u,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||m)(m==null?void 0:m.type)==="block-seq"?s(g.end,"BAD_INDENT","All sequence items must start at the same column"):s(u,"MISSING_CHAR","Sequence item without - indicator");else{d=g.end,g.comment&&(c.comment=g.comment);continue}const v=m?e(n,m,g,s):t(n,g.end,p,null,g,s);n.schema.compat&&Gx(r.indent,m,s),u=v.range[2],c.items.push(v)}return c.range=[r.offset,u,d??u],c}function Pl(e,t,n,r){let s="";if(e){let o=!1,a="";for(const c of e){const{source:u,type:d}=c;switch(d){case"space":o=!0;break;case"comment":{n&&!o&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=u.substring(1)||" ";s?s+=a+p:s=p,a="";break}case"newline":s&&(a+=u),o=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}t+=u.length}}return{comment:s,offset:t}}const Wp="Block collections are not allowed within flow collections",Kp=e=>e&&(e.type==="block-map"||e.type==="block-seq");function mH({composeNode:e,composeEmptyNode:t},n,r,s,o){var w;const a=r.start.source==="{",c=a?"flow map":"flow sequence",u=(o==null?void 0:o.nodeClass)??(a?Sn:ri),d=new u(n.schema);d.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){const C=r.items[S],{start:k,key:N,sep:j,value:A}=C,R=bo(k,{flow:c,indicator:"explicit-key-ind",next:N??(j==null?void 0:j[0]),offset:m,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!R.found){if(!R.anchor&&!R.tag&&!j&&!A){S===0&&R.comma?s(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):S<r.items.length-1&&s(R.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),R.comment&&(d.comment?d.comment+=`
|
|
626
|
+
`+R.comment:d.comment=R.comment),m=R.end;continue}!a&&n.options.strict&&dl(N)&&s(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)R.comma&&s(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(R.comma||s(R.start,"MISSING_CHAR",`Missing , between ${c} items`),R.comment){let O="";e:for(const L of k)switch(L.type){case"comma":case"space":break;case"comment":O=L.source.substring(1);break e;default:break e}if(O){let L=d.items[d.items.length-1];ft(L)&&(L=L.value??L.key),L.comment?L.comment+=`
|
|
627
|
+
`+O:L.comment=O,R.comment=R.comment.substring(O.length+1)}}if(!a&&!j&&!R.found){const O=A?e(n,A,R,s):t(n,R.end,j,null,R,s);d.items.push(O),m=O.range[2],Kp(A)&&s(O.range,"BLOCK_IN_FLOW",Wp)}else{n.atKey=!0;const O=R.end,L=N?e(n,N,R,s):t(n,O,k,null,R,s);Kp(N)&&s(L.range,"BLOCK_IN_FLOW",Wp),n.atKey=!1;const B=bo(j??[],{flow:c,indicator:"map-value-ind",next:A,offset:L.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(B.found){if(!a&&!R.found&&n.options.strict){if(j)for(const U of j){if(U===B.found)break;if(U.type==="newline"){s(U,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}R.start<B.found.offset-1024&&s(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&((w=A.source)==null?void 0:w[0])===":"?s(A,"MISSING_CHAR",`Missing space after : in ${c}`):s(B.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const M=A?e(n,A,B,s):B.found?t(n,B.end,j,null,B,s):null;M?Kp(A)&&s(M.range,"BLOCK_IN_FLOW",Wp):B.comment&&(L.comment?L.comment+=`
|
|
628
|
+
`+B.comment:L.comment=B.comment);const $=new Ft(L,M);if(n.options.keepSourceTokens&&($.srcToken=C),a){const U=d;GM(n,U.items,L)&&s(O,"DUPLICATE_KEY","Map keys must be unique"),U.items.push($)}else{const U=new Sn(n.schema);U.flow=!0,U.items.push($);const D=(M??L).range;U.range=[L.range[0],D[1],D[2]],d.items.push(U)}m=M?M.range[2]:B.end}}const g=a?"}":"]",[v,...b]=r.end;let x=m;if((v==null?void 0:v.source)===g)x=v.offset+v.source.length;else{const S=c[0].toUpperCase()+c.substring(1),C=p?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;s(m,p?"MISSING_CHAR":"BAD_INDENT",C),v&&v.source.length!==1&&b.unshift(v)}if(b.length>0){const S=Pl(b,x,n.options.strict,s);S.comment&&(d.comment?d.comment+=`
|
|
629
|
+
`+S.comment:d.comment=S.comment),d.range=[r.offset,x,S.offset]}else d.range=[r.offset,x,x];return d}function Gp(e,t,n,r,s,o){const a=n.type==="block-map"?hH(e,t,n,r,o):n.type==="block-seq"?pH(e,t,n,r,o):mH(e,t,n,r,o),c=a.constructor;return s==="!"||s===c.tagName?(a.tag=c.tagName,a):(s&&(a.tag=s),a)}function gH(e,t,n,r,s){var g;const o=r.tag,a=o?t.directives.tagName(o.source,v=>s(o,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:b}=r,x=v&&o?v.offset>o.offset?v:o:v??o;x&&(!b||b.offset<x.offset)&&s(x,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!a||a==="!"||a===Sn.tagName&&c==="map"||a===ri.tagName&&c==="seq")return Gp(e,t,n,s,a);let u=t.schema.tags.find(v=>v.tag===a&&v.collection===c);if(!u){const v=t.schema.knownTags[a];if((v==null?void 0:v.collection)===c)t.schema.tags.push(Object.assign({},v,{default:!1})),u=v;else return v?s(o,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):s(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Gp(e,t,n,s,a)}const d=Gp(e,t,n,s,a,u),p=((g=u.resolve)==null?void 0:g.call(u,d,v=>s(o,"TAG_RESOLVE_FAILED",v),t.options))??d,m=dt(p)?p:new Ae(p);return m.range=d.range,m.tag=a,u!=null&&u.format&&(m.format=u.format),m}function yH(e,t,n){const r=t.offset,s=vH(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const o=s.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,a=t.source?xH(t.source):[];let c=a.length;for(let x=a.length-1;x>=0;--x){const w=a[x][1];if(w===""||w==="\r")c=x;else break}if(c===0){const x=s.chomp==="+"&&a.length>0?`
|
|
630
|
+
`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:x,type:o,comment:s.comment,range:[r,w,w]}}let u=t.indent+s.indent,d=t.offset+s.length,p=0;for(let x=0;x<c;++x){const[w,S]=a[x];if(S===""||S==="\r")s.indent===0&&w.length>u&&(u=w.length);else{w.length<u&&n(d+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(u=w.length),p=x,u===0&&!e.atRoot&&n(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=w.length+S.length+1}for(let x=a.length-1;x>=c;--x)a[x][0].length>u&&(c=x+1);let m="",g="",v=!1;for(let x=0;x<p;++x)m+=a[x][0].slice(u)+`
|
|
631
|
+
`;for(let x=p;x<c;++x){let[w,S]=a[x];d+=w.length+S.length+1;const C=S[S.length-1]==="\r";if(C&&(S=S.slice(0,-1)),S&&w.length<u){const N=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(d-S.length-(C?2:1),"BAD_INDENT",N),w=""}o===Ae.BLOCK_LITERAL?(m+=g+w.slice(u)+S,g=`
|
|
632
|
+
`):w.length>u||S[0]===" "?(g===" "?g=`
|
|
633
|
+
`:!v&&g===`
|
|
634
|
+
`&&(g=`
|
|
635
|
+
|
|
636
|
+
`),m+=g+w.slice(u)+S,g=`
|
|
637
|
+
`,v=!0):S===""?g===`
|
|
638
|
+
`?m+=`
|
|
639
|
+
`:g=`
|
|
640
|
+
`:(m+=g+S,g=" ",v=!1)}switch(s.chomp){case"-":break;case"+":for(let x=c;x<a.length;++x)m+=`
|
|
641
|
+
`+a[x][0].slice(u);m[m.length-1]!==`
|
|
642
|
+
`&&(m+=`
|
|
643
|
+
`);break;default:m+=`
|
|
644
|
+
`}const b=r+s.length+t.source.length;return{value:m,type:o,comment:s.comment,range:[r,b,b]}}function vH({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],o=s[0];let a=0,c="",u=-1;for(let g=1;g<s.length;++g){const v=s[g];if(!c&&(v==="-"||v==="+"))c=v;else{const b=Number(v);!a&&b?a=b:u===-1&&(u=e+g)}}u!==-1&&r(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let d=!1,p="",m=s.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":d=!0;case"newline":m+=v.source.length;break;case"comment":n&&!d&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const b=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",b);const x=v.source;x&&typeof x=="string"&&(m+=x.length)}}}return{mode:o,indent:a,chomp:c,comment:p,length:m}}function xH(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),o=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)o.push([t[a],t[a+1]]);return o}function wH(e,t,n){const{offset:r,type:s,source:o,end:a}=e;let c,u;const d=(g,v,b)=>n(r+g,v,b);switch(s){case"scalar":c=Ae.PLAIN,u=bH(o,d);break;case"single-quoted-scalar":c=Ae.QUOTE_SINGLE,u=SH(o,d);break;case"double-quoted-scalar":c=Ae.QUOTE_DOUBLE,u=_H(o,d);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const p=r+o.length,m=Pl(a,p,t,n);return{value:u,type:c,comment:m.comment,range:[r,p,m.offset]}}function bH(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),YM(e)}function SH(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),YM(e.slice(1,-1)).replace(/''/g,"'")}function YM(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
645
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
646
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],o=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?o===`
|
|
647
|
+
`?s+=o:o=`
|
|
648
|
+
`:(s+=o+r[1],o=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),s+o+((r==null?void 0:r[1])??"")}function _H(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
|
|
649
|
+
`))if(s===`
|
|
650
|
+
`){const{fold:o,offset:a}=kH(e,r);n+=o,r=a}else if(s==="\\"){let o=e[++r];const a=NH[o];if(a)n+=a;else if(o===`
|
|
651
|
+
`)for(o=e[r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="\r"&&e[r+1]===`
|
|
652
|
+
`)for(o=e[++r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="x"||o==="u"||o==="U"){const c={x:2,u:4,U:8}[o];n+=CH(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(s===" "||s===" "){const o=r;let a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
|
|
653
|
+
`&&!(a==="\r"&&e[r+2]===`
|
|
654
|
+
`)&&(n+=r>o?e.slice(o,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function kH(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
655
|
+
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
656
|
+
`);)r===`
|
|
657
|
+
`&&(n+=`
|
|
658
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const NH={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
659
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function CH(e,t,n,r){const s=e.substr(t,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(a)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(a)}function XM(e,t,n,r){const{value:s,type:o,comment:a,range:c}=t.type==="block-scalar"?yH(e,t,r):wH(t,e.options.strict,r),u=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let d;e.options.stringKeys&&e.atKey?d=e.schema[dr]:u?d=EH(e.schema,s,u,n,r):t.type==="scalar"?d=jH(e,s,t,r):d=e.schema[dr];let p;try{const m=d.resolve(s,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);p=He(m)?m:new Ae(m)}catch(m){const g=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",g),p=new Ae(s)}return p.range=c,p.source=s,o&&(p.type=o),u&&(p.tag=u),d.format&&(p.format=d.format),a&&(p.comment=a),p}function EH(e,t,n,r,s){var c;if(n==="!")return e[dr];const o=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)o.push(u);else return u;for(const u of o)if((c=u.test)!=null&&c.test(t))return u;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[dr])}function jH({atKey:e,directives:t,schema:n},r,s,o){const a=n.tags.find(c=>{var u;return(c.default===!0||e&&c.default==="key")&&((u=c.test)==null?void 0:u.test(r))})||n[dr];if(n.compat){const c=n.compat.find(u=>{var d;return u.default&&((d=u.test)==null?void 0:d.test(r))})??n[dr];if(a.tag!==c.tag){const u=t.tagString(a.tag),d=t.tagString(c.tag),p=`Value may be parsed as either ${u} or ${d}`;o(s,"TAG_RESOLVE_FAILED",p,!0)}}return a}function TH(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const AH={composeNode:QM,composeEmptyNode:rb};function QM(e,t,n,r){const s=e.atKey,{spaceBefore:o,comment:a,anchor:c,tag:u}=n;let d,p=!0;switch(t.type){case"alias":d=RH(e,t,r),(c||u)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=XM(e,t,u,r),c&&(d.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":d=gH(AH,e,t,n,r),c&&(d.anchor=c.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),d=rb(e,t.offset,void 0,null,n,r),p=!1}}return c&&d.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!He(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&r(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(d.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?d.comment=a:d.commentBefore=a),e.options.keepSourceTokens&&p&&(d.srcToken=t),d}function rb(e,t,n,r,{spaceBefore:s,comment:o,anchor:a,tag:c,end:u},d){const p={type:"scalar",offset:TH(t,n,r),indent:-1,source:""},m=XM(e,p,c,d);return a&&(m.anchor=a.source.substring(1),m.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(m.spaceBefore=!0),o&&(m.comment=o,m.range[2]=u),m}function RH({options:e},{offset:t,source:n,end:r},s){const o=new Hw(n.substring(1));o.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,c=Pl(r,a,e.strict,s);return o.range=[t,a,c.offset],c.comment&&(o.comment=c.comment),o}function IH(e,t,{offset:n,start:r,value:s,end:o},a){const c=Object.assign({_directives:t},e),u=new Ol(void 0,c),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},p=bo(r,{indicator:"doc-start",next:s??(o==null?void 0:o[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});p.found&&(u.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!p.hasNewline&&a(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=s?QM(d,s,p,a):rb(d,p.end,r,null,p,a);const m=u.contents.range[2],g=Pl(o,m,!1,a);return g.comment&&(u.comment=g.comment),u.range=[n,m,g.offset],u}function Ra(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function mN(e){var s;let t="",n=!1,r=!1;for(let o=0;o<e.length;++o){const a=e[o];switch(a[0]){case"#":t+=(t===""?"":r?`
|
|
660
|
+
|
|
661
|
+
`:`
|
|
662
|
+
`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[o+1])==null?void 0:s[0])!=="#"&&(o+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class MH{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,o)=>{const a=Ra(n);o?this.warnings.push(new fH(a,r,s)):this.errors.push(new $a(a,r,s))},this.directives=new qt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=mN(this.prelude);if(r){const o=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
663
|
+
${r}`:r;else if(s||t.directives.docStart||!o)t.commentBefore=r;else if(ut(o)&&!o.flow&&o.items.length>0){let a=o.items[0];ft(a)&&(a=a.key);const c=a.commentBefore;a.commentBefore=c?`${r}
|
|
664
|
+
${c}`:r}else{const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
665
|
+
${a}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:mN(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const o=Ra(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=IH(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new $a(Ra(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new $a(Ra(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Pl(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
666
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new $a(Ra(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new Ol(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const JM="\uFEFF",ZM="",eO="",Yx="";function OH(e){switch(e){case JM:return"byte-order-mark";case ZM:return"doc-mode";case eO:return"flow-error-end";case Yx:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
667
|
+
`:case`\r
|
|
668
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function On(e){switch(e){case void 0:case" ":case`
|
|
669
|
+
`:case"\r":case" ":return!0;default:return!1}}const gN=new Set("0123456789ABCDEFabcdef"),PH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Cu=new Set(",[]{}"),LH=new Set(` ,[]{}
|
|
670
|
+
\r `),Yp=e=>!e||LH.has(e);class DH{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
671
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
672
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===`
|
|
673
|
+
`||!s&&!this.atEnd)return t+r+1}return n===`
|
|
674
|
+
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&On(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
675
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===JM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const o=t[r-1];if(o===" "||o===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const o=t[n-1];if(o===" "||o===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield ZM,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&On(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!On(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&On(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Yp),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&On(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield eO,yield*this.parseLineStart();let o=0;for(;s[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),s[o]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Yp),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||On(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
|
|
676
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){const o=this.continueScalar(s+1);if(o===-1)break;s=r.indexOf(`
|
|
677
|
+
`,o)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>On(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case`
|
|
678
|
+
`:t=o,n=0;break;case"\r":{const a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
679
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
|
|
680
|
+
`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
681
|
+
`;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let o=t-1,a=this.buffer[o];a==="\r"&&(a=this.buffer[--o]);const c=o;for(;a===" ";)a=this.buffer[--o];if(a===`
|
|
682
|
+
`&&o>=this.pos&&o+1+n>c)t=o;else break}while(!0);return yield Yx,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const o=this.buffer[r+1];if(On(o)||t&&Cu.has(o))break;n=r}else if(On(s)){let o=this.buffer[r+1];if(s==="\r"&&(o===`
|
|
683
|
+
`?(r+=1,s=`
|
|
684
|
+
`,o=this.buffer[r+1]):n=r),o==="#"||t&&Cu.has(o))break;if(s===`
|
|
685
|
+
`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Cu.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Yx,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Yp))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(On(n)||t&&Cu.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!On(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(PH.has(n))n=this.buffer[++t];else if(n==="%"&&gN.has(this.buffer[t+1])&&gN.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
686
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
687
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class $H{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const o=n+r>>1;this.lineStarts[o]<t?n=o+1:r=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function ps(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function yN(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function tO(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Eu(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Gi(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function vN(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ps(t.start,"explicit-key-ind")&&!ps(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,tO(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class qH{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new DH,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=OH(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&vN(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&yN(s.start)===-1&&(n.indent===0||s.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{yN(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Eu(this.peek(2)),r=Gi(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
688
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
689
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,o=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(o&&n.sep&&!n.value){const c=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":c.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(a=n.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ps(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(tO(n.key)&&!ps(n.sep,"newline")){const c=Gi(n.start),u=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(ps(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Gi(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:a,key:null,sep:[this.sourceToken]}):ps(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);o||n.value?(t.items.push({start:a,key:c,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(c):(Object.assign(n,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(t);if(c){if(c.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ps(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ps(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Eu(r),o=Gi(s);vN(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
690
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
691
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Eu(t),r=Gi(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Eu(t),r=Gi(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function FH(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new $H||null,prettyErrors:t}}function BH(e,t={}){const{lineCounter:n,prettyErrors:r}=FH(t),s=new qH(n==null?void 0:n.addNewLine),o=new MH(t);let a=null;for(const c of o.compose(s.parse(e),!0,e.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new $a(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(hN(e,n)),a.warnings.forEach(hN(e,n))),a}function zH(e,t,n){let r;const s=BH(e,n);if(!s)return null;if(s.warnings.forEach(o=>jM(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function hd(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return Al(e)&&!r?e.toString(n):new Ol(e,r,n).toString(n)}function VH({value:e,onChange:t}){const[n,r]=T.useState(""),[s,o]=T.useState(null),[a,c]=T.useState(!0);T.useEffect(()=>{try{const d=hd(e,{indent:2,lineWidth:0});r(d),o(null),c(!0)}catch(d){o(d instanceof Error?d.message:"Failed to serialize"),c(!1)}},[e]);const u=d=>{if(d){r(d);try{const p=zH(d);if(!p.id)throw new Error("Step ID is required");if(!p.action&&!p.workflow)throw new Error("Either action or workflow is required");o(null),c(!0),t(p)}catch(p){o(p instanceof Error?p.message:"Invalid YAML"),c(!1)}}};return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"flex items-center gap-2",children:a?h.jsxs("span",{className:"flex items-center gap-1 text-xs text-success",children:[h.jsx(ei,{className:"w-3 h-3"}),"Valid YAML"]}):h.jsxs("span",{className:"flex items-center gap-1 text-xs text-error",children:[h.jsx(kl,{className:"w-3 h-3"}),s]})}),h.jsxs("span",{className:"text-xs text-gray-500",children:[n.split(`
|
|
692
|
+
`).length," lines"]})]}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"400px",language:"yaml",value:n,onChange:u,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})}),h.jsx("div",{className:"text-xs text-gray-500",children:h.jsx("p",{children:"Edit the step configuration directly in YAML format. Changes are applied automatically when valid."})})]})}function UH({value:e,title:t}){const[n,r]=T.useState("");return T.useEffect(()=>{try{const s=hd(e,{indent:2,lineWidth:0});r(s)}catch{r("# Failed to serialize value")}},[e]),h.jsxs("div",{className:"space-y-2",children:[t&&h.jsx("h4",{className:"text-sm font-medium text-gray-300",children:t}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"300px",language:"yaml",value:n,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})})]})}function HH({inputs:e,onChange:t,availableVariables:n}){const[r,s]=T.useState(""),o=Object.entries(e),a=(m,g)=>{t({...e,[m]:g})},c=m=>{const g={...e};delete g[m],t(g)},u=()=>{r&&!e.hasOwnProperty(r)&&(t({...e,[r]:""}),s(""))},d=(m,g)=>{if(g&&g!==m&&!e.hasOwnProperty(g)){const v={};for(const[b,x]of Object.entries(e))b===m?v[g]=x:v[b]=x;t(v)}},p=(m,g)=>{const v=String(e[m]||"");a(m,v+`{{ ${g} }}`)};return h.jsxs("div",{className:"space-y-4",children:[o.length===0?h.jsx("div",{className:"text-center py-8",children:h.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No inputs defined"})}):h.jsx("div",{className:"space-y-3",children:o.map(([m,g])=>h.jsx(WH,{inputKey:m,value:g,onChange:v=>a(m,v),onRemove:()=>c(m),onRename:v=>d(m,v),availableVariables:n,onInsertVariable:v=>p(m,v)},m))}),h.jsxs("div",{className:"flex gap-2 pt-2 border-t border-node-border",children:[h.jsx("input",{type:"text",value:r,onChange:m=>s(m.target.value),placeholder:"New input key...",className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",onKeyDown:m=>{m.key==="Enter"&&u()}}),h.jsx(Fe,{variant:"secondary",size:"sm",onClick:u,disabled:!r||e.hasOwnProperty(r),icon:h.jsx(Od,{className:"w-4 h-4"}),children:"Add"})]}),n.length>0&&h.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx(Dd,{className:"w-4 h-4 text-primary"}),h.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Available Variables"})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(m=>h.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded",children:m},m))}),h.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Click on an input field, then use the variable button to insert"})]})]})}function WH({inputKey:e,value:t,onChange:n,onRemove:r,onRename:s,availableVariables:o,onInsertVariable:a}){const[c,u]=T.useState(!1),[d,p]=T.useState(e),[m,g]=T.useState(!1),v=typeof t,b=v==="object"&&t!==null,x=Array.isArray(t),w=()=>{d!==e&&s(d),u(!1)},S=()=>x||b?h.jsx("textarea",{value:JSON.stringify(t,null,2),onChange:C=>{try{n(JSON.parse(C.target.value))}catch{n(C.target.value)}},className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary resize-none",rows:3}):v==="boolean"?h.jsxs("select",{value:String(t),onChange:C=>n(C.target.value==="true"),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[h.jsx("option",{value:"true",children:"true"}),h.jsx("option",{value:"false",children:"false"})]}):v==="number"?h.jsx("input",{type:"number",value:String(t),onChange:C=>n(parseFloat(C.target.value)||0),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary"}):h.jsx(KH,{value:String(t),onChange:C=>n(C),variables:o,placeholder:"Value or {{ variable }}"});return h.jsxs("div",{className:"p-3 bg-node-bg/50 rounded-lg border border-node-border space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[c?h.jsx("input",{type:"text",value:d,onChange:C=>p(C.target.value),onBlur:w,onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&(p(e),u(!1))},className:"flex-1 px-2 py-1 bg-node-bg border border-primary rounded text-white text-sm font-mono focus:outline-none",autoFocus:!0}):h.jsx("button",{onClick:()=>u(!0),className:"flex-1 text-left px-2 py-1 text-sm font-mono text-primary hover:bg-white/5 rounded",children:e}),h.jsx("span",{className:"text-xs text-gray-500",children:v}),h.jsx(Fe,{variant:"ghost",size:"sm",onClick:r,className:"!p-1 text-gray-400 hover:text-error",children:h.jsx(ko,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"flex gap-2",children:[S(),o.length>0&&!x&&!b&&h.jsxs("div",{className:"relative",children:[h.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>g(!m),className:"!p-2",children:h.jsx(Dd,{className:"w-4 h-4"})}),m&&h.jsxs("div",{className:"absolute right-0 top-full mt-1 z-10 p-2 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[150px]",children:[h.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Insert variable"}),h.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:o.map(C=>h.jsx("button",{onClick:()=>{a(C),g(!1)},className:"w-full text-left px-2 py-1 text-xs font-mono text-primary hover:bg-white/10 rounded",children:C},C))})]})]})]})]})}function KH({value:e,onChange:t,variables:n,placeholder:r}){const[s,o]=T.useState(!1),[a,c]=T.useState(0),[u,d]=T.useState(0),p=T.useRef(null),g=(()=>{const k=e.substring(0,a),N=k.lastIndexOf("{{");if(N===-1)return null;const j=k.substring(N);return j.includes("}}")?null:{text:j.substring(2).trim(),start:N,end:a}})(),v=g?n.filter(k=>k.toLowerCase().includes(g.text.toLowerCase())):[],b=s&&g&&v.length>0,x=k=>{t(k.target.value),c(k.target.selectionStart||0),o(!0),d(0)},w=k=>{const N=k.target;c(N.selectionStart||0)},S=k=>{if(b)switch(k.key){case"ArrowDown":k.preventDefault(),d(N=>N<v.length-1?N+1:0);break;case"ArrowUp":k.preventDefault(),d(N=>N>0?N-1:v.length-1);break;case"Enter":case"Tab":k.preventDefault(),C(v[u]);break;case"Escape":o(!1);break}},C=k=>{if(!g)return;const N=e.substring(0,g.start),j=e.substring(g.end),A=`${N}{{ ${k} }}${j}`;t(A),o(!1),setTimeout(()=>{if(p.current){const R=g.start+k.length+6;p.current.setSelectionRange(R,R),p.current.focus()}},0)};return T.useEffect(()=>{const k=()=>o(!1);return document.addEventListener("click",k),()=>document.removeEventListener("click",k)},[]),h.jsxs("div",{className:"relative flex-1",children:[h.jsx("input",{ref:p,type:"text",value:e,onChange:x,onSelect:w,onKeyDown:S,onFocus:()=>o(!0),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:r}),b&&h.jsxs("div",{className:"absolute left-0 top-full mt-1 z-20 p-1 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[200px] max-h-[200px] overflow-y-auto",onClick:k=>k.stopPropagation(),children:[h.jsxs("div",{className:"text-xs text-gray-500 px-2 py-1 mb-1",children:['Variables matching "',(g==null?void 0:g.text)||"",'"']}),v.map((k,N)=>h.jsxs("button",{onClick:()=>C(k),className:`w-full text-left px-2 py-1.5 text-xs font-mono rounded flex items-center gap-2 ${N===u?"bg-primary/20 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[h.jsx(Dd,{className:"w-3 h-3"}),k]},k)),h.jsx("div",{className:"text-xs text-gray-600 px-2 pt-1 border-t border-node-border mt-1",children:"↑↓ to navigate, Enter to select"})]})]})}function xN(e){const t=[];return!e.id||e.id.trim()===""?t.push({field:"id",message:"Step ID is required"}):/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e.id)||t.push({field:"id",message:"Step ID must start with a letter and contain only letters, numbers, underscores, and hyphens"}),!e.action&&!e.workflow&&t.push({field:"action",message:"Step must have either an action or a workflow reference"}),e.action&&e.action.split(".").length<2&&t.push({field:"action",message:"Action must be in format: service.method (e.g., slack.chat.postMessage)"}),e.workflow&&!e.workflow.endsWith(".md")&&!e.workflow.endsWith(".yaml")&&!e.workflow.endsWith(".yml")&&t.push({field:"workflow",message:"Workflow reference should end with .md, .yaml, or .yml"}),e.outputVariable&&(/^[a-zA-Z][a-zA-Z0-9_]*$/.test(e.outputVariable)||t.push({field:"outputVariable",message:"Output variable must start with a letter and contain only letters, numbers, and underscores"})),e.timeout!==void 0&&(typeof e.timeout!="number"||e.timeout<=0)&&t.push({field:"timeout",message:"Timeout must be a positive number"}),e.errorHandling&&(["stop","continue","retry"].includes(e.errorHandling.action)||t.push({field:"errorHandling.action",message:"Error action must be one of: stop, continue, retry"}),e.errorHandling.action==="retry"&&(e.errorHandling.maxRetries!==void 0&&(typeof e.errorHandling.maxRetries!="number"||e.errorHandling.maxRetries<1)&&t.push({field:"errorHandling.maxRetries",message:"Max retries must be at least 1"}),e.errorHandling.retryDelay!==void 0&&(typeof e.errorHandling.retryDelay!="number"||e.errorHandling.retryDelay<0)&&t.push({field:"errorHandling.retryDelay",message:"Retry delay must be a non-negative number"})),e.errorHandling.fallbackStep&&(/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e.errorHandling.fallbackStep)||t.push({field:"errorHandling.fallbackStep",message:"Fallback step ID must be a valid identifier"}))),e.conditions&&e.conditions.length>0&&e.conditions.forEach((n,r)=>{(!n||n.trim()==="")&&t.push({field:`conditions[${r}]`,message:`Condition ${r+1} cannot be empty`})}),{valid:t.length===0,errors:t}}function GH(e,t){const n=e.find(r=>r.field===t);return n==null?void 0:n.message}function YH({open:e,onOpenChange:t,step:n,onSave:r,availableVariables:s}){const[o,a]=T.useState(null),[c,u]=T.useState("properties"),[d,p]=T.useState([]),[m,g]=T.useState(!1);if(T.useEffect(()=>{n&&(a({...n}),u("properties"),p([]),g(!1))},[n]),T.useMemo(()=>o?xN(o):{valid:!0,errors:[]},[o]),!o)return null;const v=()=>{if(!o)return;const w=xN(o);if(p(w.errors),g(!0),w.valid)r(o),t(!1);else{const S=w.errors[0];S&&(S.field==="id"||S.field==="action"||S.field==="workflow"||S.field==="timeout"?u("properties"):S.field==="outputVariable"?u("output"):S.field.startsWith("errorHandling")?u("errors"):S.field.startsWith("conditions")&&u("conditions"))}},b=w=>{a(S=>S?{...S,...w}:null)},x=w=>{if(m)return GH(d,w)};return h.jsxs(Ss,{open:e,onOpenChange:t,title:`Edit Step: ${o.name||o.id}`,description:o.action||o.workflow||"Configure step settings",size:"xl",children:[h.jsxs(uM,{value:c,onValueChange:u,children:[h.jsxs(zw,{children:[h.jsxs(nr,{value:"properties",children:[h.jsx(Pd,{className:"w-4 h-4 mr-1.5"}),"Properties"]}),h.jsxs(nr,{value:"inputs",children:[h.jsx(Uz,{className:"w-4 h-4 mr-1.5"}),"Inputs"]}),h.jsxs(nr,{value:"output",children:[h.jsx(Hz,{className:"w-4 h-4 mr-1.5"}),"Output"]}),h.jsxs(nr,{value:"errors",children:[h.jsx(Ld,{className:"w-4 h-4 mr-1.5"}),"Errors"]}),h.jsxs(nr,{value:"conditions",children:[h.jsx(eI,{className:"w-4 h-4 mr-1.5"}),"Conditions"]}),h.jsxs(nr,{value:"yaml",children:[h.jsx(Ew,{className:"w-4 h-4 mr-1.5"}),"YAML"]})]}),h.jsxs("div",{className:"p-4",children:[h.jsx(rr,{value:"properties",children:h.jsx(XH,{step:o,onChange:b,getError:x})}),h.jsx(rr,{value:"inputs",children:h.jsx(HH,{inputs:o.inputs,onChange:w=>b({inputs:w}),availableVariables:s})}),h.jsx(rr,{value:"output",children:h.jsx(QH,{step:o,onChange:b})}),h.jsx(rr,{value:"errors",children:h.jsx(JH,{step:o,onChange:b})}),h.jsx(rr,{value:"conditions",children:h.jsx(ZH,{step:o,onChange:b,availableVariables:s})}),h.jsx(rr,{value:"yaml",children:h.jsx(VH,{value:o,onChange:w=>a(w)})})]})]}),h.jsxs(ni,{children:[m&&d.length>0&&h.jsxs("div",{className:"flex-1 flex items-center gap-2 text-error text-sm",children:[h.jsx(kl,{className:"w-4 h-4 flex-shrink-0"}),h.jsxs("span",{children:[d.length," validation error",d.length>1?"s":""]})]}),h.jsx(Fe,{variant:"secondary",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Fe,{onClick:v,children:"Save Changes"})]})]})}function XH({step:e,onChange:t,getError:n}){const r=n("id"),s=n("action"),o=n("workflow"),a=n("timeout");return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Step ID ",h.jsx("span",{className:"text-error",children:"*"})]}),h.jsx("input",{type:"text",value:e.id,onChange:c=>t({id:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${r?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"unique-step-id"}),r?h.jsx("p",{className:"mt-1 text-xs text-error",children:r}):h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Unique identifier for this step"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name"}),h.jsx("input",{type:"text",value:e.name||"",onChange:c=>t({name:c.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Action ",!e.workflow&&h.jsx("span",{className:"text-error",children:"*"})]}),h.jsx("input",{type:"text",value:e.action||"",onChange:c=>t({action:c.target.value||void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${s?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"service.method (e.g., slack.chat.postMessage)"}),s?h.jsx("p",{className:"mt-1 text-xs text-error",children:s}):h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Format: service.method or service.namespace.method"})]}),e.workflow&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Sub-workflow Path"}),h.jsx("input",{type:"text",value:e.workflow,onChange:c=>t({workflow:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${o?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"./path/to/workflow.md"}),o&&h.jsx("p",{className:"mt-1 text-xs text-error",children:o})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Timeout (seconds)"}),h.jsx("input",{type:"number",value:e.timeout||"",onChange:c=>t({timeout:c.target.value?parseInt(c.target.value,10):void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${a?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"30",min:"1"}),a&&h.jsx("p",{className:"mt-1 text-xs text-error",children:a})]})]})}function QH({step:e,onChange:t}){return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Output Variable"}),h.jsx("input",{type:"text",value:e.outputVariable||"",onChange:n=>t({outputVariable:n.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"result_variable"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Store the step output in this variable for use in subsequent steps"})]}),h.jsxs("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:[h.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Usage Example"}),h.jsx("code",{className:"text-xs text-primary font-mono",children:"{{ "+(e.outputVariable||"variable_name")+" }}"}),h.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use this syntax in subsequent steps to reference the output"})]})]})}function JH({step:e,onChange:t}){const n=e.errorHandling||{action:"stop"},r=s=>{t({errorHandling:{...n,...s}})};return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Error Action"}),h.jsxs("select",{value:n.action,onChange:s=>r({action:s.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[h.jsx("option",{value:"stop",children:"Stop workflow on error"}),h.jsx("option",{value:"continue",children:"Continue to next step"}),h.jsx("option",{value:"retry",children:"Retry with backoff"})]})]}),n.action==="retry"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Max Retries"}),h.jsx("input",{type:"number",value:n.maxRetries||3,onChange:s=>r({maxRetries:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"1",max:"10"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Retry Delay (ms)"}),h.jsx("input",{type:"number",value:n.retryDelay||1e3,onChange:s=>r({retryDelay:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"100",step:"100"})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Fallback Step (optional)"}),h.jsx("input",{type:"text",value:n.fallbackStep||"",onChange:s=>r({fallbackStep:s.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"fallback-step-id"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Jump to this step if the error action fails"})]})]})}function ZH({step:e,onChange:t,availableVariables:n}){const r=e.conditions||[],s=()=>{t({conditions:[...r,""]})},o=(c,u)=>{const d=[...r];d[c]=u,t({conditions:d})},a=c=>{const u=r.filter((d,p)=>p!==c);t({conditions:u.length>0?u:void 0})};return h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-sm text-gray-400",children:"This step will only execute if all conditions evaluate to true."}),r.length===0?h.jsxs("div",{className:"text-center py-8",children:[h.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No conditions defined"}),h.jsx(Fe,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}):h.jsxs("div",{className:"space-y-3",children:[r.map((c,u)=>h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:c,onChange:d=>o(u,d.target.value),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"{{ variable }} === 'value'"}),h.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>a(u),children:"×"})]},u)),h.jsx(Fe,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}),n.length>0&&h.jsxs("div",{className:"mt-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:"Available Variables"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(c=>h.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded cursor-pointer hover:bg-primary/20",onClick:()=>{navigator.clipboard.writeText(`{{ ${c} }}`)},children:c},c))})]})]})}const e7=["top","right","bottom","left"],_s=Math.min,cn=Math.max,pd=Math.round,ju=Math.floor,ar=e=>({x:e,y:e}),t7={left:"right",right:"left",bottom:"top",top:"bottom"},n7={start:"end",end:"start"};function Xx(e,t,n){return cn(e,_s(t,n))}function Or(e,t){return typeof e=="function"?e(t):e}function Pr(e){return e.split("-")[0]}function Ao(e){return e.split("-")[1]}function sb(e){return e==="x"?"y":"x"}function ib(e){return e==="y"?"height":"width"}const r7=new Set(["top","bottom"]);function ir(e){return r7.has(Pr(e))?"y":"x"}function ob(e){return sb(ir(e))}function s7(e,t,n){n===void 0&&(n=!1);const r=Ao(e),s=ob(e),o=ib(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=md(a)),[a,md(a)]}function i7(e){const t=md(e);return[Qx(e),t,Qx(t)]}function Qx(e){return e.replace(/start|end/g,t=>n7[t])}const wN=["left","right"],bN=["right","left"],o7=["top","bottom"],a7=["bottom","top"];function l7(e,t,n){switch(e){case"top":case"bottom":return n?t?bN:wN:t?wN:bN;case"left":case"right":return t?o7:a7;default:return[]}}function c7(e,t,n,r){const s=Ao(e);let o=l7(Pr(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Qx)))),o}function md(e){return e.replace(/left|right|bottom|top/g,t=>t7[t])}function u7(e){return{top:0,right:0,bottom:0,left:0,...e}}function nO(e){return typeof e!="number"?u7(e):{top:e,right:e,bottom:e,left:e}}function gd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function SN(e,t,n){let{reference:r,floating:s}=e;const o=ir(t),a=ob(t),c=ib(a),u=Pr(t),d=o==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let v;switch(u){case"top":v={x:p,y:r.y-s.height};break;case"bottom":v={x:p,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:m};break;case"left":v={x:r.x-s.width,y:m};break;default:v={x:r.x,y:r.y}}switch(Ao(t)){case"start":v[a]-=g*(n&&d?-1:1);break;case"end":v[a]+=g*(n&&d?-1:1);break}return v}const d7=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=SN(d,r,u),g=r,v={},b=0;for(let x=0;x<c.length;x++){const{name:w,fn:S}=c[x],{x:C,y:k,data:N,reset:j}=await S({x:p,y:m,initialPlacement:r,placement:g,strategy:s,middlewareData:v,rects:d,platform:a,elements:{reference:e,floating:t}});p=C??p,m=k??m,v={...v,[w]:{...v[w],...N}},j&&b<=50&&(b++,typeof j=="object"&&(j.placement&&(g=j.placement),j.rects&&(d=j.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:p,y:m}=SN(d,g,u)),x=-1)}return{x:p,y:m,placement:g,strategy:s,middlewareData:v}};async function fl(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:v=0}=Or(t,e),b=nO(v),w=c[g?m==="floating"?"reference":"floating":m],S=gd(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:p,strategy:u})),C=m==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),N=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},j=gd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:k,strategy:u}):C);return{top:(S.top-j.top+b.top)/N.y,bottom:(j.bottom-S.bottom+b.bottom)/N.y,left:(S.left-j.left+b.left)/N.x,right:(j.right-S.right+b.right)/N.x}}const f7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:d,padding:p=0}=Or(e,t)||{};if(d==null)return{};const m=nO(p),g={x:n,y:r},v=ob(s),b=ib(v),x=await a.getDimensions(d),w=v==="y",S=w?"top":"left",C=w?"bottom":"right",k=w?"clientHeight":"clientWidth",N=o.reference[b]+o.reference[v]-g[v]-o.floating[b],j=g[v]-o.reference[v],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let R=A?A[k]:0;(!R||!await(a.isElement==null?void 0:a.isElement(A)))&&(R=c.floating[k]||o.floating[b]);const O=N/2-j/2,L=R/2-x[b]/2-1,B=_s(m[S],L),M=_s(m[C],L),$=B,U=R-x[b]-M,D=R/2-x[b]/2+O,V=Xx($,D,U),z=!u.arrow&&Ao(s)!=null&&D!==V&&o.reference[b]/2-(D<$?B:M)-x[b]/2<0,Q=z?D<$?D-$:D-U:0;return{[v]:g[v]+Q,data:{[v]:V,centerOffset:D-V-Q,...z&&{alignmentOffset:Q}},reset:z}}}),h7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=Or(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Pr(s),C=ir(c),k=Pr(c)===c,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),j=g||(k||!x?[md(c)]:i7(c)),A=b!=="none";!g&&A&&j.push(...c7(c,x,b,N));const R=[c,...j],O=await fl(t,w),L=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&L.push(O[S]),m){const D=s7(s,a,N);L.push(O[D[0]],O[D[1]])}if(B=[...B,{placement:s,overflows:L}],!L.every(D=>D<=0)){var M,$;const D=(((M=o.flip)==null?void 0:M.index)||0)+1,V=R[D];if(V&&(!(m==="alignment"?C!==ir(V):!1)||B.every(F=>ir(F.placement)===C?F.overflows[0]>0:!0)))return{data:{index:D,overflows:B},reset:{placement:V}};let z=($=B.filter(Q=>Q.overflows[0]<=0).sort((Q,F)=>Q.overflows[1]-F.overflows[1])[0])==null?void 0:$.placement;if(!z)switch(v){case"bestFit":{var U;const Q=(U=B.filter(F=>{if(A){const q=ir(F.placement);return q===C||q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(q=>q>0).reduce((q,G)=>q+G,0)]).sort((F,q)=>F[1]-q[1])[0])==null?void 0:U[0];Q&&(z=Q);break}case"initialPlacement":z=c;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function _N(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kN(e){return e7.some(t=>e[t]>=0)}const p7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Or(e,t);switch(r){case"referenceHidden":{const o=await fl(t,{...s,elementContext:"reference"}),a=_N(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kN(a)}}}case"escaped":{const o=await fl(t,{...s,altBoundary:!0}),a=_N(o,n.floating);return{data:{escapedOffsets:a,escaped:kN(a)}}}default:return{}}}}},rO=new Set(["left","top"]);async function m7(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Pr(n),c=Ao(n),u=ir(n)==="y",d=rO.has(a)?-1:1,p=o&&u?-1:1,m=Or(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof b=="number"&&(v=c==="end"?b*-1:b),u?{x:v*p,y:g*d}:{x:g*d,y:v*p}}const g7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await m7(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},y7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:w=>{let{x:S,y:C}=w;return{x:S,y:C}}},...u}=Or(e,t),d={x:n,y:r},p=await fl(t,u),m=ir(Pr(s)),g=sb(m);let v=d[g],b=d[m];if(o){const w=g==="y"?"top":"left",S=g==="y"?"bottom":"right",C=v+p[w],k=v-p[S];v=Xx(C,v,k)}if(a){const w=m==="y"?"top":"left",S=m==="y"?"bottom":"right",C=b+p[w],k=b-p[S];b=Xx(C,b,k)}const x=c.fn({...t,[g]:v,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[m]:a}}}}}},v7=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Or(e,t),p={x:n,y:r},m=ir(s),g=sb(m);let v=p[g],b=p[m];const x=Or(c,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const k=g==="y"?"height":"width",N=o.reference[g]-o.floating[k]+w.mainAxis,j=o.reference[g]+o.reference[k]-w.mainAxis;v<N?v=N:v>j&&(v=j)}if(d){var S,C;const k=g==="y"?"width":"height",N=rO.has(Pr(s)),j=o.reference[m]-o.floating[k]+(N&&((S=a.offset)==null?void 0:S[m])||0)+(N?0:w.crossAxis),A=o.reference[m]+o.reference[k]+(N?0:((C=a.offset)==null?void 0:C[m])||0)-(N?w.crossAxis:0);b<j?b=j:b>A&&(b=A)}return{[g]:v,[m]:b}}}},x7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:c}=t,{apply:u=()=>{},...d}=Or(e,t),p=await fl(t,d),m=Pr(s),g=Ao(s),v=ir(s)==="y",{width:b,height:x}=o.floating;let w,S;m==="top"||m==="bottom"?(w=m,S=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(S=m,w=g==="end"?"top":"bottom");const C=x-p.top-p.bottom,k=b-p.left-p.right,N=_s(x-p[w],C),j=_s(b-p[S],k),A=!t.middlewareData.shift;let R=N,O=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=C),A&&!g){const B=cn(p.left,0),M=cn(p.right,0),$=cn(p.top,0),U=cn(p.bottom,0);v?O=b-2*(B!==0||M!==0?B+M:cn(p.left,p.right)):R=x-2*($!==0||U!==0?$+U:cn(p.top,p.bottom))}await u({...t,availableWidth:O,availableHeight:R});const L=await a.getDimensions(c.floating);return b!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function Qd(){return typeof window<"u"}function Ro(e){return sO(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mr(e){var t;return(t=(sO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sO(e){return Qd()?e instanceof Node||e instanceof dn(e).Node:!1}function Bn(e){return Qd()?e instanceof Element||e instanceof dn(e).Element:!1}function fr(e){return Qd()?e instanceof HTMLElement||e instanceof dn(e).HTMLElement:!1}function NN(e){return!Qd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot}const w7=new Set(["inline","contents"]);function Ll(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!w7.has(s)}const b7=new Set(["table","td","th"]);function S7(e){return b7.has(Ro(e))}const _7=[":popover-open",":modal"];function Jd(e){return _7.some(t=>{try{return e.matches(t)}catch{return!1}})}const k7=["transform","translate","scale","rotate","perspective"],N7=["transform","translate","scale","rotate","perspective","filter"],C7=["paint","layout","strict","content"];function ab(e){const t=lb(),n=Bn(e)?zn(e):e;return k7.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||N7.some(r=>(n.willChange||"").includes(r))||C7.some(r=>(n.contain||"").includes(r))}function E7(e){let t=ks(e);for(;fr(t)&&!So(t);){if(ab(t))return t;if(Jd(t))return null;t=ks(t)}return null}function lb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const j7=new Set(["html","body","#document"]);function So(e){return j7.has(Ro(e))}function zn(e){return dn(e).getComputedStyle(e)}function Zd(e){return Bn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ks(e){if(Ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||NN(e)&&e.host||mr(e);return NN(t)?t.host:t}function iO(e){const t=ks(e);return So(t)?e.ownerDocument?e.ownerDocument.body:e.body:fr(t)&&Ll(t)?t:iO(t)}function hl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=iO(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=dn(s);if(o){const c=Jx(a);return t.concat(a,a.visualViewport||[],Ll(s)?s:[],c&&n?hl(c):[])}return t.concat(s,hl(s,[],n))}function Jx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oO(e){const t=zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=fr(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=pd(n)!==o||pd(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function cb(e){return Bn(e)?e:e.contextElement}function co(e){const t=cb(e);if(!fr(t))return ar(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=oO(t);let a=(o?pd(n.width):n.width)/r,c=(o?pd(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const T7=ar(0);function aO(e){const t=dn(e);return!lb()||!t.visualViewport?T7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function A7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dn(e)?!1:t}function si(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=cb(e);let a=ar(1);t&&(r?Bn(r)&&(a=co(r)):a=co(e));const c=A7(o,n,r)?aO(o):ar(0);let u=(s.left+c.x)/a.x,d=(s.top+c.y)/a.y,p=s.width/a.x,m=s.height/a.y;if(o){const g=dn(o),v=r&&Bn(r)?dn(r):r;let b=g,x=Jx(b);for(;x&&r&&v!==b;){const w=co(x),S=x.getBoundingClientRect(),C=zn(x),k=S.left+(x.clientLeft+parseFloat(C.paddingLeft))*w.x,N=S.top+(x.clientTop+parseFloat(C.paddingTop))*w.y;u*=w.x,d*=w.y,p*=w.x,m*=w.y,u+=k,d+=N,b=dn(x),x=Jx(b)}}return gd({width:p,height:m,x:u,y:d})}function ef(e,t){const n=Zd(e).scrollLeft;return t?t.left+n:si(mr(e)).left+n}function lO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ef(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function R7(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=mr(r),c=t?Jd(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},d=ar(1);const p=ar(0),m=fr(r);if((m||!m&&!o)&&((Ro(r)!=="body"||Ll(a))&&(u=Zd(r)),fr(r))){const v=si(r);d=co(r),p.x=v.x+r.clientLeft,p.y=v.y+r.clientTop}const g=a&&!m&&!o?lO(a,u):ar(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-u.scrollTop*d.y+p.y+g.y}}function I7(e){return Array.from(e.getClientRects())}function M7(e){const t=mr(e),n=Zd(e),r=e.ownerDocument.body,s=cn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=cn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ef(e);const c=-n.scrollTop;return zn(r).direction==="rtl"&&(a+=cn(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}const CN=25;function O7(e,t){const n=dn(e),r=mr(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const p=lb();(!p||p&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}const d=ef(r);if(d<=0){const p=r.ownerDocument,m=p.body,g=getComputedStyle(m),v=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-m.clientWidth-v);b<=CN&&(o-=b)}else d<=CN&&(o+=d);return{width:o,height:a,x:c,y:u}}const P7=new Set(["absolute","fixed"]);function L7(e,t){const n=si(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=fr(e)?co(e):ar(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,d=r*o.y;return{width:a,height:c,x:u,y:d}}function EN(e,t,n){let r;if(t==="viewport")r=O7(e,n);else if(t==="document")r=M7(mr(e));else if(Bn(t))r=L7(t,n);else{const s=aO(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return gd(r)}function cO(e,t){const n=ks(e);return n===t||!Bn(n)||So(n)?!1:zn(n).position==="fixed"||cO(n,t)}function D7(e,t){const n=t.get(e);if(n)return n;let r=hl(e,[],!1).filter(c=>Bn(c)&&Ro(c)!=="body"),s=null;const o=zn(e).position==="fixed";let a=o?ks(e):e;for(;Bn(a)&&!So(a);){const c=zn(a),u=ab(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&P7.has(s.position)||Ll(a)&&!u&&cO(e,a))?r=r.filter(p=>p!==a):s=c,a=ks(a)}return t.set(e,r),r}function $7(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Jd(t)?[]:D7(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((d,p)=>{const m=EN(t,p,s);return d.top=cn(m.top,d.top),d.right=_s(m.right,d.right),d.bottom=_s(m.bottom,d.bottom),d.left=cn(m.left,d.left),d},EN(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function q7(e){const{width:t,height:n}=oO(e);return{width:t,height:n}}function F7(e,t,n){const r=fr(t),s=mr(t),o=n==="fixed",a=si(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=ar(0);function d(){u.x=ef(s)}if(r||!r&&!o)if((Ro(t)!=="body"||Ll(s))&&(c=Zd(t)),r){const v=si(t,!0,o,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else s&&d();o&&!r&&s&&d();const p=s&&!r&&!o?lO(s,c):ar(0),m=a.left+c.scrollLeft-u.x-p.x,g=a.top+c.scrollTop-u.y-p.y;return{x:m,y:g,width:a.width,height:a.height}}function Xp(e){return zn(e).position==="static"}function jN(e,t){if(!fr(e)||zn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mr(e)===n&&(n=n.ownerDocument.body),n}function uO(e,t){const n=dn(e);if(Jd(e))return n;if(!fr(e)){let s=ks(e);for(;s&&!So(s);){if(Bn(s)&&!Xp(s))return s;s=ks(s)}return n}let r=jN(e,t);for(;r&&S7(r)&&Xp(r);)r=jN(r,t);return r&&So(r)&&Xp(r)&&!ab(r)?n:r||E7(e)||n}const B7=async function(e){const t=this.getOffsetParent||uO,n=this.getDimensions,r=await n(e.floating);return{reference:F7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function z7(e){return zn(e).direction==="rtl"}const V7={convertOffsetParentRelativeRectToViewportRelativeRect:R7,getDocumentElement:mr,getClippingRect:$7,getOffsetParent:uO,getElementRects:B7,getClientRects:I7,getDimensions:q7,getScale:co,isElement:Bn,isRTL:z7};function dO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function U7(e,t){let n=null,r;const s=mr(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:p,top:m,width:g,height:v}=d;if(c||t(),!g||!v)return;const b=ju(m),x=ju(s.clientWidth-(p+g)),w=ju(s.clientHeight-(m+v)),S=ju(p),k={rootMargin:-b+"px "+-x+"px "+-w+"px "+-S+"px",threshold:cn(0,_s(1,u))||1};let N=!0;function j(A){const R=A[0].intersectionRatio;if(R!==u){if(!N)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!dO(d,e.getBoundingClientRect())&&a(),N=!1}try{n=new IntersectionObserver(j,{...k,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,k)}n.observe(e)}return a(!0),o}function H7(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=cb(e),p=s||o?[...d?hl(d):[],...hl(t)]:[];p.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const m=d&&c?U7(d,n):null;let g=-1,v=null;a&&(v=new ResizeObserver(S=>{let[C]=S;C&&C.target===d&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var k;(k=v)==null||k.observe(t)})),n()}),d&&!u&&v.observe(d),v.observe(t));let b,x=u?si(e):null;u&&w();function w(){const S=si(e);x&&!dO(x,S)&&n(),x=S,b=requestAnimationFrame(w)}return n(),()=>{var S;p.forEach(C=>{s&&C.removeEventListener("scroll",n),o&&C.removeEventListener("resize",n)}),m==null||m(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const W7=g7,K7=y7,G7=h7,Y7=x7,X7=p7,TN=f7,Q7=v7,J7=(e,t,n)=>{const r=new Map,s={platform:V7,...n},o={...s.platform,_c:r};return d7(e,t,{...s,platform:o})};var Z7=typeof document<"u",eW=function(){},Uu=Z7?T.useLayoutEffect:eW;function yd(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,s;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(!yd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!yd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function fO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function AN(e,t){const n=fO(e);return Math.round(t*n)/n}function Qp(e){const t=T.useRef(e);return Uu(()=>{t.current=e}),t}function tW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,m]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=T.useState(r);yd(g,r)||v(r);const[b,x]=T.useState(null),[w,S]=T.useState(null),C=T.useCallback(F=>{F!==A.current&&(A.current=F,x(F))},[]),k=T.useCallback(F=>{F!==R.current&&(R.current=F,S(F))},[]),N=o||b,j=a||w,A=T.useRef(null),R=T.useRef(null),O=T.useRef(p),L=u!=null,B=Qp(u),M=Qp(s),$=Qp(d),U=T.useCallback(()=>{if(!A.current||!R.current)return;const F={placement:t,strategy:n,middleware:g};M.current&&(F.platform=M.current),J7(A.current,R.current,F).then(q=>{const G={...q,isPositioned:$.current!==!1};D.current&&!yd(O.current,G)&&(O.current=G,Nw.flushSync(()=>{m(G)}))})},[g,t,n,M,$]);Uu(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[d]);const D=T.useRef(!1);Uu(()=>(D.current=!0,()=>{D.current=!1}),[]),Uu(()=>{if(N&&(A.current=N),j&&(R.current=j),N&&j){if(B.current)return B.current(N,j,U);U()}},[N,j,U,B,L]);const V=T.useMemo(()=>({reference:A,floating:R,setReference:C,setFloating:k}),[C,k]),z=T.useMemo(()=>({reference:N,floating:j}),[N,j]),Q=T.useMemo(()=>{const F={position:n,left:0,top:0};if(!z.floating)return F;const q=AN(z.floating,p.x),G=AN(z.floating,p.y);return c?{...F,transform:"translate("+q+"px, "+G+"px)",...fO(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:G}},[n,c,z.floating,p.x,p.y]);return T.useMemo(()=>({...p,update:U,refs:V,elements:z,floatingStyles:Q}),[p,U,V,z,Q])}const nW=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?TN({element:r.current,padding:s}).fn(n):{}:r?TN({element:r,padding:s}).fn(n):{}}}},rW=(e,t)=>({...W7(e),options:[e,t]}),sW=(e,t)=>({...K7(e),options:[e,t]}),iW=(e,t)=>({...Q7(e),options:[e,t]}),oW=(e,t)=>({...G7(e),options:[e,t]}),aW=(e,t)=>({...Y7(e),options:[e,t]}),lW=(e,t)=>({...X7(e),options:[e,t]}),cW=(e,t)=>({...nW(e),options:[e,t]});var uW="Arrow",hO=T.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return h.jsx(Ze.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});hO.displayName=uW;var dW=hO;function fW(e){const[t,n]=T.useState(void 0);return bs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,c;if("borderBoxSize"in o){const u=o.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ub="Popper",[pO,mO]=ii(ub),[hW,gO]=pO(ub),yO=e=>{const{__scopePopper:t,children:n}=e,[r,s]=T.useState(null);return h.jsx(hW,{scope:t,anchor:r,onAnchorChange:s,children:n})};yO.displayName=ub;var vO="PopperAnchor",xO=T.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=gO(vO,n),a=T.useRef(null),c=Et(t,a),u=T.useRef(null);return T.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||a.current,d!==u.current&&o.onAnchorChange(u.current)}),r?null:h.jsx(Ze.div,{...s,ref:c})});xO.displayName=vO;var db="PopperContent",[pW,mW]=pO(db),wO=T.forwardRef((e,t)=>{var Y,ee,ie,ue,me,ye;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...x}=e,w=gO(db,n),[S,C]=T.useState(null),k=Et(t,pe=>C(pe)),[N,j]=T.useState(null),A=fW(N),R=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,L=r+(o!=="center"?"-"+o:""),B=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},M=Array.isArray(d)?d:[d],$=M.length>0,U={padding:B,boundary:M.filter(yW),altBoundary:$},{refs:D,floatingStyles:V,placement:z,isPositioned:Q,middlewareData:F}=tW({strategy:"fixed",placement:L,whileElementsMounted:(...pe)=>H7(...pe,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[rW({mainAxis:s+O,alignmentAxis:a}),u&&sW({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?iW():void 0,...U}),u&&oW({...U}),aW({...U,apply:({elements:pe,rects:_e,availableWidth:xe,availableHeight:Ce})=>{const{width:Ne,height:tt}=_e.reference,Le=pe.floating.style;Le.setProperty("--radix-popper-available-width",`${xe}px`),Le.setProperty("--radix-popper-available-height",`${Ce}px`),Le.setProperty("--radix-popper-anchor-width",`${Ne}px`),Le.setProperty("--radix-popper-anchor-height",`${tt}px`)}}),N&&cW({element:N,padding:c}),vW({arrowWidth:R,arrowHeight:O}),g&&lW({strategy:"referenceHidden",...U})]}),[q,G]=_O(z),P=ur(b);bs(()=>{Q&&(P==null||P())},[Q,P]);const W=(Y=F.arrow)==null?void 0:Y.x,oe=(ee=F.arrow)==null?void 0:ee.y,K=((ie=F.arrow)==null?void 0:ie.centerOffset)!==0,[J,te]=T.useState();return bs(()=>{S&&te(window.getComputedStyle(S).zIndex)},[S]),h.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(ue=F.transformOrigin)==null?void 0:ue.x,(me=F.transformOrigin)==null?void 0:me.y].join(" "),...((ye=F.hide)==null?void 0:ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(pW,{scope:n,placedSide:q,onArrowChange:j,arrowX:W,arrowY:oe,shouldHideArrow:K,children:h.jsx(Ze.div,{"data-side":q,"data-align":G,...x,ref:k,style:{...x.style,animation:Q?void 0:"none"}})})})});wO.displayName=db;var bO="PopperArrow",gW={top:"bottom",right:"left",bottom:"top",left:"right"},SO=T.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=mW(bO,r),a=gW[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(dW,{...s,ref:n,style:{...s.style,display:"block"}})})});SO.displayName=bO;function yW(e){return e!==null}var vW=e=>({name:"transformOrigin",options:e,fn(t){var w,S,C;const{placement:n,rects:r,middlewareData:s}=t,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[d,p]=_O(n),m={start:"0%",center:"50%",end:"100%"}[p],g=(((S=s.arrow)==null?void 0:S.x)??0)+c/2,v=(((C=s.arrow)==null?void 0:C.y)??0)+u/2;let b="",x="";return d==="bottom"?(b=a?m:`${g}px`,x=`${-u}px`):d==="top"?(b=a?m:`${g}px`,x=`${r.floating.height+u}px`):d==="right"?(b=`${-u}px`,x=a?m:`${v}px`):d==="left"&&(b=`${r.floating.width+u}px`,x=a?m:`${v}px`),{data:{x:b,y:x}}}});function _O(e){const[t,n="center"]=e.split("-");return[t,n]}var xW=yO,wW=xO,bW=wO,SW=SO,Zx=["Enter"," "],_W=["ArrowDown","PageUp","Home"],kO=["ArrowUp","PageDown","End"],kW=[..._W,...kO],NW={ltr:[...Zx,"ArrowRight"],rtl:[...Zx,"ArrowLeft"]},CW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Dl="Menu",[pl,EW,jW]=VI(Dl),[ai,NO]=ii(Dl,[jW,mO,Fd]),tf=mO(),CO=Fd(),[TW,li]=ai(Dl),[AW,$l]=ai(Dl),EO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=tf(t),[u,d]=T.useState(null),p=T.useRef(!1),m=ur(o),g=Fw(s);return T.useEffect(()=>{const v=()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>p.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),h.jsx(xW,{...c,children:h.jsx(TW,{scope:t,open:n,onOpenChange:m,content:u,onContentChange:d,children:h.jsx(AW,{scope:t,onClose:T.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:g,modal:a,children:r})})})};EO.displayName=Dl;var RW="MenuAnchor",fb=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=tf(n);return h.jsx(wW,{...s,...r,ref:t})});fb.displayName=RW;var hb="MenuPortal",[IW,jO]=ai(hb,{forceMount:void 0}),TO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=li(hb,t);return h.jsx(IW,{scope:t,forceMount:n,children:h.jsx($r,{present:n||o.open,children:h.jsx(Ow,{asChild:!0,container:s,children:r})})})};TO.displayName=hb;var kn="MenuContent",[MW,pb]=ai(kn),AO=T.forwardRef((e,t)=>{const n=jO(kn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=li(kn,e.__scopeMenu),a=$l(kn,e.__scopeMenu);return h.jsx(pl.Provider,{scope:e.__scopeMenu,children:h.jsx($r,{present:r||o.open,children:h.jsx(pl.Slot,{scope:e.__scopeMenu,children:a.modal?h.jsx(OW,{...s,ref:t}):h.jsx(PW,{...s,ref:t})})})})}),OW=T.forwardRef((e,t)=>{const n=li(kn,e.__scopeMenu),r=T.useRef(null),s=Et(t,r);return T.useEffect(()=>{const o=r.current;if(o)return bI(o)},[]),h.jsx(mb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),PW=T.forwardRef((e,t)=>{const n=li(kn,e.__scopeMenu);return h.jsx(mb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),LW=ll("MenuContent.ScrollLock"),mb=T.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...x}=e,w=li(kn,n),S=$l(kn,n),C=tf(n),k=CO(n),N=EW(n),[j,A]=T.useState(null),R=T.useRef(null),O=Et(t,R,w.onContentChange),L=T.useRef(0),B=T.useRef(""),M=T.useRef(0),$=T.useRef(null),U=T.useRef("right"),D=T.useRef(0),V=b?Pw:T.Fragment,z=b?{as:LW,allowPinchZoom:!0}:void 0,Q=q=>{var Y,ee;const G=B.current+q,P=N().filter(ie=>!ie.disabled),W=document.activeElement,oe=(Y=P.find(ie=>ie.ref.current===W))==null?void 0:Y.textValue,K=P.map(ie=>ie.textValue),J=GW(K,G,oe),te=(ee=P.find(ie=>ie.textValue===J))==null?void 0:ee.ref.current;(function ie(ue){B.current=ue,window.clearTimeout(L.current),ue!==""&&(L.current=window.setTimeout(()=>ie(""),1e3))})(G),te&&setTimeout(()=>te.focus())};T.useEffect(()=>()=>window.clearTimeout(L.current),[]),fI();const F=T.useCallback(q=>{var P,W;return U.current===((P=$.current)==null?void 0:P.side)&&XW(q,(W=$.current)==null?void 0:W.area)},[]);return h.jsx(MW,{scope:n,searchRef:B,onItemEnter:T.useCallback(q=>{F(q)&&q.preventDefault()},[F]),onItemLeave:T.useCallback(q=>{var G;F(q)||((G=R.current)==null||G.focus(),A(null))},[F]),onTriggerLeave:T.useCallback(q=>{F(q)&&q.preventDefault()},[F]),pointerGraceTimerRef:M,onPointerGraceIntentChange:T.useCallback(q=>{$.current=q},[]),children:h.jsx(V,{...z,children:h.jsx(Mw,{asChild:!0,trapped:s,onMountAutoFocus:Re(o,q=>{var G;q.preventDefault(),(G=R.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(Iw,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:g,onDismiss:v,children:h.jsx(YI,{asChild:!0,...k,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:A,onEntryFocus:Re(u,q=>{S.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(bW,{role:"menu","aria-orientation":"vertical","data-state":WO(w.open),"data-radix-menu-content":"",dir:S.dir,...C,...x,ref:O,style:{outline:"none",...x.style},onKeyDown:Re(x.onKeyDown,q=>{const P=q.target.closest("[data-radix-menu-content]")===q.currentTarget,W=q.ctrlKey||q.altKey||q.metaKey,oe=q.key.length===1;P&&(q.key==="Tab"&&q.preventDefault(),!W&&oe&&Q(q.key));const K=R.current;if(q.target!==K||!kW.includes(q.key))return;q.preventDefault();const te=N().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);kO.includes(q.key)&&te.reverse(),WW(te)}),onBlur:Re(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(L.current),B.current="")}),onPointerMove:Re(e.onPointerMove,ml(q=>{const G=q.target,P=D.current!==q.clientX;if(q.currentTarget.contains(G)&&P){const W=q.clientX>D.current?"right":"left";U.current=W,D.current=q.clientX}}))})})})})})})});AO.displayName=kn;var DW="MenuGroup",gb=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ze.div,{role:"group",...r,ref:t})});gb.displayName=DW;var $W="MenuLabel",RO=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ze.div,{...r,ref:t})});RO.displayName=$W;var vd="MenuItem",RN="menu.itemSelect",nf=T.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=T.useRef(null),a=$l(vd,e.__scopeMenu),c=pb(vd,e.__scopeMenu),u=Et(t,o),d=T.useRef(!1),p=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(RN,{bubbles:!0,cancelable:!0});m.addEventListener(RN,v=>r==null?void 0:r(v),{once:!0}),lI(m,g),g.defaultPrevented?d.current=!1:a.onClose()}};return h.jsx(IO,{...s,ref:u,disabled:n,onClick:Re(e.onClick,p),onPointerDown:m=>{var g;(g=e.onPointerDown)==null||g.call(e,m),d.current=!0},onPointerUp:Re(e.onPointerUp,m=>{var g;d.current||(g=m.currentTarget)==null||g.click()}),onKeyDown:Re(e.onKeyDown,m=>{const g=c.searchRef.current!=="";n||g&&m.key===" "||Zx.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});nf.displayName=vd;var IO=T.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=pb(vd,n),c=CO(n),u=T.useRef(null),d=Et(t,u),[p,m]=T.useState(!1),[g,v]=T.useState("");return T.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[o.children]),h.jsx(pl.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:h.jsx(XI,{asChild:!0,...c,focusable:!r,children:h.jsx(Ze.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Re(e.onPointerMove,ml(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,ml(b=>a.onItemLeave(b))),onFocus:Re(e.onFocus,()=>m(!0)),onBlur:Re(e.onBlur,()=>m(!1))})})})}),qW="MenuCheckboxItem",MO=T.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return h.jsx($O,{scope:e.__scopeMenu,checked:n,children:h.jsx(nf,{role:"menuitemcheckbox","aria-checked":xd(n)?"mixed":n,...s,ref:t,"data-state":vb(n),onSelect:Re(s.onSelect,()=>r==null?void 0:r(xd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MO.displayName=qW;var OO="MenuRadioGroup",[FW,BW]=ai(OO,{value:void 0,onValueChange:()=>{}}),PO=T.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=ur(r);return h.jsx(FW,{scope:e.__scopeMenu,value:n,onValueChange:o,children:h.jsx(gb,{...s,ref:t})})});PO.displayName=OO;var LO="MenuRadioItem",DO=T.forwardRef((e,t)=>{const{value:n,...r}=e,s=BW(LO,e.__scopeMenu),o=n===s.value;return h.jsx($O,{scope:e.__scopeMenu,checked:o,children:h.jsx(nf,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":vb(o),onSelect:Re(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});DO.displayName=LO;var yb="MenuItemIndicator",[$O,zW]=ai(yb,{checked:!1}),qO=T.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=zW(yb,n);return h.jsx($r,{present:r||xd(o.checked)||o.checked===!0,children:h.jsx(Ze.span,{...s,ref:t,"data-state":vb(o.checked)})})});qO.displayName=yb;var VW="MenuSeparator",FO=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});FO.displayName=VW;var UW="MenuArrow",BO=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=tf(n);return h.jsx(SW,{...s,...r,ref:t})});BO.displayName=UW;var HW="MenuSub",[FJ,zO]=ai(HW),qa="MenuSubTrigger",VO=T.forwardRef((e,t)=>{const n=li(qa,e.__scopeMenu),r=$l(qa,e.__scopeMenu),s=zO(qa,e.__scopeMenu),o=pb(qa,e.__scopeMenu),a=T.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},p=T.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return T.useEffect(()=>p,[p]),T.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]),h.jsx(fb,{asChild:!0,...d,children:h.jsx(IO,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":WO(n.open),...e,ref:Aw(t,s.onTriggerChange),onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,ml(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Re(e.onPointerLeave,ml(m=>{var v,b;p();const g=(v=n.content)==null?void 0:v.getBoundingClientRect();if(g){const x=(b=n.content)==null?void 0:b.dataset.side,w=x==="right",S=w?-5:5,C=g[w?"left":"right"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+S,y:m.clientY},{x:C,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:C,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,m=>{var v;const g=o.searchRef.current!=="";e.disabled||g&&m.key===" "||NW[r.dir].includes(m.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),m.preventDefault())})})})});VO.displayName=qa;var UO="MenuSubContent",HO=T.forwardRef((e,t)=>{const n=jO(kn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=li(kn,e.__scopeMenu),a=$l(kn,e.__scopeMenu),c=zO(UO,e.__scopeMenu),u=T.useRef(null),d=Et(t,u);return h.jsx(pl.Provider,{scope:e.__scopeMenu,children:h.jsx($r,{present:r||o.open,children:h.jsx(pl.Slot,{scope:e.__scopeMenu,children:h.jsx(mb,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var m;a.isUsingKeyboardRef.current&&((m=u.current)==null||m.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Re(e.onFocusOutside,p=>{p.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Re(e.onKeyDown,p=>{var v;const m=p.currentTarget.contains(p.target),g=CW[a.dir].includes(p.key);m&&g&&(o.onOpenChange(!1),(v=c.trigger)==null||v.focus(),p.preventDefault())})})})})})});HO.displayName=UO;function WO(e){return e?"open":"closed"}function xd(e){return e==="indeterminate"}function vb(e){return xd(e)?"indeterminate":e?"checked":"unchecked"}function WW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function KW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function GW(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=KW(e,Math.max(o,0));s.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function YW(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],u=t[a],d=c.x,p=c.y,m=u.x,g=u.y;p>r!=g>r&&n<(m-d)*(r-p)/(g-p)+d&&(s=!s)}return s}function XW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return YW(n,t)}function ml(e){return t=>t.pointerType==="mouse"?e(t):void 0}var QW=EO,JW=fb,ZW=TO,eK=AO,tK=gb,nK=RO,rK=nf,sK=MO,iK=PO,oK=DO,aK=qO,lK=FO,cK=BO,uK=VO,dK=HO,xb="ContextMenu",[fK]=ii(xb,[NO]),zt=NO(),[hK,KO]=fK(xb),GO=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:o=!0}=e,[a,c]=T.useState(!1),u=zt(t),d=ur(r),p=T.useCallback(m=>{c(m),d(m)},[d]);return h.jsx(hK,{scope:t,open:a,onOpenChange:p,modal:o,children:h.jsx(QW,{...u,dir:s,open:a,onOpenChange:p,modal:o,children:n})})};GO.displayName=xb;var YO="ContextMenuTrigger",XO=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,o=KO(YO,n),a=zt(n),c=T.useRef({x:0,y:0}),u=T.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=T.useRef(0),p=T.useCallback(()=>window.clearTimeout(d.current),[]),m=g=>{c.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return T.useEffect(()=>p,[p]),T.useEffect(()=>void(r&&p()),[r,p]),h.jsxs(h.Fragment,{children:[h.jsx(JW,{...a,virtualRef:u}),h.jsx(Ze.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Re(e.onContextMenu,g=>{p(),m(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Re(e.onPointerDown,Tu(g=>{p(),d.current=window.setTimeout(()=>m(g),700)})),onPointerMove:r?e.onPointerMove:Re(e.onPointerMove,Tu(p)),onPointerCancel:r?e.onPointerCancel:Re(e.onPointerCancel,Tu(p)),onPointerUp:r?e.onPointerUp:Re(e.onPointerUp,Tu(p))})]})});XO.displayName=YO;var pK="ContextMenuPortal",QO=e=>{const{__scopeContextMenu:t,...n}=e,r=zt(t);return h.jsx(ZW,{...r,...n})};QO.displayName=pK;var JO="ContextMenuContent",ZO=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=KO(JO,n),o=zt(n),a=T.useRef(!1);return h.jsx(eK,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ZO.displayName=JO;var mK="ContextMenuGroup",gK=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(tK,{...s,...r,ref:t})});gK.displayName=mK;var yK="ContextMenuLabel",eP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(nK,{...s,...r,ref:t})});eP.displayName=yK;var vK="ContextMenuItem",tP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(rK,{...s,...r,ref:t})});tP.displayName=vK;var xK="ContextMenuCheckboxItem",nP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(sK,{...s,...r,ref:t})});nP.displayName=xK;var wK="ContextMenuRadioGroup",bK=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(iK,{...s,...r,ref:t})});bK.displayName=wK;var SK="ContextMenuRadioItem",rP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(oK,{...s,...r,ref:t})});rP.displayName=SK;var _K="ContextMenuItemIndicator",sP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(aK,{...s,...r,ref:t})});sP.displayName=_K;var kK="ContextMenuSeparator",iP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(lK,{...s,...r,ref:t})});iP.displayName=kK;var NK="ContextMenuArrow",CK=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(cK,{...s,...r,ref:t})});CK.displayName=NK;var EK="ContextMenuSubTrigger",oP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(uK,{...s,...r,ref:t})});oP.displayName=EK;var jK="ContextMenuSubContent",aP=T.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return h.jsx(dK,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});aP.displayName=jK;function Tu(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var TK=GO,AK=XO,RK=QO,lP=ZO,cP=eP,uP=tP,dP=nP,fP=rP,hP=sP,pP=iP,mP=oP,gP=aP;const IK=TK,MK=AK,OK=T.forwardRef(({className:e,inset:t,children:n,...r},s)=>h.jsxs(mP,{ref:s,className:Bt("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-white/10 data-[state=open]:bg-white/10",t&&"pl-8",e),...r,children:[n,h.jsx("span",{className:"ml-auto text-xs",children:"▶"})]}));OK.displayName=mP.displayName;const PK=T.forwardRef(({className:e,...t},n)=>h.jsx(gP,{ref:n,className:Bt("z-50 min-w-[8rem] overflow-hidden rounded-md border border-node-border bg-panel-bg p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t}));PK.displayName=gP.displayName;const yP=T.forwardRef(({className:e,...t},n)=>h.jsx(RK,{children:h.jsx(lP,{ref:n,className:Bt("z-50 min-w-[12rem] overflow-hidden rounded-md border border-node-border bg-panel-bg p-1 shadow-lg","animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t})}));yP.displayName=lP.displayName;const Xi=T.forwardRef(({className:e,inset:t,destructive:n,...r},s)=>h.jsx(uP,{ref:s,className:Bt("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"text-error focus:bg-error/10 focus:text-error",t&&"pl-8",e),...r}));Xi.displayName=uP.displayName;const LK=T.forwardRef(({className:e,children:t,checked:n,...r},s)=>h.jsxs(dP,{ref:s,className:Bt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(hP,{children:h.jsx("span",{className:"text-primary",children:"✓"})})}),t]}));LK.displayName=dP.displayName;const DK=T.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(fP,{ref:r,className:Bt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(hP,{children:h.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));DK.displayName=fP.displayName;const $K=T.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(cP,{ref:r,className:Bt("px-2 py-1.5 text-xs font-semibold text-gray-400",t&&"pl-8",e),...n}));$K.displayName=cP.displayName;const ew=T.forwardRef(({className:e,...t},n)=>h.jsx(pP,{ref:n,className:Bt("-mx-1 my-1 h-px bg-node-border",e),...t}));ew.displayName=pP.displayName;const Fa=({className:e,...t})=>h.jsx("span",{className:Bt("ml-auto text-xs tracking-widest text-gray-500",e),...t});Fa.displayName="ContextMenuShortcut";function wb(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Jp,IN;function qK(){if(IN)return Jp;IN=1;function e(){this.__data__=[],this.size=0}return Jp=e,Jp}var Zp,MN;function Io(){if(MN)return Zp;MN=1;function e(t,n){return t===n||t!==t&&n!==n}return Zp=e,Zp}var em,ON;function rf(){if(ON)return em;ON=1;var e=Io();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return em=t,em}var tm,PN;function FK(){if(PN)return tm;PN=1;var e=rf(),t=Array.prototype,n=t.splice;function r(s){var o=this.__data__,a=e(o,s);if(a<0)return!1;var c=o.length-1;return a==c?o.pop():n.call(o,a,1),--this.size,!0}return tm=r,tm}var nm,LN;function BK(){if(LN)return nm;LN=1;var e=rf();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return nm=t,nm}var rm,DN;function zK(){if(DN)return rm;DN=1;var e=rf();function t(n){return e(this.__data__,n)>-1}return rm=t,rm}var sm,$N;function VK(){if($N)return sm;$N=1;var e=rf();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return sm=t,sm}var im,qN;function sf(){if(qN)return im;qN=1;var e=qK(),t=FK(),n=BK(),r=zK(),s=VK();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var d=a[c];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,im=o,im}var om,FN;function UK(){if(FN)return om;FN=1;var e=sf();function t(){this.__data__=new e,this.size=0}return om=t,om}var am,BN;function HK(){if(BN)return am;BN=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return am=e,am}var lm,zN;function WK(){if(zN)return lm;zN=1;function e(t){return this.__data__.get(t)}return lm=e,lm}var cm,VN;function KK(){if(VN)return cm;VN=1;function e(t){return this.__data__.has(t)}return cm=e,cm}var um,UN;function vP(){if(UN)return um;UN=1;var e=typeof iu=="object"&&iu&&iu.Object===Object&&iu;return um=e,um}var dm,HN;function Gn(){if(HN)return dm;HN=1;var e=vP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return dm=n,dm}var fm,WN;function Mo(){if(WN)return fm;WN=1;var e=Gn(),t=e.Symbol;return fm=t,fm}var hm,KN;function GK(){if(KN)return hm;KN=1;var e=Mo(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(a){var c=n.call(a,s),u=a[s];try{a[s]=void 0;var d=!0}catch{}var p=r.call(a);return d&&(c?a[s]=u:delete a[s]),p}return hm=o,hm}var pm,GN;function YK(){if(GN)return pm;GN=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return pm=n,pm}var mm,YN;function ci(){if(YN)return mm;YN=1;var e=Mo(),t=GK(),n=YK(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(c){return c==null?c===void 0?s:r:o&&o in Object(c)?t(c):n(c)}return mm=a,mm}var gm,XN;function Cn(){if(XN)return gm;XN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return gm=e,gm}var ym,QN;function ql(){if(QN)return ym;QN=1;var e=ci(),t=Cn(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(c){if(!t(c))return!1;var u=e(c);return u==r||u==s||u==n||u==o}return ym=a,ym}var vm,JN;function XK(){if(JN)return vm;JN=1;var e=Gn(),t=e["__core-js_shared__"];return vm=t,vm}var xm,ZN;function QK(){if(ZN)return xm;ZN=1;var e=XK(),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 xm=n,xm}var wm,eC;function xP(){if(eC)return wm;eC=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 wm=n,wm}var bm,tC;function JK(){if(tC)return bm;tC=1;var e=ql(),t=QK(),n=Cn(),r=xP(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,u=a.toString,d=c.hasOwnProperty,p=RegExp("^"+u.call(d).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!n(g)||t(g))return!1;var v=e(g)?p:o;return v.test(r(g))}return bm=m,bm}var Sm,nC;function ZK(){if(nC)return Sm;nC=1;function e(t,n){return t==null?void 0:t[n]}return Sm=e,Sm}var _m,rC;function ui(){if(rC)return _m;rC=1;var e=JK(),t=ZK();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return _m=n,_m}var km,sC;function bb(){if(sC)return km;sC=1;var e=ui(),t=Gn(),n=e(t,"Map");return km=n,km}var Nm,iC;function of(){if(iC)return Nm;iC=1;var e=ui(),t=e(Object,"create");return Nm=t,Nm}var Cm,oC;function eG(){if(oC)return Cm;oC=1;var e=of();function t(){this.__data__=e?e(null):{},this.size=0}return Cm=t,Cm}var Em,aC;function tG(){if(aC)return Em;aC=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Em=e,Em}var jm,lC;function nG(){if(lC)return jm;lC=1;var e=of(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(e){var c=a[o];return c===t?void 0:c}return r.call(a,o)?a[o]:void 0}return jm=s,jm}var Tm,cC;function rG(){if(cC)return Tm;cC=1;var e=of(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return Tm=r,Tm}var Am,uC;function sG(){if(uC)return Am;uC=1;var e=of(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return Am=n,Am}var Rm,dC;function iG(){if(dC)return Rm;dC=1;var e=eG(),t=tG(),n=nG(),r=rG(),s=sG();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var d=a[c];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,Rm=o,Rm}var Im,fC;function oG(){if(fC)return Im;fC=1;var e=iG(),t=sf(),n=bb();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Im=r,Im}var Mm,hC;function aG(){if(hC)return Mm;hC=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Mm=e,Mm}var Om,pC;function af(){if(pC)return Om;pC=1;var e=aG();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return Om=t,Om}var Pm,mC;function lG(){if(mC)return Pm;mC=1;var e=af();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Pm=t,Pm}var Lm,gC;function cG(){if(gC)return Lm;gC=1;var e=af();function t(n){return e(this,n).get(n)}return Lm=t,Lm}var Dm,yC;function uG(){if(yC)return Dm;yC=1;var e=af();function t(n){return e(this,n).has(n)}return Dm=t,Dm}var $m,vC;function dG(){if(vC)return $m;vC=1;var e=af();function t(n,r){var s=e(this,n),o=s.size;return s.set(n,r),this.size+=s.size==o?0:1,this}return $m=t,$m}var qm,xC;function Sb(){if(xC)return qm;xC=1;var e=oG(),t=lG(),n=cG(),r=uG(),s=dG();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var d=a[c];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,qm=o,qm}var Fm,wC;function fG(){if(wC)return Fm;wC=1;var e=sf(),t=bb(),n=Sb(),r=200;function s(o,a){var c=this.__data__;if(c instanceof e){var u=c.__data__;if(!t||u.length<r-1)return u.push([o,a]),this.size=++c.size,this;c=this.__data__=new n(u)}return c.set(o,a),this.size=c.size,this}return Fm=s,Fm}var Bm,bC;function lf(){if(bC)return Bm;bC=1;var e=sf(),t=UK(),n=HK(),r=WK(),s=KK(),o=fG();function a(c){var u=this.__data__=new e(c);this.size=u.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,Bm=a,Bm}var zm,SC;function _b(){if(SC)return zm;SC=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s&&n(t[r],r,t)!==!1;);return t}return zm=e,zm}var Vm,_C;function wP(){if(_C)return Vm;_C=1;var e=ui(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Vm=t,Vm}var Um,kC;function cf(){if(kC)return Um;kC=1;var e=wP();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return Um=t,Um}var Hm,NC;function uf(){if(NC)return Hm;NC=1;var e=cf(),t=Io(),n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c){var u=o[a];(!(r.call(o,a)&&t(u,c))||c===void 0&&!(a in o))&&e(o,a,c)}return Hm=s,Hm}var Wm,CC;function Fl(){if(CC)return Wm;CC=1;var e=uf(),t=cf();function n(r,s,o,a){var c=!o;o||(o={});for(var u=-1,d=s.length;++u<d;){var p=s[u],m=a?a(o[p],r[p],p,o,r):void 0;m===void 0&&(m=r[p]),c?t(o,p,m):e(o,p,m)}return o}return Wm=n,Wm}var Km,EC;function hG(){if(EC)return Km;EC=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return Km=e,Km}var Gm,jC;function gr(){if(jC)return Gm;jC=1;function e(t){return t!=null&&typeof t=="object"}return Gm=e,Gm}var Ym,TC;function pG(){if(TC)return Ym;TC=1;var e=ci(),t=gr(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return Ym=r,Ym}var Xm,AC;function Bl(){if(AC)return Xm;AC=1;var e=pG(),t=gr(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!s.call(a,"callee")};return Xm=o,Xm}var Qm,RC;function yt(){if(RC)return Qm;RC=1;var e=Array.isArray;return Qm=e,Qm}var Ba={exports:{}},Jm,IC;function mG(){if(IC)return Jm;IC=1;function e(){return!1}return Jm=e,Jm}Ba.exports;var MC;function Oo(){return MC||(MC=1,(function(e,t){var n=Gn(),r=mG(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,c=a?n.Buffer:void 0,u=c?c.isBuffer:void 0,d=u||r;e.exports=d})(Ba,Ba.exports)),Ba.exports}var Zm,OC;function df(){if(OC)return Zm;OC=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var o=typeof r;return s=s??e,!!s&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return Zm=n,Zm}var eg,PC;function kb(){if(PC)return eg;PC=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return eg=t,eg}var tg,LC;function gG(){if(LC)return tg;LC=1;var e=ci(),t=kb(),n=gr(),r="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",p="[object Number]",m="[object Object]",g="[object RegExp]",v="[object Set]",b="[object String]",x="[object WeakMap]",w="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",k="[object Float64Array]",N="[object Int8Array]",j="[object Int16Array]",A="[object Int32Array]",R="[object Uint8Array]",O="[object Uint8ClampedArray]",L="[object Uint16Array]",B="[object Uint32Array]",M={};M[C]=M[k]=M[N]=M[j]=M[A]=M[R]=M[O]=M[L]=M[B]=!0,M[r]=M[s]=M[w]=M[o]=M[S]=M[a]=M[c]=M[u]=M[d]=M[p]=M[m]=M[g]=M[v]=M[b]=M[x]=!1;function $(U){return n(U)&&t(U.length)&&!!M[e(U)]}return tg=$,tg}var ng,DC;function ff(){if(DC)return ng;DC=1;function e(t){return function(n){return t(n)}}return ng=e,ng}var za={exports:{}};za.exports;var $C;function Nb(){return $C||($C=1,(function(e,t){var n=vP(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o&&n.process,c=(function(){try{var u=s&&s.require&&s.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=c})(za,za.exports)),za.exports}var rg,qC;function zl(){if(qC)return rg;qC=1;var e=gG(),t=ff(),n=Nb(),r=n&&n.isTypedArray,s=r?t(r):e;return rg=s,rg}var sg,FC;function bP(){if(FC)return sg;FC=1;var e=hG(),t=Bl(),n=yt(),r=Oo(),s=df(),o=zl(),a=Object.prototype,c=a.hasOwnProperty;function u(d,p){var m=n(d),g=!m&&t(d),v=!m&&!g&&r(d),b=!m&&!g&&!v&&o(d),x=m||g||v||b,w=x?e(d.length,String):[],S=w.length;for(var C in d)(p||c.call(d,C))&&!(x&&(C=="length"||v&&(C=="offset"||C=="parent")||b&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||s(C,S)))&&w.push(C);return w}return sg=u,sg}var ig,BC;function hf(){if(BC)return ig;BC=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return ig=t,ig}var og,zC;function SP(){if(zC)return og;zC=1;function e(t,n){return function(r){return t(n(r))}}return og=e,og}var ag,VC;function yG(){if(VC)return ag;VC=1;var e=SP(),t=e(Object.keys,Object);return ag=t,ag}var lg,UC;function Cb(){if(UC)return lg;UC=1;var e=hf(),t=yG(),n=Object.prototype,r=n.hasOwnProperty;function s(o){if(!e(o))return t(o);var a=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&a.push(c);return a}return lg=s,lg}var cg,HC;function qr(){if(HC)return cg;HC=1;var e=ql(),t=kb();function n(r){return r!=null&&t(r.length)&&!e(r)}return cg=n,cg}var ug,WC;function Ns(){if(WC)return ug;WC=1;var e=bP(),t=Cb(),n=qr();function r(s){return n(s)?e(s):t(s)}return ug=r,ug}var dg,KC;function vG(){if(KC)return dg;KC=1;var e=Fl(),t=Ns();function n(r,s){return r&&e(s,t(s),r)}return dg=n,dg}var fg,GC;function xG(){if(GC)return fg;GC=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return fg=e,fg}var hg,YC;function wG(){if(YC)return hg;YC=1;var e=Cn(),t=hf(),n=xG(),r=Object.prototype,s=r.hasOwnProperty;function o(a){if(!e(a))return n(a);var c=t(a),u=[];for(var d in a)d=="constructor"&&(c||!s.call(a,d))||u.push(d);return u}return hg=o,hg}var pg,XC;function di(){if(XC)return pg;XC=1;var e=bP(),t=wG(),n=qr();function r(s){return n(s)?e(s,!0):t(s)}return pg=r,pg}var mg,QC;function bG(){if(QC)return mg;QC=1;var e=Fl(),t=di();function n(r,s){return r&&e(s,t(s),r)}return mg=n,mg}var Va={exports:{}};Va.exports;var JC;function _P(){return JC||(JC=1,(function(e,t){var n=Gn(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o?n.Buffer:void 0,c=a?a.allocUnsafe:void 0;function u(d,p){if(p)return d.slice();var m=d.length,g=c?c(m):new d.constructor(m);return d.copy(g),g}e.exports=u})(Va,Va.exports)),Va.exports}var gg,ZC;function kP(){if(ZC)return gg;ZC=1;function e(t,n){var r=-1,s=t.length;for(n||(n=Array(s));++r<s;)n[r]=t[r];return n}return gg=e,gg}var yg,e2;function NP(){if(e2)return yg;e2=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=0,a=[];++r<s;){var c=t[r];n(c,r,t)&&(a[o++]=c)}return a}return yg=e,yg}var vg,t2;function CP(){if(t2)return vg;t2=1;function e(){return[]}return vg=e,vg}var xg,n2;function Eb(){if(n2)return xg;n2=1;var e=NP(),t=CP(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(a){return a==null?[]:(a=Object(a),e(s(a),function(c){return r.call(a,c)}))}:t;return xg=o,xg}var wg,r2;function SG(){if(r2)return wg;r2=1;var e=Fl(),t=Eb();function n(r,s){return e(r,t(r),s)}return wg=n,wg}var bg,s2;function jb(){if(s2)return bg;s2=1;function e(t,n){for(var r=-1,s=n.length,o=t.length;++r<s;)t[o+r]=n[r];return t}return bg=e,bg}var Sg,i2;function pf(){if(i2)return Sg;i2=1;var e=SP(),t=e(Object.getPrototypeOf,Object);return Sg=t,Sg}var _g,o2;function EP(){if(o2)return _g;o2=1;var e=jb(),t=pf(),n=Eb(),r=CP(),s=Object.getOwnPropertySymbols,o=s?function(a){for(var c=[];a;)e(c,n(a)),a=t(a);return c}:r;return _g=o,_g}var kg,a2;function _G(){if(a2)return kg;a2=1;var e=Fl(),t=EP();function n(r,s){return e(r,t(r),s)}return kg=n,kg}var Ng,l2;function jP(){if(l2)return Ng;l2=1;var e=jb(),t=yt();function n(r,s,o){var a=s(r);return t(r)?a:e(a,o(r))}return Ng=n,Ng}var Cg,c2;function TP(){if(c2)return Cg;c2=1;var e=jP(),t=Eb(),n=Ns();function r(s){return e(s,n,t)}return Cg=r,Cg}var Eg,u2;function kG(){if(u2)return Eg;u2=1;var e=jP(),t=EP(),n=di();function r(s){return e(s,n,t)}return Eg=r,Eg}var jg,d2;function NG(){if(d2)return jg;d2=1;var e=ui(),t=Gn(),n=e(t,"DataView");return jg=n,jg}var Tg,f2;function CG(){if(f2)return Tg;f2=1;var e=ui(),t=Gn(),n=e(t,"Promise");return Tg=n,Tg}var Ag,h2;function AP(){if(h2)return Ag;h2=1;var e=ui(),t=Gn(),n=e(t,"Set");return Ag=n,Ag}var Rg,p2;function EG(){if(p2)return Rg;p2=1;var e=ui(),t=Gn(),n=e(t,"WeakMap");return Rg=n,Rg}var Ig,m2;function Po(){if(m2)return Ig;m2=1;var e=NG(),t=bb(),n=CG(),r=AP(),s=EG(),o=ci(),a=xP(),c="[object Map]",u="[object Object]",d="[object Promise]",p="[object Set]",m="[object WeakMap]",g="[object DataView]",v=a(e),b=a(t),x=a(n),w=a(r),S=a(s),C=o;return(e&&C(new e(new ArrayBuffer(1)))!=g||t&&C(new t)!=c||n&&C(n.resolve())!=d||r&&C(new r)!=p||s&&C(new s)!=m)&&(C=function(k){var N=o(k),j=N==u?k.constructor:void 0,A=j?a(j):"";if(A)switch(A){case v:return g;case b:return c;case x:return d;case w:return p;case S:return m}return N}),Ig=C,Ig}var Mg,g2;function jG(){if(g2)return Mg;g2=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var s=r.length,o=new r.constructor(s);return s&&typeof r[0]=="string"&&t.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return Mg=n,Mg}var Og,y2;function RP(){if(y2)return Og;y2=1;var e=Gn(),t=e.Uint8Array;return Og=t,Og}var Pg,v2;function Tb(){if(v2)return Pg;v2=1;var e=RP();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return Pg=t,Pg}var Lg,x2;function TG(){if(x2)return Lg;x2=1;var e=Tb();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}return Lg=t,Lg}var Dg,w2;function AG(){if(w2)return Dg;w2=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return Dg=t,Dg}var $g,b2;function RG(){if(b2)return $g;b2=1;var e=Mo(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(s){return n?Object(n.call(s)):{}}return $g=r,$g}var qg,S2;function IP(){if(S2)return qg;S2=1;var e=Tb();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}return qg=t,qg}var Fg,_2;function IG(){if(_2)return Fg;_2=1;var e=Tb(),t=TG(),n=AG(),r=RG(),s=IP(),o="[object Boolean]",a="[object Date]",c="[object Map]",u="[object Number]",d="[object RegExp]",p="[object Set]",m="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",C="[object Int16Array]",k="[object Int32Array]",N="[object Uint8Array]",j="[object Uint8ClampedArray]",A="[object Uint16Array]",R="[object Uint32Array]";function O(L,B,M){var $=L.constructor;switch(B){case v:return e(L);case o:case a:return new $(+L);case b:return t(L,M);case x:case w:case S:case C:case k:case N:case j:case A:case R:return s(L,M);case c:return new $;case u:case m:return new $(L);case d:return n(L);case p:return new $;case g:return r(L)}}return Fg=O,Fg}var Bg,k2;function MP(){if(k2)return Bg;k2=1;var e=Cn(),t=Object.create,n=(function(){function r(){}return function(s){if(!e(s))return{};if(t)return t(s);r.prototype=s;var o=new r;return r.prototype=void 0,o}})();return Bg=n,Bg}var zg,N2;function OP(){if(N2)return zg;N2=1;var e=MP(),t=pf(),n=hf();function r(s){return typeof s.constructor=="function"&&!n(s)?e(t(s)):{}}return zg=r,zg}var Vg,C2;function MG(){if(C2)return Vg;C2=1;var e=Po(),t=gr(),n="[object Map]";function r(s){return t(s)&&e(s)==n}return Vg=r,Vg}var Ug,E2;function OG(){if(E2)return Ug;E2=1;var e=MG(),t=ff(),n=Nb(),r=n&&n.isMap,s=r?t(r):e;return Ug=s,Ug}var Hg,j2;function PG(){if(j2)return Hg;j2=1;var e=Po(),t=gr(),n="[object Set]";function r(s){return t(s)&&e(s)==n}return Hg=r,Hg}var Wg,T2;function LG(){if(T2)return Wg;T2=1;var e=PG(),t=ff(),n=Nb(),r=n&&n.isSet,s=r?t(r):e;return Wg=s,Wg}var Kg,A2;function PP(){if(A2)return Kg;A2=1;var e=lf(),t=_b(),n=uf(),r=vG(),s=bG(),o=_P(),a=kP(),c=SG(),u=_G(),d=TP(),p=kG(),m=Po(),g=jG(),v=IG(),b=OP(),x=yt(),w=Oo(),S=OG(),C=Cn(),k=LG(),N=Ns(),j=di(),A=1,R=2,O=4,L="[object Arguments]",B="[object Array]",M="[object Boolean]",$="[object Date]",U="[object Error]",D="[object Function]",V="[object GeneratorFunction]",z="[object Map]",Q="[object Number]",F="[object Object]",q="[object RegExp]",G="[object Set]",P="[object String]",W="[object Symbol]",oe="[object WeakMap]",K="[object ArrayBuffer]",J="[object DataView]",te="[object Float32Array]",Y="[object Float64Array]",ee="[object Int8Array]",ie="[object Int16Array]",ue="[object Int32Array]",me="[object Uint8Array]",ye="[object Uint8ClampedArray]",pe="[object Uint16Array]",_e="[object Uint32Array]",xe={};xe[L]=xe[B]=xe[K]=xe[J]=xe[M]=xe[$]=xe[te]=xe[Y]=xe[ee]=xe[ie]=xe[ue]=xe[z]=xe[Q]=xe[F]=xe[q]=xe[G]=xe[P]=xe[W]=xe[me]=xe[ye]=xe[pe]=xe[_e]=!0,xe[U]=xe[D]=xe[oe]=!1;function Ce(Ne,tt,Le,vt,xt,it){var We,It=tt&A,Mt=tt&R,Vt=tt&O;if(Le&&(We=xt?Le(Ne,vt,xt,it):Le(Ne)),We!==void 0)return We;if(!C(Ne))return Ne;var Ie=x(Ne);if(Ie){if(We=g(Ne),!It)return a(Ne,We)}else{var be=m(Ne),ot=be==D||be==V;if(w(Ne))return o(Ne,It);if(be==F||be==L||ot&&!xt){if(We=Mt||ot?{}:b(Ne),!It)return Mt?u(Ne,s(We,Ne)):c(Ne,r(We,Ne))}else{if(!xe[be])return xt?Ne:{};We=v(Ne,be,It)}}it||(it=new e);var Ve=it.get(Ne);if(Ve)return Ve;it.set(Ne,We),k(Ne)?Ne.forEach(function(Ot){We.add(Ce(Ot,tt,Le,Ot,Ne,it))}):S(Ne)&&Ne.forEach(function(Ot,Pt){We.set(Pt,Ce(Ot,tt,Le,Pt,Ne,it))});var Ut=Vt?Mt?p:d:Mt?j:N,hn=Ie?void 0:Ut(Ne);return t(hn||Ne,function(Ot,Pt){hn&&(Pt=Ot,Ot=Ne[Pt]),n(We,Pt,Ce(Ot,tt,Le,Pt,Ne,it))}),We}return Kg=Ce,Kg}var Gg,R2;function DG(){if(R2)return Gg;R2=1;var e=PP(),t=4;function n(r){return e(r,t)}return Gg=n,Gg}var Yg,I2;function Ab(){if(I2)return Yg;I2=1;function e(t){return function(){return t}}return Yg=e,Yg}var Xg,M2;function $G(){if(M2)return Xg;M2=1;function e(t){return function(n,r,s){for(var o=-1,a=Object(n),c=s(n),u=c.length;u--;){var d=c[t?u:++o];if(r(a[d],d,a)===!1)break}return n}}return Xg=e,Xg}var Qg,O2;function Rb(){if(O2)return Qg;O2=1;var e=$G(),t=e();return Qg=t,Qg}var Jg,P2;function Ib(){if(P2)return Jg;P2=1;var e=Rb(),t=Ns();function n(r,s){return r&&e(r,s,t)}return Jg=n,Jg}var Zg,L2;function qG(){if(L2)return Zg;L2=1;var e=qr();function t(n,r){return function(s,o){if(s==null)return s;if(!e(s))return n(s,o);for(var a=s.length,c=r?a:-1,u=Object(s);(r?c--:++c<a)&&o(u[c],c,u)!==!1;);return s}}return Zg=t,Zg}var ey,D2;function mf(){if(D2)return ey;D2=1;var e=Ib(),t=qG(),n=t(e);return ey=n,ey}var ty,$2;function fi(){if($2)return ty;$2=1;function e(t){return t}return ty=e,ty}var ny,q2;function LP(){if(q2)return ny;q2=1;var e=fi();function t(n){return typeof n=="function"?n:e}return ny=t,ny}var ry,F2;function DP(){if(F2)return ry;F2=1;var e=_b(),t=mf(),n=LP(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a))}return ry=s,ry}var sy,B2;function $P(){return B2||(B2=1,sy=DP()),sy}var iy,z2;function FG(){if(z2)return iy;z2=1;var e=mf();function t(n,r){var s=[];return e(n,function(o,a,c){r(o,a,c)&&s.push(o)}),s}return iy=t,iy}var oy,V2;function BG(){if(V2)return oy;V2=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return oy=t,oy}var ay,U2;function zG(){if(U2)return ay;U2=1;function e(t){return this.__data__.has(t)}return ay=e,ay}var ly,H2;function qP(){if(H2)return ly;H2=1;var e=Sb(),t=BG(),n=zG();function r(s){var o=-1,a=s==null?0:s.length;for(this.__data__=new e;++o<a;)this.add(s[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,ly=r,ly}var cy,W2;function VG(){if(W2)return cy;W2=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return cy=e,cy}var uy,K2;function FP(){if(K2)return uy;K2=1;function e(t,n){return t.has(n)}return uy=e,uy}var dy,G2;function BP(){if(G2)return dy;G2=1;var e=qP(),t=VG(),n=FP(),r=1,s=2;function o(a,c,u,d,p,m){var g=u&r,v=a.length,b=c.length;if(v!=b&&!(g&&b>v))return!1;var x=m.get(a),w=m.get(c);if(x&&w)return x==c&&w==a;var S=-1,C=!0,k=u&s?new e:void 0;for(m.set(a,c),m.set(c,a);++S<v;){var N=a[S],j=c[S];if(d)var A=g?d(j,N,S,c,a,m):d(N,j,S,a,c,m);if(A!==void 0){if(A)continue;C=!1;break}if(k){if(!t(c,function(R,O){if(!n(k,O)&&(N===R||p(N,R,u,d,m)))return k.push(O)})){C=!1;break}}else if(!(N===j||p(N,j,u,d,m))){C=!1;break}}return m.delete(a),m.delete(c),C}return dy=o,dy}var fy,Y2;function UG(){if(Y2)return fy;Y2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,o){r[++n]=[o,s]}),r}return fy=e,fy}var hy,X2;function Mb(){if(X2)return hy;X2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return hy=e,hy}var py,Q2;function HG(){if(Q2)return py;Q2=1;var e=Mo(),t=RP(),n=Io(),r=BP(),s=UG(),o=Mb(),a=1,c=2,u="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Map]",g="[object Number]",v="[object RegExp]",b="[object Set]",x="[object String]",w="[object Symbol]",S="[object ArrayBuffer]",C="[object DataView]",k=e?e.prototype:void 0,N=k?k.valueOf:void 0;function j(A,R,O,L,B,M,$){switch(O){case C:if(A.byteLength!=R.byteLength||A.byteOffset!=R.byteOffset)return!1;A=A.buffer,R=R.buffer;case S:return!(A.byteLength!=R.byteLength||!M(new t(A),new t(R)));case u:case d:case g:return n(+A,+R);case p:return A.name==R.name&&A.message==R.message;case v:case x:return A==R+"";case m:var U=s;case b:var D=L&a;if(U||(U=o),A.size!=R.size&&!D)return!1;var V=$.get(A);if(V)return V==R;L|=c,$.set(A,R);var z=r(U(A),U(R),L,B,M,$);return $.delete(A),z;case w:if(N)return N.call(A)==N.call(R)}return!1}return py=j,py}var my,J2;function WG(){if(J2)return my;J2=1;var e=TP(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c,u,d,p){var m=c&t,g=e(o),v=g.length,b=e(a),x=b.length;if(v!=x&&!m)return!1;for(var w=v;w--;){var S=g[w];if(!(m?S in a:r.call(a,S)))return!1}var C=p.get(o),k=p.get(a);if(C&&k)return C==a&&k==o;var N=!0;p.set(o,a),p.set(a,o);for(var j=m;++w<v;){S=g[w];var A=o[S],R=a[S];if(u)var O=m?u(R,A,S,a,o,p):u(A,R,S,o,a,p);if(!(O===void 0?A===R||d(A,R,c,u,p):O)){N=!1;break}j||(j=S=="constructor")}if(N&&!j){var L=o.constructor,B=a.constructor;L!=B&&"constructor"in o&&"constructor"in a&&!(typeof L=="function"&&L instanceof L&&typeof B=="function"&&B instanceof B)&&(N=!1)}return p.delete(o),p.delete(a),N}return my=s,my}var gy,Z2;function KG(){if(Z2)return gy;Z2=1;var e=lf(),t=BP(),n=HG(),r=WG(),s=Po(),o=yt(),a=Oo(),c=zl(),u=1,d="[object Arguments]",p="[object Array]",m="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function b(x,w,S,C,k,N){var j=o(x),A=o(w),R=j?p:s(x),O=A?p:s(w);R=R==d?m:R,O=O==d?m:O;var L=R==m,B=O==m,M=R==O;if(M&&a(x)){if(!a(w))return!1;j=!0,L=!1}if(M&&!L)return N||(N=new e),j||c(x)?t(x,w,S,C,k,N):n(x,w,R,S,C,k,N);if(!(S&u)){var $=L&&v.call(x,"__wrapped__"),U=B&&v.call(w,"__wrapped__");if($||U){var D=$?x.value():x,V=U?w.value():w;return N||(N=new e),k(D,V,S,C,N)}}return M?(N||(N=new e),r(x,w,S,C,k,N)):!1}return gy=b,gy}var yy,eE;function zP(){if(eE)return yy;eE=1;var e=KG(),t=gr();function n(r,s,o,a,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,o,a,n,c)}return yy=n,yy}var vy,tE;function GG(){if(tE)return vy;tE=1;var e=lf(),t=zP(),n=1,r=2;function s(o,a,c,u){var d=c.length,p=d,m=!u;if(o==null)return!p;for(o=Object(o);d--;){var g=c[d];if(m&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++d<p;){g=c[d];var v=g[0],b=o[v],x=g[1];if(m&&g[2]){if(b===void 0&&!(v in o))return!1}else{var w=new e;if(u)var S=u(b,x,v,o,a,w);if(!(S===void 0?t(x,b,n|r,u,w):S))return!1}}return!0}return vy=s,vy}var xy,nE;function VP(){if(nE)return xy;nE=1;var e=Cn();function t(n){return n===n&&!e(n)}return xy=t,xy}var wy,rE;function YG(){if(rE)return wy;rE=1;var e=VP(),t=Ns();function n(r){for(var s=t(r),o=s.length;o--;){var a=s[o],c=r[a];s[o]=[a,c,e(c)]}return s}return wy=n,wy}var by,sE;function UP(){if(sE)return by;sE=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return by=e,by}var Sy,iE;function XG(){if(iE)return Sy;iE=1;var e=GG(),t=YG(),n=UP();function r(s){var o=t(s);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(a){return a===s||e(a,s,o)}}return Sy=r,Sy}var _y,oE;function Lo(){if(oE)return _y;oE=1;var e=ci(),t=gr(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return _y=r,_y}var ky,aE;function Ob(){if(aE)return ky;aE=1;var e=yt(),t=Lo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(o,a){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||a!=null&&o in Object(a)}return ky=s,ky}var Ny,lE;function QG(){if(lE)return Ny;lE=1;var e=Sb(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var o=function(){var a=arguments,c=s?s.apply(this,a):a[0],u=o.cache;if(u.has(c))return u.get(c);var d=r.apply(this,a);return o.cache=u.set(c,d)||u,d};return o.cache=new(n.Cache||e),o}return n.Cache=e,Ny=n,Ny}var Cy,cE;function JG(){if(cE)return Cy;cE=1;var e=QG(),t=500;function n(r){var s=e(r,function(a){return o.size===t&&o.clear(),a}),o=s.cache;return s}return Cy=n,Cy}var Ey,uE;function ZG(){if(uE)return Ey;uE=1;var e=JG(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(t,function(a,c,u,d){o.push(u?d.replace(n,"$1"):c||a)}),o});return Ey=r,Ey}var jy,dE;function gf(){if(dE)return jy;dE=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=Array(s);++r<s;)o[r]=n(t[r],r,t);return o}return jy=e,jy}var Ty,fE;function eY(){if(fE)return Ty;fE=1;var e=Mo(),t=gf(),n=yt(),r=Lo(),s=e?e.prototype:void 0,o=s?s.toString:void 0;function a(c){if(typeof c=="string")return c;if(n(c))return t(c,a)+"";if(r(c))return o?o.call(c):"";var u=c+"";return u=="0"&&1/c==-1/0?"-0":u}return Ty=a,Ty}var Ay,hE;function HP(){if(hE)return Ay;hE=1;var e=eY();function t(n){return n==null?"":e(n)}return Ay=t,Ay}var Ry,pE;function yf(){if(pE)return Ry;pE=1;var e=yt(),t=Ob(),n=ZG(),r=HP();function s(o,a){return e(o)?o:t(o,a)?[o]:n(r(o))}return Ry=s,Ry}var Iy,mE;function Vl(){if(mE)return Iy;mE=1;var e=Lo();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Iy=t,Iy}var My,gE;function vf(){if(gE)return My;gE=1;var e=yf(),t=Vl();function n(r,s){s=e(s,r);for(var o=0,a=s.length;r!=null&&o<a;)r=r[t(s[o++])];return o&&o==a?r:void 0}return My=n,My}var Oy,yE;function tY(){if(yE)return Oy;yE=1;var e=vf();function t(n,r,s){var o=n==null?void 0:e(n,r);return o===void 0?s:o}return Oy=t,Oy}var Py,vE;function nY(){if(vE)return Py;vE=1;function e(t,n){return t!=null&&n in Object(t)}return Py=e,Py}var Ly,xE;function WP(){if(xE)return Ly;xE=1;var e=yf(),t=Bl(),n=yt(),r=df(),s=kb(),o=Vl();function a(c,u,d){u=e(u,c);for(var p=-1,m=u.length,g=!1;++p<m;){var v=o(u[p]);if(!(g=c!=null&&d(c,v)))break;c=c[v]}return g||++p!=m?g:(m=c==null?0:c.length,!!m&&s(m)&&r(v,m)&&(n(c)||t(c)))}return Ly=a,Ly}var Dy,wE;function KP(){if(wE)return Dy;wE=1;var e=nY(),t=WP();function n(r,s){return r!=null&&t(r,s,e)}return Dy=n,Dy}var $y,bE;function rY(){if(bE)return $y;bE=1;var e=zP(),t=tY(),n=KP(),r=Ob(),s=VP(),o=UP(),a=Vl(),c=1,u=2;function d(p,m){return r(p)&&s(m)?o(a(p),m):function(g){var v=t(g,p);return v===void 0&&v===m?n(g,p):e(m,v,c|u)}}return $y=d,$y}var qy,SE;function GP(){if(SE)return qy;SE=1;function e(t){return function(n){return n==null?void 0:n[t]}}return qy=e,qy}var Fy,_E;function sY(){if(_E)return Fy;_E=1;var e=vf();function t(n){return function(r){return e(r,n)}}return Fy=t,Fy}var By,kE;function iY(){if(kE)return By;kE=1;var e=GP(),t=sY(),n=Ob(),r=Vl();function s(o){return n(o)?e(r(o)):t(o)}return By=s,By}var zy,NE;function Fr(){if(NE)return zy;NE=1;var e=XG(),t=rY(),n=fi(),r=yt(),s=iY();function o(a){return typeof a=="function"?a:a==null?n:typeof a=="object"?r(a)?t(a[0],a[1]):e(a):s(a)}return zy=o,zy}var Vy,CE;function YP(){if(CE)return Vy;CE=1;var e=NP(),t=FG(),n=Fr(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a,3))}return Vy=s,Vy}var Uy,EE;function oY(){if(EE)return Uy;EE=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,s){return r!=null&&t.call(r,s)}return Uy=n,Uy}var Hy,jE;function XP(){if(jE)return Hy;jE=1;var e=oY(),t=WP();function n(r,s){return r!=null&&t(r,s,e)}return Hy=n,Hy}var Wy,TE;function aY(){if(TE)return Wy;TE=1;var e=Cb(),t=Po(),n=Bl(),r=yt(),s=qr(),o=Oo(),a=hf(),c=zl(),u="[object Map]",d="[object Set]",p=Object.prototype,m=p.hasOwnProperty;function g(v){if(v==null)return!0;if(s(v)&&(r(v)||typeof v=="string"||typeof v.splice=="function"||o(v)||c(v)||n(v)))return!v.length;var b=t(v);if(b==u||b==d)return!v.size;if(a(v))return!e(v).length;for(var x in v)if(m.call(v,x))return!1;return!0}return Wy=g,Wy}var Ky,AE;function QP(){if(AE)return Ky;AE=1;function e(t){return t===void 0}return Ky=e,Ky}var Gy,RE;function JP(){if(RE)return Gy;RE=1;var e=mf(),t=qr();function n(r,s){var o=-1,a=t(r)?Array(r.length):[];return e(r,function(c,u,d){a[++o]=s(c,u,d)}),a}return Gy=n,Gy}var Yy,IE;function ZP(){if(IE)return Yy;IE=1;var e=gf(),t=Fr(),n=JP(),r=yt();function s(o,a){var c=r(o)?e:n;return c(o,t(a,3))}return Yy=s,Yy}var Xy,ME;function lY(){if(ME)return Xy;ME=1;function e(t,n,r,s){var o=-1,a=t==null?0:t.length;for(s&&a&&(r=t[++o]);++o<a;)r=n(r,t[o],o,t);return r}return Xy=e,Xy}var Qy,OE;function cY(){if(OE)return Qy;OE=1;function e(t,n,r,s,o){return o(t,function(a,c,u){r=s?(s=!1,a):n(r,a,c,u)}),r}return Qy=e,Qy}var Jy,PE;function e4(){if(PE)return Jy;PE=1;var e=lY(),t=mf(),n=Fr(),r=cY(),s=yt();function o(a,c,u){var d=s(a)?e:r,p=arguments.length<3;return d(a,n(c,4),u,p,t)}return Jy=o,Jy}var Zy,LE;function uY(){if(LE)return Zy;LE=1;var e=ci(),t=yt(),n=gr(),r="[object String]";function s(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Zy=s,Zy}var ev,DE;function dY(){if(DE)return ev;DE=1;var e=GP(),t=e("length");return ev=t,ev}var tv,$E;function fY(){if($E)return tv;$E=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="\\u200d",c=RegExp("["+a+e+s+o+"]");function u(d){return c.test(d)}return tv=u,tv}var nv,qE;function hY(){if(qE)return nv;qE=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="["+e+"]",c="["+s+"]",u="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+u+")",p="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=d+"?",x="["+o+"]?",w="(?:"+v+"(?:"+[p,m,g].join("|")+")"+x+b+")*",S=x+b+w,C="(?:"+[p+c+"?",c,m,g,a].join("|")+")",k=RegExp(u+"(?="+u+")|"+C+S,"g");function N(j){for(var A=k.lastIndex=0;k.test(j);)++A;return A}return nv=N,nv}var rv,FE;function pY(){if(FE)return rv;FE=1;var e=dY(),t=fY(),n=hY();function r(s){return t(s)?n(s):e(s)}return rv=r,rv}var sv,BE;function mY(){if(BE)return sv;BE=1;var e=Cb(),t=Po(),n=qr(),r=uY(),s=pY(),o="[object Map]",a="[object Set]";function c(u){if(u==null)return 0;if(n(u))return r(u)?s(u):u.length;var d=t(u);return d==o||d==a?u.size:e(u).length}return sv=c,sv}var iv,zE;function gY(){if(zE)return iv;zE=1;var e=_b(),t=MP(),n=Ib(),r=Fr(),s=pf(),o=yt(),a=Oo(),c=ql(),u=Cn(),d=zl();function p(m,g,v){var b=o(m),x=b||a(m)||d(m);if(g=r(g,4),v==null){var w=m&&m.constructor;x?v=b?new w:[]:u(m)?v=c(w)?t(s(m)):{}:v={}}return(x?e:n)(m,function(S,C,k){return g(v,S,C,k)}),v}return iv=p,iv}var ov,VE;function yY(){if(VE)return ov;VE=1;var e=Mo(),t=Bl(),n=yt(),r=e?e.isConcatSpreadable:void 0;function s(o){return n(o)||t(o)||!!(r&&o&&o[r])}return ov=s,ov}var av,UE;function Pb(){if(UE)return av;UE=1;var e=jb(),t=yY();function n(r,s,o,a,c){var u=-1,d=r.length;for(o||(o=t),c||(c=[]);++u<d;){var p=r[u];s>0&&o(p)?s>1?n(p,s-1,o,a,c):e(c,p):a||(c[c.length]=p)}return c}return av=n,av}var lv,HE;function vY(){if(HE)return lv;HE=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return lv=e,lv}var cv,WE;function t4(){if(WE)return cv;WE=1;var e=vY(),t=Math.max;function n(r,s,o){return s=t(s===void 0?r.length-1:s,0),function(){for(var a=arguments,c=-1,u=t(a.length-s,0),d=Array(u);++c<u;)d[c]=a[s+c];c=-1;for(var p=Array(s+1);++c<s;)p[c]=a[c];return p[s]=o(d),e(r,this,p)}}return cv=n,cv}var uv,KE;function xY(){if(KE)return uv;KE=1;var e=Ab(),t=wP(),n=fi(),r=t?function(s,o){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return uv=r,uv}var dv,GE;function wY(){if(GE)return dv;GE=1;var e=800,t=16,n=Date.now;function r(s){var o=0,a=0;return function(){var c=n(),u=t-(c-a);if(a=c,u>0){if(++o>=e)return arguments[0]}else o=0;return s.apply(void 0,arguments)}}return dv=r,dv}var fv,YE;function n4(){if(YE)return fv;YE=1;var e=xY(),t=wY(),n=t(e);return fv=n,fv}var hv,XE;function xf(){if(XE)return hv;XE=1;var e=fi(),t=t4(),n=n4();function r(s,o){return n(t(s,o,e),s+"")}return hv=r,hv}var pv,QE;function r4(){if(QE)return pv;QE=1;function e(t,n,r,s){for(var o=t.length,a=r+(s?1:-1);s?a--:++a<o;)if(n(t[a],a,t))return a;return-1}return pv=e,pv}var mv,JE;function bY(){if(JE)return mv;JE=1;function e(t){return t!==t}return mv=e,mv}var gv,ZE;function SY(){if(ZE)return gv;ZE=1;function e(t,n,r){for(var s=r-1,o=t.length;++s<o;)if(t[s]===n)return s;return-1}return gv=e,gv}var yv,ej;function _Y(){if(ej)return yv;ej=1;var e=r4(),t=bY(),n=SY();function r(s,o,a){return o===o?n(s,o,a):e(s,t,a)}return yv=r,yv}var vv,tj;function kY(){if(tj)return vv;tj=1;var e=_Y();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return vv=t,vv}var xv,nj;function NY(){if(nj)return xv;nj=1;function e(t,n,r){for(var s=-1,o=t==null?0:t.length;++s<o;)if(r(n,t[s]))return!0;return!1}return xv=e,xv}var wv,rj;function CY(){if(rj)return wv;rj=1;function e(){}return wv=e,wv}var bv,sj;function EY(){if(sj)return bv;sj=1;var e=AP(),t=CY(),n=Mb(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return bv=s,bv}var Sv,ij;function jY(){if(ij)return Sv;ij=1;var e=qP(),t=kY(),n=NY(),r=FP(),s=EY(),o=Mb(),a=200;function c(u,d,p){var m=-1,g=t,v=u.length,b=!0,x=[],w=x;if(p)b=!1,g=n;else if(v>=a){var S=d?null:s(u);if(S)return o(S);b=!1,g=r,w=new e}else w=d?[]:x;e:for(;++m<v;){var C=u[m],k=d?d(C):C;if(C=p||C!==0?C:0,b&&k===k){for(var N=w.length;N--;)if(w[N]===k)continue e;d&&w.push(k),x.push(C)}else g(w,k,p)||(w!==x&&w.push(k),x.push(C))}return x}return Sv=c,Sv}var _v,oj;function s4(){if(oj)return _v;oj=1;var e=qr(),t=gr();function n(r){return t(r)&&e(r)}return _v=n,_v}var kv,aj;function TY(){if(aj)return kv;aj=1;var e=Pb(),t=xf(),n=jY(),r=s4(),s=t(function(o){return n(e(o,1,r,!0))});return kv=s,kv}var Nv,lj;function AY(){if(lj)return Nv;lj=1;var e=gf();function t(n,r){return e(r,function(s){return n[s]})}return Nv=t,Nv}var Cv,cj;function i4(){if(cj)return Cv;cj=1;var e=AY(),t=Ns();function n(r){return r==null?[]:e(r,t(r))}return Cv=n,Cv}var Ev,uj;function En(){if(uj)return Ev;uj=1;var e;if(typeof wb=="function")try{e={clone:DG(),constant:Ab(),each:$P(),filter:YP(),has:XP(),isArray:yt(),isEmpty:aY(),isFunction:ql(),isUndefined:QP(),keys:Ns(),map:ZP(),reduce:e4(),size:mY(),transform:gY(),union:TY(),values:i4()}}catch{}return e||(e=window._),Ev=e,Ev}var jv,dj;function Lb(){if(dj)return jv;dj=1;var e=En();jv=s;var t="\0",n="\0",r="";function s(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(p){return this._label=p,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return e.keys(this._nodes)},s.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._in[m])})},s.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._out[m])})},s.prototype.setNodes=function(p,m){var g=arguments,v=this;return e.each(p,function(b){g.length>1?v.setNode(b,m):v.setNode(b)}),this},s.prototype.setNode=function(p,m){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=m),this):(this._nodes[p]=arguments.length>1?m:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=n,this._children[p]={},this._children[n][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},s.prototype.node=function(p){return this._nodes[p]},s.prototype.hasNode=function(p){return e.has(this._nodes,p)},s.prototype.removeNode=function(p){var m=this;if(e.has(this._nodes,p)){var g=function(v){m.removeEdge(m._edgeObjs[v])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(v){m.setParent(v)}),delete this._children[p]),e.each(e.keys(this._in[p]),g),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),g),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},s.prototype.setParent=function(p,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(m))m=n;else{m+="";for(var g=m;!e.isUndefined(g);g=this.parent(g))if(g===p)throw new Error("Setting "+m+" as parent of "+p+" would create a cycle");this.setNode(m)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=m,this._children[m][p]=!0,this},s.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},s.prototype.parent=function(p){if(this._isCompound){var m=this._parent[p];if(m!==n)return m}},s.prototype.children=function(p){if(e.isUndefined(p)&&(p=n),this._isCompound){var m=this._children[p];if(m)return e.keys(m)}else{if(p===n)return this.nodes();if(this.hasNode(p))return[]}},s.prototype.predecessors=function(p){var m=this._preds[p];if(m)return e.keys(m)},s.prototype.successors=function(p){var m=this._sucs[p];if(m)return e.keys(m)},s.prototype.neighbors=function(p){var m=this.predecessors(p);if(m)return e.union(m,this.successors(p))},s.prototype.isLeaf=function(p){var m;return this.isDirected()?m=this.successors(p):m=this.neighbors(p),m.length===0},s.prototype.filterNodes=function(p){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var g=this;e.each(this._nodes,function(x,w){p(w)&&m.setNode(w,x)}),e.each(this._edgeObjs,function(x){m.hasNode(x.v)&&m.hasNode(x.w)&&m.setEdge(x,g.edge(x))});var v={};function b(x){var w=g.parent(x);return w===void 0||m.hasNode(w)?(v[x]=w,w):w in v?v[w]:b(w)}return this._isCompound&&e.each(m.nodes(),function(x){m.setParent(x,b(x))}),m},s.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return e.values(this._edgeObjs)},s.prototype.setPath=function(p,m){var g=this,v=arguments;return e.reduce(p,function(b,x){return v.length>1?g.setEdge(b,x,m):g.setEdge(b,x),x}),this},s.prototype.setEdge=function(){var p,m,g,v,b=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(p=x.v,m=x.w,g=x.name,arguments.length===2&&(v=arguments[1],b=!0)):(p=x,m=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],b=!0)),p=""+p,m=""+m,e.isUndefined(g)||(g=""+g);var w=c(this._isDirected,p,m,g);if(e.has(this._edgeLabels,w))return b&&(this._edgeLabels[w]=v),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(m),this._edgeLabels[w]=b?v:this._defaultEdgeLabelFn(p,m,g);var S=u(this._isDirected,p,m,g);return p=S.v,m=S.w,Object.freeze(S),this._edgeObjs[w]=S,o(this._preds[m],p),o(this._sucs[p],m),this._in[m][w]=S,this._out[p][w]=S,this._edgeCount++,this},s.prototype.edge=function(p,m,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,p,m,g);return this._edgeLabels[v]},s.prototype.hasEdge=function(p,m,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,p,m,g);return e.has(this._edgeLabels,v)},s.prototype.removeEdge=function(p,m,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,p,m,g),b=this._edgeObjs[v];return b&&(p=b.v,m=b.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[m],p),a(this._sucs[p],m),delete this._in[m][v],delete this._out[p][v],this._edgeCount--),this},s.prototype.inEdges=function(p,m){var g=this._in[p];if(g){var v=e.values(g);return m?e.filter(v,function(b){return b.v===m}):v}},s.prototype.outEdges=function(p,m){var g=this._out[p];if(g){var v=e.values(g);return m?e.filter(v,function(b){return b.w===m}):v}},s.prototype.nodeEdges=function(p,m){var g=this.inEdges(p,m);if(g)return g.concat(this.outEdges(p,m))};function o(p,m){p[m]?p[m]++:p[m]=1}function a(p,m){--p[m]||delete p[m]}function c(p,m,g,v){var b=""+m,x=""+g;if(!p&&b>x){var w=b;b=x,x=w}return b+r+x+r+(e.isUndefined(v)?t:v)}function u(p,m,g,v){var b=""+m,x=""+g;if(!p&&b>x){var w=b;b=x,x=w}var S={v:b,w:x};return v&&(S.name=v),S}function d(p,m){return c(p,m.v,m.w,m.name)}return jv}var Tv,fj;function RY(){return fj||(fj=1,Tv="2.1.8"),Tv}var Av,hj;function IY(){return hj||(hj=1,Av={Graph:Lb(),version:RY()}),Av}var Rv,pj;function MY(){if(pj)return Rv;pj=1;var e=En(),t=Lb();Rv={write:n,read:o};function n(a){var c={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return e.isUndefined(a.graph())||(c.value=e.clone(a.graph())),c}function r(a){return e.map(a.nodes(),function(c){var u=a.node(c),d=a.parent(c),p={v:c};return e.isUndefined(u)||(p.value=u),e.isUndefined(d)||(p.parent=d),p})}function s(a){return e.map(a.edges(),function(c){var u=a.edge(c),d={v:c.v,w:c.w};return e.isUndefined(c.name)||(d.name=c.name),e.isUndefined(u)||(d.value=u),d})}function o(a){var c=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(u){c.setNode(u.v,u.value),u.parent&&c.setParent(u.v,u.parent)}),e.each(a.edges,function(u){c.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),c}return Rv}var Iv,mj;function OY(){if(mj)return Iv;mj=1;var e=En();Iv=t;function t(n){var r={},s=[],o;function a(c){e.has(r,c)||(r[c]=!0,o.push(c),e.each(n.successors(c),a),e.each(n.predecessors(c),a))}return e.each(n.nodes(),function(c){o=[],a(c),o.length&&s.push(o)}),s}return Iv}var Mv,gj;function o4(){if(gj)return Mv;gj=1;var e=En();Mv=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(n){return n.key})},t.prototype.has=function(n){return e.has(this._keyIndices,n)},t.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!e.has(s,n)){var o=this._arr,a=o.length;return s[n]=a,o.push({key:n,priority:r}),this._decrease(a),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},t.prototype._heapify=function(n){var r=this._arr,s=2*n,o=s+1,a=n;s<r.length&&(a=r[s].priority<r[a].priority?s:a,o<r.length&&(a=r[o].priority<r[a].priority?o:a),a!==n&&(this._swap(n,a),this._heapify(a)))},t.prototype._decrease=function(n){for(var r=this._arr,s=r[n].priority,o;n!==0&&(o=n>>1,!(r[o].priority<s));)this._swap(n,o),n=o},t.prototype._swap=function(n,r){var s=this._arr,o=this._keyIndices,a=s[n],c=s[r];s[n]=c,s[r]=a,o[c.key]=n,o[a.key]=r},Mv}var Ov,yj;function a4(){if(yj)return Ov;yj=1;var e=En(),t=o4();Ov=r;var n=e.constant(1);function r(o,a,c,u){return s(o,String(a),c||n,u||function(d){return o.outEdges(d)})}function s(o,a,c,u){var d={},p=new t,m,g,v=function(b){var x=b.v!==m?b.v:b.w,w=d[x],S=c(b),C=g.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+S);C<w.distance&&(w.distance=C,w.predecessor=m,p.decrease(x,C))};for(o.nodes().forEach(function(b){var x=b===a?0:Number.POSITIVE_INFINITY;d[b]={distance:x},p.add(b,x)});p.size()>0&&(m=p.removeMin(),g=d[m],g.distance!==Number.POSITIVE_INFINITY);)u(m).forEach(v);return d}return Ov}var Pv,vj;function PY(){if(vj)return Pv;vj=1;var e=a4(),t=En();Pv=n;function n(r,s,o){return t.transform(r.nodes(),function(a,c){a[c]=e(r,c,s,o)},{})}return Pv}var Lv,xj;function l4(){if(xj)return Lv;xj=1;var e=En();Lv=t;function t(n){var r=0,s=[],o={},a=[];function c(u){var d=o[u]={onStack:!0,lowlink:r,index:r++};if(s.push(u),n.successors(u).forEach(function(g){e.has(o,g)?o[g].onStack&&(d.lowlink=Math.min(d.lowlink,o[g].index)):(c(g),d.lowlink=Math.min(d.lowlink,o[g].lowlink))}),d.lowlink===d.index){var p=[],m;do m=s.pop(),o[m].onStack=!1,p.push(m);while(u!==m);a.push(p)}}return n.nodes().forEach(function(u){e.has(o,u)||c(u)}),a}return Lv}var Dv,wj;function LY(){if(wj)return Dv;wj=1;var e=En(),t=l4();Dv=n;function n(r){return e.filter(t(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return Dv}var $v,bj;function DY(){if(bj)return $v;bj=1;var e=En();$v=n;var t=e.constant(1);function n(s,o,a){return r(s,o||t,a||function(c){return s.outEdges(c)})}function r(s,o,a){var c={},u=s.nodes();return u.forEach(function(d){c[d]={},c[d][d]={distance:0},u.forEach(function(p){d!==p&&(c[d][p]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(p){var m=p.v===d?p.w:p.v,g=o(p);c[d][m]={distance:g,predecessor:d}})}),u.forEach(function(d){var p=c[d];u.forEach(function(m){var g=c[m];u.forEach(function(v){var b=g[d],x=p[v],w=g[v],S=b.distance+x.distance;S<w.distance&&(w.distance=S,w.predecessor=x.predecessor)})})}),c}return $v}var qv,Sj;function c4(){if(Sj)return qv;Sj=1;var e=En();qv=t,t.CycleException=n;function t(r){var s={},o={},a=[];function c(u){if(e.has(o,u))throw new n;e.has(s,u)||(o[u]=!0,s[u]=!0,e.each(r.predecessors(u),c),delete o[u],a.push(u))}if(e.each(r.sinks(),c),e.size(s)!==r.nodeCount())throw new n;return a}function n(){}return n.prototype=new Error,qv}var Fv,_j;function $Y(){if(_j)return Fv;_j=1;var e=c4();Fv=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Fv}var Bv,kj;function u4(){if(kj)return Bv;kj=1;var e=En();Bv=t;function t(r,s,o){e.isArray(s)||(s=[s]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),c=[],u={};return e.each(s,function(d){if(!r.hasNode(d))throw new Error("Graph does not have node: "+d);n(r,d,o==="post",u,a,c)}),c}function n(r,s,o,a,c,u){e.has(a,s)||(a[s]=!0,o||u.push(s),e.each(c(s),function(d){n(r,d,o,a,c,u)}),o&&u.push(s))}return Bv}var zv,Nj;function qY(){if(Nj)return zv;Nj=1;var e=u4();zv=t;function t(n,r){return e(n,r,"post")}return zv}var Vv,Cj;function FY(){if(Cj)return Vv;Cj=1;var e=u4();Vv=t;function t(n,r){return e(n,r,"pre")}return Vv}var Uv,Ej;function BY(){if(Ej)return Uv;Ej=1;var e=En(),t=Lb(),n=o4();Uv=r;function r(s,o){var a=new t,c={},u=new n,d;function p(g){var v=g.v===d?g.w:g.v,b=u.priority(v);if(b!==void 0){var x=o(g);x<b&&(c[v]=d,u.decrease(v,x))}}if(s.nodeCount()===0)return a;e.each(s.nodes(),function(g){u.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),u.decrease(s.nodes()[0],0);for(var m=!1;u.size()>0;){if(d=u.removeMin(),e.has(c,d))a.setEdge(d,c[d]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(d).forEach(p)}return a}return Uv}var Hv,jj;function zY(){return jj||(jj=1,Hv={components:OY(),dijkstra:a4(),dijkstraAll:PY(),findCycles:LY(),floydWarshall:DY(),isAcyclic:$Y(),postorder:qY(),preorder:FY(),prim:BY(),tarjan:l4(),topsort:c4()}),Hv}var Wv,Tj;function VY(){if(Tj)return Wv;Tj=1;var e=IY();return Wv={Graph:e.Graph,json:MY(),alg:zY(),version:e.version},Wv}var Kv,Aj;function Vn(){if(Aj)return Kv;Aj=1;var e;if(typeof wb=="function")try{e=VY()}catch{}return e||(e=window.graphlib),Kv=e,Kv}var Gv,Rj;function UY(){if(Rj)return Gv;Rj=1;var e=PP(),t=1,n=4;function r(s){return e(s,t|n)}return Gv=r,Gv}var Yv,Ij;function wf(){if(Ij)return Yv;Ij=1;var e=Io(),t=qr(),n=df(),r=Cn();function s(o,a,c){if(!r(c))return!1;var u=typeof a;return(u=="number"?t(c)&&n(a,c.length):u=="string"&&a in c)?e(c[a],o):!1}return Yv=s,Yv}var Xv,Mj;function HY(){if(Mj)return Xv;Mj=1;var e=xf(),t=Io(),n=wf(),r=di(),s=Object.prototype,o=s.hasOwnProperty,a=e(function(c,u){c=Object(c);var d=-1,p=u.length,m=p>2?u[2]:void 0;for(m&&n(u[0],u[1],m)&&(p=1);++d<p;)for(var g=u[d],v=r(g),b=-1,x=v.length;++b<x;){var w=v[b],S=c[w];(S===void 0||t(S,s[w])&&!o.call(c,w))&&(c[w]=g[w])}return c});return Xv=a,Xv}var Qv,Oj;function WY(){if(Oj)return Qv;Oj=1;var e=Fr(),t=qr(),n=Ns();function r(s){return function(o,a,c){var u=Object(o);if(!t(o)){var d=e(a,3);o=n(o),a=function(m){return d(u[m],m,u)}}var p=s(o,a,c);return p>-1?u[d?o[p]:p]:void 0}}return Qv=r,Qv}var Jv,Pj;function KY(){if(Pj)return Jv;Pj=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Jv=t,Jv}var Zv,Lj;function GY(){if(Lj)return Zv;Lj=1;var e=KY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Zv=n,Zv}var e0,Dj;function YY(){if(Dj)return e0;Dj=1;var e=GY(),t=Cn(),n=Lo(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;function u(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=t(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=e(d);var m=o.test(d);return m||a.test(d)?c(d.slice(2),m?2:8):s.test(d)?r:+d}return e0=u,e0}var t0,$j;function d4(){if($j)return t0;$j=1;var e=YY(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var o=s<0?-1:1;return o*n}return s===s?s:0}return t0=r,t0}var n0,qj;function XY(){if(qj)return n0;qj=1;var e=d4();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return n0=t,n0}var r0,Fj;function QY(){if(Fj)return r0;Fj=1;var e=r4(),t=Fr(),n=XY(),r=Math.max;function s(o,a,c){var u=o==null?0:o.length;if(!u)return-1;var d=c==null?0:n(c);return d<0&&(d=r(u+d,0)),e(o,t(a,3),d)}return r0=s,r0}var s0,Bj;function JY(){if(Bj)return s0;Bj=1;var e=WY(),t=QY(),n=e(t);return s0=n,s0}var i0,zj;function f4(){if(zj)return i0;zj=1;var e=Pb();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return i0=t,i0}var o0,Vj;function ZY(){if(Vj)return o0;Vj=1;var e=Rb(),t=LP(),n=di();function r(s,o){return s==null?s:e(s,t(o),n)}return o0=r,o0}var a0,Uj;function eX(){if(Uj)return a0;Uj=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return a0=e,a0}var l0,Hj;function tX(){if(Hj)return l0;Hj=1;var e=cf(),t=Ib(),n=Fr();function r(s,o){var a={};return o=n(o,3),t(s,function(c,u,d){e(a,u,o(c,u,d))}),a}return l0=r,l0}var c0,Wj;function Db(){if(Wj)return c0;Wj=1;var e=Lo();function t(n,r,s){for(var o=-1,a=n.length;++o<a;){var c=n[o],u=r(c);if(u!=null&&(d===void 0?u===u&&!e(u):s(u,d)))var d=u,p=c}return p}return c0=t,c0}var u0,Kj;function nX(){if(Kj)return u0;Kj=1;function e(t,n){return t>n}return u0=e,u0}var d0,Gj;function rX(){if(Gj)return d0;Gj=1;var e=Db(),t=nX(),n=fi();function r(s){return s&&s.length?e(s,n,t):void 0}return d0=r,d0}var f0,Yj;function h4(){if(Yj)return f0;Yj=1;var e=cf(),t=Io();function n(r,s,o){(o!==void 0&&!t(r[s],o)||o===void 0&&!(s in r))&&e(r,s,o)}return f0=n,f0}var h0,Xj;function sX(){if(Xj)return h0;Xj=1;var e=ci(),t=pf(),n=gr(),r="[object Object]",s=Function.prototype,o=Object.prototype,a=s.toString,c=o.hasOwnProperty,u=a.call(Object);function d(p){if(!n(p)||e(p)!=r)return!1;var m=t(p);if(m===null)return!0;var g=c.call(m,"constructor")&&m.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==u}return h0=d,h0}var p0,Qj;function p4(){if(Qj)return p0;Qj=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return p0=e,p0}var m0,Jj;function iX(){if(Jj)return m0;Jj=1;var e=Fl(),t=di();function n(r){return e(r,t(r))}return m0=n,m0}var g0,Zj;function oX(){if(Zj)return g0;Zj=1;var e=h4(),t=_P(),n=IP(),r=kP(),s=OP(),o=Bl(),a=yt(),c=s4(),u=Oo(),d=ql(),p=Cn(),m=sX(),g=zl(),v=p4(),b=iX();function x(w,S,C,k,N,j,A){var R=v(w,C),O=v(S,C),L=A.get(O);if(L){e(w,C,L);return}var B=j?j(R,O,C+"",w,S,A):void 0,M=B===void 0;if(M){var $=a(O),U=!$&&u(O),D=!$&&!U&&g(O);B=O,$||U||D?a(R)?B=R:c(R)?B=r(R):U?(M=!1,B=t(O,!0)):D?(M=!1,B=n(O,!0)):B=[]:m(O)||o(O)?(B=R,o(R)?B=b(R):(!p(R)||d(R))&&(B=s(O))):M=!1}M&&(A.set(O,B),N(B,O,k,j,A),A.delete(O)),e(w,C,B)}return g0=x,g0}var y0,eT;function aX(){if(eT)return y0;eT=1;var e=lf(),t=h4(),n=Rb(),r=oX(),s=Cn(),o=di(),a=p4();function c(u,d,p,m,g){u!==d&&n(d,function(v,b){if(g||(g=new e),s(v))r(u,d,b,p,c,m,g);else{var x=m?m(a(u,b),v,b+"",u,d,g):void 0;x===void 0&&(x=v),t(u,b,x)}},o)}return y0=c,y0}var v0,tT;function lX(){if(tT)return v0;tT=1;var e=xf(),t=wf();function n(r){return e(function(s,o){var a=-1,c=o.length,u=c>1?o[c-1]:void 0,d=c>2?o[2]:void 0;for(u=r.length>3&&typeof u=="function"?(c--,u):void 0,d&&t(o[0],o[1],d)&&(u=c<3?void 0:u,c=1),s=Object(s);++a<c;){var p=o[a];p&&r(s,p,a,u)}return s})}return v0=n,v0}var x0,nT;function cX(){if(nT)return x0;nT=1;var e=aX(),t=lX(),n=t(function(r,s,o){e(r,s,o)});return x0=n,x0}var w0,rT;function m4(){if(rT)return w0;rT=1;function e(t,n){return t<n}return w0=e,w0}var b0,sT;function uX(){if(sT)return b0;sT=1;var e=Db(),t=m4(),n=fi();function r(s){return s&&s.length?e(s,n,t):void 0}return b0=r,b0}var S0,iT;function dX(){if(iT)return S0;iT=1;var e=Db(),t=Fr(),n=m4();function r(s,o){return s&&s.length?e(s,t(o,2),n):void 0}return S0=r,S0}var _0,oT;function fX(){if(oT)return _0;oT=1;var e=Gn(),t=function(){return e.Date.now()};return _0=t,_0}var k0,aT;function hX(){if(aT)return k0;aT=1;var e=uf(),t=yf(),n=df(),r=Cn(),s=Vl();function o(a,c,u,d){if(!r(a))return a;c=t(c,a);for(var p=-1,m=c.length,g=m-1,v=a;v!=null&&++p<m;){var b=s(c[p]),x=u;if(b==="__proto__"||b==="constructor"||b==="prototype")return a;if(p!=g){var w=v[b];x=d?d(w,b,v):void 0,x===void 0&&(x=r(w)?w:n(c[p+1])?[]:{})}e(v,b,x),v=v[b]}return a}return k0=o,k0}var N0,lT;function pX(){if(lT)return N0;lT=1;var e=vf(),t=hX(),n=yf();function r(s,o,a){for(var c=-1,u=o.length,d={};++c<u;){var p=o[c],m=e(s,p);a(m,p)&&t(d,n(p,s),m)}return d}return N0=r,N0}var C0,cT;function mX(){if(cT)return C0;cT=1;var e=pX(),t=KP();function n(r,s){return e(r,s,function(o,a){return t(r,a)})}return C0=n,C0}var E0,uT;function gX(){if(uT)return E0;uT=1;var e=f4(),t=t4(),n=n4();function r(s){return n(t(s,void 0,e),s+"")}return E0=r,E0}var j0,dT;function yX(){if(dT)return j0;dT=1;var e=mX(),t=gX(),n=t(function(r,s){return r==null?{}:e(r,s)});return j0=n,j0}var T0,fT;function vX(){if(fT)return T0;fT=1;var e=Math.ceil,t=Math.max;function n(r,s,o,a){for(var c=-1,u=t(e((s-r)/(o||1)),0),d=Array(u);u--;)d[a?u:++c]=r,r+=o;return d}return T0=n,T0}var A0,hT;function xX(){if(hT)return A0;hT=1;var e=vX(),t=wf(),n=d4();function r(s){return function(o,a,c){return c&&typeof c!="number"&&t(o,a,c)&&(a=c=void 0),o=n(o),a===void 0?(a=o,o=0):a=n(a),c=c===void 0?o<a?1:-1:n(c),e(o,a,c,s)}}return A0=r,A0}var R0,pT;function wX(){if(pT)return R0;pT=1;var e=xX(),t=e();return R0=t,R0}var I0,mT;function bX(){if(mT)return I0;mT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return I0=e,I0}var M0,gT;function SX(){if(gT)return M0;gT=1;var e=Lo();function t(n,r){if(n!==r){var s=n!==void 0,o=n===null,a=n===n,c=e(n),u=r!==void 0,d=r===null,p=r===r,m=e(r);if(!d&&!m&&!c&&n>r||c&&u&&p&&!d&&!m||o&&u&&p||!s&&p||!a)return 1;if(!o&&!c&&!m&&n<r||m&&s&&a&&!o&&!c||d&&s&&a||!u&&a||!p)return-1}return 0}return M0=t,M0}var O0,yT;function _X(){if(yT)return O0;yT=1;var e=SX();function t(n,r,s){for(var o=-1,a=n.criteria,c=r.criteria,u=a.length,d=s.length;++o<u;){var p=e(a[o],c[o]);if(p){if(o>=d)return p;var m=s[o];return p*(m=="desc"?-1:1)}}return n.index-r.index}return O0=t,O0}var P0,vT;function kX(){if(vT)return P0;vT=1;var e=gf(),t=vf(),n=Fr(),r=JP(),s=bX(),o=ff(),a=_X(),c=fi(),u=yt();function d(p,m,g){m.length?m=e(m,function(x){return u(x)?function(w){return t(w,x.length===1?x[0]:x)}:x}):m=[c];var v=-1;m=e(m,o(n));var b=r(p,function(x,w,S){var C=e(m,function(k){return k(x)});return{criteria:C,index:++v,value:x}});return s(b,function(x,w){return a(x,w,g)})}return P0=d,P0}var L0,xT;function NX(){if(xT)return L0;xT=1;var e=Pb(),t=kX(),n=xf(),r=wf(),s=n(function(o,a){if(o==null)return[];var c=a.length;return c>1&&r(o,a[0],a[1])?a=[]:c>2&&r(a[0],a[1],a[2])&&(a=[a[0]]),t(o,e(a,1),[])});return L0=s,L0}var D0,wT;function CX(){if(wT)return D0;wT=1;var e=HP(),t=0;function n(r){var s=++t;return e(r)+s}return D0=n,D0}var $0,bT;function EX(){if(bT)return $0;bT=1;function e(t,n,r){for(var s=-1,o=t.length,a=n.length,c={};++s<o;){var u=s<a?n[s]:void 0;r(c,t[s],u)}return c}return $0=e,$0}var q0,ST;function jX(){if(ST)return q0;ST=1;var e=uf(),t=EX();function n(r,s){return t(r||[],s||[],e)}return q0=n,q0}var F0,_T;function et(){if(_T)return F0;_T=1;var e;if(typeof wb=="function")try{e={cloneDeep:UY(),constant:Ab(),defaults:HY(),each:$P(),filter:YP(),find:JY(),flatten:f4(),forEach:DP(),forIn:ZY(),has:XP(),isUndefined:QP(),last:eX(),map:ZP(),mapValues:tX(),max:rX(),merge:cX(),min:uX(),minBy:dX(),now:fX(),pick:yX(),range:wX(),reduce:e4(),sortBy:NX(),uniqueId:CX(),values:i4(),zipObject:jX()}}catch{}return e||(e=window._),F0=e,F0}var B0,kT;function TX(){if(kT)return B0;kT=1,B0=e;function e(){var r={};r._next=r._prev=r,this._sentinel=r}e.prototype.dequeue=function(){var r=this._sentinel,s=r._prev;if(s!==r)return t(s),s},e.prototype.enqueue=function(r){var s=this._sentinel;r._prev&&r._next&&t(r),r._next=s._next,s._next._prev=r,s._next=r,r._prev=s},e.prototype.toString=function(){for(var r=[],s=this._sentinel,o=s._prev;o!==s;)r.push(JSON.stringify(o,n)),o=o._prev;return"["+r.join(", ")+"]"};function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,s){if(r!=="_next"&&r!=="_prev")return s}return B0}var z0,NT;function AX(){if(NT)return z0;NT=1;var e=et(),t=Vn().Graph,n=TX();z0=s;var r=e.constant(1);function s(d,p){if(d.nodeCount()<=1)return[];var m=c(d,p||r),g=o(m.graph,m.buckets,m.zeroIdx);return e.flatten(e.map(g,function(v){return d.outEdges(v.v,v.w)}),!0)}function o(d,p,m){for(var g=[],v=p[p.length-1],b=p[0],x;d.nodeCount();){for(;x=b.dequeue();)a(d,p,m,x);for(;x=v.dequeue();)a(d,p,m,x);if(d.nodeCount()){for(var w=p.length-2;w>0;--w)if(x=p[w].dequeue(),x){g=g.concat(a(d,p,m,x,!0));break}}}return g}function a(d,p,m,g,v){var b=v?[]:void 0;return e.forEach(d.inEdges(g.v),function(x){var w=d.edge(x),S=d.node(x.v);v&&b.push({v:x.v,w:x.w}),S.out-=w,u(p,m,S)}),e.forEach(d.outEdges(g.v),function(x){var w=d.edge(x),S=x.w,C=d.node(S);C.in-=w,u(p,m,C)}),d.removeNode(g.v),b}function c(d,p){var m=new t,g=0,v=0;e.forEach(d.nodes(),function(w){m.setNode(w,{v:w,in:0,out:0})}),e.forEach(d.edges(),function(w){var S=m.edge(w.v,w.w)||0,C=p(w),k=S+C;m.setEdge(w.v,w.w,k),v=Math.max(v,m.node(w.v).out+=C),g=Math.max(g,m.node(w.w).in+=C)});var b=e.range(v+g+3).map(function(){return new n}),x=g+1;return e.forEach(m.nodes(),function(w){u(b,x,m.node(w))}),{graph:m,buckets:b,zeroIdx:x}}function u(d,p,m){m.out?m.in?d[m.out-m.in+p].enqueue(m):d[d.length-1].enqueue(m):d[0].enqueue(m)}return z0}var V0,CT;function RX(){if(CT)return V0;CT=1;var e=et(),t=AX();V0={run:n,undo:s};function n(o){var a=o.graph().acyclicer==="greedy"?t(o,c(o)):r(o);e.forEach(a,function(u){var d=o.edge(u);o.removeEdge(u),d.forwardName=u.name,d.reversed=!0,o.setEdge(u.w,u.v,d,e.uniqueId("rev"))});function c(u){return function(d){return u.edge(d).weight}}}function r(o){var a=[],c={},u={};function d(p){e.has(u,p)||(u[p]=!0,c[p]=!0,e.forEach(o.outEdges(p),function(m){e.has(c,m.w)?a.push(m):d(m.w)}),delete c[p])}return e.forEach(o.nodes(),d),a}function s(o){e.forEach(o.edges(),function(a){var c=o.edge(a);if(c.reversed){o.removeEdge(a);var u=c.forwardName;delete c.reversed,delete c.forwardName,o.setEdge(a.w,a.v,c,u)}})}return V0}var U0,ET;function Zt(){if(ET)return U0;ET=1;var e=et(),t=Vn().Graph;U0={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:o,predecessorWeights:a,intersectRect:c,buildLayerMatrix:u,normalizeRanks:d,removeEmptyRanks:p,addBorderNode:m,maxRank:g,partition:v,time:b,notime:x};function n(w,S,C,k){var N;do N=e.uniqueId(k);while(w.hasNode(N));return C.dummy=S,w.setNode(N,C),N}function r(w){var S=new t().setGraph(w.graph());return e.forEach(w.nodes(),function(C){S.setNode(C,w.node(C))}),e.forEach(w.edges(),function(C){var k=S.edge(C.v,C.w)||{weight:0,minlen:1},N=w.edge(C);S.setEdge(C.v,C.w,{weight:k.weight+N.weight,minlen:Math.max(k.minlen,N.minlen)})}),S}function s(w){var S=new t({multigraph:w.isMultigraph()}).setGraph(w.graph());return e.forEach(w.nodes(),function(C){w.children(C).length||S.setNode(C,w.node(C))}),e.forEach(w.edges(),function(C){S.setEdge(C,w.edge(C))}),S}function o(w){var S=e.map(w.nodes(),function(C){var k={};return e.forEach(w.outEdges(C),function(N){k[N.w]=(k[N.w]||0)+w.edge(N).weight}),k});return e.zipObject(w.nodes(),S)}function a(w){var S=e.map(w.nodes(),function(C){var k={};return e.forEach(w.inEdges(C),function(N){k[N.v]=(k[N.v]||0)+w.edge(N).weight}),k});return e.zipObject(w.nodes(),S)}function c(w,S){var C=w.x,k=w.y,N=S.x-C,j=S.y-k,A=w.width/2,R=w.height/2;if(!N&&!j)throw new Error("Not possible to find intersection inside of the rectangle");var O,L;return Math.abs(j)*A>Math.abs(N)*R?(j<0&&(R=-R),O=R*N/j,L=R):(N<0&&(A=-A),O=A,L=A*j/N),{x:C+O,y:k+L}}function u(w){var S=e.map(e.range(g(w)+1),function(){return[]});return e.forEach(w.nodes(),function(C){var k=w.node(C),N=k.rank;e.isUndefined(N)||(S[N][k.order]=C)}),S}function d(w){var S=e.min(e.map(w.nodes(),function(C){return w.node(C).rank}));e.forEach(w.nodes(),function(C){var k=w.node(C);e.has(k,"rank")&&(k.rank-=S)})}function p(w){var S=e.min(e.map(w.nodes(),function(j){return w.node(j).rank})),C=[];e.forEach(w.nodes(),function(j){var A=w.node(j).rank-S;C[A]||(C[A]=[]),C[A].push(j)});var k=0,N=w.graph().nodeRankFactor;e.forEach(C,function(j,A){e.isUndefined(j)&&A%N!==0?--k:k&&e.forEach(j,function(R){w.node(R).rank+=k})})}function m(w,S,C,k){var N={width:0,height:0};return arguments.length>=4&&(N.rank=C,N.order=k),n(w,"border",N,S)}function g(w){return e.max(e.map(w.nodes(),function(S){var C=w.node(S).rank;if(!e.isUndefined(C))return C}))}function v(w,S){var C={lhs:[],rhs:[]};return e.forEach(w,function(k){S(k)?C.lhs.push(k):C.rhs.push(k)}),C}function b(w,S){var C=e.now();try{return S()}finally{console.log(w+" time: "+(e.now()-C)+"ms")}}function x(w,S){return S()}return U0}var H0,jT;function IX(){if(jT)return H0;jT=1;var e=et(),t=Zt();H0={run:n,undo:s};function n(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(a){r(o,a)})}function r(o,a){var c=a.v,u=o.node(c).rank,d=a.w,p=o.node(d).rank,m=a.name,g=o.edge(a),v=g.labelRank;if(p!==u+1){o.removeEdge(a);var b,x,w;for(w=0,++u;u<p;++w,++u)g.points=[],x={width:0,height:0,edgeLabel:g,edgeObj:a,rank:u},b=t.addDummyNode(o,"edge",x,"_d"),u===v&&(x.width=g.width,x.height=g.height,x.dummy="edge-label",x.labelpos=g.labelpos),o.setEdge(c,b,{weight:g.weight},m),w===0&&o.graph().dummyChains.push(b),c=b;o.setEdge(c,d,{weight:g.weight},m)}}function s(o){e.forEach(o.graph().dummyChains,function(a){var c=o.node(a),u=c.edgeLabel,d;for(o.setEdge(c.edgeObj,u);c.dummy;)d=o.successors(a)[0],o.removeNode(a),u.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(u.x=c.x,u.y=c.y,u.width=c.width,u.height=c.height),a=d,c=o.node(a)})}return H0}var W0,TT;function wd(){if(TT)return W0;TT=1;var e=et();W0={longestPath:t,slack:n};function t(r){var s={};function o(a){var c=r.node(a);if(e.has(s,a))return c.rank;s[a]=!0;var u=e.min(e.map(r.outEdges(a),function(d){return o(d.w)-r.edge(d).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),c.rank=u}e.forEach(r.sources(),o)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return W0}var K0,AT;function g4(){if(AT)return K0;AT=1;var e=et(),t=Vn().Graph,n=wd().slack;K0=r;function r(c){var u=new t({directed:!1}),d=c.nodes()[0],p=c.nodeCount();u.setNode(d,{});for(var m,g;s(u,c)<p;)m=o(u,c),g=u.hasNode(m.v)?n(c,m):-n(c,m),a(u,c,g);return u}function s(c,u){function d(p){e.forEach(u.nodeEdges(p),function(m){var g=m.v,v=p===g?m.w:g;!c.hasNode(v)&&!n(u,m)&&(c.setNode(v,{}),c.setEdge(p,v,{}),d(v))})}return e.forEach(c.nodes(),d),c.nodeCount()}function o(c,u){return e.minBy(u.edges(),function(d){if(c.hasNode(d.v)!==c.hasNode(d.w))return n(u,d)})}function a(c,u,d){e.forEach(c.nodes(),function(p){u.node(p).rank+=d})}return K0}var G0,RT;function MX(){if(RT)return G0;RT=1;var e=et(),t=g4(),n=wd().slack,r=wd().longestPath,s=Vn().alg.preorder,o=Vn().alg.postorder,a=Zt().simplify;G0=c,c.initLowLimValues=m,c.initCutValues=u,c.calcCutValue=p,c.leaveEdge=v,c.enterEdge=b,c.exchangeEdges=x;function c(k){k=a(k),r(k);var N=t(k);m(N),u(N,k);for(var j,A;j=v(N);)A=b(N,k,j),x(N,k,j,A)}function u(k,N){var j=o(k,k.nodes());j=j.slice(0,j.length-1),e.forEach(j,function(A){d(k,N,A)})}function d(k,N,j){var A=k.node(j),R=A.parent;k.edge(j,R).cutvalue=p(k,N,j)}function p(k,N,j){var A=k.node(j),R=A.parent,O=!0,L=N.edge(j,R),B=0;return L||(O=!1,L=N.edge(R,j)),B=L.weight,e.forEach(N.nodeEdges(j),function(M){var $=M.v===j,U=$?M.w:M.v;if(U!==R){var D=$===O,V=N.edge(M).weight;if(B+=D?V:-V,S(k,j,U)){var z=k.edge(j,U).cutvalue;B+=D?-z:z}}}),B}function m(k,N){arguments.length<2&&(N=k.nodes()[0]),g(k,{},1,N)}function g(k,N,j,A,R){var O=j,L=k.node(A);return N[A]=!0,e.forEach(k.neighbors(A),function(B){e.has(N,B)||(j=g(k,N,j,B,A))}),L.low=O,L.lim=j++,R?L.parent=R:delete L.parent,j}function v(k){return e.find(k.edges(),function(N){return k.edge(N).cutvalue<0})}function b(k,N,j){var A=j.v,R=j.w;N.hasEdge(A,R)||(A=j.w,R=j.v);var O=k.node(A),L=k.node(R),B=O,M=!1;O.lim>L.lim&&(B=L,M=!0);var $=e.filter(N.edges(),function(U){return M===C(k,k.node(U.v),B)&&M!==C(k,k.node(U.w),B)});return e.minBy($,function(U){return n(N,U)})}function x(k,N,j,A){var R=j.v,O=j.w;k.removeEdge(R,O),k.setEdge(A.v,A.w,{}),m(k),u(k,N),w(k,N)}function w(k,N){var j=e.find(k.nodes(),function(R){return!N.node(R).parent}),A=s(k,j);A=A.slice(1),e.forEach(A,function(R){var O=k.node(R).parent,L=N.edge(R,O),B=!1;L||(L=N.edge(O,R),B=!0),N.node(R).rank=N.node(O).rank+(B?L.minlen:-L.minlen)})}function S(k,N,j){return k.hasEdge(N,j)}function C(k,N,j){return j.low<=N.lim&&N.lim<=j.lim}return G0}var Y0,IT;function OX(){if(IT)return Y0;IT=1;var e=wd(),t=e.longestPath,n=g4(),r=MX();Y0=s;function s(u){switch(u.graph().ranker){case"network-simplex":c(u);break;case"tight-tree":a(u);break;case"longest-path":o(u);break;default:c(u)}}var o=t;function a(u){t(u),n(u)}function c(u){r(u)}return Y0}var X0,MT;function PX(){if(MT)return X0;MT=1;var e=et();X0=t;function t(s){var o=r(s);e.forEach(s.graph().dummyChains,function(a){for(var c=s.node(a),u=c.edgeObj,d=n(s,o,u.v,u.w),p=d.path,m=d.lca,g=0,v=p[g],b=!0;a!==u.w;){if(c=s.node(a),b){for(;(v=p[g])!==m&&s.node(v).maxRank<c.rank;)g++;v===m&&(b=!1)}if(!b){for(;g<p.length-1&&s.node(v=p[g+1]).minRank<=c.rank;)g++;v=p[g]}s.setParent(a,v),a=s.successors(a)[0]}})}function n(s,o,a,c){var u=[],d=[],p=Math.min(o[a].low,o[c].low),m=Math.max(o[a].lim,o[c].lim),g,v;g=a;do g=s.parent(g),u.push(g);while(g&&(o[g].low>p||m>o[g].lim));for(v=g,g=c;(g=s.parent(g))!==v;)d.push(g);return{path:u.concat(d.reverse()),lca:v}}function r(s){var o={},a=0;function c(u){var d=a;e.forEach(s.children(u),c),o[u]={low:d,lim:a++}}return e.forEach(s.children(),c),o}return X0}var Q0,OT;function LX(){if(OT)return Q0;OT=1;var e=et(),t=Zt();Q0={run:n,cleanup:a};function n(c){var u=t.addDummyNode(c,"root",{},"_root"),d=s(c),p=e.max(e.values(d))-1,m=2*p+1;c.graph().nestingRoot=u,e.forEach(c.edges(),function(v){c.edge(v).minlen*=m});var g=o(c)+1;e.forEach(c.children(),function(v){r(c,u,m,g,p,d,v)}),c.graph().nodeRankFactor=m}function r(c,u,d,p,m,g,v){var b=c.children(v);if(!b.length){v!==u&&c.setEdge(u,v,{weight:0,minlen:d});return}var x=t.addBorderNode(c,"_bt"),w=t.addBorderNode(c,"_bb"),S=c.node(v);c.setParent(x,v),S.borderTop=x,c.setParent(w,v),S.borderBottom=w,e.forEach(b,function(C){r(c,u,d,p,m,g,C);var k=c.node(C),N=k.borderTop?k.borderTop:C,j=k.borderBottom?k.borderBottom:C,A=k.borderTop?p:2*p,R=N!==j?1:m-g[v]+1;c.setEdge(x,N,{weight:A,minlen:R,nestingEdge:!0}),c.setEdge(j,w,{weight:A,minlen:R,nestingEdge:!0})}),c.parent(v)||c.setEdge(u,x,{weight:0,minlen:m+g[v]})}function s(c){var u={};function d(p,m){var g=c.children(p);g&&g.length&&e.forEach(g,function(v){d(v,m+1)}),u[p]=m}return e.forEach(c.children(),function(p){d(p,1)}),u}function o(c){return e.reduce(c.edges(),function(u,d){return u+c.edge(d).weight},0)}function a(c){var u=c.graph();c.removeNode(u.nestingRoot),delete u.nestingRoot,e.forEach(c.edges(),function(d){var p=c.edge(d);p.nestingEdge&&c.removeEdge(d)})}return Q0}var J0,PT;function DX(){if(PT)return J0;PT=1;var e=et(),t=Zt();J0=n;function n(s){function o(a){var c=s.children(a),u=s.node(a);if(c.length&&e.forEach(c,o),e.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var d=u.minRank,p=u.maxRank+1;d<p;++d)r(s,"borderLeft","_bl",a,u,d),r(s,"borderRight","_br",a,u,d)}}e.forEach(s.children(),o)}function r(s,o,a,c,u,d){var p={width:0,height:0,rank:d,borderType:o},m=u[o][d-1],g=t.addDummyNode(s,"border",p,a);u[o][d]=g,s.setParent(g,c),m&&s.setEdge(m,g,{weight:1})}return J0}var Z0,LT;function $X(){if(LT)return Z0;LT=1;var e=et();Z0={adjust:t,undo:n};function t(d){var p=d.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&r(d)}function n(d){var p=d.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&o(d),(p==="lr"||p==="rl")&&(c(d),r(d))}function r(d){e.forEach(d.nodes(),function(p){s(d.node(p))}),e.forEach(d.edges(),function(p){s(d.edge(p))})}function s(d){var p=d.width;d.width=d.height,d.height=p}function o(d){e.forEach(d.nodes(),function(p){a(d.node(p))}),e.forEach(d.edges(),function(p){var m=d.edge(p);e.forEach(m.points,a),e.has(m,"y")&&a(m)})}function a(d){d.y=-d.y}function c(d){e.forEach(d.nodes(),function(p){u(d.node(p))}),e.forEach(d.edges(),function(p){var m=d.edge(p);e.forEach(m.points,u),e.has(m,"x")&&u(m)})}function u(d){var p=d.x;d.x=d.y,d.y=p}return Z0}var ex,DT;function qX(){if(DT)return ex;DT=1;var e=et();ex=t;function t(n){var r={},s=e.filter(n.nodes(),function(d){return!n.children(d).length}),o=e.max(e.map(s,function(d){return n.node(d).rank})),a=e.map(e.range(o+1),function(){return[]});function c(d){if(!e.has(r,d)){r[d]=!0;var p=n.node(d);a[p.rank].push(d),e.forEach(n.successors(d),c)}}var u=e.sortBy(s,function(d){return n.node(d).rank});return e.forEach(u,c),a}return ex}var tx,$T;function FX(){if($T)return tx;$T=1;var e=et();tx=t;function t(r,s){for(var o=0,a=1;a<s.length;++a)o+=n(r,s[a-1],s[a]);return o}function n(r,s,o){for(var a=e.zipObject(o,e.map(o,function(g,v){return v})),c=e.flatten(e.map(s,function(g){return e.sortBy(e.map(r.outEdges(g),function(v){return{pos:a[v.w],weight:r.edge(v).weight}}),"pos")}),!0),u=1;u<o.length;)u<<=1;var d=2*u-1;u-=1;var p=e.map(new Array(d),function(){return 0}),m=0;return e.forEach(c.forEach(function(g){var v=g.pos+u;p[v]+=g.weight;for(var b=0;v>0;)v%2&&(b+=p[v+1]),v=v-1>>1,p[v]+=g.weight;m+=g.weight*b})),m}return tx}var nx,qT;function BX(){if(qT)return nx;qT=1;var e=et();nx=t;function t(n,r){return e.map(r,function(s){var o=n.inEdges(s);if(o.length){var a=e.reduce(o,function(c,u){var d=n.edge(u),p=n.node(u.v);return{sum:c.sum+d.weight*p.order,weight:c.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return nx}var rx,FT;function zX(){if(FT)return rx;FT=1;var e=et();rx=t;function t(s,o){var a={};e.forEach(s,function(u,d){var p=a[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:d};e.isUndefined(u.barycenter)||(p.barycenter=u.barycenter,p.weight=u.weight)}),e.forEach(o.edges(),function(u){var d=a[u.v],p=a[u.w];!e.isUndefined(d)&&!e.isUndefined(p)&&(p.indegree++,d.out.push(a[u.w]))});var c=e.filter(a,function(u){return!u.indegree});return n(c)}function n(s){var o=[];function a(d){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(d.barycenter)||p.barycenter>=d.barycenter)&&r(d,p)}}function c(d){return function(p){p.in.push(d),--p.indegree===0&&s.push(p)}}for(;s.length;){var u=s.pop();o.push(u),e.forEach(u.in.reverse(),a(u)),e.forEach(u.out,c(u))}return e.map(e.filter(o,function(d){return!d.merged}),function(d){return e.pick(d,["vs","i","barycenter","weight"])})}function r(s,o){var a=0,c=0;s.weight&&(a+=s.barycenter*s.weight,c+=s.weight),o.weight&&(a+=o.barycenter*o.weight,c+=o.weight),s.vs=o.vs.concat(s.vs),s.barycenter=a/c,s.weight=c,s.i=Math.min(o.i,s.i),o.merged=!0}return rx}var sx,BT;function VX(){if(BT)return sx;BT=1;var e=et(),t=Zt();sx=n;function n(o,a){var c=t.partition(o,function(x){return e.has(x,"barycenter")}),u=c.lhs,d=e.sortBy(c.rhs,function(x){return-x.i}),p=[],m=0,g=0,v=0;u.sort(s(!!a)),v=r(p,d,v),e.forEach(u,function(x){v+=x.vs.length,p.push(x.vs),m+=x.barycenter*x.weight,g+=x.weight,v=r(p,d,v)});var b={vs:e.flatten(p,!0)};return g&&(b.barycenter=m/g,b.weight=g),b}function r(o,a,c){for(var u;a.length&&(u=e.last(a)).i<=c;)a.pop(),o.push(u.vs),c++;return c}function s(o){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:o?c.i-a.i:a.i-c.i}}return sx}var ix,zT;function UX(){if(zT)return ix;zT=1;var e=et(),t=BX(),n=zX(),r=VX();ix=s;function s(c,u,d,p){var m=c.children(u),g=c.node(u),v=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};v&&(m=e.filter(m,function(j){return j!==v&&j!==b}));var w=t(c,m);e.forEach(w,function(j){if(c.children(j.v).length){var A=s(c,j.v,d,p);x[j.v]=A,e.has(A,"barycenter")&&a(j,A)}});var S=n(w,d);o(S,x);var C=r(S,p);if(v&&(C.vs=e.flatten([v,C.vs,b],!0),c.predecessors(v).length)){var k=c.node(c.predecessors(v)[0]),N=c.node(c.predecessors(b)[0]);e.has(C,"barycenter")||(C.barycenter=0,C.weight=0),C.barycenter=(C.barycenter*C.weight+k.order+N.order)/(C.weight+2),C.weight+=2}return C}function o(c,u){e.forEach(c,function(d){d.vs=e.flatten(d.vs.map(function(p){return u[p]?u[p].vs:p}),!0)})}function a(c,u){e.isUndefined(c.barycenter)?(c.barycenter=u.barycenter,c.weight=u.weight):(c.barycenter=(c.barycenter*c.weight+u.barycenter*u.weight)/(c.weight+u.weight),c.weight+=u.weight)}return ix}var ox,VT;function HX(){if(VT)return ox;VT=1;var e=et(),t=Vn().Graph;ox=n;function n(s,o,a){var c=r(s),u=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(d){return s.node(d)});return e.forEach(s.nodes(),function(d){var p=s.node(d),m=s.parent(d);(p.rank===o||p.minRank<=o&&o<=p.maxRank)&&(u.setNode(d),u.setParent(d,m||c),e.forEach(s[a](d),function(g){var v=g.v===d?g.w:g.v,b=u.edge(v,d),x=e.isUndefined(b)?0:b.weight;u.setEdge(v,d,{weight:s.edge(g).weight+x})}),e.has(p,"minRank")&&u.setNode(d,{borderLeft:p.borderLeft[o],borderRight:p.borderRight[o]}))}),u}function r(s){for(var o;s.hasNode(o=e.uniqueId("_root")););return o}return ox}var ax,UT;function WX(){if(UT)return ax;UT=1;var e=et();ax=t;function t(n,r,s){var o={},a;e.forEach(s,function(c){for(var u=n.parent(c),d,p;u;){if(d=n.parent(u),d?(p=o[d],o[d]=u):(p=a,a=u),p&&p!==u){r.setEdge(p,u);return}u=d}})}return ax}var lx,HT;function KX(){if(HT)return lx;HT=1;var e=et(),t=qX(),n=FX(),r=UX(),s=HX(),o=WX(),a=Vn().Graph,c=Zt();lx=u;function u(g){var v=c.maxRank(g),b=d(g,e.range(1,v+1),"inEdges"),x=d(g,e.range(v-1,-1,-1),"outEdges"),w=t(g);m(g,w);for(var S=Number.POSITIVE_INFINITY,C,k=0,N=0;N<4;++k,++N){p(k%2?b:x,k%4>=2),w=c.buildLayerMatrix(g);var j=n(g,w);j<S&&(N=0,C=e.cloneDeep(w),S=j)}m(g,C)}function d(g,v,b){return e.map(v,function(x){return s(g,x,b)})}function p(g,v){var b=new a;e.forEach(g,function(x){var w=x.graph().root,S=r(x,w,b,v);e.forEach(S.vs,function(C,k){x.node(C).order=k}),o(x,b,S.vs)})}function m(g,v){e.forEach(v,function(b){e.forEach(b,function(x,w){g.node(x).order=w})})}return lx}var cx,WT;function GX(){if(WT)return cx;WT=1;var e=et(),t=Vn().Graph,n=Zt();cx={positionX:b,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:c,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:g,findSmallestWidthAlignment:m,balance:v};function r(S,C){var k={};function N(j,A){var R=0,O=0,L=j.length,B=e.last(A);return e.forEach(A,function(M,$){var U=o(S,M),D=U?S.node(U).order:L;(U||M===B)&&(e.forEach(A.slice(O,$+1),function(V){e.forEach(S.predecessors(V),function(z){var Q=S.node(z),F=Q.order;(F<R||D<F)&&!(Q.dummy&&S.node(V).dummy)&&a(k,z,V)})}),O=$+1,R=D)}),A}return e.reduce(C,N),k}function s(S,C){var k={};function N(A,R,O,L,B){var M;e.forEach(e.range(R,O),function($){M=A[$],S.node(M).dummy&&e.forEach(S.predecessors(M),function(U){var D=S.node(U);D.dummy&&(D.order<L||D.order>B)&&a(k,U,M)})})}function j(A,R){var O=-1,L,B=0;return e.forEach(R,function(M,$){if(S.node(M).dummy==="border"){var U=S.predecessors(M);U.length&&(L=S.node(U[0]).order,N(R,B,$,O,L),B=$,O=L)}N(R,B,R.length,L,A.length)}),R}return e.reduce(C,j),k}function o(S,C){if(S.node(C).dummy)return e.find(S.predecessors(C),function(k){return S.node(k).dummy})}function a(S,C,k){if(C>k){var N=C;C=k,k=N}var j=S[C];j||(S[C]=j={}),j[k]=!0}function c(S,C,k){if(C>k){var N=C;C=k,k=N}return e.has(S[C],k)}function u(S,C,k,N){var j={},A={},R={};return e.forEach(C,function(O){e.forEach(O,function(L,B){j[L]=L,A[L]=L,R[L]=B})}),e.forEach(C,function(O){var L=-1;e.forEach(O,function(B){var M=N(B);if(M.length){M=e.sortBy(M,function(z){return R[z]});for(var $=(M.length-1)/2,U=Math.floor($),D=Math.ceil($);U<=D;++U){var V=M[U];A[B]===B&&L<R[V]&&!c(k,B,V)&&(A[V]=B,A[B]=j[B]=j[V],L=R[V])}}})}),{root:j,align:A}}function d(S,C,k,N,j){var A={},R=p(S,C,k,j),O=j?"borderLeft":"borderRight";function L($,U){for(var D=R.nodes(),V=D.pop(),z={};V;)z[V]?$(V):(z[V]=!0,D.push(V),D=D.concat(U(V))),V=D.pop()}function B($){A[$]=R.inEdges($).reduce(function(U,D){return Math.max(U,A[D.v]+R.edge(D))},0)}function M($){var U=R.outEdges($).reduce(function(V,z){return Math.min(V,A[z.w]-R.edge(z))},Number.POSITIVE_INFINITY),D=S.node($);U!==Number.POSITIVE_INFINITY&&D.borderType!==O&&(A[$]=Math.max(A[$],U))}return L(B,R.predecessors.bind(R)),L(M,R.successors.bind(R)),e.forEach(N,function($){A[$]=A[k[$]]}),A}function p(S,C,k,N){var j=new t,A=S.graph(),R=x(A.nodesep,A.edgesep,N);return e.forEach(C,function(O){var L;e.forEach(O,function(B){var M=k[B];if(j.setNode(M),L){var $=k[L],U=j.edge($,M);j.setEdge($,M,Math.max(R(S,B,L),U||0))}L=B})}),j}function m(S,C){return e.minBy(e.values(C),function(k){var N=Number.NEGATIVE_INFINITY,j=Number.POSITIVE_INFINITY;return e.forIn(k,function(A,R){var O=w(S,R)/2;N=Math.max(A+O,N),j=Math.min(A-O,j)}),N-j})}function g(S,C){var k=e.values(C),N=e.min(k),j=e.max(k);e.forEach(["u","d"],function(A){e.forEach(["l","r"],function(R){var O=A+R,L=S[O],B;if(L!==C){var M=e.values(L);B=R==="l"?N-e.min(M):j-e.max(M),B&&(S[O]=e.mapValues(L,function($){return $+B}))}})})}function v(S,C){return e.mapValues(S.ul,function(k,N){if(C)return S[C.toLowerCase()][N];var j=e.sortBy(e.map(S,N));return(j[1]+j[2])/2})}function b(S){var C=n.buildLayerMatrix(S),k=e.merge(r(S,C),s(S,C)),N={},j;e.forEach(["u","d"],function(R){j=R==="u"?C:e.values(C).reverse(),e.forEach(["l","r"],function(O){O==="r"&&(j=e.map(j,function($){return e.values($).reverse()}));var L=(R==="u"?S.predecessors:S.successors).bind(S),B=u(S,j,k,L),M=d(S,j,B.root,B.align,O==="r");O==="r"&&(M=e.mapValues(M,function($){return-$})),N[R+O]=M})});var A=m(S,N);return g(N,A),v(N,S.graph().align)}function x(S,C,k){return function(N,j,A){var R=N.node(j),O=N.node(A),L=0,B;if(L+=R.width/2,e.has(R,"labelpos"))switch(R.labelpos.toLowerCase()){case"l":B=-R.width/2;break;case"r":B=R.width/2;break}if(B&&(L+=k?B:-B),B=0,L+=(R.dummy?C:S)/2,L+=(O.dummy?C:S)/2,L+=O.width/2,e.has(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":B=O.width/2;break;case"r":B=-O.width/2;break}return B&&(L+=k?B:-B),B=0,L}}function w(S,C){return S.node(C).width}return cx}var ux,KT;function YX(){if(KT)return ux;KT=1;var e=et(),t=Zt(),n=GX().positionX;ux=r;function r(o){o=t.asNonCompoundGraph(o),s(o),e.forEach(n(o),function(a,c){o.node(c).x=a})}function s(o){var a=t.buildLayerMatrix(o),c=o.graph().ranksep,u=0;e.forEach(a,function(d){var p=e.max(e.map(d,function(m){return o.node(m).height}));e.forEach(d,function(m){o.node(m).y=u+p/2}),u+=p+c})}return ux}var dx,GT;function XX(){if(GT)return dx;GT=1;var e=et(),t=RX(),n=IX(),r=OX(),s=Zt().normalizeRanks,o=PX(),a=Zt().removeEmptyRanks,c=LX(),u=DX(),d=$X(),p=KX(),m=YX(),g=Zt(),v=Vn().Graph;dx=b;function b(K,J){var te=J&&J.debugTiming?g.time:g.notime;te("layout",function(){var Y=te(" buildLayoutGraph",function(){return L(K)});te(" runLayout",function(){x(Y,te)}),te(" updateInputGraph",function(){w(K,Y)})})}function x(K,J){J(" makeSpaceForEdgeLabels",function(){B(K)}),J(" removeSelfEdges",function(){q(K)}),J(" acyclic",function(){t.run(K)}),J(" nestingGraph.run",function(){c.run(K)}),J(" rank",function(){r(g.asNonCompoundGraph(K))}),J(" injectEdgeLabelProxies",function(){M(K)}),J(" removeEmptyRanks",function(){a(K)}),J(" nestingGraph.cleanup",function(){c.cleanup(K)}),J(" normalizeRanks",function(){s(K)}),J(" assignRankMinMax",function(){$(K)}),J(" removeEdgeLabelProxies",function(){U(K)}),J(" normalize.run",function(){n.run(K)}),J(" parentDummyChains",function(){o(K)}),J(" addBorderSegments",function(){u(K)}),J(" order",function(){p(K)}),J(" insertSelfEdges",function(){G(K)}),J(" adjustCoordinateSystem",function(){d.adjust(K)}),J(" position",function(){m(K)}),J(" positionSelfEdges",function(){P(K)}),J(" removeBorderNodes",function(){F(K)}),J(" normalize.undo",function(){n.undo(K)}),J(" fixupEdgeLabelCoords",function(){z(K)}),J(" undoCoordinateSystem",function(){d.undo(K)}),J(" translateGraph",function(){D(K)}),J(" assignNodeIntersects",function(){V(K)}),J(" reversePoints",function(){Q(K)}),J(" acyclic.undo",function(){t.undo(K)})}function w(K,J){e.forEach(K.nodes(),function(te){var Y=K.node(te),ee=J.node(te);Y&&(Y.x=ee.x,Y.y=ee.y,J.children(te).length&&(Y.width=ee.width,Y.height=ee.height))}),e.forEach(K.edges(),function(te){var Y=K.edge(te),ee=J.edge(te);Y.points=ee.points,e.has(ee,"x")&&(Y.x=ee.x,Y.y=ee.y)}),K.graph().width=J.graph().width,K.graph().height=J.graph().height}var S=["nodesep","edgesep","ranksep","marginx","marginy"],C={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},k=["acyclicer","ranker","rankdir","align"],N=["width","height"],j={width:0,height:0},A=["minlen","weight","width","height","labeloffset"],R={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function L(K){var J=new v({multigraph:!0,compound:!0}),te=oe(K.graph());return J.setGraph(e.merge({},C,W(te,S),e.pick(te,k))),e.forEach(K.nodes(),function(Y){var ee=oe(K.node(Y));J.setNode(Y,e.defaults(W(ee,N),j)),J.setParent(Y,K.parent(Y))}),e.forEach(K.edges(),function(Y){var ee=oe(K.edge(Y));J.setEdge(Y,e.merge({},R,W(ee,A),e.pick(ee,O)))}),J}function B(K){var J=K.graph();J.ranksep/=2,e.forEach(K.edges(),function(te){var Y=K.edge(te);Y.minlen*=2,Y.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?Y.width+=Y.labeloffset:Y.height+=Y.labeloffset)})}function M(K){e.forEach(K.edges(),function(J){var te=K.edge(J);if(te.width&&te.height){var Y=K.node(J.v),ee=K.node(J.w),ie={rank:(ee.rank-Y.rank)/2+Y.rank,e:J};g.addDummyNode(K,"edge-proxy",ie,"_ep")}})}function $(K){var J=0;e.forEach(K.nodes(),function(te){var Y=K.node(te);Y.borderTop&&(Y.minRank=K.node(Y.borderTop).rank,Y.maxRank=K.node(Y.borderBottom).rank,J=e.max(J,Y.maxRank))}),K.graph().maxRank=J}function U(K){e.forEach(K.nodes(),function(J){var te=K.node(J);te.dummy==="edge-proxy"&&(K.edge(te.e).labelRank=te.rank,K.removeNode(J))})}function D(K){var J=Number.POSITIVE_INFINITY,te=0,Y=Number.POSITIVE_INFINITY,ee=0,ie=K.graph(),ue=ie.marginx||0,me=ie.marginy||0;function ye(pe){var _e=pe.x,xe=pe.y,Ce=pe.width,Ne=pe.height;J=Math.min(J,_e-Ce/2),te=Math.max(te,_e+Ce/2),Y=Math.min(Y,xe-Ne/2),ee=Math.max(ee,xe+Ne/2)}e.forEach(K.nodes(),function(pe){ye(K.node(pe))}),e.forEach(K.edges(),function(pe){var _e=K.edge(pe);e.has(_e,"x")&&ye(_e)}),J-=ue,Y-=me,e.forEach(K.nodes(),function(pe){var _e=K.node(pe);_e.x-=J,_e.y-=Y}),e.forEach(K.edges(),function(pe){var _e=K.edge(pe);e.forEach(_e.points,function(xe){xe.x-=J,xe.y-=Y}),e.has(_e,"x")&&(_e.x-=J),e.has(_e,"y")&&(_e.y-=Y)}),ie.width=te-J+ue,ie.height=ee-Y+me}function V(K){e.forEach(K.edges(),function(J){var te=K.edge(J),Y=K.node(J.v),ee=K.node(J.w),ie,ue;te.points?(ie=te.points[0],ue=te.points[te.points.length-1]):(te.points=[],ie=ee,ue=Y),te.points.unshift(g.intersectRect(Y,ie)),te.points.push(g.intersectRect(ee,ue))})}function z(K){e.forEach(K.edges(),function(J){var te=K.edge(J);if(e.has(te,"x"))switch((te.labelpos==="l"||te.labelpos==="r")&&(te.width-=te.labeloffset),te.labelpos){case"l":te.x-=te.width/2+te.labeloffset;break;case"r":te.x+=te.width/2+te.labeloffset;break}})}function Q(K){e.forEach(K.edges(),function(J){var te=K.edge(J);te.reversed&&te.points.reverse()})}function F(K){e.forEach(K.nodes(),function(J){if(K.children(J).length){var te=K.node(J),Y=K.node(te.borderTop),ee=K.node(te.borderBottom),ie=K.node(e.last(te.borderLeft)),ue=K.node(e.last(te.borderRight));te.width=Math.abs(ue.x-ie.x),te.height=Math.abs(ee.y-Y.y),te.x=ie.x+te.width/2,te.y=Y.y+te.height/2}}),e.forEach(K.nodes(),function(J){K.node(J).dummy==="border"&&K.removeNode(J)})}function q(K){e.forEach(K.edges(),function(J){if(J.v===J.w){var te=K.node(J.v);te.selfEdges||(te.selfEdges=[]),te.selfEdges.push({e:J,label:K.edge(J)}),K.removeEdge(J)}})}function G(K){var J=g.buildLayerMatrix(K);e.forEach(J,function(te){var Y=0;e.forEach(te,function(ee,ie){var ue=K.node(ee);ue.order=ie+Y,e.forEach(ue.selfEdges,function(me){g.addDummyNode(K,"selfedge",{width:me.label.width,height:me.label.height,rank:ue.rank,order:ie+ ++Y,e:me.e,label:me.label},"_se")}),delete ue.selfEdges})})}function P(K){e.forEach(K.nodes(),function(J){var te=K.node(J);if(te.dummy==="selfedge"){var Y=K.node(te.e.v),ee=Y.x+Y.width/2,ie=Y.y,ue=te.x-ee,me=Y.height/2;K.setEdge(te.e,te.label),K.removeNode(J),te.label.points=[{x:ee+2*ue/3,y:ie-me},{x:ee+5*ue/6,y:ie-me},{x:ee+ue,y:ie},{x:ee+5*ue/6,y:ie+me},{x:ee+2*ue/3,y:ie+me}],te.label.x=te.x,te.label.y=te.y}})}function W(K,J){return e.mapValues(e.pick(K,J),Number)}function oe(K){var J={};return e.forEach(K,function(te,Y){J[Y.toLowerCase()]=te}),J}return dx}var fx,YT;function QX(){if(YT)return fx;YT=1;var e=et(),t=Zt(),n=Vn().Graph;fx={debugOrdering:r};function r(s){var o=t.buildLayerMatrix(s),a=new n({compound:!0,multigraph:!0}).setGraph({});return e.forEach(s.nodes(),function(c){a.setNode(c,{label:c}),a.setParent(c,"layer"+s.node(c).rank)}),e.forEach(s.edges(),function(c){a.setEdge(c.v,c.w,{},c.name)}),e.forEach(o,function(c,u){var d="layer"+u;a.setNode(d,{rank:"same"}),e.reduce(c,function(p,m){return a.setEdge(p,m,{style:"invis"}),m})}),a}return fx}var hx,XT;function JX(){return XT||(XT=1,hx="0.8.5"),hx}var px,QT;function ZX(){return QT||(QT=1,px={graphlib:Vn(),layout:XX(),debug:QX(),util:{time:Zt().time,notime:Zt().notime},version:JX()}),px}var eQ=ZX();const JT=gl(eQ);function y4(){const{nodes:e,edges:t,setNodes:n,setEdges:r,updateNodeData:s,clearCanvas:o}=xo(),a=_o(),c=T.useMemo(()=>e.filter(M=>M.selected),[e]),u=T.useMemo(()=>t.filter(M=>M.selected),[t]),d=T.useCallback(M=>e.find($=>$.id===M),[e]),p=T.useCallback(M=>t.find($=>$.id===M),[t]),m=T.useCallback(M=>{n([...e,M])},[e,n]),g=T.useCallback(M=>{n(e.filter($=>$.id!==M)),r(t.filter($=>$.source!==M&&$.target!==M))},[e,t,n,r]),v=T.useCallback(()=>{const M=[],$=new Map;for(const D of c){const V=`${D.id}-copy-${Date.now()}`;$.set(D.id,V),M.push({...D,id:V,position:{x:D.position.x+50,y:D.position.y+50},selected:!1,data:{...D.data,id:V}})}n([...e,...M]);const U=[];for(const D of t)$.has(D.source)&&$.has(D.target)&&U.push({...D,id:`${D.id}-copy-${Date.now()}`,source:$.get(D.source),target:$.get(D.target)});U.length>0&&r([...t,...U])},[c,e,t,n,r]),b=T.useCallback(()=>{const M=new Set(c.map(U=>U.id)),$=new Set(u.map(U=>U.id));n(e.filter(U=>!M.has(U.id))),r(t.filter(U=>!$.has(U.id)&&!M.has(U.source)&&!M.has(U.target)))},[c,u,e,t,n,r]),x=T.useCallback(()=>{const M=new JT.graphlib.Graph;M.setDefaultEdgeLabel(()=>({})),M.setGraph({rankdir:"TB",nodesep:50,ranksep:80});for(const U of e)M.setNode(U.id,{width:200,height:100});for(const U of t)M.setEdge(U.source,U.target);JT.layout(M);const $=e.map(U=>{const D=M.node(U.id);return{...U,position:{x:D.x-100,y:D.y-50}}});n($),setTimeout(()=>{a.fitView({padding:.2})},50)},[e,t,n,a]),w=T.useCallback(()=>{a.fitView({padding:.2})},[a]),S=T.useCallback(M=>{const $=d(M);$&&a.setCenter($.position.x+100,$.position.y+50,{zoom:1.5,duration:300})},[d,a]),C=T.useCallback((M,$=!1)=>{n(e.map(U=>({...U,selected:$&&U.selected||U.id===M})))},[e,n]),k=T.useCallback(()=>{n(e.map(M=>({...M,selected:!1}))),r(t.map(M=>({...M,selected:!1})))},[e,t,n,r]),{undo:N,redo:j,canUndo:A,canRedo:R,copySelected:O,paste:L,canPaste:B}=xo();return{nodes:e,edges:t,selectedNodes:c,selectedEdges:u,getNode:d,getEdge:p,addNode:m,removeNode:g,updateNodeData:s,setNodes:n,setEdges:r,clearCanvas:o,selectNode:C,clearSelection:k,duplicateSelected:v,deleteSelected:b,autoLayout:x,fitView:w,zoomToNode:S,undo:N,redo:j,canUndo:A,canRedo:R,copySelected:O,paste:L,canPaste:B}}const tQ={step:T6,subworkflow:R6,trigger:M6,output:P6,if:D6,for_each:q6,while:B6,switch:V6,parallel:H6,try:K6,map:Rp,filter:Rp,reduce:Rp};function nQ(){const{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,setNodes:o}=xo(),{autoLayout:a,deleteSelected:c,duplicateSelected:u}=y4(),d=Mr(Y=>Y.currentWorkflow),{screenToFlowPosition:p}=_o(),m=El(),[g,v]=T.useState(null),[b,x]=T.useState(!1),[w,S]=T.useState(null),[C,k]=T.useState(!1),[N,j]=T.useState(null),A=T.useRef(null),R=T.useCallback((Y,ee)=>{if(Y.preventDefault(),ee.type==="trigger"||ee.type==="output")return;const ie=d==null?void 0:d.steps.find(ue=>ue.id===ee.data.id);ie&&(v(ie),x(!0))},[d]),O=T.useCallback(()=>{if(!d)return null;const Y=["step","if","for_each","while","switch","parallel","try","map","filter","reduce"],ee=e.find(ie=>ie.selected&&Y.includes(ie.type||""));return ee&&d.steps.find(ie=>ie.id===ee.data.id)||null},[d,e]),{undo:L,redo:B,canUndo:M,canRedo:$,copySelected:U,paste:D,canPaste:V}=xo(),z=T.useCallback(Y=>{const ee=Y.metaKey||Y.ctrlKey;if((Y.key==="Backspace"||Y.key==="Delete")&&c(),ee&&Y.key==="d"&&(Y.preventDefault(),u()),ee&&Y.key==="l"&&(Y.preventDefault(),a()),ee&&Y.key==="z"&&!Y.shiftKey&&(Y.preventDefault(),M()&&L()),(ee&&Y.shiftKey&&Y.key==="z"||ee&&Y.key==="y")&&(Y.preventDefault(),$()&&B()),ee&&Y.key==="c"&&(Y.preventDefault(),U()),ee&&Y.key==="v"&&(Y.preventDefault(),V()&&D()),Y.key==="e"&&!ee&&!Y.shiftKey&&!Y.altKey){Y.preventDefault();const ie=O();ie&&(v(ie),x(!0))}if(Y.key==="y"&&!ee&&!Y.shiftKey&&!Y.altKey){Y.preventDefault();const ie=O();ie&&(S(ie),k(!0))}},[c,u,a,O,L,B,M,$,U,D,V]),Q=T.useCallback(Y=>{console.log("Saving step:",Y),x(!1),v(null)},[]),F=T.useCallback(()=>{if(!N||!d)return;const Y=d.steps.find(ee=>ee.id===N.data.id);Y&&(v(Y),x(!0)),j(null)},[N,d]),q=T.useCallback(()=>{if(!N||!d)return;const Y=d.steps.find(ee=>ee.id===N.data.id);Y&&(S(Y),k(!0)),j(null)},[N,d]),G=T.useCallback(()=>{N&&u(),j(null)},[N,u]),P=T.useCallback(()=>{N&&c(),j(null)},[N,c]),W=T.useCallback(()=>{N&&console.log("Execute step:",N.data.id),j(null)},[N]),oe=T.useCallback((Y,ee)=>{Y.preventDefault(),["step","if","for_each","while","switch","parallel","try","map","filter","reduce","subworkflow"].includes(ee.type||"")&&j(ee)},[]),K=T.useCallback(Y=>{Y.preventDefault(),Y.dataTransfer.dropEffect="copy"},[]),J=T.useCallback(Y=>{var ie;Y.preventDefault();const ee=Y.dataTransfer.getData("application/marktoflow-tool");if(ee)try{const ue=JSON.parse(ee),me=p({x:Y.clientX,y:Y.clientY}),ye=ue.id+"-"+Date.now().toString(36),pe={id:ye,type:"step",position:me,data:{id:ye,name:ue.name+" Action",action:ue.id+"."+(((ie=ue.actions)==null?void 0:ie[0])||"action"),status:"pending"}};o([...e,pe])}catch(ue){console.error("Failed to parse dropped tool data:",ue)}},[e,o,p]),te=T.useCallback(()=>{if(!d||!g)return[];const Y=[];if(d.inputs)for(const ie of Object.keys(d.inputs))Y.push(`inputs.${ie}`);const ee=d.steps.findIndex(ie=>ie.id===g.id);for(let ie=0;ie<ee;ie++){const ue=d.steps[ie];ue.outputVariable&&Y.push(ue.outputVariable)}return Y},[d,g]);return h.jsxs(IK,{children:[h.jsx(MK,{asChild:!0,children:h.jsx("div",{ref:A,className:"w-full h-full",onKeyDown:z,onDragOver:K,onDrop:J,tabIndex:0,children:h.jsxs(tz,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,onNodeDoubleClick:R,onNodeContextMenu:oe,nodeTypes:tQ,fitView:!0,snapToGrid:!0,snapGrid:[16,16],defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},proOptions:{hideAttribution:!0},children:[h.jsx(oz,{variant:Ar.Dots,gap:24,size:1,color:"#3d3d5c"}),h.jsx(hz,{}),h.jsx(Cz,{nodeColor:Y=>{var ee;switch((ee=Y.data)==null?void 0:ee.status){case"running":return"#f0ad4e";case"completed":return"#5cb85c";case"failed":return"#d9534f";default:return"#2d2d4a"}},maskColor:"rgba(26, 26, 46, 0.8)"})]})})}),h.jsxs(yP,{children:[h.jsxs(Xi,{onClick:F,children:[h.jsx(h6,{className:"w-4 h-4 mr-2"}),"Edit Step",h.jsx(Fa,{children:"E"})]}),h.jsxs(Xi,{onClick:q,children:[h.jsx(Ew,{className:"w-4 h-4 mr-2"}),"View YAML",h.jsx(Fa,{children:"Y"})]}),h.jsx(ew,{}),h.jsxs(Xi,{onClick:W,children:[h.jsx(Nl,{className:"w-4 h-4 mr-2"}),"Execute Step"]}),h.jsx(ew,{}),h.jsxs(Xi,{onClick:G,children:[h.jsx(vo,{className:"w-4 h-4 mr-2"}),"Duplicate",h.jsxs(Fa,{children:[m,"D"]})]}),h.jsxs(Xi,{onClick:P,destructive:!0,children:[h.jsx(ko,{className:"w-4 h-4 mr-2"}),"Delete",h.jsx(Fa,{children:"⌫"})]})]}),h.jsx(YH,{open:b,onOpenChange:x,step:g,onSave:Q,availableVariables:te()}),h.jsx(Ss,{open:C,onOpenChange:k,title:`YAML: ${(w==null?void 0:w.name)||(w==null?void 0:w.id)}`,size:"lg",children:h.jsx("div",{className:"p-4",children:h.jsx(UH,{value:w})})})]})}const v4=Dr((e,t)=>({editingStep:null,isEditorOpen:!1,yamlViewStep:null,isYamlViewOpen:!1,isNewStepOpen:!1,newStepPosition:null,copiedNodes:[],undoStack:[],redoStack:[],openEditor:n=>e({editingStep:n,isEditorOpen:!0}),closeEditor:()=>e({editingStep:null,isEditorOpen:!1}),openYamlViewer:n=>e({yamlViewStep:n,isYamlViewOpen:!0}),closeYamlViewer:()=>e({yamlViewStep:null,isYamlViewOpen:!1}),openNewStepWizard:n=>e({isNewStepOpen:!0,newStepPosition:n??null}),closeNewStepWizard:()=>e({isNewStepOpen:!1,newStepPosition:null}),copyNodes:n=>e({copiedNodes:n.map(r=>({...r}))}),clearClipboard:()=>e({copiedNodes:[]}),pushUndo:n=>{const{undoStack:r}=t();e({undoStack:[...r,n],redoStack:[]})},undo:()=>{const{undoStack:n,redoStack:r}=t();if(n.length===0)return null;const s=n[n.length-1];return e({undoStack:n.slice(0,-1),redoStack:[...r,s]}),s},redo:()=>{const{undoStack:n,redoStack:r}=t();if(r.length===0)return null;const s=r[r.length-1];return e({redoStack:r.slice(0,-1),undoStack:[...n,s]}),s},clearHistory:()=>e({undoStack:[],redoStack:[]})})),x4=Dr((e,t)=>({providers:[],activeProviderId:null,isLoading:!1,error:null,loadProviders:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/ai/providers");if(!n.ok)throw new Error("Failed to load providers");const r=await n.json();e({providers:r.providers,activeProviderId:r.activeProvider,isLoading:!1})}catch(n){console.error("Error loading providers:",n),e({error:n instanceof Error?n.message:"Unknown error",isLoading:!1})}},setProvider:async(n,r)=>{e({isLoading:!0,error:null});try{const s=await fetch(`/api/ai/providers/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r||{})});if(!s.ok){const a=await s.json();throw new Error(a.message||"Failed to set provider")}const o=await s.json();return o.success&&o.status?(e({providers:o.status.providers,activeProviderId:o.status.activeProvider,isLoading:!1}),!0):!1}catch(s){return console.error("Error setting provider:",s),e({error:s instanceof Error?s.message:"Unknown error",isLoading:!1}),!1}},refreshStatus:async()=>{await t().loadProviders()}}));function rQ({open:e,onOpenChange:t}){var C,k,N;const{providers:n,activeProviderId:r,isLoading:s,error:o,loadProviders:a,setProvider:c}=x4(),[u,d]=T.useState(null),[p,m]=T.useState(!1),[g,v]=T.useState({apiKey:"",baseUrl:"",model:""});T.useEffect(()=>{e&&a()},[e,a]);const b=async j=>{const A=n.find(R=>R.id===j);A&&(A.status==="needs_config"?(d(j),m(!0)):A.status==="ready"&&await c(j)&&t(!1))},x=async()=>{if(!u)return;await c(u,g)&&(m(!1),v({apiKey:"",baseUrl:"",model:""}),t(!1))},w=j=>{switch(j){case"ready":return h.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"});case"needs_config":return h.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500"});case"unavailable":return h.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500"});default:return null}},S=j=>{switch(j){case"ready":return"Ready";case"needs_config":return"Needs Configuration";case"unavailable":return"Unavailable";default:return"Unknown"}};if(p){const j=n.find(A=>A.id===u);return j?h.jsxs(Ss,{open:p,onOpenChange:m,title:`Configure ${j.name}`,description:"Enter configuration details for this provider",size:"md",children:[h.jsxs("div",{className:"p-4 space-y-4",children:[((C=j.configOptions)==null?void 0:C.apiKey)&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"API Key"}),h.jsx("input",{type:"password",value:g.apiKey,onChange:A=>v({...g,apiKey:A.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter API key"})]}),((k=j.configOptions)==null?void 0:k.baseUrl)&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Base URL"}),h.jsx("input",{type:"text",value:g.baseUrl,onChange:A=>v({...g,baseUrl:A.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter base URL"})]}),((N=j.configOptions)==null?void 0:N.model)&&h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Model"}),h.jsx("input",{type:"text",value:g.model,onChange:A=>v({...g,model:A.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter model name"})]})]}),h.jsxs(ni,{children:[h.jsx(Fe,{variant:"secondary",onClick:()=>m(!1),children:"Cancel"}),h.jsx(Fe,{variant:"primary",onClick:x,disabled:s,children:s?h.jsx(ws,{className:"w-4 h-4 animate-spin"}):"Save & Activate"})]})]}):null}return h.jsxs(Ss,{open:e,onOpenChange:t,title:"AI Provider",description:"Select which AI provider to use for agent prompts",size:"md",children:[h.jsxs("div",{className:"p-4 space-y-2",children:[o&&h.jsxs("div",{className:"flex items-center gap-2 p-3 bg-error/10 border border-error/30 rounded text-error text-sm",children:[h.jsx(kl,{className:"w-4 h-4 flex-shrink-0"}),h.jsx("span",{children:o})]}),s&&n.length===0?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(ws,{className:"w-6 h-6 animate-spin text-gray-500"})}):h.jsx("div",{className:"space-y-2",children:n.map(j=>h.jsxs("button",{onClick:()=>b(j.id),disabled:j.status==="unavailable",className:`
|
|
693
|
+
w-full flex items-center justify-between p-3 rounded border transition-all
|
|
694
|
+
${j.isActive?"bg-primary/10 border-primary text-white":"bg-node-bg border-node-border text-gray-300 hover:bg-white/5"}
|
|
695
|
+
${j.status==="unavailable"?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
696
|
+
`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[w(j.status),h.jsxs("div",{className:"text-left",children:[h.jsx("div",{className:"font-medium",children:j.name}),j.description&&h.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:j.description})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[j.isActive&&h.jsx(ei,{className:"w-4 h-4 text-primary"}),j.status==="needs_config"&&h.jsx(Pd,{className:"w-4 h-4 text-yellow-500"}),h.jsx("span",{className:"text-xs text-gray-500",children:S(j.status)})]})]},j.id))})]}),h.jsx(ni,{children:h.jsx(Fe,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function sQ({onAddStep:e,onExecute:t,onSave:n,isExecuting:r=!1}){const{autoLayout:s,fitView:o,selectedNodes:a,deleteSelected:c,duplicateSelected:u}=y4(),{undo:d,redo:p,undoStack:m,redoStack:g}=v4(),{zoomIn:v,zoomOut:b}=_o(),x=El(),{providers:w,activeProviderId:S,loadProviders:C}=x4(),[k,N]=T.useState(!1),j=m.length>0,A=g.length>0,R=a.length>0;T.useEffect(()=>{C()},[C]);const O=w.find(L=>L.id===S);return h.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1 px-2 py-1.5 bg-panel-bg/95 backdrop-blur border border-node-border rounded-lg shadow-lg",children:[h.jsx(Pn,{icon:h.jsx(Od,{className:"w-4 h-4"}),label:"Add Step",onClick:e,shortcut:"N"}),h.jsx(Ia,{}),h.jsx(Pn,{icon:h.jsx(m6,{className:"w-4 h-4"}),label:"Undo",onClick:()=>d(),disabled:!j,shortcut:`${x}Z`}),h.jsx(Pn,{icon:h.jsx(a6,{className:"w-4 h-4"}),label:"Redo",onClick:()=>p(),disabled:!A,shortcut:`${x}⇧Z`}),h.jsx(Ia,{}),h.jsx(Pn,{icon:h.jsx(vo,{className:"w-4 h-4"}),label:"Duplicate",onClick:u,disabled:!R,shortcut:`${x}D`}),h.jsx(Pn,{icon:h.jsx(ko,{className:"w-4 h-4"}),label:"Delete",onClick:c,disabled:!R,shortcut:"⌫"}),h.jsx(Ia,{}),h.jsx(Pn,{icon:h.jsx(i6,{className:"w-4 h-4"}),label:"Auto Layout",onClick:s,shortcut:`${x}L`}),h.jsx(Pn,{icon:h.jsx(v6,{className:"w-4 h-4"}),label:"Zoom In",onClick:()=>v(),shortcut:`${x}+`}),h.jsx(Pn,{icon:h.jsx(x6,{className:"w-4 h-4"}),label:"Zoom Out",onClick:()=>b(),shortcut:`${x}-`}),h.jsx(Pn,{icon:h.jsx(Jz,{className:"w-4 h-4"}),label:"Fit View",onClick:o,shortcut:`${x}0`}),h.jsx(Ia,{}),h.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 px-2 py-1.5 rounded text-sm text-gray-300 hover:text-white hover:bg-white/10 transition-colors",title:"Select AI Provider",children:[h.jsx($u,{className:"w-4 h-4"}),h.jsx("span",{className:"hidden sm:inline text-xs",children:(O==null?void 0:O.name)||"No Provider"}),h.jsx(gs,{className:"w-3 h-3"})]}),t&&h.jsxs(h.Fragment,{children:[h.jsx(Ia,{}),h.jsx(Pn,{icon:r?h.jsx(rI,{className:"w-4 h-4"}):h.jsx(Nl,{className:"w-4 h-4"}),label:r?"Stop":"Execute",onClick:t,variant:r?"destructive":"primary",shortcut:`${x}⏎`})]}),n&&h.jsx(Pn,{icon:h.jsx(c6,{className:"w-4 h-4"}),label:"Save",onClick:n,shortcut:`${x}S`}),h.jsx(rQ,{open:k,onOpenChange:N})]})}function Pn({icon:e,label:t,onClick:n,disabled:r,shortcut:s,variant:o="default"}){const a={default:"text-gray-300 hover:text-white hover:bg-white/10",primary:"text-primary hover:text-primary-light hover:bg-primary/10",destructive:"text-error hover:text-error hover:bg-error/10"};return h.jsxs("button",{onClick:n,disabled:r,className:`relative group p-2 rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${a[o]}`,title:`${t}${s?` (${s})`:""}`,children:[e,h.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-black/90 rounded text-xs text-white whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:[t,s&&h.jsx("span",{className:"ml-2 text-gray-400",children:s})]})]})}function Ia(){return h.jsx("div",{className:"w-px h-6 bg-node-border mx-1"})}function iQ({isExecuting:e,isPaused:t,workflowStatus:n,currentStepId:r,steps:s,logs:o,onPause:a,onResume:c,onStop:u,onStepOver:d,onClose:p,debug:m,onToggleDebugMode:g,onToggleBreakpoint:v,onStepInto:b,onStepOut:x,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:C}){const[k,N]=T.useState("steps"),j=(m==null?void 0:m.enabled)??!1,A=s.filter(L=>L.status==="completed").length,R=s.filter(L=>L.status==="failed").length,O=s.length>0?A/s.length*100:0;return!e&&n==="pending"?null:h.jsxs("div",{className:"absolute bottom-20 left-4 right-4 z-20 bg-panel-bg border border-node-border rounded-lg shadow-xl max-h-[400px] flex flex-col",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-node-border",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(cQ,{status:n}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-white",children:dQ(n)}),h.jsxs("div",{className:"text-xs text-gray-400",children:[A,"/",s.length," steps completed",R>0&&` • ${R} failed`]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[g&&h.jsx(Fe,{variant:j?"primary":"ghost",size:"sm",onClick:g,icon:h.jsx(jk,{className:"w-4 h-4"}),title:j?"Disable debug mode":"Enable debug mode",children:"Debug"}),e&&h.jsxs(h.Fragment,{children:[t?h.jsx(Fe,{variant:"secondary",size:"sm",onClick:c,icon:h.jsx(Nl,{className:"w-4 h-4"}),children:"Resume"}):h.jsx(Fe,{variant:"secondary",size:"sm",onClick:a,icon:h.jsx(rI,{className:"w-4 h-4"}),children:"Pause"}),j&&t&&h.jsxs(h.Fragment,{children:[h.jsx(Fe,{variant:"secondary",size:"sm",onClick:d,icon:h.jsx(al,{className:"w-4 h-4"}),title:"Step Over (F10)",children:"Over"}),b&&h.jsx(Fe,{variant:"secondary",size:"sm",onClick:b,icon:h.jsx(Oz,{className:"w-4 h-4"}),title:"Step Into (F11)",children:"Into"}),x&&h.jsx(Fe,{variant:"secondary",size:"sm",onClick:x,icon:h.jsx(Pz,{className:"w-4 h-4"}),title:"Step Out (Shift+F11)",children:"Out"})]}),!j&&h.jsx(Fe,{variant:"secondary",size:"sm",onClick:d,icon:h.jsx(iI,{className:"w-4 h-4"}),disabled:!t,children:"Step"}),h.jsx(Fe,{variant:"destructive",size:"sm",onClick:u,icon:h.jsx(oI,{className:"w-4 h-4"}),children:"Stop"})]}),!e&&h.jsx(Fe,{variant:"secondary",size:"sm",onClick:p,children:"Close"})]})]}),h.jsx("div",{className:"h-1 bg-node-bg",children:h.jsx("div",{className:`h-full transition-all duration-300 ${n==="failed"?"bg-error":n==="completed"?"bg-success":"bg-primary"}`,style:{width:`${O}%`}})}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsx("button",{onClick:()=>N("steps"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="steps"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Steps"}),h.jsx("button",{onClick:()=>N("variables"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="variables"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Variables"}),h.jsx("button",{onClick:()=>N("logs"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="logs"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Logs"}),j&&h.jsxs("button",{onClick:()=>N("debug"),className:`px-4 py-2 text-sm font-medium transition-colors flex items-center gap-1 ${k==="debug"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:[h.jsx(jk,{className:"w-3 h-3"}),"Debug"]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[k==="steps"&&h.jsx(oQ,{steps:s,currentStepId:r,debugEnabled:j,breakpoints:m==null?void 0:m.breakpoints,onToggleBreakpoint:v}),k==="variables"&&h.jsx(lQ,{steps:s}),k==="logs"&&h.jsx(aQ,{logs:o}),k==="debug"&&j&&h.jsx(fQ,{debug:m,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:C})]})]})}function oQ({steps:e,currentStepId:t,debugEnabled:n,breakpoints:r,onToggleBreakpoint:s}){return h.jsx("div",{className:"space-y-2",children:e.map(o=>{const a=r==null?void 0:r.has(o.stepId);return h.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${o.stepId===t?"bg-primary/10 border-primary":a?"bg-error/10 border-error/50":"bg-node-bg border-node-border"}`,children:[n&&s&&h.jsx("button",{onClick:()=>s(o.stepId),className:`w-4 h-4 rounded-full flex items-center justify-center transition-colors ${a?"bg-error":"bg-transparent border border-gray-500 hover:border-error hover:bg-error/20"}`,title:a?"Remove breakpoint":"Add breakpoint",children:a&&h.jsx(Lx,{className:"w-2 h-2 fill-current text-white"})}),h.jsx(uQ,{status:o.status}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm font-medium text-white truncate",children:o.stepName||o.stepId}),o.error&&h.jsx("div",{className:"text-xs text-error mt-1 truncate",children:o.error})]}),o.duration!==void 0&&h.jsxs("div",{className:"text-xs text-gray-400",children:[o.duration,"ms"]})]},o.stepId)})})}function aQ({logs:e}){return h.jsx("div",{className:"font-mono text-xs space-y-1",children:e.length===0?h.jsx("div",{className:"text-gray-500",children:"No logs yet..."}):e.map((t,n)=>h.jsx("div",{className:"text-gray-300",children:t},n))})}function lQ({steps:e}){const[t,n]=T.useState(new Set),[r,s]=T.useState(new Set),[o,a]=T.useState(null),c=e.filter(m=>m.inputs!==void 0||m.output!==void 0&&m.outputVariable),u=m=>{n(g=>{const v=new Set(g);return v.has(m)?v.delete(m):v.add(m),v})},d=m=>{s(g=>{const v=new Set(g);return v.has(m)?v.delete(m):v.add(m),v})},p=async(m,g)=>{try{const v=typeof g=="string"?g:JSON.stringify(g,null,2);await navigator.clipboard.writeText(v),a(m),setTimeout(()=>a(null),2e3)}catch(v){console.error("Failed to copy:",v)}};return c.length===0?h.jsxs("div",{className:"text-center py-8 text-gray-500 text-sm",children:["No data available yet.",h.jsx("br",{}),h.jsx("span",{className:"text-xs",children:"Step inputs and outputs will appear as steps execute."})]}):h.jsx("div",{className:"space-y-2",children:c.map(m=>{const g=t.has(m.stepId),v=m.inputs&&Object.keys(m.inputs).length>0,b=m.output!==void 0&&m.outputVariable;return h.jsxs("div",{className:"border border-node-border rounded-lg overflow-hidden",children:[h.jsxs("button",{onClick:()=>u(m.stepId),className:"w-full flex items-center gap-2 px-3 py-2 bg-node-bg hover:bg-white/5 transition-colors",children:[g?h.jsx(gs,{className:"w-4 h-4 text-gray-400"}):h.jsx(Jt,{className:"w-4 h-4 text-gray-400"}),h.jsx("code",{className:"text-sm text-white font-mono",children:m.stepName||m.stepId}),h.jsxs("span",{className:"text-xs text-gray-500 ml-auto",children:[v&&`${Object.keys(m.inputs).length} inputs`,v&&b&&" • ",b&&m.outputVariable]})]}),g&&h.jsxs("div",{className:"bg-panel-bg border-t border-node-border",children:[v&&h.jsxs("div",{className:"border-b border-node-border",children:[h.jsxs("button",{onClick:()=>d(`${m.stepId}-inputs`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${m.stepId}-inputs`)?h.jsx(gs,{className:"w-3 h-3 text-gray-400"}):h.jsx(Jt,{className:"w-3 h-3 text-gray-400"}),h.jsxs("span",{className:"text-xs font-medium text-gray-400",children:["Inputs (",Object.keys(m.inputs).length,")"]})]}),r.has(`${m.stepId}-inputs`)&&h.jsx("div",{className:"px-3 pb-3",children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("div",{className:"flex-1 overflow-x-auto",children:h.jsx(bd,{value:m.inputs,onCopy:(x,w)=>p(x,w),copiedKey:o,path:"inputs"})}),h.jsx("button",{onClick:()=>p(`${m.stepId}-inputs`,m.inputs),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy inputs",children:o===`${m.stepId}-inputs`?h.jsx(ei,{className:"w-4 h-4 text-success"}):h.jsx(vo,{className:"w-4 h-4 text-gray-400"})})]})})]}),b&&h.jsxs("div",{children:[h.jsxs("button",{onClick:()=>d(`${m.stepId}-output`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${m.stepId}-output`)?h.jsx(gs,{className:"w-3 h-3 text-gray-400"}):h.jsx(Jt,{className:"w-3 h-3 text-gray-400"}),h.jsx("span",{className:"text-xs font-medium text-gray-400",children:"Output"}),h.jsx("code",{className:"text-xs text-primary font-mono ml-auto",children:m.outputVariable})]}),r.has(`${m.stepId}-output`)&&h.jsx("div",{className:"px-3 pb-3",children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("div",{className:"flex-1 overflow-x-auto",children:h.jsx(bd,{value:m.output,onCopy:(x,w)=>p(x,w),copiedKey:o,path:m.outputVariable||"output"})}),h.jsx("button",{onClick:()=>p(m.outputVariable||"",m.output),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy output",children:o===m.outputVariable?h.jsx(ei,{className:"w-4 h-4 text-success"}):h.jsx(vo,{className:"w-4 h-4 text-gray-400"})})]})})]})]})]},m.stepId)})})}function bd({value:e,onCopy:t,copiedKey:n,path:r,depth:s=0}){const[o,a]=T.useState(s<2);if(e===null)return h.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"null"});if(e===void 0)return h.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"undefined"});if(typeof e=="boolean")return h.jsx("span",{className:`font-mono text-xs ${e?"text-success":"text-error"}`,children:String(e)});if(typeof e=="number")return h.jsx("span",{className:"text-warning font-mono text-xs",children:e});if(typeof e=="string"){const c=e.length>200?e.substring(0,200)+"...":e;return h.jsxs("span",{className:"text-success font-mono text-xs",children:['"',c,'"']})}if(Array.isArray(e))return e.length===0?h.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"[]"}):h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?h.jsx(gs,{className:"w-3 h-3"}):h.jsx(Jt,{className:"w-3 h-3"}),h.jsxs("span",{className:"text-xs font-mono",children:["Array(",e.length,")"]})]}),o&&h.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[e.slice(0,20).map((c,u)=>h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsxs("span",{className:"text-gray-500 font-mono text-xs",children:["[",u,"]:"]}),h.jsx(bd,{value:c,onCopy:t,copiedKey:n,path:`${r}[${u}]`,depth:s+1})]},u)),e.length>20&&h.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",e.length-20," more items"]})]})]});if(typeof e=="object"){const c=Object.entries(e);return c.length===0?h.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"{}"}):h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?h.jsx(gs,{className:"w-3 h-3"}):h.jsx(Jt,{className:"w-3 h-3"}),h.jsxs("span",{className:"text-xs font-mono",children:["Object(",c.length," keys)"]})]}),o&&h.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[c.slice(0,30).map(([u,d])=>h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsxs("span",{className:"text-primary font-mono text-xs",children:[u,":"]}),h.jsx(bd,{value:d,onCopy:t,copiedKey:n,path:`${r}.${u}`,depth:s+1})]},u)),c.length>30&&h.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",c.length-30," more keys"]})]})]})}return h.jsx("span",{className:"text-gray-400 font-mono text-xs",children:String(e)})}function cQ({status:e}){switch(e){case"running":return h.jsx(ws,{className:"w-5 h-5 text-primary animate-spin"});case"completed":return h.jsx(en,{className:"w-5 h-5 text-success"});case"failed":return h.jsx(lt,{className:"w-5 h-5 text-error"});case"cancelled":return h.jsx(oI,{className:"w-5 h-5 text-gray-400"});default:return h.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-500"})}}function uQ({status:e}){switch(e){case"running":return h.jsx(ws,{className:"w-4 h-4 text-warning animate-spin"});case"completed":return h.jsx(en,{className:"w-4 h-4 text-success"});case"failed":return h.jsx(lt,{className:"w-4 h-4 text-error"});case"skipped":return h.jsx(iI,{className:"w-4 h-4 text-gray-400"});default:return h.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-500"})}}function dQ(e){switch(e){case"pending":return"Pending";case"running":return"Executing Workflow...";case"completed":return"Workflow Completed";case"failed":return"Workflow Failed";case"cancelled":return"Workflow Cancelled";default:return"Unknown"}}function fQ({debug:e,onClearBreakpoints:t,onAddWatchExpression:n,onRemoveWatchExpression:r}){const[s,o]=T.useState(""),a=()=>{s.trim()&&n&&(n(s.trim()),o(""))};return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("h4",{className:"text-sm font-medium text-white flex items-center gap-2",children:[h.jsx(Lx,{className:"w-3 h-3 text-error"}),"Breakpoints (",e.breakpoints.size,")"]}),e.breakpoints.size>0&&t&&h.jsxs("button",{onClick:t,className:"text-xs text-gray-400 hover:text-white flex items-center gap-1",children:[h.jsx(ko,{className:"w-3 h-3"}),"Clear all"]})]}),h.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.breakpoints.size===0?h.jsx("div",{className:"text-xs text-gray-500",children:"No breakpoints set. Click the dot next to a step to add one."}):h.jsx("div",{className:"space-y-1",children:Array.from(e.breakpoints).map(c=>h.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-300",children:[h.jsx(Lx,{className:"w-2 h-2 fill-current text-error"}),h.jsx("span",{className:"font-mono",children:c})]},c))})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Call Stack"}),h.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.callStack.length===0?h.jsx("div",{className:"text-xs text-gray-500",children:"No active call stack"}):h.jsx("div",{className:"space-y-1",children:e.callStack.map((c,u)=>h.jsxs("div",{className:`flex items-center gap-2 text-xs ${u===0?"text-primary":"text-gray-400"}`,children:[h.jsx(al,{className:"w-3 h-3"}),h.jsx("span",{className:"font-mono",children:c})]},u))})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Watch Expressions"}),h.jsxs("div",{className:"bg-node-bg rounded-lg p-3 space-y-2",children:[n&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:s,onChange:c=>o(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),placeholder:"Add expression...",className:"flex-1 bg-transparent border border-node-border rounded px-2 py-1 text-xs text-white placeholder-gray-500 focus:outline-none focus:border-primary"}),h.jsx("button",{onClick:a,disabled:!s.trim(),className:"p-1 text-gray-400 hover:text-white disabled:opacity-50",children:h.jsx(Od,{className:"w-4 h-4"})})]}),e.watchExpressions.length===0?h.jsx("div",{className:"text-xs text-gray-500",children:"No watch expressions. Add an expression to monitor its value."}):h.jsx("div",{className:"space-y-1",children:e.watchExpressions.map(c=>h.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs group",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:"text-primary font-mono truncate",children:c}),h.jsx("span",{className:"text-gray-500",children:"="}),h.jsx("span",{className:"text-gray-300 font-mono truncate",children:"(not evaluated)"})]}),r&&h.jsx("button",{onClick:()=>r(c),className:"p-1 text-gray-500 hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx(Cl,{className:"w-3 h-3"})})]},c))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Debug State"}),h.jsxs("div",{className:"bg-node-bg rounded-lg p-3 text-xs space-y-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-400",children:"Current Step:"}),h.jsx("span",{className:"text-white font-mono",children:e.currentStepId||"(none)"})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-400",children:"Paused at Breakpoint:"}),h.jsx("span",{className:e.pausedAtBreakpoint?"text-error":"text-gray-500",children:e.pausedAtBreakpoint?"Yes":"No"})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-400",children:"Step Over Pending:"}),h.jsx("span",{className:e.stepOverPending?"text-warning":"text-gray-500",children:e.stepOverPending?"Yes":"No"})]})]})]})]})}function hQ(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const a=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(s))!=null?o:null;return c instanceof Promise?c.then(a):a(c)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const tw=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return tw(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return tw(r)(n)}}}},pQ=(e,t)=>(n,r,s)=>{let o={storage:hQ(()=>localStorage),partialize:w=>w,version:0,merge:(w,S)=>({...S,...w}),...t},a=!1,c=0;const u=new Set,d=new Set;let p=o.storage;if(!p)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...w)},r,s);const m=()=>{const w=o.partialize({...r()});return p.setItem(o.name,{state:w,version:o.version})},g=s.setState;s.setState=(w,S)=>(g(w,S),m());const v=e((...w)=>(n(...w),m()),r,s);s.getInitialState=()=>v;let b;const x=()=>{var w,S;if(!p)return;const C=++c;a=!1,u.forEach(N=>{var j;return N((j=r())!=null?j:v)});const k=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(w=r())!=null?w:v))||void 0;return tw(p.getItem.bind(p))(o.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==o.version){if(o.migrate){const j=o.migrate(N.state,N.version);return j instanceof Promise?j.then(A=>[!0,A]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var j;if(C!==c)return;const[A,R]=N;if(b=o.merge(R,(j=r())!=null?j:v),n(b,!0),A)return m()}).then(()=>{C===c&&(k==null||k(b,void 0),b=r(),a=!0,d.forEach(N=>N(b)))}).catch(N=>{C===c&&(k==null||k(void 0,N))})};return s.persist={setOptions:w=>{o={...o,...w},w.storage&&(p=w.storage)},clearStorage:()=>{p==null||p.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>x(),hasHydrated:()=>a,onHydrate:w=>(u.add(w),()=>{u.delete(w)}),onFinishHydration:w=>(d.add(w),()=>{d.delete(w)})},o.skipHydration||x(),b||v},w4=pQ,ZT={tablet:768,desktop:1024};function mQ(e){return e>=ZT.desktop?"desktop":e>=ZT.tablet?"tablet":"mobile"}const $b=Dr()(w4((e,t)=>({sidebarOpen:!0,propertiesPanelOpen:!0,mobileMenuOpen:!1,breakpoint:"desktop",toggleSidebar:()=>e(n=>({sidebarOpen:!n.sidebarOpen})),setSidebarOpen:n=>e({sidebarOpen:n}),togglePropertiesPanel:()=>e(n=>({propertiesPanelOpen:!n.propertiesPanelOpen})),setPropertiesPanelOpen:n=>e({propertiesPanelOpen:n}),toggleMobileMenu:()=>e(n=>({mobileMenuOpen:!n.mobileMenuOpen})),setMobileMenuOpen:n=>e({mobileMenuOpen:n}),setBreakpoint:n=>{t(),e(n==="mobile"?{breakpoint:n,sidebarOpen:!1,propertiesPanelOpen:!1}:n==="tablet"?{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!1}:{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!0})},closeAllPanels:()=>e({sidebarOpen:!1,propertiesPanelOpen:!1,mobileMenuOpen:!1})}),{name:"marktoflow-layout",partialize:e=>({sidebarOpen:e.sidebarOpen,propertiesPanelOpen:e.propertiesPanelOpen})}));function gQ({open:e,onOpenChange:t,onImportComplete:n}){const[r,s]=T.useState(null),[o,a]=T.useState(!1),[c,u]=T.useState([]),[d,p]=T.useState(!1),m=T.useRef(null),g=N=>{var A;const j=(A=N.target.files)==null?void 0:A[0];j&&(s(j),u([]))},v=N=>{N.preventDefault(),N.stopPropagation(),p(!0)},b=N=>{N.preventDefault(),N.stopPropagation(),p(!1)},x=N=>{var A;N.preventDefault(),N.stopPropagation(),p(!1);const j=(A=N.dataTransfer.files)==null?void 0:A[0];j&&(s(j),u([]))},w=async()=>{if(r){a(!0),u([]);try{const N=new FormData;N.append("file",r);const j=await fetch("/api/workflows/import",{method:"POST",body:N});if(!j.ok){const R=await j.json();throw new Error(R.message||"Upload failed")}const A=await j.json();Array.isArray(A.results)?u(A.results):A.success&&u([{success:!0,filename:A.filename||r.name,message:A.message}]),setTimeout(()=>{n&&n()},1500)}catch(N){u([{success:!1,filename:r.name,message:N instanceof Error?N.message:"Unknown error"}])}finally{a(!1)}}},S=()=>{s(null),u([]),t(!1)},C=N=>N?[".md",".yaml",".yml",".zip"].some(A=>N.name.toLowerCase().endsWith(A)):!1,k=N=>N.endsWith(".zip")?h.jsx(Mz,{className:"w-5 h-5 text-purple-400"}):h.jsx(od,{className:"w-5 h-5 text-blue-400"});return h.jsxs(Ss,{open:e,onOpenChange:t,title:"Import Workflow",description:"Upload workflow files from your computer",size:"md",children:[h.jsxs("div",{className:"p-4 space-y-4",children:[!r&&c.length===0&&h.jsxs("div",{onClick:()=>{var N;return(N=m.current)==null?void 0:N.click()},onDragOver:v,onDragLeave:b,onDrop:x,className:`
|
|
697
|
+
border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors
|
|
698
|
+
${d?"border-primary bg-primary/10":"border-node-border hover:border-primary/50 hover:bg-white/5"}
|
|
699
|
+
`,children:[h.jsx(aI,{className:"w-12 h-12 mx-auto mb-4 text-gray-500"}),h.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"Drag and drop a file here, or click to browse"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Supported formats: .md, .yaml, .yml, .zip"}),h.jsx("input",{ref:m,type:"file",accept:".md,.yaml,.yml,.zip",onChange:g,className:"hidden"})]}),r&&c.length===0&&h.jsxs("div",{className:"border border-node-border rounded-lg p-4",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[k(r.name),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-white truncate",children:r.name}),h.jsxs("p",{className:"text-xs text-gray-500",children:[(r.size/1024).toFixed(2)," KB"]})]}),!C(r)&&h.jsx(kl,{className:"w-5 h-5 text-error flex-shrink-0"})]}),!C(r)&&h.jsx("p",{className:"text-xs text-error mt-2",children:"Invalid file type. Please select a .md, .yaml, .yml, or .zip file."})]}),c.length>0&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-sm font-medium text-white",children:"Import Results:"}),c.map((N,j)=>h.jsxs("div",{className:`
|
|
700
|
+
flex items-start gap-3 p-3 rounded-lg border
|
|
701
|
+
${N.success?"border-success/30 bg-success/10":"border-error/30 bg-error/10"}
|
|
702
|
+
`,children:[N.success?h.jsx(en,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):h.jsx(lt,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-white truncate",children:N.filename}),N.message&&h.jsx("p",{className:"text-xs text-gray-400 mt-1",children:N.message})]})]},j))]})]}),h.jsx(ni,{children:c.length>0?h.jsx(Fe,{variant:"secondary",onClick:S,children:"Close"}):h.jsxs(h.Fragment,{children:[h.jsx(Fe,{variant:"secondary",onClick:S,disabled:o,children:"Cancel"}),h.jsx(Fe,{variant:"primary",onClick:w,disabled:!r||!C(r)||o,children:o?"Uploading...":"Import"})]})})]})}function yQ(){const[e,t]=T.useState("workflows"),{workflows:n,selectedWorkflow:r,selectWorkflow:s}=Mr(),{resetNavigation:o}=Tw(),{sidebarOpen:a,setSidebarOpen:c,breakpoint:u}=$b(),d=T.useCallback(p=>{o(),s(p),u==="mobile"&&c(!1)},[o,s,u,c]);return!a&&u!=="mobile"?h.jsxs("button",{onClick:()=>c(!0),className:"w-12 bg-panel-bg border-r border-node-border flex flex-col items-center py-4 gap-4 hover:bg-white/5 transition-colors","aria-label":"Expand sidebar",children:[h.jsx(Jt,{className:"w-4 h-4 text-gray-400"}),h.jsx(tI,{className:"w-5 h-5 text-primary"})]}):u==="mobile"?a?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>c(!1)}),h.jsx("div",{className:"fixed inset-y-0 left-0 w-72 bg-panel-bg border-r border-node-border flex flex-col z-50 md:hidden animate-slide-in-left",children:h.jsx(eA,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:d,onClose:()=>c(!1),showClose:!0})})]}):null:h.jsx("div",{className:"w-64 bg-panel-bg border-r border-node-border flex flex-col",children:h.jsx(eA,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:d,onClose:()=>c(!1),showClose:u==="tablet"})})}function eA({activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:s,onClose:o,showClose:a}){const[c,u]=T.useState(!1),{fetchWorkflows:d}=Mr();return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"p-4 border-b border-node-border flex items-center justify-between",children:[h.jsxs("h1",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[h.jsx(tI,{className:"w-5 h-5 text-primary"}),"Marktoflow"]}),a&&h.jsx("button",{onClick:o,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Close sidebar",children:h.jsx(Cl,{className:"w-4 h-4 text-gray-400"})})]}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsx("button",{onClick:()=>t("workflows"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="workflows"?"text-primary border-b-2 border-primary":"text-gray-400 hover:text-white"}`,children:"Workflows"}),h.jsx("button",{onClick:()=>t("tools"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="tools"?"text-primary border-b-2 border-primary":"text-gray-400 hover:text-white"}`,children:"Tools"})]}),h.jsx("div",{className:"p-3 border-b border-node-border",children:h.jsxs("div",{className:"relative",children:[h.jsx($x,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),h.jsx("input",{type:"text",placeholder:`Search ${e}...`,className:"w-full pl-9 pr-3 py-2 bg-node-bg border border-node-border rounded-lg text-sm text-white placeholder-gray-500 focus:outline-none focus:border-primary"})]})}),h.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:e==="workflows"?h.jsx(vQ,{workflows:n,selectedWorkflow:r,onSelect:s}):h.jsx(wQ,{})}),e==="workflows"&&h.jsxs("div",{className:"p-3 border-t border-node-border space-y-2",children:[h.jsxs("button",{className:"w-full flex items-center justify-center gap-2 px-4 py-2 bg-primary hover:bg-primary-dark text-white rounded-lg text-sm font-medium transition-colors",children:[h.jsx(Od,{className:"w-4 h-4"}),"New Workflow"]}),h.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2 bg-node-bg border border-node-border hover:bg-white/5 text-gray-300 rounded-lg text-sm font-medium transition-colors",children:[h.jsx(aI,{className:"w-4 h-4"}),"Import"]})]}),h.jsx(gQ,{open:c,onOpenChange:u,onImportComplete:()=>d()})]})}function vQ({workflows:e,selectedWorkflow:t,onSelect:n}){return e.length===0?h.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No workflows found"}):h.jsx("div",{className:"space-y-1",children:e.map(r=>h.jsxs("button",{onClick:()=>n(r.path),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors ${t===r.path?"bg-primary/10 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[h.jsx(od,{className:"w-4 h-4 flex-shrink-0"}),h.jsx("span",{className:"text-sm truncate",children:r.name}),h.jsx(Jt,{className:"w-4 h-4 ml-auto flex-shrink-0 opacity-50"})]},r.path))})}const xQ=[{id:"slack",name:"Slack",icon:"💬",category:"Communication",sdk:"@slack/web-api"},{id:"github",name:"GitHub",icon:"🐙",category:"Development",sdk:"@octokit/rest"},{id:"jira",name:"Jira",icon:"📋",category:"Project Management",sdk:"jira.js"},{id:"gmail",name:"Gmail",icon:"📧",category:"Communication",sdk:"googleapis"},{id:"http",name:"HTTP",icon:"🌐",category:"Network"},{id:"claude",name:"Claude",icon:"🤖",category:"AI"}];function wQ(){const[e,t]=T.useState(xQ),[n,r]=T.useState(!0),[s,o]=T.useState("");T.useEffect(()=>{async function d(){try{const p=await fetch("/api/tools");if(p.ok){const m=await p.json();t(m.tools)}}catch(p){console.error("Failed to fetch tools:",p)}finally{r(!1)}}d()},[]);const a=s?e.filter(d=>{var p;return d.name.toLowerCase().includes(s.toLowerCase())||d.category.toLowerCase().includes(s.toLowerCase())||((p=d.description)==null?void 0:p.toLowerCase().includes(s.toLowerCase()))}):e,c=[...new Set(a.map(d=>d.category))],u=(d,p)=>{d.dataTransfer.setData("application/marktoflow-tool",JSON.stringify(p)),d.dataTransfer.effectAllowed="copy"};return n?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(ws,{className:"w-5 h-5 text-gray-500 animate-spin"})}):h.jsxs("div",{className:"space-y-4",children:[c.map(d=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider px-2 mb-2",children:d}),h.jsx("div",{className:"space-y-1",children:a.filter(p=>p.category===d).map(p=>h.jsxs("div",{draggable:!0,onDragStart:m=>u(m,p),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-gray-300 hover:bg-white/5 cursor-grab active:cursor-grabbing transition-colors group",title:p.description||(p.sdk?"SDK: "+p.sdk:void 0),children:[h.jsx("span",{className:"text-lg",children:p.icon}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-sm block truncate",children:p.name}),p.actionCount!==void 0&&h.jsxs("span",{className:"text-xs text-gray-500",children:[p.actionCount," actions"]})]})]},p.id))})]},d)),a.length===0&&h.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No tools found"})]})}const tA={enabled:!1,breakpoints:new Set,currentStepId:null,pausedAtBreakpoint:!1,stepOverPending:!1,watchExpressions:[],callStack:[]},b4=Dr((e,t)=>({runs:[],currentRunId:null,isExecuting:!1,isPaused:!1,isLoadingHistory:!1,debug:tA,startExecution:(n,r,s)=>{const o="run-"+Date.now()+"-"+Math.random().toString(36).slice(2,8),a={id:o,workflowId:n,workflowName:r,status:"running",startTime:new Date().toISOString(),steps:[],logs:["Starting workflow execution: "+r],inputs:s};return e({runs:[a,...t().runs].slice(0,50),currentRunId:o,isExecuting:!0,isPaused:!1}),o},updateStepStatus:(n,r,s,o,a,c,u)=>{const{debug:d}=t(),p=d.enabled&&s==="running"&&d.breakpoints.has(r);e({runs:t().runs.map(m=>{if(m.id!==n)return m;const g=m.steps.find(b=>b.stepId===r),v=new Date().toISOString();return g?{...m,steps:m.steps.map(b=>{if(b.stepId!==r)return b;const x=s!=="running"?v:void 0,w=x&&b.startTime?new Date(x).getTime()-new Date(b.startTime).getTime():void 0;return{...b,status:s,endTime:x,duration:w,inputs:u??b.inputs,output:o??b.output,outputVariable:c??b.outputVariable,error:a??b.error}})}:{...m,steps:[...m.steps,{stepId:r,stepName:r,status:s,startTime:v,inputs:u,output:o,outputVariable:c,error:a}]}}),...p?{isPaused:!0,debug:{...t().debug,currentStepId:r,pausedAtBreakpoint:!0,stepOverPending:!1}}:{debug:{...t().debug,currentStepId:s==="running"?r:t().debug.currentStepId}}}),p&&t().addLog(n,`⏸️ Paused at breakpoint: ${r}`)},completeExecution:(n,r,s)=>{const o=new Date().toISOString();e({runs:t().runs.map(a=>{if(a.id!==n)return a;const c=new Date(o).getTime()-new Date(a.startTime).getTime();return{...a,status:r,endTime:o,duration:c,outputs:s,logs:[...a.logs,r==="completed"?"Workflow completed successfully":r==="failed"?"Workflow execution failed":"Workflow execution cancelled"]}}),currentRunId:null,isExecuting:!1,isPaused:!1})},addLog:(n,r)=>{e({runs:t().runs.map(s=>s.id===n?{...s,logs:[...s.logs,"["+new Date().toLocaleTimeString()+"] "+r]}:s)})},pauseExecution:()=>{e({isPaused:!0});const{currentRunId:n,runs:r}=t();n&&r.find(o=>o.id===n)&&t().addLog(n,"Execution paused")},resumeExecution:()=>{e({isPaused:!1});const{currentRunId:n}=t();n&&t().addLog(n,"Execution resumed")},cancelExecution:n=>{t().addLog(n,"Execution cancelled by user"),t().completeExecution(n,"cancelled")},clearHistory:()=>{e({runs:[]})},getRun:n=>t().runs.find(r=>r.id===n),enableDebugMode:()=>{e({debug:{...t().debug,enabled:!0}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode enabled")},disableDebugMode:()=>{e({debug:{...tA,breakpoints:t().debug.breakpoints}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode disabled")},toggleBreakpoint:n=>{const{debug:r}=t(),s=new Set(r.breakpoints);s.has(n)?s.delete(n):s.add(n),e({debug:{...r,breakpoints:s}})},hasBreakpoint:n=>t().debug.breakpoints.has(n),clearAllBreakpoints:()=>{e({debug:{...t().debug,breakpoints:new Set}});const{currentRunId:n}=t();n&&t().addLog(n,"All breakpoints cleared")},stepOver:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"➡️ Step over"))},stepInto:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬇️ Step into"))},stepOut:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!1,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬆️ Step out"))},setCurrentDebugStep:n=>{e({debug:{...t().debug,currentStepId:n}})},addWatchExpression:n=>{const{debug:r}=t();r.watchExpressions.includes(n)||e({debug:{...r,watchExpressions:[...r.watchExpressions,n]}})},removeWatchExpression:n=>{const{debug:r}=t();e({debug:{...r,watchExpressions:r.watchExpressions.filter(s=>s!==n)}})},updateCallStack:n=>{e({debug:{...t().debug,callStack:n}})},loadHistory:async n=>{e({isLoadingHistory:!0});try{const r=n?`/api/executions?workflowId=${encodeURIComponent(n)}&limit=50`:"/api/executions?limit=50",s=await fetch(r);if(!s.ok)throw new Error("Failed to load execution history");const a=(await s.json()).map(d=>{var p;return{id:d.runId,workflowId:d.workflowId,workflowName:((p=d.workflowPath.split("/").pop())==null?void 0:p.replace(".md",""))||d.workflowId,status:d.status,startTime:d.startedAt,endTime:d.completedAt||void 0,duration:d.completedAt?new Date(d.completedAt).getTime()-new Date(d.startedAt).getTime():void 0,steps:[],logs:[],inputs:d.inputs||void 0,outputs:d.outputs||void 0}}),c=new Set(t().runs.map(d=>d.id)),u=a.filter(d=>!c.has(d.id));e({runs:[...t().runs,...u].slice(0,50),isLoadingHistory:!1})}catch(r){console.error("Error loading execution history:",r),e({isLoadingHistory:!1})}},syncRunWithBackend:async n=>{console.log("Syncing run with backend:",n)}}));function nw(e){if(e<1e3)return e+"ms";if(e<6e4)return(e/1e3).toFixed(1)+"s";const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return t+"m "+n+"s"}function bQ(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),s=Math.floor(r/1e3),o=Math.floor(s/60),a=Math.floor(o/60),c=Math.floor(a/24);return s<60?"just now":o<60?o+" min ago":a<24?a+" hour"+(a>1?"s":"")+" ago":c<7?c+" day"+(c>1?"s":"")+" ago":n.toLocaleDateString()}function SQ(){const[e,t]=T.useState("properties"),n=xo(u=>u.nodes),r=T.useMemo(()=>n.filter(u=>u.selected),[n]),s=Mr(u=>u.currentWorkflow),{propertiesPanelOpen:o,setPropertiesPanelOpen:a,breakpoint:c}=$b();return c==="mobile"?o?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:()=>a(!1)}),h.jsx("div",{className:"fixed inset-y-0 right-0 w-80 max-w-[85vw] bg-panel-bg border-l border-node-border flex flex-col z-50 animate-slide-in-right",children:h.jsx(nA,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:!0})})]}):null:o?h.jsx("div",{className:"w-80 bg-panel-bg border-l border-node-border flex flex-col",children:h.jsx(nA,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:c==="tablet"})}):h.jsxs("button",{onClick:()=>a(!0),className:"w-10 bg-panel-bg border-l border-node-border flex flex-col items-center py-4 gap-4 hover:bg-white/5 transition-colors","aria-label":"Expand properties panel",children:[h.jsx(Lz,{className:"w-4 h-4 text-gray-400"}),h.jsx(Pd,{className:"w-5 h-5 text-gray-400"})]})}function nA({activeTab:e,setActiveTab:t,selectedNodes:n,workflow:r,onClose:s,showClose:o}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-node-border",children:[h.jsx("h2",{className:"text-sm font-medium text-white",children:"Properties"}),o&&h.jsx("button",{onClick:s,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Close properties panel",children:h.jsx(Cl,{className:"w-4 h-4 text-gray-400"})})]}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsx(mx,{active:e==="properties",onClick:()=>t("properties"),icon:h.jsx(Pd,{className:"w-4 h-4"}),label:"Properties"}),h.jsx(mx,{active:e==="variables",onClick:()=>t("variables"),icon:h.jsx(Dd,{className:"w-4 h-4"}),label:"Variables"}),h.jsx(mx,{active:e==="history",onClick:()=>t("history"),icon:h.jsx(jw,{className:"w-4 h-4"}),label:"History"})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="properties"&&h.jsx(_Q,{selectedNodes:n,workflow:r}),e==="variables"&&h.jsx(kQ,{}),e==="history"&&h.jsx(NQ,{})]})]})}function mx({active:e,onClick:t,icon:n,label:r}){return h.jsxs("button",{onClick:t,className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors ${e?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:[n,r]})}function _Q({selectedNodes:e,workflow:t}){var n,r,s,o,a,c,u,d,p,m,g,v,b,x,w;if(e.length===0)return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx(Yi,{title:"Workflow",children:t?h.jsxs("div",{className:"space-y-3",children:[h.jsx(fs,{label:"Name",value:((n=t.metadata)==null?void 0:n.name)||"Untitled"}),h.jsx(fs,{label:"Version",value:((r=t.metadata)==null?void 0:r.version)||"1.0.0"}),h.jsx(fs,{label:"Author",value:((s=t.metadata)==null?void 0:s.author)||"Unknown"}),h.jsx(fs,{label:"Steps",value:`${((o=t.steps)==null?void 0:o.length)||0} steps`})]}):h.jsx("div",{className:"text-sm text-gray-500",children:"No workflow loaded"})}),((a=t==null?void 0:t.metadata)==null?void 0:a.description)&&h.jsx(Yi,{title:"Description",children:h.jsx("p",{className:"text-sm text-gray-300",children:t.metadata.description})}),((c=t==null?void 0:t.metadata)==null?void 0:c.tags)&&t.metadata.tags.length>0&&h.jsx(Yi,{title:"Tags",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.metadata.tags.map(S=>h.jsx("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-full",children:S},S))})})]});if(e.length===1){const S=e[0];return h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx(Yi,{title:"Step",children:h.jsxs("div",{className:"space-y-3",children:[h.jsx(fs,{label:"ID",value:((u=S.data)==null?void 0:u.id)||S.id}),h.jsx(fs,{label:"Name",value:((d=S.data)==null?void 0:d.name)||"(unnamed)"}),h.jsx(fs,{label:"Action",value:((p=S.data)==null?void 0:p.action)||((m=S.data)==null?void 0:m.workflowPath)||"-"}),h.jsx(fs,{label:"Status",value:((g=S.data)==null?void 0:g.status)||"pending",badge:!0,badgeColor:((v=S.data)==null?void 0:v.status)==="completed"?"success":((b=S.data)==null?void 0:b.status)==="failed"?"error":((x=S.data)==null?void 0:x.status)==="running"?"warning":"default"})]})}),((w=S.data)==null?void 0:w.error)&&h.jsx(Yi,{title:"Error",children:h.jsx("div",{className:"p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono",children:S.data.error})}),h.jsx(Yi,{title:"Actions",children:h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{className:"flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors",children:"Edit"}),h.jsx("button",{className:"flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors",children:"View YAML"})]})})]})}return h.jsx("div",{className:"p-4",children:h.jsxs("div",{className:"text-sm text-gray-400",children:[e.length," nodes selected"]})})}function kQ(){const e=[{name:"inputs.repo",value:"owner/repo",type:"string"},{name:"inputs.pr_number",value:"123",type:"number"},{name:"pr_details.title",value:"Fix bug",type:"string"},{name:"pr_details.state",value:"open",type:"string"}];return h.jsx("div",{className:"p-4 space-y-2",children:e.map(t=>h.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs font-mono text-primary",children:t.name}),h.jsx("span",{className:"text-xs text-gray-500",children:t.type})]}),h.jsx("div",{className:"text-sm text-gray-300 font-mono truncate",children:t.value})]},t.name))})}function NQ(){const{runs:e,clearHistory:t}=b4(),[n,r]=T.useState(null);return n?h.jsx(CQ,{run:n,onBack:()=>r(null)}):e.length===0?h.jsxs("div",{className:"p-4 text-center",children:[h.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-node-bg flex items-center justify-center",children:h.jsx(jw,{className:"w-6 h-6 text-gray-500"})}),h.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"No execution history"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Run a workflow to see execution history here"})]}):h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map(s=>h.jsxs("button",{onClick:()=>r(s),className:"w-full p-3 bg-node-bg rounded-lg border border-node-border cursor-pointer hover:border-primary transition-colors text-left",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-xs font-medium text-white truncate max-w-[140px]",children:s.workflowName}),h.jsx(S4,{status:s.status})]}),h.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[h.jsx("span",{children:s.duration?nw(s.duration):"-"}),h.jsx("span",{children:bQ(s.startTime)})]}),s.steps.length>0&&h.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[s.steps.slice(0,5).map(o=>h.jsx(jQ,{status:o.status},o.stepId)),s.steps.length>5&&h.jsxs("span",{className:"text-xs text-gray-500",children:["+",s.steps.length-5]})]})]},s.id))}),e.length>0&&h.jsx("div",{className:"p-3 border-t border-node-border",children:h.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-xs text-gray-400 hover:text-error transition-colors",children:[h.jsx(ko,{className:"w-3.5 h-3.5"}),"Clear History"]})})]})}function CQ({run:e,onBack:t}){const[n,r]=T.useState(!1);return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"p-3 border-b border-node-border",children:[h.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-gray-400 hover:text-white mb-2",children:[h.jsx(Jt,{className:"w-3 h-3 rotate-180"}),"Back to history"]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-sm font-medium text-white truncate max-w-[180px]",children:e.workflowName}),h.jsx(S4,{status:e.status})]}),h.jsxs("div",{className:"flex items-center justify-between mt-1 text-xs text-gray-400",children:[h.jsx("span",{children:e.duration?nw(e.duration):"Running..."}),h.jsx("span",{children:new Date(e.startTime).toLocaleString()})]})]}),h.jsxs("div",{className:"flex border-b border-node-border",children:[h.jsxs("button",{onClick:()=>r(!1),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-gray-400 hover:text-white":"text-primary border-b-2 border-primary -mb-px"}`,children:["Steps (",e.steps.length,")"]}),h.jsxs("button",{onClick:()=>r(!0),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:["Logs (",e.logs.length,")"]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?h.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.logs.map((s,o)=>h.jsx("div",{className:"text-gray-300 break-words",children:s},o))}):h.jsx("div",{className:"space-y-2",children:e.steps.map(s=>h.jsxs("div",{className:"p-2 bg-node-bg rounded border border-node-border",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-white truncate",children:s.stepName}),h.jsx(EQ,{status:s.status})]}),s.duration&&h.jsx("div",{className:"text-xs text-gray-500 mt-1",children:nw(s.duration)}),s.error&&h.jsx("div",{className:"mt-2 p-2 bg-error/10 border border-error/20 rounded text-xs text-error",children:s.error})]},s.stepId))})})]})}function S4({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning",icon:ws},completed:{bg:"bg-success/10",text:"text-success",icon:en},failed:{bg:"bg-error/10",text:"text-error",icon:lt},cancelled:{bg:"bg-gray-500/10",text:"text-gray-400",icon:lt},pending:{bg:"bg-gray-500/10",text:"text-gray-400",icon:Hn}},{bg:n,text:r,icon:s}=t[e]||t.pending;return h.jsxs("span",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${n} ${r}`,children:[h.jsx(s,{className:`w-3 h-3 ${e==="running"?"animate-spin":""}`}),e]})}function EQ({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning"},completed:{bg:"bg-success/10",text:"text-success"},failed:{bg:"bg-error/10",text:"text-error"},pending:{bg:"bg-gray-500/10",text:"text-gray-400"}},{bg:n,text:r}=t[e]||t.pending;return h.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n} ${r}`,children:e})}function jQ({status:e}){const t={running:"bg-warning",completed:"bg-success",failed:"bg-error",pending:"bg-gray-500"};return h.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]||t.pending} ${e==="running"?"animate-pulse":""}`,title:e})}function Yi({title:e,children:t}){return h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-2",children:e}),t]})}function fs({label:e,value:t,badge:n,badgeColor:r="default"}){const s={default:"bg-gray-500/10 text-gray-400",success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning"};return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-gray-400",children:e}),n?h.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s[r]}`,children:t}):h.jsx("span",{className:"text-sm text-gray-200 font-mono truncate max-w-[180px]",children:t})]})}const qb=Dr((e,t)=>({isProcessing:!1,history:[],lastError:null,pendingChanges:null,sendPrompt:async n=>{e({isProcessing:!0,lastError:null});const r=Mr.getState().currentWorkflow;try{const s=await fetch("/api/ai/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n,workflow:r})});if(!s.ok)throw new Error("Failed to process prompt");const o=await s.json(),a={prompt:n,response:o.explanation,timestamp:new Date,success:!0};e({history:[a,...t().history].slice(0,20),pendingChanges:o.workflow,isProcessing:!1}),o.workflow&&t().acceptChanges()}catch(s){const o=s instanceof Error?s.message:"Unknown error";e({history:[{prompt:n,response:o,timestamp:new Date,success:!1},...t().history].slice(0,20),lastError:o,isProcessing:!1}),console.log("AI Prompt (demo mode):",n),console.log("Current workflow:",r)}},acceptChanges:()=>{const n=t().pendingChanges;n&&(Mr.getState().saveWorkflow(n),e({pendingChanges:null}))},rejectChanges:()=>{e({pendingChanges:null})},clearHistory:()=>{e({history:[]})}}));function TQ({onSelectPrompt:e}){const[t,n]=T.useState(!1),[r,s]=T.useState(null),[o,a]=T.useState(null),{history:c,clearHistory:u,sendPrompt:d,isProcessing:p}=qb(),m=async b=>{p||await d(b)},g=async(b,x)=>{try{await navigator.clipboard.writeText(b),a(x),setTimeout(()=>a(null),2e3)}catch(w){console.error("Failed to copy:",w)}},v=b=>{const w=new Date().getTime()-new Date(b).getTime();return w<6e4?"Just now":w<36e5?`${Math.floor(w/6e4)}m ago`:w<864e5?`${Math.floor(w/36e5)}h ago`:new Date(b).toLocaleDateString()};return c.length===0?null:h.jsxs("div",{className:"border-t border-node-border",children:[h.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center justify-between px-4 py-2 bg-panel-bg hover:bg-white/5 transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(jw,{className:"w-4 h-4 text-gray-400"}),h.jsx("span",{className:"text-sm text-gray-300",children:"Prompt History"}),h.jsxs("span",{className:"text-xs text-gray-500",children:["(",c.length,")"]})]}),t?h.jsx(gs,{className:"w-4 h-4 text-gray-400"}):h.jsx(Dz,{className:"w-4 h-4 text-gray-400"})]}),t&&h.jsxs("div",{className:"bg-panel-bg",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-node-border",children:[h.jsxs("span",{className:"text-xs text-gray-500",children:[c.filter(b=>b.success).length," successful,"," ",c.filter(b=>!b.success).length," failed"]}),h.jsx(Fe,{variant:"ghost",size:"sm",onClick:u,icon:h.jsx(ko,{className:"w-3 h-3"}),children:"Clear"})]}),h.jsx("div",{className:"max-h-64 overflow-y-auto",children:c.map((b,x)=>{const w=`${x}-${b.timestamp}`,S=r===b;return h.jsxs("div",{className:"border-b border-node-border last:border-b-0",children:[h.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 cursor-pointer transition-colors ${S?"bg-primary/10":"hover:bg-white/5"}`,onClick:()=>s(S?null:b),children:[b.success?h.jsx(en,{className:"w-4 h-4 text-success flex-shrink-0 mt-0.5"}):h.jsx(lt,{className:"w-4 h-4 text-error flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm text-gray-300 line-clamp-2",children:b.prompt}),h.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[h.jsx(Hn,{className:"w-3 h-3 text-gray-500"}),h.jsx("span",{className:"text-xs text-gray-500",children:v(b.timestamp)})]})]}),h.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[h.jsx("button",{onClick:C=>{C.stopPropagation(),g(b.prompt,w)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy prompt",children:o===w?h.jsx(ei,{className:"w-3.5 h-3.5 text-success"}):h.jsx(vo,{className:"w-3.5 h-3.5 text-gray-400"})}),h.jsx("button",{onClick:C=>{C.stopPropagation(),m(b.prompt)},disabled:p,className:"p-1.5 hover:bg-white/10 rounded transition-colors disabled:opacity-50",title:"Re-run prompt",children:h.jsx(l6,{className:`w-3.5 h-3.5 text-gray-400 ${p?"animate-spin":""}`})}),e&&h.jsx("button",{onClick:C=>{C.stopPropagation(),e(b.prompt)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Edit prompt",children:h.jsx("span",{className:"text-xs text-gray-400",children:"Edit"})})]})]}),S&&h.jsx("div",{className:"px-4 pb-3 pl-11",children:h.jsxs("div",{className:"bg-node-bg rounded-lg p-3",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase",children:"Response"}),h.jsx("button",{onClick:()=>g(b.response,`${w}-response`),className:"p-1 hover:bg-white/10 rounded transition-colors",children:o===`${w}-response`?h.jsx(ei,{className:"w-3 h-3 text-success"}):h.jsx(vo,{className:"w-3 h-3 text-gray-400"})})]}),h.jsx("div",{className:`text-xs font-mono ${b.success?"text-gray-300":"text-error"}`,children:b.response||"No response"})]})})]},w)})})]})]})}function AQ(){const[e,t]=T.useState(""),n=T.useRef(null),{isProcessing:r,history:s,sendPrompt:o}=qb(),a=El();T.useEffect(()=>{n.current&&(n.current.style.height="auto",n.current.style.height=`${Math.min(n.current.scrollHeight,200)}px`)},[e]);const c=async()=>{!e.trim()||r||(await o(e),t(""))},u=p=>{p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),c()),p.key==="ArrowUp"&&!e&&s.length>0&&t(s[0].prompt)},d=["Add a Slack notification step","Add error handling with 3 retries","Convert to a sub-workflow","Add a condition to skip if draft"];return h.jsxs("div",{className:"bg-panel-bg",children:[h.jsx(TQ,{onSelectPrompt:t}),!e&&!r&&h.jsx("div",{className:"px-4 py-2 border-t border-node-border/50",children:h.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",children:[h.jsx(d6,{className:"w-4 h-4 text-primary flex-shrink-0"}),d.map(p=>h.jsx("button",{onClick:()=>t(p),className:"px-3 py-1 bg-node-bg border border-node-border rounded-full text-xs text-gray-300 hover:border-primary hover:text-primary transition-colors whitespace-nowrap",children:p},p))]})}),h.jsxs("div",{className:"p-4 flex items-end gap-3 border-t border-node-border",children:[h.jsxs("div",{className:"flex-1 relative",children:[h.jsx("textarea",{ref:n,value:e,onChange:p=>t(p.target.value),onKeyDown:u,placeholder:"Describe the changes you want to make to the workflow...",disabled:r,rows:1,className:"w-full px-4 py-3 bg-node-bg border border-node-border rounded-lg text-sm text-white placeholder-gray-500 focus:outline-none focus:border-primary resize-none disabled:opacity-50"}),r&&h.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:h.jsx(ws,{className:"w-5 h-5 text-primary animate-spin"})})]}),h.jsx("button",{onClick:c,disabled:!e.trim()||r,className:"w-10 h-10 rounded-lg bg-primary hover:bg-primary-dark disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-colors",children:h.jsx(sI,{className:"w-5 h-5 text-white"})})]}),h.jsxs("div",{className:"px-4 pb-2 text-xs text-gray-500",children:["Press ",h.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:a})," +"," ",h.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"Enter"})," to send",s.length>0&&h.jsxs("span",{className:"ml-4",children:[h.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"↑"})," for last prompt"]})]})]})}function RQ({open:e,onOpenChange:t,originalWorkflow:n,modifiedWorkflow:r,explanation:s,onAccept:o,onReject:a}){const[c,u]=T.useState("explanation"),d=n?hd(n,{indent:2}):"",p=r?hd(r,{indent:2}):"",m=()=>{o(),t(!1)},g=()=>{a(),t(!1)};return h.jsxs(Ss,{open:e,onOpenChange:t,title:"Review Changes",description:"The AI has suggested the following changes to your workflow",size:"xl",children:[h.jsxs(uM,{value:c,onValueChange:u,children:[h.jsxs(zw,{children:[h.jsxs(nr,{value:"explanation",children:[h.jsx(Vz,{className:"w-4 h-4 mr-1.5"}),"Explanation"]}),h.jsxs(nr,{value:"diff",children:[h.jsx(Kz,{className:"w-4 h-4 mr-1.5"}),"Side by Side"]}),h.jsxs(nr,{value:"modified",children:[h.jsx(Ew,{className:"w-4 h-4 mr-1.5"}),"Modified YAML"]})]}),h.jsxs("div",{className:"p-4",children:[h.jsx(rr,{value:"explanation",children:h.jsxs("div",{className:"prose prose-invert max-w-none",children:[h.jsx("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:h.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:s})}),r&&h.jsxs("div",{className:"mt-4",children:[h.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Changes Summary"}),h.jsx("ul",{className:"space-y-2",children:IQ(n,r).map((v,b)=>h.jsxs("li",{className:`flex items-start gap-2 text-sm ${v.type==="added"?"text-success":v.type==="removed"?"text-error":"text-warning"}`,children:[h.jsx("span",{className:"flex-shrink-0",children:v.type==="added"?"+":v.type==="removed"?"-":"~"}),h.jsx("span",{children:v.description})]},b))})]})]})}),h.jsx(rr,{value:"diff",children:h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Original"}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"400px",language:"yaml",value:d,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Modified"}),h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"400px",language:"yaml",value:p,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]})]})}),h.jsx(rr,{value:"modified",children:h.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:h.jsx(Ya,{height:"500px",language:"yaml",value:p,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1}})})})]})]}),h.jsxs(ni,{children:[h.jsx(Fe,{variant:"secondary",onClick:g,icon:h.jsx(Cl,{className:"w-4 h-4"}),children:"Reject"}),h.jsx(Fe,{onClick:m,icon:h.jsx(ei,{className:"w-4 h-4"}),children:"Accept Changes"})]})]})}function IQ(e,t){const n=[];if(!e||!t)return n;const r=new Set(e.steps.map(o=>o.id)),s=new Set(t.steps.map(o=>o.id));for(const o of t.steps)r.has(o.id)||n.push({type:"added",description:`Added step "${o.name||o.id}"`});for(const o of e.steps)s.has(o.id)||n.push({type:"removed",description:`Removed step "${o.name||o.id}"`});for(const o of t.steps)if(r.has(o.id)){const a=e.steps.find(c=>c.id===o.id);if(a&&JSON.stringify(a)!==JSON.stringify(o)){const c=[];a.action!==o.action&&c.push("action"),JSON.stringify(a.inputs)!==JSON.stringify(o.inputs)&&c.push("inputs"),JSON.stringify(a.errorHandling)!==JSON.stringify(o.errorHandling)&&c.push("error handling"),JSON.stringify(a.conditions)!==JSON.stringify(o.conditions)&&c.push("conditions"),c.length>0&&n.push({type:"modified",description:`Modified "${o.name||o.id}": ${c.join(", ")}`})}}return e.metadata.name!==t.metadata.name&&n.push({type:"modified",description:`Renamed workflow to "${t.metadata.name}"`}),n}const Er={WORKFLOW_UPDATED:"workflow:updated",EXECUTION_STEP:"execution:step",EXECUTION_COMPLETED:"execution:completed",AI_PROCESSING:"ai:processing",AI_RESPONSE:"ai:response",WORKFLOW_SUBSCRIBE:"workflow:subscribe",WORKFLOW_UNSUBSCRIBE:"workflow:unsubscribe",EXECUTION_SUBSCRIBE:"execution:subscribe",EXECUTION_UNSUBSCRIBE:"execution:unsubscribe"},Au={slack:{name:"Slack",icon:"slack",methods:["chat.postMessage","chat.update","chat.delete","conversations.list","conversations.create","files.upload","users.info"]},github:{name:"GitHub",icon:"github",methods:["pulls.get","pulls.list","pulls.create","pulls.createReview","pulls.listFiles","issues.get","issues.create","issues.createComment","repos.getContent","search.code"]},jira:{name:"Jira",icon:"jira",methods:["issues.getIssue","issues.createIssue","issues.editIssue","issues.search","issues.addComment","issues.transition"]},gmail:{name:"Gmail",icon:"gmail",methods:["messages.list","messages.get","messages.send","drafts.create","labels.list"]},outlook:{name:"Outlook",icon:"outlook",methods:["messages.list","messages.get","messages.send","calendar.events.list","calendar.events.create"]},linear:{name:"Linear",icon:"linear",methods:["issues.get","issues.create","issues.update","issues.search","projects.list"]},notion:{name:"Notion",icon:"notion",methods:["pages.get","pages.create","pages.update","databases.query","search"]},discord:{name:"Discord",icon:"discord",methods:["messages.send","messages.edit","messages.delete","channels.get","webhooks.execute"]},airtable:{name:"Airtable",icon:"airtable",methods:["records.list","records.get","records.create","records.update","records.delete"]},confluence:{name:"Confluence",icon:"confluence",methods:["pages.list","pages.get","pages.create","pages.update","search"]},http:{name:"HTTP",icon:"http",methods:["request","get","post","put","patch","delete"]},claude:{name:"Claude",icon:"claude",methods:["analyze","generate","summarize","chat"]},opencode:{name:"OpenCode",icon:"opencode",methods:["chat","complete","analyze"]},ollama:{name:"Ollama",icon:"ollama",methods:["generate","chat","embeddings"]}};function MQ({open:e,onOpenChange:t,onCreateStep:n,position:r}){var L,B;const[s,o]=T.useState("select-type"),[a,c]=T.useState(""),[u,d]=T.useState("action"),[p,m]=T.useState(null),[g,v]=T.useState(null),[b,x]=T.useState({id:"",name:""}),w=()=>{o("select-type"),c(""),d("action"),m(null),v(null),x({id:"",name:""})},S=()=>{w(),t(!1)},C=M=>{d(M),o(M==="action"?"select-service":"configure")},k=M=>{m(M),o("select-method")},N=M=>{v(M);const $=Au[p];x({id:`${p}-${Date.now()}`,name:`${($==null?void 0:$.name)||p} - ${M}`}),o("configure")},j=()=>{const M={id:b.id||`step-${Date.now()}`,name:b.name||void 0,inputs:{}};u==="action"&&p&&g&&(M.action=`${p}.${g}`),n(M),S()},A=Object.entries(Au).filter(([M,$])=>$.name.toLowerCase().includes(a.toLowerCase())||M.toLowerCase().includes(a.toLowerCase())),O=(p?((L=Au[p])==null?void 0:L.methods)||[]:[]).filter(M=>M.toLowerCase().includes(a.toLowerCase()));return h.jsxs(Ss,{open:e,onOpenChange:S,title:"Add New Step",description:OQ(s),size:"lg",children:[h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[h.jsx("button",{onClick:()=>o("select-type"),className:`${s==="select-type"?"text-primary":"text-gray-400 hover:text-white"}`,children:"Type"}),u==="action"&&h.jsxs(h.Fragment,{children:[h.jsx(Jt,{className:"w-4 h-4 text-gray-600"}),h.jsx("button",{onClick:()=>p&&o("select-service"),className:`${s==="select-service"?"text-primary":p?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!p,children:"Service"}),h.jsx(Jt,{className:"w-4 h-4 text-gray-600"}),h.jsx("button",{onClick:()=>g&&o("select-method"),className:`${s==="select-method"?"text-primary":g?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!g,children:"Method"})]}),h.jsx(Jt,{className:"w-4 h-4 text-gray-600"}),h.jsx("span",{className:`${s==="configure"?"text-primary":"text-gray-600"}`,children:"Configure"})]}),s==="select-type"&&h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("button",{onClick:()=>C("action"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[h.jsx(ld,{className:"w-8 h-8 text-primary mb-3"}),h.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Action Step"}),h.jsx("p",{className:"text-sm text-gray-400",children:"Execute an action using a service SDK (Slack, GitHub, etc.)"})]}),h.jsxs("button",{onClick:()=>C("subworkflow"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-info transition-colors text-left",children:[h.jsx(ad,{className:"w-8 h-8 text-info mb-3"}),h.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Sub-workflow"}),h.jsx("p",{className:"text-sm text-gray-400",children:"Reference another workflow file for modular composition"})]})]}),s==="select-service"&&h.jsxs("div",{children:[h.jsxs("div",{className:"relative mb-4",children:[h.jsx($x,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),h.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search services...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),h.jsx("div",{className:"grid grid-cols-3 gap-3 max-h-[400px] overflow-y-auto",children:A.map(([M,$])=>{const U=qx(M);return h.jsxs("button",{onClick:()=>k(M),className:"flex flex-col items-center gap-2 p-4 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors",children:[h.jsx(U,{className:"w-8 h-8 text-primary"}),h.jsx("span",{className:"text-sm text-white",children:$.name})]},M)})})]}),s==="select-method"&&p&&h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[(()=>{const M=qx(p);return h.jsx(M,{className:"w-6 h-6 text-primary"})})(),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-white",children:(B=Au[p])==null?void 0:B.name}),h.jsx("div",{className:"text-xs text-gray-400",children:"Select a method"})]})]}),h.jsxs("div",{className:"relative mb-4",children:[h.jsx($x,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),h.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search methods...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),h.jsx("div",{className:"space-y-2 max-h-[350px] overflow-y-auto",children:O.map(M=>h.jsxs("button",{onClick:()=>N(M),className:"w-full flex items-center justify-between px-4 py-3 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[h.jsx("span",{className:"text-sm font-mono text-white",children:M}),h.jsx(Jt,{className:"w-4 h-4 text-gray-500"})]},M))})]}),s==="configure"&&h.jsxs("div",{className:"space-y-4",children:[u==="action"&&p&&g&&h.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[h.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Action"}),h.jsxs("div",{className:"text-sm font-mono text-primary",children:[p,".",g]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step ID"}),h.jsx("input",{type:"text",value:b.id,onChange:M=>x($=>({...$,id:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"unique-step-id"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name (optional)"}),h.jsx("input",{type:"text",value:b.name,onChange:M=>x($=>({...$,name:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),r&&h.jsx("div",{className:"text-xs text-gray-500",children:r.afterStepId?`Will be inserted after "${r.afterStepId}"`:r.beforeStepId?`Will be inserted before "${r.beforeStepId}"`:"Will be added at the end"})]})]}),h.jsxs(ni,{children:[s!=="select-type"&&h.jsx(Fe,{variant:"ghost",onClick:()=>{s==="select-service"?o("select-type"):s==="select-method"?o("select-service"):s==="configure"&&o(u==="action"?"select-method":"select-type"),c("")},children:"Back"}),h.jsx(Fe,{variant:"secondary",onClick:S,children:"Cancel"}),s==="configure"&&h.jsx(Fe,{onClick:j,disabled:!b.id,children:"Create Step"})]})]})}function OQ(e){switch(e){case"select-type":return"Choose what type of step to add";case"select-service":return"Select a service to use";case"select-method":return"Choose the method to call";case"configure":return"Configure your new step";default:return""}}const rA=[{keys:["⌘","S"],description:"Save workflow",category:"General"},{keys:["⌘","Z"],description:"Undo",category:"General"},{keys:["⌘","⇧","Z"],description:"Redo",category:"General"},{keys:["⌘","?"],description:"Show keyboard shortcuts",category:"General"},{keys:["N"],description:"Add new step",category:"Canvas"},{keys:["⌘","L"],description:"Auto-layout canvas",category:"Canvas"},{keys:["⌘","0"],description:"Fit view",category:"Canvas"},{keys:["⌘","+"],description:"Zoom in",category:"Canvas"},{keys:["⌘","-"],description:"Zoom out",category:"Canvas"},{keys:["⌫"],description:"Delete selected",category:"Canvas"},{keys:["⌘","D"],description:"Duplicate selected",category:"Canvas"},{keys:["Double-click"],description:"Edit step",category:"Editing"},{keys:["E"],description:"Edit selected step",category:"Editing"},{keys:["Y"],description:"View YAML",category:"Editing"},{keys:["Escape"],description:"Close modal / deselect",category:"Editing"},{keys:["⌘","←"],description:"Back to parent workflow",category:"Navigation"},{keys:["⌘","↑"],description:"Go to root workflow",category:"Navigation"},{keys:["⌘","↵"],description:"Execute workflow",category:"Execution"},{keys:["F9"],description:"Toggle debug mode",category:"Debugging"},{keys:["F5"],description:"Continue execution",category:"Debugging"},{keys:["F10"],description:"Step over",category:"Debugging"},{keys:["F11"],description:"Step into",category:"Debugging"},{keys:["⇧","F11"],description:"Step out",category:"Debugging"}];function PQ({open:e,onOpenChange:t}){const n=[...new Set(rA.map(s=>s.category))],r=El();return h.jsxs(Ss,{open:e,onOpenChange:t,title:"Keyboard Shortcuts",description:"Quick reference for all keyboard shortcuts",size:"md",children:[h.jsx("div",{className:"p-4 space-y-6 max-h-[60vh] overflow-y-auto",children:n.map(s=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider mb-3",children:s}),h.jsx("div",{className:"space-y-2",children:rA.filter(o=>o.category===s).map((o,a)=>h.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-node-border last:border-0",children:[h.jsx("span",{className:"text-sm text-gray-300",children:o.description}),h.jsx("div",{className:"flex items-center gap-1",children:o.keys.map((c,u)=>h.jsx("kbd",{className:"px-2 py-1 bg-node-bg border border-node-border rounded text-xs font-mono text-gray-300",children:c==="⌘"?r:c},u))})]},a))})]},s))}),h.jsx(ni,{children:h.jsx(Fe,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function LQ(){const[e,t]=T.useState(!1);return T.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="/"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),{isOpen:e,setIsOpen:t,openShortcuts:()=>t(!0)}}function DQ({onClick:e}){const t=El();return h.jsxs("button",{onClick:e,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-gray-500 hover:text-gray-300 transition-colors",title:`Keyboard shortcuts (${t}/)`,children:[h.jsx(Qz,{className:"w-3.5 h-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"Shortcuts"})]})}function gx(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function yx(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?(t.classList.add("dark"),t.classList.remove("light")):(t.classList.add("light"),t.classList.remove("dark"))}const _4=Dr()(w4((e,t)=>({theme:"dark",resolvedTheme:"dark",setTheme:n=>{const r=n==="system"?gx():n;yx(r),e({theme:n,resolvedTheme:r})},toggleTheme:()=>{const{theme:n}=t(),r=n==="dark"?"light":"dark",s=r==="system"?gx():r;yx(s),e({theme:r,resolvedTheme:s})}}),{name:"marktoflow-theme",onRehydrateStorage:()=>e=>{if(e){const t=e.theme==="system"?gx():e.theme;yx(t),e.resolvedTheme=t}}}));typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{const{theme:t,setTheme:n}=_4.getState();t==="system"&&n("system")});function $Q({showLabel:e=!1}){const{theme:t,toggleTheme:n}=_4();return h.jsxs("button",{onClick:n,className:"flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-white/10 dark:hover:bg-white/10 light:hover:bg-black/5 transition-colors",title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[t==="dark"?h.jsx(r6,{className:"w-4 h-4 text-gray-400"}):h.jsx(p6,{className:"w-4 h-4 text-yellow-500"}),e&&h.jsx("span",{className:"text-xs text-gray-400",children:t==="dark"?"Dark":"Light"})]})}function qQ({items:e,onNavigate:t}){return e.length<=1?null:h.jsx("nav",{className:"flex items-center gap-1 px-4 py-2 bg-panel-bg border-b border-node-border",children:e.map((n,r)=>h.jsxs("div",{className:"flex items-center",children:[r>0&&h.jsx(Jt,{className:"w-4 h-4 text-gray-600 mx-1"}),h.jsxs("button",{onClick:()=>t(n,r),className:`flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors ${r===e.length-1?"text-white font-medium cursor-default":"text-gray-400 hover:text-white hover:bg-white/5"}`,disabled:r===e.length-1,children:[r===0&&h.jsx(Xz,{className:"w-3.5 h-3.5"}),h.jsx("span",{className:"max-w-[150px] truncate",children:n.name})]})]},n.id))})}const hr=Object.create(null);hr.open="0";hr.close="1";hr.ping="2";hr.pong="3";hr.message="4";hr.upgrade="5";hr.noop="6";const Hu=Object.create(null);Object.keys(hr).forEach(e=>{Hu[hr[e]]=e});const rw={type:"error",data:"parser error"},k4=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",N4=typeof ArrayBuffer=="function",C4=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Fb=({type:e,data:t},n,r)=>k4&&t instanceof Blob?n?r(t):sA(t,r):N4&&(t instanceof ArrayBuffer||C4(t))?n?r(t):sA(new Blob([t]),r):r(hr[e]+(t||"")),sA=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function iA(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let vx;function FQ(e,t){if(k4&&e.data instanceof Blob)return e.data.arrayBuffer().then(iA).then(t);if(N4&&(e.data instanceof ArrayBuffer||C4(e.data)))return t(iA(e.data));Fb(e,!1,n=>{vx||(vx=new TextEncoder),t(vx.encode(n))})}const oA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ua=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<oA.length;e++)Ua[oA.charCodeAt(e)]=e;const BQ=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,c,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),p=new Uint8Array(d);for(r=0;r<n;r+=4)o=Ua[e.charCodeAt(r)],a=Ua[e.charCodeAt(r+1)],c=Ua[e.charCodeAt(r+2)],u=Ua[e.charCodeAt(r+3)],p[s++]=o<<2|a>>4,p[s++]=(a&15)<<4|c>>2,p[s++]=(c&3)<<6|u&63;return d},zQ=typeof ArrayBuffer=="function",Bb=(e,t)=>{if(typeof e!="string")return{type:"message",data:E4(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:VQ(e.substring(1),t)}:Hu[n]?e.length>1?{type:Hu[n],data:e.substring(1)}:{type:Hu[n]}:rw},VQ=(e,t)=>{if(zQ){const n=BQ(e);return E4(n,t)}else return{base64:!0,data:e}},E4=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},j4="",UQ=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{Fb(o,!1,c=>{r[a]=c,++s===n&&t(r.join(j4))})})},HQ=(e,t)=>{const n=e.split(j4),r=[];for(let s=0;s<n.length;s++){const o=Bb(n[s],t);if(r.push(o),o.type==="error")break}return r};function WQ(){return new TransformStream({transform(e,t){FQ(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let xx;function Ru(e){return e.reduce((t,n)=>t+n.length,0)}function Iu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function KQ(e,t){xx||(xx=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(Ru(n)<1)break;const u=Iu(n,1);o=(u[0]&128)===128,s=u[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Ru(n)<2)break;const u=Iu(n,2);s=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Ru(n)<8)break;const u=Iu(n,8),d=new DataView(u.buffer,u.byteOffset,u.length),p=d.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(rw);break}s=p*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Ru(n)<s)break;const u=Iu(n,s);c.enqueue(Bb(o?u:xx.decode(u),t)),r=0}if(s===0||s>e){c.enqueue(rw);break}}}})}const T4=4;function mt(e){if(e)return GQ(e)}function GQ(e){for(var t in mt.prototype)e[t]=mt.prototype[t];return e}mt.prototype.on=mt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};mt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};mt.prototype.off=mt.prototype.removeListener=mt.prototype.removeAllListeners=mt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};mt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};mt.prototype.emitReserved=mt.prototype.emit;mt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};mt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const bf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),bn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),YQ="arraybuffer";function A4(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const XQ=bn.setTimeout,QQ=bn.clearTimeout;function Sf(e,t){t.useNativeTimers?(e.setTimeoutFn=XQ.bind(bn),e.clearTimeoutFn=QQ.bind(bn)):(e.setTimeoutFn=bn.setTimeout.bind(bn),e.clearTimeoutFn=bn.clearTimeout.bind(bn))}const JQ=1.33;function ZQ(e){return typeof e=="string"?eJ(e):Math.ceil((e.byteLength||e.size)*JQ)}function eJ(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function R4(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function tJ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function nJ(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class rJ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class zb extends mt{constructor(t){super(),this.writable=!1,Sf(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new rJ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Bb(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=tJ(t);return n.length?"?"+n:""}}class sJ extends zb{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};HQ(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,UQ(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=R4()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let I4=!1;try{I4=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const iJ=I4;function oJ(){}class aJ extends sJ{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class lr extends mt{constructor(t,n,r){super(),this.createRequest=t,Sf(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=A4(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=lr.requestsCount++,lr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=oJ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete lr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}lr.requestsCount=0;lr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",aA);else if(typeof addEventListener=="function"){const e="onpagehide"in bn?"pagehide":"unload";addEventListener(e,aA,!1)}}function aA(){for(let e in lr.requests)lr.requests.hasOwnProperty(e)&&lr.requests[e].abort()}const lJ=(function(){const e=M4({xdomain:!1});return e&&e.responseType!==null})();class cJ extends aJ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=lJ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new lr(M4,this.uri(),t)}}function M4(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||iJ))return new XMLHttpRequest}catch{}if(!t)try{return new bn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const O4=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class uJ extends zb{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=O4?{}:A4(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Fb(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&bf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=R4()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const wx=bn.WebSocket||bn.MozWebSocket;class dJ extends uJ{createSocket(t,n,r){return O4?new wx(t,n,r):n?new wx(t,n):new wx(t)}doWrite(t,n){this.ws.send(n)}}class fJ extends zb{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=KQ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=WQ();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:c,value:u})=>{c||(this.onPacket(u),o())}).catch(c=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&bf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const hJ={websocket:dJ,webtransport:fJ,polling:cJ},pJ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mJ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function sw(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=pJ.exec(e||""),o={},a=14;for(;a--;)o[mJ[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=gJ(o,o.path),o.queryKey=yJ(o,o.query),o}function gJ(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function yJ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const iw=typeof addEventListener=="function"&&typeof removeEventListener=="function",Wu=[];iw&&addEventListener("offline",()=>{Wu.forEach(e=>e())},!1);class xs extends mt{constructor(t,n){if(super(),this.binaryType=YQ,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=sw(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=sw(n.host).host);Sf(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=nJ(this.opts.query)),iw&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Wu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=T4,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&xs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",xs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=ZQ(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,bf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(xs.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),iw&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Wu.indexOf(this._offlineEventListener);r!==-1&&Wu.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}xs.protocol=T4;class vJ extends xs{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;xs.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",m=>{if(!r)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;xs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,p(),n.close(),n=null)}const a=m=>{const g=new Error("probe error: "+m);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function c(){a("transport closed")}function u(){a("socket closed")}function d(m){n&&m.name!==n.name&&o()}const p=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",c),this.off("close",u),this.off("upgrading",d)};n.once("open",s),n.once("error",a),n.once("close",c),this.once("close",u),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let xJ=class extends vJ{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>hJ[s]).filter(s=>!!s)),super(t,r)}};function wJ(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=sw(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const bJ=typeof ArrayBuffer=="function",SJ=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,P4=Object.prototype.toString,_J=typeof Blob=="function"||typeof Blob<"u"&&P4.call(Blob)==="[object BlobConstructor]",kJ=typeof File=="function"||typeof File<"u"&&P4.call(File)==="[object FileConstructor]";function Vb(e){return bJ&&(e instanceof ArrayBuffer||SJ(e))||_J&&e instanceof Blob||kJ&&e instanceof File}function Ku(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ku(e[n]))return!0;return!1}if(Vb(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ku(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ku(e[n]))return!0;return!1}function NJ(e){const t=[],n=e.data,r=e;return r.data=ow(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ow(e,t){if(!e)return e;if(Vb(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ow(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ow(e[r],t));return n}return e}function CJ(e,t){return e.data=aw(e.data,t),delete e.attachments,e}function aw(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=aw(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=aw(e[n],t));return e}const EJ=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Pe;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Pe||(Pe={}));class jJ{constructor(t){this.replacer=t}encode(t){return(t.type===Pe.EVENT||t.type===Pe.ACK)&&Ku(t)?this.encodeAsBinary({type:t.type===Pe.EVENT?Pe.BINARY_EVENT:Pe.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Pe.BINARY_EVENT||t.type===Pe.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NJ(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class Ub extends mt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Pe.BINARY_EVENT;r||n.type===Pe.BINARY_ACK?(n.type=r?Pe.EVENT:Pe.ACK,this.reconstructor=new TJ(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Vb(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Pe[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Pe.BINARY_EVENT||r.type===Pe.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Ub.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Pe.CONNECT:return lA(n);case Pe.DISCONNECT:return n===void 0;case Pe.CONNECT_ERROR:return typeof n=="string"||lA(n);case Pe.EVENT:case Pe.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&EJ.indexOf(n[0])===-1);case Pe.ACK:case Pe.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class TJ{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=CJ(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function lA(e){return Object.prototype.toString.call(e)==="[object Object]"}const AJ=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ub,Encoder:jJ,get PacketType(){return Pe}},Symbol.toStringTag,{value:"Module"}));function Dn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const RJ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class L4 extends mt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Dn(t,"open",this.onopen.bind(this)),Dn(t,"packet",this.onpacket.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(RJ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Pe.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const p=this.ids++,m=n.pop();this._registerAckCallback(p,m),a.id=p}const c=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,u=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!c||(u?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},s),a=(...c)=>{this.io.clearTimeoutFn(o),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,c)=>a?s(a):r(c);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Pe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Pe.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Pe.EVENT:case Pe.BINARY_EVENT:this.onevent(t);break;case Pe.ACK:case Pe.BINARY_ACK:this.onack(t);break;case Pe.DISCONNECT:this.ondisconnect();break;case Pe.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:Pe.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Pe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Do(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Do.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Do.prototype.reset=function(){this.attempts=0};Do.prototype.setMin=function(e){this.ms=e};Do.prototype.setMax=function(e){this.max=e};Do.prototype.setJitter=function(e){this.jitter=e};class lw extends mt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Sf(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Do({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||AJ;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new xJ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Dn(n,"open",function(){r.onopen(),t&&t()}),o=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=Dn(n,"error",o);if(this._timeout!==!1){const c=this._timeout,u=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},c);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Dn(t,"ping",this.onping.bind(this)),Dn(t,"data",this.ondata.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this)),Dn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){bf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new L4(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ma={};function Gu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=wJ(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=Ma[s]&&o in Ma[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let u;return c?u=new lw(r,t):(Ma[s]||(Ma[s]=new lw(r,t)),u=Ma[s]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(Gu,{Manager:lw,Socket:L4,io:Gu,connect:Gu});function D4(e={}){const{autoConnect:t=!0,onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}=e,c=T.useRef(null),[u,d]=T.useState(!1),p=T.useRef({onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a});T.useEffect(()=>{p.current={onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}},[n,r,s,o,a]);const m=T.useCallback(()=>{var C;if((C=c.current)!=null&&C.connected)return;const S=Gu({transports:["websocket"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});S.on("connect",()=>{console.log("WebSocket connected"),d(!0)}),S.on("disconnect",()=>{console.log("WebSocket disconnected"),d(!1)}),S.on("connect_error",k=>{console.error("WebSocket connection error:",k),d(!1)}),S.on(Er.WORKFLOW_UPDATED,k=>{var N,j;(j=(N=p.current).onWorkflowUpdated)==null||j.call(N,k)}),S.on(Er.EXECUTION_STEP,k=>{var N,j;(j=(N=p.current).onExecutionStep)==null||j.call(N,k)}),S.on(Er.EXECUTION_COMPLETED,k=>{var N,j;(j=(N=p.current).onExecutionCompleted)==null||j.call(N,k)}),S.on(Er.AI_PROCESSING,({processing:k})=>{var N,j;(j=(N=p.current).onAIProcessing)==null||j.call(N,k)}),S.on(Er.AI_RESPONSE,k=>{var N,j;(j=(N=p.current).onAIResponse)==null||j.call(N,k)}),c.current=S},[]),g=T.useCallback(()=>{c.current&&(c.current.disconnect(),c.current=null,d(!1))},[]),v=T.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.WORKFLOW_SUBSCRIBE,S)},[]),b=T.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.WORKFLOW_UNSUBSCRIBE,S)},[]),x=T.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.EXECUTION_SUBSCRIBE,S)},[]),w=T.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.EXECUTION_UNSUBSCRIBE,S)},[]);return T.useEffect(()=>(t&&m(),()=>{g()}),[t,m,g]),{connected:u,socket:c.current,subscribeToWorkflow:v,unsubscribeFromWorkflow:b,subscribeToExecution:x,unsubscribeFromExecution:w,connect:m,disconnect:g}}function IJ(e){if(!e)return[];const t=[],n=/```yaml\s*\n([\s\S]*?)\n```/g;let r,s=0;for(;(r=n.exec(e))!==null;){const o=r[1],a=o.match(/^type:\s*(while|for_each|for|switch|parallel|try|if|map|filter|reduce)/m);if(a){const c=a[1],u=`control-flow-${c}-${s++}`,d=o.match(/condition:\s*["'](.+?)["']/),p=o.match(/items:\s*["'](.+?)["']/),m=o.match(/max_iterations:\s*(\d+)/),g=o.match(/expression:\s*["'](.+?)["']/),v=o.match(/item_variable:\s*(\w+)/),b=o.match(/expression:\s*["'](.+?)["']/),x={},w=o.match(/variables:\s*\n((?: .*\n)*)/);if(w){const C=w[1];C.split(`
|
|
703
|
+
`).filter(Boolean).forEach(N=>{const j=N.match(/^\s+(\w+):\s*$/);if(j){const A=j[1],R=C.match(new RegExp(`${A}:\\s*\\n\\s+initial:\\s*(.+)`));if(R)try{x[A]={initial:JSON.parse(R[1])}}catch{x[A]={initial:R[1].trim()}}}})}const S={id:u,type:c,name:c==="map"?"Map Transform":c==="filter"?"Filter Transform":c==="reduce"?"Reduce Transform":c==="switch"?"Switch/Case":c==="parallel"?"Parallel Execution":c==="try"?"Try/Catch":c==="if"?"If/Else":`${c.charAt(0).toUpperCase()+c.slice(1)} Loop`,inputs:{}};d&&(S.condition=d[1]),p&&(S.items=p[1]),m&&(S.maxIterations=parseInt(m[1],10)),Object.keys(x).length>0&&(S.variables=x),(c==="map"||c==="filter"||c==="reduce")&&(v&&(S.inputs={...S.inputs,itemVariable:v[1]}),g&&(S.inputs={...S.inputs,expression:g[1]})),c==="switch"&&b&&(S.inputs={...S.inputs,expression:b[1]}),t.push(S)}}return t}function MJ(e){const t=[],n=[];let o=0;const a=IJ(e.markdown),c=[...e.steps,...a];if(e.triggers&&e.triggers.length>0){const d=e.triggers[0],p=`trigger-${e.metadata.id}`;t.push({id:p,type:"trigger",position:{x:250,y:o},data:{id:p,name:e.metadata.name,type:d.type||"manual",cron:d.cron,path:d.path,events:d.events,active:!0}}),o+=180,c.length>0&&n.push({id:`e-${p}-${c[0].id}`,source:p,target:c[0].id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}})}if(c.forEach((d,p)=>{var S,C,k,N;const m=!!d.workflow,g=!!d.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(d.type);let v="step";m?v="subworkflow":g&&(v=d.type);const b={id:d.id,name:d.name,action:d.action,workflowPath:d.workflow,status:"pending"};let x={...b};d.type==="while"?x={...b,condition:d.condition||"true",maxIterations:d.maxIterations||100,variables:d.variables}:d.type==="for_each"||d.type==="for"?x={...b,items:d.items||"[]",itemVariable:(S=d.inputs)==null?void 0:S.itemVariable}:d.type==="switch"?x={...b,expression:((C=d.inputs)==null?void 0:C.expression)||d.condition||"",cases:{},hasDefault:!0}:d.type==="parallel"?x={...b,branches:[],maxConcurrent:0}:d.type==="try"?x={...b,hasCatch:!0,hasFinally:!1}:d.type==="if"?x={...b,condition:d.condition||"true",hasElse:!0}:d.type==="map"||d.type==="filter"||d.type==="reduce"?x={...b,transformType:d.type,items:d.items||"[]",itemVariable:(k=d.inputs)==null?void 0:k.itemVariable,expression:(N=d.inputs)==null?void 0:N.expression,condition:d.condition}:x={...b,condition:d.condition,items:d.items,maxIterations:d.maxIterations,variables:d.variables};const w={id:d.id,type:v,position:{x:250,y:o+p*180},data:x};if(t.push(w),p<c.length-1){const j=c[p+1],A={id:`e-${d.id}-${j.id}`,source:d.id,target:j.id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}};j.conditions&&j.conditions.length>0&&(A.label="conditional",A.labelStyle={fill:"#a0a0c0",fontSize:10},A.labelBgStyle={fill:"#232340"}),n.push(A)}if(d.type==="while"||d.type==="for_each"||d.type==="for"){const j=d.type==="while"?"#fb923c":"#f093fb";n.push({id:`e-${d.id}-loop-back`,source:d.id,target:d.id,sourceHandle:"loop-back",type:"smoothstep",animated:!0,style:{stroke:j,strokeWidth:2,strokeDasharray:"5,5"},label:d.type==="while"?"while true":"for each item",labelStyle:{fill:j,fontSize:9},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.9}})}if(d.type==="map"||d.type==="filter"||d.type==="reduce"){const j="#14b8a6",A=d.type==="map"?"transform each":d.type==="filter"?"test each":"accumulate";n.push({id:`e-${d.id}-transform-flow`,source:d.id,target:d.id,sourceHandle:"loop-back",type:"smoothstep",animated:!0,style:{stroke:j,strokeWidth:1.5,strokeDasharray:"3,3"},label:A,labelStyle:{fill:j,fontSize:8},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.9}})}}),c.length>0){const d=`output-${e.metadata.id}`,p=c[c.length-1],m=o+c.length*180,g=c.filter(v=>v.outputVariable).map(v=>v.outputVariable);t.push({id:d,type:"output",position:{x:250,y:m},data:{id:d,name:"Workflow Output",variables:g,status:"pending"}}),n.push({id:`e-${p.id}-${d}`,source:p.id,target:d,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}})}const u=OJ(c);return n.push(...u),{nodes:t,edges:n}}function OJ(e){const t=[],n=new Map;return e.forEach(r=>{r.outputVariable&&n.set(r.outputVariable,r.id)}),e.forEach(r=>{PJ(r.inputs).forEach(o=>{const a=o.split(".")[0],c=n.get(a);if(c&&c!==r.id){const u=`data-${c}-${r.id}-${a}`;t.find(d=>d.id===u)||t.push({id:u,source:c,target:r.id,type:"smoothstep",animated:!0,style:{stroke:"#5bc0de",strokeWidth:1,strokeDasharray:"5,5"},label:a,labelStyle:{fill:"#5bc0de",fontSize:9},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}})}})}),t}function PJ(e){const t=[],n=/\{\{\s*([^}]+)\s*\}\}/g;function r(s){if(typeof s=="string"){let o;for(;(o=n.exec(s))!==null;){const c=o[1].trim().split(".")[0].replace(/\[.*\]/,"");c!=="inputs"&&!t.includes(c)&&t.push(c)}}else Array.isArray(s)?s.forEach(r):s&&typeof s=="object"&&Object.values(s).forEach(r)}return Object.values(e).forEach(r),t}function LJ(){const{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,loadWorkflows:o,selectWorkflow:a,loadWorkflow:c,saveWorkflow:u,createWorkflow:d,deleteWorkflow:p}=Mr(),{setNodes:m,setEdges:g}=xo(),{subscribeToWorkflow:v,unsubscribeFromWorkflow:b,connected:x}=D4({onWorkflowUpdated:j=>{j.path===t&&c(j.path),(j.event==="add"||j.event==="remove")&&o()}});T.useEffect(()=>{o()},[o]),T.useEffect(()=>{if(x&&t)return v(t),()=>{b(t)}},[x,t,v,b]),T.useEffect(()=>{if(n){const{nodes:j,edges:A}=MJ(n);m(j),g(A)}},[n,m,g]);const w=T.useCallback(j=>{a(j)},[a]),S=T.useCallback(async j=>{j&&await u(j)},[u]),C=T.useCallback(async j=>{await d(j)},[d]),k=T.useCallback(async j=>{await p(j)},[p]),N=T.useCallback(j=>{if(!n)return[];const A=[];if(n.inputs)for(const R of Object.keys(n.inputs))A.push(`inputs.${R}`);for(let R=0;R<j&&R<n.steps.length;R++){const O=n.steps[R];O.outputVariable&&A.push(O.outputVariable)}return A},[n]);return{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,selectWorkflow:w,saveWorkflow:S,createWorkflow:C,deleteWorkflow:k,refreshWorkflows:o,getAvailableVariables:N}}function DJ(){const{currentWorkflow:e,selectedWorkflow:t,saveWorkflow:n,refreshWorkflows:r}=LJ(),{isNewStepOpen:s,newStepPosition:o,openNewStepWizard:a,closeNewStepWizard:c}=v4(),{pendingChanges:u,acceptChanges:d,rejectChanges:p}=qb(),{isOpen:m,setIsOpen:g,openShortcuts:v}=LQ(),{breadcrumbs:b,popToIndex:x,resetNavigation:w}=Tw(),{loadWorkflow:S}=Mr(),C=T.useCallback((Ie,be)=>{x(be),S(Ie.path||"")},[x,S]),{connected:k}=D4({onWorkflowUpdated:()=>{r()}}),{isExecuting:N,isPaused:j,currentRunId:A,runs:R,startExecution:O,updateStepStatus:L,completeExecution:B,addLog:M,pauseExecution:$,resumeExecution:U,cancelExecution:D,debug:V,enableDebugMode:z,disableDebugMode:Q,toggleBreakpoint:F,clearAllBreakpoints:q,stepOver:G,stepInto:P,stepOut:W,addWatchExpression:oe,removeWatchExpression:K}=b4(),{breakpoint:J,setBreakpoint:te,sidebarOpen:Y,setSidebarOpen:ee,propertiesPanelOpen:ie,setPropertiesPanelOpen:ue}=$b();T.useEffect(()=>{const Ie=()=>{const be=mQ(window.innerWidth);be!==J&&te(be)};return Ie(),window.addEventListener("resize",Ie),()=>window.removeEventListener("resize",Ie)},[J,te]);const[me,ye]=T.useState("pending"),[pe,_e]=T.useState([]),[xe,Ce]=T.useState([]),[Ne,tt]=T.useState(null),Le=T.useRef(null),vt=T.useCallback(()=>{a()},[a]),xt=T.useCallback(Ie=>{if(!e)return;const be={...e,steps:[...e.steps,Ie]};n(be),console.log("Created step:",Ie)},[e,n]),it=T.useCallback(()=>{var ot;if(N){Le.current&&D(Le.current),ye("cancelled"),Ce(Ve=>[...Ve,"Execution cancelled by user"]);return}if(!e)return;const Ie=((ot=e.metadata)==null?void 0:ot.name)||"Untitled Workflow",be=O(t||"unknown",Ie);Le.current=be,ye("running"),tt(null),Ce(["Starting workflow execution..."]),_e(e.steps.map(Ve=>({stepId:Ve.id,stepName:Ve.name||Ve.id,status:"pending"}))),We(e.steps,be)},[N,e,t,O,D]),We=T.useCallback(async(Ie,be)=>{for(let ot=0;ot<Ie.length;ot++){const Ve=Ie[ot],Ut=Ve.name||Ve.id;tt(Ve.id),_e(Lt=>Lt.map(tn=>tn.stepId===Ve.id?{...tn,status:"running"}:tn)),Ce(Lt=>[...Lt,"Executing step: "+Ut]),L(be,Ve.id,"running"),M(be,"Executing step: "+Ut),await new Promise(Lt=>setTimeout(Lt,1e3+Math.random()*1e3));const hn=Math.random()>.1,Ot=Math.floor(1e3+Math.random()*1e3),Pt=hn?void 0:"Simulated error";_e(Lt=>Lt.map(tn=>tn.stepId===Ve.id?{...tn,status:hn?"completed":"failed",duration:Ot,error:Pt}:tn));const hi=hn?'Step "'+Ut+'" completed':'Step "'+Ut+'" failed';if(Ce(Lt=>[...Lt,hi]),L(be,Ve.id,hn?"completed":"failed",void 0,Pt),M(be,hi),!hn){ye("failed"),B(be,"failed"),Le.current=null;return}}ye("completed"),Ce(ot=>[...ot,"Workflow completed successfully!"]),B(be,"completed"),Le.current=null},[L,M,B]),It=T.useCallback(()=>{e&&n(e)},[e,n]),Mt=T.useCallback(()=>{if(b.length>1){const Ie=b.length-2,be=b[Ie];x(Ie),S(be.path)}},[b,x,S]),Vt=T.useCallback(()=>{if(b.length>1){const Ie=b[0];x(0),S(Ie.path)}},[b,x,S]);return T.useEffect(()=>{const Ie=be=>{if(be.target instanceof HTMLInputElement||be.target instanceof HTMLTextAreaElement)return;const ot=be.metaKey||be.ctrlKey;ot&&be.key==="s"&&(be.preventDefault(),It()),ot&&be.key==="Enter"&&(be.preventDefault(),it()),be.key==="n"&&!ot&&!be.shiftKey&&!be.altKey&&(be.preventDefault(),vt()),ot&&be.key==="ArrowLeft"&&(be.preventDefault(),Mt()),ot&&be.key==="ArrowUp"&&(be.preventDefault(),Vt()),be.key==="F9"&&(be.preventDefault(),V.enabled?Q():z()),be.key==="F10"&&V.enabled&&j&&(be.preventDefault(),G()),be.key==="F11"&&!be.shiftKey&&V.enabled&&j&&(be.preventDefault(),P()),be.key==="F11"&&be.shiftKey&&V.enabled&&j&&(be.preventDefault(),W()),be.key==="F5"&&j&&(be.preventDefault(),U())};return window.addEventListener("keydown",Ie),()=>window.removeEventListener("keydown",Ie)},[It,it,vt,Mt,Vt,V.enabled,j,z,Q,G,P,W,U]),h.jsx(YR,{children:h.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-canvas-bg",children:[h.jsx(yQ,{}),h.jsxs("div",{className:"flex flex-1 flex-col relative",children:[J==="mobile"&&h.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-node-border bg-panel-bg",children:[h.jsx("button",{onClick:()=>ee(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open menu",children:h.jsx(Zz,{className:"w-5 h-5 text-gray-400"})}),h.jsx("h1",{className:"text-sm font-medium text-white",children:"Marktoflow"}),h.jsx("button",{onClick:()=>ue(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open properties",children:h.jsx(s6,{className:"w-5 h-5 text-gray-400"})})]}),J!=="mobile"&&h.jsxs("div",{className:"absolute top-4 right-4 z-10 flex items-center gap-2",children:[h.jsx($Q,{showLabel:!0}),h.jsx(DQ,{onClick:v}),h.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs ${k?"bg-success/10 text-success":"bg-error/10 text-error"}`,children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${k?"bg-success":"bg-error"}`}),k?"Connected":"Disconnected"]})]}),h.jsx(sQ,{onAddStep:vt,onExecute:it,onSave:It,isExecuting:N}),h.jsx(qQ,{items:b,onNavigate:C}),h.jsxs("div",{className:"flex-1 relative",children:[h.jsx(nQ,{}),h.jsx(iQ,{isExecuting:N,isPaused:j,workflowStatus:me,currentStepId:Ne,steps:pe,logs:xe,onPause:()=>$(),onResume:()=>U(),onStop:()=>{Le.current&&(D(Le.current),Le.current=null),ye("cancelled")},onStepOver:()=>G(),onClose:()=>{ye("pending"),_e([]),Ce([])},debug:V,onToggleDebugMode:()=>{V.enabled?Q():z()},onToggleBreakpoint:Ie=>F(Ie),onStepInto:()=>P(),onStepOut:()=>W(),onClearBreakpoints:()=>q(),onAddWatchExpression:Ie=>oe(Ie),onRemoveWatchExpression:Ie=>K(Ie)})]}),h.jsx(AQ,{})]}),h.jsx(SQ,{}),h.jsx(MQ,{open:s,onOpenChange:Ie=>{Ie||c()},onCreateStep:xt,position:o||void 0}),u&&h.jsx(RQ,{open:!!u,onOpenChange:()=>p(),originalWorkflow:e,modifiedWorkflow:u,explanation:"AI has suggested the following changes to your workflow.",onAccept:d,onReject:p}),h.jsx(PQ,{open:m,onOpenChange:g})]})})}N3.createRoot(document.getElementById("root")).render(h.jsx(pt.StrictMode,{children:h.jsx(DJ,{})}));
|
|
704
|
+
//# sourceMappingURL=index-CM44OayM.js.map
|