@marktoflow/gui 2.0.0-alpha.1 → 2.0.0-alpha.2
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 +7 -7
- package/README.md +38 -2
- package/dist/client/assets/index-C90Y_aBX.js +678 -0
- package/dist/client/assets/index-C90Y_aBX.js.map +1 -0
- package/dist/client/assets/index-CRWeQ3NN.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/server/index.js +1 -1
- package/dist/server/server/routes/tools.js +406 -0
- package/dist/server/server/routes/tools.js.map +1 -1
- package/dist/server/server/services/agents/codex-provider.js +270 -0
- package/dist/server/server/services/agents/codex-provider.js.map +1 -0
- package/dist/server/server/services/agents/prompts.js +27 -0
- package/dist/server/server/services/agents/prompts.js.map +1 -1
- package/dist/server/server/services/agents/registry.js +20 -0
- package/dist/server/server/services/agents/registry.js.map +1 -1
- package/package.json +4 -4
- package/src/client/components/Canvas/Canvas.tsx +24 -6
- package/src/client/components/Canvas/ForEachNode.tsx +128 -0
- package/src/client/components/Canvas/IfElseNode.tsx +126 -0
- package/src/client/components/Canvas/ParallelNode.tsx +140 -0
- package/src/client/components/Canvas/SwitchNode.tsx +164 -0
- package/src/client/components/Canvas/TransformNode.tsx +185 -0
- package/src/client/components/Canvas/TryCatchNode.tsx +164 -0
- package/src/client/components/Canvas/WhileNode.tsx +129 -0
- package/src/client/components/Canvas/index.ts +24 -0
- package/src/client/utils/serviceIcons.tsx +33 -0
- package/src/server/index.ts +1 -1
- package/src/server/routes/tools.ts +406 -0
- package/src/server/services/agents/codex-provider.ts +398 -0
- package/src/server/services/agents/prompts.ts +27 -0
- package/src/server/services/agents/registry.ts +21 -0
- package/tailwind.config.ts +1 -1
- package/tests/integration/api.test.ts +203 -1
- package/tests/integration/testApp.ts +1 -1
- package/tests/setup.ts +35 -0
- package/tests/unit/ForEachNode.test.tsx +218 -0
- package/tests/unit/IfElseNode.test.tsx +188 -0
- package/tests/unit/ParallelNode.test.tsx +264 -0
- package/tests/unit/SwitchNode.test.tsx +252 -0
- package/tests/unit/TransformNode.test.tsx +386 -0
- package/tests/unit/TryCatchNode.test.tsx +243 -0
- package/tests/unit/WhileNode.test.tsx +226 -0
- package/tests/unit/codexProvider.test.ts +399 -0
- package/tests/unit/serviceIcons.test.ts +197 -0
- package/.turbo/turbo-test.log +0 -22
- package/dist/client/assets/index-DwTI8opO.js +0 -608
- package/dist/client/assets/index-DwTI8opO.js.map +0 -1
- package/dist/client/assets/index-RoEdL6gO.css +0 -1
- package/dist/server/index.d.ts +0 -3
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -56
- package/dist/server/index.js.map +0 -1
- package/dist/server/routes/ai.js +0 -50
- package/dist/server/routes/ai.js.map +0 -1
- package/dist/server/routes/execute.js +0 -62
- package/dist/server/routes/execute.js.map +0 -1
- package/dist/server/routes/workflows.js +0 -99
- package/dist/server/routes/workflows.js.map +0 -1
- package/dist/server/services/AIService.d.ts +0 -30
- package/dist/server/services/AIService.d.ts.map +0 -1
- package/dist/server/services/AIService.js +0 -216
- package/dist/server/services/AIService.js.map +0 -1
- package/dist/server/services/FileWatcher.d.ts +0 -10
- package/dist/server/services/FileWatcher.d.ts.map +0 -1
- package/dist/server/services/FileWatcher.js +0 -62
- package/dist/server/services/FileWatcher.js.map +0 -1
- package/dist/server/services/WorkflowService.d.ts +0 -54
- package/dist/server/services/WorkflowService.d.ts.map +0 -1
- package/dist/server/services/WorkflowService.js +0 -323
- package/dist/server/services/WorkflowService.js.map +0 -1
- package/dist/server/websocket/index.d.ts +0 -10
- package/dist/server/websocket/index.d.ts.map +0 -1
- package/dist/server/websocket/index.js +0 -85
- package/dist/server/websocket/index.js.map +0 -1
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
function h3(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 tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var op={exports:{}},ba={},ap={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 fS;function p3(){if(fS)return Oe;fS=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"),h=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,ie){this.props=P,this.context=W,this.refs=x,this.updater=ie||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,ie){this.props=P,this.context=W,this.refs=x,this.updater=ie||v}var k=C.prototype=new S;k.constructor=C,b(k,w.prototype),k.isPureReactComponent=!0;var N=Array.isArray,T=Object.prototype.hasOwnProperty,R={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function O(P,W,ie){var K,J={},G=null,ee=null;if(W!=null)for(K in W.ref!==void 0&&(ee=W.ref),W.key!==void 0&&(G=""+W.key),W)T.call(W,K)&&!A.hasOwnProperty(K)&&(J[K]=W[K]);var te=arguments.length-2;if(te===1)J.children=ie;else if(1<te){for(var oe=Array(te),de=0;de<te;de++)oe[de]=arguments[de+2];J.children=oe}if(P&&P.defaultProps)for(K in te=P.defaultProps,te)J[K]===void 0&&(J[K]=te[K]);return{$$typeof:e,type:P,key:G,ref:ee,props:J,_owner:R.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 I(P){var W={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(ie){return W[ie]})}var $=/\/+/g;function H(P,W){return typeof P=="object"&&P!==null&&P.key!=null?I(""+P.key):W.toString(36)}function D(P,W,ie,K,J){var G=typeof P;(G==="undefined"||G==="boolean")&&(P=null);var ee=!1;if(P===null)ee=!0;else switch(G){case"string":case"number":ee=!0;break;case"object":switch(P.$$typeof){case e:case t:ee=!0}}if(ee)return ee=P,J=J(ee),P=K===""?"."+H(ee,0):K,N(J)?(ie="",P!=null&&(ie=P.replace($,"$&/")+"/"),D(J,W,ie,"",function(de){return de})):J!=null&&(B(J)&&(J=L(J,ie+(!J.key||ee&&ee.key===J.key?"":(""+J.key).replace($,"$&/")+"/")+P)),W.push(J)),1;if(ee=0,K=K===""?".":K+":",N(P))for(var te=0;te<P.length;te++){G=P[te];var oe=K+H(G,te);ee+=D(G,W,ie,oe,J)}else if(oe=g(P),typeof oe=="function")for(P=oe.call(P),te=0;!(G=P.next()).done;)G=G.value,oe=K+H(G,te++),ee+=D(G,W,ie,oe,J);else if(G==="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 ee}function V(P,W,ie){if(P==null)return P;var K=[],J=0;return D(P,K,"","",function(G){return W.call(ie,G,J++)}),K}function z(P){if(P._status===-1){var W=P._result;W=W(),W.then(function(ie){(P._status===0||P._status===-1)&&(P._status=1,P._result=ie)},function(ie){(P._status===0||P._status===-1)&&(P._status=2,P._result=ie)}),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:R};function Y(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:V,forEach:function(P,W,ie){V(P,function(){W.apply(this,arguments)},ie)},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=Y,Oe.cloneElement=function(P,W,ie){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,G=P.ref,ee=P._owner;if(W!=null){if(W.ref!==void 0&&(G=W.ref,ee=R.current),W.key!==void 0&&(J=""+W.key),P.type&&P.type.defaultProps)var te=P.type.defaultProps;for(oe in W)T.call(W,oe)&&!A.hasOwnProperty(oe)&&(K[oe]=W[oe]===void 0&&te!==void 0?te[oe]:W[oe])}var oe=arguments.length-2;if(oe===1)K.children=ie;else if(1<oe){te=Array(oe);for(var de=0;de<oe;de++)te[de]=arguments[de+2];K.children=te}return{$$typeof:e,type:P.type,key:J,ref:G,props:K,_owner:ee}},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:h,_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=Y,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,ie){return Q.current.useImperativeHandle(P,W,ie)},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,ie){return Q.current.useReducer(P,W,ie)},Oe.useRef=function(P){return Q.current.useRef(P)},Oe.useState=function(P){return Q.current.useState(P)},Oe.useSyncExternalStore=function(P,W,ie){return Q.current.useSyncExternalStore(P,W,ie)},Oe.useTransition=function(){return Q.current.useTransition()},Oe.version="18.3.1",Oe}var hS;function pl(){return hS||(hS=1,ap.exports=p3()),ap.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 pS;function m3(){if(pS)return ba;pS=1;var e=pl(),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 h,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(h in u)r.call(u,h)&&!o.hasOwnProperty(h)&&(m[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)m[h]===void 0&&(m[h]=u[h]);return{$$typeof:t,type:c,key:g,ref:v,props:m,_owner:s.current}}return ba.Fragment=n,ba.jsx=a,ba.jsxs=a,ba}var mS;function g3(){return mS||(mS=1,op.exports=m3()),op.exports}var p=g3(),j=pl();const pt=hl(j),lA=h3({__proto__:null,default:pt},[j]);var nu={},lp={exports:{}},Xt={},cp={exports:{}},up={};/**
|
|
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 gS;function y3(){return gS||(gS=1,(function(e){function t(F,q){var Y=F.length;F.push(q);e:for(;0<Y;){var P=Y-1>>>1,W=F[P];if(0<s(W,q))F[P]=q,F[Y]=W,Y=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],Y=F.pop();if(Y!==q){F[0]=Y;e:for(var P=0,W=F.length,ie=W>>>1;P<ie;){var K=2*(P+1)-1,J=F[K],G=K+1,ee=F[G];if(0>s(J,Y))G<W&&0>s(ee,J)?(F[P]=ee,F[G]=Y,P=G):(F[P]=J,F[K]=Y,P=K);else if(G<W&&0>s(ee,Y))F[P]=ee,F[G]=Y,P=G;else break e}}return q}function s(F,q){var Y=F.sortIndex-q.sortIndex;return Y!==0?Y: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=[],h=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(T);else{var q=n(d);q!==null&&Q(N,q.startTime-F)}}function T(F,q){b=!1,x&&(x=!1,S(O),O=-1),v=!0;var Y=g;try{for(k(q),m=n(u);m!==null&&(!(m.expirationTime>q)||F&&!I());){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 ie=!0;else{var K=n(d);K!==null&&Q(N,K.startTime-q),ie=!1}return ie}finally{m=null,g=Y,v=!1}}var R=!1,A=null,O=-1,L=5,B=-1;function I(){return!(e.unstable_now()-B<L)}function $(){if(A!==null){var F=e.unstable_now();B=F;var q=!0;try{q=A(!0,F)}finally{q?H():(R=!1,A=null)}}else R=!1}var H;if(typeof C=="function")H=function(){C($)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,V=D.port2;D.port1.onmessage=$,H=function(){V.postMessage(null)}}else H=function(){w($,0)};function z(F){A=F,R||(R=!0,H())}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(T))},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 Y=g;g=q;try{return F()}finally{g=Y}},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 Y=g;g=F;try{return q()}finally{g=Y}},e.unstable_scheduleCallback=function(F,q,Y){var P=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?P+Y:P):Y=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=Y+W,F={id:h++,callback:q,priorityLevel:F,startTime:Y,expirationTime:W,sortIndex:-1},Y>P?(F.sortIndex=Y,t(d,F),n(u)===null&&F===n(d)&&(x?(S(O),O=-1):x=!0,Q(N,Y-P))):(F.sortIndex=W,t(u,F),b||v||(b=!0,z(T))),F},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(F){var q=g;return function(){var Y=g;g=q;try{return F.apply(this,arguments)}finally{g=Y}}}})(up)),up}var yS;function v3(){return yS||(yS=1,cp.exports=y3()),cp.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 vS;function x3(){if(vS)return Xt;vS=1;var e=pl(),t=v3();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]*$/,h={},m={};function g(i){return u.call(m,i)?!0:u.call(h,i)?!1:d.test(i)?m[i]=!0:(h[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,M){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=M}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,T=Symbol.for("react.element"),R=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),I=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),H=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 Y=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 ie=!1;function K(i,l){if(!i||ie)return"";ie=!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
|
+
`),M=_.length-1,U=E.length-1;1<=M&&0<=U&&_[M]!==E[U];)U--;for(;1<=M&&0<=U;M--,U--)if(_[M]!==E[U]){if(M!==1||U!==1)do if(M--,U--,0>U||_[M]!==E[U]){var X=`
|
|
37
|
+
`+_[M].replace(" at new "," at ");return i.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",i.displayName)),X}while(1<=M&&0<=U);break}}}finally{ie=!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 G(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 A:return"Fragment";case R:return"Portal";case L:return"Profiler";case O:return"StrictMode";case H:return"Suspense";case D:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case I: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:G(i.type)||"Memo";case z:l=i._payload,i=i._init;try{return G(i(l))}catch{}}return null}function ee(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 G(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 te(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function oe(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function de(i){var l=oe(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(M){y=""+M,E.call(this,M)}}),Object.defineProperty(i,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(M){y=""+M},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function me(i){i._valueTracker||(i._valueTracker=de(i))}function ye(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return i&&(y=oe(i)?i.checked?"true":"false":i.value),i=y,i!==f?(l.setValue(i),!0):!1}function he(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 Se(i,l){var f=l.checked;return Y({},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=te(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=te(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,te(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"||he(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=""+te(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 Y({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Ue(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:te(f)}}function Mt(i,l){var f=te(l.value),y=te(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 It(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 Me(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 ze(i,l){if(l){var f=i.firstChild;if(f&&f===i.lastChild&&f.nodeType===3){f.nodeValue=l;return}}i.textContent=l}var Ht={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},fn=["Webkit","ms","Moz","O"];Object.keys(Ht).forEach(function(i){fn.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),Ht[l]=Ht[i]})});function Ot(i,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||Ht.hasOwnProperty(i)&&Ht[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 li=Y({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(li[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 Zt(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 Io=null;function Oo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Po=null,qr=null,Fr=null;function Fl(i){if(i=oa(i)){if(typeof Po!="function")throw Error(n(280));var l=i.stateNode;l&&(l=gc(l),Po(i.stateNode,i.type,l))}}function Bl(i){qr?Fr?Fr.push(i):Fr=[i]:qr=i}function zl(){if(qr){var i=qr,l=Fr;if(Fr=qr=null,Fl(i),l)for(i=0;i<l.length;i++)Fl(l[i])}}function Vl(i,l){return i(l)}function Hl(){}var Lo=!1;function Ul(i,l,f){if(Lo)return i(l,f);Lo=!0;try{return Vl(i,l,f)}finally{Lo=!1,(qr!==null||Fr!==null)&&(Hl(),zl())}}function Ss(i,l){var f=i.stateNode;if(f===null)return null;var y=gc(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 Do=!1;if(c)try{var ks={};Object.defineProperty(ks,"passive",{get:function(){Do=!0}}),window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{Do=!1}function gf(i,l,f,y,_,E,M,U,X){var se=Array.prototype.slice.call(arguments,3);try{l.apply(f,se)}catch(le){this.onError(le)}}var Ns=!1,ci=null,ui=!1,$o=null,yf={onError:function(i){Ns=!0,ci=i}};function vf(i,l,f,y,_,E,M,U,X){Ns=!1,ci=null,gf.apply(yf,arguments)}function xf(i,l,f,y,_,E,M,U,X){if(vf.apply(this,arguments),Ns){if(Ns){var se=ci;Ns=!1,ci=null}else throw Error(n(198));ui||(ui=!0,$o=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 qo(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 Fo(i){if(Yn(i)!==i)throw Error(n(188))}function wf(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 Fo(_),i;if(E===y)return Fo(_),l;E=E.sibling}throw Error(n(188))}if(f.return!==y.return)f=_,y=E;else{for(var M=!1,U=_.child;U;){if(U===f){M=!0,f=_,y=E;break}if(U===y){M=!0,y=_,f=E;break}U=U.sibling}if(!M){for(U=E.child;U;){if(U===f){M=!0,f=E,y=_;break}if(U===y){M=!0,y=E,f=_;break}U=U.sibling}if(!M)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 Wl(i){return i=wf(i),i!==null?Kl(i):null}function Kl(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Kl(i);if(l!==null)return l;i=i.sibling}return null}var Gl=t.unstable_scheduleCallback,Yl=t.unstable_cancelCallback,bf=t.unstable_shouldYield,Xl=t.unstable_requestPaint,nt=t.unstable_now,_f=t.unstable_getCurrentPriorityLevel,Bo=t.unstable_ImmediatePriority,Ql=t.unstable_UserBlockingPriority,di=t.unstable_NormalPriority,Sf=t.unstable_LowPriority,Jl=t.unstable_IdlePriority,Cs=null,hn=null;function kf(i){if(hn&&typeof hn.onCommitFiberRoot=="function")try{hn.onCommitFiberRoot(Cs,i,void 0,(i.current.flags&128)===128)}catch{}}var en=Math.clz32?Math.clz32:Ef,Nf=Math.log,Cf=Math.LN2;function Ef(i){return i>>>=0,i===0?32:31-(Nf(i)/Cf|0)|0}var fi=64,hi=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 pi(i,l){var f=i.pendingLanes;if(f===0)return 0;var y=0,_=i.suspendedLanes,E=i.pingedLanes,M=f&268435455;if(M!==0){var U=M&~_;U!==0?y=Xn(U):(E&=M,E!==0&&(y=Xn(E)))}else M=f&~_,M!==0?y=Xn(M):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-en(l),_=1<<f,y|=i[f],l&=~_;return y}function Zl(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 jf(i,l){for(var f=i.suspendedLanes,y=i.pingedLanes,_=i.expirationTimes,E=i.pendingLanes;0<E;){var M=31-en(E),U=1<<M,X=_[M];X===-1?((U&f)===0||(U&y)!==0)&&(_[M]=Zl(U,l)):X<=l&&(i.expiredLanes|=U),E&=~U}}function zo(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function mi(){var i=fi;return fi<<=1,(fi&4194240)===0&&(fi=64),i}function Vo(i){for(var l=[],f=0;31>f;f++)l.push(i);return l}function Es(i,l,f){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-en(l),i[l]=f}function ec(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-en(f),E=1<<_;l[_]=0,y[_]=-1,i[_]=-1,f&=~E}}function Tf(i,l){var f=i.entangledLanes|=l;for(i=i.entanglements;f;){var y=31-en(f),_=1<<y;_&l|i[y]&l&&(i[y]|=l),f&=~_}}var Fe=0;function Hb(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Ub,Af,Wb,Kb,Gb,Rf=!1,tc=[],Br=null,zr=null,Vr=null,Ho=new Map,Uo=new Map,Hr=[],PL="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 Yb(i,l){switch(i){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":zr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":Ho.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(l.pointerId)}}function Wo(i,l,f,y,_,E){return i===null||i.nativeEvent!==E?(i={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:E,targetContainers:[_]},l!==null&&(l=oa(l),l!==null&&Af(l)),i):(i.eventSystemFlags|=y,l=i.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),i)}function LL(i,l,f,y,_){switch(l){case"focusin":return Br=Wo(Br,i,l,f,y,_),!0;case"dragenter":return zr=Wo(zr,i,l,f,y,_),!0;case"mouseover":return Vr=Wo(Vr,i,l,f,y,_),!0;case"pointerover":var E=_.pointerId;return Ho.set(E,Wo(Ho.get(E)||null,i,l,f,y,_)),!0;case"gotpointercapture":return E=_.pointerId,Uo.set(E,Wo(Uo.get(E)||null,i,l,f,y,_)),!0}return!1}function Xb(i){var l=js(i.target);if(l!==null){var f=Yn(l);if(f!==null){if(l=f.tag,l===13){if(l=qo(f),l!==null){i.blockedOn=l,Gb(i.priority,function(){Wb(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 nc(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var f=If(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(f===null){f=i.nativeEvent;var y=new f.constructor(f.type,f);Io=y,f.target.dispatchEvent(y),Io=null}else return l=oa(f),l!==null&&Af(l),i.blockedOn=f,!1;l.shift()}return!0}function Qb(i,l,f){nc(i)&&f.delete(l)}function DL(){Rf=!1,Br!==null&&nc(Br)&&(Br=null),zr!==null&&nc(zr)&&(zr=null),Vr!==null&&nc(Vr)&&(Vr=null),Ho.forEach(Qb),Uo.forEach(Qb)}function Ko(i,l){i.blockedOn===l&&(i.blockedOn=null,Rf||(Rf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,DL)))}function Go(i){function l(_){return Ko(_,i)}if(0<tc.length){Ko(tc[0],i);for(var f=1;f<tc.length;f++){var y=tc[f];y.blockedOn===i&&(y.blockedOn=null)}}for(Br!==null&&Ko(Br,i),zr!==null&&Ko(zr,i),Vr!==null&&Ko(Vr,i),Ho.forEach(l),Uo.forEach(l),f=0;f<Hr.length;f++)y=Hr[f],y.blockedOn===i&&(y.blockedOn=null);for(;0<Hr.length&&(f=Hr[0],f.blockedOn===null);)Xb(f),f.blockedOn===null&&Hr.shift()}var gi=N.ReactCurrentBatchConfig,rc=!0;function $L(i,l,f,y){var _=Fe,E=gi.transition;gi.transition=null;try{Fe=1,Mf(i,l,f,y)}finally{Fe=_,gi.transition=E}}function qL(i,l,f,y){var _=Fe,E=gi.transition;gi.transition=null;try{Fe=4,Mf(i,l,f,y)}finally{Fe=_,gi.transition=E}}function Mf(i,l,f,y){if(rc){var _=If(i,l,f,y);if(_===null)Xf(i,l,y,sc,f),Yb(i,y);else if(LL(_,i,l,f,y))y.stopPropagation();else if(Yb(i,y),l&4&&-1<PL.indexOf(i)){for(;_!==null;){var E=oa(_);if(E!==null&&Ub(E),E=If(i,l,f,y),E===null&&Xf(i,l,y,sc,f),E===_)break;_=E}_!==null&&y.stopPropagation()}else Xf(i,l,y,null,f)}}var sc=null;function If(i,l,f,y){if(sc=null,i=Oo(y),i=js(i),i!==null)if(l=Yn(i),l===null)i=null;else if(f=l.tag,f===13){if(i=qo(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 sc=i,null}function Jb(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(_f()){case Bo:return 1;case Ql:return 4;case di:case Sf:return 16;case Jl:return 536870912;default:return 16}default:return 16}}var Ur=null,Of=null,ic=null;function Zb(){if(ic)return ic;var i,l=Of,f=l.length,y,_="value"in Ur?Ur.value:Ur.textContent,E=_.length;for(i=0;i<f&&l[i]===_[i];i++);var M=f-i;for(y=1;y<=M&&l[f-y]===_[E-y];y++);return ic=_.slice(i,1<y?1-y:void 0)}function oc(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 ac(){return!0}function e1(){return!1}function tn(i){function l(f,y,_,E,M){this._reactName=f,this._targetInst=_,this.type=y,this.nativeEvent=E,this.target=M,this.currentTarget=null;for(var U in i)i.hasOwnProperty(U)&&(f=i[U],this[U]=f?f(E):E[U]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?ac:e1,this.isPropagationStopped=e1,this}return Y(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=ac)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=ac)},persist:function(){},isPersistent:ac}),l}var yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pf=tn(yi),Yo=Y({},yi,{view:0,detail:0}),FL=tn(Yo),Lf,Df,Xo,lc=Y({},Yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qf,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!==Xo&&(Xo&&i.type==="mousemove"?(Lf=i.screenX-Xo.screenX,Df=i.screenY-Xo.screenY):Df=Lf=0,Xo=i),Lf)},movementY:function(i){return"movementY"in i?i.movementY:Df}}),t1=tn(lc),BL=Y({},lc,{dataTransfer:0}),zL=tn(BL),VL=Y({},Yo,{relatedTarget:0}),$f=tn(VL),HL=Y({},yi,{animationName:0,elapsedTime:0,pseudoElement:0}),UL=tn(HL),WL=Y({},yi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),KL=tn(WL),GL=Y({},yi,{data:0}),n1=tn(GL),YL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XL={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"},QL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function JL(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=QL[i])?!!l[i]:!1}function qf(){return JL}var ZL=Y({},Yo,{key:function(i){if(i.key){var l=YL[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=oc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?XL[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qf,charCode:function(i){return i.type==="keypress"?oc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?oc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),e4=tn(ZL),t4=Y({},lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),r1=tn(t4),n4=Y({},Yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qf}),r4=tn(n4),s4=Y({},yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),i4=tn(s4),o4=Y({},lc,{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}),a4=tn(o4),l4=[9,13,27,32],Ff=c&&"CompositionEvent"in window,Qo=null;c&&"documentMode"in document&&(Qo=document.documentMode);var c4=c&&"TextEvent"in window&&!Qo,s1=c&&(!Ff||Qo&&8<Qo&&11>=Qo),i1=" ",o1=!1;function a1(i,l){switch(i){case"keyup":return l4.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function l1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var vi=!1;function u4(i,l){switch(i){case"compositionend":return l1(l);case"keypress":return l.which!==32?null:(o1=!0,i1);case"textInput":return i=l.data,i===i1&&o1?null:i;default:return null}}function d4(i,l){if(vi)return i==="compositionend"||!Ff&&a1(i,l)?(i=Zb(),ic=Of=Ur=null,vi=!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 s1&&l.locale!=="ko"?null:l.data;default:return null}}var f4={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 c1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!f4[i.type]:l==="textarea"}function u1(i,l,f,y){Bl(y),l=hc(l,"onChange"),0<l.length&&(f=new Pf("onChange","change",null,f,y),i.push({event:f,listeners:l}))}var Jo=null,Zo=null;function h4(i){j1(i,0)}function cc(i){var l=Si(i);if(ye(l))return i}function p4(i,l){if(i==="change")return l}var d1=!1;if(c){var Bf;if(c){var zf="oninput"in document;if(!zf){var f1=document.createElement("div");f1.setAttribute("oninput","return;"),zf=typeof f1.oninput=="function"}Bf=zf}else Bf=!1;d1=Bf&&(!document.documentMode||9<document.documentMode)}function h1(){Jo&&(Jo.detachEvent("onpropertychange",p1),Zo=Jo=null)}function p1(i){if(i.propertyName==="value"&&cc(Zo)){var l=[];u1(l,Zo,i,Oo(i)),Ul(h4,l)}}function m4(i,l,f){i==="focusin"?(h1(),Jo=l,Zo=f,Jo.attachEvent("onpropertychange",p1)):i==="focusout"&&h1()}function g4(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return cc(Zo)}function y4(i,l){if(i==="click")return cc(l)}function v4(i,l){if(i==="input"||i==="change")return cc(l)}function x4(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var jn=typeof Object.is=="function"?Object.is:x4;function ea(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 m1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function g1(i,l){var f=m1(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=m1(f)}}function y1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?y1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function v1(){for(var i=window,l=he();l instanceof i.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)i=l.contentWindow;else break;l=he(i.document)}return l}function Vf(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 w4(i){var l=v1(),f=i.focusedElem,y=i.selectionRange;if(l!==f&&f&&f.ownerDocument&&y1(f.ownerDocument.documentElement,f)){if(y!==null&&Vf(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=_),_=g1(f,E);var M=g1(f,y);_&&M&&(i.rangeCount!==1||i.anchorNode!==_.node||i.anchorOffset!==_.offset||i.focusNode!==M.node||i.focusOffset!==M.offset)&&(l=l.createRange(),l.setStart(_.node,_.offset),i.removeAllRanges(),E>y?(i.addRange(l),i.extend(M.node,M.offset)):(l.setEnd(M.node,M.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 b4=c&&"documentMode"in document&&11>=document.documentMode,xi=null,Hf=null,ta=null,Uf=!1;function x1(i,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Uf||xi==null||xi!==he(y)||(y=xi,"selectionStart"in y&&Vf(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}),ta&&ea(ta,y)||(ta=y,y=hc(Hf,"onSelect"),0<y.length&&(l=new Pf("onSelect","select",null,l,f),i.push({event:l,listeners:y}),l.target=xi)))}function uc(i,l){var f={};return f[i.toLowerCase()]=l.toLowerCase(),f["Webkit"+i]="webkit"+l,f["Moz"+i]="moz"+l,f}var wi={animationend:uc("Animation","AnimationEnd"),animationiteration:uc("Animation","AnimationIteration"),animationstart:uc("Animation","AnimationStart"),transitionend:uc("Transition","TransitionEnd")},Wf={},w1={};c&&(w1=document.createElement("div").style,"AnimationEvent"in window||(delete wi.animationend.animation,delete wi.animationiteration.animation,delete wi.animationstart.animation),"TransitionEvent"in window||delete wi.transitionend.transition);function dc(i){if(Wf[i])return Wf[i];if(!wi[i])return i;var l=wi[i],f;for(f in l)if(l.hasOwnProperty(f)&&f in w1)return Wf[i]=l[f];return i}var b1=dc("animationend"),_1=dc("animationiteration"),S1=dc("animationstart"),k1=dc("transitionend"),N1=new Map,C1="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 Wr(i,l){N1.set(i,l),o(l,[i])}for(var Kf=0;Kf<C1.length;Kf++){var Gf=C1[Kf],_4=Gf.toLowerCase(),S4=Gf[0].toUpperCase()+Gf.slice(1);Wr(_4,"on"+S4)}Wr(b1,"onAnimationEnd"),Wr(_1,"onAnimationIteration"),Wr(S1,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(k1,"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 na="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(" "),k4=new Set("cancel close invalid load scroll toggle".split(" ").concat(na));function E1(i,l,f){var y=i.type||"unknown-event";i.currentTarget=f,xf(y,l,void 0,i),i.currentTarget=null}function j1(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 M=y.length-1;0<=M;M--){var U=y[M],X=U.instance,se=U.currentTarget;if(U=U.listener,X!==E&&_.isPropagationStopped())break e;E1(_,U,se),E=X}else for(M=0;M<y.length;M++){if(U=y[M],X=U.instance,se=U.currentTarget,U=U.listener,X!==E&&_.isPropagationStopped())break e;E1(_,U,se),E=X}}}if(ui)throw i=$o,ui=!1,$o=null,i}function We(i,l){var f=l[nh];f===void 0&&(f=l[nh]=new Set);var y=i+"__bubble";f.has(y)||(T1(l,i,2,!1),f.add(y))}function Yf(i,l,f){var y=0;l&&(y|=4),T1(f,i,y,l)}var fc="_reactListening"+Math.random().toString(36).slice(2);function ra(i){if(!i[fc]){i[fc]=!0,r.forEach(function(f){f!=="selectionchange"&&(k4.has(f)||Yf(f,!1,i),Yf(f,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[fc]||(l[fc]=!0,Yf("selectionchange",!1,l))}}function T1(i,l,f,y){switch(Jb(l)){case 1:var _=$L;break;case 4:_=qL;break;default:_=Mf}f=_.bind(null,l,f,i),_=void 0,!Do||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 Xf(i,l,f,y,_){var E=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var M=y.tag;if(M===3||M===4){var U=y.stateNode.containerInfo;if(U===_||U.nodeType===8&&U.parentNode===_)break;if(M===4)for(M=y.return;M!==null;){var X=M.tag;if((X===3||X===4)&&(X=M.stateNode.containerInfo,X===_||X.nodeType===8&&X.parentNode===_))return;M=M.return}for(;U!==null;){if(M=js(U),M===null)return;if(X=M.tag,X===5||X===6){y=E=M;continue e}U=U.parentNode}}y=y.return}Ul(function(){var se=E,le=Oo(f),ce=[];e:{var ae=N1.get(i);if(ae!==void 0){var ge=Pf,we=i;switch(i){case"keypress":if(oc(f)===0)break e;case"keydown":case"keyup":ge=e4;break;case"focusin":we="focus",ge=$f;break;case"focusout":we="blur",ge=$f;break;case"beforeblur":case"afterblur":ge=$f;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=t1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=zL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=r4;break;case b1:case _1:case S1:ge=UL;break;case k1:ge=i4;break;case"scroll":ge=FL;break;case"wheel":ge=a4;break;case"copy":case"cut":case"paste":ge=KL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=r1}var _e=(l&4)!==0,lt=!_e&&i==="scroll",ne=_e?ae!==null?ae+"Capture":null:ae;_e=[];for(var Z=se,re;Z!==null;){re=Z;var ue=re.stateNode;if(re.tag===5&&ue!==null&&(re=ue,ne!==null&&(ue=Ss(Z,ne),ue!=null&&_e.push(sa(Z,ue,re)))),lt)break;Z=Z.return}0<_e.length&&(ae=new ge(ae,we,null,f,le),ce.push({event:ae,listeners:_e}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ge=i==="mouseout"||i==="pointerout",ae&&f!==Io&&(we=f.relatedTarget||f.fromElement)&&(js(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?js(we):null,we!==null&&(lt=Yn(we),we!==lt||we.tag!==5&&we.tag!==6)&&(we=null)):(ge=null,we=se),ge!==we)){if(_e=t1,ue="onMouseLeave",ne="onMouseEnter",Z="mouse",(i==="pointerout"||i==="pointerover")&&(_e=r1,ue="onPointerLeave",ne="onPointerEnter",Z="pointer"),lt=ge==null?ae:Si(ge),re=we==null?ae:Si(we),ae=new _e(ue,Z+"leave",ge,f,le),ae.target=lt,ae.relatedTarget=re,ue=null,js(le)===se&&(_e=new _e(ne,Z+"enter",we,f,le),_e.target=re,_e.relatedTarget=lt,ue=_e),lt=ue,ge&&we)t:{for(_e=ge,ne=we,Z=0,re=_e;re;re=bi(re))Z++;for(re=0,ue=ne;ue;ue=bi(ue))re++;for(;0<Z-re;)_e=bi(_e),Z--;for(;0<re-Z;)ne=bi(ne),re--;for(;Z--;){if(_e===ne||ne!==null&&_e===ne.alternate)break t;_e=bi(_e),ne=bi(ne)}_e=null}else _e=null;ge!==null&&A1(ce,ae,ge,_e,!1),we!==null&<!==null&&A1(ce,lt,we,_e,!0)}}e:{if(ae=se?Si(se):window,ge=ae.nodeName&&ae.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ae.type==="file")var ke=p4;else if(c1(ae))if(d1)ke=v4;else{ke=g4;var Ee=m4}else(ge=ae.nodeName)&&ge.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(ke=y4);if(ke&&(ke=ke(i,se))){u1(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?Si(se):window,i){case"focusin":(c1(Ee)||Ee.contentEditable==="true")&&(xi=Ee,Hf=se,ta=null);break;case"focusout":ta=Hf=xi=null;break;case"mousedown":Uf=!0;break;case"contextmenu":case"mouseup":case"dragend":Uf=!1,x1(ce,f,le);break;case"selectionchange":if(b4)break;case"keydown":case"keyup":x1(ce,f,le)}var je;if(Ff)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 vi?a1(i,f)&&(Te="onCompositionEnd"):i==="keydown"&&f.keyCode===229&&(Te="onCompositionStart");Te&&(s1&&f.locale!=="ko"&&(vi||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&vi&&(je=Zb()):(Ur=le,Of="value"in Ur?Ur.value:Ur.textContent,vi=!0)),Ee=hc(se,Te),0<Ee.length&&(Te=new n1(Te,i,null,f,le),ce.push({event:Te,listeners:Ee}),je?Te.data=je:(je=l1(f),je!==null&&(Te.data=je)))),(je=c4?u4(i,f):d4(i,f))&&(se=hc(se,"onBeforeInput"),0<se.length&&(le=new n1("onBeforeInput","beforeinput",null,f,le),ce.push({event:le,listeners:se}),le.data=je))}j1(ce,l)})}function sa(i,l,f){return{instance:i,listener:l,currentTarget:f}}function hc(i,l){for(var f=l+"Capture",y=[];i!==null;){var _=i,E=_.stateNode;_.tag===5&&E!==null&&(_=E,E=Ss(i,f),E!=null&&y.unshift(sa(i,E,_)),E=Ss(i,l),E!=null&&y.push(sa(i,E,_))),i=i.return}return y}function bi(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function A1(i,l,f,y,_){for(var E=l._reactName,M=[];f!==null&&f!==y;){var U=f,X=U.alternate,se=U.stateNode;if(X!==null&&X===y)break;U.tag===5&&se!==null&&(U=se,_?(X=Ss(f,E),X!=null&&M.unshift(sa(f,X,U))):_||(X=Ss(f,E),X!=null&&M.push(sa(f,X,U)))),f=f.return}M.length!==0&&i.push({event:l,listeners:M})}var N4=/\r\n?/g,C4=/\u0000|\uFFFD/g;function R1(i){return(typeof i=="string"?i:""+i).replace(N4,`
|
|
38
|
+
`).replace(C4,"")}function pc(i,l,f){if(l=R1(l),R1(i)!==l&&f)throw Error(n(425))}function mc(){}var Qf=null,Jf=null;function Zf(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 eh=typeof setTimeout=="function"?setTimeout:void 0,E4=typeof clearTimeout=="function"?clearTimeout:void 0,M1=typeof Promise=="function"?Promise:void 0,j4=typeof queueMicrotask=="function"?queueMicrotask:typeof M1<"u"?function(i){return M1.resolve(null).then(i).catch(T4)}:eh;function T4(i){setTimeout(function(){throw i})}function th(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(_),Go(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=_}while(f);Go(l)}function Kr(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 I1(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 _i=Math.random().toString(36).slice(2),Qn="__reactFiber$"+_i,ia="__reactProps$"+_i,yr="__reactContainer$"+_i,nh="__reactEvents$"+_i,A4="__reactListeners$"+_i,R4="__reactHandles$"+_i;function js(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=I1(i);i!==null;){if(f=i[Qn])return f;i=I1(i)}return l}i=f,f=i.parentNode}return null}function oa(i){return i=i[Qn]||i[yr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Si(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function gc(i){return i[ia]||null}var rh=[],ki=-1;function Gr(i){return{current:i}}function Ke(i){0>ki||(i.current=rh[ki],rh[ki]=null,ki--)}function Ve(i,l){ki++,rh[ki]=i.current,i.current=l}var Yr={},jt=Gr(Yr),Ut=Gr(!1),Ts=Yr;function Ni(i,l){var f=i.type.contextTypes;if(!f)return Yr;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 yc(){Ke(Ut),Ke(jt)}function O1(i,l,f){if(jt.current!==Yr)throw Error(n(168));Ve(jt,l),Ve(Ut,f)}function P1(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,ee(i)||"Unknown",_));return Y({},f,y)}function vc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Yr,Ts=jt.current,Ve(jt,i),Ve(Ut,Ut.current),!0}function L1(i,l,f){var y=i.stateNode;if(!y)throw Error(n(169));f?(i=P1(i,l,Ts),y.__reactInternalMemoizedMergedChildContext=i,Ke(Ut),Ke(jt),Ve(jt,i)):Ke(Ut),Ve(Ut,f)}var vr=null,xc=!1,sh=!1;function D1(i){vr===null?vr=[i]:vr.push(i)}function M4(i){xc=!0,D1(i)}function Xr(){if(!sh&&vr!==null){sh=!0;var i=0,l=Fe;try{var f=vr;for(Fe=1;i<f.length;i++){var y=f[i];do y=y(!0);while(y!==null)}vr=null,xc=!1}catch(_){throw vr!==null&&(vr=vr.slice(i+1)),Gl(Bo,Xr),_}finally{Fe=l,sh=!1}}return null}var Ci=[],Ei=0,wc=null,bc=0,pn=[],mn=0,As=null,xr=1,wr="";function Rs(i,l){Ci[Ei++]=bc,Ci[Ei++]=wc,wc=i,bc=l}function $1(i,l,f){pn[mn++]=xr,pn[mn++]=wr,pn[mn++]=As,As=i;var y=xr;i=wr;var _=32-en(y)-1;y&=~(1<<_),f+=1;var E=32-en(l)+_;if(30<E){var M=_-_%5;E=(y&(1<<M)-1).toString(32),y>>=M,_-=M,xr=1<<32-en(l)+_|f<<_|y,wr=E+i}else xr=1<<E|f<<_|y,wr=i}function ih(i){i.return!==null&&(Rs(i,1),$1(i,1,0))}function oh(i){for(;i===wc;)wc=Ci[--Ei],Ci[Ei]=null,bc=Ci[--Ei],Ci[Ei]=null;for(;i===As;)As=pn[--mn],pn[mn]=null,wr=pn[--mn],pn[mn]=null,xr=pn[--mn],pn[mn]=null}var nn=null,rn=null,Xe=!1,Tn=null;function q1(i,l){var f=xn(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 F1(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,nn=i,rn=Kr(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,nn=i,rn=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=As!==null?{id:xr,overflow:wr}:null,i.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=xn(18,null,null,0),f.stateNode=l,f.return=i,i.child=f,nn=i,rn=null,!0):!1;default:return!1}}function ah(i){return(i.mode&1)!==0&&(i.flags&128)===0}function lh(i){if(Xe){var l=rn;if(l){var f=l;if(!F1(i,l)){if(ah(i))throw Error(n(418));l=Kr(f.nextSibling);var y=nn;l&&F1(i,l)?q1(y,f):(i.flags=i.flags&-4097|2,Xe=!1,nn=i)}}else{if(ah(i))throw Error(n(418));i.flags=i.flags&-4097|2,Xe=!1,nn=i}}}function B1(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;nn=i}function _c(i){if(i!==nn)return!1;if(!Xe)return B1(i),Xe=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!Zf(i.type,i.memoizedProps)),l&&(l=rn)){if(ah(i))throw z1(),Error(n(418));for(;l;)q1(i,l),l=Kr(l.nextSibling)}if(B1(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){rn=Kr(i.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}i=i.nextSibling}rn=null}}else rn=nn?Kr(i.stateNode.nextSibling):null;return!0}function z1(){for(var i=rn;i;)i=Kr(i.nextSibling)}function ji(){rn=nn=null,Xe=!1}function ch(i){Tn===null?Tn=[i]:Tn.push(i)}var I4=N.ReactCurrentBatchConfig;function aa(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(M){var U=_.refs;M===null?delete U[E]:U[E]=M},l._stringRef=E,l)}if(typeof i!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,i))}return i}function Sc(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function V1(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=ss(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 M(ne){return i&&ne.alternate===null&&(ne.flags|=2),ne}function U(ne,Z,re,ue){return Z===null||Z.tag!==6?(Z=ep(re,ne.mode,ue),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function X(ne,Z,re,ue){var ke=re.type;return ke===A?le(ne,Z,re.props.children,ue,re.key):Z!==null&&(Z.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===z&&V1(ke)===Z.type)?(ue=_(Z,re.props),ue.ref=aa(ne,Z,re),ue.return=ne,ue):(ue=Kc(re.type,re.key,re.props,null,ne.mode,ue),ue.ref=aa(ne,Z,re),ue.return=ne,ue)}function se(ne,Z,re,ue){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=tp(re,ne.mode,ue),Z.return=ne,Z):(Z=_(Z,re.children||[]),Z.return=ne,Z)}function le(ne,Z,re,ue,ke){return Z===null||Z.tag!==7?(Z=qs(re,ne.mode,ue,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=ep(""+Z,ne.mode,re),Z.return=ne,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case T:return re=Kc(Z.type,Z.key,Z.props,null,ne.mode,re),re.ref=aa(ne,null,Z),re.return=ne,re;case R:return Z=tp(Z,ne.mode,re),Z.return=ne,Z;case z:var ue=Z._init;return ce(ne,ue(Z._payload),re)}if(vt(Z)||q(Z))return Z=qs(Z,ne.mode,re,null),Z.return=ne,Z;Sc(ne,Z)}return null}function ae(ne,Z,re,ue){var ke=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return ke!==null?null:U(ne,Z,""+re,ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case T:return re.key===ke?X(ne,Z,re,ue):null;case R:return re.key===ke?se(ne,Z,re,ue):null;case z:return ke=re._init,ae(ne,Z,ke(re._payload),ue)}if(vt(re)||q(re))return ke!==null?null:le(ne,Z,re,ue,null);Sc(ne,re)}return null}function ge(ne,Z,re,ue,ke){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return ne=ne.get(re)||null,U(Z,ne,""+ue,ke);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case T:return ne=ne.get(ue.key===null?re:ue.key)||null,X(Z,ne,ue,ke);case R:return ne=ne.get(ue.key===null?re:ue.key)||null,se(Z,ne,ue,ke);case z:var Ee=ue._init;return ge(ne,Z,re,Ee(ue._payload),ke)}if(vt(ue)||q(ue))return ne=ne.get(re)||null,le(Z,ne,ue,ke,null);Sc(Z,ue)}return null}function we(ne,Z,re,ue){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],ue);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&&Rs(ne,Te),ke;if(je===null){for(;Te<re.length;Te++)je=ce(ne,re[Te],ue),je!==null&&(Z=E(je,Z,Te),Ee===null?ke=je:Ee.sibling=je,Ee=je);return Xe&&Rs(ne,Te),ke}for(je=y(ne,je);Te<re.length;Te++)kt=ge(je,ne,Te,re[Te],ue),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(is){return l(ne,is)}),Xe&&Rs(ne,Te),ke}function _e(ne,Z,re,ue){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 is=ae(ne,je,qe.value,ue);if(is===null){je===null&&(je=kt);break}i&&je&&is.alternate===null&&l(ne,je),Z=E(is,Z,Te),Ee===null?ke=is:Ee.sibling=is,Ee=is,je=kt}if(qe.done)return f(ne,je),Xe&&Rs(ne,Te),ke;if(je===null){for(;!qe.done;Te++,qe=re.next())qe=ce(ne,qe.value,ue),qe!==null&&(Z=E(qe,Z,Te),Ee===null?ke=qe:Ee.sibling=qe,Ee=qe);return Xe&&Rs(ne,Te),ke}for(je=y(ne,je);!qe.done;Te++,qe=re.next())qe=ge(je,ne,Te,qe.value,ue),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(f3){return l(ne,f3)}),Xe&&Rs(ne,Te),ke}function lt(ne,Z,re,ue){if(typeof re=="object"&&re!==null&&re.type===A&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case T:e:{for(var ke=re.key,Ee=Z;Ee!==null;){if(Ee.key===ke){if(ke=re.type,ke===A){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&&V1(ke)===Ee.type){f(ne,Ee.sibling),Z=_(Ee,re.props),Z.ref=aa(ne,Ee,re),Z.return=ne,ne=Z;break e}f(ne,Ee);break}else l(ne,Ee);Ee=Ee.sibling}re.type===A?(Z=qs(re.props.children,ne.mode,ue,re.key),Z.return=ne,ne=Z):(ue=Kc(re.type,re.key,re.props,null,ne.mode,ue),ue.ref=aa(ne,Z,re),ue.return=ne,ne=ue)}return M(ne);case R: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=tp(re,ne.mode,ue),Z.return=ne,ne=Z}return M(ne);case z:return Ee=re._init,lt(ne,Z,Ee(re._payload),ue)}if(vt(re))return we(ne,Z,re,ue);if(q(re))return _e(ne,Z,re,ue);Sc(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=ep(re,ne.mode,ue),Z.return=ne,ne=Z),M(ne)):f(ne,Z)}return lt}var Ti=H1(!0),U1=H1(!1),kc=Gr(null),Nc=null,Ai=null,uh=null;function dh(){uh=Ai=Nc=null}function fh(i){var l=kc.current;Ke(kc),i._currentValue=l}function hh(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 Ri(i,l){Nc=i,uh=Ai=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(Kt=!0),i.firstContext=null)}function gn(i){var l=i._currentValue;if(uh!==i)if(i={context:i,memoizedValue:l,next:null},Ai===null){if(Nc===null)throw Error(n(308));Ai=i,Nc.dependencies={lanes:0,firstContext:i}}else Ai=Ai.next=i;return l}var Ms=null;function ph(i){Ms===null?Ms=[i]:Ms.push(i)}function W1(i,l,f,y){var _=l.interleaved;return _===null?(f.next=f,ph(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 Qr=!1;function mh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K1(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 _r(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function Jr(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,ph(y)):(l.next=_.next,_.next=l),y.interleaved=l,br(i,f)}function Cc(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,Tf(i,f)}}function G1(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 M={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};E===null?_=E=M:E=E.next=M,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 Ec(i,l,f,y){var _=i.updateQueue;Qr=!1;var E=_.firstBaseUpdate,M=_.lastBaseUpdate,U=_.shared.pending;if(U!==null){_.shared.pending=null;var X=U,se=X.next;X.next=null,M===null?E=se:M.next=se,M=X;var le=i.alternate;le!==null&&(le=le.updateQueue,U=le.lastBaseUpdate,U!==M&&(U===null?le.firstBaseUpdate=se:U.next=se,le.lastBaseUpdate=X))}if(E!==null){var ce=_.baseState;M=0,le=se=X=null,U=E;do{var ae=U.lane,ge=U.eventTime;if((y&ae)===ae){le!==null&&(le=le.next={eventTime:ge,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var we=i,_e=U;switch(ae=l,ge=f,_e.tag){case 1:if(we=_e.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=_e.payload,ae=typeof we=="function"?we.call(ge,ce,ae):we,ae==null)break e;ce=Y({},ce,ae);break e;case 2:Qr=!0}}U.callback!==null&&U.lane!==0&&(i.flags|=64,ae=_.effects,ae===null?_.effects=[U]:ae.push(U))}else ge={eventTime:ge,lane:ae,tag:U.tag,payload:U.payload,callback:U.callback,next:null},le===null?(se=le=ge,X=ce):le=le.next=ge,M|=ae;if(U=U.next,U===null){if(U=_.shared.pending,U===null)break;ae=U,U=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 M|=_.lane,_=_.next;while(_!==l)}else E===null&&(_.shared.lanes=0);Ps|=M,i.lanes=M,i.memoizedState=ce}}function Y1(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 la={},Jn=Gr(la),ca=Gr(la),ua=Gr(la);function Is(i){if(i===la)throw Error(n(174));return i}function gh(i,l){switch(Ve(ua,l),Ve(ca,i),Ve(Jn,la),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Me(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Me(l,i)}Ke(Jn),Ve(Jn,l)}function Mi(){Ke(Jn),Ke(ca),Ke(ua)}function X1(i){Is(ua.current);var l=Is(Jn.current),f=Me(l,i.type);l!==f&&(Ve(ca,i),Ve(Jn,f))}function yh(i){ca.current===i&&(Ke(Jn),Ke(ca))}var rt=Gr(0);function jc(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 vh=[];function xh(){for(var i=0;i<vh.length;i++)vh[i]._workInProgressVersionPrimary=null;vh.length=0}var Tc=N.ReactCurrentDispatcher,wh=N.ReactCurrentBatchConfig,Os=0,st=null,wt=null,_t=null,Ac=!1,da=!1,fa=0,O4=0;function Tt(){throw Error(n(321))}function bh(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 _h(i,l,f,y,_,E){if(Os=E,st=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Tc.current=i===null||i.memoizedState===null?$4:q4,i=f(y,_),da){E=0;do{if(da=!1,fa=0,25<=E)throw Error(n(301));E+=1,_t=wt=null,l.updateQueue=null,Tc.current=F4,i=f(y,_)}while(da)}if(Tc.current=Ic,l=wt!==null&&wt.next!==null,Os=0,_t=wt=st=null,Ac=!1,l)throw Error(n(300));return i}function Sh(){var i=fa!==0;return fa=0,i}function Zn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?st.memoizedState=_t=i:_t=_t.next=i,_t}function yn(){if(wt===null){var i=st.alternate;i=i!==null?i.memoizedState:null}else i=wt.next;var l=_t===null?st.memoizedState:_t.next;if(l!==null)_t=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},_t===null?st.memoizedState=_t=i:_t=_t.next=i}return _t}function ha(i,l){return typeof l=="function"?l(i):l}function kh(i){var l=yn(),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 M=_.next;_.next=E.next,E.next=M}y.baseQueue=_=E,f.pending=null}if(_!==null){E=_.next,y=y.baseState;var U=M=null,X=null,se=E;do{var le=se.lane;if((Os&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?(U=X=ce,M=y):X=X.next=ce,st.lanes|=le,Ps|=le}se=se.next}while(se!==null&&se!==E);X===null?M=y:X.next=U,jn(y,l.memoizedState)||(Kt=!0),l.memoizedState=y,l.baseState=M,l.baseQueue=X,f.lastRenderedState=y}if(i=f.interleaved,i!==null){_=i;do E=_.lane,st.lanes|=E,Ps|=E,_=_.next;while(_!==i)}else _===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function Nh(i){var l=yn(),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 M=_=_.next;do E=i(E,M.action),M=M.next;while(M!==_);jn(E,l.memoizedState)||(Kt=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),f.lastRenderedState=E}return[E,y]}function Q1(){}function J1(i,l){var f=st,y=yn(),_=l(),E=!jn(y.memoizedState,_);if(E&&(y.memoizedState=_,Kt=!0),y=y.queue,Ch(t_.bind(null,f,y,i),[i]),y.getSnapshot!==l||E||_t!==null&&_t.memoizedState.tag&1){if(f.flags|=2048,pa(9,e_.bind(null,f,y,_,l),void 0,null),St===null)throw Error(n(349));(Os&30)!==0||Z1(f,l,_)}return _}function Z1(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 e_(i,l,f,y){l.value=f,l.getSnapshot=y,n_(l)&&r_(i)}function t_(i,l,f){return f(function(){n_(l)&&r_(i)})}function n_(i){var l=i.getSnapshot;i=i.value;try{var f=l();return!jn(i,f)}catch{return!0}}function r_(i){var l=br(i,1);l!==null&&In(l,i,1,-1)}function s_(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:ha,lastRenderedState:i},l.queue=i,i=i.dispatch=D4.bind(null,st,i),[l.memoizedState,i]}function pa(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 i_(){return yn().memoizedState}function Rc(i,l,f,y){var _=Zn();st.flags|=i,_.memoizedState=pa(1|l,f,void 0,y===void 0?null:y)}function Mc(i,l,f,y){var _=yn();y=y===void 0?null:y;var E=void 0;if(wt!==null){var M=wt.memoizedState;if(E=M.destroy,y!==null&&bh(y,M.deps)){_.memoizedState=pa(l,f,E,y);return}}st.flags|=i,_.memoizedState=pa(1|l,f,E,y)}function o_(i,l){return Rc(8390656,8,i,l)}function Ch(i,l){return Mc(2048,8,i,l)}function a_(i,l){return Mc(4,2,i,l)}function l_(i,l){return Mc(4,4,i,l)}function c_(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 u_(i,l,f){return f=f!=null?f.concat([i]):null,Mc(4,4,c_.bind(null,l,i),f)}function Eh(){}function d_(i,l){var f=yn();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&bh(l,y[1])?y[0]:(f.memoizedState=[i,l],i)}function f_(i,l){var f=yn();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&bh(l,y[1])?y[0]:(i=i(),f.memoizedState=[i,l],i)}function h_(i,l,f){return(Os&21)===0?(i.baseState&&(i.baseState=!1,Kt=!0),i.memoizedState=f):(jn(f,l)||(f=mi(),st.lanes|=f,Ps|=f,i.baseState=!0),l)}function P4(i,l){var f=Fe;Fe=f!==0&&4>f?f:4,i(!0);var y=wh.transition;wh.transition={};try{i(!1),l()}finally{Fe=f,wh.transition=y}}function p_(){return yn().memoizedState}function L4(i,l,f){var y=ns(i);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},m_(i))g_(l,f);else if(f=W1(i,l,f,y),f!==null){var _=$t();In(f,i,y,_),y_(f,l,y)}}function D4(i,l,f){var y=ns(i),_={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(m_(i))g_(l,_);else{var E=i.alternate;if(i.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var M=l.lastRenderedState,U=E(M,f);if(_.hasEagerState=!0,_.eagerState=U,jn(U,M)){var X=l.interleaved;X===null?(_.next=_,ph(l)):(_.next=X.next,X.next=_),l.interleaved=_;return}}catch{}finally{}f=W1(i,l,_,y),f!==null&&(_=$t(),In(f,i,y,_),y_(f,l,y))}}function m_(i){var l=i.alternate;return i===st||l!==null&&l===st}function g_(i,l){da=Ac=!0;var f=i.pending;f===null?l.next=l:(l.next=f.next,f.next=l),i.pending=l}function y_(i,l,f){if((f&4194240)!==0){var y=l.lanes;y&=i.pendingLanes,f|=y,l.lanes=f,Tf(i,f)}}var Ic={readContext:gn,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},$4={readContext:gn,useCallback:function(i,l){return Zn().memoizedState=[i,l===void 0?null:l],i},useContext:gn,useEffect:o_,useImperativeHandle:function(i,l,f){return f=f!=null?f.concat([i]):null,Rc(4194308,4,c_.bind(null,l,i),f)},useLayoutEffect:function(i,l){return Rc(4194308,4,i,l)},useInsertionEffect:function(i,l){return Rc(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=L4.bind(null,st,i),[y.memoizedState,i]},useRef:function(i){var l=Zn();return i={current:i},l.memoizedState=i},useState:s_,useDebugValue:Eh,useDeferredValue:function(i){return Zn().memoizedState=i},useTransition:function(){var i=s_(!1),l=i[0];return i=P4.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(),St===null)throw Error(n(349));(Os&30)!==0||Z1(y,l,f)}_.memoizedState=f;var E={value:f,getSnapshot:l};return _.queue=E,o_(t_.bind(null,y,E,i),[i]),y.flags|=2048,pa(9,e_.bind(null,y,E,f,l),void 0,null),f},useId:function(){var i=Zn(),l=St.identifierPrefix;if(Xe){var f=wr,y=xr;f=(y&~(1<<32-en(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=fa++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=O4++,l=":"+l+"r"+f.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},q4={readContext:gn,useCallback:d_,useContext:gn,useEffect:Ch,useImperativeHandle:u_,useInsertionEffect:a_,useLayoutEffect:l_,useMemo:f_,useReducer:kh,useRef:i_,useState:function(){return kh(ha)},useDebugValue:Eh,useDeferredValue:function(i){var l=yn();return h_(l,wt.memoizedState,i)},useTransition:function(){var i=kh(ha)[0],l=yn().memoizedState;return[i,l]},useMutableSource:Q1,useSyncExternalStore:J1,useId:p_,unstable_isNewReconciler:!1},F4={readContext:gn,useCallback:d_,useContext:gn,useEffect:Ch,useImperativeHandle:u_,useInsertionEffect:a_,useLayoutEffect:l_,useMemo:f_,useReducer:Nh,useRef:i_,useState:function(){return Nh(ha)},useDebugValue:Eh,useDeferredValue:function(i){var l=yn();return wt===null?l.memoizedState=i:h_(l,wt.memoizedState,i)},useTransition:function(){var i=Nh(ha)[0],l=yn().memoizedState;return[i,l]},useMutableSource:Q1,useSyncExternalStore:J1,useId:p_,unstable_isNewReconciler:!1};function An(i,l){if(i&&i.defaultProps){l=Y({},l),i=i.defaultProps;for(var f in i)l[f]===void 0&&(l[f]=i[f]);return l}return l}function jh(i,l,f,y){l=i.memoizedState,f=f(y,l),f=f==null?l:Y({},l,f),i.memoizedState=f,i.lanes===0&&(i.updateQueue.baseState=f)}var Oc={isMounted:function(i){return(i=i._reactInternals)?Yn(i)===i:!1},enqueueSetState:function(i,l,f){i=i._reactInternals;var y=$t(),_=ns(i),E=_r(y,_);E.payload=l,f!=null&&(E.callback=f),l=Jr(i,E,_),l!==null&&(In(l,i,_,y),Cc(l,i,_))},enqueueReplaceState:function(i,l,f){i=i._reactInternals;var y=$t(),_=ns(i),E=_r(y,_);E.tag=1,E.payload=l,f!=null&&(E.callback=f),l=Jr(i,E,_),l!==null&&(In(l,i,_,y),Cc(l,i,_))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var f=$t(),y=ns(i),_=_r(f,y);_.tag=2,l!=null&&(_.callback=l),l=Jr(i,_,y),l!==null&&(In(l,i,y,f),Cc(l,i,y))}};function v_(i,l,f,y,_,E,M){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(y,E,M):l.prototype&&l.prototype.isPureReactComponent?!ea(f,y)||!ea(_,E):!0}function x_(i,l,f){var y=!1,_=Yr,E=l.contextType;return typeof E=="object"&&E!==null?E=gn(E):(_=Wt(l)?Ts:jt.current,y=l.contextTypes,E=(y=y!=null)?Ni(i,_):Yr),l=new l(f,E),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Oc,i.stateNode=l,l._reactInternals=i,y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=_,i.__reactInternalMemoizedMaskedChildContext=E),l}function w_(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&&Oc.enqueueReplaceState(l,l.state,null)}function Th(i,l,f,y){var _=i.stateNode;_.props=f,_.state=i.memoizedState,_.refs={},mh(i);var E=l.contextType;typeof E=="object"&&E!==null?_.context=gn(E):(E=Wt(l)?Ts:jt.current,_.context=Ni(i,E)),_.state=i.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(jh(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&&Oc.enqueueReplaceState(_,_.state,null),Ec(i,f,_,y),_.state=i.memoizedState),typeof _.componentDidMount=="function"&&(i.flags|=4194308)}function Ii(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 Ah(i,l,f){return{value:i,source:null,stack:f??null,digest:l??null}}function Rh(i,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var B4=typeof WeakMap=="function"?WeakMap:Map;function b_(i,l,f){f=_r(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){Bc||(Bc=!0,Wh=y),Rh(i,l)},f}function __(i,l,f){f=_r(-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(){Rh(i,l)}}var E=i.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(f.callback=function(){Rh(i,l),typeof y!="function"&&(es===null?es=new Set([this]):es.add(this));var M=l.stack;this.componentDidCatch(l.value,{componentStack:M!==null?M:""})}),f}function S_(i,l,f){var y=i.pingCache;if(y===null){y=i.pingCache=new B4;var _=new Set;y.set(l,_)}else _=y.get(l),_===void 0&&(_=new Set,y.set(l,_));_.has(f)||(_.add(f),i=t3.bind(null,i,l,f),l.then(i,i))}function k_(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 N_(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=_r(-1,1),l.tag=2,Jr(f,l,1))),f.lanes|=1),i):(i.flags|=65536,i.lanes=_,i)}var z4=N.ReactCurrentOwner,Kt=!1;function Dt(i,l,f,y){l.child=i===null?U1(l,null,f,y):Ti(l,i.child,f,y)}function C_(i,l,f,y,_){f=f.render;var E=l.ref;return Ri(l,_),y=_h(i,l,f,y,E,_),f=Sh(),i!==null&&!Kt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,Sr(i,l,_)):(Xe&&f&&ih(l),l.flags|=1,Dt(i,l,y,_),l.child)}function E_(i,l,f,y,_){if(i===null){var E=f.type;return typeof E=="function"&&!Zh(E)&&E.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=E,j_(i,l,E,y,_)):(i=Kc(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 M=E.memoizedProps;if(f=f.compare,f=f!==null?f:ea,f(M,y)&&i.ref===l.ref)return Sr(i,l,_)}return l.flags|=1,i=ss(E,y),i.ref=l.ref,i.return=l,l.child=i}function j_(i,l,f,y,_){if(i!==null){var E=i.memoizedProps;if(ea(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,Sr(i,l,_)}return Mh(i,l,f,y,_)}function T_(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},Ve(Pi,sn),sn|=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,Ve(Pi,sn),sn|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=E!==null?E.baseLanes:f,Ve(Pi,sn),sn|=y}else E!==null?(y=E.baseLanes|f,l.memoizedState=null):y=f,Ve(Pi,sn),sn|=y;return Dt(i,l,_,f),l.child}function A_(i,l){var f=l.ref;(i===null&&f!==null||i!==null&&i.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function Mh(i,l,f,y,_){var E=Wt(f)?Ts:jt.current;return E=Ni(l,E),Ri(l,_),f=_h(i,l,f,y,E,_),y=Sh(),i!==null&&!Kt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~_,Sr(i,l,_)):(Xe&&y&&ih(l),l.flags|=1,Dt(i,l,f,_),l.child)}function R_(i,l,f,y,_){if(Wt(f)){var E=!0;vc(l)}else E=!1;if(Ri(l,_),l.stateNode===null)Lc(i,l),x_(l,f,y),Th(l,f,y,_),y=!0;else if(i===null){var M=l.stateNode,U=l.memoizedProps;M.props=U;var X=M.context,se=f.contextType;typeof se=="object"&&se!==null?se=gn(se):(se=Wt(f)?Ts:jt.current,se=Ni(l,se));var le=f.getDerivedStateFromProps,ce=typeof le=="function"||typeof M.getSnapshotBeforeUpdate=="function";ce||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(U!==y||X!==se)&&w_(l,M,y,se),Qr=!1;var ae=l.memoizedState;M.state=ae,Ec(l,y,M,_),X=l.memoizedState,U!==y||ae!==X||Ut.current||Qr?(typeof le=="function"&&(jh(l,f,le,y),X=l.memoizedState),(U=Qr||v_(l,f,U,y,ae,X,se))?(ce||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(l.flags|=4194308)):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=X),M.props=y,M.state=X,M.context=se,y=U):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{M=l.stateNode,K1(i,l),U=l.memoizedProps,se=l.type===l.elementType?U:An(l.type,U),M.props=se,ce=l.pendingProps,ae=M.context,X=f.contextType,typeof X=="object"&&X!==null?X=gn(X):(X=Wt(f)?Ts:jt.current,X=Ni(l,X));var ge=f.getDerivedStateFromProps;(le=typeof ge=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(U!==ce||ae!==X)&&w_(l,M,y,X),Qr=!1,ae=l.memoizedState,M.state=ae,Ec(l,y,M,_);var we=l.memoizedState;U!==ce||ae!==we||Ut.current||Qr?(typeof ge=="function"&&(jh(l,f,ge,y),we=l.memoizedState),(se=Qr||v_(l,f,se,y,ae,we,X)||!1)?(le||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(y,we,X),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(y,we,X)),typeof M.componentDidUpdate=="function"&&(l.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof M.componentDidUpdate!="function"||U===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||U===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=we),M.props=y,M.state=we,M.context=X,y=se):(typeof M.componentDidUpdate!="function"||U===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||U===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),y=!1)}return Ih(i,l,f,y,E,_)}function Ih(i,l,f,y,_,E){A_(i,l);var M=(l.flags&128)!==0;if(!y&&!M)return _&&L1(l,f,!1),Sr(i,l,E);y=l.stateNode,z4.current=l;var U=M&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,i!==null&&M?(l.child=Ti(l,i.child,null,E),l.child=Ti(l,null,U,E)):Dt(i,l,U,E),l.memoizedState=y.state,_&&L1(l,f,!0),l.child}function M_(i){var l=i.stateNode;l.pendingContext?O1(i,l.pendingContext,l.pendingContext!==l.context):l.context&&O1(i,l.context,!1),gh(i,l.containerInfo)}function I_(i,l,f,y,_){return ji(),ch(_),l.flags|=256,Dt(i,l,f,y),l.child}var Oh={dehydrated:null,treeContext:null,retryLane:0};function Ph(i){return{baseLanes:i,cachePool:null,transitions:null}}function O_(i,l,f){var y=l.pendingProps,_=rt.current,E=!1,M=(l.flags&128)!==0,U;if((U=M)||(U=i!==null&&i.memoizedState===null?!1:(_&2)!==0),U?(E=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(_|=1),Ve(rt,_&1),i===null)return lh(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):(M=y.children,i=y.fallback,E?(y=l.mode,E=l.child,M={mode:"hidden",children:M},(y&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=M):E=Gc(M,y,0,null),i=qs(i,y,f,null),E.return=l,i.return=l,E.sibling=i,l.child=E,l.child.memoizedState=Ph(f),l.memoizedState=Oh,i):Lh(l,M));if(_=i.memoizedState,_!==null&&(U=_.dehydrated,U!==null))return V4(i,l,M,y,U,_,f);if(E){E=y.fallback,M=l.mode,_=i.child,U=_.sibling;var X={mode:"hidden",children:y.children};return(M&1)===0&&l.child!==_?(y=l.child,y.childLanes=0,y.pendingProps=X,l.deletions=null):(y=ss(_,X),y.subtreeFlags=_.subtreeFlags&14680064),U!==null?E=ss(U,E):(E=qs(E,M,f,null),E.flags|=2),E.return=l,y.return=l,y.sibling=E,l.child=y,y=E,E=l.child,M=i.child.memoizedState,M=M===null?Ph(f):{baseLanes:M.baseLanes|f,cachePool:null,transitions:M.transitions},E.memoizedState=M,E.childLanes=i.childLanes&~f,l.memoizedState=Oh,y}return E=i.child,i=E.sibling,y=ss(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 Lh(i,l){return l=Gc({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function Pc(i,l,f,y){return y!==null&&ch(y),Ti(l,i.child,null,f),i=Lh(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function V4(i,l,f,y,_,E,M){if(f)return l.flags&256?(l.flags&=-257,y=Ah(Error(n(422))),Pc(i,l,M,y)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(E=y.fallback,_=l.mode,y=Gc({mode:"visible",children:y.children},_,0,null),E=qs(E,_,M,null),E.flags|=2,y.return=l,E.return=l,y.sibling=E,l.child=y,(l.mode&1)!==0&&Ti(l,i.child,null,M),l.child.memoizedState=Ph(M),l.memoizedState=Oh,E);if((l.mode&1)===0)return Pc(i,l,M,null);if(_.data==="$!"){if(y=_.nextSibling&&_.nextSibling.dataset,y)var U=y.dgst;return y=U,E=Error(n(419)),y=Ah(E,y,void 0),Pc(i,l,M,y)}if(U=(M&i.childLanes)!==0,Kt||U){if(y=St,y!==null){switch(M&-M){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|M))!==0?0:_,_!==0&&_!==E.retryLane&&(E.retryLane=_,br(i,_),In(y,i,_,-1))}return Jh(),y=Ah(Error(n(421))),Pc(i,l,M,y)}return _.data==="$?"?(l.flags|=128,l.child=i.child,l=n3.bind(null,i),_._reactRetry=l,null):(i=E.treeContext,rn=Kr(_.nextSibling),nn=l,Xe=!0,Tn=null,i!==null&&(pn[mn++]=xr,pn[mn++]=wr,pn[mn++]=As,xr=i.id,wr=i.overflow,As=l),l=Lh(l,y.children),l.flags|=4096,l)}function P_(i,l,f){i.lanes|=l;var y=i.alternate;y!==null&&(y.lanes|=l),hh(i.return,l,f)}function Dh(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 L_(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&&P_(i,f,l);else if(i.tag===19)P_(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(Ve(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&&jc(i)===null&&(_=f),f=f.sibling;f=_,f===null?(_=l.child,l.child=null):(_=f.sibling,f.sibling=null),Dh(l,!1,_,f,E);break;case"backwards":for(f=null,_=l.child,l.child=null;_!==null;){if(i=_.alternate,i!==null&&jc(i)===null){l.child=_;break}i=_.sibling,_.sibling=f,f=_,_=i}Dh(l,!0,f,null,E);break;case"together":Dh(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Lc(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function Sr(i,l,f){if(i!==null&&(l.dependencies=i.dependencies),Ps|=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=ss(i,i.pendingProps),l.child=f,f.return=l;i.sibling!==null;)i=i.sibling,f=f.sibling=ss(i,i.pendingProps),f.return=l;f.sibling=null}return l.child}function H4(i,l,f){switch(l.tag){case 3:M_(l),ji();break;case 5:X1(l);break;case 1:Wt(l.type)&&vc(l);break;case 4:gh(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,_=l.memoizedProps.value;Ve(kc,y._currentValue),y._currentValue=_;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Ve(rt,rt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?O_(i,l,f):(Ve(rt,rt.current&1),i=Sr(i,l,f),i!==null?i.sibling:null);Ve(rt,rt.current&1);break;case 19:if(y=(f&l.childLanes)!==0,(i.flags&128)!==0){if(y)return L_(i,l,f);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Ve(rt,rt.current),y)break;return null;case 22:case 23:return l.lanes=0,T_(i,l,f)}return Sr(i,l,f)}var D_,$h,$_,q_;D_=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}},$h=function(){},$_=function(i,l,f,y){var _=i.memoizedProps;if(_!==y){i=l.stateNode,Is(Jn.current);var E=null;switch(f){case"input":_=Se(i,_),y=Se(i,y),E=[];break;case"select":_=Y({},_,{value:void 0}),y=Y({},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=mc)}Lt(f,y);var M;f=null;for(se in _)if(!y.hasOwnProperty(se)&&_.hasOwnProperty(se)&&_[se]!=null)if(se==="style"){var U=_[se];for(M in U)U.hasOwnProperty(M)&&(f||(f={}),f[M]="")}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(U=_!=null?_[se]:void 0,y.hasOwnProperty(se)&&X!==U&&(X!=null||U!=null))if(se==="style")if(U){for(M in U)!U.hasOwnProperty(M)||X&&X.hasOwnProperty(M)||(f||(f={}),f[M]="");for(M in X)X.hasOwnProperty(M)&&U[M]!==X[M]&&(f||(f={}),f[M]=X[M])}else f||(E||(E=[]),E.push(se,f)),f=X;else se==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,U=U?U.__html:void 0,X!=null&&U!==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"&&We("scroll",i),E||U===X||(E=[])):(E=E||[]).push(se,X))}f&&(E=E||[]).push("style",f);var se=E;(l.updateQueue=se)&&(l.flags|=4)}},q_=function(i,l,f,y){f!==y&&(l.flags|=4)};function ma(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 U4(i,l,f){var y=l.pendingProps;switch(oh(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)&&yc(),At(l),null;case 3:return y=l.stateNode,Mi(),Ke(Ut),Ke(jt),xh(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(i===null||i.child===null)&&(_c(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Tn!==null&&(Yh(Tn),Tn=null))),$h(i,l),At(l),null;case 5:yh(l);var _=Is(ua.current);if(f=l.type,i!==null&&l.stateNode!=null)$_(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=Is(Jn.current),_c(l)){y=l.stateNode,f=l.type;var E=l.memoizedProps;switch(y[Qn]=l,y[ia]=E,i=(l.mode&1)!==0,f){case"dialog":We("cancel",y),We("close",y);break;case"iframe":case"object":case"embed":We("load",y);break;case"video":case"audio":for(_=0;_<na.length;_++)We(na[_],y);break;case"source":We("error",y);break;case"img":case"image":case"link":We("error",y),We("load",y);break;case"details":We("toggle",y);break;case"input":xe(y,E),We("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!E.multiple},We("invalid",y);break;case"textarea":Ue(y,E),We("invalid",y)}Lt(f,E),_=null;for(var M in E)if(E.hasOwnProperty(M)){var U=E[M];M==="children"?typeof U=="string"?y.textContent!==U&&(E.suppressHydrationWarning!==!0&&pc(y.textContent,U,i),_=["children",U]):typeof U=="number"&&y.textContent!==""+U&&(E.suppressHydrationWarning!==!0&&pc(y.textContent,U,i),_=["children",""+U]):s.hasOwnProperty(M)&&U!=null&&M==="onScroll"&&We("scroll",y)}switch(f){case"input":me(y),tt(y,E,!0);break;case"textarea":me(y),It(y);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(y.onclick=mc)}y=_,l.updateQueue=y,y!==null&&(l.flags|=4)}else{M=_.nodeType===9?_:_.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Vt(f)),i==="http://www.w3.org/1999/xhtml"?f==="script"?(i=M.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=M.createElement(f,{is:y.is}):(i=M.createElement(f),f==="select"&&(M=i,y.multiple?M.multiple=!0:y.size&&(M.size=y.size))):i=M.createElementNS(i,f),i[Qn]=l,i[ia]=y,D_(i,l,!1,!1),l.stateNode=i;e:{switch(M=Zt(f,y),f){case"dialog":We("cancel",i),We("close",i),_=y;break;case"iframe":case"object":case"embed":We("load",i),_=y;break;case"video":case"audio":for(_=0;_<na.length;_++)We(na[_],i);_=y;break;case"source":We("error",i),_=y;break;case"img":case"image":case"link":We("error",i),We("load",i),_=y;break;case"details":We("toggle",i),_=y;break;case"input":xe(i,y),_=Se(i,y),We("invalid",i);break;case"option":_=y;break;case"select":i._wrapperState={wasMultiple:!!y.multiple},_=Y({},y,{value:void 0}),We("invalid",i);break;case"textarea":Ue(i,y),_=it(i,y),We("invalid",i);break;default:_=y}Lt(f,_),U=_;for(E in U)if(U.hasOwnProperty(E)){var X=U[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!=="")&&ze(i,X):typeof X=="number"&&ze(i,""+X):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(s.hasOwnProperty(E)?X!=null&&E==="onScroll"&&We("scroll",i):X!=null&&k(i,E,X,M))}switch(f){case"input":me(i),tt(i,y,!1);break;case"textarea":me(i),It(i);break;case"option":y.value!=null&&i.setAttribute("value",""+te(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=mc)}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)q_(i,l,i.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(f=Is(ua.current),Is(Jn.current),_c(l)){if(y=l.stateNode,f=l.memoizedProps,y[Qn]=l,(E=y.nodeValue!==f)&&(i=nn,i!==null))switch(i.tag){case 3:pc(y.nodeValue,f,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&pc(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(Ke(rt),y=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Xe&&rn!==null&&(l.mode&1)!==0&&(l.flags&128)===0)z1(),ji(),l.flags|=98560,E=!1;else if(E=_c(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 ji(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;At(l),E=!1}else Tn!==null&&(Yh(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):Jh())),l.updateQueue!==null&&(l.flags|=4),At(l),null);case 4:return Mi(),$h(i,l),i===null&&ra(l.stateNode.containerInfo),At(l),null;case 10:return fh(l.type._context),At(l),null;case 17:return Wt(l.type)&&yc(),At(l),null;case 19:if(Ke(rt),E=l.memoizedState,E===null)return At(l),null;if(y=(l.flags&128)!==0,M=E.rendering,M===null)if(y)ma(E,!1);else{if(bt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(M=jc(i),M!==null){for(l.flags|=128,ma(E,!1),y=M.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,M=E.alternate,M===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=M.childLanes,E.lanes=M.lanes,E.child=M.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=M.memoizedProps,E.memoizedState=M.memoizedState,E.updateQueue=M.updateQueue,E.type=M.type,i=M.dependencies,E.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),f=f.sibling;return Ve(rt,rt.current&1|2),l.child}i=i.sibling}E.tail!==null&&nt()>Li&&(l.flags|=128,y=!0,ma(E,!1),l.lanes=4194304)}else{if(!y)if(i=jc(M),i!==null){if(l.flags|=128,y=!0,f=i.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),ma(E,!0),E.tail===null&&E.tailMode==="hidden"&&!M.alternate&&!Xe)return At(l),null}else 2*nt()-E.renderingStartTime>Li&&f!==1073741824&&(l.flags|=128,y=!0,ma(E,!1),l.lanes=4194304);E.isBackwards?(M.sibling=l.child,l.child=M):(f=E.last,f!==null?f.sibling=M:l.child=M,E.last=M)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=nt(),l.sibling=null,f=rt.current,Ve(rt,y?f&1|2:f&1),l):(At(l),null);case 22:case 23:return Qh(),y=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(l.flags|=8192),y&&(l.mode&1)!==0?(sn&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 W4(i,l){switch(oh(l),l.tag){case 1:return Wt(l.type)&&yc(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Mi(),Ke(Ut),Ke(jt),xh(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return yh(l),null;case 13:if(Ke(rt),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));ji()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Ke(rt),null;case 4:return Mi(),null;case 10:return fh(l.type._context),null;case 22:case 23:return Qh(),null;case 24:return null;default:return null}}var Dc=!1,Rt=!1,K4=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Oi(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 qh(i,l,f){try{f()}catch(y){at(i,l,y)}}var F_=!1;function G4(i,l){if(Qf=rc,i=v1(),Vf(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 M=0,U=-1,X=-1,se=0,le=0,ce=i,ae=null;t:for(;;){for(var ge;ce!==f||_!==0&&ce.nodeType!==3||(U=M+_),ce!==E||y!==0&&ce.nodeType!==3||(X=M+y),ce.nodeType===3&&(M+=ce.nodeValue.length),(ge=ce.firstChild)!==null;)ae=ce,ce=ge;for(;;){if(ce===i)break t;if(ae===f&&++se===_&&(U=M),ae===E&&++le===y&&(X=M),(ge=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=ge}f=U===-1||X===-1?null:{start:U,end:X}}else f=null}f=f||{start:0,end:0}}else f=null;for(Jf={focusedElem:i,selectionRange:f},rc=!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 _e=we.memoizedProps,lt=we.memoizedState,ne=l.stateNode,Z=ne.getSnapshotBeforeUpdate(l.elementType===l.type?_e:An(l.type,_e),lt);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(ue){at(l,l.return,ue)}if(i=l.sibling,i!==null){i.return=l.return,ve=i;break}ve=l.return}return we=F_,F_=!1,we}function ga(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&&qh(l,f,E)}_=_.next}while(_!==y)}}function $c(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 Fh(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 B_(i){var l=i.alternate;l!==null&&(i.alternate=null,B_(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[Qn],delete l[ia],delete l[nh],delete l[A4],delete l[R4])),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 z_(i){return i.tag===5||i.tag===3||i.tag===4}function V_(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||z_(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 Bh(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=mc));else if(y!==4&&(i=i.child,i!==null))for(Bh(i,l,f),i=i.sibling;i!==null;)Bh(i,l,f),i=i.sibling}function zh(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(zh(i,l,f),i=i.sibling;i!==null;)zh(i,l,f),i=i.sibling}var Nt=null,Rn=!1;function Zr(i,l,f){for(f=f.child;f!==null;)H_(i,l,f),f=f.sibling}function H_(i,l,f){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(Cs,f)}catch{}switch(f.tag){case 5:Rt||Oi(f,l);case 6:var y=Nt,_=Rn;Nt=null,Zr(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?th(i.parentNode,f):i.nodeType===1&&th(i,f),Go(i)):th(Nt,f.stateNode));break;case 4:y=Nt,_=Rn,Nt=f.stateNode.containerInfo,Rn=!0,Zr(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=_,M=E.destroy;E=E.tag,M!==void 0&&((E&2)!==0||(E&4)!==0)&&qh(f,l,M),_=_.next}while(_!==y)}Zr(i,l,f);break;case 1:if(!Rt&&(Oi(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(U){at(f,l,U)}Zr(i,l,f);break;case 21:Zr(i,l,f);break;case 22:f.mode&1?(Rt=(y=Rt)||f.memoizedState!==null,Zr(i,l,f),Rt=y):Zr(i,l,f);break;default:Zr(i,l,f)}}function U_(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var f=i.stateNode;f===null&&(f=i.stateNode=new K4),l.forEach(function(y){var _=r3.bind(null,i,y);f.has(y)||(f.add(y),y.then(_,_))})}}function Mn(i,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var _=f[y];try{var E=i,M=l,U=M;e:for(;U!==null;){switch(U.tag){case 5:Nt=U.stateNode,Rn=!1;break e;case 3:Nt=U.stateNode.containerInfo,Rn=!0;break e;case 4:Nt=U.stateNode.containerInfo,Rn=!0;break e}U=U.return}if(Nt===null)throw Error(n(160));H_(E,M,_),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;)W_(l,i),l=l.sibling}function W_(i,l){var f=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Mn(l,i),er(i),y&4){try{ga(3,i,i.return),$c(3,i)}catch(_e){at(i,i.return,_e)}try{ga(5,i,i.return)}catch(_e){at(i,i.return,_e)}}break;case 1:Mn(l,i),er(i),y&512&&f!==null&&Oi(f,f.return);break;case 5:if(Mn(l,i),er(i),y&512&&f!==null&&Oi(f,f.return),i.flags&32){var _=i.stateNode;try{ze(_,"")}catch(_e){at(i,i.return,_e)}}if(y&4&&(_=i.stateNode,_!=null)){var E=i.memoizedProps,M=f!==null?f.memoizedProps:E,U=i.type,X=i.updateQueue;if(i.updateQueue=null,X!==null)try{U==="input"&&E.type==="radio"&&E.name!=null&&Ce(_,E),Zt(U,M);var se=Zt(U,E);for(M=0;M<X.length;M+=2){var le=X[M],ce=X[M+1];le==="style"?Pt(_,ce):le==="dangerouslySetInnerHTML"?ot(_,ce):le==="children"?ze(_,ce):k(_,le,ce,se)}switch(U){case"input":Ne(_,E);break;case"textarea":Mt(_,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))}_[ia]=E}catch(_e){at(i,i.return,_e)}}break;case 6:if(Mn(l,i),er(i),y&4){if(i.stateNode===null)throw Error(n(162));_=i.stateNode,E=i.memoizedProps;try{_.nodeValue=E}catch(_e){at(i,i.return,_e)}}break;case 3:if(Mn(l,i),er(i),y&4&&f!==null&&f.memoizedState.isDehydrated)try{Go(l.containerInfo)}catch(_e){at(i,i.return,_e)}break;case 4:Mn(l,i),er(i);break;case 13:Mn(l,i),er(i),_=i.child,_.flags&8192&&(E=_.memoizedState!==null,_.stateNode.isHidden=E,!E||_.alternate!==null&&_.alternate.memoizedState!==null||(Uh=nt())),y&4&&U_(i);break;case 22:if(le=f!==null&&f.memoizedState!==null,i.mode&1?(Rt=(se=Rt)||le,Mn(l,i),Rt=se):Mn(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:ga(4,ae,ae.return);break;case 1:Oi(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(_e){at(y,f,_e)}}break;case 5:Oi(ae,ae.return);break;case 22:if(ae.memoizedState!==null){Y_(ce);continue}}ge!==null?(ge.return=ae,ve=ge):Y_(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"):(U=ce.stateNode,X=ce.memoizedProps.style,M=X!=null&&X.hasOwnProperty("display")?X.display:null,U.style.display=Ot("display",M))}catch(_e){at(i,i.return,_e)}}}else if(ce.tag===6){if(le===null)try{ce.stateNode.nodeValue=se?"":ce.memoizedProps}catch(_e){at(i,i.return,_e)}}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:Mn(l,i),er(i),y&4&&U_(i);break;case 21:break;default:Mn(l,i),er(i)}}function er(i){var l=i.flags;if(l&2){try{e:{for(var f=i.return;f!==null;){if(z_(f)){var y=f;break e}f=f.return}throw Error(n(160))}switch(y.tag){case 5:var _=y.stateNode;y.flags&32&&(ze(_,""),y.flags&=-33);var E=V_(i);zh(i,E,_);break;case 3:case 4:var M=y.stateNode.containerInfo,U=V_(i);Bh(i,U,M);break;default:throw Error(n(161))}}catch(X){at(i,i.return,X)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function Y4(i,l,f){ve=i,K_(i)}function K_(i,l,f){for(var y=(i.mode&1)!==0;ve!==null;){var _=ve,E=_.child;if(_.tag===22&&y){var M=_.memoizedState!==null||Dc;if(!M){var U=_.alternate,X=U!==null&&U.memoizedState!==null||Rt;U=Dc;var se=Rt;if(Dc=M,(Rt=X)&&!se)for(ve=_;ve!==null;)M=ve,X=M.child,M.tag===22&&M.memoizedState!==null?X_(_):X!==null?(X.return=M,ve=X):X_(_);for(;E!==null;)ve=E,K_(E),E=E.sibling;ve=_,Dc=U,Rt=se}G_(i)}else(_.subtreeFlags&8772)!==0&&E!==null?(E.return=_,ve=E):G_(i)}}function G_(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||$c(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&&Y1(l,E,y);break;case 3:var M=l.updateQueue;if(M!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}Y1(l,M,f)}break;case 5:var U=l.stateNode;if(f===null&&l.flags&4){f=U;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&&Go(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Rt||l.flags&512&&Fh(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 Y_(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 X_(i){for(;ve!==null;){var l=ve;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{$c(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{Fh(l)}catch(X){at(l,E,X)}break;case 5:var M=l.return;try{Fh(l)}catch(X){at(l,M,X)}}}catch(X){at(l,l.return,X)}if(l===i){ve=null;break}var U=l.sibling;if(U!==null){U.return=l.return,ve=U;break}ve=l.return}}var X4=Math.ceil,qc=N.ReactCurrentDispatcher,Vh=N.ReactCurrentOwner,vn=N.ReactCurrentBatchConfig,$e=0,St=null,ht=null,Ct=0,sn=0,Pi=Gr(0),bt=0,ya=null,Ps=0,Fc=0,Hh=0,va=null,Gt=null,Uh=0,Li=1/0,kr=null,Bc=!1,Wh=null,es=null,zc=!1,ts=null,Vc=0,xa=0,Kh=null,Hc=-1,Uc=0;function $t(){return($e&6)!==0?nt():Hc!==-1?Hc:Hc=nt()}function ns(i){return(i.mode&1)===0?1:($e&2)!==0&&Ct!==0?Ct&-Ct:I4.transition!==null?(Uc===0&&(Uc=mi()),Uc):(i=Fe,i!==0||(i=window.event,i=i===void 0?16:Jb(i.type)),i)}function In(i,l,f,y){if(50<xa)throw xa=0,Kh=null,Error(n(185));Es(i,f,y),(($e&2)===0||i!==St)&&(i===St&&(($e&2)===0&&(Fc|=f),bt===4&&rs(i,Ct)),Yt(i,y),f===1&&$e===0&&(l.mode&1)===0&&(Li=nt()+500,xc&&Xr()))}function Yt(i,l){var f=i.callbackNode;jf(i,l);var y=pi(i,i===St?Ct:0);if(y===0)f!==null&&Yl(f),i.callbackNode=null,i.callbackPriority=0;else if(l=y&-y,i.callbackPriority!==l){if(f!=null&&Yl(f),l===1)i.tag===0?M4(J_.bind(null,i)):D1(J_.bind(null,i)),j4(function(){($e&6)===0&&Xr()}),f=null;else{switch(Hb(y)){case 1:f=Bo;break;case 4:f=Ql;break;case 16:f=di;break;case 536870912:f=Jl;break;default:f=di}f=oS(f,Q_.bind(null,i))}i.callbackPriority=l,i.callbackNode=f}}function Q_(i,l){if(Hc=-1,Uc=0,($e&6)!==0)throw Error(n(327));var f=i.callbackNode;if(Di()&&i.callbackNode!==f)return null;var y=pi(i,i===St?Ct:0);if(y===0)return null;if((y&30)!==0||(y&i.expiredLanes)!==0||l)l=Wc(i,y);else{l=y;var _=$e;$e|=2;var E=eS();(St!==i||Ct!==l)&&(kr=null,Li=nt()+500,Ds(i,l));do try{Z4();break}catch(U){Z_(i,U)}while(!0);dh(),qc.current=E,$e=_,ht!==null?l=0:(St=null,Ct=0,l=bt)}if(l!==0){if(l===2&&(_=zo(i),_!==0&&(y=_,l=Gh(i,_))),l===1)throw f=ya,Ds(i,0),rs(i,y),Yt(i,nt()),f;if(l===6)rs(i,y);else{if(_=i.current.alternate,(y&30)===0&&!Q4(_)&&(l=Wc(i,y),l===2&&(E=zo(i),E!==0&&(y=E,l=Gh(i,E))),l===1))throw f=ya,Ds(i,0),rs(i,y),Yt(i,nt()),f;switch(i.finishedWork=_,i.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:$s(i,Gt,kr);break;case 3:if(rs(i,y),(y&130023424)===y&&(l=Uh+500-nt(),10<l)){if(pi(i,0)!==0)break;if(_=i.suspendedLanes,(_&y)!==y){$t(),i.pingedLanes|=i.suspendedLanes&_;break}i.timeoutHandle=eh($s.bind(null,i,Gt,kr),l);break}$s(i,Gt,kr);break;case 4:if(rs(i,y),(y&4194240)===y)break;for(l=i.eventTimes,_=-1;0<y;){var M=31-en(y);E=1<<M,M=l[M],M>_&&(_=M),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*X4(y/1960))-y,10<y){i.timeoutHandle=eh($s.bind(null,i,Gt,kr),y);break}$s(i,Gt,kr);break;case 5:$s(i,Gt,kr);break;default:throw Error(n(329))}}}return Yt(i,nt()),i.callbackNode===f?Q_.bind(null,i):null}function Gh(i,l){var f=va;return i.current.memoizedState.isDehydrated&&(Ds(i,l).flags|=256),i=Wc(i,l),i!==2&&(l=Gt,Gt=f,l!==null&&Yh(l)),i}function Yh(i){Gt===null?Gt=i:Gt.push.apply(Gt,i)}function Q4(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 rs(i,l){for(l&=~Hh,l&=~Fc,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var f=31-en(l),y=1<<f;i[f]=-1,l&=~y}}function J_(i){if(($e&6)!==0)throw Error(n(327));Di();var l=pi(i,0);if((l&1)===0)return Yt(i,nt()),null;var f=Wc(i,l);if(i.tag!==0&&f===2){var y=zo(i);y!==0&&(l=y,f=Gh(i,y))}if(f===1)throw f=ya,Ds(i,0),rs(i,l),Yt(i,nt()),f;if(f===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,$s(i,Gt,kr),Yt(i,nt()),null}function Xh(i,l){var f=$e;$e|=1;try{return i(l)}finally{$e=f,$e===0&&(Li=nt()+500,xc&&Xr())}}function Ls(i){ts!==null&&ts.tag===0&&($e&6)===0&&Di();var l=$e;$e|=1;var f=vn.transition,y=Fe;try{if(vn.transition=null,Fe=1,i)return i()}finally{Fe=y,vn.transition=f,$e=l,($e&6)===0&&Xr()}}function Qh(){sn=Pi.current,Ke(Pi)}function Ds(i,l){i.finishedWork=null,i.finishedLanes=0;var f=i.timeoutHandle;if(f!==-1&&(i.timeoutHandle=-1,E4(f)),ht!==null)for(f=ht.return;f!==null;){var y=f;switch(oh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&yc();break;case 3:Mi(),Ke(Ut),Ke(jt),xh();break;case 5:yh(y);break;case 4:Mi();break;case 13:Ke(rt);break;case 19:Ke(rt);break;case 10:fh(y.type._context);break;case 22:case 23:Qh()}f=f.return}if(St=i,ht=i=ss(i.current,null),Ct=sn=l,bt=0,ya=null,Hh=Fc=Ps=0,Gt=va=null,Ms!==null){for(l=0;l<Ms.length;l++)if(f=Ms[l],y=f.interleaved,y!==null){f.interleaved=null;var _=y.next,E=f.pending;if(E!==null){var M=E.next;E.next=_,y.next=M}f.pending=y}Ms=null}return i}function Z_(i,l){do{var f=ht;try{if(dh(),Tc.current=Ic,Ac){for(var y=st.memoizedState;y!==null;){var _=y.queue;_!==null&&(_.pending=null),y=y.next}Ac=!1}if(Os=0,_t=wt=st=null,da=!1,fa=0,Vh.current=null,f===null||f.return===null){bt=1,ya=l,ht=null;break}e:{var E=i,M=f.return,U=f,X=l;if(l=Ct,U.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var se=X,le=U,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=k_(M);if(ge!==null){ge.flags&=-257,N_(ge,M,U,E,l),ge.mode&1&&S_(E,se,l),l=ge,X=se;var we=l.updateQueue;if(we===null){var _e=new Set;_e.add(X),l.updateQueue=_e}else we.add(X);break e}else{if((l&1)===0){S_(E,se,l),Jh();break e}X=Error(n(426))}}else if(Xe&&U.mode&1){var lt=k_(M);if(lt!==null){(lt.flags&65536)===0&&(lt.flags|=256),N_(lt,M,U,E,l),ch(Ii(X,U));break e}}E=X=Ii(X,U),bt!==4&&(bt=2),va===null?va=[E]:va.push(E),E=M;do{switch(E.tag){case 3:E.flags|=65536,l&=-l,E.lanes|=l;var ne=b_(E,X,l);G1(E,ne);break e;case 1:U=X;var Z=E.type,re=E.stateNode;if((E.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(es===null||!es.has(re)))){E.flags|=65536,l&=-l,E.lanes|=l;var ue=__(E,U,l);G1(E,ue);break e}}E=E.return}while(E!==null)}nS(f)}catch(ke){l=ke,ht===f&&f!==null&&(ht=f=f.return);continue}break}while(!0)}function eS(){var i=qc.current;return qc.current=Ic,i===null?Ic:i}function Jh(){(bt===0||bt===3||bt===2)&&(bt=4),St===null||(Ps&268435455)===0&&(Fc&268435455)===0||rs(St,Ct)}function Wc(i,l){var f=$e;$e|=2;var y=eS();(St!==i||Ct!==l)&&(kr=null,Ds(i,l));do try{J4();break}catch(_){Z_(i,_)}while(!0);if(dh(),$e=f,qc.current=y,ht!==null)throw Error(n(261));return St=null,Ct=0,bt}function J4(){for(;ht!==null;)tS(ht)}function Z4(){for(;ht!==null&&!bf();)tS(ht)}function tS(i){var l=iS(i.alternate,i,sn);i.memoizedProps=i.pendingProps,l===null?nS(i):ht=l,Vh.current=null}function nS(i){var l=i;do{var f=l.alternate;if(i=l.return,(l.flags&32768)===0){if(f=U4(f,l,sn),f!==null){ht=f;return}}else{if(f=W4(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 $s(i,l,f){var y=Fe,_=vn.transition;try{vn.transition=null,Fe=1,e3(i,l,f,y)}finally{vn.transition=_,Fe=y}return null}function e3(i,l,f,y){do Di();while(ts!==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(ec(i,E),i===St&&(ht=St=null,Ct=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||zc||(zc=!0,oS(di,function(){return Di(),null})),E=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||E){E=vn.transition,vn.transition=null;var M=Fe;Fe=1;var U=$e;$e|=4,Vh.current=null,G4(i,f),W_(f,i),w4(Jf),rc=!!Qf,Jf=Qf=null,i.current=f,Y4(f),Xl(),$e=U,Fe=M,vn.transition=E}else i.current=f;if(zc&&(zc=!1,ts=i,Vc=_),E=i.pendingLanes,E===0&&(es=null),kf(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(Bc)throw Bc=!1,i=Wh,Wh=null,i;return(Vc&1)!==0&&i.tag!==0&&Di(),E=i.pendingLanes,(E&1)!==0?i===Kh?xa++:(xa=0,Kh=i):xa=0,Xr(),null}function Di(){if(ts!==null){var i=Hb(Vc),l=vn.transition,f=Fe;try{if(vn.transition=null,Fe=16>i?16:i,ts===null)var y=!1;else{if(i=ts,ts=null,Vc=0,($e&6)!==0)throw Error(n(331));var _=$e;for($e|=4,ve=i.current;ve!==null;){var E=ve,M=E.child;if((ve.flags&16)!==0){var U=E.deletions;if(U!==null){for(var X=0;X<U.length;X++){var se=U[X];for(ve=se;ve!==null;){var le=ve;switch(le.tag){case 0:case 11:case 15:ga(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(B_(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 _e=we.child;if(_e!==null){we.child=null;do{var lt=_e.sibling;_e.sibling=null,_e=lt}while(_e!==null)}}ve=E}}if((E.subtreeFlags&2064)!==0&&M!==null)M.return=E,ve=M;else e:for(;ve!==null;){if(E=ve,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:ga(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;){M=ve;var re=M.child;if((M.subtreeFlags&2064)!==0&&re!==null)re.return=M,ve=re;else e:for(M=Z;ve!==null;){if(U=ve,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:$c(9,U)}}catch(ke){at(U,U.return,ke)}if(U===M){ve=null;break e}var ue=U.sibling;if(ue!==null){ue.return=U.return,ve=ue;break e}ve=U.return}}if($e=_,Xr(),hn&&typeof hn.onPostCommitFiberRoot=="function")try{hn.onPostCommitFiberRoot(Cs,i)}catch{}y=!0}return y}finally{Fe=f,vn.transition=l}}return!1}function rS(i,l,f){l=Ii(f,l),l=b_(i,l,1),i=Jr(i,l,1),l=$t(),i!==null&&(Es(i,1,l),Yt(i,l))}function at(i,l,f){if(i.tag===3)rS(i,i,f);else for(;l!==null;){if(l.tag===3){rS(l,i,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(es===null||!es.has(y))){i=Ii(f,i),i=__(l,i,1),l=Jr(l,i,1),i=$t(),l!==null&&(Es(l,1,i),Yt(l,i));break}}l=l.return}}function t3(i,l,f){var y=i.pingCache;y!==null&&y.delete(l),l=$t(),i.pingedLanes|=i.suspendedLanes&f,St===i&&(Ct&f)===f&&(bt===4||bt===3&&(Ct&130023424)===Ct&&500>nt()-Uh?Ds(i,0):Hh|=f),Yt(i,l)}function sS(i,l){l===0&&((i.mode&1)===0?l=1:(l=hi,hi<<=1,(hi&130023424)===0&&(hi=4194304)));var f=$t();i=br(i,l),i!==null&&(Es(i,l,f),Yt(i,f))}function n3(i){var l=i.memoizedState,f=0;l!==null&&(f=l.retryLane),sS(i,f)}function r3(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),sS(i,f)}var iS;iS=function(i,l,f){if(i!==null)if(i.memoizedProps!==l.pendingProps||Ut.current)Kt=!0;else{if((i.lanes&f)===0&&(l.flags&128)===0)return Kt=!1,H4(i,l,f);Kt=(i.flags&131072)!==0}else Kt=!1,Xe&&(l.flags&1048576)!==0&&$1(l,bc,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;Lc(i,l),i=l.pendingProps;var _=Ni(l,jt.current);Ri(l,f),_=_h(null,l,y,i,_,f);var E=Sh();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,vc(l)):E=!1,l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,mh(l),_.updater=Oc,l.stateNode=_,_._reactInternals=l,Th(l,y,i,f),l=Ih(null,l,y,!0,E,f)):(l.tag=0,Xe&&E&&ih(l),Dt(null,l,_,f),l=l.child),l;case 16:y=l.elementType;e:{switch(Lc(i,l),i=l.pendingProps,_=y._init,y=_(y._payload),l.type=y,_=l.tag=i3(y),i=An(y,i),_){case 0:l=Mh(null,l,y,i,f);break e;case 1:l=R_(null,l,y,i,f);break e;case 11:l=C_(null,l,y,i,f);break e;case 14:l=E_(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,_),Mh(i,l,y,_,f);case 1:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:An(y,_),R_(i,l,y,_,f);case 3:e:{if(M_(l),i===null)throw Error(n(387));y=l.pendingProps,E=l.memoizedState,_=E.element,K1(i,l),Ec(l,y,null,f);var M=l.memoizedState;if(y=M.element,E.isDehydrated)if(E={element:y,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){_=Ii(Error(n(423)),l),l=I_(i,l,y,f,_);break e}else if(y!==_){_=Ii(Error(n(424)),l),l=I_(i,l,y,f,_);break e}else for(rn=Kr(l.stateNode.containerInfo.firstChild),nn=l,Xe=!0,Tn=null,f=U1(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(ji(),y===_){l=Sr(i,l,f);break e}Dt(i,l,y,f)}l=l.child}return l;case 5:return X1(l),i===null&&lh(l),y=l.type,_=l.pendingProps,E=i!==null?i.memoizedProps:null,M=_.children,Zf(y,_)?M=null:E!==null&&Zf(y,E)&&(l.flags|=32),A_(i,l),Dt(i,l,M,f),l.child;case 6:return i===null&&lh(l),null;case 13:return O_(i,l,f);case 4:return gh(l,l.stateNode.containerInfo),y=l.pendingProps,i===null?l.child=Ti(l,null,y,f):Dt(i,l,y,f),l.child;case 11:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:An(y,_),C_(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,M=_.value,Ve(kc,y._currentValue),y._currentValue=M,E!==null)if(jn(E.value,M)){if(E.children===_.children&&!Ut.current){l=Sr(i,l,f);break e}}else for(E=l.child,E!==null&&(E.return=l);E!==null;){var U=E.dependencies;if(U!==null){M=E.child;for(var X=U.firstContext;X!==null;){if(X.context===y){if(E.tag===1){X=_r(-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),hh(E.return,f,l),U.lanes|=f;break}X=X.next}}else if(E.tag===10)M=E.type===l.type?null:E.child;else if(E.tag===18){if(M=E.return,M===null)throw Error(n(341));M.lanes|=f,U=M.alternate,U!==null&&(U.lanes|=f),hh(M,f,l),M=E.sibling}else M=E.child;if(M!==null)M.return=E;else for(M=E;M!==null;){if(M===l){M=null;break}if(E=M.sibling,E!==null){E.return=M.return,M=E;break}M=M.return}E=M}Dt(i,l,_.children,f),l=l.child}return l;case 9:return _=l.type,y=l.pendingProps.children,Ri(l,f),_=gn(_),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,_),E_(i,l,y,_,f);case 15:return j_(i,l,l.type,l.pendingProps,f);case 17:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:An(y,_),Lc(i,l),l.tag=1,Wt(y)?(i=!0,vc(l)):i=!1,Ri(l,f),x_(l,y,_),Th(l,y,_,f),Ih(null,l,y,!0,i,f);case 19:return L_(i,l,f);case 22:return T_(i,l,f)}throw Error(n(156,l.tag))};function oS(i,l){return Gl(i,l)}function s3(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 xn(i,l,f,y){return new s3(i,l,f,y)}function Zh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function i3(i){if(typeof i=="function")return Zh(i)?1:0;if(i!=null){if(i=i.$$typeof,i===$)return 11;if(i===V)return 14}return 2}function ss(i,l){var f=i.alternate;return f===null?(f=xn(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 Kc(i,l,f,y,_,E){var M=2;if(y=i,typeof i=="function")Zh(i)&&(M=1);else if(typeof i=="string")M=5;else e:switch(i){case A:return qs(f.children,_,E,l);case O:M=8,_|=8;break;case L:return i=xn(12,f,l,_|2),i.elementType=L,i.lanes=E,i;case H:return i=xn(13,f,l,_),i.elementType=H,i.lanes=E,i;case D:return i=xn(19,f,l,_),i.elementType=D,i.lanes=E,i;case Q:return Gc(f,_,E,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:M=10;break e;case I:M=9;break e;case $:M=11;break e;case V:M=14;break e;case z:M=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=xn(M,f,l,_),l.elementType=i,l.type=y,l.lanes=E,l}function qs(i,l,f,y){return i=xn(7,i,y,l),i.lanes=f,i}function Gc(i,l,f,y){return i=xn(22,i,y,l),i.elementType=Q,i.lanes=f,i.stateNode={isHidden:!1},i}function ep(i,l,f){return i=xn(6,i,null,l),i.lanes=f,i}function tp(i,l,f){return l=xn(4,i.children!==null?i.children:[],i.key,l),l.lanes=f,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function o3(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=Vo(0),this.expirationTimes=Vo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vo(0),this.identifierPrefix=y,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function np(i,l,f,y,_,E,M,U,X){return i=new o3(i,l,f,U,X),l===1?(l=1,E===!0&&(l|=8)):l=0,E=xn(3,null,null,l),i.current=E,E.stateNode=i,E.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},mh(E),i}function a3(i,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:y==null?null:""+y,children:i,containerInfo:l,implementation:f}}function aS(i){if(!i)return Yr;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 P1(i,f,l)}return l}function lS(i,l,f,y,_,E,M,U,X){return i=np(f,y,!0,i,_,E,M,U,X),i.context=aS(null),f=i.current,y=$t(),_=ns(f),E=_r(y,_),E.callback=l??null,Jr(f,E,_),i.current.lanes=_,Es(i,_,y),Yt(i,y),i}function Yc(i,l,f,y){var _=l.current,E=$t(),M=ns(_);return f=aS(f),l.context===null?l.context=f:l.pendingContext=f,l=_r(E,M),l.payload={element:i},y=y===void 0?null:y,y!==null&&(l.callback=y),i=Jr(_,l,M),i!==null&&(In(i,_,M,E),Cc(i,_,M)),M}function Xc(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 cS(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var f=i.retryLane;i.retryLane=f!==0&&f<l?f:l}}function rp(i,l){cS(i,l),(i=i.alternate)&&cS(i,l)}function l3(){return null}var uS=typeof reportError=="function"?reportError:function(i){console.error(i)};function sp(i){this._internalRoot=i}Qc.prototype.render=sp.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));Yc(i,l,null,null)},Qc.prototype.unmount=sp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Ls(function(){Yc(null,i,null,null)}),l[yr]=null}};function Qc(i){this._internalRoot=i}Qc.prototype.unstable_scheduleHydration=function(i){if(i){var l=Kb();i={blockedOn:null,target:i,priority:l};for(var f=0;f<Hr.length&&l!==0&&l<Hr[f].priority;f++);Hr.splice(f,0,i),f===0&&Xb(i)}};function ip(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Jc(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function dS(){}function c3(i,l,f,y,_){if(_){if(typeof y=="function"){var E=y;y=function(){var se=Xc(M);E.call(se)}}var M=lS(l,y,i,0,null,!1,!1,"",dS);return i._reactRootContainer=M,i[yr]=M.current,ra(i.nodeType===8?i.parentNode:i),Ls(),M}for(;_=i.lastChild;)i.removeChild(_);if(typeof y=="function"){var U=y;y=function(){var se=Xc(X);U.call(se)}}var X=np(i,0,!1,null,null,!1,!1,"",dS);return i._reactRootContainer=X,i[yr]=X.current,ra(i.nodeType===8?i.parentNode:i),Ls(function(){Yc(l,X,f,y)}),X}function Zc(i,l,f,y,_){var E=f._reactRootContainer;if(E){var M=E;if(typeof _=="function"){var U=_;_=function(){var X=Xc(M);U.call(X)}}Yc(l,M,i,_)}else M=c3(f,l,i,_,y);return Xc(M)}Ub=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var f=Xn(l.pendingLanes);f!==0&&(Tf(l,f|1),Yt(l,nt()),($e&6)===0&&(Li=nt()+500,Xr()))}break;case 13:Ls(function(){var y=br(i,1);if(y!==null){var _=$t();In(y,i,1,_)}}),rp(i,1)}},Af=function(i){if(i.tag===13){var l=br(i,134217728);if(l!==null){var f=$t();In(l,i,134217728,f)}rp(i,134217728)}},Wb=function(i){if(i.tag===13){var l=ns(i),f=br(i,l);if(f!==null){var y=$t();In(f,i,l,y)}rp(i,l)}},Kb=function(){return Fe},Gb=function(i,l){var f=Fe;try{return Fe=i,l()}finally{Fe=f}},Po=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 _=gc(y);if(!_)throw Error(n(90));ye(y),Ne(y,_)}}}break;case"textarea":Mt(i,f);break;case"select":l=f.value,l!=null&&xt(i,!!f.multiple,l,!1)}},Vl=Xh,Hl=Ls;var u3={usingClientEntryPoint:!1,Events:[oa,Si,gc,Bl,zl,Xh]},wa={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},d3={bundleType:wa.bundleType,version:wa.version,rendererPackageName:wa.rendererPackageName,rendererConfig:wa.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=Wl(i),i===null?null:i.stateNode},findFiberByHostInstance:wa.findFiberByHostInstance||l3,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 eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eu.isDisabled&&eu.supportsFiber)try{Cs=eu.inject(d3),hn=eu}catch{}}return Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u3,Xt.createPortal=function(i,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ip(l))throw Error(n(200));return a3(i,l,null,f)},Xt.createRoot=function(i,l){if(!ip(i))throw Error(n(299));var f=!1,y="",_=uS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),l=np(i,1,!1,null,null,f,!1,y,_),i[yr]=l.current,ra(i.nodeType===8?i.parentNode:i),new sp(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=Wl(l),i=i===null?null:i.stateNode,i},Xt.flushSync=function(i){return Ls(i)},Xt.hydrate=function(i,l,f){if(!Jc(l))throw Error(n(200));return Zc(null,i,l,!0,f)},Xt.hydrateRoot=function(i,l,f){if(!ip(i))throw Error(n(405));var y=f!=null&&f.hydratedSources||null,_=!1,E="",M=uS;if(f!=null&&(f.unstable_strictMode===!0&&(_=!0),f.identifierPrefix!==void 0&&(E=f.identifierPrefix),f.onRecoverableError!==void 0&&(M=f.onRecoverableError)),l=lS(l,null,i,1,f??null,_,!1,E,M),i[yr]=l.current,ra(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 Qc(l)},Xt.render=function(i,l,f){if(!Jc(l))throw Error(n(200));return Zc(null,i,l,!1,f)},Xt.unmountComponentAtNode=function(i){if(!Jc(i))throw Error(n(40));return i._reactRootContainer?(Ls(function(){Zc(null,null,i,!1,function(){i._reactRootContainer=null,i[yr]=null})}),!0):!1},Xt.unstable_batchedUpdates=Xh,Xt.unstable_renderSubtreeIntoContainer=function(i,l,f,y){if(!Jc(f))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return Zc(i,l,f,!1,y)},Xt.version="18.3.1-next-f1338f8080-20240426",Xt}var xS;function cA(){if(xS)return lp.exports;xS=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(),lp.exports=x3(),lp.exports}var wS;function w3(){if(wS)return nu;wS=1;var e=cA();return nu.createRoot=e.createRoot,nu.hydrateRoot=e.hydrateRoot,nu}var b3=w3();const _3=hl(b3);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 S3={value:()=>{}};function gd(){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 Au(n)}function Au(e){this._=e}function k3(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}})}Au.prototype=gd.prototype={constructor:Au,on:function(e,t){var n=this._,r=k3(e+"",n),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=N3(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]=bS(n[s],e.name,t);else if(t==null)for(s in n)n[s]=bS(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 Au(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 N3(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function bS(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=S3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var gx="http://www.w3.org/1999/xhtml";const _S={svg:"http://www.w3.org/2000/svg",xhtml:gx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),_S.hasOwnProperty(t)?{space:_S[t],local:e}:e}function C3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===gx&&t.documentElement.namespaceURI===gx?t.createElement(e):t.createElementNS(n,e)}}function E3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function uA(e){var t=yd(e);return(t.local?E3:C3)(t)}function j3(){}function ow(e){return e==null?j3:function(){return this.querySelector(e)}}function T3(e){typeof e!="function"&&(e=ow(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,h=0;h<a;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d);return new un(r,this._parents)}function A3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function R3(){return[]}function dA(e){return e==null?R3:function(){return this.querySelectorAll(e)}}function M3(e){return function(){return A3(e.apply(this,arguments))}}function I3(e){typeof e=="function"?e=M3(e):e=dA(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 un(r,s)}function fA(e){return function(){return this.matches(e)}}function hA(e){return function(t){return t.matches(e)}}var O3=Array.prototype.find;function P3(e){return function(){return O3.call(this.children,e)}}function L3(){return this.firstElementChild}function D3(e){return this.select(e==null?L3:P3(typeof e=="function"?e:hA(e)))}var $3=Array.prototype.filter;function q3(){return Array.from(this.children)}function F3(e){return function(){return $3.call(this.children,e)}}function B3(e){return this.selectAll(e==null?q3:F3(typeof e=="function"?e:hA(e)))}function z3(e){typeof e!="function"&&(e=fA(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 un(r,this._parents)}function pA(e){return new Array(e.length)}function V3(){return new un(this._enter||this._groups.map(pA),this._parents)}function Uu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Uu.prototype={constructor:Uu,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 H3(e){return function(){return e}}function U3(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 Uu(e,o[a]);for(;a<u;++a)(c=t[a])&&(s[a]=c)}function W3(e,t,n,r,s,o,a){var c,u,d=new Map,h=t.length,m=o.length,g=new Array(h),v;for(c=0;c<h;++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 Uu(e,o[c]);for(c=0;c<h;++c)(u=t[c])&&d.get(g[c])===u&&(s[c]=u)}function K3(e){return e.__data__}function G3(e,t){if(!arguments.length)return Array.from(this,K3);var n=t?W3:U3,r=this._parents,s=this._groups;typeof e!="function"&&(e=H3(e));for(var o=s.length,a=new Array(o),c=new Array(o),u=new Array(o),d=0;d<o;++d){var h=r[d],m=s[d],g=m.length,v=Y3(e.call(h,h&&h.__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(h,m,x,w,S,v,t);for(var C=0,k=0,N,T;C<b;++C)if(N=x[C]){for(C>=k&&(k=C+1);!(T=w[k])&&++k<b;);N._next=T||null}}return a=new un(a,r),a._enter=c,a._exit=u,a}function Y3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function X3(){return new un(this._exit||this._groups.map(pA),this._parents)}function Q3(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 J3(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],h=r[u],m=d.length,g=c[u]=new Array(m),v,b=0;b<m;++b)(v=d[b]||h[b])&&(g[b]=v);for(;u<s;++u)c[u]=n[u];return new un(c,this._parents)}function Z3(){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 eD(e){e||(e=tD);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,h=0;h<c;++h)(d=a[h])&&(u[h]=d);u.sort(t)}return new un(s,this._parents).order()}function tD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function nD(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function rD(){return Array.from(this)}function sD(){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 iD(){let e=0;for(const t of this)++e;return e}function oD(){return!this.node()}function aD(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 lD(e){return function(){this.removeAttribute(e)}}function cD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uD(e,t){return function(){this.setAttribute(e,t)}}function dD(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function fD(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function hD(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 pD(e,t){var n=yd(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?cD:lD:typeof t=="function"?n.local?hD:fD:n.local?dD:uD)(n,t))}function mA(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mD(e){return function(){this.style.removeProperty(e)}}function gD(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yD(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function vD(e,t,n){return arguments.length>1?this.each((t==null?mD:typeof t=="function"?yD:gD)(e,t,n??"")):io(this.node(),e)}function io(e,t){return e.style.getPropertyValue(t)||mA(e).getComputedStyle(e,null).getPropertyValue(t)}function xD(e){return function(){delete this[e]}}function wD(e,t){return function(){this[e]=t}}function bD(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _D(e,t){return arguments.length>1?this.each((t==null?xD:typeof t=="function"?bD:wD)(e,t)):this.node()[e]}function gA(e){return e.trim().split(/^|\s+/)}function aw(e){return e.classList||new yA(e)}function yA(e){this._node=e,this._names=gA(e.getAttribute("class")||"")}yA.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 vA(e,t){for(var n=aw(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function xA(e,t){for(var n=aw(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function SD(e){return function(){vA(this,e)}}function kD(e){return function(){xA(this,e)}}function ND(e,t){return function(){(t.apply(this,arguments)?vA:xA)(this,e)}}function CD(e,t){var n=gA(e+"");if(arguments.length<2){for(var r=aw(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?ND:t?SD:kD)(n,t))}function ED(){this.textContent=""}function jD(e){return function(){this.textContent=e}}function TD(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function AD(e){return arguments.length?this.each(e==null?ED:(typeof e=="function"?TD:jD)(e)):this.node().textContent}function RD(){this.innerHTML=""}function MD(e){return function(){this.innerHTML=e}}function ID(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function OD(e){return arguments.length?this.each(e==null?RD:(typeof e=="function"?ID:MD)(e)):this.node().innerHTML}function PD(){this.nextSibling&&this.parentNode.appendChild(this)}function LD(){return this.each(PD)}function DD(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $D(){return this.each(DD)}function qD(e){var t=typeof e=="function"?e:uA(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function FD(){return null}function BD(e,t){var n=typeof e=="function"?e:uA(e),r=t==null?FD:typeof t=="function"?t:ow(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zD(){var e=this.parentNode;e&&e.removeChild(this)}function VD(){return this.each(zD)}function HD(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function UD(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function WD(e){return this.select(e?UD:HD)}function KD(e){return arguments.length?this.property("__data__",e):this.node().__data__}function GD(e){return function(t){e.call(this,t,this.__data__)}}function YD(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 XD(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 QD(e,t,n){return function(){var r=this.__on,s,o=GD(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 JD(e,t,n){var r=YD(e+""),s,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,d=c.length,h;u<d;++u)for(s=0,h=c[u];s<o;++s)if((a=r[s]).type===h.type&&a.name===h.name)return h.value}return}for(c=t?QD:XD,s=0;s<o;++s)this.each(c(r[s],t,n));return this}function wA(e,t,n){var r=mA(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 ZD(e,t){return function(){return wA(this,e,t)}}function e5(e,t){return function(){return wA(this,e,t.apply(this,arguments))}}function t5(e,t){return this.each((typeof t=="function"?e5:ZD)(e,t))}function*n5(){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 bA=[null];function un(e,t){this._groups=e,this._parents=t}function ml(){return new un([[document.documentElement]],bA)}function r5(){return this}un.prototype=ml.prototype={constructor:un,select:T3,selectAll:I3,selectChild:D3,selectChildren:B3,filter:z3,data:G3,enter:V3,exit:X3,join:Q3,merge:J3,selection:r5,order:Z3,sort:eD,call:nD,nodes:rD,node:sD,size:iD,empty:oD,each:aD,attr:pD,style:vD,property:_D,classed:CD,text:AD,html:OD,raise:LD,lower:$D,append:qD,insert:BD,remove:VD,clone:WD,datum:KD,on:JD,dispatch:t5,[Symbol.iterator]:n5};function ln(e){return typeof e=="string"?new un([[document.querySelector(e)]],[document.documentElement]):new un([[e]],bA)}function s5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ln(e,t){if(e=s5(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 i5={passive:!1},Wa={capture:!0,passive:!1};function dp(e){e.stopImmediatePropagation()}function Ji(e){e.preventDefault(),e.stopImmediatePropagation()}function _A(e){var t=e.document.documentElement,n=ln(e).on("dragstart.drag",Ji,Wa);"onselectstart"in t?n.on("selectstart.drag",Ji,Wa):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function SA(e,t){var n=e.document.documentElement,r=ln(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ji,Wa),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 ru=e=>()=>e;function yx(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:a,y:c,dx:u,dy:d,dispatch:h}){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:h}})}yx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function o5(e){return!e.ctrlKey&&!e.button}function a5(){return this.parentNode}function l5(e,t){return t??{x:e.x,y:e.y}}function c5(){return navigator.maxTouchPoints||"ontouchstart"in this}function kA(){var e=o5,t=a5,n=l5,r=c5,s={},o=gd("start","drag","end"),a=0,c,u,d,h,m=0;function g(N){N.on("mousedown.drag",v).filter(r).on("touchstart.drag",w).on("touchmove.drag",S,i5).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(N,T){if(!(h||!e.call(this,N,T))){var R=k(this,t.call(this,N,T),N,T,"mouse");R&&(ln(N.view).on("mousemove.drag",b,Wa).on("mouseup.drag",x,Wa),_A(N.view),dp(N),d=!1,c=N.clientX,u=N.clientY,R("start",N))}}function b(N){if(Ji(N),!d){var T=N.clientX-c,R=N.clientY-u;d=T*T+R*R>m}s.mouse("drag",N)}function x(N){ln(N.view).on("mousemove.drag mouseup.drag",null),SA(N.view,d),Ji(N),s.mouse("end",N)}function w(N,T){if(e.call(this,N,T)){var R=N.changedTouches,A=t.call(this,N,T),O=R.length,L,B;for(L=0;L<O;++L)(B=k(this,A,N,T,R[L].identifier,R[L]))&&(dp(N),B("start",N,R[L]))}}function S(N){var T=N.changedTouches,R=T.length,A,O;for(A=0;A<R;++A)(O=s[T[A].identifier])&&(Ji(N),O("drag",N,T[A]))}function C(N){var T=N.changedTouches,R=T.length,A,O;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),A=0;A<R;++A)(O=s[T[A].identifier])&&(dp(N),O("end",N,T[A]))}function k(N,T,R,A,O,L){var B=o.copy(),I=Ln(L||R,T),$,H,D;if((D=n.call(N,new yx("beforestart",{sourceEvent:R,target:g,identifier:O,active:a,x:I[0],y:I[1],dx:0,dy:0,dispatch:B}),A))!=null)return $=D.x-I[0]||0,H=D.y-I[1]||0,function V(z,Q,F){var q=I,Y;switch(z){case"start":s[O]=V,Y=a++;break;case"end":delete s[O],--a;case"drag":I=Ln(F||Q,T),Y=a;break}B.call(z,N,new yx(z,{sourceEvent:Q,subject:D,target:g,identifier:O,active:Y,x:I[0]+$,y:I[1]+H,dx:I[0]-q[0],dy:I[1]-q[1],dispatch:B}),A)}}return g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:ru(!!N),g):e},g.container=function(N){return arguments.length?(t=typeof N=="function"?N:ru(N),g):t},g.subject=function(N){return arguments.length?(n=typeof N=="function"?N:ru(N),g):n},g.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:ru(!!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 lw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function NA(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function gl(){}var Ka=.7,Wu=1/Ka,Zi="\\s*([+-]?\\d+)\\s*",Ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",or="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u5=/^#([0-9a-f]{3,8})$/,d5=new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`),f5=new RegExp(`^rgb\\(${or},${or},${or}\\)$`),h5=new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${Ga}\\)$`),p5=new RegExp(`^rgba\\(${or},${or},${or},${Ga}\\)$`),m5=new RegExp(`^hsl\\(${Ga},${or},${or}\\)$`),g5=new RegExp(`^hsla\\(${Ga},${or},${or},${Ga}\\)$`),SS={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};lw(gl,Ks,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kS,formatHex:kS,formatHex8:y5,formatHsl:v5,formatRgb:NS,toString:NS});function kS(){return this.rgb().formatHex()}function y5(){return this.rgb().formatHex8()}function v5(){return CA(this).formatHsl()}function NS(){return this.rgb().formatRgb()}function Ks(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=u5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?CS(t):n===3?new Qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?su(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?su(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=d5.exec(e))?new Qt(t[1],t[2],t[3],1):(t=f5.exec(e))?new Qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=h5.exec(e))?su(t[1],t[2],t[3],t[4]):(t=p5.exec(e))?su(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=m5.exec(e))?TS(t[1],t[2]/100,t[3]/100,1):(t=g5.exec(e))?TS(t[1],t[2]/100,t[3]/100,t[4]):SS.hasOwnProperty(e)?CS(SS[e]):e==="transparent"?new Qt(NaN,NaN,NaN,0):null}function CS(e){return new Qt(e>>16&255,e>>8&255,e&255,1)}function su(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qt(e,t,n,r)}function x5(e){return e instanceof gl||(e=Ks(e)),e?(e=e.rgb(),new Qt(e.r,e.g,e.b,e.opacity)):new Qt}function vx(e,t,n,r){return arguments.length===1?x5(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}lw(Qt,vx,NA(gl,{brighter(e){return e=e==null?Wu:Math.pow(Wu,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ka:Math.pow(Ka,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qt(Us(this.r),Us(this.g),Us(this.b),Ku(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:ES,formatHex:ES,formatHex8:w5,formatRgb:jS,toString:jS}));function ES(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}`}function w5(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}${zs((isNaN(this.opacity)?1:this.opacity)*255)}`}function jS(){const e=Ku(this.opacity);return`${e===1?"rgb(":"rgba("}${Us(this.r)}, ${Us(this.g)}, ${Us(this.b)}${e===1?")":`, ${e})`}`}function Ku(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Us(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zs(e){return e=Us(e),(e<16?"0":"")+e.toString(16)}function TS(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 CA(e){if(e instanceof $n)return new $n(e.h,e.s,e.l,e.opacity);if(e instanceof gl||(e=Ks(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 b5(e,t,n,r){return arguments.length===1?CA(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}lw($n,b5,NA(gl,{brighter(e){return e=e==null?Wu:Math.pow(Wu,e),new $n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ka:Math.pow(Ka,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(fp(e>=240?e-240:e+120,s,r),fp(e,s,r),fp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new $n(AS(this.h),iu(this.s),iu(this.l),Ku(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=Ku(this.opacity);return`${e===1?"hsl(":"hsla("}${AS(this.h)}, ${iu(this.s)*100}%, ${iu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function AS(e){return e=(e||0)%360,e<0?e+360:e}function iu(e){return Math.max(0,Math.min(1,e||0))}function fp(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 cw=e=>()=>e;function _5(e,t){return function(n){return e+n*t}}function S5(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 k5(e){return(e=+e)==1?EA:function(t,n){return n-t?S5(t,n,e):cw(isNaN(t)?n:t)}}function EA(e,t){var n=t-e;return n?_5(e,n):cw(isNaN(e)?t:e)}const Gu=(function e(t){var n=k5(t);function r(s,o){var a=n((s=vx(s)).r,(o=vx(o)).r),c=n(s.g,o.g),u=n(s.b,o.b),d=EA(s.opacity,o.opacity);return function(h){return s.r=a(h),s.g=c(h),s.b=u(h),s.opacity=d(h),s+""}}return r.gamma=e,r})(1);function N5(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 C5(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E5(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]=qa(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 j5(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 T5(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]=qa(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var xx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hp=new RegExp(xx.source,"g");function A5(e){return function(){return e}}function R5(e){return function(t){return e(t)+""}}function jA(e,t){var n=xx.lastIndex=hp.lastIndex=0,r,s,o,a=-1,c=[],u=[];for(e=e+"",t=t+"";(r=xx.exec(e))&&(s=hp.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=hp.lastIndex;return n<t.length&&(o=t.slice(n),c[a]?c[a]+=o:c[++a]=o),c.length<2?u[0]?R5(u[0].x):A5(t):(t=u.length,function(d){for(var h=0,m;h<t;++h)c[(m=u[h]).i]=m.x(d);return c.join("")})}function qa(e,t){var n=typeof t,r;return t==null||n==="boolean"?cw(t):(n==="number"?tr:n==="string"?(r=Ks(t))?(t=r,Gu):jA:t instanceof Ks?Gu:t instanceof Date?j5:C5(t)?N5:Array.isArray(t)?E5:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?T5:tr)(e,t)}var RS=180/Math.PI,wx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function TA(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)*RS,skewX:Math.atan(u)*RS,scaleX:a,scaleY:c}}var ou;function M5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?wx:TA(t.a,t.b,t.c,t.d,t.e,t.f)}function I5(e){return e==null||(ou||(ou=document.createElementNS("http://www.w3.org/2000/svg","g")),ou.setAttribute("transform",e),!(e=ou.transform.baseVal.consolidate()))?wx:(e=e.matrix,TA(e.a,e.b,e.c,e.d,e.e,e.f))}function AA(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function o(d,h,m,g,v,b){if(d!==m||h!==g){var x=v.push("translate(",null,t,null,n);b.push({i:x-4,x:tr(d,m)},{i:x-2,x:tr(h,g)})}else(m||g)&&v.push("translate("+m+t+g+n)}function a(d,h,m,g){d!==h?(d-h>180?h+=360:h-d>180&&(d+=360),g.push({i:m.push(s(m)+"rotate(",null,r)-2,x:tr(d,h)})):h&&m.push(s(m)+"rotate("+h+r)}function c(d,h,m,g){d!==h?g.push({i:m.push(s(m)+"skewX(",null,r)-2,x:tr(d,h)}):h&&m.push(s(m)+"skewX("+h+r)}function u(d,h,m,g,v,b){if(d!==m||h!==g){var x=v.push(s(v)+"scale(",null,",",null,")");b.push({i:x-4,x:tr(d,m)},{i:x-2,x:tr(h,g)})}else(m!==1||g!==1)&&v.push(s(v)+"scale("+m+","+g+")")}return function(d,h){var m=[],g=[];return d=e(d),h=e(h),o(d.translateX,d.translateY,h.translateX,h.translateY,m,g),a(d.rotate,h.rotate,m,g),c(d.skewX,h.skewX,m,g),u(d.scaleX,d.scaleY,h.scaleX,h.scaleY,m,g),d=h=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 O5=AA(M5,"px, ","px)","deg)"),P5=AA(I5,", ",")",")"),L5=1e-12;function MS(e){return((e=Math.exp(e))+1/e)/2}function D5(e){return((e=Math.exp(e))-1/e)/2}function $5(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ru=(function e(t,n,r){function s(o,a){var c=o[0],u=o[1],d=o[2],h=a[0],m=a[1],g=a[2],v=h-c,b=m-u,x=v*v+b*b,w,S;if(x<L5)S=Math.log(g/d)/t,w=function(A){return[c+A*v,u+A*b,d*Math.exp(t*A*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),T=Math.log(Math.sqrt(k*k+1)-k),R=Math.log(Math.sqrt(N*N+1)-N);S=(R-T)/t,w=function(A){var O=A*S,L=MS(T),B=d/(n*C)*(L*$5(t*O+T)-D5(T));return[c+B*v,u+B*b,d*L/MS(t*O+T)]}}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 oo=0,ja=0,_a=0,RA=1e3,Yu,Ta,Xu=0,Gs=0,vd=0,Ya=typeof performance=="object"&&performance.now?performance:Date,MA=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function uw(){return Gs||(MA(q5),Gs=Ya.now()+vd)}function q5(){Gs=0}function Qu(){this._call=this._time=this._next=null}Qu.prototype=IA.prototype={constructor:Qu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?uw():+n)+(t==null?0:+t),!this._next&&Ta!==this&&(Ta?Ta._next=this:Yu=this,Ta=this),this._call=e,this._time=n,bx()},stop:function(){this._call&&(this._call=null,this._time=1/0,bx())}};function IA(e,t,n){var r=new Qu;return r.restart(e,t,n),r}function F5(){uw(),++oo;for(var e=Yu,t;e;)(t=Gs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--oo}function IS(){Gs=(Xu=Ya.now())+vd,oo=ja=0;try{F5()}finally{oo=0,z5(),Gs=0}}function B5(){var e=Ya.now(),t=e-Xu;t>RA&&(vd-=t,Xu=e)}function z5(){for(var e,t=Yu,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:Yu=n);Ta=e,bx(r)}function bx(e){if(!oo){ja&&(ja=clearTimeout(ja));var t=e-Gs;t>24?(e<1/0&&(ja=setTimeout(IS,e-Ya.now()-vd)),_a&&(_a=clearInterval(_a))):(_a||(Xu=Ya.now(),_a=setInterval(B5,RA)),oo=1,MA(IS))}}function OS(e,t,n){var r=new Qu;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var V5=gd("start","end","cancel","interrupt"),H5=[],OA=0,PS=1,_x=2,Mu=3,LS=4,Sx=5,Iu=6;function xd(e,t,n,r,s,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;U5(e,n,{name:t,index:r,group:s,on:V5,tween:H5,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:OA})}function dw(e,t){var n=Hn(e,t);if(n.state>OA)throw new Error("too late; already scheduled");return n}function pr(e,t){var n=Hn(e,t);if(n.state>Mu)throw new Error("too late; already running");return n}function Hn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function U5(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=IA(o,0,n.time);function o(d){n.state=PS,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var h,m,g,v;if(n.state!==PS)return u();for(h in r)if(v=r[h],v.name===n.name){if(v.state===Mu)return OS(a);v.state===LS?(v.state=Iu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[h]):+h<t&&(v.state=Iu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[h])}if(OS(function(){n.state===Mu&&(n.state=LS,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=_x,n.on.call("start",e,e.__data__,n.index,n.group),n.state===_x){for(n.state=Mu,s=new Array(g=n.tween.length),h=0,m=-1;h<g;++h)(v=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++m]=v);s.length=m+1}}function c(d){for(var h=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=Sx,1),m=-1,g=s.length;++m<g;)s[m].call(e,h);n.state===Sx&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Iu,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Ou(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>_x&&r.state<Sx,r.state=Iu,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function W5(e){return this.each(function(){Ou(this,e)})}function K5(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 G5(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 Y5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Hn(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?K5:G5)(n,e,t))}function fw(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 Hn(s,r).value[t]}}function PA(e,t){var n;return(typeof t=="number"?tr:t instanceof Ks?Gu:(n=Ks(t))?(t=n,Gu):jA)(e,t)}function X5(e){return function(){this.removeAttribute(e)}}function Q5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function J5(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 Z5(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 e$(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 t$(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 n$(e,t){var n=yd(e),r=n==="transform"?P5:PA;return this.attrTween(e,typeof t=="function"?(n.local?t$:e$)(n,r,fw(this,"attr."+e,t)):t==null?(n.local?Q5:X5)(n):(n.local?Z5:J5)(n,r,t))}function r$(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function s$(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function i$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&s$(e,o)),n}return s._value=t,s}function o$(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&r$(e,o)),n}return s._value=t,s}function a$(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=yd(e);return this.tween(n,(r.local?i$:o$)(r,t))}function l$(e,t){return function(){dw(this,e).delay=+t.apply(this,arguments)}}function c$(e,t){return t=+t,function(){dw(this,e).delay=t}}function u$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?l$:c$)(t,e)):Hn(this.node(),t).delay}function d$(e,t){return function(){pr(this,e).duration=+t.apply(this,arguments)}}function f$(e,t){return t=+t,function(){pr(this,e).duration=t}}function h$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?d$:f$)(t,e)):Hn(this.node(),t).duration}function p$(e,t){if(typeof t!="function")throw new Error;return function(){pr(this,e).ease=t}}function m$(e){var t=this._id;return arguments.length?this.each(p$(t,e)):Hn(this.node(),t).ease}function g$(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pr(this,e).ease=n}}function y$(e){if(typeof e!="function")throw new Error;return this.each(g$(this._id,e))}function v$(e){typeof e!="function"&&(e=fA(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 Mr(r,this._parents,this._name,this._id)}function x$(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],h=u.length,m=a[c]=new Array(h),g,v=0;v<h;++v)(g=u[v]||d[v])&&(m[v]=g);for(;c<r;++c)a[c]=t[c];return new Mr(a,this._parents,this._name,this._id)}function w$(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 b$(e,t,n){var r,s,o=w$(t)?dw:pr;return function(){var a=o(this,e),c=a.on;c!==r&&(s=(r=c).copy()).on(t,n),a.on=s}}function _$(e,t){var n=this._id;return arguments.length<2?Hn(this.node(),n).on.on(e):this.each(b$(n,e,t))}function S$(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function k$(){return this.on("end.remove",S$(this._id))}function N$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ow(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),h,m,g=0;g<u;++g)(h=c[g])&&(m=e.call(h,h.__data__,g,c))&&("__data__"in h&&(m.__data__=h.__data__),d[g]=m,xd(d[g],t,n,g,d,Hn(h,n)));return new Mr(o,this._parents,t,n)}function C$(e){var t=this._name,n=this._id;typeof e!="function"&&(e=dA(e));for(var r=this._groups,s=r.length,o=[],a=[],c=0;c<s;++c)for(var u=r[c],d=u.length,h,m=0;m<d;++m)if(h=u[m]){for(var g=e.call(h,h.__data__,m,u),v,b=Hn(h,n),x=0,w=g.length;x<w;++x)(v=g[x])&&xd(v,t,n,x,g,b);o.push(g),a.push(h)}return new Mr(o,a,t,n)}var E$=ml.prototype.constructor;function j$(){return new E$(this._groups,this._parents)}function T$(e,t){var n,r,s;return function(){var o=io(this,e),a=(this.style.removeProperty(e),io(this,e));return o===a?null:o===n&&a===r?s:s=t(n=o,r=a)}}function LA(e){return function(){this.style.removeProperty(e)}}function A$(e,t,n){var r,s=n+"",o;return function(){var a=io(this,e);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=io(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),io(this,e))),a===u?null:a===r&&u===s?o:(s=u,o=t(r=a,c))}}function M$(e,t){var n,r,s,o="style."+t,a="end."+o,c;return function(){var u=pr(this,e),d=u.on,h=u.value[o]==null?c||(c=LA(t)):void 0;(d!==n||s!==h)&&(r=(n=d).copy()).on(a,s=h),u.on=r}}function I$(e,t,n){var r=(e+="")=="transform"?O5:PA;return t==null?this.styleTween(e,T$(e,r)).on("end.style."+e,LA(e)):typeof t=="function"?this.styleTween(e,R$(e,r,fw(this,"style."+e,t))).each(M$(this._id,e)):this.styleTween(e,A$(e,r,t),n).on("end.style."+e,null)}function O$(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function P$(e,t,n){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&O$(e,a,n)),r}return o._value=t,o}function L$(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,P$(e,t,n??""))}function D$(e){return function(){this.textContent=e}}function $$(e){return function(){var t=e(this);this.textContent=t??""}}function q$(e){return this.tween("text",typeof e=="function"?$$(fw(this,"text",e)):D$(e==null?"":e+""))}function F$(e){return function(t){this.textContent=e.call(this,t)}}function B$(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&F$(s)),t}return r._value=e,r}function z$(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,B$(e))}function V$(){for(var e=this._name,t=this._id,n=DA(),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 h=Hn(u,t);xd(u,e,n,d,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Mr(r,this._parents,e,n)}function H$(){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),h=d.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),d.on=t}),s===0&&o()})}var U$=0;function Mr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function DA(){return++U$}var Nr=ml.prototype;Mr.prototype={constructor:Mr,select:N$,selectAll:C$,selectChild:Nr.selectChild,selectChildren:Nr.selectChildren,filter:v$,merge:x$,selection:j$,transition:V$,call:Nr.call,nodes:Nr.nodes,node:Nr.node,size:Nr.size,empty:Nr.empty,each:Nr.each,on:_$,attr:n$,attrTween:a$,style:I$,styleTween:L$,text:q$,textTween:z$,remove:k$,tween:Y5,delay:u$,duration:h$,ease:m$,easeVarying:y$,end:H$,[Symbol.iterator]:Nr[Symbol.iterator]};function W$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var K$={time:null,delay:0,duration:250,ease:W$};function G$(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 Y$(e){var t,n;e instanceof Mr?(t=e._id,e=e._name):(t=DA(),(n=K$).time=uw(),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])&&xd(u,e,t,d,a,n||G$(u,t));return new Mr(r,this._parents,e,t)}ml.prototype.interrupt=W5;ml.prototype.transition=Y$;const au=e=>()=>e;function X$(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 wd=new jr(1,0,0);$A.prototype=jr.prototype;function $A(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wd;return e.__zoom}function pp(e){e.stopImmediatePropagation()}function Sa(e){e.preventDefault(),e.stopImmediatePropagation()}function Q$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function J$(){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 DS(){return this.__zoom||wd}function Z$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eq(){return navigator.maxTouchPoints||"ontouchstart"in this}function tq(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 qA(){var e=Q$,t=J$,n=tq,r=Z$,s=eq,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Ru,d=gd("start","zoom","end"),h,m,g,v=500,b=150,x=0,w=10;function S(D){D.property("__zoom",DS).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).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",DS),D!==F?T(D,V,z,Q):F.interrupt().each(function(){R(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,Y=z==null?N(F):typeof z=="function"?z.apply(this,arguments):z,P=q.invert(Y),W=typeof V=="function"?V.apply(this,arguments):V;return n(k(C(q,W),Y,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),Y=this.__zoom,P=Q==null?N(q):typeof Q=="function"?Q.apply(this,arguments):Q;return n(wd.translate(P[0],P[1]).scale(Y.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 T(D,V,z,Q){D.on("start.zoom",function(){R(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(Q).end()}).tween("zoom",function(){var F=this,q=arguments,Y=R(F,q).event(Q),P=t.apply(F,q),W=z==null?N(P):typeof z=="function"?z.apply(F,q):z,ie=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,G=u(K.invert(W).concat(ie/K.k),J.invert(W).concat(ie/J.k));return function(ee){if(ee===1)ee=J;else{var te=G(ee),oe=ie/te[2];ee=new jr(oe,W[0]-te[0]*oe,W[1]-te[1]*oe)}Y.zoom(null,ee)}})}function R(D,V,z){return!z&&D.__zooming||new A(D,V)}function A(D,V){this.that=D,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,V),this.taps=0}A.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=ln(this.that).datum();d.call(D,this.that,new X$(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=R(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)],Ou(this),z.start()}Sa(D),z.wheel=setTimeout(Y,b),z.zoom("mouse",n(k(C(Q,F),z.mouse[0],z.mouse[1]),z.extent,a));function Y(){z.wheel=null,z.end()}}function L(D,...V){if(g||!e.apply(this,arguments))return;var z=D.currentTarget,Q=R(this,V,!0).event(D),F=ln(D.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ie,!0),q=Ln(D,z),Y=D.clientX,P=D.clientY;_A(D.view),pp(D),Q.mouse=[q,this.__zoom.invert(q)],Ou(this),Q.start();function W(K){if(Sa(K),!Q.moved){var J=K.clientX-Y,G=K.clientY-P;Q.moved=J*J+G*G>x}Q.event(K).zoom("mouse",n(k(Q.that.__zoom,Q.mouse[0]=Ln(K,z),Q.mouse[1]),Q.extent,a))}function ie(K){F.on("mousemove.zoom mouseup.zoom",null),SA(K.view,Q.moved),Sa(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),Y=n(k(C(z,q),Q,F),t.apply(this,V),a);Sa(D),c>0?ln(this).transition().duration(c).call(T,Y,Q,D):ln(this).call(S.transform,Y,Q,D)}}function I(D,...V){if(e.apply(this,arguments)){var z=D.touches,Q=z.length,F=R(this,V,D.changedTouches.length===Q).event(D),q,Y,P,W;for(pp(D),Y=0;Y<Q;++Y)P=z[Y],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+!!h);h&&(h=clearTimeout(h)),q&&(F.taps<2&&(m=W[0],h=setTimeout(function(){h=null},v)),Ou(this),F.start())}}function $(D,...V){if(this.__zooming){var z=R(this,V).event(D),Q=D.changedTouches,F=Q.length,q,Y,P,W;for(Sa(D),q=0;q<F;++q)Y=Q[q],P=Ln(Y,this),z.touch0&&z.touch0[2]===Y.identifier?z.touch0[0]=P:z.touch1&&z.touch1[2]===Y.identifier&&(z.touch1[0]=P);if(Y=z.that.__zoom,z.touch1){var ie=z.touch0[0],K=z.touch0[1],J=z.touch1[0],G=z.touch1[1],ee=(ee=J[0]-ie[0])*ee+(ee=J[1]-ie[1])*ee,te=(te=G[0]-K[0])*te+(te=G[1]-K[1])*te;Y=C(Y,Math.sqrt(ee/te)),P=[(ie[0]+J[0])/2,(ie[1]+J[1])/2],W=[(K[0]+G[0])/2,(K[1]+G[1])/2]}else if(z.touch0)P=z.touch0[0],W=z.touch0[1];else return;z.zoom("touch",n(k(Y,P,W),z.extent,a))}}function H(D,...V){if(this.__zooming){var z=R(this,V).event(D),Q=D.changedTouches,F=Q.length,q,Y;for(pp(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),q=0;q<F;++q)Y=Q[q],z.touch0&&z.touch0[2]===Y.identifier?delete z.touch0:z.touch1&&z.touch1[2]===Y.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&&(Y=Ln(Y,this),Math.hypot(m[0]-Y[0],m[1]-Y[1])<w)){var P=ln(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return S.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:au(+D),S):r},S.filter=function(D){return arguments.length?(e=typeof D=="function"?D:au(!!D),S):e},S.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:au(!!D),S):s},S.extent=function(D){return arguments.length?(t=typeof D=="function"?D:au([[+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."},Xa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],FA=["Enter"," ","Escape"],BA={"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 ao;(function(e){e.Strict="strict",e.Loose="loose"})(ao||(ao={}));var Ws;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ws||(Ws={}));var Qa;(function(e){e.Partial="partial",e.Full="full"})(Qa||(Qa={}));const zA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var hs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(hs||(hs={}));var Ju;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ju||(Ju={}));var pe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(pe||(pe={}));const $S={[pe.Left]:pe.Right,[pe.Right]:pe.Left,[pe.Top]:pe.Bottom,[pe.Bottom]:pe.Top};function VA(e){return e===null?null:e?"valid":"invalid"}const HA=e=>"id"in e&&"source"in e&&"target"in e,nq=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),hw=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yl=(e,t=[0,0])=>{const{width:n,height:r}=Pr(e),s=e.origin??t,o=n*s[0],a=r*s[1];return{x:e.position.x-o,y:e.position.y-a}},rq=(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):hw(s)?s:t.nodeLookup.get(s.id));const c=a?Zu(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bd(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _d(n)},vl=(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=bd(n,Zu(s)),r=!0)}),r?_d(n):{x:0,y:0,width:0,height:0}},pw=(e,t,[n,r,s]=[0,0,1],o=!1,a=!1)=>{const c={...wl(t,[n,r,s]),width:t.width/s,height:t.height/s},u=[];for(const d of e.values()){const{measured:h,selectable:m=!0,hidden:g=!1}=d;if(a&&!m||g)continue;const v=h.width??d.width??d.initialWidth??null,b=h.height??d.height??d.initialHeight??null,x=Ja(c,co(d)),w=(v??0)*(b??0),S=o&&x>0;(!d.internals.handleBounds||S||x>=w||d.dragging)&&u.push(d)}return u},sq=(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 iq(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 oq({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},a){if(e.size===0)return Promise.resolve(!0);const c=iq(e,a),u=vl(c),d=mw(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 UA({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},h=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&&uo(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=uo(m)?Ys(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)*h[0],y:g.y-d+(a.measured.height??0)*h[1]},positionAbsolute:g}}async function aq({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),h=sq(a,u);for(const g of u)c.has(g.id)&&!h.find(b=>b.id===g.id)&&h.push(g);if(!s)return{edges:h,nodes:a};const m=await s({nodes:a,edges:h});return typeof m=="boolean"?m?{edges:h,nodes:a}:{edges:[],nodes:[]}:m}const lo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ys=(e={x:0,y:0},t,n)=>({x:lo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:lo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function WA(e,t,n){const{width:r,height:s}=Pr(n),{x:o,y:a}=n.internals.positionAbsolute;return Ys(e,[[o,a],[o+r,a+s]],t)}const qS=(e,t,n)=>e<t?lo(Math.abs(e-t),1,t)/t:e>n?-lo(Math.abs(e-n),1,t)/t:0,KA=(e,t,n=15,r=40)=>{const s=qS(e.x,r,t.width-r)*n,o=qS(e.y,r,t.height-r)*n;return[s,o]},bd=(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)}),kx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),_d=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),co=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=hw(e)?e.internals.positionAbsolute:yl(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}},Zu=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=hw(e)?e.internals.positionAbsolute:yl(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)}},GA=(e,t)=>_d(bd(kx(e),kx(t))),Ja=(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)},FS=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),lq=(e,t)=>{},xl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wl=({x:e,y:t},[n,r,s],o=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return o?xl(c,a):c},ed=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function $i(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 cq(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=$i(e,n),s=$i(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=$i(e.top??e.y??0,n),s=$i(e.bottom??e.y??0,n),o=$i(e.left??e.x??0,t),a=$i(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 uq(e,t,n,r,s,o){const{x:a,y:c}=ed(e,[t,n,r]),{x:u,y:d}=ed({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=s-u,m=o-d;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(h),bottom:Math.floor(m)}}const mw=(e,t,n,r,s,o)=>{const a=cq(o,t,n),c=(t-a.x)/e.width,u=(n-a.y)/e.height,d=Math.min(c,u),h=lo(d,r,s),m=e.x+e.width/2,g=e.y+e.height/2,v=t/2-m*h,b=n/2-g*h,x=uq(e,v,b,h,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:h}},Za=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function uo(e){return e!=null&&e!=="parent"}function Pr(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 YA(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 XA(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 BS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function dq(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function fq(e){return{...BA,...e||{}}}function Fa(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:a}=Fn(e),c=wl({x:o-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:u,y:d}=n?xl(c,t):c;return{xSnapped:u,ySnapped:d,...c}}const gw=e=>({width:e.offsetWidth,height:e.offsetHeight}),QA=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},hq=["INPUT","SELECT","TEXTAREA"];function JA(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:hq.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ZA=e=>"clientX"in e,Fn=(e,t)=>{var o,a;const n=ZA(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)}},zS=(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,...gw(a)}})};function eR({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,h=Math.abs(u-e),m=Math.abs(d-t);return[u,d,h,m]}function lu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function VS({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case pe.Left:return[t-lu(t-r,o),n];case pe.Right:return[t+lu(r-t,o),n];case pe.Top:return[t,n-lu(n-s,o)];case pe.Bottom:return[t,n+lu(s-n,o)]}}function tR({sourceX:e,sourceY:t,sourcePosition:n=pe.Bottom,targetX:r,targetY:s,targetPosition:o=pe.Top,curvature:a=.25}){const[c,u]=VS({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[d,h]=VS({pos:o,x1:r,y1:s,x2:e,y2:t,c:a}),[m,g,v,b]=eR({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:u,targetControlX:d,targetControlY:h});return[`M${e},${t} C${c},${u} ${d},${h} ${r},${s}`,m,g,v,b]}function nR({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 pq({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 mq({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=bd(Zu(e),Zu(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 Ja(a,_d(o))>0}const gq=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,yq=(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)),rR=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||gq;let s;return HA(e)?s={...e}:s={...e,id:r(e)},yq(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function sR({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,a,c]=nR({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,a,c]}const HS={[pe.Left]:{x:-1,y:0},[pe.Right]:{x:1,y:0},[pe.Top]:{x:0,y:-1},[pe.Bottom]:{x:0,y:1}},vq=({source:e,sourcePosition:t=pe.Bottom,target:n})=>t===pe.Left||t===pe.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},US=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function xq({source:e,sourcePosition:t=pe.Bottom,target:n,targetPosition:r=pe.Top,center:s,offset:o,stepPosition:a}){const c=HS[t],u=HS[r],d={x:e.x+c.x*o,y:e.y+c.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},m=vq({source:d,sourcePosition:t,target:h}),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]=nR({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+(h.x-d.x)*a,w=s.y??(d.y+h.y)/2):(x=s.x??(d.x+h.x)/2,w=s.y??d.y+(h.y-d.y)*a);const R=[{x,y:d.y},{x,y:h.y}],A=[{x:d.x,y:w},{x:h.x,y:w}];c[g]===v?b=g==="x"?R:A:b=g==="x"?A:R}else{const R=[{x:d.x,y:h.y}],A=[{x:h.x,y:d.y}];if(g==="x"?b=c.x===v?A:R:b=c.y===v?R:A,t===r){const $=Math.abs(e[g]-n[g]);if($<=o){const H=Math.min(o-1,o-$);c[g]===v?S[g]=(d[g]>e[g]?-1:1)*H:C[g]=(h[g]>n[g]?-1:1)*H}}if(t!==r){const $=g==="x"?"y":"x",H=c[g]===u[$],D=d[$]>h[$],V=d[$]<h[$];(c[g]===1&&(!H&&D||H&&V)||c[g]!==1&&(!H&&V||H&&D))&&(b=g==="x"?R:A)}const O={x:d.x+S.x,y:d.y+S.y},L={x:h.x+C.x,y:h.y+C.y},B=Math.max(Math.abs(O.x-b[0].x),Math.abs(L.x-b[0].x)),I=Math.max(Math.abs(O.y-b[0].y),Math.abs(L.y-b[0].y));B>=I?(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:h.x+C.x,y:h.y+C.y},n],x,w,k,N]}function wq(e,t,n,r){const s=Math.min(US(e,t)/2,US(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,h=e.y<n.y?1:-1;return`L ${o+s*d},${a}Q ${o},${a} ${o},${a+s*h}`}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 Nx({sourceX:e,sourceY:t,sourcePosition:n=pe.Bottom,targetX:r,targetY:s,targetPosition:o=pe.Top,borderRadius:a=5,centerX:c,centerY:u,offset:d=20,stepPosition:h=.5}){const[m,g,v,b,x]=xq({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:c,y:u},offset:d,stepPosition:h});return[m.reduce((S,C,k)=>{let N="";return k>0&&k<m.length-1?N=wq(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 WS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function bq(e){var m;const{sourceNode:t,targetNode:n}=e;if(!WS(t)||!WS(n))return null;const r=t.internals.handleBounds||KS(t.handles),s=n.internals.handleBounds||KS(n.handles),o=GS((r==null?void 0:r.source)??[],e.sourceHandle),a=GS(e.connectionMode===ao.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)||pe.Bottom,u=(a==null?void 0:a.position)||pe.Top,d=Xs(t,o,c),h=Xs(n,a,u);return{sourceX:d.x,sourceY:d.y,targetX:h.x,targetY:h.y,sourcePosition:c,targetPosition:u}}function KS(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 Xs(e,t,n=pe.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??Pr(e);if(r)return{x:s+a/2,y:o+c/2};switch((t==null?void 0:t.position)??n){case pe.Top:return{x:s+a/2,y:o};case pe.Right:return{x:s+a,y:o+c/2};case pe.Bottom:return{x:s+a/2,y:o+c};case pe.Left:return{x:s,y:o+c/2}}}function GS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Cx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function _q(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=Cx(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 iR=1e3,Sq=10,yw={nodeOrigin:[0,0],nodeExtent:Xa,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},kq={...yw,checkEquality:!0};function vw(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Nq(e,t,n){const r=vw(yw,n);for(const s of e.values())if(s.parentId)ww(s,e,t,r);else{const o=yl(s,r.nodeOrigin),a=uo(s.extent)?s.extent:r.nodeExtent,c=Ys(o,a,Pr(s));s.internals.positionAbsolute=c}}function Cq(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 xw(e){return e==="manual"}function Ex(e,t,n,r={}){var d,h;const s=vw(kq,r),o={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!xw(s.zIndexMode)?iR: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=yl(m,s.nodeOrigin),b=uo(m.extent)?m.extent:s.nodeExtent,x=Ys(v,b,Pr(m));g={...s.defaults,...m,measured:{width:(d=m.measured)==null?void 0:d.width,height:(h=m.measured)==null?void 0:h.height},internals:{positionAbsolute:x,handleBounds:Cq(m,g),z:oR(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&&ww(g,t,n,r,o)}return u}function Eq(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 ww(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:c,zIndexMode:u}=vw(yw,r),d=e.parentId,h=t.get(d);if(!h){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}Eq(e,n),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*Sq),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const m=o&&!xw(u)?iR:0,{x:g,y:v,z:b}=jq(e,h,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 oR(e,t,n){const r=qn(e.zIndex)?e.zIndex:0;return xw(n)?r:r+(e.selected?t:0)}function jq(e,t,n,r,s,o){const{x:a,y:c}=t.internals.positionAbsolute,u=Pr(e),d=yl(e,n),h=uo(e.extent)?Ys(d,e.extent,u):d;let m=Ys({x:a+h.x,y:c+h.y},r,u);e.extent==="parent"&&(m=WA(m,u,t));const g=oR(e,s,o),v=t.internals.z??0;return{x:m.x,y:m.y,z:v>=g?v+1:g}}function bw(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)??co(u),h=GA(d,c.rect);o.set(c.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:c,parent:u},d)=>{var k;const h=u.internals.positionAbsolute,m=Pr(u),g=u.origin??r,v=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,b=c.y<h.y?Math.round(Math.abs(h.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(T=>T.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 Tq(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=[],h=window.getComputedStyle(c),{m22:m}=new window.DOMMatrixReadOnly(h.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=gw(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=uo(b.extent)?b.extent:o;let{positionAbsolute:N}=b.internals;b.parentId&&b.extent==="parent"?N=WA(N,x,t.get(b.parentId)):k&&(N=Ys(N,k,x));const T={...b,measured:x,internals:{...b.internals,positionAbsolute:N,handleBounds:{source:zS("source",v.nodeElement,C,m,b.id),target:zS("target",v.nodeElement,C,m,b.id)}}};t.set(b.id,T),b.parentId&&ww(T,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:co(T,s)}))}}if(g.length>0){const v=bw(g,t,n,s);d.push(...v)}return{changes:d,updatedInternals:u}}async function Aq({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 YS(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 aR(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}`,h=`${o}-${c}--${s}-${a}`;YS("source",u,h,e,s,a),YS("target",u,d,e,o,c),t.set(r.id,r)}}function lR(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:lR(n,t):!1}function XS(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 Rq(e,t,n,r){const s=new Map;for(const[o,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!lR(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 mp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,c,u;const s=[];for(const[d,h]of t){const m=(a=n.get(d))==null?void 0:a.internals.userNode;m&&s.push({...m,position:h.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 Mq({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=xl(o,t);return{x:a.x-o.x,y:a.y-o.y}}function Iq({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},h=null,m=!1,g=null,v=!1,b=!1,x=null;function w({noDragClassName:C,handleSelector:k,domNode:N,isSelectable:T,nodeId:R,nodeClickDistance:A=0}){g=ln(N);function O({x:$,y:H}){const{nodeLookup:D,nodeExtent:V,snapGrid:z,snapToGrid:Q,nodeOrigin:F,onNodeDrag:q,onSelectionDrag:Y,onError:P,updateNodePositions:W}=t();o={x:$,y:H};let ie=!1;const K=c.size>1,J=K&&V?kx(vl(c)):null,G=K&&Q?Mq({dragItems:c,snapGrid:z,x:$,y:H}):null;for(const[ee,te]of c){if(!D.has(ee))continue;let oe={x:$-te.distance.x,y:H-te.distance.y};Q&&(oe=G?{x:Math.round(oe.x+G.x),y:Math.round(oe.y+G.y)}:xl(oe,z));let de=null;if(K&&V&&!te.extent&&J){const{positionAbsolute:he}=te.internals,Se=he.x-J.x+V[0][0],xe=he.x+te.measured.width-J.x2+V[1][0],Ce=he.y-J.y+V[0][1],Ne=he.y+te.measured.height-J.y2+V[1][1];de=[[Se,Ce],[xe,Ne]]}const{position:me,positionAbsolute:ye}=UA({nodeId:ee,nextPosition:oe,nodeLookup:D,nodeExtent:de||V,nodeOrigin:F,onError:P});ie=ie||te.position.x!==me.x||te.position.y!==me.y,te.position=me,te.internals.positionAbsolute=ye}if(b=b||ie,!!ie&&(W(c,!0),x&&(r||q||!R&&Y))){const[ee,te]=mp({nodeId:R,dragItems:c,nodeLookup:D});r==null||r(x,c,ee,te),q==null||q(x,ee,te),R||Y==null||Y(x,te)}}async function L(){if(!h)return;const{transform:$,panBy:H,autoPanSpeed:D,autoPanOnNodeDrag:V}=t();if(!V){u=!1,cancelAnimationFrame(a);return}const[z,Q]=KA(d,h,D);(z!==0||Q!==0)&&(o.x=(o.x??0)-z/$[2],o.y=(o.y??0)-Q/$[2],await H({x:z,y:Q})&&O(o)),a=requestAnimationFrame(L)}function B($){var K;const{nodeLookup:H,multiSelectionActive:D,nodesDraggable:V,transform:z,snapGrid:Q,snapToGrid:F,selectNodesOnDrag:q,onNodeDragStart:Y,onSelectionDragStart:P,unselectNodesAndEdges:W}=t();m=!0,(!q||!T)&&!D&&R&&((K=H.get(R))!=null&&K.selected||W()),T&&q&&R&&(e==null||e(R));const ie=Fa($.sourceEvent,{transform:z,snapGrid:Q,snapToGrid:F,containerBounds:h});if(o=ie,c=Rq(H,V,ie,R),c.size>0&&(n||Y||!R&&P)){const[J,G]=mp({nodeId:R,dragItems:c,nodeLookup:H});n==null||n($.sourceEvent,c,J,G),Y==null||Y($.sourceEvent,J,G),R||P==null||P($.sourceEvent,G)}}const I=kA().clickDistance(A).on("start",$=>{const{domNode:H,nodeDragThreshold:D,transform:V,snapGrid:z,snapToGrid:Q}=t();h=(H==null?void 0:H.getBoundingClientRect())||null,v=!1,b=!1,x=$.sourceEvent,D===0&&B($),o=Fa($.sourceEvent,{transform:V,snapGrid:z,snapToGrid:Q,containerBounds:h}),d=Fn($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:D,snapGrid:V,snapToGrid:z,nodeDragThreshold:Q,nodeLookup:F}=t(),q=Fa($.sourceEvent,{transform:D,snapGrid:V,snapToGrid:z,containerBounds:h});if(x=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||R&&!F.has(R))&&(v=!0),!v){if(!u&&H&&m&&(u=!0,L()),!m){const Y=Fn($.sourceEvent,h),P=Y.x-d.x,W=Y.y-d.y;Math.sqrt(P*P+W*W)>Q&&B($)}(o.x!==q.xSnapped||o.y!==q.ySnapped)&&c&&m&&(d=Fn($.sourceEvent,h),O(q))}}).on("end",$=>{if(!(!m||v)&&(u=!1,m=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:H,updateNodePositions:D,onNodeDragStop:V,onSelectionDragStop:z}=t();if(b&&(D(c,!1),b=!1),s||V||!R&&z){const[Q,F]=mp({nodeId:R,dragItems:c,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,c,Q,F),V==null||V($.sourceEvent,Q,F),R||z==null||z($.sourceEvent,F)}}}).filter($=>{const H=$.target;return!$.button&&(!C||!XS(H,`.${C}`,N))&&(!k||XS(H,k,N))});g.call(I)}function S(){g==null||g.on(".drag",null)}return{update:w,destroy:S}}function Oq(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())Ja(s,co(o))>0&&r.push(o);return r}const Pq=250;function Lq(e,t,n,r){var c,u;let s=[],o=1/0;const a=Oq(e,n,t+Pq);for(const d of a){const h=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const m of h){if(r.nodeId===m.nodeId&&r.type===m.type&&r.id===m.id)continue;const{x:g,y:v}=Xs(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(h=>h.type===d)??s[0]}return s[0]}function cR(e,t,n,r,s,o=!1){var d,h,m;const a=r.get(e);if(!a)return null;const c=s==="strict"?(d=a.internals.handleBounds)==null?void 0:d[t]:[...((h=a.internals.handleBounds)==null?void 0:h.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,...Xs(a,u,u.position,!0)}:u}function uR(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Dq(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const dR=()=>!0;function $q(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:a,domNode:c,nodeLookup:u,lib:d,autoPanOnConnect:h,flowId:m,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:x,onConnectEnd:w,isValidConnection:S=dR,onReconnectEnd:C,updateConnection:k,getTransform:N,getFromHandle:T,autoPanSpeed:R,dragThreshold:A=1,handleDomNode:O}){const L=QA(e.target);let B=0,I;const{x:$,y:H}=Fn(e),D=uR(o,O),V=c==null?void 0:c.getBoundingClientRect();let z=!1;if(!V||!D)return;const Q=cR(s,D,r,u,t);if(!Q)return;let F=Fn(e,V),q=!1,Y=null,P=!1,W=null;function ie(){if(!h||!V)return;const[me,ye]=KA(F,V,R);g({x:me,y:ye}),B=requestAnimationFrame(ie)}const K={...Q,nodeId:s,type:D,position:Q.position},J=u.get(s);let ee={inProgress:!0,isValid:null,from:Xs(J,K,pe.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:J,to:F,toHandle:null,toPosition:$S[K.position],toNode:null,pointer:F};function te(){z=!0,k(ee),b==null||b(e,{nodeId:s,handleId:r,handleType:D})}A===0&&te();function oe(me){if(!z){const{x:Ne,y:tt}=Fn(me),Le=Ne-$,vt=tt-H;if(!(Le*Le+vt*vt>A*A))return;te()}if(!T()||!K){de(me);return}const ye=N();F=Fn(me,V),I=Lq(wl(F,ye,!1,[1,1]),n,u,K),q||(ie(),q=!0);const he=fR(me,{handle:I,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:S,doc:L,lib:d,flowId:m,nodeLookup:u});W=he.handleDomNode,Y=he.connection,P=Dq(!!I,he.isValid);const Se=u.get(s),xe=Se?Xs(Se,K,pe.Left,!0):ee.from,Ce={...ee,from:xe,isValid:P,to:he.toHandle&&P?ed({x:he.toHandle.x,y:he.toHandle.y},ye):F,toHandle:he.toHandle,toPosition:P&&he.toHandle?he.toHandle.position:$S[K.position],toNode:he.toHandle?u.get(he.toHandle.nodeId):null,pointer:F};k(Ce),ee=Ce}function de(me){if(!("touches"in me&&me.touches.length>0)){if(z){(I||W)&&Y&&P&&(x==null||x(Y));const{inProgress:ye,...he}=ee,Se={...he,toPosition:ee.toHandle?ee.toPosition:null};w==null||w(me,Se),o&&(C==null||C(me,Se))}v(),cancelAnimationFrame(B),q=!1,P=!1,Y=null,W=null,L.removeEventListener("mousemove",oe),L.removeEventListener("mouseup",de),L.removeEventListener("touchmove",oe),L.removeEventListener("touchend",de)}}L.addEventListener("mousemove",oe),L.addEventListener("mouseup",de),L.addEventListener("touchmove",oe),L.addEventListener("touchend",de)}function fR(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:a,lib:c,flowId:u,isValidConnection:d=dR,nodeLookup:h}){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=uR(void 0,w),k=w.getAttribute("data-nodeid"),N=w.getAttribute("data-handleid"),T=w.classList.contains("connectable"),R=w.classList.contains("connectableend");if(!k||!C)return S;const A={source:m?k:r,sourceHandle:m?N:s,target:m?r:k,targetHandle:m?s:N};S.connection=A;const L=T&&R&&(n===ao.Strict?m&&C==="source"||!m&&C==="target":k!==r||N!==s);S.isValid=L&&d(A),S.toHandle=cR(k,C,N,h,n,!0)}return S}const jx={onPointerDown:$q,isValid:fR};function qq({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=ln(e);function o({translateExtent:c,width:u,height:d,zoomStep:h=1,pannable:m=!0,zoomable:g=!0,inversePan:v=!1}){const b=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const N=n(),T=k.sourceEvent.ctrlKey&&Za()?10:1,R=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*h,A=N[2]*Math.pow(2,R*T);t.scaleTo(A)};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 T=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],R=[T[0]-x[0],T[1]-x[1]];x=T;const A=r()*Math.max(N[2],Math.log(N[2]))*(v?-1:1),O={x:N[0]-R[0]*A,y:N[1]-R[1]*A},L=[[0,0],[u,d]];t.setViewportConstrained({x:O.x,y:O.y,zoom:N[2]},L,c)},C=qA().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 Sd=e=>({x:e.x,y:e.y,zoom:e.k}),gp=({x:e,y:t,zoom:n})=>wd.translate(e,t).scale(n),Wi=(e,t)=>e.target.closest(`.${t}`),hR=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Fq=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,yp=(e,t=0,n=Fq,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},pR=e=>{const t=e.ctrlKey&&Za()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Bq({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:d}){return h=>{if(Wi(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(h.ctrlKey&&a){const w=Ln(h),S=pR(h),C=m*Math.pow(2,S);r.scaleTo(n,C,w,h);return}const g=h.deltaMode===1?20:1;let v=s===Ws.Vertical?0:h.deltaX*g,b=s===Ws.Horizontal?0:h.deltaY*g;!Za()&&h.shiftKey&&s!==Ws.Vertical&&(v=h.deltaY*g,b=0),r.translateBy(n,-(v/m)*o,-(b/m)*o,{internal:!0});const x=Sd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,x),e.panScrollTimeout=setTimeout(()=>{d==null||d(h,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(h,x))}}function zq({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",a=!t&&o&&!r.ctrlKey,c=Wi(r,e);if(r.ctrlKey&&o&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,s)}}function Vq({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,a,c;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Sd(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 Hq({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var a,c;e.usedRightMouseButton=!!(n&&hR(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,Sd(o.transform)))}}function Uq({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&&hR(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Sd(a.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,u)},n?150:0)}}}function Wq({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:h}){return m=>{var w;const g=e||t,v=n&&m.ctrlKey,b=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Wi(m,`${d}-flow__node`)||Wi(m,`${d}-flow__edge`)))return!0;if(!r&&!g&&!s&&!o&&!n||a||h&&!b||Wi(m,c)&&b||Wi(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 Kq({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},h=e.getBoundingClientRect(),m=qA().scaleExtent([t,n]).translateExtent(r),g=ln(e).call(m);C({x:s.x,y:s.y,zoom:lo(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");m.wheelDelta(pR);function x(I,$){return g?new Promise(H=>{m==null||m.interpolate(($==null?void 0:$.interpolate)==="linear"?qa:Ru).transform(yp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),I)}):Promise.resolve(!1)}function w({noWheelClassName:I,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:D,panOnScroll:V,panOnDrag:z,panOnScrollMode:Q,panOnScrollSpeed:F,preventScrolling:q,zoomOnPinch:Y,zoomOnScroll:P,zoomOnDoubleClick:W,zoomActivationKeyPressed:ie,lib:K,onTransformChange:J,connectionInProgress:G,paneClickDistance:ee,selectionOnDrag:te}){D&&!d.isZoomingOrPanning&&S();const oe=V&&!ie&&!D;m.clickDistance(te?1/0:!qn(ee)||ee<0?0:ee);const de=oe?Bq({zoomPanValues:d,noWheelClassName:I,d3Selection:g,d3Zoom:m,panOnScrollMode:Q,panOnScrollSpeed:F,zoomOnPinch:Y,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:c}):zq({noWheelClassName:I,preventScrolling:q,d3ZoomHandler:v});if(g.on("wheel.zoom",de,{passive:!1}),!D){const ye=Vq({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:a});m.on("start",ye);const he=Hq({zoomPanValues:d,panOnDrag:z,onPaneContextMenu:!!H,onPanZoom:o,onTransformChange:J});m.on("zoom",he);const Se=Uq({zoomPanValues:d,panOnDrag:z,panOnScroll:V,onPaneContextMenu:H,onPanZoomEnd:c,onDraggingChange:u});m.on("end",Se)}const me=Wq({zoomActivationKeyPressed:ie,panOnDrag:z,zoomOnScroll:P,panOnScroll:V,zoomOnDoubleClick:W,zoomOnPinch:Y,userSelectionActive:D,noPanClassName:$,noWheelClassName:I,lib:K,connectionInProgress:G});m.filter(me),W?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function S(){m.on("zoom",null)}async function C(I,$,H){const D=gp(I),V=m==null?void 0:m.constrain()(D,$,H);return V&&await x(V),new Promise(z=>z(V))}async function k(I,$){const H=gp(I);return await x(H,$),new Promise(D=>D(H))}function N(I){if(g){const $=gp(I),H=g.property("__zoom");(H.k!==I.zoom||H.x!==I.x||H.y!==I.y)&&(m==null||m.transform(g,$,null,{sync:!0}))}}function T(){const I=g?$A(g.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function R(I,$){return g?new Promise(H=>{m==null||m.interpolate(($==null?void 0:$.interpolate)==="linear"?qa:Ru).scaleTo(yp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),I)}):Promise.resolve(!1)}function A(I,$){return g?new Promise(H=>{m==null||m.interpolate(($==null?void 0:$.interpolate)==="linear"?qa:Ru).scaleBy(yp(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),I)}):Promise.resolve(!1)}function O(I){m==null||m.scaleExtent(I)}function L(I){m==null||m.translateExtent(I)}function B(I){const $=!qn(I)||I<0?0:I;m==null||m.clickDistance($)}return{update:w,destroy:S,setViewport:k,setViewportConstrained:C,getViewport:T,scaleTo:R,scaleBy:A,setScaleExtent:O,setTranslateExtent:L,syncViewport:N,setClickDistance:B}}var fo;(function(e){e.Line="line",e.Handle="handle"})(fo||(fo={}));function Gq({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 QS(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 os(e,t){return Math.max(0,t-e)}function as(e,t){return Math.max(0,e-t)}function cu(e,t,n){return Math.max(0,t-e,e-n)}function JS(e,t){return e?!t:t}function Yq(e,t,n,r,s,o,a,c){let{affectsX:u,affectsY:d}=t;const{isHorizontal:h,isVertical:m}=t,g=h&&m,{xSnapped:v,ySnapped:b}=n,{minWidth:x,maxWidth:w,minHeight:S,maxHeight:C}=r,{x:k,y:N,width:T,height:R,aspectRatio:A}=e;let O=Math.floor(h?v-e.pointerX:0),L=Math.floor(m?b-e.pointerY:0);const B=T+(u?-O:O),I=R+(d?-L:L),$=-o[0]*T,H=-o[1]*R;let D=cu(B,x,w),V=cu(I,S,C);if(a){let F=0,q=0;u&&O<0?F=os(k+O+$,a[0][0]):!u&&O>0&&(F=as(k+B+$,a[1][0])),d&&L<0?q=os(N+L+H,a[0][1]):!d&&L>0&&(q=as(N+I+H,a[1][1])),D=Math.max(D,F),V=Math.max(V,q)}if(c){let F=0,q=0;u&&O>0?F=as(k+O,c[0][0]):!u&&O<0&&(F=os(k+B,c[1][0])),d&&L>0?q=as(N+L,c[0][1]):!d&&L<0&&(q=os(N+I,c[1][1])),D=Math.max(D,F),V=Math.max(V,q)}if(s){if(h){const F=cu(B/A,S,C)*A;if(D=Math.max(D,F),a){let q=0;!u&&!d||u&&!d&&g?q=as(N+H+B/A,a[1][1])*A:q=os(N+H+(u?O:-O)/A,a[0][1])*A,D=Math.max(D,q)}if(c){let q=0;!u&&!d||u&&!d&&g?q=os(N+B/A,c[1][1])*A:q=as(N+(u?O:-O)/A,c[0][1])*A,D=Math.max(D,q)}}if(m){const F=cu(I*A,x,w)/A;if(V=Math.max(V,F),a){let q=0;!u&&!d||d&&!u&&g?q=as(k+I*A+$,a[1][0])/A:q=os(k+(d?L:-L)*A+$,a[0][0])/A,V=Math.max(V,q)}if(c){let q=0;!u&&!d||d&&!u&&g?q=os(k+I*A,c[1][0])/A:q=as(k+(d?L:-L)*A,c[0][0])/A,V=Math.max(V,q)}}}L=L+(L<0?V:-V),O=O+(O<0?D:-D),s&&(g?B>I*A?L=(JS(u,d)?-O:O)/A:O=(JS(u,d)?-L:L)*A:h?(L=O/A,d=u):(O=L*A,u=d));const z=u?k+O:k,Q=d?N+L:N;return{width:T+(u?-O:O),height:R+(d?-L:L),x:o[0]*O*(u?-1:1)+z,y:o[1]*L*(d?-1:1)+Q}}const mR={width:0,height:0,x:0,y:0},Xq={...mR,pointerX:0,pointerY:0,aspectRatio:1};function Qq(e){return[[0,0],[e.measured.width,e.measured.height]]}function Jq(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 Zq({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=ln(e);let a={controlDirection:QS("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:h,keepAspectRatio:m,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:x,shouldResize:w}){let S={...mR},C={...Xq};a={boundaries:h,resizeDirection:g,keepAspectRatio:m,controlDirection:QS(d)};let k,N=null,T=[],R,A,O,L=!1;const B=kA().on("start",I=>{const{nodeLookup:$,transform:H,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}=Fa(I.sourceEvent,{transform:H,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},R=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(R=$.get(k.parentId),A=R&&k.extent==="parent"?Qq(R):void 0),T=[],O=void 0;for(const[Y,P]of $)if(P.parentId===t&&(T.push({id:Y,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const W=Jq(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(I,{...S})}).on("drag",I=>{const{transform:$,snapGrid:H,snapToGrid:D,nodeOrigin:V}=n(),z=Fa(I.sourceEvent,{transform:$,snapGrid:H,snapToGrid:D,containerBounds:N}),Q=[];if(!k)return;const{x:F,y:q,width:Y,height:P}=S,W={},ie=k.origin??V,{width:K,height:J,x:G,y:ee}=Yq(C,a.controlDirection,z,a.boundaries,a.keepAspectRatio,ie,A,O),te=K!==Y,oe=J!==P,de=G!==F&&te,me=ee!==q&&oe;if(!de&&!me&&!te&&!oe)return;if((de||me||ie[0]===1||ie[1]===1)&&(W.x=de?G:S.x,W.y=me?ee:S.y,S.x=W.x,S.y=W.y,T.length>0)){const xe=G-F,Ce=ee-q;for(const Ne of T)Ne.position={x:Ne.position.x-xe+ie[0]*(K-Y),y:Ne.position.y-Ce+ie[1]*(J-P)},Q.push(Ne)}if((te||oe)&&(W.width=te&&(!a.resizeDirection||a.resizeDirection==="horizontal")?K:S.width,W.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?J:S.height,S.width=W.width,S.height=W.height),R&&k.expandParent){const xe=ie[0]*(W.width??0);W.x&&W.x<xe&&(S.x=xe,C.x=C.x-(W.x-xe));const Ce=ie[1]*(W.height??0);W.y&&W.y<Ce&&(S.y=Ce,C.y=C.y-(W.y-Ce))}const ye=Gq({width:S.width,prevWidth:Y,height:S.height,prevHeight:P,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),he={...S,direction:ye};(w==null?void 0:w(I,he))!==!1&&(L=!0,b==null||b(I,he),r(W,Q))}).on("end",I=>{L&&(x==null||x(I,{...S}),s==null||s({...S}),L=!1)});o.call(B)}function u(){o.on(".drag",null)}return{update:c,destroy:u}}var vp={exports:{}},xp={},wp={exports:{}},bp={};/**
|
|
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 ZS;function eF(){if(ZS)return bp;ZS=1;var e=pl();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 h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return bp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,bp}var ek;function tF(){return ek||(ek=1,wp.exports=eF()),wp.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 tk;function nF(){if(tk)return xp;tk=1;var e=pl(),t=tF();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}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 xp.useSyncExternalStoreWithSelector=function(d,h,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(R){if(!C){if(C=!0,k=R,R=g(R),v!==void 0&&x.hasValue){var A=x.value;if(v(A,R))return N=A}return N=R}if(A=N,r(k,R))return A;var O=g(R);return v!==void 0&&v(A,O)?(k=R,A):(k=R,N=O)}var C=!1,k,N,T=m===void 0?null:m;return[function(){return S(h())},T===null?void 0:function(){return S(T())}]},[h,m,g,v]);var w=s(d,b[0],b[1]);return a(function(){x.hasValue=!0,x.value=w},[w]),u(w),w},xp}var nk;function rF(){return nk||(nk=1,vp.exports=nF()),vp.exports}var sF=rF();const iF=hl(sF),oF={},rk=e=>{let t;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(t):h;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:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(oF?"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},aF=e=>e?rk(e):rk,{useDebugValue:lF}=pt,{useSyncExternalStoreWithSelector:cF}=iF,uF=e=>e;function gR(e,t=uF,n){const r=cF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lF(r),r}const sk=(e,t)=>{const n=aF(e),r=(s,o=t)=>gR(n,s,o);return Object.assign(r,n),r},dF=(e,t)=>e?sk(e,t):sk;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 _w=cA();const fF=hl(_w),kd=j.createContext(null),hF=kd.Provider,yR=cr.error001();function De(e,t){const n=j.useContext(kd);if(n===null)throw new Error(yR);return gR(n,e,t)}function Je(){const e=j.useContext(kd);if(e===null)throw new Error(yR);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ik={display:"none"},pF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},vR="react-flow__node-desc",xR="react-flow__edge-desc",mF="react-flow__aria-live",gF=e=>e.ariaLiveMessage,yF=e=>e.ariaLabelConfig;function vF({rfId:e}){const t=De(gF);return p.jsx("div",{id:`${mF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:pF,children:t})}function xF({rfId:e,disableKeyboardA11y:t}){const n=De(yF);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${vR}-${e}`,style:ik,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${xR}-${e}`,style:ik,children:n["edge.a11yDescription.default"]}),!t&&p.jsx(vF,{rfId:e})]})}const Nd=j.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const a=`${e}`.split("-");return p.jsx("div",{className:gt(["react-flow__panel",n,...a]),style:r,ref:o,...s,children:t})});Nd.displayName="Panel";function wF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:p.jsx(Nd,{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:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const bF=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}},uu=e=>e.id;function _F(e,t){return Qe(e.selectedNodes.map(uu),t.selectedNodes.map(uu))&&Qe(e.selectedEdges.map(uu),t.selectedEdges.map(uu))}function SF({onSelectionChange:e}){const t=Je(),{selectedNodes:n,selectedEdges:r}=De(bF,_F);return j.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const kF=e=>!!e.onSelectionChangeHandlers;function NF({onSelectionChange:e}){const t=De(kF);return e||t?p.jsx(SF,{onSelectionChange:e}):null}const wR=[0,0],CF={x:0,y:0,zoom:1},EF=["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"],ok=[...EF,"rfId"],jF=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}),ak={translateExtent:Xa,nodeOrigin:wR,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function TF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:u}=De(jF,Qe),d=Je();j.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=ak,c()}),[]);const h=j.useRef(ak);return j.useEffect(()=>{for(const m of ok){const g=e[m],v=h.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:fq(g)}):m==="fitView"?d.setState({fitViewQueued:g}):m==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[m]:g})))}h.current=e},ok.map(m=>e[m])),null}function lk(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function AF(e){var r;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const s=lk(),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=lk())!=null&&r.matches?"dark":"light"}const ck=typeof document<"u"?document:null;function el(e=null,t={target:ck,actInsideInputWithModifier:!0}){const[n,r]=j.useState(!1),s=j.useRef(!1),o=j.useRef(new Set([])),[a,c]=j.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
|
+
`)),h=d.reduce((m,g)=>m.concat(...g),[]);return[d,h]}return[[],[]]},[e]);return j.useEffect(()=>{const u=(t==null?void 0:t.target)??ck,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=v=>{var w,S;if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!d)&&JA(v))return!1;const x=dk(v.code,c);if(o.current.add(v[x]),uk(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=dk(v.code,c);uk(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",h),u==null||u.addEventListener("keyup",m),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",m),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function uk(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function dk(e,t){return t.includes(e)?"code":"key"}const RF=()=>{const e=Je();return j.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=mw(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},h=n.snapGrid??s,m=n.snapToGrid??o;return wl(d,r,m,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),a=ed(t,n);return{x:a.x+s,y:a.y+o}}}),[])};function bR(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)MF(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 MF(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 bR(e,t)}function SR(e,t){return bR(e,t)}function Fs(e,t){return{id:e,type:"select",selected:t}}function Ki(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(Fs(o.id,a)))}return r}function fk({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 hk(e){return{id:e.id,type:"remove"}}const pk=e=>nq(e),IF=e=>HA(e);function kR(e){return j.forwardRef(e)}const OF=typeof window<"u"?j.useLayoutEffect:j.useEffect;function mk(e){const[t,n]=j.useState(BigInt(0)),[r]=j.useState(()=>PF(()=>n(s=>s+BigInt(1))));return OF(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function PF(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const NR=j.createContext(null);function LF({children:e}){const t=Je(),n=j.useCallback(c=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:h,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=fk({items:x,lookup:g});for(const S of b.values())w=S(w);h&&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=mk(n),s=j.useCallback(c=>{const{edges:u=[],setEdges:d,hasDefaultEdges:h,onEdgesChange:m,edgeLookup:g}=t.getState();let v=u;for(const b of c)v=typeof b=="function"?b(v):b;h?d(v):m&&m(fk({items:v,lookup:g}))},[]),o=mk(s),a=j.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return p.jsx(NR.Provider,{value:a,children:e})}function DF(){const e=j.useContext(NR);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const $F=e=>!!e.panZoom;function yo(){const e=RF(),t=Je(),n=DF(),r=De($F),s=j.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=pk(m)?m:g.get(m.id),x=b.parentId?XA(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 co(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&&pk(w)?w:{...x,...w}}return x}))},h=(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&&IF(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:T,edges:R}=await aq({nodesToRemove:m,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:N}),A=R.length>0,O=T.length>0;if(A){const L=R.map(hk);w==null||w(R),C(L)}if(O){const L=T.map(hk);x==null||x(T),S(L)}return(O||A)&&(k==null||k({nodes:T,edges:R})),{deletedNodes:T,deletedEdges:R}},getIntersectingNodes:(m,g=!0,v)=>{const b=FS(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=co(w?S:C),N=Ja(k,x);return g&&N>0||N>=k.width*k.height||N>=x.width*x.height}):[]},isNodeIntersecting:(m,g,v=!0)=>{const x=FS(m)?m:u(m);if(!x)return!1;const w=Ja(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:h,updateEdgeData:(m,g,v={replace:!1})=>{h(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 rq(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??dq();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return j.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const gk=e=>e.selected,qF=typeof window<"u"?window:void 0;function FF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Je(),{deleteElements:r}=yo(),s=el(e,{actInsideInputWithModifier:!1}),o=el(t,{target:qF});j.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();r({nodes:c.filter(gk),edges:a.filter(gk)}),n.setState({nodesSelectionActive:!1})}},[s]),j.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function BF(e){const t=Je();j.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=gw(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 Cd={position:"absolute",width:"100%",height:"100%",top:0,left:0},zF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function VF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Ws.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:h,maxZoom:m,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:x,noPanClassName:w,onViewportChange:S,isControlledViewport:C,paneClickDistance:k,selectionOnDrag:N}){const T=Je(),R=j.useRef(null),{userSelectionActive:A,lib:O,connectionInProgress:L}=De(zF,Qe),B=el(g),I=j.useRef();BF(R);const $=j.useCallback(H=>{S==null||S({x:H[0],y:H[1],zoom:H[2]}),C||T.setState({transform:H})},[S,C]);return j.useEffect(()=>{if(R.current){I.current=Kq({domNode:R.current,minZoom:h,maxZoom:m,translateExtent:d,viewport:u,onDraggingChange:z=>T.setState({paneDragging:z}),onPanZoomStart:(z,Q)=>{const{onViewportChangeStart:F,onMoveStart:q}=T.getState();q==null||q(z,Q),F==null||F(Q)},onPanZoom:(z,Q)=>{const{onViewportChange:F,onMove:q}=T.getState();q==null||q(z,Q),F==null||F(Q)},onPanZoomEnd:(z,Q)=>{const{onViewportChangeEnd:F,onMoveEnd:q}=T.getState();q==null||q(z,Q),F==null||F(Q)}});const{x:H,y:D,zoom:V}=I.current.getViewport();return T.setState({panZoom:I.current,transform:[H,D,V],domNode:R.current.closest(".react-flow")}),()=>{var z;(z=I.current)==null||z.destroy()}}},[]),j.useEffect(()=>{var H;(H=I.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:w,userSelectionActive:A,noWheelClassName:x,lib:O,onTransformChange:$,connectionInProgress:L,selectionOnDrag:N,paneClickDistance:k})},[e,t,n,r,s,o,a,c,B,v,w,A,x,O,$,L,N,k]),p.jsx("div",{className:"react-flow__renderer",ref:R,style:Cd,children:b})}const HF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function UF(){const{userSelectionActive:e,userSelectionRect:t}=De(HF,Qe);return e&&t?p.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 _p=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},WF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function KF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Qa.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:a,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:h,onPaneMouseEnter:m,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const x=Je(),{userSelectionActive:w,elementsSelectable:S,dragging:C,connectionInProgress:k}=De(WF,Qe),N=S&&(e||w),T=j.useRef(null),R=j.useRef(),A=j.useRef(new Set),O=j.useRef(new Set),L=j.useRef(!1),B=F=>{if(L.current||k){L.current=!1;return}u==null||u(F),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},I=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}d==null||d(F)},$=h?F=>h(F):void 0,H=F=>{L.current&&(F.stopPropagation(),L.current=!1)},D=F=>{var J,G;const{domNode:q}=x.getState();if(R.current=q==null?void 0:q.getBoundingClientRect(),!R.current)return;const Y=F.target===T.current;if(!Y&&!!F.target.closest(".nokey")||!e||!(o&&Y||t)||F.button!==0||!F.isPrimary)return;(G=(J=F.target)==null?void 0:J.setPointerCapture)==null||G.call(J,F.pointerId),L.current=!1;const{x:ie,y:K}=Fn(F.nativeEvent,R.current);x.setState({userSelectionRect:{width:0,height:0,startX:ie,startY:K,x:ie,y:K}}),Y||(F.stopPropagation(),F.preventDefault())},V=F=>{const{userSelectionRect:q,transform:Y,nodeLookup:P,edgeLookup:W,connectionLookup:ie,triggerNodeChanges:K,triggerEdgeChanges:J,defaultEdgeOptions:G,resetSelectedElements:ee}=x.getState();if(!R.current||!q)return;const{x:te,y:oe}=Fn(F.nativeEvent,R.current),{startX:de,startY:me}=q;if(!L.current){const Ce=t?0:s;if(Math.hypot(te-de,oe-me)<=Ce)return;ee(),a==null||a(F)}L.current=!0;const ye={startX:de,startY:me,x:te<de?te:de,y:oe<me?oe:me,width:Math.abs(te-de),height:Math.abs(oe-me)},he=A.current,Se=O.current;A.current=new Set(pw(P,ye,Y,n===Qa.Partial,!0).map(Ce=>Ce.id)),O.current=new Set;const xe=(G==null?void 0:G.selectable)??!0;for(const Ce of A.current){const Ne=ie.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(!BS(he,A.current)){const Ce=Ki(P,A.current,!0);K(Ce)}if(!BS(Se,O.current)){const Ce=Ki(W,O.current);J(Ce)}x.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},z=F=>{var q,Y;F.button===0&&((Y=(q=F.target)==null?void 0:q.releasePointerCapture)==null||Y.call(q,F.pointerId),!w&&F.target===T.current&&x.getState().userSelectionRect&&(B==null||B(F)),x.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(c==null||c(F),x.setState({nodesSelectionActive:A.current.size>0})))},Q=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:gt(["react-flow__pane",{draggable:Q,dragging:C,selection:e}]),onClick:N?void 0:_p(B,T),onContextMenu:_p(I,T),onWheel:_p($,T),onPointerEnter:N?void 0:m,onPointerMove:N?V:g,onPointerUp:N?z:void 0,onPointerDownCapture:N?D:void 0,onClickCapture:N?H:void 0,onPointerLeave:v,ref:T,style:Cd,children:[b,p.jsx(UF,{})]})}function Tx({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 h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function CR({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:a}){const c=Je(),[u,d]=j.useState(!1),h=j.useRef();return j.useEffect(()=>{h.current=Iq({getStoreItems:()=>c.getState(),onNodeMouseDown:m=>{Tx({id:m,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),j.useEffect(()=>{var m,g;if(t)(m=h.current)==null||m.destroy();else if(e.current)return(g=h.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:a}),()=>{var v;(v=h.current)==null||v.destroy()}},[n,r,t,o,e,s]),u}const GF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ER(){const e=Je();return j.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:a,onError:c,updateNodePositions:u,nodeLookup:d,nodeOrigin:h}=e.getState(),m=new Map,g=GF(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=xl(C,o));const{position:k,positionAbsolute:N}=UA({nodeId:S.id,nextPosition:C,nodeLookup:d,nodeExtent:r,nodeOrigin:h,onError:c});S.position=k,S.internals.positionAbsolute=N,m.set(S.id,S)}u(m)},[])}const Sw=j.createContext(null),YF=Sw.Provider;Sw.Consumer;const jR=()=>j.useContext(Sw),XF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),QF=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:a}=r,{fromHandle:c,toHandle:u,isValid:d}=a,h=(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:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===ao.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:h&&d}};function JF({type:e="source",position:t=pe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:a,onConnect:c,children:u,className:d,onMouseDown:h,onTouchStart:m,...g},v){var V,z;const b=a||null,x=e==="target",w=Je(),S=jR(),{connectOnClick:C,noPanClassName:k,rfId:N}=De(XF,Qe),{connectingFrom:T,connectingTo:R,clickConnecting:A,isPossibleEndHandle:O,connectionInProcess:L,clickConnectionInProcess:B,valid:I}=De(QF(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:Y}=w.getState(),P={...F,...Q};if(Y){const{edges:W,setEdges:ie}=w.getState();ie(rR(P,W))}q==null||q(P),c==null||c(P)},H=Q=>{if(!S)return;const F=ZA(Q.nativeEvent);if(s&&(F&&Q.button===0||!F)){const q=w.getState();jx.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?h==null||h(Q):m==null||m(Q)},D=Q=>{const{onClickConnectStart:F,onClickConnectEnd:q,connectionClickStartHandle:Y,connectionMode:P,isValidConnection:W,lib:ie,rfId:K,nodeLookup:J,connection:G}=w.getState();if(!S||!Y&&!s)return;if(!Y){F==null||F(Q.nativeEvent,{nodeId:S,handleId:b,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:S,type:e,id:b}});return}const ee=QA(Q.target),te=n||W,{connection:oe,isValid:de}=jx.isValid(Q.nativeEvent,{handle:{nodeId:S,id:b,type:e},connectionMode:P,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:te,flowId:K,doc:ee,lib:ie,nodeLookup:J});de&&oe&&$(oe);const me=structuredClone(G);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,q==null||q(Q,me),w.setState({connectionClickStartHandle:null})};return p.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:A,connectingfrom:T,connectingto:R,valid:I,connectionindicator:r&&(!L||O)&&(L||B?o:s)}]),onMouseDown:H,onTouchStart:H,onClick:C?D:void 0,ref:v,...g,children:u})}const Be=j.memo(kR(JF));function ZF({data:e,isConnectable:t,sourcePosition:n=pe.Bottom}){return p.jsxs(p.Fragment,{children:[e==null?void 0:e.label,p.jsx(Be,{type:"source",position:n,isConnectable:t})]})}function eB({data:e,isConnectable:t,targetPosition:n=pe.Top,sourcePosition:r=pe.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(Be,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,p.jsx(Be,{type:"source",position:r,isConnectable:t})]})}function tB(){return null}function nB({data:e,isConnectable:t,targetPosition:n=pe.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(Be,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const td={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},yk={input:ZF,default:eB,output:nB,group:tB};function rB(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 sB=e=>{const{width:t,height:n,x:r,y:s}=vl(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 iB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Je(),{width:s,height:o,transformString:a,userSelectionActive:c}=De(sB,Qe),u=ER(),d=j.useRef(null);if(j.useEffect(()=>{var g;n||(g=d.current)==null||g.focus({preventScroll:!0})},[n]),CR({nodeRef:d}),c||!s||!o)return null;const h=e?g=>{const v=r.getState().nodes.filter(b=>b.selected);e(g,v)}:void 0,m=g=>{Object.prototype.hasOwnProperty.call(td,g.key)&&(g.preventDefault(),u({direction:td[g.key],factor:g.shiftKey?4:1}))};return p.jsx("div",{className:gt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:p.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:s,height:o}})})}const vk=typeof window<"u"?window:void 0,oB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function TR({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:w,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:k,panOnScroll:N,panOnScrollSpeed:T,panOnScrollMode:R,zoomOnDoubleClick:A,panOnDrag:O,defaultViewport:L,translateExtent:B,minZoom:I,maxZoom:$,preventScrolling:H,onSelectionContextMenu:D,noWheelClassName:V,noPanClassName:z,disableKeyboardA11y:Q,onViewportChange:F,isControlledViewport:q}){const{nodesSelectionActive:Y,userSelectionActive:P}=De(oB,Qe),W=el(d,{target:vk}),ie=el(x,{target:vk}),K=ie||O,J=ie||N,G=h&&K!==!0,ee=W||P||G;return FF({deleteKeyCode:u,multiSelectionKeyCode:b}),p.jsx(VF,{onPaneContextMenu:o,elementsSelectable:S,zoomOnScroll:C,zoomOnPinch:k,panOnScroll:J,panOnScrollSpeed:T,panOnScrollMode:R,zoomOnDoubleClick:A,panOnDrag:!W&&K,defaultViewport:L,translateExtent:B,minZoom:I,maxZoom:$,zoomActivationKeyCode:w,preventScrolling:H,noWheelClassName:V,noPanClassName:z,onViewportChange:F,isControlledViewport:q,paneClickDistance:c,selectionOnDrag:G,children:p.jsxs(KF,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:K,isSelecting:!!ee,selectionMode:m,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:G,children:[e,Y&&p.jsx(iB,{onSelectionContextMenu:D,noPanClassName:z,disableKeyboardA11y:Q})]})})}TR.displayName="FlowRenderer";const aB=j.memo(TR),lB=e=>t=>e?pw(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 cB(e){return De(j.useCallback(lB(e),[e]),Qe)}const uB=e=>e.updateNodeInternals;function dB(){const e=De(uB),[t]=j.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 j.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function fB({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Je(),o=j.useRef(null),a=j.useRef(null),c=j.useRef(e.sourcePosition),u=j.useRef(e.targetPosition),d=j.useRef(t),h=n&&!!e.internals.handleBounds;return j.useEffect(()=>{o.current&&!e.hidden&&(!h||a.current!==o.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(o.current),a.current=o.current)},[h,e.hidden]),j.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),j.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 hB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:a,nodesDraggable:c,elementsSelectable:u,nodesConnectable:d,nodesFocusable:h,resizeObserver:m,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:x,nodeTypes:w,nodeClickDistance:S,onError:C}){const{node:k,internals:N,isParent:T}=De(te=>{const oe=te.nodeLookup.get(e),de=te.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:de}},Qe);let R=k.type||"default",A=(w==null?void 0:w[R])||yk[R];A===void 0&&(C==null||C("003",cr.error003(R)),R="default",A=(w==null?void 0:w.default)||yk.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"),I=!!(k.focusable||h&&typeof k.focusable>"u"),$=Je(),H=YA(k),D=fB({node:k,nodeType:R,hasDimensions:H,resizeObserver:m}),V=CR({nodeRef:D,disabled:k.hidden||!O,noDragClassName:g,handleSelector:k.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:S}),z=ER();if(k.hidden)return null;const Q=Pr(k),F=rB(k),q=L||O||t||n||r||s,Y=n?te=>n(te,{...N.userNode}):void 0,P=r?te=>r(te,{...N.userNode}):void 0,W=s?te=>s(te,{...N.userNode}):void 0,ie=o?te=>o(te,{...N.userNode}):void 0,K=a?te=>a(te,{...N.userNode}):void 0,J=te=>{const{selectNodesOnDrag:oe,nodeDragThreshold:de}=$.getState();L&&(!oe||!O||de>0)&&Tx({id:e,store:$,nodeRef:D}),t&&t(te,{...N.userNode})},G=te=>{if(!(JA(te.nativeEvent)||b)){if(FA.includes(te.key)&&L){const oe=te.key==="Escape";Tx({id:e,store:$,unselect:oe,nodeRef:D})}else if(O&&k.selected&&Object.prototype.hasOwnProperty.call(td,te.key)){te.preventDefault();const{ariaLabelConfig:oe}=$.getState();$.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),z({direction:td[te.key],factor:te.shiftKey?4:1})}}},ee=()=>{var Se;if(b||!((Se=D.current)!=null&&Se.matches(":focus-visible")))return;const{transform:te,width:oe,height:de,autoPanOnNodeFocus:me,setCenter:ye}=$.getState();if(!me)return;pw(new Map([[e,k]]),{x:0,y:0,width:oe,height:de},te,!0).length>0||ye(k.position.x+Q.width/2,k.position.y+Q.height/2,{zoom:te[2]})};return p.jsx("div",{className:gt(["react-flow__node",`react-flow__node-${R}`,{[v]:O},k.className,{selected:k.selected,selectable:L,parent:T,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:H?"visible":"hidden",...k.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Y,onMouseMove:P,onMouseLeave:W,onContextMenu:ie,onClick:J,onDoubleClick:K,onKeyDown:I?G:void 0,tabIndex:I?0:void 0,onFocus:I?ee:void 0,role:k.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${vR}-${x}`,"aria-label":k.ariaLabel,...k.domAttributes,children:p.jsx(YF,{value:e,children:p.jsx(A,{id:e,data:k.data,type:R,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 pB=j.memo(hB);const mB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function AR(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=De(mB,Qe),a=cB(e.onlyRenderVisibleElements),c=dB();return p.jsx("div",{className:"react-flow__nodes",style:Cd,children:a.map(u=>p.jsx(pB,{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))})}AR.displayName="NodeRenderer";const gB=j.memo(AR);function yB(e){return De(j.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&&mq({sourceNode:o,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Qe)}const vB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return p.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},xB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return p.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},xk={[Ju.Arrow]:vB,[Ju.ArrowClosed]:xB};function wB(e){const t=Je();return j.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(xk,e)?xk[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",cr.error009(e)),null)},[e])}const bB=({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=wB(t);return u?p.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:p.jsx(u,{color:n,strokeWidth:a})}):null},RR=({defaultColor:e,rfId:t})=>{const n=De(o=>o.edges),r=De(o=>o.defaultEdgeOptions),s=j.useMemo(()=>_q(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?p.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:p.jsx("defs",{children:s.map(o=>p.jsx(bB,{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};RR.displayName="MarkerDefinitions";var _B=j.memo(RR);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,...h}){const[m,g]=j.useState({x:1,y:0,width:0,height:0}),v=gt(["react-flow__edge-textwrapper",d]),b=j.useRef(null);return j.useEffect(()=>{if(b.current){const x=b.current.getBBox();g({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?p.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:v,visibility:m.width?"visible":"hidden",...h,children:[s&&p.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}),p.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 SB=j.memo(MR);function Ed({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:d=20,...h}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...h,d:e,fill:"none",className:gt(["react-flow__edge-path",h.className])}),d?p.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&qn(t)&&qn(n)?p.jsx(SB,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function wk({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===pe.Left||e===pe.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function IR({sourceX:e,sourceY:t,sourcePosition:n=pe.Bottom,targetX:r,targetY:s,targetPosition:o=pe.Top}){const[a,c]=wk({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,d]=wk({pos:o,x1:r,y1:s,x2:e,y2:t}),[h,m,g,v]=eR({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}`,h,m,g,v]}function OR(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a,targetPosition:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})=>{const[C,k,N]=IR({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c}),T=e.isInternal?void 0:t;return p.jsx(Ed,{id:T,path:C,labelX:k,labelY:N,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})})}const kB=OR({isInternal:!1}),PR=OR({isInternal:!0});kB.displayName="SimpleBezierEdge";PR.displayName="SimpleBezierEdgeInternal";function LR(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,sourcePosition:v=pe.Bottom,targetPosition:b=pe.Top,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:C})=>{const[k,N,T]=Nx({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}),R=e.isInternal?void 0:t;return p.jsx(Ed,{id:R,path:k,labelX:N,labelY:T,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:w,interactionWidth:C})})}const DR=LR({isInternal:!1}),$R=LR({isInternal:!0});DR.displayName="SmoothStepEdge";$R.displayName="SmoothStepEdgeInternal";function qR(e){return j.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return p.jsx(DR,{...n,id:r,pathOptions:j.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const NB=qR({isInternal:!1}),FR=qR({isInternal:!0});NB.displayName="StepEdge";FR.displayName="StepEdgeInternal";function BR(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:v,markerStart:b,interactionWidth:x})=>{const[w,S,C]=sR({sourceX:n,sourceY:r,targetX:s,targetY:o}),k=e.isInternal?void 0:t;return p.jsx(Ed,{id:k,path:w,labelX:S,labelY:C,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:v,markerStart:b,interactionWidth:x})})}const CB=BR({isInternal:!1}),zR=BR({isInternal:!0});CB.displayName="StraightEdge";zR.displayName="StraightEdgeInternal";function VR(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a=pe.Bottom,targetPosition:c=pe.Top,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:C})=>{const[k,N,T]=tR({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c,curvature:S==null?void 0:S.curvature}),R=e.isInternal?void 0:t;return p.jsx(Ed,{id:R,path:k,labelX:N,labelY:T,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:C})})}const EB=VR({isInternal:!1}),HR=VR({isInternal:!0});EB.displayName="BezierEdge";HR.displayName="BezierEdgeInternal";const bk={default:HR,straight:zR,step:FR,smoothstep:$R,simplebezier:PR},_k={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},jB=(e,t,n)=>n===pe.Left?e-t:n===pe.Right?e+t:e,TB=(e,t,n)=>n===pe.Top?e-t:n===pe.Bottom?e+t:e,Sk="react-flow__edgeupdater";function kk({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:a,type:c}){return p.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:a,className:gt([Sk,`${Sk}-${c}`]),cx:jB(t,r,e),cy:TB(n,r,e),r,stroke:"transparent",fill:"transparent"})}function AB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:c,targetPosition:u,onReconnect:d,onReconnectStart:h,onReconnectEnd:m,setReconnecting:g,setUpdateHover:v}){const b=Je(),x=(N,T)=>{if(N.button!==0)return;const{autoPanOnConnect:R,domNode:A,isValidConnection:O,connectionMode:L,connectionRadius:B,lib:I,onConnectStart:$,onConnectEnd:H,cancelConnection:D,nodeLookup:V,rfId:z,panBy:Q,updateConnection:F}=b.getState(),q=T.type==="target",Y=(ie,K)=>{g(!1),m==null||m(ie,n,T.type,K)},P=ie=>d==null?void 0:d(n,ie),W=(ie,K)=>{g(!0),h==null||h(N,n,T.type),$==null||$(ie,K)};jx.onPointerDown(N.nativeEvent,{autoPanOnConnect:R,connectionMode:L,connectionRadius:B,domNode:A,handleId:T.id,nodeId:T.nodeId,nodeLookup:V,isTarget:q,edgeUpdaterType:T.type,lib:I,flowId:z,cancelConnection:D,panBy:Q,isValidConnection:O,onConnect:P,onConnectStart:W,onConnectEnd:H,onReconnectEnd:Y,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 p.jsxs(p.Fragment,{children:[(e===!0||e==="source")&&p.jsx(kk,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:C,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&p.jsx(kk,{position:u,centerX:o,centerY:a,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:k,type:"target"})]})}function RB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,reconnectRadius:h,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 T=k.type||"default",R=(x==null?void 0:x[T])||bk[T];R===void 0&&(S==null||S("011",cr.error011(T)),T="default",R=(x==null?void 0:x.default)||bk.default);const A=!!(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=j.useRef(null),[I,$]=j.useState(!1),[H,D]=j.useState(!1),V=Je(),{zIndex:z,sourceX:Q,sourceY:F,targetX:q,targetY:Y,sourcePosition:P,targetPosition:W}=De(j.useCallback(ye=>{const he=ye.nodeLookup.get(k.source),Se=ye.nodeLookup.get(k.target);if(!he||!Se)return{zIndex:k.zIndex,..._k};const xe=bq({id:e,sourceNode:he,targetNode:Se,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:ye.connectionMode,onError:S});return{zIndex:pq({selected:k.selected,zIndex:k.zIndex,sourceNode:he,targetNode:Se,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...xe||_k}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Qe),ie=j.useMemo(()=>k.markerStart?`url('#${Cx(k.markerStart,b)}')`:void 0,[k.markerStart,b]),K=j.useMemo(()=>k.markerEnd?`url('#${Cx(k.markerEnd,b)}')`:void 0,[k.markerEnd,b]);if(k.hidden||Q===null||F===null||q===null||Y===null)return null;const J=ye=>{var Ce;const{addSelectedEdges:he,unselectNodesAndEdges:Se,multiSelectionActive:xe}=V.getState();L&&(V.setState({nodesSelectionActive:!1}),k.selected&&xe?(Se({nodes:[],edges:[k]}),(Ce=B.current)==null||Ce.blur()):he([e])),s&&s(ye,k)},G=o?ye=>{o(ye,{...k})}:void 0,ee=a?ye=>{a(ye,{...k})}:void 0,te=c?ye=>{c(ye,{...k})}:void 0,oe=u?ye=>{u(ye,{...k})}:void 0,de=d?ye=>{d(ye,{...k})}:void 0,me=ye=>{var he;if(!C&&FA.includes(ye.key)&&L){const{unselectNodesAndEdges:Se,addSelectedEdges:xe}=V.getState();ye.key==="Escape"?((he=B.current)==null||he.blur(),Se({edges:[k]})):xe([e])}};return p.jsx("svg",{style:{zIndex:z},children:p.jsxs("g",{className:gt(["react-flow__edge",`react-flow__edge-${T}`,k.className,w,{selected:k.selected,animated:k.animated,inactive:!L&&!s,updating:I,selectable:L}]),onClick:J,onDoubleClick:G,onContextMenu:ee,onMouseEnter:te,onMouseMove:oe,onMouseLeave:de,onKeyDown:A?me:void 0,tabIndex:A?0:void 0,role:k.ariaRole??(A?"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":A?`${xR}-${b}`:void 0,ref:B,...k.domAttributes,children:[!H&&p.jsx(R,{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:Y,sourcePosition:P,targetPosition:W,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:ie,markerEnd:K,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),O&&p.jsx(AB,{edge:k,isReconnectable:O,reconnectRadius:h,onReconnect:m,onReconnectStart:g,onReconnectEnd:v,sourceX:Q,sourceY:F,targetX:q,targetY:Y,sourcePosition:P,targetPosition:W,setUpdateHover:$,setReconnecting:D})]})})}var MB=j.memo(RB);const IB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function UR({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:h,reconnectRadius:m,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:x}){const{edgesFocusable:w,edgesReconnectable:S,elementsSelectable:C,onError:k}=De(IB,Qe),N=yB(t);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(_B,{defaultColor:e,rfId:n}),N.map(T=>p.jsx(MB,{id:T,edgesFocusable:w,edgesReconnectable:S,elementsSelectable:C,noPanClassName:s,onReconnect:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:h,reconnectRadius:m,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:k,edgeTypes:r,disableKeyboardA11y:x},T))]})}UR.displayName="EdgeRenderer";const OB=j.memo(UR),PB=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LB({children:e}){const t=De(PB);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function DB(e){const t=yo(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const $B=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function qB(e){const t=De($B),n=Je();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function FB(e){return e.connection.inProgress?{...e.connection,to:wl(e.connection.to,e.transform)}:{...e.connection}}function BB(e){return FB}function zB(e){const t=BB();return De(t,Qe)}const VB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function HB({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:a,isValid:c,inProgress:u}=De(VB,Qe);return!(o&&s&&u)?null:p.jsx("svg",{style:e,width:o,height:a,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:gt(["react-flow__connection",VA(c)]),children:p.jsx(WR,{style:t,type:n,CustomComponent:r,isValid:c})})})}const WR=({style:e,type:t=hs.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:a,fromHandle:c,fromPosition:u,to:d,toNode:h,toHandle:m,toPosition:g,pointer:v}=zB();if(!s)return;if(n)return p.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:VA(r),toNode:h,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 hs.Bezier:[b]=tR(x);break;case hs.SimpleBezier:[b]=IR(x);break;case hs.Step:[b]=Nx({...x,borderRadius:0});break;case hs.SmoothStep:[b]=Nx(x);break;default:[b]=sR(x)}return p.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};WR.displayName="ConnectionLine";const UB={};function Nk(e=UB){j.useRef(e),Je(),j.useEffect(()=>{},[e])}function WB(){Je(),j.useRef(!1),j.useEffect(()=>{},[])}function KR({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:w,connectionLineContainerStyle:S,selectionKeyCode:C,selectionOnDrag:k,selectionMode:N,multiSelectionKeyCode:T,panActivationKeyCode:R,zoomActivationKeyCode:A,deleteKeyCode:O,onlyRenderVisibleElements:L,elementsSelectable:B,defaultViewport:I,translateExtent:$,minZoom:H,maxZoom:D,preventScrolling:V,defaultMarkerColor:z,zoomOnScroll:Q,zoomOnPinch:F,panOnScroll:q,panOnScrollSpeed:Y,panOnScrollMode:P,zoomOnDoubleClick:W,panOnDrag:ie,onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:G,onPaneMouseLeave:ee,onPaneScroll:te,onPaneContextMenu:oe,paneClickDistance:de,nodeClickDistance:me,onEdgeContextMenu:ye,onEdgeMouseEnter:he,onEdgeMouseMove:Se,onEdgeMouseLeave:xe,reconnectRadius:Ce,onReconnect:Ne,onReconnectStart:tt,onReconnectEnd:Le,noDragClassName:vt,noWheelClassName:xt,noPanClassName:it,disableKeyboardA11y:Ue,nodeExtent:Mt,rfId:It,viewport:Vt,onViewportChange:Me}){return Nk(e),Nk(t),WB(),DB(n),qB(Vt),p.jsx(aB,{onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:G,onPaneMouseLeave:ee,onPaneContextMenu:oe,onPaneScroll:te,paneClickDistance:de,deleteKeyCode:O,selectionKeyCode:C,selectionOnDrag:k,selectionMode:N,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:T,panActivationKeyCode:R,zoomActivationKeyCode:A,elementsSelectable:B,zoomOnScroll:Q,zoomOnPinch:F,zoomOnDoubleClick:W,panOnScroll:q,panOnScrollSpeed:Y,panOnScrollMode:P,panOnDrag:ie,defaultViewport:I,translateExtent:$,minZoom:H,maxZoom:D,onSelectionContextMenu:m,preventScrolling:V,noDragClassName:vt,noWheelClassName:xt,noPanClassName:it,disableKeyboardA11y:Ue,onViewportChange:Me,isControlledViewport:!!Vt,children:p.jsxs(LB,{children:[p.jsx(OB,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Ne,onReconnectStart:tt,onReconnectEnd:Le,onlyRenderVisibleElements:L,onEdgeContextMenu:ye,onEdgeMouseEnter:he,onEdgeMouseMove:Se,onEdgeMouseLeave:xe,reconnectRadius:Ce,defaultMarkerColor:z,noPanClassName:it,disableKeyboardA11y:Ue,rfId:It}),p.jsx(HB,{style:x,type:b,component:w,containerStyle:S}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(gB,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:me,onlyRenderVisibleElements:L,noPanClassName:it,noDragClassName:vt,disableKeyboardA11y:Ue,nodeExtent:Mt,rfId:It}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}KR.displayName="GraphView";const KB=j.memo(KR),Ck=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u=.5,maxZoom:d=2,nodeOrigin:h,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=h??[0,0],N=m??Xa;aR(x,w,S);const T=Ex(C,v,b,{nodeOrigin:k,nodeExtent:N,zIndexMode:g});let R=[0,0,1];if(a&&s&&o){const A=vl(v,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:O,y:L,zoom:B}=mw(A,s,o,u,d,(c==null?void 0:c.padding)??.1);R=[O,L,B]}return{rfId:"1",width:s??0,height:o??0,transform:R,nodes:C,nodesInitialized:T,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:Xa,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ao.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:{...zA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lq,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:BA,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},GB=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:h,nodeExtent:m,zIndexMode:g})=>dF((v,b)=>{async function x(){const{nodeLookup:w,panZoom:S,fitViewOptions:C,fitViewResolver:k,width:N,height:T,minZoom:R,maxZoom:A}=b();S&&(await oq({nodes:w,width:N,height:T,panZoom:S,minZoom:R,maxZoom:A},C),k==null||k.resolve(!0),v({fitViewResolver:null}))}return{...Ck({nodes:e,edges:t,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:h,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:w=>{const{nodeLookup:S,parentLookup:C,nodeOrigin:k,elevateNodesOnSelect:N,fitViewQueued:T,zIndexMode:R}=b(),A=Ex(w,S,C,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:R});T&&A?(x(),v({nodes:w,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:w,nodesInitialized:A})},setEdges:w=>{const{connectionLookup:S,edgeLookup:C}=b();aR(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:T,nodeExtent:R,debug:A,fitViewQueued:O,zIndexMode:L}=b(),{changes:B,updatedInternals:I}=Tq(w,C,k,N,T,R,L);I&&(Nq(C,k,{nodeOrigin:T,nodeExtent:R,zIndexMode:L}),O?(x(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(A&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(w,S=!1)=>{const C=[];let k=[];const{nodeLookup:N,triggerNodeChanges:T,connection:R,updateConnection:A,onNodesChangeMiddlewareMap:O}=b();for(const[L,B]of w){const I=N.get(L),$=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(B!=null&&B.position)),H={id:L,type:"position",position:$?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(I&&R.inProgress&&R.fromNode.id===I.id){const D=Xs(I,R.fromHandle,pe.Left,!0);A({...R,from:D})}$&&I.parentId&&C.push({id:L,parentId:I.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),k.push(H)}if(C.length>0){const{parentLookup:L,nodeOrigin:B}=b(),I=bw(C,N,L,B);k.push(...I)}for(const L of O.values())k=L(k);T(k)},triggerNodeChanges:w=>{const{onNodesChange:S,setNodes:C,nodes:k,hasDefaultNodes:N,debug:T}=b();if(w!=null&&w.length){if(N){const R=_R(w,k);C(R)}T&&console.log("React Flow: trigger node changes",w),S==null||S(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:S,setEdges:C,edges:k,hasDefaultEdges:N,debug:T}=b();if(w!=null&&w.length){if(N){const R=SR(w,k);C(R)}T&&console.log("React Flow: trigger edge changes",w),S==null||S(w)}},addSelectedNodes:w=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:k,triggerNodeChanges:N,triggerEdgeChanges:T}=b();if(S){const R=w.map(A=>Fs(A,!0));N(R);return}N(Ki(k,new Set([...w]),!0)),T(Ki(C))},addSelectedEdges:w=>{const{multiSelectionActive:S,edgeLookup:C,nodeLookup:k,triggerNodeChanges:N,triggerEdgeChanges:T}=b();if(S){const R=w.map(A=>Fs(A,!0));T(R);return}T(Ki(C,new Set([...w]))),N(Ki(k,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:S}={})=>{const{edges:C,nodes:k,nodeLookup:N,triggerNodeChanges:T,triggerEdgeChanges:R}=b(),A=w||k,O=S||C,L=A.map(I=>{const $=N.get(I.id);return $&&($.selected=!1),Fs(I.id,!1)}),B=O.map(I=>Fs(I.id,!1));T(L),R(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 T=S.reduce((A,O)=>O.selected?[...A,Fs(O.id,!1)]:A,[]),R=w.reduce((A,O)=>O.selected?[...A,Fs(O.id,!1)]:A,[]);C(T),k(R)},setNodeExtent:w=>{const{nodes:S,nodeLookup:C,parentLookup:k,nodeOrigin:N,elevateNodesOnSelect:T,nodeExtent:R,zIndexMode:A}=b();w[0][0]===R[0][0]&&w[0][1]===R[0][1]&&w[1][0]===R[1][0]&&w[1][1]===R[1][1]||(Ex(S,C,k,{nodeOrigin:N,nodeExtent:w,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:A}),v({nodeExtent:w}))},panBy:w=>{const{transform:S,width:C,height:k,panZoom:N,translateExtent:T}=b();return Aq({delta:w,panZoom:N,transform:S,translateExtent:T,width:C,height:k})},setCenter:async(w,S,C)=>{const{width:k,height:N,maxZoom:T,panZoom:R}=b();if(!R)return Promise.resolve(!1);const A=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:T;return await R.setViewport({x:k/2-w*A,y:N/2-S*A,zoom:A},{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:{...zA}})},updateConnection:w=>{v({connection:w})},reset:()=>v({...Ck()})}},Object.is);function GR({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:h,nodeExtent:m,zIndexMode:g,children:v}){const[b]=j.useState(()=>GB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:d,minZoom:a,maxZoom:c,fitViewOptions:u,nodeOrigin:h,nodeExtent:m,zIndexMode:g}));return p.jsx(hF,{value:b,children:p.jsx(LF,{children:v})})}function YB({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:h,nodeOrigin:m,nodeExtent:g,zIndexMode:v}){return j.useContext(kd)?p.jsx(p.Fragment,{children:e}):p.jsx(GR,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:a,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:h,nodeOrigin:m,nodeExtent:g,zIndexMode:v,children:e})}const XB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function QB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:a,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:S,onNodeMouseEnter:C,onNodeMouseMove:k,onNodeMouseLeave:N,onNodeContextMenu:T,onNodeDoubleClick:R,onNodeDragStart:A,onNodeDrag:O,onNodeDragStop:L,onNodesDelete:B,onEdgesDelete:I,onDelete:$,onSelectionChange:H,onSelectionDragStart:D,onSelectionDrag:V,onSelectionDragStop:z,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:q,onBeforeDelete:Y,connectionMode:P,connectionLineType:W=hs.Bezier,connectionLineStyle:ie,connectionLineComponent:K,connectionLineContainerStyle:J,deleteKeyCode:G="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:te=!1,selectionMode:oe=Qa.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:me=Za()?"Meta":"Control",zoomActivationKeyCode:ye=Za()?"Meta":"Control",snapToGrid:he,snapGrid:Se,onlyRenderVisibleElements:xe=!1,selectNodesOnDrag:Ce,nodesDraggable:Ne,autoPanOnNodeFocus:tt,nodesConnectable:Le,nodesFocusable:vt,nodeOrigin:xt=wR,edgesFocusable:it,edgesReconnectable:Ue,elementsSelectable:Mt=!0,defaultViewport:It=CF,minZoom:Vt=.5,maxZoom:Me=2,translateExtent:be=Xa,preventScrolling:ot=!0,nodeExtent:ze,defaultMarkerColor:Ht="#b1b1b7",zoomOnScroll:fn=!0,zoomOnPinch:Ot=!0,panOnScroll:Pt=!1,panOnScrollSpeed:li=.5,panOnScrollMode:Lt=Ws.Free,zoomOnDoubleClick:Zt=!0,panOnDrag:Io=!0,onPaneClick:Oo,onPaneMouseEnter:Po,onPaneMouseMove:qr,onPaneMouseLeave:Fr,onPaneScroll:Fl,onPaneContextMenu:Bl,paneClickDistance:zl=1,nodeClickDistance:Vl=0,children:Hl,onReconnect:Lo,onReconnectStart:Ul,onReconnectEnd:Ss,onEdgeContextMenu:Do,onEdgeDoubleClick:ks,onEdgeMouseEnter:gf,onEdgeMouseMove:Ns,onEdgeMouseLeave:ci,reconnectRadius:ui=10,onNodesChange:$o,onEdgesChange:yf,noDragClassName:vf="nodrag",noWheelClassName:xf="nowheel",noPanClassName:Yn="nopan",fitView:qo,fitViewOptions:Fo,connectOnClick:wf,attributionPosition:Wl,proOptions:Kl,defaultEdgeOptions:Gl,elevateNodesOnSelect:Yl=!0,elevateEdgesOnSelect:bf=!1,disableKeyboardA11y:Xl=!1,autoPanOnConnect:nt,autoPanOnNodeDrag:_f,autoPanSpeed:Bo,connectionRadius:Ql,isValidConnection:di,onError:Sf,style:Jl,id:Cs,nodeDragThreshold:hn,connectionDragThreshold:kf,viewport:en,onViewportChange:Nf,width:Cf,height:Ef,colorMode:fi="light",debug:hi,onScroll:Xn,ariaLabelConfig:pi,zIndexMode:Zl="basic",...jf},zo){const mi=Cs||"1",Vo=AF(fi),Es=j.useCallback(ec=>{ec.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Xn==null||Xn(ec)},[Xn]);return p.jsx("div",{"data-testid":"rf__wrapper",...jf,onScroll:Es,style:{...Jl,...XB},ref:zo,className:gt(["react-flow",s,Vo]),id:Cs,role:"application",children:p.jsxs(YB,{nodes:e,edges:t,width:Cf,height:Ef,fitView:qo,fitViewOptions:Fo,minZoom:Vt,maxZoom:Me,nodeOrigin:xt,nodeExtent:ze,zIndexMode:Zl,children:[p.jsx(KB,{onInit:d,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:C,onNodeMouseMove:k,onNodeMouseLeave:N,onNodeContextMenu:T,onNodeDoubleClick:R,nodeTypes:o,edgeTypes:a,connectionLineType:W,connectionLineStyle:ie,connectionLineComponent:K,connectionLineContainerStyle:J,selectionKeyCode:ee,selectionOnDrag:te,selectionMode:oe,deleteKeyCode:G,multiSelectionKeyCode:me,panActivationKeyCode:de,zoomActivationKeyCode:ye,onlyRenderVisibleElements:xe,defaultViewport:It,translateExtent:be,minZoom:Vt,maxZoom:Me,preventScrolling:ot,zoomOnScroll:fn,zoomOnPinch:Ot,zoomOnDoubleClick:Zt,panOnScroll:Pt,panOnScrollSpeed:li,panOnScrollMode:Lt,panOnDrag:Io,onPaneClick:Oo,onPaneMouseEnter:Po,onPaneMouseMove:qr,onPaneMouseLeave:Fr,onPaneScroll:Fl,onPaneContextMenu:Bl,paneClickDistance:zl,nodeClickDistance:Vl,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:q,onReconnect:Lo,onReconnectStart:Ul,onReconnectEnd:Ss,onEdgeContextMenu:Do,onEdgeDoubleClick:ks,onEdgeMouseEnter:gf,onEdgeMouseMove:Ns,onEdgeMouseLeave:ci,reconnectRadius:ui,defaultMarkerColor:Ht,noDragClassName:vf,noWheelClassName:xf,noPanClassName:Yn,rfId:mi,disableKeyboardA11y:Xl,nodeExtent:ze,viewport:en,onViewportChange:Nf}),p.jsx(TF,{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:Ue,elementsSelectable:Mt,elevateNodesOnSelect:Yl,elevateEdgesOnSelect:bf,minZoom:Vt,maxZoom:Me,nodeExtent:ze,onNodesChange:$o,onEdgesChange:yf,snapToGrid:he,snapGrid:Se,connectionMode:P,translateExtent:be,connectOnClick:wf,defaultEdgeOptions:Gl,fitView:qo,fitViewOptions:Fo,onNodesDelete:B,onEdgesDelete:I,onDelete:$,onNodeDragStart:A,onNodeDrag:O,onNodeDragStop:L,onSelectionDrag:V,onSelectionDragStart:D,onSelectionDragStop:z,onMove:h,onMoveStart:m,onMoveEnd:g,noPanClassName:Yn,nodeOrigin:xt,rfId:mi,autoPanOnConnect:nt,autoPanOnNodeDrag:_f,autoPanSpeed:Bo,onError:Sf,connectionRadius:Ql,isValidConnection:di,selectNodesOnDrag:Ce,nodeDragThreshold:hn,connectionDragThreshold:kf,onBeforeDelete:Y,debug:hi,ariaLabelConfig:pi,zIndexMode:Zl}),p.jsx(NF,{onSelectionChange:H}),Hl,p.jsx(wF,{proOptions:Kl,position:Wl}),p.jsx(xF,{rfId:mi,disableKeyboardA11y:Xl})]})})}var JB=kR(QB);function ZB({dimensions:e,lineWidth:t,variant:n,className:r}){return p.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 ez({radius:e,className:t}){return p.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 tz={[Ar.Dots]:1,[Ar.Lines]:1,[Ar.Cross]:6},nz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function YR({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:h}){const m=j.useRef(null),{transform:g,patternId:v}=De(nz,Qe),b=r||tz[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],T=w?[k,k]:C,R=[N[0]*g[2]||1+T[0]/2,N[1]*g[2]||1+T[1]/2],A=`${v}${e||""}`;return p.jsxs("svg",{className:gt(["react-flow__background",d]),style:{...u,...Cd,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:m,"data-testid":"rf__background",children:[p.jsx("pattern",{id:A,x:g[0]%C[0],y:g[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:x?p.jsx(ez,{radius:k/2,className:h}):p.jsx(ZB,{dimensions:T,lineWidth:s,variant:t,className:h})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}YR.displayName="Background";const rz=j.memo(YR);function sz(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function iz(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function oz(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.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 az(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.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 lz(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.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 du({children:e,className:t,...n}){return p.jsx("button",{type:"button",className:gt(["react-flow__controls-button",t]),...n,children:e})}const cz=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function XR({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:a,onFitView:c,onInteractiveChange:u,className:d,children:h,position:m="bottom-left",orientation:g="vertical","aria-label":v}){const b=Je(),{isInteractive:x,minZoomReached:w,maxZoomReached:S,ariaLabelConfig:C}=De(cz,Qe),{zoomIn:k,zoomOut:N,fitView:T}=yo(),R=()=>{k(),o==null||o()},A=()=>{N(),a==null||a()},O=()=>{T(s),c==null||c()},L=()=>{b.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)},B=g==="horizontal"?"horizontal":"vertical";return p.jsxs(Nd,{className:gt(["react-flow__controls",B,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&p.jsxs(p.Fragment,{children:[p.jsx(du,{onClick:R,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:S,children:p.jsx(sz,{})}),p.jsx(du,{onClick:A,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:w,children:p.jsx(iz,{})})]}),n&&p.jsx(du,{className:"react-flow__controls-fitview",onClick:O,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:p.jsx(oz,{})}),r&&p.jsx(du,{className:"react-flow__controls-interactive",onClick:L,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:x?p.jsx(lz,{}):p.jsx(az,{})}),h]})}XR.displayName="Controls";const uz=j.memo(XR);function dz({id:e,x:t,y:n,width:r,height:s,style:o,color:a,strokeColor:c,strokeWidth:u,className:d,borderRadius:h,shapeRendering:m,selected:g,onClick:v}){const{background:b,backgroundColor:x}=o||{},w=a||b||x;return p.jsx("rect",{className:gt(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:w,stroke:c,strokeWidth:u},shapeRendering:m,onClick:v?S=>v(S,e):void 0})}const fz=j.memo(dz),hz=e=>e.nodes.map(t=>t.id),Sp=e=>e instanceof Function?e:()=>e;function pz({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=fz,onClick:a}){const c=De(hz,Qe),u=Sp(t),d=Sp(e),h=Sp(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:c.map(g=>p.jsx(gz,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:a,shapeRendering:m},g))})}function mz({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:a,NodeComponent:c,onClick:u}){const{node:d,x:h,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}=Pr(w);return{node:w,x:S,y:C,width:k,height:N}},Qe);return!d||d.hidden||!YA(d)?null:p.jsx(c,{x:h,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 gz=j.memo(mz);var yz=j.memo(pz);const vz=200,xz=150,wz=e=>!e.hidden,bz=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?GA(vl(e.nodeLookup,{filter:wz}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},_z="react-flow__minimap-desc";function QR({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:u,maskColor:d,maskStrokeColor:h,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 T=Je(),R=j.useRef(null),{boundingRect:A,viewBB:O,rfId:L,panZoom:B,translateExtent:I,flowWidth:$,flowHeight:H,ariaLabelConfig:D}=De(bz,Qe),V=(e==null?void 0:e.width)??vz,z=(e==null?void 0:e.height)??xz,Q=A.width/V,F=A.height/z,q=Math.max(Q,F),Y=q*V,P=q*z,W=N*q,ie=A.x-(Y-A.width)/2-W,K=A.y-(P-A.height)/2-W,J=Y+W*2,G=P+W*2,ee=`${_z}-${L}`,te=j.useRef(0),oe=j.useRef();te.current=q,j.useEffect(()=>{if(R.current&&B)return oe.current=qq({domNode:R.current,panZoom:B,getTransform:()=>T.getState().transform,getViewScale:()=>te.current}),()=>{var he;(he=oe.current)==null||he.destroy()}},[B]),j.useEffect(()=>{var he;(he=oe.current)==null||he.update({translateExtent:I,width:$,height:H,inversePan:C,pannable:x,zoomStep:k,zoomable:w})},[x,w,C,k,I,$,H]);const de=v?he=>{var Ce;const[Se,xe]=((Ce=oe.current)==null?void 0:Ce.pointer(he))||[0,0];v(he,{x:Se,y:xe})}:void 0,me=b?j.useCallback((he,Se)=>{const xe=T.getState().nodeLookup.get(Se).internals.userNode;b(he,xe)},[]):void 0,ye=S??D["minimap.ariaLabel"];return p.jsx(Nd,{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 h=="string"?h: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:p.jsxs("svg",{width:V,height:z,viewBox:`${ie} ${K} ${J} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ee,ref:R,onClick:de,children:[ye&&p.jsx("title",{id:ee,children:ye}),p.jsx(yz,{onClick:me,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${ie-W},${K-W}h${J+W*2}v${G+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"})]})})}QR.displayName="MiniMap";const Sz=j.memo(QR),kz=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Nz={[fo.Line]:"right",[fo.Handle]:"bottom-right"};function Cz({nodeId:e,position:t,variant:n=fo.Handle,className:r,style:s=void 0,children:o,color:a,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:x,onResize:w,onResizeEnd:S}){const C=jR(),k=typeof e=="string"?e:C,N=Je(),T=j.useRef(null),R=n===fo.Handle,A=De(j.useCallback(kz(R&&v),[R,v]),Qe),O=j.useRef(null),L=t??Nz[n];j.useEffect(()=>{if(!(!T.current||!k))return O.current||(O.current=Zq({domNode:T.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:I,transform:$,snapGrid:H,snapToGrid:D,nodeOrigin:V,domNode:z}=N.getState();return{nodeLookup:I,transform:$,snapGrid:H,snapToGrid:D,nodeOrigin:V,paneDomNode:z}},onChange:(I,$)=>{const{triggerNodeChanges:H,nodeLookup:D,parentLookup:V,nodeOrigin:z}=N.getState(),Q=[],F={x:I.x,y:I.y},q=D.get(k);if(q&&q.expandParent&&q.parentId){const Y=q.origin??z,P=I.width??q.measured.width??0,W=I.height??q.measured.height??0,ie={id:q.id,parentId:q.parentId,rect:{width:P,height:W,...XA({x:I.x??q.position.x,y:I.y??q.position.y},{width:P,height:W},q.parentId,D,Y)}},K=bw([ie],D,V,z);Q.push(...K),F.x=I.x?Math.max(Y[0]*P,I.x):void 0,F.y=I.y?Math.max(Y[1]*W,I.y):void 0}if(F.x!==void 0&&F.y!==void 0){const Y={id:k,type:"position",position:{...F}};Q.push(Y)}if(I.width!==void 0&&I.height!==void 0){const P={id:k,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};Q.push(P)}for(const Y of $){const P={...Y,type:"position"};Q.push(P)}H(Q)},onEnd:({width:I,height:$})=>{const H={id:k,type:"dimensions",resizing:!1,dimensions:{width:I,height:$}};N.getState().triggerNodeChanges([H])}})),O.current.update({controlPosition:L,boundaries:{minWidth:c,minHeight:u,maxWidth:d,maxHeight:h},keepAspectRatio:m,resizeDirection:g,onResizeStart:x,onResize:w,onResizeEnd:S,shouldResize:b}),()=>{var I;(I=O.current)==null||I.destroy()}},[L,c,u,d,h,m,x,w,S,b]);const B=L.split("-");return p.jsx("div",{className:gt(["react-flow__resize-control","nodrag",...B,n,r]),ref:T,style:{...s,scale:A,...a&&{[R?"backgroundColor":"borderColor"]:a}},children:o})}j.memo(Cz);/**
|
|
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 Ez=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),JR=(...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 jz={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 Tz=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},u)=>j.createElement("svg",{ref:u,...jz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:JR("lucide",s),...c},[...a.map(([d,h])=>j.createElement(d,h)),...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=j.forwardRef(({className:r,...s},o)=>j.createElement(Tz,{ref:o,iconNode:t,className:JR(`lucide-${Ez(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 Az=fe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
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 tl=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
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 Rz=fe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
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 kp=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"}]]);/**
|
|
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 Ek=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"}]]);/**
|
|
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 Ax=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"}]]);/**
|
|
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 nl=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 rl=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 Mz=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 _n=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 Iz=fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 kw=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"}]]);/**
|
|
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 dn=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"}]]);/**
|
|
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 Oz=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"}]]);/**
|
|
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 dt=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"}]]);/**
|
|
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 Rx=fe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 Pz=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"}]]);/**
|
|
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 Un=fe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 Lz=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"}]]);/**
|
|
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 Nw=fe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
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 sl=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"}]]);/**
|
|
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 Dz=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"}]]);/**
|
|
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 $z=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"}]]);/**
|
|
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 qz=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"}]]);/**
|
|
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 Fz=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"}]]);/**
|
|
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 Bz=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"}]]);/**
|
|
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 Mx=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"}]]);/**
|
|
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 ZR=fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
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 zz=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"}]]);/**
|
|
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 nd=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"}]]);/**
|
|
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 eM=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"}]]);/**
|
|
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 Ix=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"}]]);/**
|
|
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 Vz=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"}]]);/**
|
|
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 jk=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"}]]);/**
|
|
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 Hz=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"}]]);/**
|
|
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 Tk=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"}]]);/**
|
|
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 Uz=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"}]]);/**
|
|
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 Cw=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"}]]);/**
|
|
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 Wz=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"}]]);/**
|
|
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 Kz=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"}]]);/**
|
|
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 Ak=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"}]]);/**
|
|
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 vo=fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 Rk=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"}]]);/**
|
|
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 Gz=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"}]]);/**
|
|
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 Yz=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"}]]);/**
|
|
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 Xz=fe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
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 Qz=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"}]]);/**
|
|
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 Jz=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"}]]);/**
|
|
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 Zz=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 e6=fe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 t6=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"}]]);/**
|
|
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 tM=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"}]]);/**
|
|
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 n6=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"}]]);/**
|
|
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 bl=fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 jd=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 r6=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"}]]);/**
|
|
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 s6=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"}]]);/**
|
|
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 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"}]]);/**
|
|
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 Ik=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"}]]);/**
|
|
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 i6=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"}]]);/**
|
|
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 Ox=fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 nM=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"}]]);/**
|
|
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 Ew=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"}]]);/**
|
|
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 Ok=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"}]]);/**
|
|
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 o6=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"}]]);/**
|
|
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 rM=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"}]]);/**
|
|
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 a6=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"}]]);/**
|
|
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 l6=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"}]]);/**
|
|
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 c6=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"}]]);/**
|
|
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 sM=fe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 u6=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"}]]);/**
|
|
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 xo=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"}]]);/**
|
|
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 Pk=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"}]]);/**
|
|
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 iM=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"}]]);/**
|
|
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 d6=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"}]]);/**
|
|
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 f6=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"}]]);/**
|
|
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 Td=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"}]]);/**
|
|
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 h6=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"}]]);/**
|
|
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 _l=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 rd=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"}]]);/**
|
|
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 p6=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"}]]);/**
|
|
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 m6=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"}]]),Lk=e=>{let t;const n=new Set,r=(d,h)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const g=t;t=h??(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},g6=(e=>e?Lk(e):Lk),y6=e=>e;function v6(e,t=y6){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 Dk=e=>{const t=g6(e),n=r=>v6(t,r);return Object.assign(n,t),n},bs=(e=>e?Dk(e):Dk),x6=[{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"}}],w6=[{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"}],ho=bs((e,t)=>({nodes:x6,edges:w6,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:SR(n,t().edges)})},onConnect:n=>{t().saveCheckpoint(),e({edges:rR({...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})),h=s.map(m=>({...m,selected:!1}));e({nodes:[...h,...u],edges:[...o,...d],future:[]})},canPaste:()=>{const{clipboard:n}=t();return n!==null&&n.nodes.length>0}})),Np=[{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"}],$k={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"}]},ys=bs((e,t)=>({workflows:Np,selectedWorkflow:Np[0].path,currentWorkflow:$k,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();e({workflows:r.workflows,isLoading:!1})}catch{e({workflows:Np,isLoading:!1})}},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:$k,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})}}})),b6={slack:Qz,github:Ix,jira:Pz,gmail:Rk,outlook:Ax,linear:Pk,notion:Mx,discord:Xz,airtable:$z,confluence:Mx,http:Hz,claude:kp,opencode:kp,ollama:kp,webhook:rd,schedule:Ax,trigger:rd,stripe:Dz,teams:f6,twilio:n6,sendgrid:nM,shopify:o6,zendesk:Uz,mailchimp:Rk,asana:l6,trello:Pk,dropbox:Lz,s3:Tk,"aws-s3":Tk};function Px(e){const t=e.toLowerCase().split(".")[0];return b6[t]||Oz}function _6({data:e,selected:t}){var d,h;const n=((d=e.action)==null?void 0:d.split(".")[0])||"unknown",r=((h=e.action)==null?void 0:h.split(".").slice(1).join("."))||e.action,s=Px(n),o={pending:{icon:Un,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:bl,color:"text-warning",bgColor:"bg-warning/10",animate:!0},completed:{icon:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:kw,color:"text-gray-500",bgColor:"bg-gray-500/10"}},a=e.status||"pending",c=o[a],u=c.icon;return p.jsxs("div",{className:`step-node p-0 ${t?"selected":""} ${a==="running"?"running":""} ${a==="completed"?"completed":""} ${a==="failed"?"failed":""}`,children:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:p.jsx(s,{className:"w-5 h-5 text-primary"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),p.jsx("div",{className:"text-xs text-gray-400 truncate",children:n})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${c.bgColor} flex items-center justify-center`,children:p.jsx(u,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3",children:[p.jsx("div",{className:"text-xs text-gray-300 font-mono truncate",children:r}),e.retryCount&&e.retryCount>0&&p.jsxs("div",{className:"mt-2 text-xs text-warning",children:["Retry #",e.retryCount]}),e.error&&p.jsx("div",{className:"mt-2 text-xs text-error truncate",children:e.error})]}),p.jsx(Be,{type:"source",position:pe.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const S6=j.memo(_6),jw=bs((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 k6({data:e,selected:t}){const[n,r]=j.useState(!1),{pushWorkflow:s,breadcrumbs:o,setRootWorkflow:a}=jw(),{loadWorkflow:c,selectedWorkflow:u,currentWorkflow:d}=ys(),h=j.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 p.jsxs("div",{className:`step-node p-0 min-w-[250px] ${t?"selected":""} ${m[g]}`,children:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border bg-info/5",children:[p.jsx("button",{onClick:()=>r(!n),className:"w-6 h-6 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:n?p.jsx(rl,{className:"w-4 h-4 text-info"}):p.jsx(_n,{className:"w-4 h-4 text-info"})}),p.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/10 flex items-center justify-center",children:p.jsx(nd,{className:"w-5 h-5 text-info"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),p.jsx("div",{className:"text-xs text-gray-400",children:"Sub-workflow"})]}),p.jsx("button",{onClick:h,className:"w-6 h-6 rounded flex items-center justify-center hover:bg-info/20 transition-colors",title:"Drill into sub-workflow",children:p.jsx(tl,{className:"w-4 h-4 text-info"})})]}),p.jsxs("div",{className:"p-3",children:[p.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",children:e.workflowPath}),e.stepCount!==void 0&&p.jsx("div",{className:"mt-2 flex items-center gap-2",children:p.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-info/10 text-info",children:[e.stepCount," steps"]})})]}),n&&p.jsx("div",{className:"border-t border-node-border p-3 bg-black/20",children:p.jsxs("button",{onClick:h,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:[p.jsx(nd,{className:"w-4 h-4"}),"Open Sub-workflow",p.jsx(tl,{className:"w-4 h-4"})]})}),p.jsx(Be,{type:"source",position:pe.Bottom,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"})]})}const N6=j.memo(k6),qk={manual:{icon:bl,color:"text-primary",bgColor:"bg-primary/10",borderColor:"border-primary",label:"Manual Trigger"},schedule:{icon:Ax,color:"text-info",bgColor:"bg-info/10",borderColor:"border-info",label:"Schedule"},webhook:{icon:h6,color:"text-success",bgColor:"bg-success/10",borderColor:"border-success",label:"Webhook"},file:{icon:nd,color:"text-warning",bgColor:"bg-warning/10",borderColor:"border-warning",label:"File Watcher"},event:{icon:rd,color:"text-purple-400",bgColor:"bg-purple-400/10",borderColor:"border-purple-400",label:"Event"}};function C6({data:e,selected:t}){const n=qk[e.type]||qk.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 p.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:[p.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[p.jsx("div",{className:`w-8 h-8 rounded-full ${n.bgColor} flex items-center justify-center`,children:p.jsx(r,{className:`w-4 h-4 ${n.color}`})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:n.label}),p.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Trigger"})]}),e.active!==!1&&p.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-pulse",title:"Active"})]}),p.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[p.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:s(),children:s()}),e.lastTriggered&&p.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Last: ",new Date(e.lastTriggered).toLocaleString()]})]}),p.jsx(Be,{type:"source",position:pe.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"})]})}const E6=j.memo(C6);function j6({data:e,selected:t}){const n={pending:{icon:Un,color:"text-gray-400",borderColor:"border-gray-500",bgColor:"bg-gray-500/10"},completed:{icon:dn,color:"text-success",borderColor:"border-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",borderColor:"border-error",bgColor:"bg-error/10"}},r=e.status||"pending",s=n[r],o=s.icon;return p.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:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"}),p.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[p.jsx("div",{className:`w-8 h-8 rounded-full ${s.bgColor} flex items-center justify-center`,children:p.jsx(zz,{className:`w-4 h-4 ${s.color}`})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Output"}),p.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Workflow End"})]}),p.jsx(o,{className:`w-4 h-4 ${s.color}`})]}),e.variables&&e.variables.length>0&&p.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[p.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output Variables"}),p.jsx("div",{className:"flex flex-wrap gap-1",children:e.variables.map(a=>p.jsx("code",{className:"px-1.5 py-0.5 bg-white/5 text-primary text-xs rounded",children:a},a))})]}),e.description&&p.jsx("div",{className:"px-3 py-2 border-t border-white/10",children:p.jsx("div",{className:"text-xs text-gray-400",children:e.description})}),r==="completed"&&e.result!==void 0&&p.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[p.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Result"}),p.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 T6=j.memo(j6);function A6({data:e,selected:t}){const n={pending:{icon:Un,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Ix,color:"text-blue-400",bgColor:"bg-blue-400/10",animate:!0},completed:{icon:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:dt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return p.jsxs("div",{className:`control-flow-node if-else-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:p.jsx(Ix,{className:"w-5 h-5 text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"If/Else"}),p.jsx("div",{className:"text-xs text-white/70",children:"Conditional"})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:p.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3 bg-white/10",children:[p.jsx("div",{className:"text-xs text-white/90 font-mono mb-3",children:e.condition||"No condition set"}),p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="then"?"bg-green-500/30 text-green-200":"bg-white/5 text-white/60"}`,children:"✓ Then"}),p.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="else"?"bg-red-500/30 text-red-200":"bg-white/5 text-white/60"}`,children:"✗ Else"})]})]}),p.jsx(Be,{type:"source",position:pe.Bottom,id:"then",style:{left:"33%"},className:"!w-3 !h-3 !bg-green-500 !border-2 !border-node-bg"}),p.jsx(Be,{type:"source",position:pe.Bottom,id:"else",style:{left:"67%"},className:"!w-3 !h-3 !bg-red-500 !border-2 !border-node-bg"})]})}const R6=j.memo(A6);function M6({data:e,selected:t}){const n={pending:{icon:Un,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:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:dt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return p.jsxs("div",{className:`control-flow-node for-each-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:p.jsx(Mk,{className:"w-5 h-5 text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"For Each"}),p.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:p.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3 bg-white/10",children:[p.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[p.jsx("span",{className:"text-white/60",children:"Items:"})," ",p.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),p.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[p.jsx("span",{className:"text-white/60",children:"Variable:"})," ",p.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),e.totalIterations!==void 0&&p.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-xs text-white/70",children:"Progress"}),p.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration||0," / ",e.totalIterations]})]}),p.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:p.jsx("div",{className:"bg-orange-400 h-1.5 rounded-full transition-all",style:{width:`${(e.currentIteration||0)/e.totalIterations*100}%`}})})]}),p.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[p.jsx("span",{children:"ℹ️"}),p.jsx("span",{children:"Access: loop.index, loop.first, loop.last"})]})]}),p.jsx(Be,{type:"source",position:pe.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const I6=j.memo(M6);function O6({data:e,selected:t}){const n={pending:{icon:Un,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Ik,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:dt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return p.jsxs("div",{className:`control-flow-node while-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #fb923c 0%, #f97316 100%)"},children:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:p.jsx(Ik,{className:"w-5 h-5 text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"While"}),p.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:p.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3 bg-white/10",children:[p.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[p.jsx("span",{className:"text-white/60",children:"Condition:"})," ",p.jsx("span",{className:"font-mono",children:e.condition||"Not set"})]}),p.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[p.jsx("span",{className:"text-white/60",children:"Max Iterations:"})," ",p.jsx("span",{className:"font-medium",children:e.maxIterations||100})]}),e.currentIteration!==void 0&&p.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-xs text-white/70",children:"Iterations"}),p.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration," / ",e.maxIterations||100]})]}),p.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:p.jsx("div",{className:"bg-orange-400 h-1.5 rounded-full transition-all",style:{width:`${e.currentIteration/(e.maxIterations||100)*100}%`}})})]}),p.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[p.jsx("span",{children:"⚠️"}),p.jsx("span",{children:"Exits when condition becomes false"})]})]}),p.jsx(Be,{type:"source",position:pe.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const P6=j.memo(O6);function L6({data:e,selected:t}){const n={pending:{icon:Un,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:jk,color:"text-purple-400",bgColor:"bg-purple-400/10",animate:!0},completed:{icon:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:dt,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;return p.jsxs("div",{className:`control-flow-node switch-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #a855f7 0%, #ec4899 100%)"},children:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:p.jsx(jk,{className:"w-5 h-5 text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Switch"}),p.jsx("div",{className:"text-xs text-white/70",children:"Multi-Branch Router"})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:p.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3 bg-white/10",children:[p.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[p.jsx("span",{className:"text-white/60",children:"Expression:"})," ",p.jsx("span",{className:"font-mono",children:e.expression||"Not set"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"text-xs text-white/70 font-medium mb-1",children:"Cases:"}),c.map((d,h)=>{const m=e.activeCase===d,g=(h+1)/(c.length+(e.hasDefault?2:1))*100;return p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors ${m?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":"bg-white/5 text-white/70"}`,children:d}),p.jsx(Be,{type:"source",position:pe.Bottom,id:`case-${d}`,style:{left:`${g}%`},className:"!w-2.5 !h-2.5 !bg-purple-400 !border-2 !border-node-bg"})]},d)}),u&&p.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&&p.jsxs("div",{className:"relative",children:[p.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"}),p.jsx(Be,{type:"source",position:pe.Bottom,id:"case-default",style:{left:"95%"},className:"!w-2.5 !h-2.5 !bg-gray-400 !border-2 !border-node-bg"})]})]}),p.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[p.jsx("span",{children:"ℹ️"}),p.jsxs("span",{children:[a.length," case",a.length!==1?"s":"",e.hasDefault?" + default":""]})]})]})]})}const D6=j.memo(L6);function $6({data:e,selected:t}){var a,c;const n={pending:{icon:Un,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Ak,color:"text-green-400",bgColor:"bg-green-400/10",animate:!0},completed:{icon:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:dt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return p.jsxs("div",{className:`control-flow-node parallel-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)"},children:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:p.jsx(Ak,{className:"w-5 h-5 text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Parallel"}),p.jsx("div",{className:"text-xs text-white/70",children:"Concurrent Execution"})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:p.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3 bg-white/10",children:[p.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[p.jsx("span",{className:"text-white/60",children:"Branches:"})," ",p.jsx("span",{className:"font-medium",children:((a=e.branches)==null?void 0:a.length)||0}),e.maxConcurrent&&p.jsxs(p.Fragment,{children:[" ",p.jsx("span",{className:"text-white/60",children:"• Max Concurrent:"})," ",p.jsx("span",{className:"font-medium",children:e.maxConcurrent})]})]}),p.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(c=e.branches)==null?void 0:c.slice(0,6).map(u=>{var m,g;const d=(m=e.activeBranches)==null?void 0:m.includes(u.id),h=(g=e.completedBranches)==null?void 0:g.includes(u.id);return p.jsx("div",{className:`px-2 py-1 rounded text-xs font-medium transition-colors ${h?"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&&p.jsxs("div",{className:"px-2 py-1 rounded text-xs font-medium bg-white/10 text-white/60",children:["+",e.branches.length-6]})]}),p.jsxs("div",{className:"text-xs text-white/50 flex items-center gap-1",children:[p.jsx("span",{children:"On Error:"}),p.jsx("span",{className:"font-medium",children:e.onError||"stop"})]})]}),p.jsx(Be,{type:"source",position:pe.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const q6=j.memo($6);function F6({data:e,selected:t}){const n={pending:{icon:Un,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Ok,color:"text-yellow-400",bgColor:"bg-yellow-400/10",animate:!0},completed:{icon:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:dt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return p.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:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:p.jsx(Ok,{className:"w-5 h-5 text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Try/Catch"}),p.jsx("div",{className:"text-xs text-white/70",children:"Error Handling"})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:p.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3 bg-white/10",children:[e.errorOccurred&&p.jsxs("div",{className:"mb-3 p-2 bg-red-500/20 border border-red-500/30 rounded flex items-center gap-2",children:[p.jsx(iM,{className:"w-4 h-4 text-red-200"}),p.jsx("span",{className:"text-xs text-red-200 font-medium",children:"Error occurred"})]}),p.jsxs("div",{className:"space-y-2",children:[p.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&&p.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&&p.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"})]}),p.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[p.jsx("span",{children:"ℹ️"}),p.jsx("span",{children:"Finally always executes"})]})]}),p.jsx(Be,{type:"source",position:pe.Bottom,id:"try",style:{left:"25%"},className:"!w-2.5 !h-2.5 !bg-blue-500 !border-2 !border-node-bg"}),e.hasCatch&&p.jsx(Be,{type:"source",position:pe.Bottom,id:"catch",style:{left:"50%"},className:"!w-2.5 !h-2.5 !bg-red-500 !border-2 !border-node-bg"}),e.hasFinally&&p.jsx(Be,{type:"source",position:pe.Bottom,id:"finally",style:{left:"75%"},className:"!w-2.5 !h-2.5 !bg-purple-500 !border-2 !border-node-bg"})]})}const B6=j.memo(F6);function z6({data:e,selected:t}){const n={map:{icon:tl,label:"Map",color:"#14b8a6"},filter:{icon:ZR,label:"Filter",color:"#10b981"},reduce:{icon:Jz,label:"Reduce",color:"#06b6d4"}},r={pending:{icon:Un,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:dn,color:"text-success",bgColor:"bg-success/10"},failed:{icon:dt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:dt,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 p.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:[p.jsx(Be,{type:"target",position:pe.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),p.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:p.jsx(u,{className:"w-5 h-5 text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white",children:e.name||c.label}),p.jsx("div",{className:"text-xs text-white/70",children:"Transform"})]}),p.jsx("div",{className:`w-6 h-6 rounded-full ${o.bgColor} flex items-center justify-center`,children:p.jsx(a,{className:`w-4 h-4 ${o.color} ${o.animate?"animate-pulse":""}`})})]}),p.jsxs("div",{className:"p-3 bg-white/10",children:[p.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[p.jsx("span",{className:"text-white/60",children:"Items:"})," ",p.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),p.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[p.jsx("span",{className:"text-white/60",children:"Variable:"})," ",p.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),p.jsxs("div",{className:"mb-3 p-2 bg-white/5 rounded",children:[p.jsx("div",{className:"text-xs text-white/60 mb-1",children:e.transformType==="filter"?"Condition":e.transformType==="reduce"?"Reducer":"Expression"}),p.jsx("div",{className:"text-xs text-white font-mono break-all",children:d||"Not set"})]}),e.transformType==="reduce"&&e.initialValue!==void 0&&p.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[p.jsx("span",{className:"text-white/60",children:"Initial:"})," ",p.jsx("span",{className:"font-mono",children:JSON.stringify(e.initialValue)})]}),(e.inputCount!==void 0||e.outputCount!==void 0)&&p.jsxs("div",{className:"mt-3 p-2 bg-white/5 rounded flex items-center justify-between",children:[p.jsxs("div",{className:"text-xs",children:[p.jsx("span",{className:"text-white/60",children:"In:"})," ",p.jsx("span",{className:"text-white font-medium",children:e.inputCount??"?"})]}),p.jsx("div",{className:"text-white/40",children:"→"}),p.jsxs("div",{className:"text-xs",children:[p.jsx("span",{className:"text-white/60",children:"Out:"})," ",p.jsx("span",{className:"text-white font-medium",children:e.outputCount??"?"})]})]}),p.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[p.jsx("span",{children:"ℹ️"}),p.jsx("span",{children:e.transformType==="map"?"Transforms each item":e.transformType==="filter"?"Selects matching items":"Aggregates to single value"})]})]}),p.jsx(Be,{type:"source",position:pe.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const Cp=j.memo(z6);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 Fk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tw(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Fk(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():Fk(e[s],null)}}}}function Et(...e){return j.useCallback(Tw(...e),e)}function V6(e,t){const n=j.createContext(t),r=o=>{const{children:a,...c}=o,u=j.useMemo(()=>c,Object.values(c));return p.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function s(o){const a=j.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 ei(e,t=[]){let n=[];function r(o,a){const c=j.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=j.useMemo(()=>b,Object.values(b));return p.jsx(x.Provider,{value:w,children:v})};d.displayName=o+"Provider";function h(m,g){var x;const v=((x=g==null?void 0:g[e])==null?void 0:x[u])||c,b=j.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,h]}const s=()=>{const o=n.map(a=>j.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return j.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[r,H6(s,...t)]}function H6(...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 j.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var vs=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},U6=lA[" useId ".trim().toString()]||(()=>{}),W6=0;function Ba(e){const[t,n]=j.useState(U6());return vs(()=>{n(r=>r??String(W6++))},[e]),t?`radix-${t}`:""}var K6=lA[" useInsertionEffect ".trim().toString()]||vs;function Aw({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=G6({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:s;{const h=j.useRef(e!==void 0);j.useEffect(()=>{const m=h.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.`),h.current=c},[c,r])}const d=j.useCallback(h=>{var m;if(c){const g=Y6(h)?h(e):h;g!==e&&((m=a.current)==null||m.call(a,g))}else o(h)},[c,e,o,a]);return[u,d]}function G6({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),s=j.useRef(n),o=j.useRef(t);return K6(()=>{o.current=t},[t]),j.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function Y6(e){return typeof e=="function"}function il(e){const t=X6(e),n=j.forwardRef((r,s)=>{const{children:o,...a}=r,c=j.Children.toArray(o),u=c.find(J6);if(u){const d=u.props.children,h=c.map(m=>m===u?j.Children.count(d)>1?j.Children.only(null):j.isValidElement(d)?d.props.children:null:m);return p.jsx(t,{...a,ref:s,children:j.isValidElement(d)?j.cloneElement(d,void 0,h):null})}return p.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function X6(e){const t=j.forwardRef((n,r)=>{const{children:s,...o}=n;if(j.isValidElement(s)){const a=e8(s),c=Z6(o,s.props);return s.type!==j.Fragment&&(c.ref=r?Tw(r,a):a),j.cloneElement(s,c)}return j.Children.count(s)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Q6=Symbol("radix.slottable");function J6(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Q6}function Z6(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 e8(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 t8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=t8.reduce((e,t)=>{const n=il(`Primitive.${t}`),r=j.forwardRef((s,o)=>{const{asChild:a,...c}=s,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oM(e,t){e&&_w.flushSync(()=>e.dispatchEvent(t))}function ur(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function n8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e);j.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 r8="DismissableLayer",Lx="dismissableLayer.update",s8="dismissableLayer.pointerDownOutside",i8="dismissableLayer.focusOutside",Bk,aM=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rw=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,d=j.useContext(aM),[h,m]=j.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=j.useState({}),b=Et(t,A=>m(A)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(w),C=h?x.indexOf(h):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,N=C>=S,T=l8(A=>{const O=A.target,L=[...d.branches].some(B=>B.contains(O));!N||L||(s==null||s(A),a==null||a(A),A.defaultPrevented||c==null||c())},g),R=c8(A=>{const O=A.target;[...d.branches].some(B=>B.contains(O))||(o==null||o(A),a==null||a(A),A.defaultPrevented||c==null||c())},g);return n8(A=>{C===d.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&c&&(A.preventDefault(),c()))},g),j.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Bk=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),zk(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Bk)}},[h,g,n,d]),j.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),zk())},[h,d]),j.useEffect(()=>{const A=()=>v({});return document.addEventListener(Lx,A),()=>document.removeEventListener(Lx,A)},[]),p.jsx(Ze.div,{...u,ref:b,style:{pointerEvents:k?N?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,T.onPointerDownCapture)})});Rw.displayName=r8;var o8="DismissableLayerBranch",a8=j.forwardRef((e,t)=>{const n=j.useContext(aM),r=j.useRef(null),s=Et(t,r);return j.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),p.jsx(Ze.div,{...e,ref:s})});a8.displayName=o8;function l8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=j.useRef(!1),s=j.useRef(()=>{});return j.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){lM(s8,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 c8(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=j.useRef(!1);return j.useEffect(()=>{const s=o=>{o.target&&!r.current&&lM(i8,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 zk(){const e=new CustomEvent(Lx);document.dispatchEvent(e)}function lM(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?oM(s,o):s.dispatchEvent(o)}var Ep="focusScope.autoFocusOnMount",jp="focusScope.autoFocusOnUnmount",Vk={bubbles:!1,cancelable:!0},u8="FocusScope",Mw=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,u]=j.useState(null),d=ur(s),h=ur(o),m=j.useRef(null),g=Et(t,x=>u(x)),v=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let x=function(k){if(v.paused||!c)return;const N=k.target;c.contains(N)?m.current=N:ds(m.current,{select:!0})},w=function(k){if(v.paused||!c)return;const N=k.relatedTarget;N!==null&&(c.contains(N)||ds(m.current,{select:!0}))},S=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&ds(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]),j.useEffect(()=>{if(c){Uk.add(v);const x=document.activeElement;if(!c.contains(x)){const S=new CustomEvent(Ep,Vk);c.addEventListener(Ep,d),c.dispatchEvent(S),S.defaultPrevented||(d8(g8(cM(c)),{select:!0}),document.activeElement===x&&ds(c))}return()=>{c.removeEventListener(Ep,d),setTimeout(()=>{const S=new CustomEvent(jp,Vk);c.addEventListener(jp,h),c.dispatchEvent(S),S.defaultPrevented||ds(x??document.body,{select:!0}),c.removeEventListener(jp,h),Uk.remove(v)},0)}}},[c,d,h,v]);const b=j.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]=f8(C);k&&N?!x.shiftKey&&S===N?(x.preventDefault(),n&&ds(k,{select:!0})):x.shiftKey&&S===k&&(x.preventDefault(),n&&ds(N,{select:!0})):S===C&&x.preventDefault()}},[n,r,v.paused]);return p.jsx(Ze.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Mw.displayName=u8;function d8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ds(r,{select:t}),document.activeElement!==n)return}function f8(e){const t=cM(e),n=Hk(t,e),r=Hk(t.reverse(),e);return[n,r]}function cM(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(!h8(n,{upTo:t}))return n}function h8(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 p8(e){return e instanceof HTMLInputElement&&"select"in e}function ds(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&p8(e)&&t&&e.select()}}var Uk=m8();function m8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Wk(e,t),e.unshift(t)},remove(t){var n;e=Wk(e,t),(n=e[0])==null||n.resume()}}}function Wk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function g8(e){return e.filter(t=>t.tagName!=="A")}var y8="Portal",Iw=j.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=j.useState(!1);vs(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?fF.createPortal(p.jsx(Ze.div,{...r,ref:t}),a):null});Iw.displayName=y8;function v8(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Lr=e=>{const{present:t,children:n}=e,r=x8(t),s=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),o=Et(r.ref,w8(s));return typeof n=="function"||r.isPresent?j.cloneElement(s,{ref:o}):null};Lr.displayName="Presence";function x8(e){const[t,n]=j.useState(),r=j.useRef(null),s=j.useRef(e),o=j.useRef("none"),a=e?"mounted":"unmounted",[c,u]=v8(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const d=fu(r.current);o.current=c==="mounted"?d:"none"},[c]),vs(()=>{const d=r.current,h=s.current;if(h!==e){const g=o.current,v=fu(d);e?u("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(h&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),vs(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,m=v=>{const x=fu(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=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=v=>{v.target===t&&(o.current=fu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{h.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:j.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function fu(e){return(e==null?void 0:e.animationName)||"none"}function w8(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 Tp=0;function uM(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Kk()),document.body.insertAdjacentElement("beforeend",e[1]??Kk()),Tp++,()=>{Tp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Tp--}},[])}function Kk(){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 dM(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 b8(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 Pu="right-scroll-bar-position",Lu="width-before-scroll-bar",_8="with-scroll-bars-hidden",S8="--removed-body-scroll-bar-size";function Ap(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function k8(e,t){var n=j.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 N8=typeof window<"u"?j.useLayoutEffect:j.useEffect,Gk=new WeakMap;function C8(e,t){var n=k8(null,function(r){return e.forEach(function(s){return Ap(s,r)})});return N8(function(){var r=Gk.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(c){o.has(c)||Ap(c,null)}),o.forEach(function(c){s.has(c)||Ap(c,a)})}Gk.set(n,e)},[e]),n}function E8(e){return e}function j8(e,t){t===void 0&&(t=E8);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 h=a;a=[],h.forEach(o)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return s}function T8(e){e===void 0&&(e={});var t=j8(null);return t.options=sr({async:!0,ssr:!1},e),t}var fM=function(e){var t=e.sideCar,n=dM(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,sr({},n))};fM.isSideCarExport=!0;function A8(e,t){return e.useMedium(t),fM}var hM=T8(),Rp=function(){},Ad=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Rp,onWheelCapture:Rp,onTouchMoveCapture:Rp}),s=r[0],o=r[1],a=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,h=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=dM(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,R=C8([n,t]),A=sr(sr({},N),s);return j.createElement(j.Fragment,null,h&&j.createElement(T,{sideCar:hM,removeScrollBar:d,shards:m,noRelative:v,noIsolation:b,inert:x,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:k}),a?j.cloneElement(j.Children.only(c),sr(sr({},A),{ref:R})):j.createElement(C,sr({},A,{className:u,ref:R}),c))});Ad.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ad.classNames={fullWidth:Lu,zeroRight:Pu};var R8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function M8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=R8();return t&&e.setAttribute("nonce",t),e}function I8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function O8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var P8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=M8())&&(I8(t,n),O8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},L8=function(){var e=P8();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pM=function(){var e=L8(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},D8={left:0,top:0,right:0,gap:0},Mp=function(e){return parseInt(e||"",10)||0},$8=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[Mp(n),Mp(r),Mp(s)]},q8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return D8;var t=$8(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])}},F8=pM(),eo="data-scroll-locked",B8=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
493
|
+
.`.concat(_8,` {
|
|
494
|
+
overflow: hidden `).concat(r,`;
|
|
495
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
496
|
+
}
|
|
497
|
+
body[`).concat(eo,`] {
|
|
498
|
+
overflow: hidden `).concat(r,`;
|
|
499
|
+
overscroll-behavior: contain;
|
|
500
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
501
|
+
padding-left: `.concat(s,`px;
|
|
502
|
+
padding-top: `).concat(o,`px;
|
|
503
|
+
padding-right: `).concat(a,`px;
|
|
504
|
+
margin-left:0;
|
|
505
|
+
margin-top:0;
|
|
506
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
507
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.`).concat(Pu,` {
|
|
511
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.`).concat(Lu,` {
|
|
515
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.`).concat(Pu," .").concat(Pu,` {
|
|
519
|
+
right: 0 `).concat(r,`;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.`).concat(Lu," .").concat(Lu,` {
|
|
523
|
+
margin-right: 0 `).concat(r,`;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
body[`).concat(eo,`] {
|
|
527
|
+
`).concat(S8,": ").concat(c,`px;
|
|
528
|
+
}
|
|
529
|
+
`)},Yk=function(){var e=parseInt(document.body.getAttribute(eo)||"0",10);return isFinite(e)?e:0},z8=function(){j.useEffect(function(){return document.body.setAttribute(eo,(Yk()+1).toString()),function(){var e=Yk()-1;e<=0?document.body.removeAttribute(eo):document.body.setAttribute(eo,e.toString())}},[])},V8=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;z8();var o=j.useMemo(function(){return q8(s)},[s]);return j.createElement(F8,{styles:B8(o,!t,s,n?"":"!important")})},Dx=!1;if(typeof window<"u")try{var hu=Object.defineProperty({},"passive",{get:function(){return Dx=!0,!0}});window.addEventListener("test",hu,hu),window.removeEventListener("test",hu,hu)}catch{Dx=!1}var qi=Dx?{passive:!1}:!1,H8=function(e){return e.tagName==="TEXTAREA"},mM=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!H8(e)&&n[t]==="visible")},U8=function(e){return mM(e,"overflowY")},W8=function(e){return mM(e,"overflowX")},Xk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=gM(e,r);if(s){var o=yM(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},K8=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},G8=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gM=function(e,t){return e==="v"?U8(t):W8(t)},yM=function(e,t){return e==="v"?K8(t):G8(t)},Y8=function(e,t){return e==="h"&&t==="rtl"?-1:1},X8=function(e,t,n,r,s){var o=Y8(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),d=!1,h=a>0,m=0,g=0;do{if(!c)break;var v=yM(e,c),b=v[0],x=v[1],w=v[2],S=x-w-o*b;(b||S)&&gM(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(h&&Math.abs(m)<1||!h&&Math.abs(g)<1)&&(d=!0),d},pu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qk=function(e){return[e.deltaX,e.deltaY]},Jk=function(e){return e&&"current"in e?e.current:e},Q8=function(e,t){return e[0]===t[0]&&e[1]===t[1]},J8=function(e){return`
|
|
530
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
531
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
532
|
+
`)},Z8=0,Fi=[];function eV(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),s=j.useState(Z8++)[0],o=j.useState(pM)[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var x=b8([e.lockRef.current],(e.shards||[]).map(Jk),!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=j.useCallback(function(x,w){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var S=pu(x),C=n.current,k="deltaX"in x?x.deltaX:C[0]-S[0],N="deltaY"in x?x.deltaY:C[1]-S[1],T,R=x.target,A=Math.abs(k)>Math.abs(N)?"h":"v";if("touches"in x&&A==="h"&&R.type==="range")return!1;var O=window.getSelection(),L=O&&O.anchorNode,B=L?L===R||L.contains(R):!1;if(B)return!1;var I=Xk(A,R);if(!I)return!0;if(I?T=A:(T=A==="v"?"h":"v",I=Xk(A,R)),!I)return!1;if(!r.current&&"changedTouches"in x&&(k||N)&&(r.current=T),!T)return!0;var $=r.current||T;return X8($,w,x,$==="h"?k:N)},[]),u=j.useCallback(function(x){var w=x;if(!(!Fi.length||Fi[Fi.length-1]!==o)){var S="deltaY"in w?Qk(w):pu(w),C=t.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&Q8(T.delta,S)})[0];if(C&&C.should){w.cancelable&&w.preventDefault();return}if(!C){var k=(a.current.shards||[]).map(Jk).filter(Boolean).filter(function(T){return T.contains(w.target)}),N=k.length>0?c(w,k[0]):!a.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),d=j.useCallback(function(x,w,S,C){var k={name:x,delta:w,target:S,should:C,shadowParent:tV(S)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(N){return N!==k})},1)},[]),h=j.useCallback(function(x){n.current=pu(x),r.current=void 0},[]),m=j.useCallback(function(x){d(x.type,Qk(x),x.target,c(x,e.lockRef.current))},[]),g=j.useCallback(function(x){d(x.type,pu(x),x.target,c(x,e.lockRef.current))},[]);j.useEffect(function(){return Fi.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",u,qi),document.addEventListener("touchmove",u,qi),document.addEventListener("touchstart",h,qi),function(){Fi=Fi.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,qi),document.removeEventListener("touchmove",u,qi),document.removeEventListener("touchstart",h,qi)}},[]);var v=e.removeScrollBar,b=e.inert;return j.createElement(j.Fragment,null,b?j.createElement(o,{styles:J8(s)}):null,v?j.createElement(V8,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nV=A8(hM,eV);var Ow=j.forwardRef(function(e,t){return j.createElement(Ad,sr({},e,{ref:t,sideCar:nV}))});Ow.classNames=Ad.classNames;var rV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Bi=new WeakMap,mu=new WeakMap,gu={},Ip=0,vM=function(e){return e&&(e.host||vM(e.parentNode))},sV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vM(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})},iV=function(e,t,n,r){var s=sV(t,Array.isArray(e)?e:[e]);gu[n]||(gu[n]=new WeakMap);var o=gu[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 h=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(g){if(c.has(g))h(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",x=(Bi.get(g)||0)+1,w=(o.get(g)||0)+1;Bi.set(g,x),o.set(g,w),a.push(g),x===1&&b&&mu.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 h(t),c.clear(),Ip++,function(){a.forEach(function(m){var g=Bi.get(m)-1,v=o.get(m)-1;Bi.set(m,g),o.set(m,v),g||(mu.has(m)||m.removeAttribute(r),mu.delete(m)),v||m.removeAttribute(n)}),Ip--,Ip||(Bi=new WeakMap,Bi=new WeakMap,mu=new WeakMap,gu={})}},xM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=rV(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),iV(r,s,n,"aria-hidden")):function(){return null}},Rd="Dialog",[wM]=ei(Rd),[oV,Wn]=wM(Rd),bM=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=j.useRef(null),u=j.useRef(null),[d,h]=Aw({prop:r,defaultProp:s??!1,onChange:o,caller:Rd});return p.jsx(oV,{scope:t,triggerRef:c,contentRef:u,contentId:Ba(),titleId:Ba(),descriptionId:Ba(),open:d,onOpenChange:h,onOpenToggle:j.useCallback(()=>h(m=>!m),[h]),modal:a,children:n})};bM.displayName=Rd;var _M="DialogTrigger",aV=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(_M,n),o=Et(t,s.triggerRef);return p.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Dw(s.open),...r,ref:o,onClick:Re(e.onClick,s.onOpenToggle)})});aV.displayName=_M;var Pw="DialogPortal",[lV,SM]=wM(Pw,{forceMount:void 0}),kM=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Wn(Pw,t);return p.jsx(lV,{scope:t,forceMount:n,children:j.Children.map(r,a=>p.jsx(Lr,{present:n||o.open,children:p.jsx(Iw,{asChild:!0,container:s,children:a})}))})};kM.displayName=Pw;var sd="DialogOverlay",NM=j.forwardRef((e,t)=>{const n=SM(sd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Wn(sd,e.__scopeDialog);return o.modal?p.jsx(Lr,{present:r||o.open,children:p.jsx(uV,{...s,ref:t})}):null});NM.displayName=sd;var cV=il("DialogOverlay.RemoveScroll"),uV=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(sd,n);return p.jsx(Ow,{as:cV,allowPinchZoom:!0,shards:[s.contentRef],children:p.jsx(Ze.div,{"data-state":Dw(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qs="DialogContent",CM=j.forwardRef((e,t)=>{const n=SM(Qs,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Wn(Qs,e.__scopeDialog);return p.jsx(Lr,{present:r||o.open,children:o.modal?p.jsx(dV,{...s,ref:t}):p.jsx(fV,{...s,ref:t})})});CM.displayName=Qs;var dV=j.forwardRef((e,t)=>{const n=Wn(Qs,e.__scopeDialog),r=j.useRef(null),s=Et(t,n.contentRef,r);return j.useEffect(()=>{const o=r.current;if(o)return xM(o)},[]),p.jsx(EM,{...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())})}),fV=j.forwardRef((e,t)=>{const n=Wn(Qs,e.__scopeDialog),r=j.useRef(!1),s=j.useRef(!1);return p.jsx(EM,{...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()}})}),EM=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=Wn(Qs,n),u=j.useRef(null),d=Et(t,u);return uM(),p.jsxs(p.Fragment,{children:[p.jsx(Mw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:p.jsx(Rw,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Dw(c.open),...a,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(hV,{titleId:c.titleId}),p.jsx(mV,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Lw="DialogTitle",jM=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(Lw,n);return p.jsx(Ze.h2,{id:s.titleId,...r,ref:t})});jM.displayName=Lw;var TM="DialogDescription",AM=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(TM,n);return p.jsx(Ze.p,{id:s.descriptionId,...r,ref:t})});AM.displayName=TM;var RM="DialogClose",MM=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wn(RM,n);return p.jsx(Ze.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});MM.displayName=RM;function Dw(e){return e?"open":"closed"}var IM="DialogTitleWarning",[AJ,OM]=V6(IM,{contentName:Qs,titleName:Lw,docsSlug:"dialog"}),hV=({titleId:e})=>{const t=OM(IM),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
533
|
+
|
|
534
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
535
|
+
|
|
536
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pV="DialogDescriptionWarning",mV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${OM(pV).contentName}}.`;return j.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},gV=bM,yV=kM,vV=NM,xV=CM,wV=jM,bV=AM,_V=MM;function PM(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=PM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function SV(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=PM(e))&&(r&&(r+=" "),r+=t);return r}const $w="-",kV=e=>{const t=CV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split($w);return c[0]===""&&c.length!==1&&c.shift(),LM(c,t)||NV(a)},getConflictingClassGroupIds:(a,c)=>{const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}}},LM=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?LM(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join($w);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId},Zk=/^\[(.+)\]$/,NV=e=>{if(Zk.test(e)){const t=Zk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},CV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return jV(Object.entries(e.classGroups),n).forEach(([o,a])=>{$x(a,r,o,t)}),r},$x=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:eN(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(EV(s)){$x(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{$x(a,eN(t,o),n,r)})})},eN=(e,t)=>{let n=e;return t.split($w).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},EV=e=>e.isThemeGetter,jV=(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,TV=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)}}},DM="!",AV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=c=>{const u=[];let d=0,h=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(h,w)),h=w+o;continue}if(S==="/"){m=w;continue}}S==="["?d++:S==="]"&&d--}const g=u.length===0?c:c.substring(h),v=g.startsWith(DM),b=v?g.substring(1):g,x=m&&m>h?m-h:void 0;return{modifiers:u,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:x}};return n?c=>n({className:c,parseClassName:a}):a},RV=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},MV=e=>({cache:TV(e.cacheSize),parseClassName:AV(e),...kV(e)}),IV=/\s+/,OV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(IV);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{modifiers:h,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=RV(h).join(":"),S=m?w+DM: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 T=k[N];o.push(S+T)}c=d+(c.length>0?" "+c:c)}return c};function PV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=$M(t))&&(r&&(r+=" "),r+=n);return r}const $M=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$M(e[r]))&&(n&&(n+=" "),n+=t);return n};function LV(e,...t){let n,r,s,o=a;function a(u){const d=t.reduce((h,m)=>m(h),e());return n=MV(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 h=OV(u,n);return s(u,h),h}return function(){return o(PV.apply(null,arguments))}}const Ge=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},qM=/^\[(?:([a-z-]+):)?(.+)\]$/i,DV=/^\d+\/\d+$/,$V=new Set(["px","full","screen"]),qV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,FV=/\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$/,BV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,zV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cr=e=>to(e)||$V.has(e)||DV.test(e),ls=e=>wo(e,"length",QV),to=e=>!!e&&!Number.isNaN(Number(e)),Op=e=>wo(e,"number",to),ka=e=>!!e&&Number.isInteger(Number(e)),HV=e=>e.endsWith("%")&&to(e.slice(0,-1)),Ie=e=>qM.test(e),cs=e=>qV.test(e),UV=new Set(["length","size","percentage"]),WV=e=>wo(e,UV,FM),KV=e=>wo(e,"position",FM),GV=new Set(["image","url"]),YV=e=>wo(e,GV,ZV),XV=e=>wo(e,"",JV),Na=()=>!0,wo=(e,t,n)=>{const r=qM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},QV=e=>FV.test(e)&&!BV.test(e),FM=()=>!1,JV=e=>zV.test(e),ZV=e=>VV.test(e),e9=()=>{const e=Ge("colors"),t=Ge("spacing"),n=Ge("blur"),r=Ge("brightness"),s=Ge("borderColor"),o=Ge("borderRadius"),a=Ge("borderSpacing"),c=Ge("borderWidth"),u=Ge("contrast"),d=Ge("grayscale"),h=Ge("hueRotate"),m=Ge("invert"),g=Ge("gap"),v=Ge("gradientColorStops"),b=Ge("gradientColorStopPositions"),x=Ge("inset"),w=Ge("margin"),S=Ge("opacity"),C=Ge("padding"),k=Ge("saturate"),N=Ge("scale"),T=Ge("sepia"),R=Ge("skew"),A=Ge("space"),O=Ge("translate"),L=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Ie,t],$=()=>[Ie,t],H=()=>["",Cr,ls],D=()=>["auto",to,Ie],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",Ie],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[to,Ie];return{cacheSize:500,separator:":",theme:{colors:[Na],spacing:[Cr,ls],blur:["none","",cs,Ie],brightness:P(),borderColor:[e],borderRadius:["none","","full",cs,Ie],borderSpacing:$(),borderWidth:H(),contrast:P(),grayscale:q(),hueRotate:P(),invert:q(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[HV,ls],inset:I(),margin:I(),opacity:P(),padding:$(),saturate:P(),scale:P(),sepia:q(),skew:P(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}],container:["container"],columns:[{columns:[cs]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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(),Ie]}],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",ka,Ie]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ie]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",ka,Ie]}],"grid-cols":[{"grid-cols":[Na]}],"col-start-end":[{col:["auto",{span:["full",ka,Ie]},Ie]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Na]}],"row-start-end":[{row:["auto",{span:[ka,Ie]},Ie]}],"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",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],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":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,t]}],"min-w":[{"min-w":[Ie,t,"min","max","fit"]}],"max-w":[{"max-w":[Ie,t,"none","full","min","max","fit","prose",{screen:[cs]},cs]}],h:[{h:[Ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",cs,ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Op]}],"font-family":[{font:[Na]}],"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",Ie]}],"line-clamp":[{"line-clamp":["none",to,Op]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Cr,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"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,ls]}],"underline-offset":[{"underline-offset":["auto",Cr,Ie]}],"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",Ie]}],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",Ie]}],"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(),KV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",WV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},YV]}],"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,Ie]}],"outline-w":[{outline:[Cr,ls]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Cr,ls]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cs,XV]}],"shadow-color":[{shadow:[Na]}],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",cs,Ie]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[k]}],sepia:[{sepia:[T]}],"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":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"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",Ie]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[ka,Ie]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ie]}],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",Ie]}],"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",Ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Cr,ls,Op]}],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"]}}},t9=LV(e9);function Bt(...e){return t9(SV(e))}const n9={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]"};function Sl({open:e,onOpenChange:t,title:n,description:r,children:s,className:o,size:a="md"}){return p.jsx(gV,{open:e,onOpenChange:t,children:p.jsxs(yV,{children:[p.jsx(vV,{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"}),p.jsxs(xV,{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",n9[a],o),children:[(n||r)&&p.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-node-border",children:[p.jsxs("div",{children:[n&&p.jsx(wV,{className:"text-lg font-semibold text-white",children:n}),r&&p.jsx(bV,{className:"mt-1 text-sm text-gray-400",children:r})]}),p.jsx(_V,{className:"rounded-full p-1 hover:bg-white/10 transition-colors",children:p.jsx(_l,{className:"w-5 h-5 text-gray-400"})})]}),p.jsx("div",{className:"max-h-[calc(85vh-8rem)] overflow-y-auto",children:s})]})]})})}function Md({children:e,className:t}){return p.jsx("div",{className:Bt("flex items-center justify-end gap-3 p-4 border-t border-node-border",t),children:e})}const r9={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"},s9={sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},Ye=j.forwardRef(({className:e,variant:t="primary",size:n="md",loading:r,icon:s,disabled:o,children:a,...c},u)=>p.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",r9[t],s9[n],e),...c,children:[r?p.jsx(vo,{className:"w-4 h-4 animate-spin"}):s&&p.jsx("span",{className:"flex-shrink-0",children:s}),a]}));Ye.displayName="Button";function BM(e){const t=e+"CollectionProvider",[n,r]=ei(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 p.jsx(s,{scope:w,itemMap:k,collectionRef:C,children:S})};a.displayName=t;const c=e+"CollectionSlot",u=il(c),d=pt.forwardRef((x,w)=>{const{scope:S,children:C}=x,k=o(c,S),N=Et(w,k.collectionRef);return p.jsx(u,{ref:N,children:C})});d.displayName=c;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=il(h),v=pt.forwardRef((x,w)=>{const{scope:S,children:C,...k}=x,N=pt.useRef(null),T=Et(w,N),R=o(h,S);return pt.useEffect(()=>(R.itemMap.set(N,{ref:N,...k}),()=>void R.itemMap.delete(N))),p.jsx(g,{[m]:"",ref:T,children:C})});v.displayName=h;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((R,A)=>k.indexOf(R.ref.current)-k.indexOf(A.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:d,ItemSlot:v},b,r]}var i9=j.createContext(void 0);function qw(e){const t=j.useContext(i9);return e||t||"ltr"}var Pp="rovingFocusGroup.onEntryFocus",o9={bubbles:!1,cancelable:!0},kl="RovingFocusGroup",[qx,zM,a9]=BM(kl),[l9,Id]=ei(kl,[a9]),[c9,u9]=l9(kl),VM=j.forwardRef((e,t)=>p.jsx(qx.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(qx.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(d9,{...e,ref:t})})}));VM.displayName=kl;var d9=j.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...m}=e,g=j.useRef(null),v=Et(t,g),b=qw(o),[x,w]=Aw({prop:a,defaultProp:c??null,onChange:u,caller:kl}),[S,C]=j.useState(!1),k=ur(d),N=zM(n),T=j.useRef(!1),[R,A]=j.useState(0);return j.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(Pp,k),()=>O.removeEventListener(Pp,k)},[k]),p.jsx(c9,{scope:n,orientation:r,dir:b,loop:s,currentTabStopId:x,onItemFocus:j.useCallback(O=>w(O),[w]),onItemShiftTab:j.useCallback(()=>C(!0),[]),onFocusableItemAdd:j.useCallback(()=>A(O=>O+1),[]),onFocusableItemRemove:j.useCallback(()=>A(O=>O-1),[]),children:p.jsx(Ze.div,{tabIndex:S||R===0?-1:0,"data-orientation":r,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{T.current=!0}),onFocus:Re(e.onFocus,O=>{const L=!T.current;if(O.target===O.currentTarget&&L&&!S){const B=new CustomEvent(Pp,o9);if(O.currentTarget.dispatchEvent(B),!B.defaultPrevented){const I=N().filter(z=>z.focusable),$=I.find(z=>z.active),H=I.find(z=>z.id===x),V=[$,H,...I].filter(Boolean).map(z=>z.ref.current);WM(V,h)}}T.current=!1}),onBlur:Re(e.onBlur,()=>C(!1))})})}),HM="RovingFocusGroupItem",UM=j.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...c}=e,u=Ba(),d=o||u,h=u9(HM,n),m=h.currentTabStopId===d,g=zM(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:x}=h;return j.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),p.jsx(qx.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:p.jsx(Ze.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Re(e.onMouseDown,w=>{r?h.onItemFocus(d):w.preventDefault()}),onFocus:Re(e.onFocus,()=>h.onItemFocus(d)),onKeyDown:Re(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=p9(w,h.orientation,h.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=h.loop?m9(k,N+1):k.slice(N+1)}setTimeout(()=>WM(k))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:x!=null}):a})})});UM.displayName=HM;var f9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function h9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function p9(e,t,n){const r=h9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return f9[r]}function WM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function m9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KM=VM,GM=UM,Od="Tabs",[g9]=ei(Od,[Id]),YM=Id(),[y9,Fw]=g9(Od),XM=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,h=qw(c),[m,g]=Aw({prop:r,onChange:s,defaultProp:o??"",caller:Od});return p.jsx(y9,{scope:n,baseId:Ba(),value:m,onValueChange:g,orientation:a,dir:h,activationMode:u,children:p.jsx(Ze.div,{dir:h,"data-orientation":a,...d,ref:t})})});XM.displayName=Od;var QM="TabsList",JM=j.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Fw(QM,n),a=YM(n);return p.jsx(KM,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:p.jsx(Ze.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});JM.displayName=QM;var ZM="TabsTrigger",eI=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=Fw(ZM,n),c=YM(n),u=rI(a.baseId,r),d=sI(a.baseId,r),h=r===a.value;return p.jsx(GM,{asChild:!0,...c,focusable:!s,active:h,children:p.jsx(Ze.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"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";!h&&!s&&m&&a.onValueChange(r)})})})});eI.displayName=ZM;var tI="TabsContent",nI=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=Fw(tI,n),u=rI(c.baseId,r),d=sI(c.baseId,r),h=r===c.value,m=j.useRef(h);return j.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),p.jsx(Lr,{present:s||h,children:({present:g})=>p.jsx(Ze.div,{"data-state":h?"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})})});nI.displayName=tI;function rI(e,t){return`${e}-trigger-${t}`}function sI(e,t){return`${e}-content-${t}`}var v9=XM,iI=JM,oI=eI,aI=nI;const lI=v9,Bw=j.forwardRef(({className:e,...t},n)=>p.jsx(iI,{ref:n,className:Bt("inline-flex items-center gap-1 border-b border-node-border w-full px-2",e),...t}));Bw.displayName=iI.displayName;const nr=j.forwardRef(({className:e,...t},n)=>p.jsx(oI,{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=oI.displayName;const rr=j.forwardRef(({className:e,...t},n)=>p.jsx(aI,{ref:n,className:Bt("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",e),...t}));rr.displayName=aI.displayName;function tN(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 x9(e){if(Array.isArray(e))return e}function w9(e,t,n){return(t=E9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b9(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(h){d=!0,s=h}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return c}}function _9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
537
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nN(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 rN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nN(Object(n),!0).forEach(function(r){w9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S9(e,t){if(e==null)return{};var n,r,s=k9(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 k9(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 N9(e,t){return x9(e)||b9(e,t)||j9(e,t)||_9()}function C9(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 E9(e){var t=C9(e,"string");return typeof t=="symbol"?t:t+""}function j9(e,t){if(e){if(typeof e=="string")return tN(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)?tN(e,t):void 0}}function T9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sN(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 iN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sN(Object(n),!0).forEach(function(r){T9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function A9(){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 Aa(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 id(e){return{}.toString.call(e).includes("Object")}function R9(e){return!Object.keys(e).length}function ol(e){return typeof e=="function"}function M9(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function I9(e,t){return id(t)||ps("changeType"),Object.keys(t).some(function(n){return!M9(e,n)})&&ps("changeField"),t}function O9(e){ol(e)||ps("selectorType")}function P9(e){ol(e)||id(e)||ps("handlerType"),id(e)&&Object.values(e).some(function(t){return!ol(t)})&&ps("handlersType")}function L9(e){e||ps("initialIsRequired"),id(e)||ps("initialType"),R9(e)&&ps("initialContent")}function D9(e,t){throw new Error(e[t]||e.default)}var $9={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"},ps=Aa(D9)($9),yu={changes:I9,selector:O9,handler:P9,initial:L9};function q9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};yu.initial(e),yu.handler(t);var n={current:e},r=Aa(z9)(n,t),s=Aa(B9)(n),o=Aa(yu.changes)(e),a=Aa(F9)(n);function c(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(h){return h};return yu.selector(d),d(n.current)}function u(d){A9(r,s,o,a)(d)}return[c,u]}function F9(e,t){return ol(t)?t(e.current):t}function B9(e,t){return e.current=iN(iN({},e.current),t),t}function z9(e,t,n){return ol(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 V9={create:q9},H9={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function U9(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 W9(e){return{}.toString.call(e).includes("Object")}function K9(e){return e||oN("configIsRequired"),W9(e)||oN("configType"),e.urls?(G9(),{paths:{vs:e.urls.monacoBase}}):e}function G9(){console.warn(cI.deprecation)}function Y9(e,t){throw new Error(e[t]||e.default)}var cI={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!
|
|
538
|
+
You are using deprecated way of configuration.
|
|
539
|
+
|
|
540
|
+
Instead of using
|
|
541
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
542
|
+
use
|
|
543
|
+
monaco.config({ paths: { vs: '...' } })
|
|
544
|
+
|
|
545
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
546
|
+
`},oN=U9(Y9)(cI),X9={config:K9},Q9=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 uI(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],uI(e[n],t[n]))}),rN(rN({},e),t)}var J9={type:"cancelation",msg:"operation is manually canceled"};function Lp(e){var t=!1,n=new Promise(function(r,s){e.then(function(o){return t?s(J9):r(o)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var Z9=["monaco"],eH=V9.create({config:H9,isInitialized:!1,resolve:null,reject:null,monaco:null}),dI=N9(eH,2),Nl=dI[0],Pd=dI[1];function tH(e){var t=X9.config(e),n=t.monaco,r=S9(t,Z9);Pd(function(s){return{config:uI(s.config,r),monaco:n}})}function nH(){var e=Nl(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Pd({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Lp(Dp);if(window.monaco&&window.monaco.editor)return fI(window.monaco),e.resolve(window.monaco),Lp(Dp);Q9(rH,iH)(oH)}return Lp(Dp)}function rH(e){return document.body.appendChild(e)}function sH(e){var t=document.createElement("script");return e&&(t.src=e),t}function iH(e){var t=Nl(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=sH("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function oH(){var e=Nl(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;fI(r),e.resolve(r)},function(n){e.reject(n)})}function fI(e){Nl().monaco||Pd({monaco:e})}function aH(){return Nl(function(e){var t=e.monaco;return t})}var Dp=new Promise(function(e,t){return Pd({resolve:e,reject:t})}),hI={config:tH,init:nH,__getMonacoInstance:aH},lH={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},$p=lH,cH={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},uH=cH;function dH({children:e}){return pt.createElement("div",{style:uH.container},e)}var fH=dH,hH=fH;function pH({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:a}){return pt.createElement("section",{style:{...$p.wrapper,width:e,height:t},...a},!n&&pt.createElement(hH,null,r),pt.createElement("div",{ref:s,style:{...$p.fullWidth,...!n&&$p.hide},className:o}))}var mH=pH,pI=j.memo(mH);function gH(e){j.useEffect(e,[])}var mI=gH;function yH(e,t,n=!0){let r=j.useRef(!0);j.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var on=yH;function za(){}function Gi(e,t,n,r){return vH(e,r)||xH(e,t,n,r)}function vH(e,t){return e.editor.getModel(gI(e,t))}function xH(e,t,n,r){return e.editor.createModel(t,n,r?gI(e,r):void 0)}function gI(e,t){return e.Uri.parse(t)}function wH({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:d="light",loading:h="Loading...",options:m={},height:g="100%",width:v="100%",className:b,wrapperProps:x={},beforeMount:w=za,onMount:S=za}){let[C,k]=j.useState(!1),[N,T]=j.useState(!0),R=j.useRef(null),A=j.useRef(null),O=j.useRef(null),L=j.useRef(S),B=j.useRef(w),I=j.useRef(!1);mI(()=>{let V=hI.init();return V.then(z=>(A.current=z)&&T(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>R.current?D():V.cancel()}),on(()=>{if(R.current&&A.current){let V=R.current.getOriginalEditor(),z=Gi(A.current,e||"",r||n||"text",o||"");z!==V.getModel()&&V.setModel(z)}},[o],C),on(()=>{if(R.current&&A.current){let V=R.current.getModifiedEditor(),z=Gi(A.current,t||"",s||n||"text",a||"");z!==V.getModel()&&V.setModel(z)}},[a],C),on(()=>{let V=R.current.getModifiedEditor();V.getOption(A.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],C),on(()=>{var V,z;(z=(V=R.current)==null?void 0:V.getModel())==null||z.original.setValue(e||"")},[e],C),on(()=>{let{original:V,modified:z}=R.current.getModel();A.current.editor.setModelLanguage(V,r||n||"text"),A.current.editor.setModelLanguage(z,s||n||"text")},[n,r,s],C),on(()=>{var V;(V=A.current)==null||V.editor.setTheme(d)},[d],C),on(()=>{var V;(V=R.current)==null||V.updateOptions(m)},[m],C);let $=j.useCallback(()=>{var Q;if(!A.current)return;B.current(A.current);let V=Gi(A.current,e||"",r||n||"text",o||""),z=Gi(A.current,t||"",s||n||"text",a||"");(Q=R.current)==null||Q.setModel({original:V,modified:z})},[n,t,s,e,r,o,a]),H=j.useCallback(()=>{var V;!I.current&&O.current&&(R.current=A.current.editor.createDiffEditor(O.current,{automaticLayout:!0,...m}),$(),(V=A.current)==null||V.editor.setTheme(d),k(!0),I.current=!0)},[m,d,$]);j.useEffect(()=>{C&&L.current(R.current,A.current)},[C]),j.useEffect(()=>{!N&&!C&&H()},[N,C,H]);function D(){var z,Q,F,q;let V=(z=R.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=R.current)==null||q.dispose()}return pt.createElement(pI,{width:v,height:g,isEditorReady:C,loading:h,_ref:O,className:b,wrapperProps:x})}var bH=wH;j.memo(bH);function _H(e){let t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}var SH=_H,vu=new Map;function kH({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:o,theme:a="light",line:c,loading:u="Loading...",options:d={},overrideServices:h={},saveViewState:m=!0,keepCurrentModel:g=!1,width:v="100%",height:b="100%",className:x,wrapperProps:w={},beforeMount:S=za,onMount:C=za,onChange:k,onValidate:N=za}){let[T,R]=j.useState(!1),[A,O]=j.useState(!0),L=j.useRef(null),B=j.useRef(null),I=j.useRef(null),$=j.useRef(C),H=j.useRef(S),D=j.useRef(),V=j.useRef(r),z=SH(o),Q=j.useRef(!1),F=j.useRef(!1);mI(()=>{let P=hI.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?Y():P.cancel()}),on(()=>{var W,ie,K,J;let P=Gi(L.current,e||r||"",t||s||"",o||n||"");P!==((W=B.current)==null?void 0:W.getModel())&&(m&&vu.set(z,(ie=B.current)==null?void 0:ie.saveViewState()),(K=B.current)==null||K.setModel(P),m&&((J=B.current)==null||J.restoreViewState(vu.get(o))))},[o],T),on(()=>{var P;(P=B.current)==null||P.updateOptions(d)},[d],T),on(()=>{!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],T),on(()=>{var W,ie;let P=(W=B.current)==null?void 0:W.getModel();P&&s&&((ie=L.current)==null||ie.editor.setModelLanguage(P,s))},[s],T),on(()=>{var P;c!==void 0&&((P=B.current)==null||P.revealLine(c))},[c],T),on(()=>{var P;(P=L.current)==null||P.editor.setTheme(a)},[a],T);let q=j.useCallback(()=>{var P;if(!(!I.current||!L.current)&&!Q.current){H.current(L.current);let W=o||n,ie=Gi(L.current,r||e||"",t||s||"",W||"");B.current=(P=L.current)==null?void 0:P.editor.create(I.current,{model:ie,automaticLayout:!0,...d},h),m&&B.current.restoreViewState(vu.get(W)),L.current.editor.setTheme(a),c!==void 0&&B.current.revealLine(c),R(!0),Q.current=!0}},[e,t,n,r,s,o,d,h,m,a,c]);j.useEffect(()=>{T&&$.current(B.current,L.current)},[T]),j.useEffect(()=>{!A&&!T&&q()},[A,T,q]),V.current=r,j.useEffect(()=>{var P,W;T&&k&&((P=D.current)==null||P.dispose(),D.current=(W=B.current)==null?void 0:W.onDidChangeModelContent(ie=>{F.current||k(B.current.getValue(),ie)}))},[T,k]),j.useEffect(()=>{if(T){let P=L.current.editor.onDidChangeMarkers(W=>{var K;let ie=(K=B.current.getModel())==null?void 0:K.uri;if(ie&&W.find(J=>J.path===ie.path)){let J=L.current.editor.getModelMarkers({resource:ie});N==null||N(J)}});return()=>{P==null||P.dispose()}}return()=>{}},[T,N]);function Y(){var P,W;(P=D.current)==null||P.dispose(),g?m&&vu.set(o,B.current.saveViewState()):(W=B.current.getModel())==null||W.dispose(),B.current.dispose()}return pt.createElement(pI,{width:v,height:b,isEditorReady:T,loading:u,_ref:I,className:x,wrapperProps:w})}var NH=kH,CH=j.memo(NH),Va=CH;const zw=Symbol.for("yaml.alias"),Fx=Symbol.for("yaml.document"),ms=Symbol.for("yaml.map"),yI=Symbol.for("yaml.pair"),dr=Symbol.for("yaml.scalar"),bo=Symbol.for("yaml.seq"),Nn=Symbol.for("yaml.node.type"),ti=e=>!!e&&typeof e=="object"&&e[Nn]===zw,Cl=e=>!!e&&typeof e=="object"&&e[Nn]===Fx,El=e=>!!e&&typeof e=="object"&&e[Nn]===ms,ft=e=>!!e&&typeof e=="object"&&e[Nn]===yI,He=e=>!!e&&typeof e=="object"&&e[Nn]===dr,jl=e=>!!e&&typeof e=="object"&&e[Nn]===bo;function ct(e){if(e&&typeof e=="object")switch(e[Nn]){case ms:case bo:return!0}return!1}function ut(e){if(e&&typeof e=="object")switch(e[Nn]){case zw:case ms:case dr:case bo:return!0}return!1}const vI=e=>(He(e)||ct(e))&&!!e.anchor,Bs=Symbol("break visit"),EH=Symbol("skip children"),Ha=Symbol("remove node");function _o(e,t){const n=jH(t);Cl(e)?Yi(null,e.contents,n,Object.freeze([e]))===Ha&&(e.contents=null):Yi(null,e,n,Object.freeze([]))}_o.BREAK=Bs;_o.SKIP=EH;_o.REMOVE=Ha;function Yi(e,t,n,r){const s=TH(e,t,n,r);if(ut(s)||ft(s))return AH(e,r,s),Yi(e,s,n,r);if(typeof s!="symbol"){if(ct(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const a=Yi(o,t.items[o],n,r);if(typeof a=="number")o=a-1;else{if(a===Bs)return Bs;a===Ha&&(t.items.splice(o,1),o-=1)}}}else if(ft(t)){r=Object.freeze(r.concat(t));const o=Yi("key",t.key,n,r);if(o===Bs)return Bs;o===Ha&&(t.key=null);const a=Yi("value",t.value,n,r);if(a===Bs)return Bs;a===Ha&&(t.value=null)}}return s}function jH(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 TH(e,t,n,r){var s,o,a,c,u;if(typeof n=="function")return n(e,t,r);if(El(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(jl(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(ti(t))return(u=n.Alias)==null?void 0:u.call(n,e,t,r)}function AH(e,t,n){const r=t[t.length-1];if(ct(r))r.items[e]=n;else if(ft(r))e==="key"?r.key=n:r.value=n;else if(Cl(r))r.contents=n;else{const s=ti(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const RH={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},MH=e=>e.replace(/[!,[\]{}]/g,t=>RH[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+MH(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&&ut(t.contents)){const o={};_o(t.contents,(a,c)=>{ut(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(`
|
|
547
|
+
`)}}qt.defaultYaml={explicit:!1,version:"1.2"};qt.defaultTags={"!!":"tag:yaml.org,2002:"};function xI(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 wI(e){const t=new Set;return _o(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function bI(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function IH(e,t){const n=[],r=new Map;let s=null;return{onAnchor:o=>{n.push(o),s??(s=wI(e));const a=bI(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)||ct(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 Xi(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=Xi(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=Xi(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=Xi(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=Xi(e,r,s,o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}return e.call(t,n,r)}function Sn(e,t,n){if(Array.isArray(e))return e.map((r,s)=>Sn(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!vI(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 Vw{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(!Cl(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=Sn(this,"",a);if(typeof s=="function")for(const{count:u,res:d}of a.anchors.values())s(d,u);return typeof o=="function"?Xi(o,{"":c},"",c):c}}class Hw extends Vw{constructor(t){super(zw),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=[],_o(t,{Node:(o,a)=>{(ti(a)||vI(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||(Sn(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=Du(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(xI(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 Du(e,t,n){if(ti(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(ct(t)){let r=0;for(const s of t.items){const o=Du(e,s,n);o>r&&(r=o)}return r}else if(ft(t)){const r=Du(e,t.key,n),s=Du(e,t.value,n);return Math.max(r,s)}return 1}const _I=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Vw{constructor(t){super(dr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Sn(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 OH="tag:yaml.org,2002:";function PH(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 al(e,t,n){var m,g,v;if(Cl(e)&&(e=e.contents),ut(e))return e;if(ft(e)){const b=(g=(m=n.schema[ms]).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=OH+t.slice(2));let d=PH(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[ms]:Symbol.iterator in Object(e)?a[bo]:a[ms]}o&&(o(d),delete n.onTagObj);const h=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?h.tag=t:d.default||(h.tag=d.tag),u&&(u.node=h),h}function od(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 al(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 Ra=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let SI=class extends Vw{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=>ut(r)||ft(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ra(t))this.add(n);else{const[r,...s]=t,o=this.get(r,!0);if(ct(o))o.addIn(s,n);else if(o===void 0&&this.schema)this.set(r,od(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(ct(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:ct(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 ct(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(ct(o))o.setIn(s,n);else if(o===void 0&&this.schema)this.set(r,od(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};const LH=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Tr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Vs=(e,t,n)=>e.endsWith(`
|
|
548
|
+
`)?Tr(n,t):n.includes(`
|
|
549
|
+
`)?`
|
|
550
|
+
`+Tr(n,t):(e.endsWith(" ")?"":" ")+n,kI="flow",Bx="block",$u="quoted";function Ld(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=[],h={};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===Bx&&(x=aN(e,x,t.length),x!==-1&&(m=x+u));for(let k;k=e[x+=1];){if(n===$u&&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===`
|
|
551
|
+
`)n===Bx&&(x=aN(e,x,t.length)),m=x+t.length+u,g=void 0;else{if(k===" "&&v&&v!==" "&&v!==`
|
|
552
|
+
`&&v!==" "){const N=e[x+1];N&&N!==" "&&N!==`
|
|
553
|
+
`&&N!==" "&&(g=x)}if(x>=m)if(g)d.push(g),m=g+u,g=void 0;else if(n===$u){for(;v===" "||v===" ";)v=k,k=e[x+=1],b=!0;const N=x>S+1?x-2:w-1;if(h[N])return e;d.push(N),h[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],T=d[k+1]||e.length;N===0?C=`
|
|
554
|
+
${t}${e.slice(0,T)}`:(n===$u&&h[N]&&(C+=`${e[N]}\\`),C+=`
|
|
555
|
+
${t}${e.slice(N+1,T)}`)}return C}function aN(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!==`
|
|
556
|
+
`);r=t,s=t+1,o=e[s]}return r}const Dd=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$d=e=>/^(%|---|\.\.\.)/m.test(e);function DH(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]===`
|
|
557
|
+
`){if(o-a>r)return!0;if(a=o+1,s-a<=r)return!1}return!0}function Ua(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,o=t.indent||($d(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 h=n.substr(u+2,4);switch(h){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:h.substr(0,2)==="00"?a+="\\x"+h.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)+`
|
|
558
|
+
|
|
559
|
+
`;n[u+2]==="\\"&&n[u+3]==="n"&&n[u+4]!=='"';)a+=`
|
|
560
|
+
`,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:Ld(a,o,$u,Dd(t,!1))}function zx(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
561
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Ua(e,t);const n=t.indent||($d(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
562
|
+
${n}`)+"'";return t.implicitKey?r:Ld(r,n,kI,Dd(t,!1))}function Qi(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Ua;else{const s=e.includes('"'),o=e.includes("'");s&&!o?r=zx:o&&!s?r=Ua:r=n?zx:Ua}return r(e,t)}let Vx;try{Vx=new RegExp(`(^|(?<!
|
|
563
|
+
))
|
|
564
|
+
+(?!
|
|
565
|
+
|$)`,"g")}catch{Vx=/\n+(?!\n|$)/g}function qu({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 Qi(n,r);const d=r.indent||(r.forceBlockIndent||$d(n)?" ":""),h=a==="literal"?!0:a==="folded"||t===Ae.BLOCK_FOLDED?!1:t===Ae.BLOCK_LITERAL?!0:!DH(n,u,d.length);if(!n)return h?`|
|
|
566
|
+
`:`>
|
|
567
|
+
`;let m,g;for(g=n.length;g>0;--g){const T=n[g-1];if(T!==`
|
|
568
|
+
`&&T!==" "&&T!==" ")break}let v=n.substring(g);const b=v.indexOf(`
|
|
569
|
+
`);b===-1?m="-":n===v||b!==v.length-1?(m="+",o&&o()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
570
|
+
`&&(v=v.slice(0,-1)),v=v.replace(Vx,`$&${d}`));let x=!1,w,S=-1;for(w=0;w<n.length;++w){const T=n[w];if(T===" ")x=!0;else if(T===`
|
|
571
|
+
`)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()),!h){const T=n.replace(/\n+/g,`
|
|
572
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`);let R=!1;const A=Dd(r,!0);a!=="folded"&&t!==Ae.BLOCK_FOLDED&&(A.onOverflow=()=>{R=!0});const O=Ld(`${C}${T}${v}`,d,Bx,A);if(!R)return`>${N}
|
|
573
|
+
${d}${O}`}return n=n.replace(/\n+/g,`$&${d}`),`|${N}
|
|
574
|
+
${d}${C}${n}${v}`}function $H(e,t,n,r){const{type:s,value:o}=e,{actualString:a,implicitKey:c,indent:u,indentStep:d,inFlow:h}=t;if(c&&o.includes(`
|
|
575
|
+
`)||h&&/[[\]{},]/.test(o))return Qi(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||h||!o.includes(`
|
|
576
|
+
`)?Qi(o,t):qu(e,t,n,r);if(!c&&!h&&s!==Ae.PLAIN&&o.includes(`
|
|
577
|
+
`))return qu(e,t,n,r);if($d(o)){if(u==="")return t.forceBlockIndent=!0,qu(e,t,n,r);if(c&&u===d)return Qi(o,t)}const m=o.replace(/\n+/g,`$&
|
|
578
|
+
${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 Qi(o,t)}return c?m:Ld(m,u,kI,Dd(t,!1))}function Uw(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=h=>{switch(h){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return s||o?Qi(a.value,t):qu(a,t,n,r);case Ae.QUOTE_DOUBLE:return Ua(a.value,t);case Ae.QUOTE_SINGLE:return zx(a.value,t);case Ae.PLAIN:return $H(a,t,n,r);default:return null}};let d=u(c);if(d===null){const{defaultKeyType:h,defaultStringType:m}=t.options,g=s&&h||m;if(d=u(g),d===null)throw new Error(`Unsupported default string type ${g}`)}return d}function NI(e,t){const n=Object.assign({blockQuote:!0,commentString:LH,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 qH(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 FH(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],o=(He(e)||ct(e))&&e.anchor;o&&xI(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 po(e,t,n,r){var u;if(ft(e))return e.toString(t,n,r);if(ti(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=ut(e)?e:t.doc.createNode(e,{onTagObj:d=>s=d});s??(s=qH(t.doc.schema.tags,o));const a=FH(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)?Uw(o,t,n,r):o.toString(t,n,r);return a?He(o)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
|
|
579
|
+
${t.indent}${c}`:c}function BH({key:e,value:t},n,r,s){const{allNullValues:o,doc:a,indent:c,indentStep:u,options:{commentString:d,indentSeq:h,simpleKeys:m}}=n;let g=ut(e)&&e.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ct(e)||!ut(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let v=!m&&(!e||g&&t==null&&!n.inFlow||ct(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=po(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+=Vs(w,n.indent,d(g)):x&&s&&s(),w;b&&(g=null),v?(g&&(w+=Vs(w,n.indent,d(g))),w=`? ${w}
|
|
580
|
+
${c}:`):(w=`${w}:`,g&&(w+=Vs(w,n.indent,d(g))));let S,C,k;ut(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,!h&&u.length>=2&&!n.inFlow&&!v&&jl(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let N=!1;const T=po(t,n,()=>N=!0,()=>x=!0);let R=" ";if(g||S||C){if(R=S?`
|
|
581
|
+
`:"",C){const A=d(C);R+=`
|
|
582
|
+
${Tr(A,n.indent)}`}T===""&&!n.inFlow?R===`
|
|
583
|
+
`&&k&&(R=`
|
|
584
|
+
|
|
585
|
+
`):R+=`
|
|
586
|
+
${n.indent}`}else if(!v&&ct(t)){const A=T[0],O=T.indexOf(`
|
|
587
|
+
`),L=O!==-1,B=n.inFlow??t.flow??t.items.length===0;if(L||!B){let I=!1;if(L&&(A==="&"||A==="!")){let $=T.indexOf(" ");A==="&"&&$!==-1&&$<O&&T[$+1]==="!"&&($=T.indexOf(" ",$+1)),($===-1||O<$)&&(I=!0)}I||(R=`
|
|
588
|
+
${n.indent}`)}}else(T===""||T[0]===`
|
|
589
|
+
`)&&(R="");return w+=R+T,n.inFlow?N&&r&&r():k&&!N?w+=Vs(w,n.indent,d(k)):x&&s&&s(),w}function CI(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const xu="<<",Rr={identify:e=>e===xu||typeof e=="symbol"&&e.description===xu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(xu)),{addToJSMap:EI}),stringify:()=>xu},zH=(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 EI(e,t,n){if(n=e&&ti(n)?n.resolve(e.doc):n,jl(n))for(const r of n.items)qp(e,t,r);else if(Array.isArray(n))for(const r of n)qp(e,t,r);else qp(e,t,n)}function qp(e,t,n){const r=e&&ti(n)?n.resolve(e.doc):n;if(!El(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 jI(e,t,{key:n,value:r}){if(ut(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(zH(e,n))EI(e,t,r);else{const s=Sn(n,"",e);if(t instanceof Map)t.set(s,Sn(r,s,e));else if(t instanceof Set)t.add(s);else{const o=VH(n,s,e),a=Sn(r,o,e);o in t?Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[o]=a}}return t}function VH(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ut(e)&&(n!=null&&n.doc)){const r=NI(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)+'..."'),CI(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 Ww(e,t,n){const r=al(e,void 0,n),s=al(t,void 0,n);return new Ft(r,s)}class Ft{constructor(t,n=null){Object.defineProperty(this,Nn,{value:yI}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return ut(n)&&(n=n.clone(t)),ut(r)&&(r=r.clone(t)),new Ft(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return jI(n,r,this)}toString(t,n,r){return t!=null&&t.doc?BH(this,t,n,r):JSON.stringify(this)}}function TI(e,t,n){return(t.inFlow??e.flow?UH:HH)(e,t,n)}function HH({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:o,onChompKeep:a,onComment:c}){const{indent:u,options:{commentString:d}}=n,h=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(ut(x))!m&&x.spaceBefore&&g.push(""),ad(n,g,x.commentBefore,m),x.comment&&(w=x.comment);else if(ft(x)){const C=ut(x.key)?x.key:null;C&&(!m&&C.spaceBefore&&g.push(""),ad(n,g,C.commentBefore,m))}m=!1;let S=po(x,h,()=>w=null,()=>m=!0);w&&(S+=Vs(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?`
|
|
590
|
+
${u}${x}`:`
|
|
591
|
+
`}}return e?(v+=`
|
|
592
|
+
`+Tr(d(e),u),c&&c()):m&&a&&a(),v}function UH({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,h=0;const m=[];for(let b=0;b<e.length;++b){const x=e[b];let w=null;if(ut(x))x.spaceBefore&&m.push(""),ad(t,m,x.commentBefore,!1),x.comment&&(w=x.comment);else if(ft(x)){const C=ut(x.key)?x.key:null;C&&(C.spaceBefore&&m.push(""),ad(t,m,C.commentBefore,!1),C.comment&&(d=!0));const k=ut(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=po(x,u,()=>w=null);b<e.length-1&&(S+=","),w&&(S+=Vs(S,r,c(w))),!d&&(m.length>h||S.includes(`
|
|
593
|
+
`))&&(d=!0),m.push(S),h=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?`
|
|
594
|
+
${o}${s}${x}`:`
|
|
595
|
+
`;return`${b}
|
|
596
|
+
${s}${v}`}else return`${g}${a}${m.join(" ")}${a}${v}`}function ad({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 Hs(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 bn extends SI{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(ms,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(Ww(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=Hs(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)&&_I(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=Hs(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Hs(this.items,t),s=r==null?void 0:r.value;return(!n&&He(s)?s.value:s)??void 0}has(t){return!!Hs(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)jI(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})),TI(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const So={collection:"map",default:!0,nodeClass:bn,tag:"tag:yaml.org,2002:map",resolve(e,t){return El(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>bn.from(e,t,n)};class Js extends SI{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(bo,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=wu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=wu(t);if(typeof r!="number")return;const s=this.items[r];return!n&&He(s)?s.value:s}has(t){const n=wu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=wu(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];He(s)&&_I(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(Sn(o,String(s++),n));return r}toString(t,n,r){return t?TI(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(al(c,void 0,r))}}return o}}function wu(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 ko={collection:"seq",default:!0,nodeClass:Js,tag:"tag:yaml.org,2002:seq",resolve(e,t){return jl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Js.from(e,t,n)},qd={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),Uw(e,t,n,r)}},Fd={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"&&Fd.test.test(e)?e:t.options.nullStr},Kw={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&&Kw.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 AI={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},RI={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)}},MI={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},Bd=e=>typeof e=="bigint"||Number.isInteger(e),Gw=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function II(e,t,n){const{value:r}=e;return Bd(r)&&r>=0?n+r.toString(t):Kn(e)}const OI={identify:e=>Bd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Gw(e,2,8,n),stringify:e=>II(e,8,"0o")},PI={identify:Bd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Gw(e,0,10,n),stringify:Kn},LI={identify:e=>Bd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Gw(e,2,16,n),stringify:e=>II(e,16,"0x")},WH=[So,ko,qd,Fd,Kw,OI,PI,LI,AI,RI,MI];function lN(e){return typeof e=="bigint"||Number.isInteger(e)}const bu=({value:e})=>JSON.stringify(e),KH=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:bu},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:bu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:bu},{identify:lN,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})=>lN(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:bu}],GH={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},YH=[So,ko].concat(KH,GH),Yw={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),h=new Array(d);for(let m=0,g=0;m<d;++m,g+=u)h[m]=c.substr(g,u);c=h.join(t===Ae.BLOCK_LITERAL?`
|
|
597
|
+
`:" ")}return Uw({comment:e,type:t,value:c},r,s,o)}};function DI(e,t){if(jl(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ft(r)){if(El(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}
|
|
598
|
+
${s.key.commentBefore}`:r.commentBefore),r.comment){const o=s.value??s.key;o.comment=o.comment?`${r.comment}
|
|
599
|
+
${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 $I(e,t,n){const{replacer:r}=n,s=new Js(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(Ww(c,u,n))}return s}const Xw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:DI,createNode:$I};class no extends Js{constructor(){super(),this.add=bn.prototype.add.bind(this),this.delete=bn.prototype.delete.bind(this),this.get=bn.prototype.get.bind(this),this.has=bn.prototype.has.bind(this),this.set=bn.prototype.set.bind(this),this.tag=no.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=Sn(s.key,"",n),a=Sn(s.value,o,n)):o=Sn(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=$I(t,n,r),o=new this;return o.items=s.items,o}}no.tag="tag:yaml.org,2002:omap";const Qw={collection:"seq",identify:e=>e instanceof Map,nodeClass:no,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=DI(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 no,n)},createNode:(e,t,n)=>no.from(e,t,n)};function qI({value:e,source:t},n){return t&&(e?FI:BI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const FI={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:qI},BI={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:qI},XH={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},QH={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)}},JH={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},Tl=e=>typeof e=="bigint"||Number.isInteger(e);function zd(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 Jw(e,t,n){const{value:r}=e;if(Tl(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Kn(e)}const ZH={identify:Tl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>zd(e,2,2,n),stringify:e=>Jw(e,2,"0b")},eU={identify:Tl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>zd(e,1,8,n),stringify:e=>Jw(e,8,"0")},tU={identify:Tl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>zd(e,0,10,n),stringify:Kn},nU={identify:Tl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>zd(e,2,16,n),stringify:e=>Jw(e,16,"0x")};class ro extends bn{constructor(t){super(t),this.tag=ro.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),Hs(this.items,n.key)||this.items.push(n)}get(t,n){const r=Hs(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=Hs(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(Ww(a,null,r));return o}}ro.tag="tag:yaml.org,2002:set";const Zw={collection:"map",identify:e=>e instanceof Set,nodeClass:ro,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ro.from(e,t,n),resolve(e,t){if(El(e)){if(e.hasAllNullValues(!0))return Object.assign(new ro,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function eb(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 zI(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 VI={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})=>eb(e,n),stringify:zI},HI={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=>eb(e,!1),stringify:zI},Vd={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(Vd.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 h=t[8];if(h&&h!=="Z"){let m=eb(h,!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$/,""))??""},cN=[So,ko,qd,Fd,FI,BI,ZH,eU,tU,nU,XH,QH,JH,Yw,Rr,Qw,Xw,Zw,VI,HI,Vd],uN=new Map([["core",WH],["failsafe",[So,ko,qd]],["json",YH],["yaml11",cN],["yaml-1.1",cN]]),dN={binary:Yw,bool:Kw,float:MI,floatExp:RI,floatNaN:AI,floatTime:HI,int:PI,intHex:LI,intOct:OI,intTime:VI,map:So,merge:Rr,null:Fd,omap:Qw,pairs:Xw,seq:ko,set:Zw,timestamp:Vd},rU={"tag:yaml.org,2002:binary":Yw,"tag:yaml.org,2002:merge":Rr,"tag:yaml.org,2002:omap":Qw,"tag:yaml.org,2002:pairs":Xw,"tag:yaml.org,2002:set":Zw,"tag:yaml.org,2002:timestamp":Vd};function Fp(e,t,n){const r=uN.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(uN.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"?dN[a]:a;if(!c){const u=JSON.stringify(a),d=Object.keys(dN).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return o.includes(c)||o.push(c),o},[])}const sU=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class tb{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:o,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?Fp(t,"compat"):t?Fp(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=s?rU:{},this.tags=Fp(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,ms,{value:So}),Object.defineProperty(this,dr,{value:qd}),Object.defineProperty(this,bo,{value:ko}),this.sortMapEntries=typeof a=="function"?a:a===!0?sU:null}clone(){const t=Object.create(tb.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function iU(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=NI(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(ut(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 h=po(e.contents,s,()=>c=null,d);c&&(h+=Vs(h,"",o(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(po(e.contents,s));if((u=e.directives)!=null&&u.docEnd)if(e.comment){const d=o(e.comment);d.includes(`
|
|
600
|
+
`)?(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(`
|
|
601
|
+
`)+`
|
|
602
|
+
`}class Al{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Nn,{value:Fx});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(Al.prototype,{[Nn]:{value:Fx}});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=ut(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){zi(this.contents)&&this.contents.add(t)}addIn(t,n){zi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=wI(this);t.anchor=!n||r.has(n)?bI(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:h}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:v}=IH(this,a||"a"),b={aliasDuplicateObjects:o??!0,keepUndefined:u??!1,onAnchor:m,onTagObj:d,replacer:s,schema:this.schema,sourceObjects:v},x=al(t,h,b);return c&&ct(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 zi(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ra(t)?this.contents==null?!1:(this.contents=null,!0):zi(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ct(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ra(t)?!n&&He(this.contents)?this.contents.value:this.contents:ct(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ct(this.contents)?this.contents.has(t):!1}hasIn(t){return Ra(t)?this.contents!==void 0:ct(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=od(this.schema,[t],n):zi(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ra(t)?this.contents=n:this.contents==null?this.contents=od(this.schema,Array.from(t),n):zi(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 tb(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=Sn(this.contents,n??"",c);if(typeof o=="function")for(const{count:d,res:h}of c.anchors.values())o(h,d);return typeof a=="function"?Xi(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 iU(this,t)}}function zi(e){if(ct(e))return!0;throw new Error("Expected a YAML collection as document contents")}class UI extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Ma extends UI{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class oU extends UI{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const fN=(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)+`…
|
|
603
|
+
`),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+=`:
|
|
604
|
+
|
|
605
|
+
${a}
|
|
606
|
+
${d}
|
|
607
|
+
`}};function mo(e,{flow:t,indicator:n,next:r,offset:s,onError:o,parentIndent:a,startOnNewline:c}){let u=!1,d=c,h=c,m="",g="",v=!1,b=!1,x=null,w=null,S=null,C=null,k=null,N=null,T=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),h=!0;break;case"comment":{h||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),h=!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,T??(T=O.offset),d=!1,h=!1,b=!0;break;case"tag":{S&&o(O,"MULTIPLE_TAGS","A node can have at most one tag"),S=O,T??(T=O.offset),d=!1,h=!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",h=!1;break;case"comma":if(t){k&&o(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=O,d=!1,h=!1;break}default:o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),d=!1,h=!1}const R=e[e.length-1],A=R?R.offset+R.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:A,start:T??A}}function ll(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
608
|
+
`))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(ll(t.key)||ll(t.value))return!0}return!1;default:return!0}}function Hx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&ll(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function WI(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 hN="All mapping items must start at the same column";function aU({composeNode:e,composeEmptyNode:t},n,r,s,o){var h;const a=(o==null?void 0:o.nodeClass)??bn,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=mo(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",hN)),!w.anchor&&!w.tag&&!b){d=w.end,w.comment&&(c.comment?c.comment+=`
|
|
609
|
+
`+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||ll(v))&&s(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((h=w.found)==null?void 0:h.indent)!==r.indent&&s(u,"BAD_INDENT",hN);n.atKey=!0;const C=w.end,k=v?e(n,v,w,s):t(n,C,g,null,w,s);n.schema.compat&&Hx(r.indent,v,s),n.atKey=!1,WI(n,c.items,k)&&s(C,"DUPLICATE_KEY","Map keys must be unique");const N=mo(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 T=x?e(n,x,N,s):t(n,u,b,null,N,s);n.schema.compat&&Hx(r.indent,x,s),u=T.range[2];const R=new Ft(k,T);n.options.keepSourceTokens&&(R.srcToken=m),c.items.push(R)}else{S&&s(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(k.comment?k.comment+=`
|
|
610
|
+
`+N.comment:k.comment=N.comment);const T=new Ft(k);n.options.keepSourceTokens&&(T.srcToken=m),c.items.push(T)}}return d&&d<u&&s(d,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,u,d??u],c}function lU({composeNode:e,composeEmptyNode:t},n,r,s,o){const a=(o==null?void 0:o.nodeClass)??Js,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset,d=null;for(const{start:h,value:m}of r.items){const g=mo(h,{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,h,null,g,s);n.schema.compat&&Hx(r.indent,m,s),u=v.range[2],c.items.push(v)}return c.range=[r.offset,u,d??u],c}function Rl(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 h=u.substring(1)||" ";s?s+=a+h:s=h,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 Bp="Block collections are not allowed within flow collections",zp=e=>e&&(e.type==="block-map"||e.type==="block-seq");function cU({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?bn:Js),d=new u(n.schema);d.flow=!0;const h=n.atRoot;h&&(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:T,value:R}=C,A=mo(k,{flow:c,indicator:"explicit-key-ind",next:N??(T==null?void 0:T[0]),offset:m,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!T&&!R){S===0&&A.comma?s(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):S<r.items.length-1&&s(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),A.comment&&(d.comment?d.comment+=`
|
|
611
|
+
`+A.comment:d.comment=A.comment),m=A.end;continue}!a&&n.options.strict&&ll(N)&&s(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)A.comma&&s(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(A.comma||s(A.start,"MISSING_CHAR",`Missing , between ${c} items`),A.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+=`
|
|
612
|
+
`+O:L.comment=O,A.comment=A.comment.substring(O.length+1)}}if(!a&&!T&&!A.found){const O=R?e(n,R,A,s):t(n,A.end,T,null,A,s);d.items.push(O),m=O.range[2],zp(R)&&s(O.range,"BLOCK_IN_FLOW",Bp)}else{n.atKey=!0;const O=A.end,L=N?e(n,N,A,s):t(n,O,k,null,A,s);zp(N)&&s(L.range,"BLOCK_IN_FLOW",Bp),n.atKey=!1;const B=mo(T??[],{flow:c,indicator:"map-value-ind",next:R,offset:L.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(B.found){if(!a&&!A.found&&n.options.strict){if(T)for(const H of T){if(H===B.found)break;if(H.type==="newline"){s(H,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.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 R&&("source"in R&&((w=R.source)==null?void 0:w[0])===":"?s(R,"MISSING_CHAR",`Missing space after : in ${c}`):s(B.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const I=R?e(n,R,B,s):B.found?t(n,B.end,T,null,B,s):null;I?zp(R)&&s(I.range,"BLOCK_IN_FLOW",Bp):B.comment&&(L.comment?L.comment+=`
|
|
613
|
+
`+B.comment:L.comment=B.comment);const $=new Ft(L,I);if(n.options.keepSourceTokens&&($.srcToken=C),a){const H=d;WI(n,H.items,L)&&s(O,"DUPLICATE_KEY","Map keys must be unique"),H.items.push($)}else{const H=new bn(n.schema);H.flow=!0,H.items.push($);const D=(I??L).range;H.range=[L.range[0],D[1],D[2]],d.items.push(H)}m=I?I.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=h?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;s(m,h?"MISSING_CHAR":"BAD_INDENT",C),v&&v.source.length!==1&&b.unshift(v)}if(b.length>0){const S=Rl(b,x,n.options.strict,s);S.comment&&(d.comment?d.comment+=`
|
|
614
|
+
`+S.comment:d.comment=S.comment),d.range=[r.offset,x,S.offset]}else d.range=[r.offset,x,x];return d}function Vp(e,t,n,r,s,o){const a=n.type==="block-map"?aU(e,t,n,r,o):n.type==="block-seq"?lU(e,t,n,r,o):cU(e,t,n,r,o),c=a.constructor;return s==="!"||s===c.tagName?(a.tag=c.tagName,a):(s&&(a.tag=s),a)}function uU(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===bn.tagName&&c==="map"||a===Js.tagName&&c==="seq")return Vp(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),Vp(e,t,n,s,a)}const d=Vp(e,t,n,s,a,u),h=((g=u.resolve)==null?void 0:g.call(u,d,v=>s(o,"TAG_RESOLVE_FAILED",v),t.options))??d,m=ut(h)?h:new Ae(h);return m.range=d.range,m.tag=a,u!=null&&u.format&&(m.format=u.format),m}function dU(e,t,n){const r=t.offset,s=fU(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?hU(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?`
|
|
615
|
+
`.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,h=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),h=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<h;++x)m+=a[x][0].slice(u)+`
|
|
616
|
+
`;for(let x=h;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=`
|
|
617
|
+
`):w.length>u||S[0]===" "?(g===" "?g=`
|
|
618
|
+
`:!v&&g===`
|
|
619
|
+
`&&(g=`
|
|
620
|
+
|
|
621
|
+
`),m+=g+w.slice(u)+S,g=`
|
|
622
|
+
`,v=!0):S===""?g===`
|
|
623
|
+
`?m+=`
|
|
624
|
+
`:g=`
|
|
625
|
+
`:(m+=g+S,g=" ",v=!1)}switch(s.chomp){case"-":break;case"+":for(let x=c;x<a.length;++x)m+=`
|
|
626
|
+
`+a[x][0].slice(u);m[m.length-1]!==`
|
|
627
|
+
`&&(m+=`
|
|
628
|
+
`);break;default:m+=`
|
|
629
|
+
`}const b=r+s.length+t.source.length;return{value:m,type:o,comment:s.comment,range:[r,b,b]}}function fU({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,h="",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,h=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:h,length:m}}function hU(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 pU(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=mU(o,d);break;case"single-quoted-scalar":c=Ae.QUOTE_SINGLE,u=gU(o,d);break;case"double-quoted-scalar":c=Ae.QUOTE_DOUBLE,u=yU(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 h=r+o.length,m=Rl(a,h,t,n);return{value:u,type:c,comment:m.comment,range:[r,h,m.offset]}}function mU(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}`),KI(e)}function gU(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),KI(e.slice(1,-1)).replace(/''/g,"'")}function KI(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
630
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
631
|
+
`,"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===`
|
|
632
|
+
`?s+=o:o=`
|
|
633
|
+
`:(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 yU(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
|
|
634
|
+
`))if(s===`
|
|
635
|
+
`){const{fold:o,offset:a}=vU(e,r);n+=o,r=a}else if(s==="\\"){let o=e[++r];const a=xU[o];if(a)n+=a;else if(o===`
|
|
636
|
+
`)for(o=e[r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="\r"&&e[r+1]===`
|
|
637
|
+
`)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+=wU(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!==`
|
|
638
|
+
`&&!(a==="\r"&&e[r+2]===`
|
|
639
|
+
`)&&(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 vU(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
640
|
+
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
641
|
+
`);)r===`
|
|
642
|
+
`&&(n+=`
|
|
643
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const xU={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
644
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function wU(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 GI(e,t,n,r){const{value:s,type:o,comment:a,range:c}=t.type==="block-scalar"?dU(e,t,r):pU(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=bU(e.schema,s,u,n,r):t.type==="scalar"?d=_U(e,s,t,r):d=e.schema[dr];let h;try{const m=d.resolve(s,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);h=He(m)?m:new Ae(m)}catch(m){const g=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",g),h=new Ae(s)}return h.range=c,h.source=s,o&&(h.type=o),u&&(h.tag=u),d.format&&(h.format=d.format),a&&(h.comment=a),h}function bU(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 _U({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),h=`Value may be parsed as either ${u} or ${d}`;o(s,"TAG_RESOLVE_FAILED",h,!0)}}return a}function SU(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 kU={composeNode:YI,composeEmptyNode:nb};function YI(e,t,n,r){const s=e.atKey,{spaceBefore:o,comment:a,anchor:c,tag:u}=n;let d,h=!0;switch(t.type){case"alias":d=NU(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=GI(e,t,u,r),c&&(d.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":d=uU(kU,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=nb(e,t.offset,void 0,null,n,r),h=!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&&h&&(d.srcToken=t),d}function nb(e,t,n,r,{spaceBefore:s,comment:o,anchor:a,tag:c,end:u},d){const h={type:"scalar",offset:SU(t,n,r),indent:-1,source:""},m=GI(e,h,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 NU({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=Rl(r,a,e.strict,s);return o.range=[t,a,c.offset],c.comment&&(o.comment=c.comment),o}function CU(e,t,{offset:n,start:r,value:s,end:o},a){const c=Object.assign({_directives:t},e),u=new Al(void 0,c),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},h=mo(r,{indicator:"doc-start",next:s??(o==null?void 0:o[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});h.found&&(u.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!h.hasNewline&&a(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=s?YI(d,s,h,a):nb(d,h.end,r,null,h,a);const m=u.contents.range[2],g=Rl(o,m,!1,a);return g.comment&&(u.comment=g.comment),u.range=[n,m,g.offset],u}function Ca(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 pN(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?`
|
|
645
|
+
|
|
646
|
+
`:`
|
|
647
|
+
`)+(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 EU{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,o)=>{const a=Ca(n);o?this.warnings.push(new oU(a,r,s)):this.errors.push(new Ma(a,r,s))},this.directives=new qt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=pN(this.prelude);if(r){const o=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
648
|
+
${r}`:r;else if(s||t.directives.docStart||!o)t.commentBefore=r;else if(ct(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}
|
|
649
|
+
${c}`:r}else{const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
650
|
+
${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:pN(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=Ca(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=CU(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 Ma(Ca(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 Ma(Ca(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Rl(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}
|
|
651
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ma(Ca(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 Al(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 XI="\uFEFF",QI="",JI="",Ux="";function jU(e){switch(e){case XI:return"byte-order-mark";case QI:return"doc-mode";case JI:return"flow-error-end";case Ux:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
652
|
+
`:case`\r
|
|
653
|
+
`: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`
|
|
654
|
+
`:case"\r":case" ":return!0;default:return!1}}const mN=new Set("0123456789ABCDEFabcdef"),TU=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_u=new Set(",[]{}"),AU=new Set(` ,[]{}
|
|
655
|
+
\r `),Hp=e=>!e||AU.has(e);class RU{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===`
|
|
656
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
657
|
+
`:!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===`
|
|
658
|
+
`||!s&&!this.atEnd)return t+r+1}return n===`
|
|
659
|
+
`||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(`
|
|
660
|
+
`,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]===XI&&(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 QI,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(Hp),"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 JI,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(Hp),"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(`
|
|
661
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){const o=this.continueScalar(s+1);if(o===-1)break;s=r.indexOf(`
|
|
662
|
+
`,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`
|
|
663
|
+
`:t=o,n=0;break;case"\r":{const a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
664
|
+
`)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(`
|
|
665
|
+
`,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===`
|
|
666
|
+
`;)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===`
|
|
667
|
+
`&&o>=this.pos&&o+1+n>c)t=o;else break}while(!0);return yield Ux,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&&_u.has(o))break;n=r}else if(On(s)){let o=this.buffer[r+1];if(s==="\r"&&(o===`
|
|
668
|
+
`?(r+=1,s=`
|
|
669
|
+
`,o=this.buffer[r+1]):n=r),o==="#"||t&&_u.has(o))break;if(s===`
|
|
670
|
+
`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&_u.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Ux,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(Hp))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(On(n)||t&&_u.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(TU.has(n))n=this.buffer[++t];else if(n==="%"&&mN.has(this.buffer[t+1])&&mN.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===`
|
|
671
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
672
|
+
`?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 MU{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 fs(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function gN(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 ZI(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 Su(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 Vi(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 yN(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!fs(t.start,"explicit-key-ind")&&!fs(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,ZI(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 IU{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 RU,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=jU(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"&&yN(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&&gN(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":{gN(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=Su(this.peek(2)),r=Vi(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(`
|
|
673
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
674
|
+
`,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(fs(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(ZI(n.key)&&!fs(n.sep,"newline")){const c=Vi(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(fs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Vi(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]}):fs(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&&!fs(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||fs(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=Su(r),o=Vi(s);yN(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(`
|
|
675
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
676
|
+
`,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=Su(t),r=Vi(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=Su(t),r=Vi(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 OU(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new MU||null,prettyErrors:t}}function PU(e,t={}){const{lineCounter:n,prettyErrors:r}=OU(t),s=new IU(n==null?void 0:n.addNewLine),o=new EU(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 Ma(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(fN(e,n)),a.warnings.forEach(fN(e,n))),a}function LU(e,t,n){let r;const s=PU(e,n);if(!s)return null;if(s.warnings.forEach(o=>CI(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 ld(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 Cl(e)&&!r?e.toString(n):new Al(e,r,n).toString(n)}function DU({value:e,onChange:t}){const[n,r]=j.useState(""),[s,o]=j.useState(null),[a,c]=j.useState(!0);j.useEffect(()=>{try{const d=ld(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 h=LU(d);if(!h.id)throw new Error("Step ID is required");if(!h.action&&!h.workflow)throw new Error("Either action or workflow is required");o(null),c(!0),t(h)}catch(h){o(h instanceof Error?h.message:"Invalid YAML"),c(!1)}}};return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{className:"flex items-center gap-2",children:a?p.jsxs("span",{className:"flex items-center gap-1 text-xs text-success",children:[p.jsx(nl,{className:"w-3 h-3"}),"Valid YAML"]}):p.jsxs("span",{className:"flex items-center gap-1 text-xs text-error",children:[p.jsx(kw,{className:"w-3 h-3"}),s]})}),p.jsxs("span",{className:"text-xs text-gray-500",children:[n.split(`
|
|
677
|
+
`).length," lines"]})]}),p.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:p.jsx(Va,{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}}})}),p.jsx("div",{className:"text-xs text-gray-500",children:p.jsx("p",{children:"Edit the step configuration directly in YAML format. Changes are applied automatically when valid."})})]})}function $U({value:e,title:t}){const[n,r]=j.useState("");return j.useEffect(()=>{try{const s=ld(e,{indent:2,lineWidth:0});r(s)}catch{r("# Failed to serialize value")}},[e]),p.jsxs("div",{className:"space-y-2",children:[t&&p.jsx("h4",{className:"text-sm font-medium text-gray-300",children:t}),p.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:p.jsx(Va,{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 qU({inputs:e,onChange:t,availableVariables:n}){const[r,s]=j.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)}},h=(m,g)=>{const v=String(e[m]||"");a(m,v+`{{ ${g} }}`)};return p.jsxs("div",{className:"space-y-4",children:[o.length===0?p.jsx("div",{className:"text-center py-8",children:p.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No inputs defined"})}):p.jsx("div",{className:"space-y-3",children:o.map(([m,g])=>p.jsx(FU,{inputKey:m,value:g,onChange:v=>a(m,v),onRemove:()=>c(m),onRename:v=>d(m,v),availableVariables:n,onInsertVariable:v=>h(m,v)},m))}),p.jsxs("div",{className:"flex gap-2 pt-2 border-t border-node-border",children:[p.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()}}),p.jsx(Ye,{variant:"secondary",size:"sm",onClick:u,disabled:!r||e.hasOwnProperty(r),icon:p.jsx(jd,{className:"w-4 h-4"}),children:"Add"})]}),n.length>0&&p.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx(Td,{className:"w-4 h-4 text-primary"}),p.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Available Variables"})]}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(m=>p.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded",children:m},m))}),p.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Click on an input field, then use the variable button to insert"})]})]})}function FU({inputKey:e,value:t,onChange:n,onRemove:r,onRename:s,availableVariables:o,onInsertVariable:a}){const[c,u]=j.useState(!1),[d,h]=j.useState(e),[m,g]=j.useState(!1),v=typeof t,b=v==="object"&&t!==null,x=Array.isArray(t),w=()=>{d!==e&&s(d),u(!1)},S=()=>x||b?p.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"?p.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:[p.jsx("option",{value:"true",children:"true"}),p.jsx("option",{value:"false",children:"false"})]}):v==="number"?p.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"}):p.jsx(BU,{value:String(t),onChange:C=>n(C),variables:o,placeholder:"Value or {{ variable }}"});return p.jsxs("div",{className:"p-3 bg-node-bg/50 rounded-lg border border-node-border space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[c?p.jsx("input",{type:"text",value:d,onChange:C=>h(C.target.value),onBlur:w,onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&(h(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}):p.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}),p.jsx("span",{className:"text-xs text-gray-500",children:v}),p.jsx(Ye,{variant:"ghost",size:"sm",onClick:r,className:"!p-1 text-gray-400 hover:text-error",children:p.jsx(xo,{className:"w-4 h-4"})})]}),p.jsxs("div",{className:"flex gap-2",children:[S(),o.length>0&&!x&&!b&&p.jsxs("div",{className:"relative",children:[p.jsx(Ye,{variant:"ghost",size:"sm",onClick:()=>g(!m),className:"!p-2",children:p.jsx(Td,{className:"w-4 h-4"})}),m&&p.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:[p.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Insert variable"}),p.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:o.map(C=>p.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 BU({value:e,onChange:t,variables:n,placeholder:r}){const[s,o]=j.useState(!1),[a,c]=j.useState(0),[u,d]=j.useState(0),h=j.useRef(null),g=(()=>{const k=e.substring(0,a),N=k.lastIndexOf("{{");if(N===-1)return null;const T=k.substring(N);return T.includes("}}")?null:{text:T.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),T=e.substring(g.end),R=`${N}{{ ${k} }}${T}`;t(R),o(!1),setTimeout(()=>{if(h.current){const A=g.start+k.length+6;h.current.setSelectionRange(A,A),h.current.focus()}},0)};return j.useEffect(()=>{const k=()=>o(!1);return document.addEventListener("click",k),()=>document.removeEventListener("click",k)},[]),p.jsxs("div",{className:"relative flex-1",children:[p.jsx("input",{ref:h,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&&p.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:[p.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)=>p.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:[p.jsx(Td,{className:"w-3 h-3"}),k]},k)),p.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 vN(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 zU(e,t){const n=e.find(r=>r.field===t);return n==null?void 0:n.message}function VU({open:e,onOpenChange:t,step:n,onSave:r,availableVariables:s}){const[o,a]=j.useState(null),[c,u]=j.useState("properties"),[d,h]=j.useState([]),[m,g]=j.useState(!1);if(j.useEffect(()=>{n&&(a({...n}),u("properties"),h([]),g(!1))},[n]),j.useMemo(()=>o?vN(o):{valid:!0,errors:[]},[o]),!o)return null;const v=()=>{if(!o)return;const w=vN(o);if(h(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 zU(d,w)};return p.jsxs(Sl,{open:e,onOpenChange:t,title:`Edit Step: ${o.name||o.id}`,description:o.action||o.workflow||"Configure step settings",size:"xl",children:[p.jsxs(lI,{value:c,onValueChange:u,children:[p.jsxs(Bw,{children:[p.jsxs(nr,{value:"properties",children:[p.jsx(Ew,{className:"w-4 h-4 mr-1.5"}),"Properties"]}),p.jsxs(nr,{value:"inputs",children:[p.jsx(Fz,{className:"w-4 h-4 mr-1.5"}),"Inputs"]}),p.jsxs(nr,{value:"output",children:[p.jsx(Bz,{className:"w-4 h-4 mr-1.5"}),"Output"]}),p.jsxs(nr,{value:"errors",children:[p.jsx(iM,{className:"w-4 h-4 mr-1.5"}),"Errors"]}),p.jsxs(nr,{value:"conditions",children:[p.jsx(ZR,{className:"w-4 h-4 mr-1.5"}),"Conditions"]}),p.jsxs(nr,{value:"yaml",children:[p.jsx(Nw,{className:"w-4 h-4 mr-1.5"}),"YAML"]})]}),p.jsxs("div",{className:"p-4",children:[p.jsx(rr,{value:"properties",children:p.jsx(HU,{step:o,onChange:b,getError:x})}),p.jsx(rr,{value:"inputs",children:p.jsx(qU,{inputs:o.inputs,onChange:w=>b({inputs:w}),availableVariables:s})}),p.jsx(rr,{value:"output",children:p.jsx(UU,{step:o,onChange:b})}),p.jsx(rr,{value:"errors",children:p.jsx(WU,{step:o,onChange:b})}),p.jsx(rr,{value:"conditions",children:p.jsx(KU,{step:o,onChange:b,availableVariables:s})}),p.jsx(rr,{value:"yaml",children:p.jsx(DU,{value:o,onChange:w=>a(w)})})]})]}),p.jsxs(Md,{children:[m&&d.length>0&&p.jsxs("div",{className:"flex-1 flex items-center gap-2 text-error text-sm",children:[p.jsx(kw,{className:"w-4 h-4 flex-shrink-0"}),p.jsxs("span",{children:[d.length," validation error",d.length>1?"s":""]})]}),p.jsx(Ye,{variant:"secondary",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ye,{onClick:v,children:"Save Changes"})]})]})}function HU({step:e,onChange:t,getError:n}){const r=n("id"),s=n("action"),o=n("workflow"),a=n("timeout");return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Step ID ",p.jsx("span",{className:"text-error",children:"*"})]}),p.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?p.jsx("p",{className:"mt-1 text-xs text-error",children:r}):p.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Unique identifier for this step"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name"}),p.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"})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Action ",!e.workflow&&p.jsx("span",{className:"text-error",children:"*"})]}),p.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?p.jsx("p",{className:"mt-1 text-xs text-error",children:s}):p.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Format: service.method or service.namespace.method"})]}),e.workflow&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Sub-workflow Path"}),p.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&&p.jsx("p",{className:"mt-1 text-xs text-error",children:o})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Timeout (seconds)"}),p.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&&p.jsx("p",{className:"mt-1 text-xs text-error",children:a})]})]})}function UU({step:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Output Variable"}),p.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"}),p.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Store the step output in this variable for use in subsequent steps"})]}),p.jsxs("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:[p.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Usage Example"}),p.jsx("code",{className:"text-xs text-primary font-mono",children:"{{ "+(e.outputVariable||"variable_name")+" }}"}),p.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use this syntax in subsequent steps to reference the output"})]})]})}function WU({step:e,onChange:t}){const n=e.errorHandling||{action:"stop"},r=s=>{t({errorHandling:{...n,...s}})};return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Error Action"}),p.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:[p.jsx("option",{value:"stop",children:"Stop workflow on error"}),p.jsx("option",{value:"continue",children:"Continue to next step"}),p.jsx("option",{value:"retry",children:"Retry with backoff"})]})]}),n.action==="retry"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Max Retries"}),p.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"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Retry Delay (ms)"}),p.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"})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Fallback Step (optional)"}),p.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"}),p.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Jump to this step if the error action fails"})]})]})}function KU({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,h)=>h!==c);t({conditions:u.length>0?u:void 0})};return p.jsxs("div",{className:"space-y-4",children:[p.jsx("p",{className:"text-sm text-gray-400",children:"This step will only execute if all conditions evaluate to true."}),r.length===0?p.jsxs("div",{className:"text-center py-8",children:[p.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No conditions defined"}),p.jsx(Ye,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}):p.jsxs("div",{className:"space-y-3",children:[r.map((c,u)=>p.jsxs("div",{className:"flex gap-2",children:[p.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'"}),p.jsx(Ye,{variant:"ghost",size:"sm",onClick:()=>a(u),children:"×"})]},u)),p.jsx(Ye,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}),n.length>0&&p.jsxs("div",{className:"mt-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[p.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:"Available Variables"}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(c=>p.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 GU=["top","right","bottom","left"],xs=Math.min,an=Math.max,cd=Math.round,ku=Math.floor,ar=e=>({x:e,y:e}),YU={left:"right",right:"left",bottom:"top",top:"bottom"},XU={start:"end",end:"start"};function Wx(e,t,n){return an(e,xs(t,n))}function Ir(e,t){return typeof e=="function"?e(t):e}function Or(e){return e.split("-")[0]}function No(e){return e.split("-")[1]}function rb(e){return e==="x"?"y":"x"}function sb(e){return e==="y"?"height":"width"}const QU=new Set(["top","bottom"]);function ir(e){return QU.has(Or(e))?"y":"x"}function ib(e){return rb(ir(e))}function JU(e,t,n){n===void 0&&(n=!1);const r=No(e),s=ib(e),o=sb(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=ud(a)),[a,ud(a)]}function ZU(e){const t=ud(e);return[Kx(e),t,Kx(t)]}function Kx(e){return e.replace(/start|end/g,t=>XU[t])}const xN=["left","right"],wN=["right","left"],e7=["top","bottom"],t7=["bottom","top"];function n7(e,t,n){switch(e){case"top":case"bottom":return n?t?wN:xN:t?xN:wN;case"left":case"right":return t?e7:t7;default:return[]}}function r7(e,t,n,r){const s=No(e);let o=n7(Or(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Kx)))),o}function ud(e){return e.replace(/left|right|bottom|top/g,t=>YU[t])}function s7(e){return{top:0,right:0,bottom:0,left:0,...e}}function eO(e){return typeof e!="number"?s7(e):{top:e,right:e,bottom:e,left:e}}function dd(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 bN(e,t,n){let{reference:r,floating:s}=e;const o=ir(t),a=ib(t),c=sb(a),u=Or(t),d=o==="y",h=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:h,y:r.y-s.height};break;case"bottom":v={x:h,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(No(t)){case"start":v[a]-=g*(n&&d?-1:1);break;case"end":v[a]+=g*(n&&d?-1:1);break}return v}const i7=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:h,y:m}=bN(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:T}=await S({x:h,y:m,initialPlacement:r,placement:g,strategy:s,middlewareData:v,rects:d,platform:a,elements:{reference:e,floating:t}});h=C??h,m=k??m,v={...v,[w]:{...v[w],...N}},T&&b<=50&&(b++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(d=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:h,y:m}=bN(d,g,u)),x=-1)}return{x:h,y:m,placement:g,strategy:s,middlewareData:v}};async function cl(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:h="viewport",elementContext:m="floating",altBoundary:g=!1,padding:v=0}=Ir(t,e),b=eO(v),w=c[g?m==="floating"?"reference":"floating":m],S=dd(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:h,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},T=dd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:k,strategy:u}):C);return{top:(S.top-T.top+b.top)/N.y,bottom:(T.bottom-S.bottom+b.bottom)/N.y,left:(S.left-T.left+b.left)/N.x,right:(T.right-S.right+b.right)/N.x}}const o7=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:h=0}=Ir(e,t)||{};if(d==null)return{};const m=eO(h),g={x:n,y:r},v=ib(s),b=sb(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],T=g[v]-o.reference[v],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let A=R?R[k]:0;(!A||!await(a.isElement==null?void 0:a.isElement(R)))&&(A=c.floating[k]||o.floating[b]);const O=N/2-T/2,L=A/2-x[b]/2-1,B=xs(m[S],L),I=xs(m[C],L),$=B,H=A-x[b]-I,D=A/2-x[b]/2+O,V=Wx($,D,H),z=!u.arrow&&No(s)!=null&&D!==V&&o.reference[b]/2-(D<$?B:I)-x[b]/2<0,Q=z?D<$?D-$:D-H:0;return{[v]:g[v]+Q,data:{[v]:V,centerOffset:D-V-Q,...z&&{alignmentOffset:Q}},reset:z}}}),a7=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:h=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=Ir(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Or(s),C=ir(c),k=Or(c)===c,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=g||(k||!x?[ud(c)]:ZU(c)),R=b!=="none";!g&&R&&T.push(...r7(c,x,b,N));const A=[c,...T],O=await cl(t,w),L=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&L.push(O[S]),m){const D=JU(s,a,N);L.push(O[D[0]],O[D[1]])}if(B=[...B,{placement:s,overflows:L}],!L.every(D=>D<=0)){var I,$;const D=(((I=o.flip)==null?void 0:I.index)||0)+1,V=A[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 H;const Q=(H=B.filter(F=>{if(R){const q=ir(F.placement);return q===C||q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(q=>q>0).reduce((q,Y)=>q+Y,0)]).sort((F,q)=>F[1]-q[1])[0])==null?void 0:H[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 SN(e){return GU.some(t=>e[t]>=0)}const l7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Ir(e,t);switch(r){case"referenceHidden":{const o=await cl(t,{...s,elementContext:"reference"}),a=_N(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:SN(a)}}}case"escaped":{const o=await cl(t,{...s,altBoundary:!0}),a=_N(o,n.floating);return{data:{escapedOffsets:a,escaped:SN(a)}}}default:return{}}}}},tO=new Set(["left","top"]);async function c7(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Or(n),c=No(n),u=ir(n)==="y",d=tO.has(a)?-1:1,h=o&&u?-1:1,m=Ir(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*h,y:g*d}:{x:g*d,y:v*h}}const u7=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 c7(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}}}}},d7=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}=Ir(e,t),d={x:n,y:r},h=await cl(t,u),m=ir(Or(s)),g=rb(m);let v=d[g],b=d[m];if(o){const w=g==="y"?"top":"left",S=g==="y"?"bottom":"right",C=v+h[w],k=v-h[S];v=Wx(C,v,k)}if(a){const w=m==="y"?"top":"left",S=m==="y"?"bottom":"right",C=b+h[w],k=b-h[S];b=Wx(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}}}}}},f7=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}=Ir(e,t),h={x:n,y:r},m=ir(s),g=rb(m);let v=h[g],b=h[m];const x=Ir(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,T=o.reference[g]+o.reference[k]-w.mainAxis;v<N?v=N:v>T&&(v=T)}if(d){var S,C;const k=g==="y"?"width":"height",N=tO.has(Or(s)),T=o.reference[m]-o.floating[k]+(N&&((S=a.offset)==null?void 0:S[m])||0)+(N?0:w.crossAxis),R=o.reference[m]+o.reference[k]+(N?0:((C=a.offset)==null?void 0:C[m])||0)-(N?w.crossAxis:0);b<T?b=T:b>R&&(b=R)}return{[g]:v,[m]:b}}}},h7=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}=Ir(e,t),h=await cl(t,d),m=Or(s),g=No(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-h.top-h.bottom,k=b-h.left-h.right,N=xs(x-h[w],C),T=xs(b-h[S],k),R=!t.middlewareData.shift;let A=N,O=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=C),R&&!g){const B=an(h.left,0),I=an(h.right,0),$=an(h.top,0),H=an(h.bottom,0);v?O=b-2*(B!==0||I!==0?B+I:an(h.left,h.right)):A=x-2*($!==0||H!==0?$+H:an(h.top,h.bottom))}await u({...t,availableWidth:O,availableHeight:A});const L=await a.getDimensions(c.floating);return b!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function Hd(){return typeof window<"u"}function Co(e){return nO(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mr(e){var t;return(t=(nO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nO(e){return Hd()?e instanceof Node||e instanceof cn(e).Node:!1}function Bn(e){return Hd()?e instanceof Element||e instanceof cn(e).Element:!1}function fr(e){return Hd()?e instanceof HTMLElement||e instanceof cn(e).HTMLElement:!1}function kN(e){return!Hd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot}const p7=new Set(["inline","contents"]);function Ml(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!p7.has(s)}const m7=new Set(["table","td","th"]);function g7(e){return m7.has(Co(e))}const y7=[":popover-open",":modal"];function Ud(e){return y7.some(t=>{try{return e.matches(t)}catch{return!1}})}const v7=["transform","translate","scale","rotate","perspective"],x7=["transform","translate","scale","rotate","perspective","filter"],w7=["paint","layout","strict","content"];function ob(e){const t=ab(),n=Bn(e)?zn(e):e;return v7.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)||x7.some(r=>(n.willChange||"").includes(r))||w7.some(r=>(n.contain||"").includes(r))}function b7(e){let t=ws(e);for(;fr(t)&&!go(t);){if(ob(t))return t;if(Ud(t))return null;t=ws(t)}return null}function ab(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _7=new Set(["html","body","#document"]);function go(e){return _7.has(Co(e))}function zn(e){return cn(e).getComputedStyle(e)}function Wd(e){return Bn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ws(e){if(Co(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kN(e)&&e.host||mr(e);return kN(t)?t.host:t}function rO(e){const t=ws(e);return go(t)?e.ownerDocument?e.ownerDocument.body:e.body:fr(t)&&Ml(t)?t:rO(t)}function ul(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=rO(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=cn(s);if(o){const c=Gx(a);return t.concat(a,a.visualViewport||[],Ml(s)?s:[],c&&n?ul(c):[])}return t.concat(s,ul(s,[],n))}function Gx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sO(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=cd(n)!==o||cd(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function lb(e){return Bn(e)?e:e.contextElement}function so(e){const t=lb(e);if(!fr(t))return ar(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=sO(t);let a=(o?cd(n.width):n.width)/r,c=(o?cd(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const S7=ar(0);function iO(e){const t=cn(e);return!ab()||!t.visualViewport?S7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function k7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cn(e)?!1:t}function Zs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=lb(e);let a=ar(1);t&&(r?Bn(r)&&(a=so(r)):a=so(e));const c=k7(o,n,r)?iO(o):ar(0);let u=(s.left+c.x)/a.x,d=(s.top+c.y)/a.y,h=s.width/a.x,m=s.height/a.y;if(o){const g=cn(o),v=r&&Bn(r)?cn(r):r;let b=g,x=Gx(b);for(;x&&r&&v!==b;){const w=so(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,h*=w.x,m*=w.y,u+=k,d+=N,b=cn(x),x=Gx(b)}}return dd({width:h,height:m,x:u,y:d})}function Kd(e,t){const n=Wd(e).scrollLeft;return t?t.left+n:Zs(mr(e)).left+n}function oO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Kd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function N7(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=mr(r),c=t?Ud(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},d=ar(1);const h=ar(0),m=fr(r);if((m||!m&&!o)&&((Co(r)!=="body"||Ml(a))&&(u=Wd(r)),fr(r))){const v=Zs(r);d=so(r),h.x=v.x+r.clientLeft,h.y=v.y+r.clientTop}const g=a&&!m&&!o?oO(a,u):ar(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function C7(e){return Array.from(e.getClientRects())}function E7(e){const t=mr(e),n=Wd(e),r=e.ownerDocument.body,s=an(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=an(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Kd(e);const c=-n.scrollTop;return zn(r).direction==="rtl"&&(a+=an(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}const NN=25;function j7(e,t){const n=cn(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 h=ab();(!h||h&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}const d=Kd(r);if(d<=0){const h=r.ownerDocument,m=h.body,g=getComputedStyle(m),v=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-m.clientWidth-v);b<=NN&&(o-=b)}else d<=NN&&(o+=d);return{width:o,height:a,x:c,y:u}}const T7=new Set(["absolute","fixed"]);function A7(e,t){const n=Zs(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=fr(e)?so(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 CN(e,t,n){let r;if(t==="viewport")r=j7(e,n);else if(t==="document")r=E7(mr(e));else if(Bn(t))r=A7(t,n);else{const s=iO(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return dd(r)}function aO(e,t){const n=ws(e);return n===t||!Bn(n)||go(n)?!1:zn(n).position==="fixed"||aO(n,t)}function R7(e,t){const n=t.get(e);if(n)return n;let r=ul(e,[],!1).filter(c=>Bn(c)&&Co(c)!=="body"),s=null;const o=zn(e).position==="fixed";let a=o?ws(e):e;for(;Bn(a)&&!go(a);){const c=zn(a),u=ob(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&T7.has(s.position)||Ml(a)&&!u&&aO(e,a))?r=r.filter(h=>h!==a):s=c,a=ws(a)}return t.set(e,r),r}function M7(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Ud(t)?[]:R7(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((d,h)=>{const m=CN(t,h,s);return d.top=an(m.top,d.top),d.right=xs(m.right,d.right),d.bottom=xs(m.bottom,d.bottom),d.left=an(m.left,d.left),d},CN(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function I7(e){const{width:t,height:n}=sO(e);return{width:t,height:n}}function O7(e,t,n){const r=fr(t),s=mr(t),o=n==="fixed",a=Zs(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=ar(0);function d(){u.x=Kd(s)}if(r||!r&&!o)if((Co(t)!=="body"||Ml(s))&&(c=Wd(t)),r){const v=Zs(t,!0,o,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else s&&d();o&&!r&&s&&d();const h=s&&!r&&!o?oO(s,c):ar(0),m=a.left+c.scrollLeft-u.x-h.x,g=a.top+c.scrollTop-u.y-h.y;return{x:m,y:g,width:a.width,height:a.height}}function Up(e){return zn(e).position==="static"}function EN(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 lO(e,t){const n=cn(e);if(Ud(e))return n;if(!fr(e)){let s=ws(e);for(;s&&!go(s);){if(Bn(s)&&!Up(s))return s;s=ws(s)}return n}let r=EN(e,t);for(;r&&g7(r)&&Up(r);)r=EN(r,t);return r&&go(r)&&Up(r)&&!ob(r)?n:r||b7(e)||n}const P7=async function(e){const t=this.getOffsetParent||lO,n=this.getDimensions,r=await n(e.floating);return{reference:O7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function L7(e){return zn(e).direction==="rtl"}const D7={convertOffsetParentRelativeRectToViewportRelativeRect:N7,getDocumentElement:mr,getClippingRect:M7,getOffsetParent:lO,getElementRects:P7,getClientRects:C7,getDimensions:I7,getScale:so,isElement:Bn,isRTL:L7};function cO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $7(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:h,top:m,width:g,height:v}=d;if(c||t(),!g||!v)return;const b=ku(m),x=ku(s.clientWidth-(h+g)),w=ku(s.clientHeight-(m+v)),S=ku(h),k={rootMargin:-b+"px "+-x+"px "+-w+"px "+-S+"px",threshold:an(0,xs(1,u))||1};let N=!0;function T(R){const A=R[0].intersectionRatio;if(A!==u){if(!N)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!cO(d,e.getBoundingClientRect())&&a(),N=!1}try{n=new IntersectionObserver(T,{...k,root:s.ownerDocument})}catch{n=new IntersectionObserver(T,k)}n.observe(e)}return a(!0),o}function q7(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=lb(e),h=s||o?[...d?ul(d):[],...ul(t)]:[];h.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const m=d&&c?$7(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?Zs(e):null;u&&w();function w(){const S=Zs(e);x&&!cO(x,S)&&n(),x=S,b=requestAnimationFrame(w)}return n(),()=>{var S;h.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 F7=u7,B7=d7,z7=a7,V7=h7,H7=l7,jN=o7,U7=f7,W7=(e,t,n)=>{const r=new Map,s={platform:D7,...n},o={...s.platform,_c:r};return i7(e,t,{...s,platform:o})};var K7=typeof document<"u",G7=function(){},Fu=K7?j.useLayoutEffect:G7;function fd(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(!fd(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)&&!fd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function uO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function TN(e,t){const n=uO(e);return Math.round(t*n)/n}function Wp(e){const t=j.useRef(e);return Fu(()=>{t.current=e}),t}function Y7(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,[h,m]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=j.useState(r);fd(g,r)||v(r);const[b,x]=j.useState(null),[w,S]=j.useState(null),C=j.useCallback(F=>{F!==R.current&&(R.current=F,x(F))},[]),k=j.useCallback(F=>{F!==A.current&&(A.current=F,S(F))},[]),N=o||b,T=a||w,R=j.useRef(null),A=j.useRef(null),O=j.useRef(h),L=u!=null,B=Wp(u),I=Wp(s),$=Wp(d),H=j.useCallback(()=>{if(!R.current||!A.current)return;const F={placement:t,strategy:n,middleware:g};I.current&&(F.platform=I.current),W7(R.current,A.current,F).then(q=>{const Y={...q,isPositioned:$.current!==!1};D.current&&!fd(O.current,Y)&&(O.current=Y,_w.flushSync(()=>{m(Y)}))})},[g,t,n,I,$]);Fu(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[d]);const D=j.useRef(!1);Fu(()=>(D.current=!0,()=>{D.current=!1}),[]),Fu(()=>{if(N&&(R.current=N),T&&(A.current=T),N&&T){if(B.current)return B.current(N,T,H);H()}},[N,T,H,B,L]);const V=j.useMemo(()=>({reference:R,floating:A,setReference:C,setFloating:k}),[C,k]),z=j.useMemo(()=>({reference:N,floating:T}),[N,T]),Q=j.useMemo(()=>{const F={position:n,left:0,top:0};if(!z.floating)return F;const q=TN(z.floating,h.x),Y=TN(z.floating,h.y);return c?{...F,transform:"translate("+q+"px, "+Y+"px)",...uO(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:Y}},[n,c,z.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:H,refs:V,elements:z,floatingStyles:Q}),[h,H,V,z,Q])}const X7=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?jN({element:r.current,padding:s}).fn(n):{}:r?jN({element:r,padding:s}).fn(n):{}}}},Q7=(e,t)=>({...F7(e),options:[e,t]}),J7=(e,t)=>({...B7(e),options:[e,t]}),Z7=(e,t)=>({...U7(e),options:[e,t]}),eW=(e,t)=>({...z7(e),options:[e,t]}),tW=(e,t)=>({...V7(e),options:[e,t]}),nW=(e,t)=>({...H7(e),options:[e,t]}),rW=(e,t)=>({...X7(e),options:[e,t]});var sW="Arrow",dO=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return p.jsx(Ze.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});dO.displayName=sW;var iW=dO;function oW(e){const[t,n]=j.useState(void 0);return vs(()=>{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 cb="Popper",[fO,hO]=ei(cb),[aW,pO]=fO(cb),mO=e=>{const{__scopePopper:t,children:n}=e,[r,s]=j.useState(null);return p.jsx(aW,{scope:t,anchor:r,onAnchorChange:s,children:n})};mO.displayName=cb;var gO="PopperAnchor",yO=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=pO(gO,n),a=j.useRef(null),c=Et(t,a),u=j.useRef(null);return j.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||a.current,d!==u.current&&o.onAnchorChange(u.current)}),r?null:p.jsx(Ze.div,{...s,ref:c})});yO.displayName=gO;var ub="PopperContent",[lW,cW]=fO(ub),vO=j.forwardRef((e,t)=>{var ee,te,oe,de,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:h=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...x}=e,w=pO(ub,n),[S,C]=j.useState(null),k=Et(t,he=>C(he)),[N,T]=j.useState(null),R=oW(N),A=(R==null?void 0:R.width)??0,O=(R==null?void 0:R.height)??0,L=r+(o!=="center"?"-"+o:""),B=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},I=Array.isArray(d)?d:[d],$=I.length>0,H={padding:B,boundary:I.filter(dW),altBoundary:$},{refs:D,floatingStyles:V,placement:z,isPositioned:Q,middlewareData:F}=Y7({strategy:"fixed",placement:L,whileElementsMounted:(...he)=>q7(...he,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[Q7({mainAxis:s+O,alignmentAxis:a}),u&&J7({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Z7():void 0,...H}),u&&eW({...H}),tW({...H,apply:({elements:he,rects:Se,availableWidth:xe,availableHeight:Ce})=>{const{width:Ne,height:tt}=Se.reference,Le=he.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&&rW({element:N,padding:c}),fW({arrowWidth:A,arrowHeight:O}),g&&nW({strategy:"referenceHidden",...H})]}),[q,Y]=bO(z),P=ur(b);vs(()=>{Q&&(P==null||P())},[Q,P]);const W=(ee=F.arrow)==null?void 0:ee.x,ie=(te=F.arrow)==null?void 0:te.y,K=((oe=F.arrow)==null?void 0:oe.centerOffset)!==0,[J,G]=j.useState();return vs(()=>{S&&G(window.getComputedStyle(S).zIndex)},[S]),p.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":[(de=F.transformOrigin)==null?void 0:de.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:p.jsx(lW,{scope:n,placedSide:q,onArrowChange:T,arrowX:W,arrowY:ie,shouldHideArrow:K,children:p.jsx(Ze.div,{"data-side":q,"data-align":Y,...x,ref:k,style:{...x.style,animation:Q?void 0:"none"}})})})});vO.displayName=ub;var xO="PopperArrow",uW={top:"bottom",right:"left",bottom:"top",left:"right"},wO=j.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=cW(xO,r),a=uW[o.placedSide];return p.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:p.jsx(iW,{...s,ref:n,style:{...s.style,display:"block"}})})});wO.displayName=xO;function dW(e){return e!==null}var fW=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,h]=bO(n),m={start:"0%",center:"50%",end:"100%"}[h],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 bO(e){const[t,n="center"]=e.split("-");return[t,n]}var hW=mO,pW=yO,mW=vO,gW=wO,Yx=["Enter"," "],yW=["ArrowDown","PageUp","Home"],_O=["ArrowUp","PageDown","End"],vW=[...yW,..._O],xW={ltr:[...Yx,"ArrowRight"],rtl:[...Yx,"ArrowLeft"]},wW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Il="Menu",[dl,bW,_W]=BM(Il),[ni,SO]=ei(Il,[_W,hO,Id]),Gd=hO(),kO=Id(),[SW,ri]=ni(Il),[kW,Ol]=ni(Il),NO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=Gd(t),[u,d]=j.useState(null),h=j.useRef(!1),m=ur(o),g=qw(s);return j.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.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})}},[]),p.jsx(hW,{...c,children:p.jsx(SW,{scope:t,open:n,onOpenChange:m,content:u,onContentChange:d,children:p.jsx(kW,{scope:t,onClose:j.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:g,modal:a,children:r})})})};NO.displayName=Il;var NW="MenuAnchor",db=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Gd(n);return p.jsx(pW,{...s,...r,ref:t})});db.displayName=NW;var fb="MenuPortal",[CW,CO]=ni(fb,{forceMount:void 0}),EO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ri(fb,t);return p.jsx(CW,{scope:t,forceMount:n,children:p.jsx(Lr,{present:n||o.open,children:p.jsx(Iw,{asChild:!0,container:s,children:r})})})};EO.displayName=fb;var kn="MenuContent",[EW,hb]=ni(kn),jO=j.forwardRef((e,t)=>{const n=CO(kn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ri(kn,e.__scopeMenu),a=Ol(kn,e.__scopeMenu);return p.jsx(dl.Provider,{scope:e.__scopeMenu,children:p.jsx(Lr,{present:r||o.open,children:p.jsx(dl.Slot,{scope:e.__scopeMenu,children:a.modal?p.jsx(jW,{...s,ref:t}):p.jsx(TW,{...s,ref:t})})})})}),jW=j.forwardRef((e,t)=>{const n=ri(kn,e.__scopeMenu),r=j.useRef(null),s=Et(t,r);return j.useEffect(()=>{const o=r.current;if(o)return xM(o)},[]),p.jsx(pb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),TW=j.forwardRef((e,t)=>{const n=ri(kn,e.__scopeMenu);return p.jsx(pb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),AW=il("MenuContent.ScrollLock"),pb=j.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...x}=e,w=ri(kn,n),S=Ol(kn,n),C=Gd(n),k=kO(n),N=bW(n),[T,R]=j.useState(null),A=j.useRef(null),O=Et(t,A,w.onContentChange),L=j.useRef(0),B=j.useRef(""),I=j.useRef(0),$=j.useRef(null),H=j.useRef("right"),D=j.useRef(0),V=b?Ow:j.Fragment,z=b?{as:AW,allowPinchZoom:!0}:void 0,Q=q=>{var ee,te;const Y=B.current+q,P=N().filter(oe=>!oe.disabled),W=document.activeElement,ie=(ee=P.find(oe=>oe.ref.current===W))==null?void 0:ee.textValue,K=P.map(oe=>oe.textValue),J=zW(K,Y,ie),G=(te=P.find(oe=>oe.textValue===J))==null?void 0:te.ref.current;(function oe(de){B.current=de,window.clearTimeout(L.current),de!==""&&(L.current=window.setTimeout(()=>oe(""),1e3))})(Y),G&&setTimeout(()=>G.focus())};j.useEffect(()=>()=>window.clearTimeout(L.current),[]),uM();const F=j.useCallback(q=>{var P,W;return H.current===((P=$.current)==null?void 0:P.side)&&HW(q,(W=$.current)==null?void 0:W.area)},[]);return p.jsx(EW,{scope:n,searchRef:B,onItemEnter:j.useCallback(q=>{F(q)&&q.preventDefault()},[F]),onItemLeave:j.useCallback(q=>{var Y;F(q)||((Y=A.current)==null||Y.focus(),R(null))},[F]),onTriggerLeave:j.useCallback(q=>{F(q)&&q.preventDefault()},[F]),pointerGraceTimerRef:I,onPointerGraceIntentChange:j.useCallback(q=>{$.current=q},[]),children:p.jsx(V,{...z,children:p.jsx(Mw,{asChild:!0,trapped:s,onMountAutoFocus:Re(o,q=>{var Y;q.preventDefault(),(Y=A.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:p.jsx(Rw,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:v,children:p.jsx(KM,{asChild:!0,...k,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:R,onEntryFocus:Re(u,q=>{S.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(mW,{role:"menu","aria-orientation":"vertical","data-state":HO(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,ie=q.key.length===1;P&&(q.key==="Tab"&&q.preventDefault(),!W&&ie&&Q(q.key));const K=A.current;if(q.target!==K||!vW.includes(q.key))return;q.preventDefault();const G=N().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);_O.includes(q.key)&&G.reverse(),FW(G)}),onBlur:Re(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(L.current),B.current="")}),onPointerMove:Re(e.onPointerMove,fl(q=>{const Y=q.target,P=D.current!==q.clientX;if(q.currentTarget.contains(Y)&&P){const W=q.clientX>D.current?"right":"left";H.current=W,D.current=q.clientX}}))})})})})})})});jO.displayName=kn;var RW="MenuGroup",mb=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ze.div,{role:"group",...r,ref:t})});mb.displayName=RW;var MW="MenuLabel",TO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ze.div,{...r,ref:t})});TO.displayName=MW;var hd="MenuItem",AN="menu.itemSelect",Yd=j.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=j.useRef(null),a=Ol(hd,e.__scopeMenu),c=hb(hd,e.__scopeMenu),u=Et(t,o),d=j.useRef(!1),h=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(AN,{bubbles:!0,cancelable:!0});m.addEventListener(AN,v=>r==null?void 0:r(v),{once:!0}),oM(m,g),g.defaultPrevented?d.current=!1:a.onClose()}};return p.jsx(AO,{...s,ref:u,disabled:n,onClick:Re(e.onClick,h),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===" "||Yx.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Yd.displayName=hd;var AO=j.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=hb(hd,n),c=kO(n),u=j.useRef(null),d=Et(t,u),[h,m]=j.useState(!1),[g,v]=j.useState("");return j.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[o.children]),p.jsx(dl.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:p.jsx(GM,{asChild:!0,...c,focusable:!r,children:p.jsx(Ze.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Re(e.onPointerMove,fl(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,fl(b=>a.onItemLeave(b))),onFocus:Re(e.onFocus,()=>m(!0)),onBlur:Re(e.onBlur,()=>m(!1))})})})}),IW="MenuCheckboxItem",RO=j.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return p.jsx(LO,{scope:e.__scopeMenu,checked:n,children:p.jsx(Yd,{role:"menuitemcheckbox","aria-checked":pd(n)?"mixed":n,...s,ref:t,"data-state":yb(n),onSelect:Re(s.onSelect,()=>r==null?void 0:r(pd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});RO.displayName=IW;var MO="MenuRadioGroup",[OW,PW]=ni(MO,{value:void 0,onValueChange:()=>{}}),IO=j.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=ur(r);return p.jsx(OW,{scope:e.__scopeMenu,value:n,onValueChange:o,children:p.jsx(mb,{...s,ref:t})})});IO.displayName=MO;var OO="MenuRadioItem",PO=j.forwardRef((e,t)=>{const{value:n,...r}=e,s=PW(OO,e.__scopeMenu),o=n===s.value;return p.jsx(LO,{scope:e.__scopeMenu,checked:o,children:p.jsx(Yd,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":yb(o),onSelect:Re(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});PO.displayName=OO;var gb="MenuItemIndicator",[LO,LW]=ni(gb,{checked:!1}),DO=j.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=LW(gb,n);return p.jsx(Lr,{present:r||pd(o.checked)||o.checked===!0,children:p.jsx(Ze.span,{...s,ref:t,"data-state":yb(o.checked)})})});DO.displayName=gb;var DW="MenuSeparator",$O=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$O.displayName=DW;var $W="MenuArrow",qO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Gd(n);return p.jsx(gW,{...s,...r,ref:t})});qO.displayName=$W;var qW="MenuSub",[MJ,FO]=ni(qW),Ia="MenuSubTrigger",BO=j.forwardRef((e,t)=>{const n=ri(Ia,e.__scopeMenu),r=Ol(Ia,e.__scopeMenu),s=FO(Ia,e.__scopeMenu),o=hb(Ia,e.__scopeMenu),a=j.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},h=j.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return j.useEffect(()=>h,[h]),j.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]),p.jsx(db,{asChild:!0,...d,children:p.jsx(AO,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":HO(n.open),...e,ref:Tw(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,fl(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Re(e.onPointerLeave,fl(m=>{var v,b;h();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===" "||xW[r.dir].includes(m.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),m.preventDefault())})})})});BO.displayName=Ia;var zO="MenuSubContent",VO=j.forwardRef((e,t)=>{const n=CO(kn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ri(kn,e.__scopeMenu),a=Ol(kn,e.__scopeMenu),c=FO(zO,e.__scopeMenu),u=j.useRef(null),d=Et(t,u);return p.jsx(dl.Provider,{scope:e.__scopeMenu,children:p.jsx(Lr,{present:r||o.open,children:p.jsx(dl.Slot,{scope:e.__scopeMenu,children:p.jsx(pb,{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:h=>{var m;a.isUsingKeyboardRef.current&&((m=u.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Re(e.onFocusOutside,h=>{h.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{var v;const m=h.currentTarget.contains(h.target),g=wW[a.dir].includes(h.key);m&&g&&(o.onOpenChange(!1),(v=c.trigger)==null||v.focus(),h.preventDefault())})})})})})});VO.displayName=zO;function HO(e){return e?"open":"closed"}function pd(e){return e==="indeterminate"}function yb(e){return pd(e)?"indeterminate":e?"checked":"unchecked"}function FW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function BW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zW(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=BW(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 VW(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,h=c.y,m=u.x,g=u.y;h>r!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function HW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return VW(n,t)}function fl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var UW=NO,WW=db,KW=EO,GW=jO,YW=mb,XW=TO,QW=Yd,JW=RO,ZW=IO,eK=PO,tK=DO,nK=$O,rK=qO,sK=BO,iK=VO,vb="ContextMenu",[oK]=ei(vb,[SO]),zt=SO(),[aK,UO]=oK(vb),WO=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:o=!0}=e,[a,c]=j.useState(!1),u=zt(t),d=ur(r),h=j.useCallback(m=>{c(m),d(m)},[d]);return p.jsx(aK,{scope:t,open:a,onOpenChange:h,modal:o,children:p.jsx(UW,{...u,dir:s,open:a,onOpenChange:h,modal:o,children:n})})};WO.displayName=vb;var KO="ContextMenuTrigger",GO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,o=UO(KO,n),a=zt(n),c=j.useRef({x:0,y:0}),u=j.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=j.useRef(0),h=j.useCallback(()=>window.clearTimeout(d.current),[]),m=g=>{c.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return j.useEffect(()=>h,[h]),j.useEffect(()=>void(r&&h()),[r,h]),p.jsxs(p.Fragment,{children:[p.jsx(WW,{...a,virtualRef:u}),p.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=>{h(),m(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Re(e.onPointerDown,Nu(g=>{h(),d.current=window.setTimeout(()=>m(g),700)})),onPointerMove:r?e.onPointerMove:Re(e.onPointerMove,Nu(h)),onPointerCancel:r?e.onPointerCancel:Re(e.onPointerCancel,Nu(h)),onPointerUp:r?e.onPointerUp:Re(e.onPointerUp,Nu(h))})]})});GO.displayName=KO;var lK="ContextMenuPortal",YO=e=>{const{__scopeContextMenu:t,...n}=e,r=zt(t);return p.jsx(KW,{...r,...n})};YO.displayName=lK;var XO="ContextMenuContent",QO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=UO(XO,n),o=zt(n),a=j.useRef(!1);return p.jsx(GW,{...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)"}})});QO.displayName=XO;var cK="ContextMenuGroup",uK=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(YW,{...s,...r,ref:t})});uK.displayName=cK;var dK="ContextMenuLabel",JO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(XW,{...s,...r,ref:t})});JO.displayName=dK;var fK="ContextMenuItem",ZO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(QW,{...s,...r,ref:t})});ZO.displayName=fK;var hK="ContextMenuCheckboxItem",eP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(JW,{...s,...r,ref:t})});eP.displayName=hK;var pK="ContextMenuRadioGroup",mK=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(ZW,{...s,...r,ref:t})});mK.displayName=pK;var gK="ContextMenuRadioItem",tP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(eK,{...s,...r,ref:t})});tP.displayName=gK;var yK="ContextMenuItemIndicator",nP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(tK,{...s,...r,ref:t})});nP.displayName=yK;var vK="ContextMenuSeparator",rP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(nK,{...s,...r,ref:t})});rP.displayName=vK;var xK="ContextMenuArrow",wK=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(rK,{...s,...r,ref:t})});wK.displayName=xK;var bK="ContextMenuSubTrigger",sP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(sK,{...s,...r,ref:t})});sP.displayName=bK;var _K="ContextMenuSubContent",iP=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=zt(n);return p.jsx(iK,{...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)"}})});iP.displayName=_K;function Nu(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var SK=WO,kK=GO,NK=YO,oP=QO,aP=JO,lP=ZO,cP=eP,uP=tP,dP=nP,fP=rP,hP=sP,pP=iP;const CK=SK,EK=kK,jK=j.forwardRef(({className:e,inset:t,children:n,...r},s)=>p.jsxs(hP,{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,p.jsx("span",{className:"ml-auto text-xs",children:"▶"})]}));jK.displayName=hP.displayName;const TK=j.forwardRef(({className:e,...t},n)=>p.jsx(pP,{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}));TK.displayName=pP.displayName;const mP=j.forwardRef(({className:e,...t},n)=>p.jsx(NK,{children:p.jsx(oP,{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})}));mP.displayName=oP.displayName;const Ui=j.forwardRef(({className:e,inset:t,destructive:n,...r},s)=>p.jsx(lP,{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}));Ui.displayName=lP.displayName;const AK=j.forwardRef(({className:e,children:t,checked:n,...r},s)=>p.jsxs(cP,{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:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(dP,{children:p.jsx("span",{className:"text-primary",children:"✓"})})}),t]}));AK.displayName=cP.displayName;const RK=j.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(uP,{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:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(dP,{children:p.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));RK.displayName=uP.displayName;const MK=j.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(aP,{ref:r,className:Bt("px-2 py-1.5 text-xs font-semibold text-gray-400",t&&"pl-8",e),...n}));MK.displayName=aP.displayName;const Xx=j.forwardRef(({className:e,...t},n)=>p.jsx(fP,{ref:n,className:Bt("-mx-1 my-1 h-px bg-node-border",e),...t}));Xx.displayName=fP.displayName;const Oa=({className:e,...t})=>p.jsx("span",{className:Bt("ml-auto text-xs tracking-widest text-gray-500",e),...t});Oa.displayName="ContextMenuShortcut";function xb(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 Kp,RN;function IK(){if(RN)return Kp;RN=1;function e(){this.__data__=[],this.size=0}return Kp=e,Kp}var Gp,MN;function Eo(){if(MN)return Gp;MN=1;function e(t,n){return t===n||t!==t&&n!==n}return Gp=e,Gp}var Yp,IN;function Xd(){if(IN)return Yp;IN=1;var e=Eo();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return Yp=t,Yp}var Xp,ON;function OK(){if(ON)return Xp;ON=1;var e=Xd(),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 Xp=r,Xp}var Qp,PN;function PK(){if(PN)return Qp;PN=1;var e=Xd();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return Qp=t,Qp}var Jp,LN;function LK(){if(LN)return Jp;LN=1;var e=Xd();function t(n){return e(this.__data__,n)>-1}return Jp=t,Jp}var Zp,DN;function DK(){if(DN)return Zp;DN=1;var e=Xd();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 Zp=t,Zp}var em,$N;function Qd(){if($N)return em;$N=1;var e=IK(),t=OK(),n=PK(),r=LK(),s=DK();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,em=o,em}var tm,qN;function $K(){if(qN)return tm;qN=1;var e=Qd();function t(){this.__data__=new e,this.size=0}return tm=t,tm}var nm,FN;function qK(){if(FN)return nm;FN=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return nm=e,nm}var rm,BN;function FK(){if(BN)return rm;BN=1;function e(t){return this.__data__.get(t)}return rm=e,rm}var sm,zN;function BK(){if(zN)return sm;zN=1;function e(t){return this.__data__.has(t)}return sm=e,sm}var im,VN;function gP(){if(VN)return im;VN=1;var e=typeof tu=="object"&&tu&&tu.Object===Object&&tu;return im=e,im}var om,HN;function Gn(){if(HN)return om;HN=1;var e=gP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return om=n,om}var am,UN;function jo(){if(UN)return am;UN=1;var e=Gn(),t=e.Symbol;return am=t,am}var lm,WN;function zK(){if(WN)return lm;WN=1;var e=jo(),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 h=r.call(a);return d&&(c?a[s]=u:delete a[s]),h}return lm=o,lm}var cm,KN;function VK(){if(KN)return cm;KN=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return cm=n,cm}var um,GN;function si(){if(GN)return um;GN=1;var e=jo(),t=zK(),n=VK(),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 um=a,um}var dm,YN;function Cn(){if(YN)return dm;YN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return dm=e,dm}var fm,XN;function Pl(){if(XN)return fm;XN=1;var e=si(),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 fm=a,fm}var hm,QN;function HK(){if(QN)return hm;QN=1;var e=Gn(),t=e["__core-js_shared__"];return hm=t,hm}var pm,JN;function UK(){if(JN)return pm;JN=1;var e=HK(),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 pm=n,pm}var mm,ZN;function yP(){if(ZN)return mm;ZN=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 mm=n,mm}var gm,eC;function WK(){if(eC)return gm;eC=1;var e=Pl(),t=UK(),n=Cn(),r=yP(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,u=a.toString,d=c.hasOwnProperty,h=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)?h:o;return v.test(r(g))}return gm=m,gm}var ym,tC;function KK(){if(tC)return ym;tC=1;function e(t,n){return t==null?void 0:t[n]}return ym=e,ym}var vm,nC;function ii(){if(nC)return vm;nC=1;var e=WK(),t=KK();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return vm=n,vm}var xm,rC;function wb(){if(rC)return xm;rC=1;var e=ii(),t=Gn(),n=e(t,"Map");return xm=n,xm}var wm,sC;function Jd(){if(sC)return wm;sC=1;var e=ii(),t=e(Object,"create");return wm=t,wm}var bm,iC;function GK(){if(iC)return bm;iC=1;var e=Jd();function t(){this.__data__=e?e(null):{},this.size=0}return bm=t,bm}var _m,oC;function YK(){if(oC)return _m;oC=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return _m=e,_m}var Sm,aC;function XK(){if(aC)return Sm;aC=1;var e=Jd(),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 Sm=s,Sm}var km,lC;function QK(){if(lC)return km;lC=1;var e=Jd(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return km=r,km}var Nm,cC;function JK(){if(cC)return Nm;cC=1;var e=Jd(),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 Nm=n,Nm}var Cm,uC;function ZK(){if(uC)return Cm;uC=1;var e=GK(),t=YK(),n=XK(),r=QK(),s=JK();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,Cm=o,Cm}var Em,dC;function eG(){if(dC)return Em;dC=1;var e=ZK(),t=Qd(),n=wb();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Em=r,Em}var jm,fC;function tG(){if(fC)return jm;fC=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return jm=e,jm}var Tm,hC;function Zd(){if(hC)return Tm;hC=1;var e=tG();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return Tm=t,Tm}var Am,pC;function nG(){if(pC)return Am;pC=1;var e=Zd();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Am=t,Am}var Rm,mC;function rG(){if(mC)return Rm;mC=1;var e=Zd();function t(n){return e(this,n).get(n)}return Rm=t,Rm}var Mm,gC;function sG(){if(gC)return Mm;gC=1;var e=Zd();function t(n){return e(this,n).has(n)}return Mm=t,Mm}var Im,yC;function iG(){if(yC)return Im;yC=1;var e=Zd();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 Im=t,Im}var Om,vC;function bb(){if(vC)return Om;vC=1;var e=eG(),t=nG(),n=rG(),r=sG(),s=iG();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,Om=o,Om}var Pm,xC;function oG(){if(xC)return Pm;xC=1;var e=Qd(),t=wb(),n=bb(),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 Pm=s,Pm}var Lm,wC;function ef(){if(wC)return Lm;wC=1;var e=Qd(),t=$K(),n=qK(),r=FK(),s=BK(),o=oG();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,Lm=a,Lm}var Dm,bC;function _b(){if(bC)return Dm;bC=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 Dm=e,Dm}var $m,_C;function vP(){if(_C)return $m;_C=1;var e=ii(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return $m=t,$m}var qm,SC;function tf(){if(SC)return qm;SC=1;var e=vP();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return qm=t,qm}var Fm,kC;function nf(){if(kC)return Fm;kC=1;var e=tf(),t=Eo(),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 Fm=s,Fm}var Bm,NC;function Ll(){if(NC)return Bm;NC=1;var e=nf(),t=tf();function n(r,s,o,a){var c=!o;o||(o={});for(var u=-1,d=s.length;++u<d;){var h=s[u],m=a?a(o[h],r[h],h,o,r):void 0;m===void 0&&(m=r[h]),c?t(o,h,m):e(o,h,m)}return o}return Bm=n,Bm}var zm,CC;function aG(){if(CC)return zm;CC=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return zm=e,zm}var Vm,EC;function gr(){if(EC)return Vm;EC=1;function e(t){return t!=null&&typeof t=="object"}return Vm=e,Vm}var Hm,jC;function lG(){if(jC)return Hm;jC=1;var e=si(),t=gr(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return Hm=r,Hm}var Um,TC;function Dl(){if(TC)return Um;TC=1;var e=lG(),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 Um=o,Um}var Wm,AC;function yt(){if(AC)return Wm;AC=1;var e=Array.isArray;return Wm=e,Wm}var Pa={exports:{}},Km,RC;function cG(){if(RC)return Km;RC=1;function e(){return!1}return Km=e,Km}Pa.exports;var MC;function To(){return MC||(MC=1,(function(e,t){var n=Gn(),r=cG(),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})(Pa,Pa.exports)),Pa.exports}var Gm,IC;function rf(){if(IC)return Gm;IC=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 Gm=n,Gm}var Ym,OC;function Sb(){if(OC)return Ym;OC=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Ym=t,Ym}var Xm,PC;function uG(){if(PC)return Xm;PC=1;var e=si(),t=Sb(),n=gr(),r="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",h="[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]",T="[object Int16Array]",R="[object Int32Array]",A="[object Uint8Array]",O="[object Uint8ClampedArray]",L="[object Uint16Array]",B="[object Uint32Array]",I={};I[C]=I[k]=I[N]=I[T]=I[R]=I[A]=I[O]=I[L]=I[B]=!0,I[r]=I[s]=I[w]=I[o]=I[S]=I[a]=I[c]=I[u]=I[d]=I[h]=I[m]=I[g]=I[v]=I[b]=I[x]=!1;function $(H){return n(H)&&t(H.length)&&!!I[e(H)]}return Xm=$,Xm}var Qm,LC;function sf(){if(LC)return Qm;LC=1;function e(t){return function(n){return t(n)}}return Qm=e,Qm}var La={exports:{}};La.exports;var DC;function kb(){return DC||(DC=1,(function(e,t){var n=gP(),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})(La,La.exports)),La.exports}var Jm,$C;function $l(){if($C)return Jm;$C=1;var e=uG(),t=sf(),n=kb(),r=n&&n.isTypedArray,s=r?t(r):e;return Jm=s,Jm}var Zm,qC;function xP(){if(qC)return Zm;qC=1;var e=aG(),t=Dl(),n=yt(),r=To(),s=rf(),o=$l(),a=Object.prototype,c=a.hasOwnProperty;function u(d,h){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)(h||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 Zm=u,Zm}var eg,FC;function of(){if(FC)return eg;FC=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return eg=t,eg}var tg,BC;function wP(){if(BC)return tg;BC=1;function e(t,n){return function(r){return t(n(r))}}return tg=e,tg}var ng,zC;function dG(){if(zC)return ng;zC=1;var e=wP(),t=e(Object.keys,Object);return ng=t,ng}var rg,VC;function Nb(){if(VC)return rg;VC=1;var e=of(),t=dG(),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 rg=s,rg}var sg,HC;function Dr(){if(HC)return sg;HC=1;var e=Pl(),t=Sb();function n(r){return r!=null&&t(r.length)&&!e(r)}return sg=n,sg}var ig,UC;function _s(){if(UC)return ig;UC=1;var e=xP(),t=Nb(),n=Dr();function r(s){return n(s)?e(s):t(s)}return ig=r,ig}var og,WC;function fG(){if(WC)return og;WC=1;var e=Ll(),t=_s();function n(r,s){return r&&e(s,t(s),r)}return og=n,og}var ag,KC;function hG(){if(KC)return ag;KC=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return ag=e,ag}var lg,GC;function pG(){if(GC)return lg;GC=1;var e=Cn(),t=of(),n=hG(),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 lg=o,lg}var cg,YC;function oi(){if(YC)return cg;YC=1;var e=xP(),t=pG(),n=Dr();function r(s){return n(s)?e(s,!0):t(s)}return cg=r,cg}var ug,XC;function mG(){if(XC)return ug;XC=1;var e=Ll(),t=oi();function n(r,s){return r&&e(s,t(s),r)}return ug=n,ug}var Da={exports:{}};Da.exports;var QC;function bP(){return QC||(QC=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,h){if(h)return d.slice();var m=d.length,g=c?c(m):new d.constructor(m);return d.copy(g),g}e.exports=u})(Da,Da.exports)),Da.exports}var dg,JC;function _P(){if(JC)return dg;JC=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 dg=e,dg}var fg,ZC;function SP(){if(ZC)return fg;ZC=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 fg=e,fg}var hg,eE;function kP(){if(eE)return hg;eE=1;function e(){return[]}return hg=e,hg}var pg,tE;function Cb(){if(tE)return pg;tE=1;var e=SP(),t=kP(),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 pg=o,pg}var mg,nE;function gG(){if(nE)return mg;nE=1;var e=Ll(),t=Cb();function n(r,s){return e(r,t(r),s)}return mg=n,mg}var gg,rE;function Eb(){if(rE)return gg;rE=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 gg=e,gg}var yg,sE;function af(){if(sE)return yg;sE=1;var e=wP(),t=e(Object.getPrototypeOf,Object);return yg=t,yg}var vg,iE;function NP(){if(iE)return vg;iE=1;var e=Eb(),t=af(),n=Cb(),r=kP(),s=Object.getOwnPropertySymbols,o=s?function(a){for(var c=[];a;)e(c,n(a)),a=t(a);return c}:r;return vg=o,vg}var xg,oE;function yG(){if(oE)return xg;oE=1;var e=Ll(),t=NP();function n(r,s){return e(r,t(r),s)}return xg=n,xg}var wg,aE;function CP(){if(aE)return wg;aE=1;var e=Eb(),t=yt();function n(r,s,o){var a=s(r);return t(r)?a:e(a,o(r))}return wg=n,wg}var bg,lE;function EP(){if(lE)return bg;lE=1;var e=CP(),t=Cb(),n=_s();function r(s){return e(s,n,t)}return bg=r,bg}var _g,cE;function vG(){if(cE)return _g;cE=1;var e=CP(),t=NP(),n=oi();function r(s){return e(s,n,t)}return _g=r,_g}var Sg,uE;function xG(){if(uE)return Sg;uE=1;var e=ii(),t=Gn(),n=e(t,"DataView");return Sg=n,Sg}var kg,dE;function wG(){if(dE)return kg;dE=1;var e=ii(),t=Gn(),n=e(t,"Promise");return kg=n,kg}var Ng,fE;function jP(){if(fE)return Ng;fE=1;var e=ii(),t=Gn(),n=e(t,"Set");return Ng=n,Ng}var Cg,hE;function bG(){if(hE)return Cg;hE=1;var e=ii(),t=Gn(),n=e(t,"WeakMap");return Cg=n,Cg}var Eg,pE;function Ao(){if(pE)return Eg;pE=1;var e=xG(),t=wb(),n=wG(),r=jP(),s=bG(),o=si(),a=yP(),c="[object Map]",u="[object Object]",d="[object Promise]",h="[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)!=h||s&&C(new s)!=m)&&(C=function(k){var N=o(k),T=N==u?k.constructor:void 0,R=T?a(T):"";if(R)switch(R){case v:return g;case b:return c;case x:return d;case w:return h;case S:return m}return N}),Eg=C,Eg}var jg,mE;function _G(){if(mE)return jg;mE=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 jg=n,jg}var Tg,gE;function TP(){if(gE)return Tg;gE=1;var e=Gn(),t=e.Uint8Array;return Tg=t,Tg}var Ag,yE;function jb(){if(yE)return Ag;yE=1;var e=TP();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return Ag=t,Ag}var Rg,vE;function SG(){if(vE)return Rg;vE=1;var e=jb();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}return Rg=t,Rg}var Mg,xE;function kG(){if(xE)return Mg;xE=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return Mg=t,Mg}var Ig,wE;function NG(){if(wE)return Ig;wE=1;var e=jo(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(s){return n?Object(n.call(s)):{}}return Ig=r,Ig}var Og,bE;function AP(){if(bE)return Og;bE=1;var e=jb();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}return Og=t,Og}var Pg,_E;function CG(){if(_E)return Pg;_E=1;var e=jb(),t=SG(),n=kG(),r=NG(),s=AP(),o="[object Boolean]",a="[object Date]",c="[object Map]",u="[object Number]",d="[object RegExp]",h="[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]",T="[object Uint8ClampedArray]",R="[object Uint16Array]",A="[object Uint32Array]";function O(L,B,I){var $=L.constructor;switch(B){case v:return e(L);case o:case a:return new $(+L);case b:return t(L,I);case x:case w:case S:case C:case k:case N:case T:case R:case A:return s(L,I);case c:return new $;case u:case m:return new $(L);case d:return n(L);case h:return new $;case g:return r(L)}}return Pg=O,Pg}var Lg,SE;function RP(){if(SE)return Lg;SE=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 Lg=n,Lg}var Dg,kE;function MP(){if(kE)return Dg;kE=1;var e=RP(),t=af(),n=of();function r(s){return typeof s.constructor=="function"&&!n(s)?e(t(s)):{}}return Dg=r,Dg}var $g,NE;function EG(){if(NE)return $g;NE=1;var e=Ao(),t=gr(),n="[object Map]";function r(s){return t(s)&&e(s)==n}return $g=r,$g}var qg,CE;function jG(){if(CE)return qg;CE=1;var e=EG(),t=sf(),n=kb(),r=n&&n.isMap,s=r?t(r):e;return qg=s,qg}var Fg,EE;function TG(){if(EE)return Fg;EE=1;var e=Ao(),t=gr(),n="[object Set]";function r(s){return t(s)&&e(s)==n}return Fg=r,Fg}var Bg,jE;function AG(){if(jE)return Bg;jE=1;var e=TG(),t=sf(),n=kb(),r=n&&n.isSet,s=r?t(r):e;return Bg=s,Bg}var zg,TE;function IP(){if(TE)return zg;TE=1;var e=ef(),t=_b(),n=nf(),r=fG(),s=mG(),o=bP(),a=_P(),c=gG(),u=yG(),d=EP(),h=vG(),m=Ao(),g=_G(),v=CG(),b=MP(),x=yt(),w=To(),S=jG(),C=Cn(),k=AG(),N=_s(),T=oi(),R=1,A=2,O=4,L="[object Arguments]",B="[object Array]",I="[object Boolean]",$="[object Date]",H="[object Error]",D="[object Function]",V="[object GeneratorFunction]",z="[object Map]",Q="[object Number]",F="[object Object]",q="[object RegExp]",Y="[object Set]",P="[object String]",W="[object Symbol]",ie="[object WeakMap]",K="[object ArrayBuffer]",J="[object DataView]",G="[object Float32Array]",ee="[object Float64Array]",te="[object Int8Array]",oe="[object Int16Array]",de="[object Int32Array]",me="[object Uint8Array]",ye="[object Uint8ClampedArray]",he="[object Uint16Array]",Se="[object Uint32Array]",xe={};xe[L]=xe[B]=xe[K]=xe[J]=xe[I]=xe[$]=xe[G]=xe[ee]=xe[te]=xe[oe]=xe[de]=xe[z]=xe[Q]=xe[F]=xe[q]=xe[Y]=xe[P]=xe[W]=xe[me]=xe[ye]=xe[he]=xe[Se]=!0,xe[H]=xe[D]=xe[ie]=!1;function Ce(Ne,tt,Le,vt,xt,it){var Ue,Mt=tt&R,It=tt&A,Vt=tt&O;if(Le&&(Ue=xt?Le(Ne,vt,xt,it):Le(Ne)),Ue!==void 0)return Ue;if(!C(Ne))return Ne;var Me=x(Ne);if(Me){if(Ue=g(Ne),!Mt)return a(Ne,Ue)}else{var be=m(Ne),ot=be==D||be==V;if(w(Ne))return o(Ne,Mt);if(be==F||be==L||ot&&!xt){if(Ue=It||ot?{}:b(Ne),!Mt)return It?u(Ne,s(Ue,Ne)):c(Ne,r(Ue,Ne))}else{if(!xe[be])return xt?Ne:{};Ue=v(Ne,be,Mt)}}it||(it=new e);var ze=it.get(Ne);if(ze)return ze;it.set(Ne,Ue),k(Ne)?Ne.forEach(function(Ot){Ue.add(Ce(Ot,tt,Le,Ot,Ne,it))}):S(Ne)&&Ne.forEach(function(Ot,Pt){Ue.set(Pt,Ce(Ot,tt,Le,Pt,Ne,it))});var Ht=Vt?It?h:d:It?T:N,fn=Me?void 0:Ht(Ne);return t(fn||Ne,function(Ot,Pt){fn&&(Pt=Ot,Ot=Ne[Pt]),n(Ue,Pt,Ce(Ot,tt,Le,Pt,Ne,it))}),Ue}return zg=Ce,zg}var Vg,AE;function RG(){if(AE)return Vg;AE=1;var e=IP(),t=4;function n(r){return e(r,t)}return Vg=n,Vg}var Hg,RE;function Tb(){if(RE)return Hg;RE=1;function e(t){return function(){return t}}return Hg=e,Hg}var Ug,ME;function MG(){if(ME)return Ug;ME=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 Ug=e,Ug}var Wg,IE;function Ab(){if(IE)return Wg;IE=1;var e=MG(),t=e();return Wg=t,Wg}var Kg,OE;function Rb(){if(OE)return Kg;OE=1;var e=Ab(),t=_s();function n(r,s){return r&&e(r,s,t)}return Kg=n,Kg}var Gg,PE;function IG(){if(PE)return Gg;PE=1;var e=Dr();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 Gg=t,Gg}var Yg,LE;function lf(){if(LE)return Yg;LE=1;var e=Rb(),t=IG(),n=t(e);return Yg=n,Yg}var Xg,DE;function ai(){if(DE)return Xg;DE=1;function e(t){return t}return Xg=e,Xg}var Qg,$E;function OP(){if($E)return Qg;$E=1;var e=ai();function t(n){return typeof n=="function"?n:e}return Qg=t,Qg}var Jg,qE;function PP(){if(qE)return Jg;qE=1;var e=_b(),t=lf(),n=OP(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a))}return Jg=s,Jg}var Zg,FE;function LP(){return FE||(FE=1,Zg=PP()),Zg}var ey,BE;function OG(){if(BE)return ey;BE=1;var e=lf();function t(n,r){var s=[];return e(n,function(o,a,c){r(o,a,c)&&s.push(o)}),s}return ey=t,ey}var ty,zE;function PG(){if(zE)return ty;zE=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return ty=t,ty}var ny,VE;function LG(){if(VE)return ny;VE=1;function e(t){return this.__data__.has(t)}return ny=e,ny}var ry,HE;function DP(){if(HE)return ry;HE=1;var e=bb(),t=PG(),n=LG();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,ry=r,ry}var sy,UE;function DG(){if(UE)return sy;UE=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 sy=e,sy}var iy,WE;function $P(){if(WE)return iy;WE=1;function e(t,n){return t.has(n)}return iy=e,iy}var oy,KE;function qP(){if(KE)return oy;KE=1;var e=DP(),t=DG(),n=$P(),r=1,s=2;function o(a,c,u,d,h,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],T=c[S];if(d)var R=g?d(T,N,S,c,a,m):d(N,T,S,a,c,m);if(R!==void 0){if(R)continue;C=!1;break}if(k){if(!t(c,function(A,O){if(!n(k,O)&&(N===A||h(N,A,u,d,m)))return k.push(O)})){C=!1;break}}else if(!(N===T||h(N,T,u,d,m))){C=!1;break}}return m.delete(a),m.delete(c),C}return oy=o,oy}var ay,GE;function $G(){if(GE)return ay;GE=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,o){r[++n]=[o,s]}),r}return ay=e,ay}var ly,YE;function Mb(){if(YE)return ly;YE=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return ly=e,ly}var cy,XE;function qG(){if(XE)return cy;XE=1;var e=jo(),t=TP(),n=Eo(),r=qP(),s=$G(),o=Mb(),a=1,c=2,u="[object Boolean]",d="[object Date]",h="[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 T(R,A,O,L,B,I,$){switch(O){case C:if(R.byteLength!=A.byteLength||R.byteOffset!=A.byteOffset)return!1;R=R.buffer,A=A.buffer;case S:return!(R.byteLength!=A.byteLength||!I(new t(R),new t(A)));case u:case d:case g:return n(+R,+A);case h:return R.name==A.name&&R.message==A.message;case v:case x:return R==A+"";case m:var H=s;case b:var D=L&a;if(H||(H=o),R.size!=A.size&&!D)return!1;var V=$.get(R);if(V)return V==A;L|=c,$.set(R,A);var z=r(H(R),H(A),L,B,I,$);return $.delete(R),z;case w:if(N)return N.call(R)==N.call(A)}return!1}return cy=T,cy}var uy,QE;function FG(){if(QE)return uy;QE=1;var e=EP(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c,u,d,h){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=h.get(o),k=h.get(a);if(C&&k)return C==a&&k==o;var N=!0;h.set(o,a),h.set(a,o);for(var T=m;++w<v;){S=g[w];var R=o[S],A=a[S];if(u)var O=m?u(A,R,S,a,o,h):u(R,A,S,o,a,h);if(!(O===void 0?R===A||d(R,A,c,u,h):O)){N=!1;break}T||(T=S=="constructor")}if(N&&!T){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 h.delete(o),h.delete(a),N}return uy=s,uy}var dy,JE;function BG(){if(JE)return dy;JE=1;var e=ef(),t=qP(),n=qG(),r=FG(),s=Ao(),o=yt(),a=To(),c=$l(),u=1,d="[object Arguments]",h="[object Array]",m="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function b(x,w,S,C,k,N){var T=o(x),R=o(w),A=T?h:s(x),O=R?h:s(w);A=A==d?m:A,O=O==d?m:O;var L=A==m,B=O==m,I=A==O;if(I&&a(x)){if(!a(w))return!1;T=!0,L=!1}if(I&&!L)return N||(N=new e),T||c(x)?t(x,w,S,C,k,N):n(x,w,A,S,C,k,N);if(!(S&u)){var $=L&&v.call(x,"__wrapped__"),H=B&&v.call(w,"__wrapped__");if($||H){var D=$?x.value():x,V=H?w.value():w;return N||(N=new e),k(D,V,S,C,N)}}return I?(N||(N=new e),r(x,w,S,C,k,N)):!1}return dy=b,dy}var fy,ZE;function FP(){if(ZE)return fy;ZE=1;var e=BG(),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 fy=n,fy}var hy,e2;function zG(){if(e2)return hy;e2=1;var e=ef(),t=FP(),n=1,r=2;function s(o,a,c,u){var d=c.length,h=d,m=!u;if(o==null)return!h;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<h;){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 hy=s,hy}var py,t2;function BP(){if(t2)return py;t2=1;var e=Cn();function t(n){return n===n&&!e(n)}return py=t,py}var my,n2;function VG(){if(n2)return my;n2=1;var e=BP(),t=_s();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 my=n,my}var gy,r2;function zP(){if(r2)return gy;r2=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return gy=e,gy}var yy,s2;function HG(){if(s2)return yy;s2=1;var e=zG(),t=VG(),n=zP();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 yy=r,yy}var vy,i2;function Ro(){if(i2)return vy;i2=1;var e=si(),t=gr(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return vy=r,vy}var xy,o2;function Ib(){if(o2)return xy;o2=1;var e=yt(),t=Ro(),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 xy=s,xy}var wy,a2;function UG(){if(a2)return wy;a2=1;var e=bb(),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,wy=n,wy}var by,l2;function WG(){if(l2)return by;l2=1;var e=UG(),t=500;function n(r){var s=e(r,function(a){return o.size===t&&o.clear(),a}),o=s.cache;return s}return by=n,by}var _y,c2;function KG(){if(c2)return _y;c2=1;var e=WG(),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 _y=r,_y}var Sy,u2;function cf(){if(u2)return Sy;u2=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 Sy=e,Sy}var ky,d2;function GG(){if(d2)return ky;d2=1;var e=jo(),t=cf(),n=yt(),r=Ro(),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 ky=a,ky}var Ny,f2;function VP(){if(f2)return Ny;f2=1;var e=GG();function t(n){return n==null?"":e(n)}return Ny=t,Ny}var Cy,h2;function uf(){if(h2)return Cy;h2=1;var e=yt(),t=Ib(),n=KG(),r=VP();function s(o,a){return e(o)?o:t(o,a)?[o]:n(r(o))}return Cy=s,Cy}var Ey,p2;function ql(){if(p2)return Ey;p2=1;var e=Ro();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Ey=t,Ey}var jy,m2;function df(){if(m2)return jy;m2=1;var e=uf(),t=ql();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 jy=n,jy}var Ty,g2;function YG(){if(g2)return Ty;g2=1;var e=df();function t(n,r,s){var o=n==null?void 0:e(n,r);return o===void 0?s:o}return Ty=t,Ty}var Ay,y2;function XG(){if(y2)return Ay;y2=1;function e(t,n){return t!=null&&n in Object(t)}return Ay=e,Ay}var Ry,v2;function HP(){if(v2)return Ry;v2=1;var e=uf(),t=Dl(),n=yt(),r=rf(),s=Sb(),o=ql();function a(c,u,d){u=e(u,c);for(var h=-1,m=u.length,g=!1;++h<m;){var v=o(u[h]);if(!(g=c!=null&&d(c,v)))break;c=c[v]}return g||++h!=m?g:(m=c==null?0:c.length,!!m&&s(m)&&r(v,m)&&(n(c)||t(c)))}return Ry=a,Ry}var My,x2;function UP(){if(x2)return My;x2=1;var e=XG(),t=HP();function n(r,s){return r!=null&&t(r,s,e)}return My=n,My}var Iy,w2;function QG(){if(w2)return Iy;w2=1;var e=FP(),t=YG(),n=UP(),r=Ib(),s=BP(),o=zP(),a=ql(),c=1,u=2;function d(h,m){return r(h)&&s(m)?o(a(h),m):function(g){var v=t(g,h);return v===void 0&&v===m?n(g,h):e(m,v,c|u)}}return Iy=d,Iy}var Oy,b2;function WP(){if(b2)return Oy;b2=1;function e(t){return function(n){return n==null?void 0:n[t]}}return Oy=e,Oy}var Py,_2;function JG(){if(_2)return Py;_2=1;var e=df();function t(n){return function(r){return e(r,n)}}return Py=t,Py}var Ly,S2;function ZG(){if(S2)return Ly;S2=1;var e=WP(),t=JG(),n=Ib(),r=ql();function s(o){return n(o)?e(r(o)):t(o)}return Ly=s,Ly}var Dy,k2;function $r(){if(k2)return Dy;k2=1;var e=HG(),t=QG(),n=ai(),r=yt(),s=ZG();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 Dy=o,Dy}var $y,N2;function KP(){if(N2)return $y;N2=1;var e=SP(),t=OG(),n=$r(),r=yt();function s(o,a){var c=r(o)?e:t;return c(o,n(a,3))}return $y=s,$y}var qy,C2;function eY(){if(C2)return qy;C2=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,s){return r!=null&&t.call(r,s)}return qy=n,qy}var Fy,E2;function GP(){if(E2)return Fy;E2=1;var e=eY(),t=HP();function n(r,s){return r!=null&&t(r,s,e)}return Fy=n,Fy}var By,j2;function tY(){if(j2)return By;j2=1;var e=Nb(),t=Ao(),n=Dl(),r=yt(),s=Dr(),o=To(),a=of(),c=$l(),u="[object Map]",d="[object Set]",h=Object.prototype,m=h.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 By=g,By}var zy,T2;function YP(){if(T2)return zy;T2=1;function e(t){return t===void 0}return zy=e,zy}var Vy,A2;function XP(){if(A2)return Vy;A2=1;var e=lf(),t=Dr();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 Vy=n,Vy}var Hy,R2;function QP(){if(R2)return Hy;R2=1;var e=cf(),t=$r(),n=XP(),r=yt();function s(o,a){var c=r(o)?e:n;return c(o,t(a,3))}return Hy=s,Hy}var Uy,M2;function nY(){if(M2)return Uy;M2=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 Uy=e,Uy}var Wy,I2;function rY(){if(I2)return Wy;I2=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 Wy=e,Wy}var Ky,O2;function JP(){if(O2)return Ky;O2=1;var e=nY(),t=lf(),n=$r(),r=rY(),s=yt();function o(a,c,u){var d=s(a)?e:r,h=arguments.length<3;return d(a,n(c,4),u,h,t)}return Ky=o,Ky}var Gy,P2;function sY(){if(P2)return Gy;P2=1;var e=si(),t=yt(),n=gr(),r="[object String]";function s(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Gy=s,Gy}var Yy,L2;function iY(){if(L2)return Yy;L2=1;var e=WP(),t=e("length");return Yy=t,Yy}var Xy,D2;function oY(){if(D2)return Xy;D2=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 Xy=u,Xy}var Qy,$2;function aY(){if($2)return Qy;$2=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+")",h="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=d+"?",x="["+o+"]?",w="(?:"+v+"(?:"+[h,m,g].join("|")+")"+x+b+")*",S=x+b+w,C="(?:"+[h+c+"?",c,m,g,a].join("|")+")",k=RegExp(u+"(?="+u+")|"+C+S,"g");function N(T){for(var R=k.lastIndex=0;k.test(T);)++R;return R}return Qy=N,Qy}var Jy,q2;function lY(){if(q2)return Jy;q2=1;var e=iY(),t=oY(),n=aY();function r(s){return t(s)?n(s):e(s)}return Jy=r,Jy}var Zy,F2;function cY(){if(F2)return Zy;F2=1;var e=Nb(),t=Ao(),n=Dr(),r=sY(),s=lY(),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 Zy=c,Zy}var ev,B2;function uY(){if(B2)return ev;B2=1;var e=_b(),t=RP(),n=Rb(),r=$r(),s=af(),o=yt(),a=To(),c=Pl(),u=Cn(),d=$l();function h(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 ev=h,ev}var tv,z2;function dY(){if(z2)return tv;z2=1;var e=jo(),t=Dl(),n=yt(),r=e?e.isConcatSpreadable:void 0;function s(o){return n(o)||t(o)||!!(r&&o&&o[r])}return tv=s,tv}var nv,V2;function Ob(){if(V2)return nv;V2=1;var e=Eb(),t=dY();function n(r,s,o,a,c){var u=-1,d=r.length;for(o||(o=t),c||(c=[]);++u<d;){var h=r[u];s>0&&o(h)?s>1?n(h,s-1,o,a,c):e(c,h):a||(c[c.length]=h)}return c}return nv=n,nv}var rv,H2;function fY(){if(H2)return rv;H2=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 rv=e,rv}var sv,U2;function ZP(){if(U2)return sv;U2=1;var e=fY(),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 h=Array(s+1);++c<s;)h[c]=a[c];return h[s]=o(d),e(r,this,h)}}return sv=n,sv}var iv,W2;function hY(){if(W2)return iv;W2=1;var e=Tb(),t=vP(),n=ai(),r=t?function(s,o){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return iv=r,iv}var ov,K2;function pY(){if(K2)return ov;K2=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 ov=r,ov}var av,G2;function eL(){if(G2)return av;G2=1;var e=hY(),t=pY(),n=t(e);return av=n,av}var lv,Y2;function ff(){if(Y2)return lv;Y2=1;var e=ai(),t=ZP(),n=eL();function r(s,o){return n(t(s,o,e),s+"")}return lv=r,lv}var cv,X2;function tL(){if(X2)return cv;X2=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 cv=e,cv}var uv,Q2;function mY(){if(Q2)return uv;Q2=1;function e(t){return t!==t}return uv=e,uv}var dv,J2;function gY(){if(J2)return dv;J2=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 dv=e,dv}var fv,Z2;function yY(){if(Z2)return fv;Z2=1;var e=tL(),t=mY(),n=gY();function r(s,o,a){return o===o?n(s,o,a):e(s,t,a)}return fv=r,fv}var hv,ej;function vY(){if(ej)return hv;ej=1;var e=yY();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return hv=t,hv}var pv,tj;function xY(){if(tj)return pv;tj=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 pv=e,pv}var mv,nj;function wY(){if(nj)return mv;nj=1;function e(){}return mv=e,mv}var gv,rj;function bY(){if(rj)return gv;rj=1;var e=jP(),t=wY(),n=Mb(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return gv=s,gv}var yv,sj;function _Y(){if(sj)return yv;sj=1;var e=DP(),t=vY(),n=xY(),r=$P(),s=bY(),o=Mb(),a=200;function c(u,d,h){var m=-1,g=t,v=u.length,b=!0,x=[],w=x;if(h)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=h||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,h)||(w!==x&&w.push(k),x.push(C))}return x}return yv=c,yv}var vv,ij;function nL(){if(ij)return vv;ij=1;var e=Dr(),t=gr();function n(r){return t(r)&&e(r)}return vv=n,vv}var xv,oj;function SY(){if(oj)return xv;oj=1;var e=Ob(),t=ff(),n=_Y(),r=nL(),s=t(function(o){return n(e(o,1,r,!0))});return xv=s,xv}var wv,aj;function kY(){if(aj)return wv;aj=1;var e=cf();function t(n,r){return e(r,function(s){return n[s]})}return wv=t,wv}var bv,lj;function rL(){if(lj)return bv;lj=1;var e=kY(),t=_s();function n(r){return r==null?[]:e(r,t(r))}return bv=n,bv}var _v,cj;function En(){if(cj)return _v;cj=1;var e;if(typeof xb=="function")try{e={clone:RG(),constant:Tb(),each:LP(),filter:KP(),has:GP(),isArray:yt(),isEmpty:tY(),isFunction:Pl(),isUndefined:YP(),keys:_s(),map:QP(),reduce:JP(),size:cY(),transform:uY(),union:SY(),values:rL()}}catch{}return e||(e=window._),_v=e,_v}var Sv,uj;function Pb(){if(uj)return Sv;uj=1;var e=En();Sv=s;var t="\0",n="\0",r="";function s(h){this._isDirected=e.has(h,"directed")?h.directed:!0,this._isMultigraph=e.has(h,"multigraph")?h.multigraph:!1,this._isCompound=e.has(h,"compound")?h.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(h){return this._label=h,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(h){return e.isFunction(h)||(h=e.constant(h)),this._defaultNodeLabelFn=h,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return e.keys(this._nodes)},s.prototype.sources=function(){var h=this;return e.filter(this.nodes(),function(m){return e.isEmpty(h._in[m])})},s.prototype.sinks=function(){var h=this;return e.filter(this.nodes(),function(m){return e.isEmpty(h._out[m])})},s.prototype.setNodes=function(h,m){var g=arguments,v=this;return e.each(h,function(b){g.length>1?v.setNode(b,m):v.setNode(b)}),this},s.prototype.setNode=function(h,m){return e.has(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=m),this):(this._nodes[h]=arguments.length>1?m:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=n,this._children[h]={},this._children[n][h]=!0),this._in[h]={},this._preds[h]={},this._out[h]={},this._sucs[h]={},++this._nodeCount,this)},s.prototype.node=function(h){return this._nodes[h]},s.prototype.hasNode=function(h){return e.has(this._nodes,h)},s.prototype.removeNode=function(h){var m=this;if(e.has(this._nodes,h)){var g=function(v){m.removeEdge(m._edgeObjs[v])};delete this._nodes[h],this._isCompound&&(this._removeFromParentsChildList(h),delete this._parent[h],e.each(this.children(h),function(v){m.setParent(v)}),delete this._children[h]),e.each(e.keys(this._in[h]),g),delete this._in[h],delete this._preds[h],e.each(e.keys(this._out[h]),g),delete this._out[h],delete this._sucs[h],--this._nodeCount}return this},s.prototype.setParent=function(h,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===h)throw new Error("Setting "+m+" as parent of "+h+" would create a cycle");this.setNode(m)}return this.setNode(h),this._removeFromParentsChildList(h),this._parent[h]=m,this._children[m][h]=!0,this},s.prototype._removeFromParentsChildList=function(h){delete this._children[this._parent[h]][h]},s.prototype.parent=function(h){if(this._isCompound){var m=this._parent[h];if(m!==n)return m}},s.prototype.children=function(h){if(e.isUndefined(h)&&(h=n),this._isCompound){var m=this._children[h];if(m)return e.keys(m)}else{if(h===n)return this.nodes();if(this.hasNode(h))return[]}},s.prototype.predecessors=function(h){var m=this._preds[h];if(m)return e.keys(m)},s.prototype.successors=function(h){var m=this._sucs[h];if(m)return e.keys(m)},s.prototype.neighbors=function(h){var m=this.predecessors(h);if(m)return e.union(m,this.successors(h))},s.prototype.isLeaf=function(h){var m;return this.isDirected()?m=this.successors(h):m=this.neighbors(h),m.length===0},s.prototype.filterNodes=function(h){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){h(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(h){return e.isFunction(h)||(h=e.constant(h)),this._defaultEdgeLabelFn=h,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return e.values(this._edgeObjs)},s.prototype.setPath=function(h,m){var g=this,v=arguments;return e.reduce(h,function(b,x){return v.length>1?g.setEdge(b,x,m):g.setEdge(b,x),x}),this},s.prototype.setEdge=function(){var h,m,g,v,b=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(h=x.v,m=x.w,g=x.name,arguments.length===2&&(v=arguments[1],b=!0)):(h=x,m=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],b=!0)),h=""+h,m=""+m,e.isUndefined(g)||(g=""+g);var w=c(this._isDirected,h,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(h),this.setNode(m),this._edgeLabels[w]=b?v:this._defaultEdgeLabelFn(h,m,g);var S=u(this._isDirected,h,m,g);return h=S.v,m=S.w,Object.freeze(S),this._edgeObjs[w]=S,o(this._preds[m],h),o(this._sucs[h],m),this._in[m][w]=S,this._out[h][w]=S,this._edgeCount++,this},s.prototype.edge=function(h,m,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,h,m,g);return this._edgeLabels[v]},s.prototype.hasEdge=function(h,m,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,h,m,g);return e.has(this._edgeLabels,v)},s.prototype.removeEdge=function(h,m,g){var v=arguments.length===1?d(this._isDirected,arguments[0]):c(this._isDirected,h,m,g),b=this._edgeObjs[v];return b&&(h=b.v,m=b.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[m],h),a(this._sucs[h],m),delete this._in[m][v],delete this._out[h][v],this._edgeCount--),this},s.prototype.inEdges=function(h,m){var g=this._in[h];if(g){var v=e.values(g);return m?e.filter(v,function(b){return b.v===m}):v}},s.prototype.outEdges=function(h,m){var g=this._out[h];if(g){var v=e.values(g);return m?e.filter(v,function(b){return b.w===m}):v}},s.prototype.nodeEdges=function(h,m){var g=this.inEdges(h,m);if(g)return g.concat(this.outEdges(h,m))};function o(h,m){h[m]?h[m]++:h[m]=1}function a(h,m){--h[m]||delete h[m]}function c(h,m,g,v){var b=""+m,x=""+g;if(!h&&b>x){var w=b;b=x,x=w}return b+r+x+r+(e.isUndefined(v)?t:v)}function u(h,m,g,v){var b=""+m,x=""+g;if(!h&&b>x){var w=b;b=x,x=w}var S={v:b,w:x};return v&&(S.name=v),S}function d(h,m){return c(h,m.v,m.w,m.name)}return Sv}var kv,dj;function NY(){return dj||(dj=1,kv="2.1.8"),kv}var Nv,fj;function CY(){return fj||(fj=1,Nv={Graph:Pb(),version:NY()}),Nv}var Cv,hj;function EY(){if(hj)return Cv;hj=1;var e=En(),t=Pb();Cv={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),h={v:c};return e.isUndefined(u)||(h.value=u),e.isUndefined(d)||(h.parent=d),h})}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 Cv}var Ev,pj;function jY(){if(pj)return Ev;pj=1;var e=En();Ev=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 Ev}var jv,mj;function sL(){if(mj)return jv;mj=1;var e=En();jv=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},jv}var Tv,gj;function iL(){if(gj)return Tv;gj=1;var e=En(),t=sL();Tv=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={},h=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,h.decrease(x,C))};for(o.nodes().forEach(function(b){var x=b===a?0:Number.POSITIVE_INFINITY;d[b]={distance:x},h.add(b,x)});h.size()>0&&(m=h.removeMin(),g=d[m],g.distance!==Number.POSITIVE_INFINITY);)u(m).forEach(v);return d}return Tv}var Av,yj;function TY(){if(yj)return Av;yj=1;var e=iL(),t=En();Av=n;function n(r,s,o){return t.transform(r.nodes(),function(a,c){a[c]=e(r,c,s,o)},{})}return Av}var Rv,vj;function oL(){if(vj)return Rv;vj=1;var e=En();Rv=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 h=[],m;do m=s.pop(),o[m].onStack=!1,h.push(m);while(u!==m);a.push(h)}}return n.nodes().forEach(function(u){e.has(o,u)||c(u)}),a}return Rv}var Mv,xj;function AY(){if(xj)return Mv;xj=1;var e=En(),t=oL();Mv=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 Mv}var Iv,wj;function RY(){if(wj)return Iv;wj=1;var e=En();Iv=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(h){d!==h&&(c[d][h]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(h){var m=h.v===d?h.w:h.v,g=o(h);c[d][m]={distance:g,predecessor:d}})}),u.forEach(function(d){var h=c[d];u.forEach(function(m){var g=c[m];u.forEach(function(v){var b=g[d],x=h[v],w=g[v],S=b.distance+x.distance;S<w.distance&&(w.distance=S,w.predecessor=x.predecessor)})})}),c}return Iv}var Ov,bj;function aL(){if(bj)return Ov;bj=1;var e=En();Ov=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,Ov}var Pv,_j;function MY(){if(_j)return Pv;_j=1;var e=aL();Pv=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Pv}var Lv,Sj;function lL(){if(Sj)return Lv;Sj=1;var e=En();Lv=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 Lv}var Dv,kj;function IY(){if(kj)return Dv;kj=1;var e=lL();Dv=t;function t(n,r){return e(n,r,"post")}return Dv}var $v,Nj;function OY(){if(Nj)return $v;Nj=1;var e=lL();$v=t;function t(n,r){return e(n,r,"pre")}return $v}var qv,Cj;function PY(){if(Cj)return qv;Cj=1;var e=En(),t=Pb(),n=sL();qv=r;function r(s,o){var a=new t,c={},u=new n,d;function h(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(h)}return a}return qv}var Fv,Ej;function LY(){return Ej||(Ej=1,Fv={components:jY(),dijkstra:iL(),dijkstraAll:TY(),findCycles:AY(),floydWarshall:RY(),isAcyclic:MY(),postorder:IY(),preorder:OY(),prim:PY(),tarjan:oL(),topsort:aL()}),Fv}var Bv,jj;function DY(){if(jj)return Bv;jj=1;var e=CY();return Bv={Graph:e.Graph,json:EY(),alg:LY(),version:e.version},Bv}var zv,Tj;function Vn(){if(Tj)return zv;Tj=1;var e;if(typeof xb=="function")try{e=DY()}catch{}return e||(e=window.graphlib),zv=e,zv}var Vv,Aj;function $Y(){if(Aj)return Vv;Aj=1;var e=IP(),t=1,n=4;function r(s){return e(s,t|n)}return Vv=r,Vv}var Hv,Rj;function hf(){if(Rj)return Hv;Rj=1;var e=Eo(),t=Dr(),n=rf(),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 Hv=s,Hv}var Uv,Mj;function qY(){if(Mj)return Uv;Mj=1;var e=ff(),t=Eo(),n=hf(),r=oi(),s=Object.prototype,o=s.hasOwnProperty,a=e(function(c,u){c=Object(c);var d=-1,h=u.length,m=h>2?u[2]:void 0;for(m&&n(u[0],u[1],m)&&(h=1);++d<h;)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 Uv=a,Uv}var Wv,Ij;function FY(){if(Ij)return Wv;Ij=1;var e=$r(),t=Dr(),n=_s();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 h=s(o,a,c);return h>-1?u[d?o[h]:h]:void 0}}return Wv=r,Wv}var Kv,Oj;function BY(){if(Oj)return Kv;Oj=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Kv=t,Kv}var Gv,Pj;function zY(){if(Pj)return Gv;Pj=1;var e=BY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Gv=n,Gv}var Yv,Lj;function VY(){if(Lj)return Yv;Lj=1;var e=zY(),t=Cn(),n=Ro(),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 h=typeof d.valueOf=="function"?d.valueOf():d;d=t(h)?h+"":h}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 Yv=u,Yv}var Xv,Dj;function cL(){if(Dj)return Xv;Dj=1;var e=VY(),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 Xv=r,Xv}var Qv,$j;function HY(){if($j)return Qv;$j=1;var e=cL();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return Qv=t,Qv}var Jv,qj;function UY(){if(qj)return Jv;qj=1;var e=tL(),t=$r(),n=HY(),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 Jv=s,Jv}var Zv,Fj;function WY(){if(Fj)return Zv;Fj=1;var e=FY(),t=UY(),n=e(t);return Zv=n,Zv}var e0,Bj;function uL(){if(Bj)return e0;Bj=1;var e=Ob();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return e0=t,e0}var t0,zj;function KY(){if(zj)return t0;zj=1;var e=Ab(),t=OP(),n=oi();function r(s,o){return s==null?s:e(s,t(o),n)}return t0=r,t0}var n0,Vj;function GY(){if(Vj)return n0;Vj=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return n0=e,n0}var r0,Hj;function YY(){if(Hj)return r0;Hj=1;var e=tf(),t=Rb(),n=$r();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 r0=r,r0}var s0,Uj;function Lb(){if(Uj)return s0;Uj=1;var e=Ro();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,h=c}return h}return s0=t,s0}var i0,Wj;function XY(){if(Wj)return i0;Wj=1;function e(t,n){return t>n}return i0=e,i0}var o0,Kj;function QY(){if(Kj)return o0;Kj=1;var e=Lb(),t=XY(),n=ai();function r(s){return s&&s.length?e(s,n,t):void 0}return o0=r,o0}var a0,Gj;function dL(){if(Gj)return a0;Gj=1;var e=tf(),t=Eo();function n(r,s,o){(o!==void 0&&!t(r[s],o)||o===void 0&&!(s in r))&&e(r,s,o)}return a0=n,a0}var l0,Yj;function JY(){if(Yj)return l0;Yj=1;var e=si(),t=af(),n=gr(),r="[object Object]",s=Function.prototype,o=Object.prototype,a=s.toString,c=o.hasOwnProperty,u=a.call(Object);function d(h){if(!n(h)||e(h)!=r)return!1;var m=t(h);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 l0=d,l0}var c0,Xj;function fL(){if(Xj)return c0;Xj=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return c0=e,c0}var u0,Qj;function ZY(){if(Qj)return u0;Qj=1;var e=Ll(),t=oi();function n(r){return e(r,t(r))}return u0=n,u0}var d0,Jj;function eX(){if(Jj)return d0;Jj=1;var e=dL(),t=bP(),n=AP(),r=_P(),s=MP(),o=Dl(),a=yt(),c=nL(),u=To(),d=Pl(),h=Cn(),m=JY(),g=$l(),v=fL(),b=ZY();function x(w,S,C,k,N,T,R){var A=v(w,C),O=v(S,C),L=R.get(O);if(L){e(w,C,L);return}var B=T?T(A,O,C+"",w,S,R):void 0,I=B===void 0;if(I){var $=a(O),H=!$&&u(O),D=!$&&!H&&g(O);B=O,$||H||D?a(A)?B=A:c(A)?B=r(A):H?(I=!1,B=t(O,!0)):D?(I=!1,B=n(O,!0)):B=[]:m(O)||o(O)?(B=A,o(A)?B=b(A):(!h(A)||d(A))&&(B=s(O))):I=!1}I&&(R.set(O,B),N(B,O,k,T,R),R.delete(O)),e(w,C,B)}return d0=x,d0}var f0,Zj;function tX(){if(Zj)return f0;Zj=1;var e=ef(),t=dL(),n=Ab(),r=eX(),s=Cn(),o=oi(),a=fL();function c(u,d,h,m,g){u!==d&&n(d,function(v,b){if(g||(g=new e),s(v))r(u,d,b,h,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 f0=c,f0}var h0,eT;function nX(){if(eT)return h0;eT=1;var e=ff(),t=hf();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 h=o[a];h&&r(s,h,a,u)}return s})}return h0=n,h0}var p0,tT;function rX(){if(tT)return p0;tT=1;var e=tX(),t=nX(),n=t(function(r,s,o){e(r,s,o)});return p0=n,p0}var m0,nT;function hL(){if(nT)return m0;nT=1;function e(t,n){return t<n}return m0=e,m0}var g0,rT;function sX(){if(rT)return g0;rT=1;var e=Lb(),t=hL(),n=ai();function r(s){return s&&s.length?e(s,n,t):void 0}return g0=r,g0}var y0,sT;function iX(){if(sT)return y0;sT=1;var e=Lb(),t=$r(),n=hL();function r(s,o){return s&&s.length?e(s,t(o,2),n):void 0}return y0=r,y0}var v0,iT;function oX(){if(iT)return v0;iT=1;var e=Gn(),t=function(){return e.Date.now()};return v0=t,v0}var x0,oT;function aX(){if(oT)return x0;oT=1;var e=nf(),t=uf(),n=rf(),r=Cn(),s=ql();function o(a,c,u,d){if(!r(a))return a;c=t(c,a);for(var h=-1,m=c.length,g=m-1,v=a;v!=null&&++h<m;){var b=s(c[h]),x=u;if(b==="__proto__"||b==="constructor"||b==="prototype")return a;if(h!=g){var w=v[b];x=d?d(w,b,v):void 0,x===void 0&&(x=r(w)?w:n(c[h+1])?[]:{})}e(v,b,x),v=v[b]}return a}return x0=o,x0}var w0,aT;function lX(){if(aT)return w0;aT=1;var e=df(),t=aX(),n=uf();function r(s,o,a){for(var c=-1,u=o.length,d={};++c<u;){var h=o[c],m=e(s,h);a(m,h)&&t(d,n(h,s),m)}return d}return w0=r,w0}var b0,lT;function cX(){if(lT)return b0;lT=1;var e=lX(),t=UP();function n(r,s){return e(r,s,function(o,a){return t(r,a)})}return b0=n,b0}var _0,cT;function uX(){if(cT)return _0;cT=1;var e=uL(),t=ZP(),n=eL();function r(s){return n(t(s,void 0,e),s+"")}return _0=r,_0}var S0,uT;function dX(){if(uT)return S0;uT=1;var e=cX(),t=uX(),n=t(function(r,s){return r==null?{}:e(r,s)});return S0=n,S0}var k0,dT;function fX(){if(dT)return k0;dT=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 k0=n,k0}var N0,fT;function hX(){if(fT)return N0;fT=1;var e=fX(),t=hf(),n=cL();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 N0=r,N0}var C0,hT;function pX(){if(hT)return C0;hT=1;var e=hX(),t=e();return C0=t,C0}var E0,pT;function mX(){if(pT)return E0;pT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return E0=e,E0}var j0,mT;function gX(){if(mT)return j0;mT=1;var e=Ro();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,h=r===r,m=e(r);if(!d&&!m&&!c&&n>r||c&&u&&h&&!d&&!m||o&&u&&h||!s&&h||!a)return 1;if(!o&&!c&&!m&&n<r||m&&s&&a&&!o&&!c||d&&s&&a||!u&&a||!h)return-1}return 0}return j0=t,j0}var T0,gT;function yX(){if(gT)return T0;gT=1;var e=gX();function t(n,r,s){for(var o=-1,a=n.criteria,c=r.criteria,u=a.length,d=s.length;++o<u;){var h=e(a[o],c[o]);if(h){if(o>=d)return h;var m=s[o];return h*(m=="desc"?-1:1)}}return n.index-r.index}return T0=t,T0}var A0,yT;function vX(){if(yT)return A0;yT=1;var e=cf(),t=df(),n=$r(),r=XP(),s=mX(),o=sf(),a=yX(),c=ai(),u=yt();function d(h,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(h,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 A0=d,A0}var R0,vT;function xX(){if(vT)return R0;vT=1;var e=Ob(),t=vX(),n=ff(),r=hf(),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 R0=s,R0}var M0,xT;function wX(){if(xT)return M0;xT=1;var e=VP(),t=0;function n(r){var s=++t;return e(r)+s}return M0=n,M0}var I0,wT;function bX(){if(wT)return I0;wT=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 I0=e,I0}var O0,bT;function _X(){if(bT)return O0;bT=1;var e=nf(),t=bX();function n(r,s){return t(r||[],s||[],e)}return O0=n,O0}var P0,_T;function et(){if(_T)return P0;_T=1;var e;if(typeof xb=="function")try{e={cloneDeep:$Y(),constant:Tb(),defaults:qY(),each:LP(),filter:KP(),find:WY(),flatten:uL(),forEach:PP(),forIn:KY(),has:GP(),isUndefined:YP(),last:GY(),map:QP(),mapValues:YY(),max:QY(),merge:rX(),min:sX(),minBy:iX(),now:oX(),pick:dX(),range:pX(),reduce:JP(),sortBy:xX(),uniqueId:wX(),values:rL(),zipObject:_X()}}catch{}return e||(e=window._),P0=e,P0}var L0,ST;function SX(){if(ST)return L0;ST=1,L0=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 L0}var D0,kT;function kX(){if(kT)return D0;kT=1;var e=et(),t=Vn().Graph,n=SX();D0=s;var r=e.constant(1);function s(d,h){if(d.nodeCount()<=1)return[];var m=c(d,h||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,h,m){for(var g=[],v=h[h.length-1],b=h[0],x;d.nodeCount();){for(;x=b.dequeue();)a(d,h,m,x);for(;x=v.dequeue();)a(d,h,m,x);if(d.nodeCount()){for(var w=h.length-2;w>0;--w)if(x=h[w].dequeue(),x){g=g.concat(a(d,h,m,x,!0));break}}}return g}function a(d,h,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(h,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(h,m,C)}),d.removeNode(g.v),b}function c(d,h){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=h(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,h,m){m.out?m.in?d[m.out-m.in+h].enqueue(m):d[d.length-1].enqueue(m):d[0].enqueue(m)}return D0}var $0,NT;function NX(){if(NT)return $0;NT=1;var e=et(),t=kX();$0={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(h){e.has(u,h)||(u[h]=!0,c[h]=!0,e.forEach(o.outEdges(h),function(m){e.has(c,m.w)?a.push(m):d(m.w)}),delete c[h])}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 $0}var q0,CT;function Jt(){if(CT)return q0;CT=1;var e=et(),t=Vn().Graph;q0={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:o,predecessorWeights:a,intersectRect:c,buildLayerMatrix:u,normalizeRanks:d,removeEmptyRanks:h,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,T=S.y-k,R=w.width/2,A=w.height/2;if(!N&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var O,L;return Math.abs(T)*R>Math.abs(N)*A?(T<0&&(A=-A),O=A*N/T,L=A):(N<0&&(R=-R),O=R,L=R*T/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 h(w){var S=e.min(e.map(w.nodes(),function(T){return w.node(T).rank})),C=[];e.forEach(w.nodes(),function(T){var R=w.node(T).rank-S;C[R]||(C[R]=[]),C[R].push(T)});var k=0,N=w.graph().nodeRankFactor;e.forEach(C,function(T,R){e.isUndefined(T)&&R%N!==0?--k:k&&e.forEach(T,function(A){w.node(A).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 q0}var F0,ET;function CX(){if(ET)return F0;ET=1;var e=et(),t=Jt();F0={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,h=o.node(d).rank,m=a.name,g=o.edge(a),v=g.labelRank;if(h!==u+1){o.removeEdge(a);var b,x,w;for(w=0,++u;u<h;++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 F0}var B0,jT;function md(){if(jT)return B0;jT=1;var e=et();B0={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 B0}var z0,TT;function pL(){if(TT)return z0;TT=1;var e=et(),t=Vn().Graph,n=md().slack;z0=r;function r(c){var u=new t({directed:!1}),d=c.nodes()[0],h=c.nodeCount();u.setNode(d,{});for(var m,g;s(u,c)<h;)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(h){e.forEach(u.nodeEdges(h),function(m){var g=m.v,v=h===g?m.w:g;!c.hasNode(v)&&!n(u,m)&&(c.setNode(v,{}),c.setEdge(h,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(h){u.node(h).rank+=d})}return z0}var V0,AT;function EX(){if(AT)return V0;AT=1;var e=et(),t=pL(),n=md().slack,r=md().longestPath,s=Vn().alg.preorder,o=Vn().alg.postorder,a=Jt().simplify;V0=c,c.initLowLimValues=m,c.initCutValues=u,c.calcCutValue=h,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 T,R;T=v(N);)R=b(N,k,T),x(N,k,T,R)}function u(k,N){var T=o(k,k.nodes());T=T.slice(0,T.length-1),e.forEach(T,function(R){d(k,N,R)})}function d(k,N,T){var R=k.node(T),A=R.parent;k.edge(T,A).cutvalue=h(k,N,T)}function h(k,N,T){var R=k.node(T),A=R.parent,O=!0,L=N.edge(T,A),B=0;return L||(O=!1,L=N.edge(A,T)),B=L.weight,e.forEach(N.nodeEdges(T),function(I){var $=I.v===T,H=$?I.w:I.v;if(H!==A){var D=$===O,V=N.edge(I).weight;if(B+=D?V:-V,S(k,T,H)){var z=k.edge(T,H).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,T,R,A){var O=T,L=k.node(R);return N[R]=!0,e.forEach(k.neighbors(R),function(B){e.has(N,B)||(T=g(k,N,T,B,R))}),L.low=O,L.lim=T++,A?L.parent=A:delete L.parent,T}function v(k){return e.find(k.edges(),function(N){return k.edge(N).cutvalue<0})}function b(k,N,T){var R=T.v,A=T.w;N.hasEdge(R,A)||(R=T.w,A=T.v);var O=k.node(R),L=k.node(A),B=O,I=!1;O.lim>L.lim&&(B=L,I=!0);var $=e.filter(N.edges(),function(H){return I===C(k,k.node(H.v),B)&&I!==C(k,k.node(H.w),B)});return e.minBy($,function(H){return n(N,H)})}function x(k,N,T,R){var A=T.v,O=T.w;k.removeEdge(A,O),k.setEdge(R.v,R.w,{}),m(k),u(k,N),w(k,N)}function w(k,N){var T=e.find(k.nodes(),function(A){return!N.node(A).parent}),R=s(k,T);R=R.slice(1),e.forEach(R,function(A){var O=k.node(A).parent,L=N.edge(A,O),B=!1;L||(L=N.edge(O,A),B=!0),N.node(A).rank=N.node(O).rank+(B?L.minlen:-L.minlen)})}function S(k,N,T){return k.hasEdge(N,T)}function C(k,N,T){return T.low<=N.lim&&N.lim<=T.lim}return V0}var H0,RT;function jX(){if(RT)return H0;RT=1;var e=md(),t=e.longestPath,n=pL(),r=EX();H0=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 H0}var U0,MT;function TX(){if(MT)return U0;MT=1;var e=et();U0=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),h=d.path,m=d.lca,g=0,v=h[g],b=!0;a!==u.w;){if(c=s.node(a),b){for(;(v=h[g])!==m&&s.node(v).maxRank<c.rank;)g++;v===m&&(b=!1)}if(!b){for(;g<h.length-1&&s.node(v=h[g+1]).minRank<=c.rank;)g++;v=h[g]}s.setParent(a,v),a=s.successors(a)[0]}})}function n(s,o,a,c){var u=[],d=[],h=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>h||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 U0}var W0,IT;function AX(){if(IT)return W0;IT=1;var e=et(),t=Jt();W0={run:n,cleanup:a};function n(c){var u=t.addDummyNode(c,"root",{},"_root"),d=s(c),h=e.max(e.values(d))-1,m=2*h+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,h,d,v)}),c.graph().nodeRankFactor=m}function r(c,u,d,h,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,h,m,g,C);var k=c.node(C),N=k.borderTop?k.borderTop:C,T=k.borderBottom?k.borderBottom:C,R=k.borderTop?h:2*h,A=N!==T?1:m-g[v]+1;c.setEdge(x,N,{weight:R,minlen:A,nestingEdge:!0}),c.setEdge(T,w,{weight:R,minlen:A,nestingEdge:!0})}),c.parent(v)||c.setEdge(u,x,{weight:0,minlen:m+g[v]})}function s(c){var u={};function d(h,m){var g=c.children(h);g&&g.length&&e.forEach(g,function(v){d(v,m+1)}),u[h]=m}return e.forEach(c.children(),function(h){d(h,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 h=c.edge(d);h.nestingEdge&&c.removeEdge(d)})}return W0}var K0,OT;function RX(){if(OT)return K0;OT=1;var e=et(),t=Jt();K0=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,h=u.maxRank+1;d<h;++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 h={width:0,height:0,rank:d,borderType:o},m=u[o][d-1],g=t.addDummyNode(s,"border",h,a);u[o][d]=g,s.setParent(g,c),m&&s.setEdge(m,g,{weight:1})}return K0}var G0,PT;function MX(){if(PT)return G0;PT=1;var e=et();G0={adjust:t,undo:n};function t(d){var h=d.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&r(d)}function n(d){var h=d.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&o(d),(h==="lr"||h==="rl")&&(c(d),r(d))}function r(d){e.forEach(d.nodes(),function(h){s(d.node(h))}),e.forEach(d.edges(),function(h){s(d.edge(h))})}function s(d){var h=d.width;d.width=d.height,d.height=h}function o(d){e.forEach(d.nodes(),function(h){a(d.node(h))}),e.forEach(d.edges(),function(h){var m=d.edge(h);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(h){u(d.node(h))}),e.forEach(d.edges(),function(h){var m=d.edge(h);e.forEach(m.points,u),e.has(m,"x")&&u(m)})}function u(d){var h=d.x;d.x=d.y,d.y=h}return G0}var Y0,LT;function IX(){if(LT)return Y0;LT=1;var e=et();Y0=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 h=n.node(d);a[h.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 Y0}var X0,DT;function OX(){if(DT)return X0;DT=1;var e=et();X0=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 h=e.map(new Array(d),function(){return 0}),m=0;return e.forEach(c.forEach(function(g){var v=g.pos+u;h[v]+=g.weight;for(var b=0;v>0;)v%2&&(b+=h[v+1]),v=v-1>>1,h[v]+=g.weight;m+=g.weight*b})),m}return X0}var Q0,$T;function PX(){if($T)return Q0;$T=1;var e=et();Q0=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),h=n.node(u.v);return{sum:c.sum+d.weight*h.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 Q0}var J0,qT;function LX(){if(qT)return J0;qT=1;var e=et();J0=t;function t(s,o){var a={};e.forEach(s,function(u,d){var h=a[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:d};e.isUndefined(u.barycenter)||(h.barycenter=u.barycenter,h.weight=u.weight)}),e.forEach(o.edges(),function(u){var d=a[u.v],h=a[u.w];!e.isUndefined(d)&&!e.isUndefined(h)&&(h.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(h){h.merged||(e.isUndefined(h.barycenter)||e.isUndefined(d.barycenter)||h.barycenter>=d.barycenter)&&r(d,h)}}function c(d){return function(h){h.in.push(d),--h.indegree===0&&s.push(h)}}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 J0}var Z0,FT;function DX(){if(FT)return Z0;FT=1;var e=et(),t=Jt();Z0=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}),h=[],m=0,g=0,v=0;u.sort(s(!!a)),v=r(h,d,v),e.forEach(u,function(x){v+=x.vs.length,h.push(x.vs),m+=x.barycenter*x.weight,g+=x.weight,v=r(h,d,v)});var b={vs:e.flatten(h,!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 Z0}var ex,BT;function $X(){if(BT)return ex;BT=1;var e=et(),t=PX(),n=LX(),r=DX();ex=s;function s(c,u,d,h){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(T){return T!==v&&T!==b}));var w=t(c,m);e.forEach(w,function(T){if(c.children(T.v).length){var R=s(c,T.v,d,h);x[T.v]=R,e.has(R,"barycenter")&&a(T,R)}});var S=n(w,d);o(S,x);var C=r(S,h);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(h){return u[h]?u[h].vs:h}),!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 ex}var tx,zT;function qX(){if(zT)return tx;zT=1;var e=et(),t=Vn().Graph;tx=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 h=s.node(d),m=s.parent(d);(h.rank===o||h.minRank<=o&&o<=h.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(h,"minRank")&&u.setNode(d,{borderLeft:h.borderLeft[o],borderRight:h.borderRight[o]}))}),u}function r(s){for(var o;s.hasNode(o=e.uniqueId("_root")););return o}return tx}var nx,VT;function FX(){if(VT)return nx;VT=1;var e=et();nx=t;function t(n,r,s){var o={},a;e.forEach(s,function(c){for(var u=n.parent(c),d,h;u;){if(d=n.parent(u),d?(h=o[d],o[d]=u):(h=a,a=u),h&&h!==u){r.setEdge(h,u);return}u=d}})}return nx}var rx,HT;function BX(){if(HT)return rx;HT=1;var e=et(),t=IX(),n=OX(),r=$X(),s=qX(),o=FX(),a=Vn().Graph,c=Jt();rx=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){h(k%2?b:x,k%4>=2),w=c.buildLayerMatrix(g);var T=n(g,w);T<S&&(N=0,C=e.cloneDeep(w),S=T)}m(g,C)}function d(g,v,b){return e.map(v,function(x){return s(g,x,b)})}function h(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 rx}var sx,UT;function zX(){if(UT)return sx;UT=1;var e=et(),t=Vn().Graph,n=Jt();sx={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(T,R){var A=0,O=0,L=T.length,B=e.last(R);return e.forEach(R,function(I,$){var H=o(S,I),D=H?S.node(H).order:L;(H||I===B)&&(e.forEach(R.slice(O,$+1),function(V){e.forEach(S.predecessors(V),function(z){var Q=S.node(z),F=Q.order;(F<A||D<F)&&!(Q.dummy&&S.node(V).dummy)&&a(k,z,V)})}),O=$+1,A=D)}),R}return e.reduce(C,N),k}function s(S,C){var k={};function N(R,A,O,L,B){var I;e.forEach(e.range(A,O),function($){I=R[$],S.node(I).dummy&&e.forEach(S.predecessors(I),function(H){var D=S.node(H);D.dummy&&(D.order<L||D.order>B)&&a(k,H,I)})})}function T(R,A){var O=-1,L,B=0;return e.forEach(A,function(I,$){if(S.node(I).dummy==="border"){var H=S.predecessors(I);H.length&&(L=S.node(H[0]).order,N(A,B,$,O,L),B=$,O=L)}N(A,B,A.length,L,R.length)}),A}return e.reduce(C,T),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 T=S[C];T||(S[C]=T={}),T[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 T={},R={},A={};return e.forEach(C,function(O){e.forEach(O,function(L,B){T[L]=L,R[L]=L,A[L]=B})}),e.forEach(C,function(O){var L=-1;e.forEach(O,function(B){var I=N(B);if(I.length){I=e.sortBy(I,function(z){return A[z]});for(var $=(I.length-1)/2,H=Math.floor($),D=Math.ceil($);H<=D;++H){var V=I[H];R[B]===B&&L<A[V]&&!c(k,B,V)&&(R[V]=B,R[B]=T[B]=T[V],L=A[V])}}})}),{root:T,align:R}}function d(S,C,k,N,T){var R={},A=h(S,C,k,T),O=T?"borderLeft":"borderRight";function L($,H){for(var D=A.nodes(),V=D.pop(),z={};V;)z[V]?$(V):(z[V]=!0,D.push(V),D=D.concat(H(V))),V=D.pop()}function B($){R[$]=A.inEdges($).reduce(function(H,D){return Math.max(H,R[D.v]+A.edge(D))},0)}function I($){var H=A.outEdges($).reduce(function(V,z){return Math.min(V,R[z.w]-A.edge(z))},Number.POSITIVE_INFINITY),D=S.node($);H!==Number.POSITIVE_INFINITY&&D.borderType!==O&&(R[$]=Math.max(R[$],H))}return L(B,A.predecessors.bind(A)),L(I,A.successors.bind(A)),e.forEach(N,function($){R[$]=R[k[$]]}),R}function h(S,C,k,N){var T=new t,R=S.graph(),A=x(R.nodesep,R.edgesep,N);return e.forEach(C,function(O){var L;e.forEach(O,function(B){var I=k[B];if(T.setNode(I),L){var $=k[L],H=T.edge($,I);T.setEdge($,I,Math.max(A(S,B,L),H||0))}L=B})}),T}function m(S,C){return e.minBy(e.values(C),function(k){var N=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return e.forIn(k,function(R,A){var O=w(S,A)/2;N=Math.max(R+O,N),T=Math.min(R-O,T)}),N-T})}function g(S,C){var k=e.values(C),N=e.min(k),T=e.max(k);e.forEach(["u","d"],function(R){e.forEach(["l","r"],function(A){var O=R+A,L=S[O],B;if(L!==C){var I=e.values(L);B=A==="l"?N-e.min(I):T-e.max(I),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 T=e.sortBy(e.map(S,N));return(T[1]+T[2])/2})}function b(S){var C=n.buildLayerMatrix(S),k=e.merge(r(S,C),s(S,C)),N={},T;e.forEach(["u","d"],function(A){T=A==="u"?C:e.values(C).reverse(),e.forEach(["l","r"],function(O){O==="r"&&(T=e.map(T,function($){return e.values($).reverse()}));var L=(A==="u"?S.predecessors:S.successors).bind(S),B=u(S,T,k,L),I=d(S,T,B.root,B.align,O==="r");O==="r"&&(I=e.mapValues(I,function($){return-$})),N[A+O]=I})});var R=m(S,N);return g(N,R),v(N,S.graph().align)}function x(S,C,k){return function(N,T,R){var A=N.node(T),O=N.node(R),L=0,B;if(L+=A.width/2,e.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":B=-A.width/2;break;case"r":B=A.width/2;break}if(B&&(L+=k?B:-B),B=0,L+=(A.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 sx}var ix,WT;function VX(){if(WT)return ix;WT=1;var e=et(),t=Jt(),n=zX().positionX;ix=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 h=e.max(e.map(d,function(m){return o.node(m).height}));e.forEach(d,function(m){o.node(m).y=u+h/2}),u+=h+c})}return ix}var ox,KT;function HX(){if(KT)return ox;KT=1;var e=et(),t=NX(),n=CX(),r=jX(),s=Jt().normalizeRanks,o=TX(),a=Jt().removeEmptyRanks,c=AX(),u=RX(),d=MX(),h=BX(),m=VX(),g=Jt(),v=Vn().Graph;ox=b;function b(K,J){var G=J&&J.debugTiming?g.time:g.notime;G("layout",function(){var ee=G(" buildLayoutGraph",function(){return L(K)});G(" runLayout",function(){x(ee,G)}),G(" updateInputGraph",function(){w(K,ee)})})}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(){I(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(){H(K)}),J(" normalize.run",function(){n.run(K)}),J(" parentDummyChains",function(){o(K)}),J(" addBorderSegments",function(){u(K)}),J(" order",function(){h(K)}),J(" insertSelfEdges",function(){Y(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(G){var ee=K.node(G),te=J.node(G);ee&&(ee.x=te.x,ee.y=te.y,J.children(G).length&&(ee.width=te.width,ee.height=te.height))}),e.forEach(K.edges(),function(G){var ee=K.edge(G),te=J.edge(G);ee.points=te.points,e.has(te,"x")&&(ee.x=te.x,ee.y=te.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"],T={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],A={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}),G=ie(K.graph());return J.setGraph(e.merge({},C,W(G,S),e.pick(G,k))),e.forEach(K.nodes(),function(ee){var te=ie(K.node(ee));J.setNode(ee,e.defaults(W(te,N),T)),J.setParent(ee,K.parent(ee))}),e.forEach(K.edges(),function(ee){var te=ie(K.edge(ee));J.setEdge(ee,e.merge({},A,W(te,R),e.pick(te,O)))}),J}function B(K){var J=K.graph();J.ranksep/=2,e.forEach(K.edges(),function(G){var ee=K.edge(G);ee.minlen*=2,ee.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?ee.width+=ee.labeloffset:ee.height+=ee.labeloffset)})}function I(K){e.forEach(K.edges(),function(J){var G=K.edge(J);if(G.width&&G.height){var ee=K.node(J.v),te=K.node(J.w),oe={rank:(te.rank-ee.rank)/2+ee.rank,e:J};g.addDummyNode(K,"edge-proxy",oe,"_ep")}})}function $(K){var J=0;e.forEach(K.nodes(),function(G){var ee=K.node(G);ee.borderTop&&(ee.minRank=K.node(ee.borderTop).rank,ee.maxRank=K.node(ee.borderBottom).rank,J=e.max(J,ee.maxRank))}),K.graph().maxRank=J}function H(K){e.forEach(K.nodes(),function(J){var G=K.node(J);G.dummy==="edge-proxy"&&(K.edge(G.e).labelRank=G.rank,K.removeNode(J))})}function D(K){var J=Number.POSITIVE_INFINITY,G=0,ee=Number.POSITIVE_INFINITY,te=0,oe=K.graph(),de=oe.marginx||0,me=oe.marginy||0;function ye(he){var Se=he.x,xe=he.y,Ce=he.width,Ne=he.height;J=Math.min(J,Se-Ce/2),G=Math.max(G,Se+Ce/2),ee=Math.min(ee,xe-Ne/2),te=Math.max(te,xe+Ne/2)}e.forEach(K.nodes(),function(he){ye(K.node(he))}),e.forEach(K.edges(),function(he){var Se=K.edge(he);e.has(Se,"x")&&ye(Se)}),J-=de,ee-=me,e.forEach(K.nodes(),function(he){var Se=K.node(he);Se.x-=J,Se.y-=ee}),e.forEach(K.edges(),function(he){var Se=K.edge(he);e.forEach(Se.points,function(xe){xe.x-=J,xe.y-=ee}),e.has(Se,"x")&&(Se.x-=J),e.has(Se,"y")&&(Se.y-=ee)}),oe.width=G-J+de,oe.height=te-ee+me}function V(K){e.forEach(K.edges(),function(J){var G=K.edge(J),ee=K.node(J.v),te=K.node(J.w),oe,de;G.points?(oe=G.points[0],de=G.points[G.points.length-1]):(G.points=[],oe=te,de=ee),G.points.unshift(g.intersectRect(ee,oe)),G.points.push(g.intersectRect(te,de))})}function z(K){e.forEach(K.edges(),function(J){var G=K.edge(J);if(e.has(G,"x"))switch((G.labelpos==="l"||G.labelpos==="r")&&(G.width-=G.labeloffset),G.labelpos){case"l":G.x-=G.width/2+G.labeloffset;break;case"r":G.x+=G.width/2+G.labeloffset;break}})}function Q(K){e.forEach(K.edges(),function(J){var G=K.edge(J);G.reversed&&G.points.reverse()})}function F(K){e.forEach(K.nodes(),function(J){if(K.children(J).length){var G=K.node(J),ee=K.node(G.borderTop),te=K.node(G.borderBottom),oe=K.node(e.last(G.borderLeft)),de=K.node(e.last(G.borderRight));G.width=Math.abs(de.x-oe.x),G.height=Math.abs(te.y-ee.y),G.x=oe.x+G.width/2,G.y=ee.y+G.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 G=K.node(J.v);G.selfEdges||(G.selfEdges=[]),G.selfEdges.push({e:J,label:K.edge(J)}),K.removeEdge(J)}})}function Y(K){var J=g.buildLayerMatrix(K);e.forEach(J,function(G){var ee=0;e.forEach(G,function(te,oe){var de=K.node(te);de.order=oe+ee,e.forEach(de.selfEdges,function(me){g.addDummyNode(K,"selfedge",{width:me.label.width,height:me.label.height,rank:de.rank,order:oe+ ++ee,e:me.e,label:me.label},"_se")}),delete de.selfEdges})})}function P(K){e.forEach(K.nodes(),function(J){var G=K.node(J);if(G.dummy==="selfedge"){var ee=K.node(G.e.v),te=ee.x+ee.width/2,oe=ee.y,de=G.x-te,me=ee.height/2;K.setEdge(G.e,G.label),K.removeNode(J),G.label.points=[{x:te+2*de/3,y:oe-me},{x:te+5*de/6,y:oe-me},{x:te+de,y:oe},{x:te+5*de/6,y:oe+me},{x:te+2*de/3,y:oe+me}],G.label.x=G.x,G.label.y=G.y}})}function W(K,J){return e.mapValues(e.pick(K,J),Number)}function ie(K){var J={};return e.forEach(K,function(G,ee){J[ee.toLowerCase()]=G}),J}return ox}var ax,GT;function UX(){if(GT)return ax;GT=1;var e=et(),t=Jt(),n=Vn().Graph;ax={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(h,m){return a.setEdge(h,m,{style:"invis"}),m})}),a}return ax}var lx,YT;function WX(){return YT||(YT=1,lx="0.8.5"),lx}var cx,XT;function KX(){return XT||(XT=1,cx={graphlib:Vn(),layout:HX(),debug:UX(),util:{time:Jt().time,notime:Jt().notime},version:WX()}),cx}var GX=KX();const QT=hl(GX);function mL(){const{nodes:e,edges:t,setNodes:n,setEdges:r,updateNodeData:s,clearCanvas:o}=ho(),a=yo(),c=j.useMemo(()=>e.filter(I=>I.selected),[e]),u=j.useMemo(()=>t.filter(I=>I.selected),[t]),d=j.useCallback(I=>e.find($=>$.id===I),[e]),h=j.useCallback(I=>t.find($=>$.id===I),[t]),m=j.useCallback(I=>{n([...e,I])},[e,n]),g=j.useCallback(I=>{n(e.filter($=>$.id!==I)),r(t.filter($=>$.source!==I&&$.target!==I))},[e,t,n,r]),v=j.useCallback(()=>{const I=[],$=new Map;for(const D of c){const V=`${D.id}-copy-${Date.now()}`;$.set(D.id,V),I.push({...D,id:V,position:{x:D.position.x+50,y:D.position.y+50},selected:!1,data:{...D.data,id:V}})}n([...e,...I]);const H=[];for(const D of t)$.has(D.source)&&$.has(D.target)&&H.push({...D,id:`${D.id}-copy-${Date.now()}`,source:$.get(D.source),target:$.get(D.target)});H.length>0&&r([...t,...H])},[c,e,t,n,r]),b=j.useCallback(()=>{const I=new Set(c.map(H=>H.id)),$=new Set(u.map(H=>H.id));n(e.filter(H=>!I.has(H.id))),r(t.filter(H=>!$.has(H.id)&&!I.has(H.source)&&!I.has(H.target)))},[c,u,e,t,n,r]),x=j.useCallback(()=>{const I=new QT.graphlib.Graph;I.setDefaultEdgeLabel(()=>({})),I.setGraph({rankdir:"TB",nodesep:50,ranksep:80});for(const H of e)I.setNode(H.id,{width:200,height:100});for(const H of t)I.setEdge(H.source,H.target);QT.layout(I);const $=e.map(H=>{const D=I.node(H.id);return{...H,position:{x:D.x-100,y:D.y-50}}});n($),setTimeout(()=>{a.fitView({padding:.2})},50)},[e,t,n,a]),w=j.useCallback(()=>{a.fitView({padding:.2})},[a]),S=j.useCallback(I=>{const $=d(I);$&&a.setCenter($.position.x+100,$.position.y+50,{zoom:1.5,duration:300})},[d,a]),C=j.useCallback((I,$=!1)=>{n(e.map(H=>({...H,selected:$&&H.selected||H.id===I})))},[e,n]),k=j.useCallback(()=>{n(e.map(I=>({...I,selected:!1}))),r(t.map(I=>({...I,selected:!1})))},[e,t,n,r]),{undo:N,redo:T,canUndo:R,canRedo:A,copySelected:O,paste:L,canPaste:B}=ho();return{nodes:e,edges:t,selectedNodes:c,selectedEdges:u,getNode:d,getEdge:h,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:T,canUndo:R,canRedo:A,copySelected:O,paste:L,canPaste:B}}const YX={step:S6,subworkflow:N6,trigger:E6,output:T6,if:R6,for_each:I6,while:P6,switch:D6,parallel:q6,try:B6,map:Cp,filter:Cp,reduce:Cp};function XX(){const{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,setNodes:o}=ho(),{autoLayout:a,deleteSelected:c,duplicateSelected:u}=mL(),d=ys(G=>G.currentWorkflow),{screenToFlowPosition:h}=yo(),[m,g]=j.useState(null),[v,b]=j.useState(!1),[x,w]=j.useState(null),[S,C]=j.useState(!1),[k,N]=j.useState(null),T=j.useRef(null),R=j.useCallback((G,ee)=>{if(G.preventDefault(),ee.type==="trigger"||ee.type==="output")return;const te=d==null?void 0:d.steps.find(oe=>oe.id===ee.data.id);te&&(g(te),b(!0))},[d]),A=j.useCallback(()=>{if(!d)return null;const G=["step","if","for_each","while","switch","parallel","try","map","filter","reduce"],ee=e.find(te=>te.selected&&G.includes(te.type||""));return ee&&d.steps.find(te=>te.id===ee.data.id)||null},[d,e]),{undo:O,redo:L,canUndo:B,canRedo:I,copySelected:$,paste:H,canPaste:D}=ho(),V=j.useCallback(G=>{const ee=G.metaKey||G.ctrlKey;if((G.key==="Backspace"||G.key==="Delete")&&c(),ee&&G.key==="d"&&(G.preventDefault(),u()),ee&&G.key==="l"&&(G.preventDefault(),a()),ee&&G.key==="z"&&!G.shiftKey&&(G.preventDefault(),B()&&O()),(ee&&G.shiftKey&&G.key==="z"||ee&&G.key==="y")&&(G.preventDefault(),I()&&L()),ee&&G.key==="c"&&(G.preventDefault(),$()),ee&&G.key==="v"&&(G.preventDefault(),D()&&H()),G.key==="e"&&!ee&&!G.shiftKey&&!G.altKey){G.preventDefault();const te=A();te&&(g(te),b(!0))}if(G.key==="y"&&!ee&&!G.shiftKey&&!G.altKey){G.preventDefault();const te=A();te&&(w(te),C(!0))}},[c,u,a,A,O,L,B,I,$,H,D]),z=j.useCallback(G=>{console.log("Saving step:",G),b(!1),g(null)},[]),Q=j.useCallback(()=>{if(!k||!d)return;const G=d.steps.find(ee=>ee.id===k.data.id);G&&(g(G),b(!0)),N(null)},[k,d]),F=j.useCallback(()=>{if(!k||!d)return;const G=d.steps.find(ee=>ee.id===k.data.id);G&&(w(G),C(!0)),N(null)},[k,d]),q=j.useCallback(()=>{k&&u(),N(null)},[k,u]),Y=j.useCallback(()=>{k&&c(),N(null)},[k,c]),P=j.useCallback(()=>{k&&console.log("Execute step:",k.data.id),N(null)},[k]),W=j.useCallback((G,ee)=>{G.preventDefault(),["step","if","for_each","while","switch","parallel","try","map","filter","reduce","subworkflow"].includes(ee.type||"")&&N(ee)},[]),ie=j.useCallback(G=>{G.preventDefault(),G.dataTransfer.dropEffect="copy"},[]),K=j.useCallback(G=>{var te;G.preventDefault();const ee=G.dataTransfer.getData("application/marktoflow-tool");if(ee)try{const oe=JSON.parse(ee),de=h({x:G.clientX,y:G.clientY}),me=oe.id+"-"+Date.now().toString(36),ye={id:me,type:"step",position:de,data:{id:me,name:oe.name+" Action",action:oe.id+"."+(((te=oe.actions)==null?void 0:te[0])||"action"),status:"pending"}};o([...e,ye])}catch(oe){console.error("Failed to parse dropped tool data:",oe)}},[e,o,h]),J=j.useCallback(()=>{if(!d||!m)return[];const G=[];if(d.inputs)for(const te of Object.keys(d.inputs))G.push(`inputs.${te}`);const ee=d.steps.findIndex(te=>te.id===m.id);for(let te=0;te<ee;te++){const oe=d.steps[te];oe.outputVariable&&G.push(oe.outputVariable)}return G},[d,m]);return p.jsxs(CK,{children:[p.jsx(EK,{asChild:!0,children:p.jsx("div",{ref:T,className:"w-full h-full",onKeyDown:V,onDragOver:ie,onDrop:K,tabIndex:0,children:p.jsxs(JB,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,onNodeDoubleClick:R,onNodeContextMenu:W,nodeTypes:YX,fitView:!0,snapToGrid:!0,snapGrid:[16,16],defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},proOptions:{hideAttribution:!0},children:[p.jsx(rz,{variant:Ar.Dots,gap:24,size:1,color:"#3d3d5c"}),p.jsx(uz,{}),p.jsx(Sz,{nodeColor:G=>{var ee;switch((ee=G.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)"})]})})}),p.jsxs(mP,{children:[p.jsxs(Ui,{onClick:Q,children:[p.jsx(c6,{className:"w-4 h-4 mr-2"}),"Edit Step",p.jsx(Oa,{children:"E"})]}),p.jsxs(Ui,{onClick:F,children:[p.jsx(Nw,{className:"w-4 h-4 mr-2"}),"View YAML",p.jsx(Oa,{children:"Y"})]}),p.jsx(Xx,{}),p.jsxs(Ui,{onClick:P,children:[p.jsx(bl,{className:"w-4 h-4 mr-2"}),"Execute Step"]}),p.jsx(Xx,{}),p.jsxs(Ui,{onClick:q,children:[p.jsx(sl,{className:"w-4 h-4 mr-2"}),"Duplicate",p.jsx(Oa,{children:"⌘D"})]}),p.jsxs(Ui,{onClick:Y,destructive:!0,children:[p.jsx(xo,{className:"w-4 h-4 mr-2"}),"Delete",p.jsx(Oa,{children:"⌫"})]})]}),p.jsx(VU,{open:v,onOpenChange:b,step:m,onSave:z,availableVariables:J()}),p.jsx(Sl,{open:S,onOpenChange:C,title:`YAML: ${(x==null?void 0:x.name)||(x==null?void 0:x.id)}`,size:"lg",children:p.jsx("div",{className:"p-4",children:p.jsx($U,{value:x})})})]})}const gL=bs((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:[]})}));function QX({onAddStep:e,onExecute:t,onSave:n,isExecuting:r=!1}){const{autoLayout:s,fitView:o,selectedNodes:a,deleteSelected:c,duplicateSelected:u}=mL(),{undo:d,redo:h,undoStack:m,redoStack:g}=gL(),{zoomIn:v,zoomOut:b}=yo(),x=m.length>0,w=g.length>0,S=a.length>0;return p.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:[p.jsx(Pn,{icon:p.jsx(jd,{className:"w-4 h-4"}),label:"Add Step",onClick:e,shortcut:"N"}),p.jsx(Cu,{}),p.jsx(Pn,{icon:p.jsx(d6,{className:"w-4 h-4"}),label:"Undo",onClick:()=>d(),disabled:!x,shortcut:"⌘Z"}),p.jsx(Pn,{icon:p.jsx(r6,{className:"w-4 h-4"}),label:"Redo",onClick:()=>h(),disabled:!w,shortcut:"⌘⇧Z"}),p.jsx(Cu,{}),p.jsx(Pn,{icon:p.jsx(sl,{className:"w-4 h-4"}),label:"Duplicate",onClick:u,disabled:!S,shortcut:"⌘D"}),p.jsx(Pn,{icon:p.jsx(xo,{className:"w-4 h-4"}),label:"Delete",onClick:c,disabled:!S,shortcut:"⌫"}),p.jsx(Cu,{}),p.jsx(Pn,{icon:p.jsx(t6,{className:"w-4 h-4"}),label:"Auto Layout",onClick:s,shortcut:"⌘L"}),p.jsx(Pn,{icon:p.jsx(p6,{className:"w-4 h-4"}),label:"Zoom In",onClick:()=>v(),shortcut:"⌘+"}),p.jsx(Pn,{icon:p.jsx(m6,{className:"w-4 h-4"}),label:"Zoom Out",onClick:()=>b(),shortcut:"⌘-"}),p.jsx(Pn,{icon:p.jsx(Gz,{className:"w-4 h-4"}),label:"Fit View",onClick:o,shortcut:"⌘0"}),p.jsx(Cu,{}),t&&p.jsx(Pn,{icon:r?p.jsx(tM,{className:"w-4 h-4"}):p.jsx(bl,{className:"w-4 h-4"}),label:r?"Stop":"Execute",onClick:t,variant:r?"destructive":"primary",shortcut:"⌘⏎"}),n&&p.jsx(Pn,{icon:p.jsx(i6,{className:"w-4 h-4"}),label:"Save",onClick:n,shortcut:"⌘S"})]})}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 p.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,p.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&&p.jsx("span",{className:"ml-2 text-gray-400",children:s})]})]})}function Cu(){return p.jsx("div",{className:"w-px h-6 bg-node-border mx-1"})}function JX({isExecuting:e,isPaused:t,workflowStatus:n,currentStepId:r,steps:s,logs:o,onPause:a,onResume:c,onStop:u,onStepOver:d,onClose:h,debug:m,onToggleDebugMode:g,onToggleBreakpoint:v,onStepInto:b,onStepOut:x,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:C}){const[k,N]=j.useState("steps"),T=(m==null?void 0:m.enabled)??!1,R=s.filter(L=>L.status==="completed").length,A=s.filter(L=>L.status==="failed").length,O=s.length>0?R/s.length*100:0;return!e&&n==="pending"?null:p.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:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-node-border",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(rQ,{status:n}),p.jsxs("div",{children:[p.jsx("div",{className:"text-sm font-medium text-white",children:iQ(n)}),p.jsxs("div",{className:"text-xs text-gray-400",children:[R,"/",s.length," steps completed",A>0&&` • ${A} failed`]})]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[g&&p.jsx(Ye,{variant:T?"primary":"ghost",size:"sm",onClick:g,icon:p.jsx(Ek,{className:"w-4 h-4"}),title:T?"Disable debug mode":"Enable debug mode",children:"Debug"}),e&&p.jsxs(p.Fragment,{children:[t?p.jsx(Ye,{variant:"secondary",size:"sm",onClick:c,icon:p.jsx(bl,{className:"w-4 h-4"}),children:"Resume"}):p.jsx(Ye,{variant:"secondary",size:"sm",onClick:a,icon:p.jsx(tM,{className:"w-4 h-4"}),children:"Pause"}),T&&t&&p.jsxs(p.Fragment,{children:[p.jsx(Ye,{variant:"secondary",size:"sm",onClick:d,icon:p.jsx(tl,{className:"w-4 h-4"}),title:"Step Over (F10)",children:"Over"}),b&&p.jsx(Ye,{variant:"secondary",size:"sm",onClick:b,icon:p.jsx(Az,{className:"w-4 h-4"}),title:"Step Into (F11)",children:"Into"}),x&&p.jsx(Ye,{variant:"secondary",size:"sm",onClick:x,icon:p.jsx(Rz,{className:"w-4 h-4"}),title:"Step Out (Shift+F11)",children:"Out"})]}),!T&&p.jsx(Ye,{variant:"secondary",size:"sm",onClick:d,icon:p.jsx(rM,{className:"w-4 h-4"}),disabled:!t,children:"Step"}),p.jsx(Ye,{variant:"destructive",size:"sm",onClick:u,icon:p.jsx(sM,{className:"w-4 h-4"}),children:"Stop"})]}),!e&&p.jsx(Ye,{variant:"secondary",size:"sm",onClick:h,children:"Close"})]})]}),p.jsx("div",{className:"h-1 bg-node-bg",children:p.jsx("div",{className:`h-full transition-all duration-300 ${n==="failed"?"bg-error":n==="completed"?"bg-success":"bg-primary"}`,style:{width:`${O}%`}})}),p.jsxs("div",{className:"flex border-b border-node-border",children:[p.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"}),p.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"}),p.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"}),T&&p.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:[p.jsx(Ek,{className:"w-3 h-3"}),"Debug"]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[k==="steps"&&p.jsx(ZX,{steps:s,currentStepId:r,debugEnabled:T,breakpoints:m==null?void 0:m.breakpoints,onToggleBreakpoint:v}),k==="variables"&&p.jsx(tQ,{steps:s}),k==="logs"&&p.jsx(eQ,{logs:o}),k==="debug"&&T&&p.jsx(oQ,{debug:m,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:C})]})]})}function ZX({steps:e,currentStepId:t,debugEnabled:n,breakpoints:r,onToggleBreakpoint:s}){return p.jsx("div",{className:"space-y-2",children:e.map(o=>{const a=r==null?void 0:r.has(o.stepId);return p.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&&p.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&&p.jsx(Rx,{className:"w-2 h-2 fill-current text-white"})}),p.jsx(sQ,{status:o.status}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-medium text-white truncate",children:o.stepName||o.stepId}),o.error&&p.jsx("div",{className:"text-xs text-error mt-1 truncate",children:o.error})]}),o.duration!==void 0&&p.jsxs("div",{className:"text-xs text-gray-400",children:[o.duration,"ms"]})]},o.stepId)})})}function eQ({logs:e}){return p.jsx("div",{className:"font-mono text-xs space-y-1",children:e.length===0?p.jsx("div",{className:"text-gray-500",children:"No logs yet..."}):e.map((t,n)=>p.jsx("div",{className:"text-gray-300",children:t},n))})}function tQ({steps:e}){const[t,n]=j.useState(new Set),[r,s]=j.useState(null),o=e.filter(u=>u.output!==void 0&&u.outputVariable),a=u=>{n(d=>{const h=new Set(d);return h.has(u)?h.delete(u):h.add(u),h})},c=async(u,d)=>{try{const h=typeof d=="string"?d:JSON.stringify(d,null,2);await navigator.clipboard.writeText(h),s(u),setTimeout(()=>s(null),2e3)}catch(h){console.error("Failed to copy:",h)}};return o.length===0?p.jsxs("div",{className:"text-center py-8 text-gray-500 text-sm",children:["No variables available yet.",p.jsx("br",{}),p.jsx("span",{className:"text-xs",children:"Variables will appear as steps complete."})]}):p.jsx("div",{className:"space-y-2",children:o.map(u=>{const d=t.has(u.stepId);return p.jsxs("div",{className:"border border-node-border rounded-lg overflow-hidden",children:[p.jsxs("button",{onClick:()=>a(u.stepId),className:"w-full flex items-center gap-2 px-3 py-2 bg-node-bg hover:bg-white/5 transition-colors",children:[d?p.jsx(rl,{className:"w-4 h-4 text-gray-400"}):p.jsx(_n,{className:"w-4 h-4 text-gray-400"}),p.jsx("code",{className:"text-sm text-primary font-mono",children:u.outputVariable}),p.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:nQ(u.output)})]}),d&&p.jsx("div",{className:"p-3 bg-panel-bg border-t border-node-border",children:p.jsxs("div",{className:"flex items-start gap-2",children:[p.jsx("div",{className:"flex-1 overflow-x-auto",children:p.jsx(Qx,{value:u.output,onCopy:(h,m)=>c(h,m),copiedKey:r,path:u.outputVariable||""})}),p.jsx("button",{onClick:()=>c(u.outputVariable||"",u.output),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy entire value",children:r===u.outputVariable?p.jsx(nl,{className:"w-4 h-4 text-success"}):p.jsx(sl,{className:"w-4 h-4 text-gray-400"})})]})})]},u.stepId)})})}function Qx({value:e,onCopy:t,copiedKey:n,path:r,depth:s=0}){const[o,a]=j.useState(s<2);if(e===null)return p.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"null"});if(e===void 0)return p.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"undefined"});if(typeof e=="boolean")return p.jsx("span",{className:`font-mono text-xs ${e?"text-success":"text-error"}`,children:String(e)});if(typeof e=="number")return p.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 p.jsxs("span",{className:"text-success font-mono text-xs",children:['"',c,'"']})}if(Array.isArray(e))return e.length===0?p.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"[]"}):p.jsxs("div",{className:"space-y-1",children:[p.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?p.jsx(rl,{className:"w-3 h-3"}):p.jsx(_n,{className:"w-3 h-3"}),p.jsxs("span",{className:"text-xs font-mono",children:["Array(",e.length,")"]})]}),o&&p.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[e.slice(0,20).map((c,u)=>p.jsxs("div",{className:"flex items-start gap-2",children:[p.jsxs("span",{className:"text-gray-500 font-mono text-xs",children:["[",u,"]:"]}),p.jsx(Qx,{value:c,onCopy:t,copiedKey:n,path:`${r}[${u}]`,depth:s+1})]},u)),e.length>20&&p.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?p.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"{}"}):p.jsxs("div",{className:"space-y-1",children:[p.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?p.jsx(rl,{className:"w-3 h-3"}):p.jsx(_n,{className:"w-3 h-3"}),p.jsxs("span",{className:"text-xs font-mono",children:["Object(",c.length," keys)"]})]}),o&&p.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[c.slice(0,30).map(([u,d])=>p.jsxs("div",{className:"flex items-start gap-2",children:[p.jsxs("span",{className:"text-primary font-mono text-xs",children:[u,":"]}),p.jsx(Qx,{value:d,onCopy:t,copiedKey:n,path:`${r}.${u}`,depth:s+1})]},u)),c.length>30&&p.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",c.length-30," more keys"]})]})]})}return p.jsx("span",{className:"text-gray-400 font-mono text-xs",children:String(e)})}function nQ(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?`array[${e.length}]`:typeof e=="object"?"object":typeof e}function rQ({status:e}){switch(e){case"running":return p.jsx(vo,{className:"w-5 h-5 text-primary animate-spin"});case"completed":return p.jsx(dn,{className:"w-5 h-5 text-success"});case"failed":return p.jsx(dt,{className:"w-5 h-5 text-error"});case"cancelled":return p.jsx(sM,{className:"w-5 h-5 text-gray-400"});default:return p.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-500"})}}function sQ({status:e}){switch(e){case"running":return p.jsx(vo,{className:"w-4 h-4 text-warning animate-spin"});case"completed":return p.jsx(dn,{className:"w-4 h-4 text-success"});case"failed":return p.jsx(dt,{className:"w-4 h-4 text-error"});case"skipped":return p.jsx(rM,{className:"w-4 h-4 text-gray-400"});default:return p.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-500"})}}function iQ(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 oQ({debug:e,onClearBreakpoints:t,onAddWatchExpression:n,onRemoveWatchExpression:r}){const[s,o]=j.useState(""),a=()=>{s.trim()&&n&&(n(s.trim()),o(""))};return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("h4",{className:"text-sm font-medium text-white flex items-center gap-2",children:[p.jsx(Rx,{className:"w-3 h-3 text-error"}),"Breakpoints (",e.breakpoints.size,")"]}),e.breakpoints.size>0&&t&&p.jsxs("button",{onClick:t,className:"text-xs text-gray-400 hover:text-white flex items-center gap-1",children:[p.jsx(xo,{className:"w-3 h-3"}),"Clear all"]})]}),p.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.breakpoints.size===0?p.jsx("div",{className:"text-xs text-gray-500",children:"No breakpoints set. Click the dot next to a step to add one."}):p.jsx("div",{className:"space-y-1",children:Array.from(e.breakpoints).map(c=>p.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-300",children:[p.jsx(Rx,{className:"w-2 h-2 fill-current text-error"}),p.jsx("span",{className:"font-mono",children:c})]},c))})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-sm font-medium text-white",children:"Call Stack"}),p.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.callStack.length===0?p.jsx("div",{className:"text-xs text-gray-500",children:"No active call stack"}):p.jsx("div",{className:"space-y-1",children:e.callStack.map((c,u)=>p.jsxs("div",{className:`flex items-center gap-2 text-xs ${u===0?"text-primary":"text-gray-400"}`,children:[p.jsx(tl,{className:"w-3 h-3"}),p.jsx("span",{className:"font-mono",children:c})]},u))})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-sm font-medium text-white",children:"Watch Expressions"}),p.jsxs("div",{className:"bg-node-bg rounded-lg p-3 space-y-2",children:[n&&p.jsxs("div",{className:"flex items-center gap-2",children:[p.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"}),p.jsx("button",{onClick:a,disabled:!s.trim(),className:"p-1 text-gray-400 hover:text-white disabled:opacity-50",children:p.jsx(jd,{className:"w-4 h-4"})})]}),e.watchExpressions.length===0?p.jsx("div",{className:"text-xs text-gray-500",children:"No watch expressions. Add an expression to monitor its value."}):p.jsx("div",{className:"space-y-1",children:e.watchExpressions.map(c=>p.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs group",children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("span",{className:"text-primary font-mono truncate",children:c}),p.jsx("span",{className:"text-gray-500",children:"="}),p.jsx("span",{className:"text-gray-300 font-mono truncate",children:"(not evaluated)"})]}),r&&p.jsx("button",{onClick:()=>r(c),className:"p-1 text-gray-500 hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",children:p.jsx(_l,{className:"w-3 h-3"})})]},c))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-sm font-medium text-white",children:"Debug State"}),p.jsxs("div",{className:"bg-node-bg rounded-lg p-3 text-xs space-y-1",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-gray-400",children:"Current Step:"}),p.jsx("span",{className:"text-white font-mono",children:e.currentStepId||"(none)"})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-gray-400",children:"Paused at Breakpoint:"}),p.jsx("span",{className:e.pausedAtBreakpoint?"text-error":"text-gray-500",children:e.pausedAtBreakpoint?"Yes":"No"})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-gray-400",children:"Step Over Pending:"}),p.jsx("span",{className:e.stepOverPending?"text-warning":"text-gray-500",children:e.stepOverPending?"Yes":"No"})]})]})]})]})}function aQ(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 Jx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Jx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Jx(r)(n)}}}},lQ=(e,t)=>(n,r,s)=>{let o={storage:aQ(()=>localStorage),partialize:w=>w,version:0,merge:(w,S)=>({...S,...w}),...t},a=!1,c=0;const u=new Set,d=new Set;let h=o.storage;if(!h)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 h.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(!h)return;const C=++c;a=!1,u.forEach(N=>{var T;return N((T=r())!=null?T:v)});const k=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(w=r())!=null?w:v))||void 0;return Jx(h.getItem.bind(h))(o.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==o.version){if(o.migrate){const T=o.migrate(N.state,N.version);return T instanceof Promise?T.then(R=>[!0,R]):[!0,T]}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 T;if(C!==c)return;const[R,A]=N;if(b=o.merge(A,(T=r())!=null?T:v),n(b,!0),R)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&&(h=w.storage)},clearStorage:()=>{h==null||h.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},yL=lQ,JT={tablet:768,desktop:1024};function cQ(e){return e>=JT.desktop?"desktop":e>=JT.tablet?"tablet":"mobile"}const Db=bs()(yL((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 uQ(){const[e,t]=j.useState("workflows"),{workflows:n,selectedWorkflow:r,selectWorkflow:s}=ys(),{resetNavigation:o}=jw(),{sidebarOpen:a,setSidebarOpen:c,breakpoint:u}=Db(),d=j.useCallback(h=>{o(),s(h),u==="mobile"&&c(!1)},[o,s,u,c]);return!a&&u!=="mobile"?p.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:[p.jsx(_n,{className:"w-4 h-4 text-gray-400"}),p.jsx(eM,{className:"w-5 h-5 text-primary"})]}):u==="mobile"?a?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>c(!1)}),p.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:p.jsx(ZT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:d,onClose:()=>c(!1),showClose:!0})})]}):null:p.jsx("div",{className:"w-64 bg-panel-bg border-r border-node-border flex flex-col",children:p.jsx(ZT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:d,onClose:()=>c(!1),showClose:u==="tablet"})})}function ZT({activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:s,onClose:o,showClose:a}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"p-4 border-b border-node-border flex items-center justify-between",children:[p.jsxs("h1",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[p.jsx(eM,{className:"w-5 h-5 text-primary"}),"Marktoflow"]}),a&&p.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:p.jsx(_l,{className:"w-4 h-4 text-gray-400"})})]}),p.jsxs("div",{className:"flex border-b border-node-border",children:[p.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"}),p.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"})]}),p.jsx("div",{className:"p-3 border-b border-node-border",children:p.jsxs("div",{className:"relative",children:[p.jsx(Ox,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),p.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"})]})}),p.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:e==="workflows"?p.jsx(dQ,{workflows:n,selectedWorkflow:r,onSelect:s}):p.jsx(hQ,{})}),e==="workflows"&&p.jsx("div",{className:"p-3 border-t border-node-border",children:p.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:[p.jsx(jd,{className:"w-4 h-4"}),"New Workflow"]})})]})}function dQ({workflows:e,selectedWorkflow:t,onSelect:n}){return e.length===0?p.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No workflows found"}):p.jsx("div",{className:"space-y-1",children:e.map(r=>p.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:[p.jsx(Mx,{className:"w-4 h-4 flex-shrink-0"}),p.jsx("span",{className:"text-sm truncate",children:r.name}),p.jsx(_n,{className:"w-4 h-4 ml-auto flex-shrink-0 opacity-50"})]},r.path))})}const fQ=[{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 hQ(){const[e,t]=j.useState(fQ),[n,r]=j.useState(!0),[s,o]=j.useState("");j.useEffect(()=>{async function d(){try{const h=await fetch("/api/tools");if(h.ok){const m=await h.json();t(m.tools)}}catch(h){console.error("Failed to fetch tools:",h)}finally{r(!1)}}d()},[]);const a=s?e.filter(d=>{var h;return d.name.toLowerCase().includes(s.toLowerCase())||d.category.toLowerCase().includes(s.toLowerCase())||((h=d.description)==null?void 0:h.toLowerCase().includes(s.toLowerCase()))}):e,c=[...new Set(a.map(d=>d.category))],u=(d,h)=>{d.dataTransfer.setData("application/marktoflow-tool",JSON.stringify(h)),d.dataTransfer.effectAllowed="copy"};return n?p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx(vo,{className:"w-5 h-5 text-gray-500 animate-spin"})}):p.jsxs("div",{className:"space-y-4",children:[c.map(d=>p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider px-2 mb-2",children:d}),p.jsx("div",{className:"space-y-1",children:a.filter(h=>h.category===d).map(h=>p.jsxs("div",{draggable:!0,onDragStart:m=>u(m,h),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:h.description||(h.sdk?"SDK: "+h.sdk:void 0),children:[p.jsx("span",{className:"text-lg",children:h.icon}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("span",{className:"text-sm block truncate",children:h.name}),h.actionCount!==void 0&&p.jsxs("span",{className:"text-xs text-gray-500",children:[h.actionCount," actions"]})]})]},h.id))})]},d)),a.length===0&&p.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No tools found"})]})}const eA={enabled:!1,breakpoints:new Set,currentStepId:null,pausedAtBreakpoint:!1,stepOverPending:!1,watchExpressions:[],callStack:[]},vL=bs((e,t)=>({runs:[],currentRunId:null,isExecuting:!1,isPaused:!1,debug:eA,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)=>{const{debug:u}=t(),d=u.enabled&&s==="running"&&u.breakpoints.has(r);e({runs:t().runs.map(h=>{if(h.id!==n)return h;const m=h.steps.find(v=>v.stepId===r),g=new Date().toISOString();return m?{...h,steps:h.steps.map(v=>{if(v.stepId!==r)return v;const b=s!=="running"?g:void 0,x=b&&v.startTime?new Date(b).getTime()-new Date(v.startTime).getTime():void 0;return{...v,status:s,endTime:b,duration:x,output:o??v.output,outputVariable:c??v.outputVariable,error:a??v.error}})}:{...h,steps:[...h.steps,{stepId:r,stepName:r,status:s,startTime:g,output:o,outputVariable:c,error:a}]}}),...d?{isPaused:!0,debug:{...t().debug,currentStepId:r,pausedAtBreakpoint:!0,stepOverPending:!1}}:{debug:{...t().debug,currentStepId:s==="running"?r:t().debug.currentStepId}}}),d&&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:{...eA,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}})}}));function Zx(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 pQ(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 mQ(){const[e,t]=j.useState("properties"),n=ho(u=>u.nodes),r=j.useMemo(()=>n.filter(u=>u.selected),[n]),s=ys(u=>u.currentWorkflow),{propertiesPanelOpen:o,setPropertiesPanelOpen:a,breakpoint:c}=Db();return c==="mobile"?o?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:()=>a(!1)}),p.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:p.jsx(tA,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:!0})})]}):null:o?p.jsx("div",{className:"w-80 bg-panel-bg border-l border-node-border flex flex-col",children:p.jsx(tA,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,onClose:()=>a(!1),showClose:c==="tablet"})}):p.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:[p.jsx(Mz,{className:"w-4 h-4 text-gray-400"}),p.jsx(Ew,{className:"w-5 h-5 text-gray-400"})]})}function tA({activeTab:e,setActiveTab:t,selectedNodes:n,workflow:r,onClose:s,showClose:o}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-node-border",children:[p.jsx("h2",{className:"text-sm font-medium text-white",children:"Properties"}),o&&p.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:p.jsx(_l,{className:"w-4 h-4 text-gray-400"})})]}),p.jsxs("div",{className:"flex border-b border-node-border",children:[p.jsx(ux,{active:e==="properties",onClick:()=>t("properties"),icon:p.jsx(Ew,{className:"w-4 h-4"}),label:"Properties"}),p.jsx(ux,{active:e==="variables",onClick:()=>t("variables"),icon:p.jsx(Td,{className:"w-4 h-4"}),label:"Variables"}),p.jsx(ux,{active:e==="history",onClick:()=>t("history"),icon:p.jsx(Cw,{className:"w-4 h-4"}),label:"History"})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="properties"&&p.jsx(gQ,{selectedNodes:n,workflow:r}),e==="variables"&&p.jsx(yQ,{}),e==="history"&&p.jsx(vQ,{})]})]})}function ux({active:e,onClick:t,icon:n,label:r}){return p.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 gQ({selectedNodes:e,workflow:t}){var n,r,s,o,a,c,u,d,h,m,g,v,b,x,w;if(e.length===0)return p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsx(Hi,{title:"Workflow",children:t?p.jsxs("div",{className:"space-y-3",children:[p.jsx(us,{label:"Name",value:((n=t.metadata)==null?void 0:n.name)||"Untitled"}),p.jsx(us,{label:"Version",value:((r=t.metadata)==null?void 0:r.version)||"1.0.0"}),p.jsx(us,{label:"Author",value:((s=t.metadata)==null?void 0:s.author)||"Unknown"}),p.jsx(us,{label:"Steps",value:`${((o=t.steps)==null?void 0:o.length)||0} steps`})]}):p.jsx("div",{className:"text-sm text-gray-500",children:"No workflow loaded"})}),((a=t==null?void 0:t.metadata)==null?void 0:a.description)&&p.jsx(Hi,{title:"Description",children:p.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&&p.jsx(Hi,{title:"Tags",children:p.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.metadata.tags.map(S=>p.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 p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsx(Hi,{title:"Step",children:p.jsxs("div",{className:"space-y-3",children:[p.jsx(us,{label:"ID",value:((u=S.data)==null?void 0:u.id)||S.id}),p.jsx(us,{label:"Name",value:((d=S.data)==null?void 0:d.name)||"(unnamed)"}),p.jsx(us,{label:"Action",value:((h=S.data)==null?void 0:h.action)||((m=S.data)==null?void 0:m.workflowPath)||"-"}),p.jsx(us,{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)&&p.jsx(Hi,{title:"Error",children:p.jsx("div",{className:"p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono",children:S.data.error})}),p.jsx(Hi,{title:"Actions",children:p.jsxs("div",{className:"flex gap-2",children:[p.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"}),p.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 p.jsx("div",{className:"p-4",children:p.jsxs("div",{className:"text-sm text-gray-400",children:[e.length," nodes selected"]})})}function yQ(){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 p.jsx("div",{className:"p-4 space-y-2",children:e.map(t=>p.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-xs font-mono text-primary",children:t.name}),p.jsx("span",{className:"text-xs text-gray-500",children:t.type})]}),p.jsx("div",{className:"text-sm text-gray-300 font-mono truncate",children:t.value})]},t.name))})}function vQ(){const{runs:e,clearHistory:t}=vL(),[n,r]=j.useState(null);return n?p.jsx(xQ,{run:n,onBack:()=>r(null)}):e.length===0?p.jsxs("div",{className:"p-4 text-center",children:[p.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-node-bg flex items-center justify-center",children:p.jsx(Cw,{className:"w-6 h-6 text-gray-500"})}),p.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"No execution history"}),p.jsx("p",{className:"text-xs text-gray-500",children:"Run a workflow to see execution history here"})]}):p.jsxs("div",{className:"flex flex-col h-full",children:[p.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map(s=>p.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:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-xs font-medium text-white truncate max-w-[140px]",children:s.workflowName}),p.jsx(xL,{status:s.status})]}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[p.jsx("span",{children:s.duration?Zx(s.duration):"-"}),p.jsx("span",{children:pQ(s.startTime)})]}),s.steps.length>0&&p.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[s.steps.slice(0,5).map(o=>p.jsx(bQ,{status:o.status},o.stepId)),s.steps.length>5&&p.jsxs("span",{className:"text-xs text-gray-500",children:["+",s.steps.length-5]})]})]},s.id))}),e.length>0&&p.jsx("div",{className:"p-3 border-t border-node-border",children:p.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:[p.jsx(xo,{className:"w-3.5 h-3.5"}),"Clear History"]})})]})}function xQ({run:e,onBack:t}){const[n,r]=j.useState(!1);return p.jsxs("div",{className:"flex flex-col h-full",children:[p.jsxs("div",{className:"p-3 border-b border-node-border",children:[p.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-gray-400 hover:text-white mb-2",children:[p.jsx(_n,{className:"w-3 h-3 rotate-180"}),"Back to history"]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm font-medium text-white truncate max-w-[180px]",children:e.workflowName}),p.jsx(xL,{status:e.status})]}),p.jsxs("div",{className:"flex items-center justify-between mt-1 text-xs text-gray-400",children:[p.jsx("span",{children:e.duration?Zx(e.duration):"Running..."}),p.jsx("span",{children:new Date(e.startTime).toLocaleString()})]})]}),p.jsxs("div",{className:"flex border-b border-node-border",children:[p.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,")"]}),p.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,")"]})]}),p.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?p.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.logs.map((s,o)=>p.jsx("div",{className:"text-gray-300 break-words",children:s},o))}):p.jsx("div",{className:"space-y-2",children:e.steps.map(s=>p.jsxs("div",{className:"p-2 bg-node-bg rounded border border-node-border",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-xs font-medium text-white truncate",children:s.stepName}),p.jsx(wQ,{status:s.status})]}),s.duration&&p.jsx("div",{className:"text-xs text-gray-500 mt-1",children:Zx(s.duration)}),s.error&&p.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 xL({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning",icon:vo},completed:{bg:"bg-success/10",text:"text-success",icon:dn},failed:{bg:"bg-error/10",text:"text-error",icon:dt},cancelled:{bg:"bg-gray-500/10",text:"text-gray-400",icon:dt},pending:{bg:"bg-gray-500/10",text:"text-gray-400",icon:Un}},{bg:n,text:r,icon:s}=t[e]||t.pending;return p.jsxs("span",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${n} ${r}`,children:[p.jsx(s,{className:`w-3 h-3 ${e==="running"?"animate-spin":""}`}),e]})}function wQ({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 p.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n} ${r}`,children:e})}function bQ({status:e}){const t={running:"bg-warning",completed:"bg-success",failed:"bg-error",pending:"bg-gray-500"};return p.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]||t.pending} ${e==="running"?"animate-pulse":""}`,title:e})}function Hi({title:e,children:t}){return p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-2",children:e}),t]})}function us({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 p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-xs text-gray-400",children:e}),n?p.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s[r]}`,children:t}):p.jsx("span",{className:"text-sm text-gray-200 font-mono truncate max-w-[180px]",children:t})]})}const $b=bs((e,t)=>({isProcessing:!1,history:[],lastError:null,pendingChanges:null,sendPrompt:async n=>{e({isProcessing:!0,lastError:null});const r=ys.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&&(ys.getState().saveWorkflow(n),e({pendingChanges:null}))},rejectChanges:()=>{e({pendingChanges:null})},clearHistory:()=>{e({history:[]})}}));function _Q({onSelectPrompt:e}){const[t,n]=j.useState(!1),[r,s]=j.useState(null),[o,a]=j.useState(null),{history:c,clearHistory:u,sendPrompt:d,isProcessing:h}=$b(),m=async b=>{h||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:p.jsxs("div",{className:"border-t border-node-border",children:[p.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:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Cw,{className:"w-4 h-4 text-gray-400"}),p.jsx("span",{className:"text-sm text-gray-300",children:"Prompt History"}),p.jsxs("span",{className:"text-xs text-gray-500",children:["(",c.length,")"]})]}),t?p.jsx(rl,{className:"w-4 h-4 text-gray-400"}):p.jsx(Iz,{className:"w-4 h-4 text-gray-400"})]}),t&&p.jsxs("div",{className:"bg-panel-bg",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-node-border",children:[p.jsxs("span",{className:"text-xs text-gray-500",children:[c.filter(b=>b.success).length," successful,"," ",c.filter(b=>!b.success).length," failed"]}),p.jsx(Ye,{variant:"ghost",size:"sm",onClick:u,icon:p.jsx(xo,{className:"w-3 h-3"}),children:"Clear"})]}),p.jsx("div",{className:"max-h-64 overflow-y-auto",children:c.map((b,x)=>{const w=`${x}-${b.timestamp}`,S=r===b;return p.jsxs("div",{className:"border-b border-node-border last:border-b-0",children:[p.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?p.jsx(dn,{className:"w-4 h-4 text-success flex-shrink-0 mt-0.5"}):p.jsx(dt,{className:"w-4 h-4 text-error flex-shrink-0 mt-0.5"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-gray-300 line-clamp-2",children:b.prompt}),p.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[p.jsx(Un,{className:"w-3 h-3 text-gray-500"}),p.jsx("span",{className:"text-xs text-gray-500",children:v(b.timestamp)})]})]}),p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[p.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?p.jsx(nl,{className:"w-3.5 h-3.5 text-success"}):p.jsx(sl,{className:"w-3.5 h-3.5 text-gray-400"})}),p.jsx("button",{onClick:C=>{C.stopPropagation(),m(b.prompt)},disabled:h,className:"p-1.5 hover:bg-white/10 rounded transition-colors disabled:opacity-50",title:"Re-run prompt",children:p.jsx(s6,{className:`w-3.5 h-3.5 text-gray-400 ${h?"animate-spin":""}`})}),e&&p.jsx("button",{onClick:C=>{C.stopPropagation(),e(b.prompt)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Edit prompt",children:p.jsx("span",{className:"text-xs text-gray-400",children:"Edit"})})]})]}),S&&p.jsx("div",{className:"px-4 pb-3 pl-11",children:p.jsxs("div",{className:"bg-node-bg rounded-lg p-3",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase",children:"Response"}),p.jsx("button",{onClick:()=>g(b.response,`${w}-response`),className:"p-1 hover:bg-white/10 rounded transition-colors",children:o===`${w}-response`?p.jsx(nl,{className:"w-3 h-3 text-success"}):p.jsx(sl,{className:"w-3 h-3 text-gray-400"})})]}),p.jsx("div",{className:`text-xs font-mono ${b.success?"text-gray-300":"text-error"}`,children:b.response||"No response"})]})})]},w)})})]})]})}function SQ(){const[e,t]=j.useState(""),n=j.useRef(null),{isProcessing:r,history:s,sendPrompt:o}=$b();j.useEffect(()=>{n.current&&(n.current.style.height="auto",n.current.style.height=`${Math.min(n.current.scrollHeight,200)}px`)},[e]);const a=async()=>{!e.trim()||r||(await o(e),t(""))},c=d=>{d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),a()),d.key==="ArrowUp"&&!e&&s.length>0&&t(s[0].prompt)},u=["Add a Slack notification step","Add error handling with 3 retries","Convert to a sub-workflow","Add a condition to skip if draft"];return p.jsxs("div",{className:"bg-panel-bg",children:[p.jsx(_Q,{onSelectPrompt:t}),!e&&!r&&p.jsx("div",{className:"px-4 py-2 border-t border-node-border/50",children:p.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",children:[p.jsx(a6,{className:"w-4 h-4 text-primary flex-shrink-0"}),u.map(d=>p.jsx("button",{onClick:()=>t(d),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:d},d))]})}),p.jsxs("div",{className:"p-4 flex items-end gap-3 border-t border-node-border",children:[p.jsxs("div",{className:"flex-1 relative",children:[p.jsx("textarea",{ref:n,value:e,onChange:d=>t(d.target.value),onKeyDown:c,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&&p.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:p.jsx(vo,{className:"w-5 h-5 text-primary animate-spin"})})]}),p.jsx("button",{onClick:a,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:p.jsx(nM,{className:"w-5 h-5 text-white"})})]}),p.jsxs("div",{className:"px-4 pb-2 text-xs text-gray-500",children:["Press ",p.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"⌘"})," +"," ",p.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"Enter"})," to send",s.length>0&&p.jsxs("span",{className:"ml-4",children:[p.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"↑"})," for last prompt"]})]})]})}function kQ({open:e,onOpenChange:t,originalWorkflow:n,modifiedWorkflow:r,explanation:s,onAccept:o,onReject:a}){const[c,u]=j.useState("explanation"),d=n?ld(n,{indent:2}):"",h=r?ld(r,{indent:2}):"",m=()=>{o(),t(!1)},g=()=>{a(),t(!1)};return p.jsxs(Sl,{open:e,onOpenChange:t,title:"Review Changes",description:"The AI has suggested the following changes to your workflow",size:"xl",children:[p.jsxs(lI,{value:c,onValueChange:u,children:[p.jsxs(Bw,{children:[p.jsxs(nr,{value:"explanation",children:[p.jsx(qz,{className:"w-4 h-4 mr-1.5"}),"Explanation"]}),p.jsxs(nr,{value:"diff",children:[p.jsx(Vz,{className:"w-4 h-4 mr-1.5"}),"Side by Side"]}),p.jsxs(nr,{value:"modified",children:[p.jsx(Nw,{className:"w-4 h-4 mr-1.5"}),"Modified YAML"]})]}),p.jsxs("div",{className:"p-4",children:[p.jsx(rr,{value:"explanation",children:p.jsxs("div",{className:"prose prose-invert max-w-none",children:[p.jsx("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:p.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:s})}),r&&p.jsxs("div",{className:"mt-4",children:[p.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Changes Summary"}),p.jsx("ul",{className:"space-y-2",children:NQ(n,r).map((v,b)=>p.jsxs("li",{className:`flex items-start gap-2 text-sm ${v.type==="added"?"text-success":v.type==="removed"?"text-error":"text-warning"}`,children:[p.jsx("span",{className:"flex-shrink-0",children:v.type==="added"?"+":v.type==="removed"?"-":"~"}),p.jsx("span",{children:v.description})]},b))})]})]})}),p.jsx(rr,{value:"diff",children:p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{children:[p.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Original"}),p.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:p.jsx(Va,{height:"400px",language:"yaml",value:d,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]}),p.jsxs("div",{children:[p.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Modified"}),p.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:p.jsx(Va,{height:"400px",language:"yaml",value:h,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]})]})}),p.jsx(rr,{value:"modified",children:p.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:p.jsx(Va,{height:"500px",language:"yaml",value:h,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1}})})})]})]}),p.jsxs(Md,{children:[p.jsx(Ye,{variant:"secondary",onClick:g,icon:p.jsx(_l,{className:"w-4 h-4"}),children:"Reject"}),p.jsx(Ye,{onClick:m,icon:p.jsx(nl,{className:"w-4 h-4"}),children:"Accept Changes"})]})]})}function NQ(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"},Eu={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 CQ({open:e,onOpenChange:t,onCreateStep:n,position:r}){var L,B;const[s,o]=j.useState("select-type"),[a,c]=j.useState(""),[u,d]=j.useState("action"),[h,m]=j.useState(null),[g,v]=j.useState(null),[b,x]=j.useState({id:"",name:""}),w=()=>{o("select-type"),c(""),d("action"),m(null),v(null),x({id:"",name:""})},S=()=>{w(),t(!1)},C=I=>{d(I),o(I==="action"?"select-service":"configure")},k=I=>{m(I),o("select-method")},N=I=>{v(I);const $=Eu[h];x({id:`${h}-${Date.now()}`,name:`${($==null?void 0:$.name)||h} - ${I}`}),o("configure")},T=()=>{const I={id:b.id||`step-${Date.now()}`,name:b.name||void 0,inputs:{}};u==="action"&&h&&g&&(I.action=`${h}.${g}`),n(I),S()},R=Object.entries(Eu).filter(([I,$])=>$.name.toLowerCase().includes(a.toLowerCase())||I.toLowerCase().includes(a.toLowerCase())),O=(h?((L=Eu[h])==null?void 0:L.methods)||[]:[]).filter(I=>I.toLowerCase().includes(a.toLowerCase()));return p.jsxs(Sl,{open:e,onOpenChange:S,title:"Add New Step",description:EQ(s),size:"lg",children:[p.jsxs("div",{className:"p-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[p.jsx("button",{onClick:()=>o("select-type"),className:`${s==="select-type"?"text-primary":"text-gray-400 hover:text-white"}`,children:"Type"}),u==="action"&&p.jsxs(p.Fragment,{children:[p.jsx(_n,{className:"w-4 h-4 text-gray-600"}),p.jsx("button",{onClick:()=>h&&o("select-service"),className:`${s==="select-service"?"text-primary":h?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!h,children:"Service"}),p.jsx(_n,{className:"w-4 h-4 text-gray-600"}),p.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"})]}),p.jsx(_n,{className:"w-4 h-4 text-gray-600"}),p.jsx("span",{className:`${s==="configure"?"text-primary":"text-gray-600"}`,children:"Configure"})]}),s==="select-type"&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.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:[p.jsx(rd,{className:"w-8 h-8 text-primary mb-3"}),p.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Action Step"}),p.jsx("p",{className:"text-sm text-gray-400",children:"Execute an action using a service SDK (Slack, GitHub, etc.)"})]}),p.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:[p.jsx(nd,{className:"w-8 h-8 text-info mb-3"}),p.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Sub-workflow"}),p.jsx("p",{className:"text-sm text-gray-400",children:"Reference another workflow file for modular composition"})]})]}),s==="select-service"&&p.jsxs("div",{children:[p.jsxs("div",{className:"relative mb-4",children:[p.jsx(Ox,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),p.jsx("input",{type:"text",value:a,onChange:I=>c(I.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})]}),p.jsx("div",{className:"grid grid-cols-3 gap-3 max-h-[400px] overflow-y-auto",children:R.map(([I,$])=>{const H=Px(I);return p.jsxs("button",{onClick:()=>k(I),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:[p.jsx(H,{className:"w-8 h-8 text-primary"}),p.jsx("span",{className:"text-sm text-white",children:$.name})]},I)})})]}),s==="select-method"&&h&&p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[(()=>{const I=Px(h);return p.jsx(I,{className:"w-6 h-6 text-primary"})})(),p.jsxs("div",{children:[p.jsx("div",{className:"text-sm font-medium text-white",children:(B=Eu[h])==null?void 0:B.name}),p.jsx("div",{className:"text-xs text-gray-400",children:"Select a method"})]})]}),p.jsxs("div",{className:"relative mb-4",children:[p.jsx(Ox,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),p.jsx("input",{type:"text",value:a,onChange:I=>c(I.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})]}),p.jsx("div",{className:"space-y-2 max-h-[350px] overflow-y-auto",children:O.map(I=>p.jsxs("button",{onClick:()=>N(I),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:[p.jsx("span",{className:"text-sm font-mono text-white",children:I}),p.jsx(_n,{className:"w-4 h-4 text-gray-500"})]},I))})]}),s==="configure"&&p.jsxs("div",{className:"space-y-4",children:[u==="action"&&h&&g&&p.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[p.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Action"}),p.jsxs("div",{className:"text-sm font-mono text-primary",children:[h,".",g]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step ID"}),p.jsx("input",{type:"text",value:b.id,onChange:I=>x($=>({...$,id:I.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"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name (optional)"}),p.jsx("input",{type:"text",value:b.name,onChange:I=>x($=>({...$,name:I.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&&p.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"})]})]}),p.jsxs(Md,{children:[s!=="select-type"&&p.jsx(Ye,{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"}),p.jsx(Ye,{variant:"secondary",onClick:S,children:"Cancel"}),s==="configure"&&p.jsx(Ye,{onClick:T,disabled:!b.id,children:"Create Step"})]})]})}function EQ(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 nA=[{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 jQ({open:e,onOpenChange:t}){const n=[...new Set(nA.map(r=>r.category))];return p.jsxs(Sl,{open:e,onOpenChange:t,title:"Keyboard Shortcuts",description:"Quick reference for all keyboard shortcuts",size:"md",children:[p.jsx("div",{className:"p-4 space-y-6 max-h-[60vh] overflow-y-auto",children:n.map(r=>p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider mb-3",children:r}),p.jsx("div",{className:"space-y-2",children:nA.filter(s=>s.category===r).map((s,o)=>p.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-node-border last:border-0",children:[p.jsx("span",{className:"text-sm text-gray-300",children:s.description}),p.jsx("div",{className:"flex items-center gap-1",children:s.keys.map((a,c)=>p.jsx("kbd",{className:"px-2 py-1 bg-node-bg border border-node-border rounded text-xs font-mono text-gray-300",children:a},c))})]},o))})]},r))}),p.jsx(Md,{children:p.jsx(Ye,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function TQ(){const[e,t]=j.useState(!1);return j.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 AQ({onClick:e}){return p.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 (⌘/)",children:[p.jsx(Kz,{className:"w-3.5 h-3.5"}),p.jsx("span",{className:"hidden sm:inline",children:"Shortcuts"})]})}function dx(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function fx(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 wL=bs()(yL((e,t)=>({theme:"dark",resolvedTheme:"dark",setTheme:n=>{const r=n==="system"?dx():n;fx(r),e({theme:n,resolvedTheme:r})},toggleTheme:()=>{const{theme:n}=t(),r=n==="dark"?"light":"dark",s=r==="system"?dx():r;fx(s),e({theme:r,resolvedTheme:s})}}),{name:"marktoflow-theme",onRehydrateStorage:()=>e=>{if(e){const t=e.theme==="system"?dx():e.theme;fx(t),e.resolvedTheme=t}}}));typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{const{theme:t,setTheme:n}=wL.getState();t==="system"&&n("system")});function RQ({showLabel:e=!1}){const{theme:t,toggleTheme:n}=wL();return p.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"?p.jsx(Zz,{className:"w-4 h-4 text-gray-400"}):p.jsx(u6,{className:"w-4 h-4 text-yellow-500"}),e&&p.jsx("span",{className:"text-xs text-gray-400",children:t==="dark"?"Dark":"Light"})]})}function MQ({items:e,onNavigate:t}){return e.length<=1?null:p.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)=>p.jsxs("div",{className:"flex items-center",children:[r>0&&p.jsx(_n,{className:"w-4 h-4 text-gray-600 mx-1"}),p.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&&p.jsx(Wz,{className:"w-3.5 h-3.5"}),p.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 Bu=Object.create(null);Object.keys(hr).forEach(e=>{Bu[hr[e]]=e});const ew={type:"error",data:"parser error"},bL=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",_L=typeof ArrayBuffer=="function",SL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,qb=({type:e,data:t},n,r)=>bL&&t instanceof Blob?n?r(t):rA(t,r):_L&&(t instanceof ArrayBuffer||SL(t))?n?r(t):rA(new Blob([t]),r):r(hr[e]+(t||"")),rA=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function sA(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let hx;function IQ(e,t){if(bL&&e.data instanceof Blob)return e.data.arrayBuffer().then(sA).then(t);if(_L&&(e.data instanceof ArrayBuffer||SL(e.data)))return t(sA(e.data));qb(e,!1,n=>{hx||(hx=new TextEncoder),t(hx.encode(n))})}const iA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$a=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<iA.length;e++)$a[iA.charCodeAt(e)]=e;const OQ=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),h=new Uint8Array(d);for(r=0;r<n;r+=4)o=$a[e.charCodeAt(r)],a=$a[e.charCodeAt(r+1)],c=$a[e.charCodeAt(r+2)],u=$a[e.charCodeAt(r+3)],h[s++]=o<<2|a>>4,h[s++]=(a&15)<<4|c>>2,h[s++]=(c&3)<<6|u&63;return d},PQ=typeof ArrayBuffer=="function",Fb=(e,t)=>{if(typeof e!="string")return{type:"message",data:kL(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:LQ(e.substring(1),t)}:Bu[n]?e.length>1?{type:Bu[n],data:e.substring(1)}:{type:Bu[n]}:ew},LQ=(e,t)=>{if(PQ){const n=OQ(e);return kL(n,t)}else return{base64:!0,data:e}},kL=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},NL="",DQ=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{qb(o,!1,c=>{r[a]=c,++s===n&&t(r.join(NL))})})},$Q=(e,t)=>{const n=e.split(NL),r=[];for(let s=0;s<n.length;s++){const o=Fb(n[s],t);if(r.push(o),o.type==="error")break}return r};function qQ(){return new TransformStream({transform(e,t){IQ(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 px;function ju(e){return e.reduce((t,n)=>t+n.length,0)}function Tu(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 FQ(e,t){px||(px=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(ju(n)<1)break;const u=Tu(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(ju(n)<2)break;const u=Tu(n,2);s=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(ju(n)<8)break;const u=Tu(n,8),d=new DataView(u.buffer,u.byteOffset,u.length),h=d.getUint32(0);if(h>Math.pow(2,21)-1){c.enqueue(ew);break}s=h*Math.pow(2,32)+d.getUint32(4),r=3}else{if(ju(n)<s)break;const u=Tu(n,s);c.enqueue(Fb(o?u:px.decode(u),t)),r=0}if(s===0||s>e){c.enqueue(ew);break}}}})}const CL=4;function mt(e){if(e)return BQ(e)}function BQ(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 pf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),zQ="arraybuffer";function EL(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const VQ=wn.setTimeout,HQ=wn.clearTimeout;function mf(e,t){t.useNativeTimers?(e.setTimeoutFn=VQ.bind(wn),e.clearTimeoutFn=HQ.bind(wn)):(e.setTimeoutFn=wn.setTimeout.bind(wn),e.clearTimeoutFn=wn.clearTimeout.bind(wn))}const UQ=1.33;function WQ(e){return typeof e=="string"?KQ(e):Math.ceil((e.byteLength||e.size)*UQ)}function KQ(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 jL(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function GQ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function YQ(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 XQ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Bb extends mt{constructor(t){super(),this.writable=!1,mf(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 XQ(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=Fb(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=GQ(t);return n.length?"?"+n:""}}class QQ extends Bb{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)};$Q(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,DQ(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]=jL()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let TL=!1;try{TL=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const JQ=TL;function ZQ(){}class eJ extends QQ{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,mf(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=EL(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=ZQ,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",oA);else if(typeof addEventListener=="function"){const e="onpagehide"in wn?"pagehide":"unload";addEventListener(e,oA,!1)}}function oA(){for(let e in lr.requests)lr.requests.hasOwnProperty(e)&&lr.requests[e].abort()}const tJ=(function(){const e=AL({xdomain:!1});return e&&e.responseType!==null})();class nJ extends eJ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=tJ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new lr(AL,this.uri(),t)}}function AL(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||JQ))return new XMLHttpRequest}catch{}if(!t)try{return new wn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const RL=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class rJ extends Bb{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=RL?{}:EL(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;qb(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&pf(()=>{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]=jL()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const mx=wn.WebSocket||wn.MozWebSocket;class sJ extends rJ{createSocket(t,n,r){return RL?new mx(t,n,r):n?new mx(t,n):new mx(t)}doWrite(t,n){this.ws.send(n)}}class iJ extends Bb{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=FQ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=qQ();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&&pf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const oJ={websocket:sJ,webtransport:iJ,polling:nJ},aJ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lJ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tw(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=aJ.exec(e||""),o={},a=14;for(;a--;)o[lJ[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=cJ(o,o.path),o.queryKey=uJ(o,o.query),o}function cJ(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 uJ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const nw=typeof addEventListener=="function"&&typeof removeEventListener=="function",zu=[];nw&&addEventListener("offline",()=>{zu.forEach(e=>e())},!1);class gs extends mt{constructor(t,n){if(super(),this.binaryType=zQ,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=tw(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=tw(n.host).host);mf(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=YQ(this.opts.query)),nw&&(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"})},zu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=CL,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&&gs.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",gs.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+=WQ(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,pf(()=>{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(gs.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(),nw&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=zu.indexOf(this._offlineEventListener);r!==-1&&zu.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}gs.protocol=CL;class dJ extends gs{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;gs.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;gs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),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,h(),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 h=()=>{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 fJ=class extends dJ{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=>oJ[s]).filter(s=>!!s)),super(t,r)}};function hJ(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=tw(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 pJ=typeof ArrayBuffer=="function",mJ=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ML=Object.prototype.toString,gJ=typeof Blob=="function"||typeof Blob<"u"&&ML.call(Blob)==="[object BlobConstructor]",yJ=typeof File=="function"||typeof File<"u"&&ML.call(File)==="[object FileConstructor]";function zb(e){return pJ&&(e instanceof ArrayBuffer||mJ(e))||gJ&&e instanceof Blob||yJ&&e instanceof File}function Vu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Vu(e[n]))return!0;return!1}if(zb(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Vu(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Vu(e[n]))return!0;return!1}function vJ(e){const t=[],n=e.data,r=e;return r.data=rw(n,t),r.attachments=t.length,{packet:r,buffers:t}}function rw(e,t){if(!e)return e;if(zb(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]=rw(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]=rw(e[r],t));return n}return e}function xJ(e,t){return e.data=sw(e.data,t),delete e.attachments,e}function sw(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]=sw(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=sw(e[n],t));return e}const wJ=["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 bJ{constructor(t){this.replacer=t}encode(t){return(t.type===Pe.EVENT||t.type===Pe.ACK)&&Vu(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=vJ(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class Vb 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 _J(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(zb(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(Vb.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 aA(n);case Pe.DISCONNECT:return n===void 0;case Pe.CONNECT_ERROR:return typeof n=="string"||aA(n);case Pe.EVENT:case Pe.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&wJ.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 _J{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=xJ(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function aA(e){return Object.prototype.toString.call(e)==="[object Object]"}const SJ=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Vb,Encoder:bJ,get PacketType(){return Pe}},Symbol.toStringTag,{value:"Module"}));function Dn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const kJ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class IL 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(kJ.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 h=this.ids++,m=n.pop();this._registerAckCallback(h,m),a.id=h}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 Mo(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}Mo.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};Mo.prototype.reset=function(){this.attempts=0};Mo.prototype.setMin=function(e){this.ms=e};Mo.prototype.setMax=function(e){this.max=e};Mo.prototype.setJitter=function(e){this.jitter=e};class iw 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,mf(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 Mo({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||SJ;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 fJ(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){pf(()=>{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 IL(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 Ea={};function Hu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=hJ(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=Ea[s]&&o in Ea[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let u;return c?u=new iw(r,t):(Ea[s]||(Ea[s]=new iw(r,t)),u=Ea[s]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(Hu,{Manager:iw,Socket:IL,io:Hu,connect:Hu});function OL(e={}){const{autoConnect:t=!0,onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}=e,c=j.useRef(null),[u,d]=j.useState(!1),h=j.useRef({onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a});j.useEffect(()=>{h.current={onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}},[n,r,s,o,a]);const m=j.useCallback(()=>{var C;if((C=c.current)!=null&&C.connected)return;const S=Hu({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,T;(T=(N=h.current).onWorkflowUpdated)==null||T.call(N,k)}),S.on(Er.EXECUTION_STEP,k=>{var N,T;(T=(N=h.current).onExecutionStep)==null||T.call(N,k)}),S.on(Er.EXECUTION_COMPLETED,k=>{var N,T;(T=(N=h.current).onExecutionCompleted)==null||T.call(N,k)}),S.on(Er.AI_PROCESSING,({processing:k})=>{var N,T;(T=(N=h.current).onAIProcessing)==null||T.call(N,k)}),S.on(Er.AI_RESPONSE,k=>{var N,T;(T=(N=h.current).onAIResponse)==null||T.call(N,k)}),c.current=S},[]),g=j.useCallback(()=>{c.current&&(c.current.disconnect(),c.current=null,d(!1))},[]),v=j.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.WORKFLOW_SUBSCRIBE,S)},[]),b=j.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.WORKFLOW_UNSUBSCRIBE,S)},[]),x=j.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.EXECUTION_SUBSCRIBE,S)},[]),w=j.useCallback(S=>{var C;(C=c.current)==null||C.emit(Er.EXECUTION_UNSUBSCRIBE,S)},[]);return j.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 NJ(e){const t=[],n=[];let o=0;if(e.triggers&&e.triggers.length>0){const c=e.triggers[0],u=`trigger-${e.metadata.id}`;t.push({id:u,type:"trigger",position:{x:250,y:o},data:{id:u,name:e.metadata.name,type:c.type||"manual",cron:c.cron,path:c.path,events:c.events,active:!0}}),o+=120,e.steps.length>0&&n.push({id:`e-${u}-${e.steps[0].id}`,source:u,target:e.steps[0].id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}})}if(e.steps.forEach((c,u)=>{const d=!!c.workflow,h={id:c.id,type:d?"subworkflow":"step",position:{x:250,y:o+u*120},data:{id:c.id,name:c.name,action:c.action,workflowPath:c.workflow,status:"pending"}};if(t.push(h),u<e.steps.length-1){const m=e.steps[u+1],g={id:`e-${c.id}-${m.id}`,source:c.id,target:m.id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}};m.conditions&&m.conditions.length>0&&(g.label="conditional",g.labelStyle={fill:"#a0a0c0",fontSize:10},g.labelBgStyle={fill:"#232340"}),n.push(g)}}),e.steps.length>0){const c=`output-${e.metadata.id}`,u=e.steps[e.steps.length-1],d=o+e.steps.length*120,h=e.steps.filter(m=>m.outputVariable).map(m=>m.outputVariable);t.push({id:c,type:"output",position:{x:250,y:d},data:{id:c,name:"Workflow Output",variables:h,status:"pending"}}),n.push({id:`e-${u.id}-${c}`,source:u.id,target:c,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}})}const a=CJ(e.steps);return n.push(...a),{nodes:t,edges:n}}function CJ(e){const t=[],n=new Map;return e.forEach(r=>{r.outputVariable&&n.set(r.outputVariable,r.id)}),e.forEach(r=>{EJ(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 EJ(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 jJ(){const{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,loadWorkflows:o,selectWorkflow:a,loadWorkflow:c,saveWorkflow:u,createWorkflow:d,deleteWorkflow:h}=ys(),{setNodes:m,setEdges:g}=ho(),{subscribeToWorkflow:v,unsubscribeFromWorkflow:b,connected:x}=OL({onWorkflowUpdated:T=>{T.path===t&&c(T.path),(T.event==="add"||T.event==="remove")&&o()}});j.useEffect(()=>{o()},[o]),j.useEffect(()=>{if(x&&t)return v(t),()=>{b(t)}},[x,t,v,b]),j.useEffect(()=>{if(n){const{nodes:T,edges:R}=NJ(n);m(T),g(R)}},[n,m,g]);const w=j.useCallback(T=>{a(T)},[a]),S=j.useCallback(async T=>{T&&await u(T)},[u]),C=j.useCallback(async T=>{await d(T)},[d]),k=j.useCallback(async T=>{await h(T)},[h]),N=j.useCallback(T=>{if(!n)return[];const R=[];if(n.inputs)for(const A of Object.keys(n.inputs))R.push(`inputs.${A}`);for(let A=0;A<T&&A<n.steps.length;A++){const O=n.steps[A];O.outputVariable&&R.push(O.outputVariable)}return R},[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 TJ(){const{currentWorkflow:e,selectedWorkflow:t,saveWorkflow:n,refreshWorkflows:r}=jJ(),{isNewStepOpen:s,newStepPosition:o,openNewStepWizard:a,closeNewStepWizard:c}=gL(),{pendingChanges:u,acceptChanges:d,rejectChanges:h}=$b(),{isOpen:m,setIsOpen:g,openShortcuts:v}=TQ(),{breadcrumbs:b,popToIndex:x,resetNavigation:w}=jw(),{loadWorkflow:S}=ys(),C=j.useCallback((Me,be)=>{x(be),S(Me.path||"")},[x,S]),{connected:k}=OL({onWorkflowUpdated:()=>{r()}}),{isExecuting:N,isPaused:T,currentRunId:R,runs:A,startExecution:O,updateStepStatus:L,completeExecution:B,addLog:I,pauseExecution:$,resumeExecution:H,cancelExecution:D,debug:V,enableDebugMode:z,disableDebugMode:Q,toggleBreakpoint:F,clearAllBreakpoints:q,stepOver:Y,stepInto:P,stepOut:W,addWatchExpression:ie,removeWatchExpression:K}=vL(),{breakpoint:J,setBreakpoint:G,sidebarOpen:ee,setSidebarOpen:te,propertiesPanelOpen:oe,setPropertiesPanelOpen:de}=Db();j.useEffect(()=>{const Me=()=>{const be=cQ(window.innerWidth);be!==J&&G(be)};return Me(),window.addEventListener("resize",Me),()=>window.removeEventListener("resize",Me)},[J,G]);const[me,ye]=j.useState("pending"),[he,Se]=j.useState([]),[xe,Ce]=j.useState([]),[Ne,tt]=j.useState(null),Le=j.useRef(null),vt=j.useCallback(()=>{a()},[a]),xt=j.useCallback(Me=>{if(!e)return;const be={...e,steps:[...e.steps,Me]};n(be),console.log("Created step:",Me)},[e,n]),it=j.useCallback(()=>{var ot;if(N){Le.current&&D(Le.current),ye("cancelled"),Ce(ze=>[...ze,"Execution cancelled by user"]);return}if(!e)return;const Me=((ot=e.metadata)==null?void 0:ot.name)||"Untitled Workflow",be=O(t||"unknown",Me);Le.current=be,ye("running"),tt(null),Ce(["Starting workflow execution..."]),Se(e.steps.map(ze=>({stepId:ze.id,stepName:ze.name||ze.id,status:"pending"}))),Ue(e.steps,be)},[N,e,t,O,D]),Ue=j.useCallback(async(Me,be)=>{for(let ot=0;ot<Me.length;ot++){const ze=Me[ot],Ht=ze.name||ze.id;tt(ze.id),Se(Lt=>Lt.map(Zt=>Zt.stepId===ze.id?{...Zt,status:"running"}:Zt)),Ce(Lt=>[...Lt,"Executing step: "+Ht]),L(be,ze.id,"running"),I(be,"Executing step: "+Ht),await new Promise(Lt=>setTimeout(Lt,1e3+Math.random()*1e3));const fn=Math.random()>.1,Ot=Math.floor(1e3+Math.random()*1e3),Pt=fn?void 0:"Simulated error";Se(Lt=>Lt.map(Zt=>Zt.stepId===ze.id?{...Zt,status:fn?"completed":"failed",duration:Ot,error:Pt}:Zt));const li=fn?'Step "'+Ht+'" completed':'Step "'+Ht+'" failed';if(Ce(Lt=>[...Lt,li]),L(be,ze.id,fn?"completed":"failed",void 0,Pt),I(be,li),!fn){ye("failed"),B(be,"failed"),Le.current=null;return}}ye("completed"),Ce(ot=>[...ot,"Workflow completed successfully!"]),B(be,"completed"),Le.current=null},[L,I,B]),Mt=j.useCallback(()=>{e&&n(e)},[e,n]),It=j.useCallback(()=>{if(b.length>1){const Me=b.length-2,be=b[Me];x(Me),S(be.path)}},[b,x,S]),Vt=j.useCallback(()=>{if(b.length>1){const Me=b[0];x(0),S(Me.path)}},[b,x,S]);return j.useEffect(()=>{const Me=be=>{if(be.target instanceof HTMLInputElement||be.target instanceof HTMLTextAreaElement)return;const ot=be.metaKey||be.ctrlKey;ot&&be.key==="s"&&(be.preventDefault(),Mt()),ot&&be.key==="Enter"&&(be.preventDefault(),it()),be.key==="n"&&!ot&&!be.shiftKey&&!be.altKey&&(be.preventDefault(),vt()),ot&&be.key==="ArrowLeft"&&(be.preventDefault(),It()),ot&&be.key==="ArrowUp"&&(be.preventDefault(),Vt()),be.key==="F9"&&(be.preventDefault(),V.enabled?Q():z()),be.key==="F10"&&V.enabled&&T&&(be.preventDefault(),Y()),be.key==="F11"&&!be.shiftKey&&V.enabled&&T&&(be.preventDefault(),P()),be.key==="F11"&&be.shiftKey&&V.enabled&&T&&(be.preventDefault(),W()),be.key==="F5"&&T&&(be.preventDefault(),H())};return window.addEventListener("keydown",Me),()=>window.removeEventListener("keydown",Me)},[Mt,it,vt,It,Vt,V.enabled,T,z,Q,Y,P,W,H]),p.jsx(GR,{children:p.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-canvas-bg",children:[p.jsx(uQ,{}),p.jsxs("div",{className:"flex flex-1 flex-col relative",children:[J==="mobile"&&p.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-node-border bg-panel-bg",children:[p.jsx("button",{onClick:()=>te(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open menu",children:p.jsx(Yz,{className:"w-5 h-5 text-gray-400"})}),p.jsx("h1",{className:"text-sm font-medium text-white",children:"Marktoflow"}),p.jsx("button",{onClick:()=>de(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open properties",children:p.jsx(e6,{className:"w-5 h-5 text-gray-400"})})]}),J!=="mobile"&&p.jsxs("div",{className:"absolute top-4 right-4 z-10 flex items-center gap-2",children:[p.jsx(RQ,{showLabel:!0}),p.jsx(AQ,{onClick:v}),p.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:[p.jsx("div",{className:`w-2 h-2 rounded-full ${k?"bg-success":"bg-error"}`}),k?"Connected":"Disconnected"]})]}),p.jsx(QX,{onAddStep:vt,onExecute:it,onSave:Mt,isExecuting:N}),p.jsx(MQ,{items:b,onNavigate:C}),p.jsxs("div",{className:"flex-1 relative",children:[p.jsx(XX,{}),p.jsx(JX,{isExecuting:N,isPaused:T,workflowStatus:me,currentStepId:Ne,steps:he,logs:xe,onPause:()=>$(),onResume:()=>H(),onStop:()=>{Le.current&&(D(Le.current),Le.current=null),ye("cancelled")},onStepOver:()=>Y(),onClose:()=>{ye("pending"),Se([]),Ce([])},debug:V,onToggleDebugMode:()=>{V.enabled?Q():z()},onToggleBreakpoint:Me=>F(Me),onStepInto:()=>P(),onStepOut:()=>W(),onClearBreakpoints:()=>q(),onAddWatchExpression:Me=>ie(Me),onRemoveWatchExpression:Me=>K(Me)})]}),p.jsx(SQ,{})]}),p.jsx(mQ,{}),p.jsx(CQ,{open:s,onOpenChange:Me=>{Me||c()},onCreateStep:xt,position:o||void 0}),u&&p.jsx(kQ,{open:!!u,onOpenChange:()=>h(),originalWorkflow:e,modifiedWorkflow:u,explanation:"AI has suggested the following changes to your workflow.",onAccept:d,onReject:h}),p.jsx(jQ,{open:m,onOpenChange:g})]})})}_3.createRoot(document.getElementById("root")).render(p.jsx(pt.StrictMode,{children:p.jsx(TJ,{})}));
|
|
678
|
+
//# sourceMappingURL=index-C90Y_aBX.js.map
|