@marktoflow/gui 2.0.4-alpha.1 → 2.0.4

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.
@@ -0,0 +1,833 @@
1
+ function Y5(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 i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{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 i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var ju=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ul(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zp={exports:{}},Za={},Vp={exports:{}},Pe={};/**
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 Yk;function X5(){if(Yk)return Pe;Yk=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"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator;function g($){return $===null||typeof $!="object"?null:($=h&&$[h]||$["@@iterator"],typeof $=="function"?$:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function v($,K,ie){this.props=$,this.context=K,this.refs=b,this.updater=ie||y}v.prototype.isReactComponent={},v.prototype.setState=function($,K){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,K,"setState")},v.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function N(){}N.prototype=v.prototype;function S($,K,ie){this.props=$,this.context=K,this.refs=b,this.updater=ie||y}var k=S.prototype=new N;k.constructor=S,w(k,v.prototype),k.isPureReactComponent=!0;var _=Array.isArray,A=Object.prototype.hasOwnProperty,I={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function O($,K,ie){var U,Q={},Z=null,ee=null;if(K!=null)for(U in K.ref!==void 0&&(ee=K.ref),K.key!==void 0&&(Z=""+K.key),K)A.call(K,U)&&!T.hasOwnProperty(U)&&(Q[U]=K[U]);var se=arguments.length-2;if(se===1)Q.children=ie;else if(1<se){for(var ae=Array(se),ne=0;ne<se;ne++)ae[ne]=arguments[ne+2];Q.children=ae}if($&&$.defaultProps)for(U in se=$.defaultProps,se)Q[U]===void 0&&(Q[U]=se[U]);return{$$typeof:e,type:$,key:Z,ref:ee,props:Q,_owner:I.current}}function L($,K){return{$$typeof:e,type:$.type,key:K,ref:$.ref,props:$.props,_owner:$._owner}}function B($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function M($){var K={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(ie){return K[ie]})}var P=/\/+/g;function H($,K){return typeof $=="object"&&$!==null&&$.key!=null?M(""+$.key):K.toString(36)}function D($,K,ie,U,Q){var Z=typeof $;(Z==="undefined"||Z==="boolean")&&($=null);var ee=!1;if($===null)ee=!0;else switch(Z){case"string":case"number":ee=!0;break;case"object":switch($.$$typeof){case e:case t:ee=!0}}if(ee)return ee=$,Q=Q(ee),$=U===""?"."+H(ee,0):U,_(Q)?(ie="",$!=null&&(ie=$.replace(P,"$&/")+"/"),D(Q,K,ie,"",function(ne){return ne})):Q!=null&&(B(Q)&&(Q=L(Q,ie+(!Q.key||ee&&ee.key===Q.key?"":(""+Q.key).replace(P,"$&/")+"/")+$)),K.push(Q)),1;if(ee=0,U=U===""?".":U+":",_($))for(var se=0;se<$.length;se++){Z=$[se];var ae=U+H(Z,se);ee+=D(Z,K,ie,ae,Q)}else if(ae=g($),typeof ae=="function")for($=ae.call($),se=0;!(Z=$.next()).done;)Z=Z.value,ae=U+H(Z,se++),ee+=D(Z,K,ie,ae,Q);else if(Z==="object")throw K=String($),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return ee}function z($,K,ie){if($==null)return $;var U=[],Q=0;return D($,U,"","",function(Z){return K.call(ie,Z,Q++)}),U}function V($){if($._status===-1){var K=$._result;K=K(),K.then(function(ie){($._status===0||$._status===-1)&&($._status=1,$._result=ie)},function(ie){($._status===0||$._status===-1)&&($._status=2,$._result=ie)}),$._status===-1&&($._status=0,$._result=K)}if($._status===1)return $._result.default;throw $._result}var G={current:null},q={transition:null},F={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:q,ReactCurrentOwner:I};function Y(){throw Error("act(...) is not supported in production builds of React.")}return Pe.Children={map:z,forEach:function($,K,ie){z($,function(){K.apply(this,arguments)},ie)},count:function($){var K=0;return z($,function(){K++}),K},toArray:function($){return z($,function(K){return K})||[]},only:function($){if(!B($))throw Error("React.Children.only expected to receive a single React element child.");return $}},Pe.Component=v,Pe.Fragment=n,Pe.Profiler=s,Pe.PureComponent=S,Pe.StrictMode=r,Pe.Suspense=d,Pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,Pe.act=Y,Pe.cloneElement=function($,K,ie){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var U=w({},$.props),Q=$.key,Z=$.ref,ee=$._owner;if(K!=null){if(K.ref!==void 0&&(Z=K.ref,ee=I.current),K.key!==void 0&&(Q=""+K.key),$.type&&$.type.defaultProps)var se=$.type.defaultProps;for(ae in K)A.call(K,ae)&&!T.hasOwnProperty(ae)&&(U[ae]=K[ae]===void 0&&se!==void 0?se[ae]:K[ae])}var ae=arguments.length-2;if(ae===1)U.children=ie;else if(1<ae){se=Array(ae);for(var ne=0;ne<ae;ne++)se[ne]=arguments[ne+2];U.children=se}return{$$typeof:e,type:$.type,key:Q,ref:Z,props:U,_owner:ee}},Pe.createContext=function($){return $={$$typeof:a,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:i,_context:$},$.Consumer=$},Pe.createElement=O,Pe.createFactory=function($){var K=O.bind(null,$);return K.type=$,K},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function($){return{$$typeof:c,render:$}},Pe.isValidElement=B,Pe.lazy=function($){return{$$typeof:p,_payload:{_status:-1,_result:$},_init:V}},Pe.memo=function($,K){return{$$typeof:f,type:$,compare:K===void 0?null:K}},Pe.startTransition=function($){var K=q.transition;q.transition={};try{$()}finally{q.transition=K}},Pe.unstable_act=Y,Pe.useCallback=function($,K){return G.current.useCallback($,K)},Pe.useContext=function($){return G.current.useContext($)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function($){return G.current.useDeferredValue($)},Pe.useEffect=function($,K){return G.current.useEffect($,K)},Pe.useId=function(){return G.current.useId()},Pe.useImperativeHandle=function($,K,ie){return G.current.useImperativeHandle($,K,ie)},Pe.useInsertionEffect=function($,K){return G.current.useInsertionEffect($,K)},Pe.useLayoutEffect=function($,K){return G.current.useLayoutEffect($,K)},Pe.useMemo=function($,K){return G.current.useMemo($,K)},Pe.useReducer=function($,K,ie){return G.current.useReducer($,K,ie)},Pe.useRef=function($){return G.current.useRef($)},Pe.useState=function($){return G.current.useState($)},Pe.useSyncExternalStore=function($,K,ie){return G.current.useSyncExternalStore($,K,ie)},Pe.useTransition=function(){return G.current.useTransition()},Pe.version="18.3.1",Pe}var Xk;function Wl(){return Xk||(Xk=1,Vp.exports=X5()),Vp.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 Qk;function Q5(){if(Qk)return Za;Qk=1;var e=Wl(),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,i={key:!0,ref:!0,__self:!0,__source:!0};function a(c,d,f){var p,h={},g=null,y=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(y=d.ref);for(p in d)r.call(d,p)&&!i.hasOwnProperty(p)&&(h[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)h[p]===void 0&&(h[p]=d[p]);return{$$typeof:t,type:c,key:g,ref:y,props:h,_owner:s.current}}return Za.Fragment=n,Za.jsx=a,Za.jsxs=a,Za}var Jk;function J5(){return Jk||(Jk=1,zp.exports=Q5()),zp.exports}var u=J5(),E=Wl();const yt=Ul(E),oI=Y5({__proto__:null,default:yt},[E]);var Au={},Hp={exports:{}},Jt={},Up={exports:{}},Wp={};/**
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 Zk;function Z5(){return Zk||(Zk=1,(function(e){function t(q,F){var Y=q.length;q.push(F);e:for(;0<Y;){var $=Y-1>>>1,K=q[$];if(0<s(K,F))q[$]=F,q[Y]=K,Y=$;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var F=q[0],Y=q.pop();if(Y!==F){q[0]=Y;e:for(var $=0,K=q.length,ie=K>>>1;$<ie;){var U=2*($+1)-1,Q=q[U],Z=U+1,ee=q[Z];if(0>s(Q,Y))Z<K&&0>s(ee,Q)?(q[$]=ee,q[Z]=Y,$=Z):(q[$]=Q,q[U]=Y,$=U);else if(Z<K&&0>s(ee,Y))q[$]=ee,q[Z]=Y,$=Z;else break e}}return F}function s(q,F){var Y=q.sortIndex-F.sortIndex;return Y!==0?Y:q.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,h=null,g=3,y=!1,w=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,S=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(q){for(var F=n(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=q)r(f),F.sortIndex=F.expirationTime,t(d,F);else break;F=n(f)}}function _(q){if(b=!1,k(q),!w)if(n(d)!==null)w=!0,V(A);else{var F=n(f);F!==null&&G(_,F.startTime-q)}}function A(q,F){w=!1,b&&(b=!1,N(O),O=-1),y=!0;var Y=g;try{for(k(F),h=n(d);h!==null&&(!(h.expirationTime>F)||q&&!M());){var $=h.callback;if(typeof $=="function"){h.callback=null,g=h.priorityLevel;var K=$(h.expirationTime<=F);F=e.unstable_now(),typeof K=="function"?h.callback=K:h===n(d)&&r(d),k(F)}else r(d);h=n(d)}if(h!==null)var ie=!0;else{var U=n(f);U!==null&&G(_,U.startTime-F),ie=!1}return ie}finally{h=null,g=Y,y=!1}}var I=!1,T=null,O=-1,L=5,B=-1;function M(){return!(e.unstable_now()-B<L)}function P(){if(T!==null){var q=e.unstable_now();B=q;var F=!0;try{F=T(!0,q)}finally{F?H():(I=!1,T=null)}}else I=!1}var H;if(typeof S=="function")H=function(){S(P)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,z=D.port2;D.port1.onmessage=P,H=function(){z.postMessage(null)}}else H=function(){v(P,0)};function V(q){T=q,I||(I=!0,H())}function G(q,F){O=v(function(){q(e.unstable_now())},F)}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(q){q.callback=null},e.unstable_continueExecution=function(){w||y||(w=!0,V(A))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(q){switch(g){case 1:case 2:case 3:var F=3;break;default:F=g}var Y=g;g=F;try{return q()}finally{g=Y}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,F){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=g;g=q;try{return F()}finally{g=Y}},e.unstable_scheduleCallback=function(q,F,Y){var $=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?$+Y:$):Y=$,q){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=Y+K,q={id:p++,callback:F,priorityLevel:q,startTime:Y,expirationTime:K,sortIndex:-1},Y>$?(q.sortIndex=Y,t(f,q),n(d)===null&&q===n(f)&&(b?(N(O),O=-1):b=!0,G(_,Y-$))):(q.sortIndex=K,t(d,q),w||y||(w=!0,V(A))),q},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(q){var F=g;return function(){var Y=g;g=F;try{return q.apply(this,arguments)}finally{g=Y}}}})(Wp)),Wp}var eS;function eD(){return eS||(eS=1,Up.exports=Z5()),Up.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 tS;function tD(){if(tS)return Jt;tS=1;var e=Wl(),t=eD();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,m=1;m<arguments.length;m++)l+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+o+"; 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 i(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},h={};function g(o){return d.call(h,o)?!0:d.call(p,o)?!1:f.test(o)?h[o]=!0:(p[o]=!0,!1)}function y(o,l,m,x){if(m!==null&&m.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return x?!1:m!==null?!m.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function w(o,l,m,x){if(l===null||typeof l>"u"||y(o,l,m,x))return!0;if(x)return!1;if(m!==null)switch(m.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 b(o,l,m,x,C,j,R){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=x,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=o,this.type=l,this.sanitizeURL=j,this.removeEmptyString=R}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){v[o]=new b(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];v[l]=new b(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){v[o]=new b(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){v[o]=new b(o,2,!1,o,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(o){v[o]=new b(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){v[o]=new b(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){v[o]=new b(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){v[o]=new b(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){v[o]=new b(o,5,!1,o.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function S(o){return o[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(o){var l=o.replace(N,S);v[l]=new b(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(N,S);v[l]=new b(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(N,S);v[l]=new b(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){v[o]=new b(o,1,!1,o.toLowerCase(),null,!1,!1)}),v.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){v[o]=new b(o,1,!1,o.toLowerCase(),null,!0,!0)});function k(o,l,m,x){var C=v.hasOwnProperty(l)?v[l]:null;(C!==null?C.type!==0:x||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(w(l,m,C,x)&&(m=null),x||C===null?g(l)&&(m===null?o.removeAttribute(l):o.setAttribute(l,""+m)):C.mustUseProperty?o[C.propertyName]=m===null?C.type===3?!1:"":m:(l=C.attributeName,x=C.attributeNamespace,m===null?o.removeAttribute(l):(C=C.type,m=C===3||C===4&&m===!0?"":""+m,x?o.setAttributeNS(x,l,m):o.setAttribute(l,m))))}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),I=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),M=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),q=Symbol.iterator;function F(o){return o===null||typeof o!="object"?null:(o=q&&o[q]||o["@@iterator"],typeof o=="function"?o:null)}var Y=Object.assign,$;function K(o){if($===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);$=l&&l[1]||""}return`
34
+ `+$+o}var ie=!1;function U(o,l){if(!o||ie)return"";ie=!0;var m=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(oe){var x=oe}Reflect.construct(o,[],l)}else{try{l.call()}catch(oe){x=oe}o.call(l.prototype)}else{try{throw Error()}catch(oe){x=oe}o()}}catch(oe){if(oe&&x&&typeof oe.stack=="string"){for(var C=oe.stack.split(`
35
+ `),j=x.stack.split(`
36
+ `),R=C.length-1,W=j.length-1;1<=R&&0<=W&&C[R]!==j[W];)W--;for(;1<=R&&0<=W;R--,W--)if(C[R]!==j[W]){if(R!==1||W!==1)do if(R--,W--,0>W||C[R]!==j[W]){var X=`
37
+ `+C[R].replace(" at new "," at ");return o.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",o.displayName)),X}while(1<=R&&0<=W);break}}}finally{ie=!1,Error.prepareStackTrace=m}return(o=o?o.displayName||o.name:"")?K(o):""}function Q(o){switch(o.tag){case 5:return K(o.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return o=U(o.type,!1),o;case 11:return o=U(o.type.render,!1),o;case 1:return o=U(o.type,!0),o;default:return""}}function Z(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case T:return"Fragment";case I:return"Portal";case L:return"Profiler";case O:return"StrictMode";case H:return"Suspense";case D:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case M:return(o.displayName||"Context")+".Consumer";case B:return(o._context.displayName||"Context")+".Provider";case P:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case z:return l=o.displayName||null,l!==null?l:Z(o.type)||"Memo";case V:l=o._payload,o=o._init;try{return Z(o(l))}catch{}}return null}function ee(o){var l=o.type;switch(o.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 o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(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 se(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ae(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ne(o){var l=ae(o)?"checked":"value",m=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),x=""+o[l];if(!o.hasOwnProperty(l)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,j=m.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return C.call(this)},set:function(R){x=""+R,j.call(this,R)}}),Object.defineProperty(o,l,{enumerable:m.enumerable}),{getValue:function(){return x},setValue:function(R){x=""+R},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function le(o){o._valueTracker||(o._valueTracker=ne(o))}function he(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var m=l.getValue(),x="";return o&&(x=ae(o)?o.checked?"true":"false":o.value),o=x,o!==m?(l.setValue(o),!0):!1}function pe(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function ve(o,l){var m=l.checked;return Y({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??o._wrapperState.initialChecked})}function xe(o,l){var m=l.defaultValue==null?"":l.defaultValue,x=l.checked!=null?l.checked:l.defaultChecked;m=se(l.value!=null?l.value:m),o._wrapperState={initialChecked:x,initialValue:m,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ae(o,l){l=l.checked,l!=null&&k(o,"checked",l,!1)}function Se(o,l){Ae(o,l);var m=se(l.value),x=l.type;if(m!=null)x==="number"?(m===0&&o.value===""||o.value!=m)&&(o.value=""+m):o.value!==""+m&&(o.value=""+m);else if(x==="submit"||x==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Ve(o,l.type,m):l.hasOwnProperty("defaultValue")&&Ve(o,l.type,se(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Ge(o,l,m){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var x=l.type;if(!(x!=="submit"&&x!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,m||l===o.value||(o.value=l),o.defaultValue=l}m=o.name,m!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,m!==""&&(o.name=m)}function Ve(o,l,m){(l!=="number"||pe(o.ownerDocument)!==o)&&(m==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+m&&(o.defaultValue=""+m))}var jt=Array.isArray;function St(o,l,m,x){if(o=o.options,l){l={};for(var C=0;C<m.length;C++)l["$"+m[C]]=!0;for(m=0;m<o.length;m++)C=l.hasOwnProperty("$"+o[m].value),o[m].selected!==C&&(o[m].selected=C),C&&x&&(o[m].defaultSelected=!0)}else{for(m=""+se(m),l=null,C=0;C<o.length;C++){if(o[C].value===m){o[C].selected=!0,x&&(o[C].defaultSelected=!0);return}l!==null||o[C].disabled||(l=o[C])}l!==null&&(l.selected=!0)}}function mt(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return Y({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function He(o,l){var m=l.value;if(m==null){if(m=l.children,l=l.defaultValue,m!=null){if(l!=null)throw Error(n(92));if(jt(m)){if(1<m.length)throw Error(n(93));m=m[0]}l=m}l==null&&(l=""),m=l}o._wrapperState={initialValue:se(m)}}function nn(o,l){var m=se(l.value),x=se(l.defaultValue);m!=null&&(m=""+m,m!==o.value&&(o.value=m),l.defaultValue==null&&o.defaultValue!==m&&(o.defaultValue=m)),x!=null&&(o.defaultValue=""+x)}function Rt(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function rn(o){switch(o){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 ut(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?rn(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Ot,Pn=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,m,x,C){MSApp.execUnsafeLocalFunction(function(){return o(l,m,x,C)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Ot=Ot||document.createElement("div"),Ot.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Ot.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function ze(o,l){if(l){var m=o.firstChild;if(m&&m===o.lastChild&&m.nodeType===3){m.nodeValue=l;return}}o.textContent=l}var Ln={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},Dr=["Webkit","ms","Moz","O"];Object.keys(Ln).forEach(function(o){Dr.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Ln[l]=Ln[o]})});function Wt(o,l,m){return l==null||typeof l=="boolean"||l===""?"":m||typeof l!="number"||l===0||Ln.hasOwnProperty(o)&&Ln[o]?(""+l).trim():l+"px"}function sn(o,l){o=o.style;for(var m in l)if(l.hasOwnProperty(m)){var x=m.indexOf("--")===0,C=Wt(m,l[m],x);m==="float"&&(m="cssFloat"),x?o.setProperty(m,C):o[m]=C}}var ma=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 ls(o,l){if(l){if(ma[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));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 cr(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 Xs=null;function Dn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ur=null,$n=null,vn=null;function cs(o){if(o=$a(o)){if(typeof ur!="function")throw Error(n(280));var l=o.stateNode;l&&(l=Vc(l),ur(o.stateNode,o.type,l))}}function Qs(o){$n?vn?vn.push(o):vn=[o]:$n=o}function Ce(){if($n){var o=$n,l=vn;if(vn=$n=null,cs(o),l)for(o=0;o<l.length;o++)cs(l[o])}}function be(o,l){return o(l)}function We(){}var bn=!1;function Fn(o,l,m){if(bn)return o(l,m);bn=!0;try{return be(o,l,m)}finally{bn=!1,($n!==null||vn!==null)&&(We(),Ce())}}function $r(o,l){var m=o.stateNode;if(m===null)return null;var x=Vc(m);if(x===null)return null;m=x[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":(x=!x.disabled)||(o=o.type,x=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!x;break e;default:o=!1}if(o)return null;if(m&&typeof m!="function")throw Error(n(231,l,typeof m));return m}var on=!1;if(c)try{var Js={};Object.defineProperty(Js,"passive",{get:function(){on=!0}}),window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch{on=!1}function Jf(o,l,m,x,C,j,R,W,X){var oe=Array.prototype.slice.call(arguments,3);try{l.apply(m,oe)}catch(de){this.onError(de)}}var Zs=!1,Vi=null,Hi=!1,ga=null,Zf={onError:function(o){Zs=!0,Vi=o}};function eh(o,l,m,x,C,j,R,W,X){Zs=!1,Vi=null,Jf.apply(Zf,arguments)}function th(o,l,m,x,C,j,R,W,X){if(eh.apply(this,arguments),Zs){if(Zs){var oe=Vi;Zs=!1,Vi=null}else throw Error(n(198));Hi||(Hi=!0,ga=oe)}}function dr(o){var l=o,m=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(m=l.return),o=l.return;while(o)}return l.tag===3?m:null}function ya(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function xa(o){if(dr(o)!==o)throw Error(n(188))}function nh(o){var l=o.alternate;if(!l){if(l=dr(o),l===null)throw Error(n(188));return l!==o?null:o}for(var m=o,x=l;;){var C=m.return;if(C===null)break;var j=C.alternate;if(j===null){if(x=C.return,x!==null){m=x;continue}break}if(C.child===j.child){for(j=C.child;j;){if(j===m)return xa(C),o;if(j===x)return xa(C),l;j=j.sibling}throw Error(n(188))}if(m.return!==x.return)m=C,x=j;else{for(var R=!1,W=C.child;W;){if(W===m){R=!0,m=C,x=j;break}if(W===x){R=!0,x=C,m=j;break}W=W.sibling}if(!R){for(W=j.child;W;){if(W===m){R=!0,m=j,x=C;break}if(W===x){R=!0,x=j,m=C;break}W=W.sibling}if(!R)throw Error(n(189))}}if(m.alternate!==x)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?o:l}function vc(o){return o=nh(o),o!==null?bc(o):null}function bc(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=bc(o);if(l!==null)return l;o=o.sibling}return null}var wc=t.unstable_scheduleCallback,Nc=t.unstable_cancelCallback,rh=t.unstable_shouldYield,kc=t.unstable_requestPaint,ot=t.unstable_now,sh=t.unstable_getCurrentPriorityLevel,va=t.unstable_ImmediatePriority,Sc=t.unstable_UserBlockingPriority,Ui=t.unstable_NormalPriority,ih=t.unstable_LowPriority,Cc=t.unstable_IdlePriority,ei=null,wn=null;function oh(o){if(wn&&typeof wn.onCommitFiberRoot=="function")try{wn.onCommitFiberRoot(ei,o,void 0,(o.current.flags&128)===128)}catch{}}var an=Math.clz32?Math.clz32:ch,ah=Math.log,lh=Math.LN2;function ch(o){return o>>>=0,o===0?32:31-(ah(o)/lh|0)|0}var Wi=64,Ki=4194304;function fr(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Gi(o,l){var m=o.pendingLanes;if(m===0)return 0;var x=0,C=o.suspendedLanes,j=o.pingedLanes,R=m&268435455;if(R!==0){var W=R&~C;W!==0?x=fr(W):(j&=R,j!==0&&(x=fr(j)))}else R=m&~C,R!==0?x=fr(R):j!==0&&(x=fr(j));if(x===0)return 0;if(l!==0&&l!==x&&(l&C)===0&&(C=x&-x,j=l&-l,C>=j||C===16&&(j&4194240)!==0))return l;if((x&4)!==0&&(x|=m&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=x;0<l;)m=31-an(l),C=1<<m,x|=o[m],l&=~C;return x}function _c(o,l){switch(o){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 uh(o,l){for(var m=o.suspendedLanes,x=o.pingedLanes,C=o.expirationTimes,j=o.pendingLanes;0<j;){var R=31-an(j),W=1<<R,X=C[R];X===-1?((W&m)===0||(W&x)!==0)&&(C[R]=_c(W,l)):X<=l&&(o.expiredLanes|=W),j&=~W}}function ba(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Yi(){var o=Wi;return Wi<<=1,(Wi&4194240)===0&&(Wi=64),o}function wa(o){for(var l=[],m=0;31>m;m++)l.push(o);return l}function ti(o,l,m){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-an(l),o[l]=m}function Ec(o,l){var m=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var x=o.eventTimes;for(o=o.expirationTimes;0<m;){var C=31-an(m),j=1<<C;l[C]=0,x[C]=-1,o[C]=-1,m&=~j}}function dh(o,l){var m=o.entangledLanes|=l;for(o=o.entanglements;m;){var x=31-an(m),C=1<<x;C&l|o[x]&l&&(o[x]|=l),m&=~C}}var Ke=0;function E1(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var j1,fh,A1,T1,I1,hh=!1,jc=[],us=null,ds=null,fs=null,Na=new Map,ka=new Map,hs=[],yL="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 M1(o,l){switch(o){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":ds=null;break;case"mouseover":case"mouseout":fs=null;break;case"pointerover":case"pointerout":Na.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ka.delete(l.pointerId)}}function Sa(o,l,m,x,C,j){return o===null||o.nativeEvent!==j?(o={blockedOn:l,domEventName:m,eventSystemFlags:x,nativeEvent:j,targetContainers:[C]},l!==null&&(l=$a(l),l!==null&&fh(l)),o):(o.eventSystemFlags|=x,l=o.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),o)}function xL(o,l,m,x,C){switch(l){case"focusin":return us=Sa(us,o,l,m,x,C),!0;case"dragenter":return ds=Sa(ds,o,l,m,x,C),!0;case"mouseover":return fs=Sa(fs,o,l,m,x,C),!0;case"pointerover":var j=C.pointerId;return Na.set(j,Sa(Na.get(j)||null,o,l,m,x,C)),!0;case"gotpointercapture":return j=C.pointerId,ka.set(j,Sa(ka.get(j)||null,o,l,m,x,C)),!0}return!1}function R1(o){var l=ni(o.target);if(l!==null){var m=dr(l);if(m!==null){if(l=m.tag,l===13){if(l=ya(m),l!==null){o.blockedOn=l,I1(o.priority,function(){A1(m)});return}}else if(l===3&&m.stateNode.current.memoizedState.isDehydrated){o.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Ac(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var m=mh(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(m===null){m=o.nativeEvent;var x=new m.constructor(m.type,m);Xs=x,m.target.dispatchEvent(x),Xs=null}else return l=$a(m),l!==null&&fh(l),o.blockedOn=m,!1;l.shift()}return!0}function O1(o,l,m){Ac(o)&&m.delete(l)}function vL(){hh=!1,us!==null&&Ac(us)&&(us=null),ds!==null&&Ac(ds)&&(ds=null),fs!==null&&Ac(fs)&&(fs=null),Na.forEach(O1),ka.forEach(O1)}function Ca(o,l){o.blockedOn===l&&(o.blockedOn=null,hh||(hh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,vL)))}function _a(o){function l(C){return Ca(C,o)}if(0<jc.length){Ca(jc[0],o);for(var m=1;m<jc.length;m++){var x=jc[m];x.blockedOn===o&&(x.blockedOn=null)}}for(us!==null&&Ca(us,o),ds!==null&&Ca(ds,o),fs!==null&&Ca(fs,o),Na.forEach(l),ka.forEach(l),m=0;m<hs.length;m++)x=hs[m],x.blockedOn===o&&(x.blockedOn=null);for(;0<hs.length&&(m=hs[0],m.blockedOn===null);)R1(m),m.blockedOn===null&&hs.shift()}var Xi=_.ReactCurrentBatchConfig,Tc=!0;function bL(o,l,m,x){var C=Ke,j=Xi.transition;Xi.transition=null;try{Ke=1,ph(o,l,m,x)}finally{Ke=C,Xi.transition=j}}function wL(o,l,m,x){var C=Ke,j=Xi.transition;Xi.transition=null;try{Ke=4,ph(o,l,m,x)}finally{Ke=C,Xi.transition=j}}function ph(o,l,m,x){if(Tc){var C=mh(o,l,m,x);if(C===null)Mh(o,l,x,Ic,m),M1(o,x);else if(xL(C,o,l,m,x))x.stopPropagation();else if(M1(o,x),l&4&&-1<yL.indexOf(o)){for(;C!==null;){var j=$a(C);if(j!==null&&j1(j),j=mh(o,l,m,x),j===null&&Mh(o,l,x,Ic,m),j===C)break;C=j}C!==null&&x.stopPropagation()}else Mh(o,l,x,null,m)}}var Ic=null;function mh(o,l,m,x){if(Ic=null,o=Dn(x),o=ni(o),o!==null)if(l=dr(o),l===null)o=null;else if(m=l.tag,m===13){if(o=ya(l),o!==null)return o;o=null}else if(m===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Ic=o,null}function P1(o){switch(o){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(sh()){case va:return 1;case Sc:return 4;case Ui:case ih:return 16;case Cc:return 536870912;default:return 16}default:return 16}}var ps=null,gh=null,Mc=null;function L1(){if(Mc)return Mc;var o,l=gh,m=l.length,x,C="value"in ps?ps.value:ps.textContent,j=C.length;for(o=0;o<m&&l[o]===C[o];o++);var R=m-o;for(x=1;x<=R&&l[m-x]===C[j-x];x++);return Mc=C.slice(o,1<x?1-x:void 0)}function Rc(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Oc(){return!0}function D1(){return!1}function ln(o){function l(m,x,C,j,R){this._reactName=m,this._targetInst=C,this.type=x,this.nativeEvent=j,this.target=R,this.currentTarget=null;for(var W in o)o.hasOwnProperty(W)&&(m=o[W],this[W]=m?m(j):j[W]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Oc:D1,this.isPropagationStopped=D1,this}return Y(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),l}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yh=ln(Qi),Ea=Y({},Qi,{view:0,detail:0}),NL=ln(Ea),xh,vh,ja,Pc=Y({},Ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wh,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==ja&&(ja&&o.type==="mousemove"?(xh=o.screenX-ja.screenX,vh=o.screenY-ja.screenY):vh=xh=0,ja=o),xh)},movementY:function(o){return"movementY"in o?o.movementY:vh}}),$1=ln(Pc),kL=Y({},Pc,{dataTransfer:0}),SL=ln(kL),CL=Y({},Ea,{relatedTarget:0}),bh=ln(CL),_L=Y({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),EL=ln(_L),jL=Y({},Qi,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),AL=ln(jL),TL=Y({},Qi,{data:0}),F1=ln(TL),IL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ML={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"},RL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OL(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=RL[o])?!!l[o]:!1}function wh(){return OL}var PL=Y({},Ea,{key:function(o){if(o.key){var l=IL[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Rc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?ML[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wh,charCode:function(o){return o.type==="keypress"?Rc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Rc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),LL=ln(PL),DL=Y({},Pc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),q1=ln(DL),$L=Y({},Ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wh}),FL=ln($L),qL=Y({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),BL=ln(qL),zL=Y({},Pc,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),VL=ln(zL),HL=[9,13,27,32],Nh=c&&"CompositionEvent"in window,Aa=null;c&&"documentMode"in document&&(Aa=document.documentMode);var UL=c&&"TextEvent"in window&&!Aa,B1=c&&(!Nh||Aa&&8<Aa&&11>=Aa),z1=" ",V1=!1;function H1(o,l){switch(o){case"keyup":return HL.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ji=!1;function WL(o,l){switch(o){case"compositionend":return U1(l);case"keypress":return l.which!==32?null:(V1=!0,z1);case"textInput":return o=l.data,o===z1&&V1?null:o;default:return null}}function KL(o,l){if(Ji)return o==="compositionend"||!Nh&&H1(o,l)?(o=L1(),Mc=gh=ps=null,Ji=!1,o):null;switch(o){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 B1&&l.locale!=="ko"?null:l.data;default:return null}}var GL={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 W1(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!GL[o.type]:l==="textarea"}function K1(o,l,m,x){Qs(x),l=qc(l,"onChange"),0<l.length&&(m=new yh("onChange","change",null,m,x),o.push({event:m,listeners:l}))}var Ta=null,Ia=null;function YL(o){dN(o,0)}function Lc(o){var l=ro(o);if(he(l))return o}function XL(o,l){if(o==="change")return l}var G1=!1;if(c){var kh;if(c){var Sh="oninput"in document;if(!Sh){var Y1=document.createElement("div");Y1.setAttribute("oninput","return;"),Sh=typeof Y1.oninput=="function"}kh=Sh}else kh=!1;G1=kh&&(!document.documentMode||9<document.documentMode)}function X1(){Ta&&(Ta.detachEvent("onpropertychange",Q1),Ia=Ta=null)}function Q1(o){if(o.propertyName==="value"&&Lc(Ia)){var l=[];K1(l,Ia,o,Dn(o)),Fn(YL,l)}}function QL(o,l,m){o==="focusin"?(X1(),Ta=l,Ia=m,Ta.attachEvent("onpropertychange",Q1)):o==="focusout"&&X1()}function JL(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Lc(Ia)}function ZL(o,l){if(o==="click")return Lc(l)}function e5(o,l){if(o==="input"||o==="change")return Lc(l)}function t5(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var qn=typeof Object.is=="function"?Object.is:t5;function Ma(o,l){if(qn(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var m=Object.keys(o),x=Object.keys(l);if(m.length!==x.length)return!1;for(x=0;x<m.length;x++){var C=m[x];if(!d.call(l,C)||!qn(o[C],l[C]))return!1}return!0}function J1(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Z1(o,l){var m=J1(o);o=0;for(var x;m;){if(m.nodeType===3){if(x=o+m.textContent.length,o<=l&&x>=l)return{node:m,offset:l-o};o=x}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=J1(m)}}function eN(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?eN(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function tN(){for(var o=window,l=pe();l instanceof o.HTMLIFrameElement;){try{var m=typeof l.contentWindow.location.href=="string"}catch{m=!1}if(m)o=l.contentWindow;else break;l=pe(o.document)}return l}function Ch(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function n5(o){var l=tN(),m=o.focusedElem,x=o.selectionRange;if(l!==m&&m&&m.ownerDocument&&eN(m.ownerDocument.documentElement,m)){if(x!==null&&Ch(m)){if(l=x.start,o=x.end,o===void 0&&(o=l),"selectionStart"in m)m.selectionStart=l,m.selectionEnd=Math.min(o,m.value.length);else if(o=(l=m.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var C=m.textContent.length,j=Math.min(x.start,C);x=x.end===void 0?j:Math.min(x.end,C),!o.extend&&j>x&&(C=x,x=j,j=C),C=Z1(m,j);var R=Z1(m,x);C&&R&&(o.rangeCount!==1||o.anchorNode!==C.node||o.anchorOffset!==C.offset||o.focusNode!==R.node||o.focusOffset!==R.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),o.removeAllRanges(),j>x?(o.addRange(l),o.extend(R.node,R.offset)):(l.setEnd(R.node,R.offset),o.addRange(l)))}}for(l=[],o=m;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<l.length;m++)o=l[m],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var r5=c&&"documentMode"in document&&11>=document.documentMode,Zi=null,_h=null,Ra=null,Eh=!1;function nN(o,l,m){var x=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Eh||Zi==null||Zi!==pe(x)||(x=Zi,"selectionStart"in x&&Ch(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Ra&&Ma(Ra,x)||(Ra=x,x=qc(_h,"onSelect"),0<x.length&&(l=new yh("onSelect","select",null,l,m),o.push({event:l,listeners:x}),l.target=Zi)))}function Dc(o,l){var m={};return m[o.toLowerCase()]=l.toLowerCase(),m["Webkit"+o]="webkit"+l,m["Moz"+o]="moz"+l,m}var eo={animationend:Dc("Animation","AnimationEnd"),animationiteration:Dc("Animation","AnimationIteration"),animationstart:Dc("Animation","AnimationStart"),transitionend:Dc("Transition","TransitionEnd")},jh={},rN={};c&&(rN=document.createElement("div").style,"AnimationEvent"in window||(delete eo.animationend.animation,delete eo.animationiteration.animation,delete eo.animationstart.animation),"TransitionEvent"in window||delete eo.transitionend.transition);function $c(o){if(jh[o])return jh[o];if(!eo[o])return o;var l=eo[o],m;for(m in l)if(l.hasOwnProperty(m)&&m in rN)return jh[o]=l[m];return o}var sN=$c("animationend"),iN=$c("animationiteration"),oN=$c("animationstart"),aN=$c("transitionend"),lN=new Map,cN="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 ms(o,l){lN.set(o,l),i(l,[o])}for(var Ah=0;Ah<cN.length;Ah++){var Th=cN[Ah],s5=Th.toLowerCase(),i5=Th[0].toUpperCase()+Th.slice(1);ms(s5,"on"+i5)}ms(sN,"onAnimationEnd"),ms(iN,"onAnimationIteration"),ms(oN,"onAnimationStart"),ms("dblclick","onDoubleClick"),ms("focusin","onFocus"),ms("focusout","onBlur"),ms(aN,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oa="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(" "),o5=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oa));function uN(o,l,m){var x=o.type||"unknown-event";o.currentTarget=m,th(x,l,void 0,o),o.currentTarget=null}function dN(o,l){l=(l&4)!==0;for(var m=0;m<o.length;m++){var x=o[m],C=x.event;x=x.listeners;e:{var j=void 0;if(l)for(var R=x.length-1;0<=R;R--){var W=x[R],X=W.instance,oe=W.currentTarget;if(W=W.listener,X!==j&&C.isPropagationStopped())break e;uN(C,W,oe),j=X}else for(R=0;R<x.length;R++){if(W=x[R],X=W.instance,oe=W.currentTarget,W=W.listener,X!==j&&C.isPropagationStopped())break e;uN(C,W,oe),j=X}}}if(Hi)throw o=ga,Hi=!1,ga=null,o}function Je(o,l){var m=l[$h];m===void 0&&(m=l[$h]=new Set);var x=o+"__bubble";m.has(x)||(fN(l,o,2,!1),m.add(x))}function Ih(o,l,m){var x=0;l&&(x|=4),fN(m,o,x,l)}var Fc="_reactListening"+Math.random().toString(36).slice(2);function Pa(o){if(!o[Fc]){o[Fc]=!0,r.forEach(function(m){m!=="selectionchange"&&(o5.has(m)||Ih(m,!1,o),Ih(m,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Fc]||(l[Fc]=!0,Ih("selectionchange",!1,l))}}function fN(o,l,m,x){switch(P1(l)){case 1:var C=bL;break;case 4:C=wL;break;default:C=ph}m=C.bind(null,l,m,o),C=void 0,!on||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),x?C!==void 0?o.addEventListener(l,m,{capture:!0,passive:C}):o.addEventListener(l,m,!0):C!==void 0?o.addEventListener(l,m,{passive:C}):o.addEventListener(l,m,!1)}function Mh(o,l,m,x,C){var j=x;if((l&1)===0&&(l&2)===0&&x!==null)e:for(;;){if(x===null)return;var R=x.tag;if(R===3||R===4){var W=x.stateNode.containerInfo;if(W===C||W.nodeType===8&&W.parentNode===C)break;if(R===4)for(R=x.return;R!==null;){var X=R.tag;if((X===3||X===4)&&(X=R.stateNode.containerInfo,X===C||X.nodeType===8&&X.parentNode===C))return;R=R.return}for(;W!==null;){if(R=ni(W),R===null)return;if(X=R.tag,X===5||X===6){x=j=R;continue e}W=W.parentNode}}x=x.return}Fn(function(){var oe=j,de=Dn(m),fe=[];e:{var ue=lN.get(o);if(ue!==void 0){var ye=yh,Ne=o;switch(o){case"keypress":if(Rc(m)===0)break e;case"keydown":case"keyup":ye=LL;break;case"focusin":Ne="focus",ye=bh;break;case"focusout":Ne="blur",ye=bh;break;case"beforeblur":case"afterblur":ye=bh;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=$1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=SL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=FL;break;case sN:case iN:case oN:ye=EL;break;case aN:ye=BL;break;case"scroll":ye=NL;break;case"wheel":ye=VL;break;case"copy":case"cut":case"paste":ye=AL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=q1}var ke=(l&4)!==0,dt=!ke&&o==="scroll",te=ke?ue!==null?ue+"Capture":null:ue;ke=[];for(var J=oe,re;J!==null;){re=J;var me=re.stateNode;if(re.tag===5&&me!==null&&(re=me,te!==null&&(me=$r(J,te),me!=null&&ke.push(La(J,me,re)))),dt)break;J=J.return}0<ke.length&&(ue=new ye(ue,Ne,null,m,de),fe.push({event:ue,listeners:ke}))}}if((l&7)===0){e:{if(ue=o==="mouseover"||o==="pointerover",ye=o==="mouseout"||o==="pointerout",ue&&m!==Xs&&(Ne=m.relatedTarget||m.fromElement)&&(ni(Ne)||Ne[Fr]))break e;if((ye||ue)&&(ue=de.window===de?de:(ue=de.ownerDocument)?ue.defaultView||ue.parentWindow:window,ye?(Ne=m.relatedTarget||m.toElement,ye=oe,Ne=Ne?ni(Ne):null,Ne!==null&&(dt=dr(Ne),Ne!==dt||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(ye=null,Ne=oe),ye!==Ne)){if(ke=$1,me="onMouseLeave",te="onMouseEnter",J="mouse",(o==="pointerout"||o==="pointerover")&&(ke=q1,me="onPointerLeave",te="onPointerEnter",J="pointer"),dt=ye==null?ue:ro(ye),re=Ne==null?ue:ro(Ne),ue=new ke(me,J+"leave",ye,m,de),ue.target=dt,ue.relatedTarget=re,me=null,ni(de)===oe&&(ke=new ke(te,J+"enter",Ne,m,de),ke.target=re,ke.relatedTarget=dt,me=ke),dt=me,ye&&Ne)t:{for(ke=ye,te=Ne,J=0,re=ke;re;re=to(re))J++;for(re=0,me=te;me;me=to(me))re++;for(;0<J-re;)ke=to(ke),J--;for(;0<re-J;)te=to(te),re--;for(;J--;){if(ke===te||te!==null&&ke===te.alternate)break t;ke=to(ke),te=to(te)}ke=null}else ke=null;ye!==null&&hN(fe,ue,ye,ke,!1),Ne!==null&&dt!==null&&hN(fe,dt,Ne,ke,!0)}}e:{if(ue=oe?ro(oe):window,ye=ue.nodeName&&ue.nodeName.toLowerCase(),ye==="select"||ye==="input"&&ue.type==="file")var _e=XL;else if(W1(ue))if(G1)_e=e5;else{_e=JL;var Ee=QL}else(ye=ue.nodeName)&&ye.toLowerCase()==="input"&&(ue.type==="checkbox"||ue.type==="radio")&&(_e=ZL);if(_e&&(_e=_e(o,oe))){K1(fe,_e,m,de);break e}Ee&&Ee(o,ue,oe),o==="focusout"&&(Ee=ue._wrapperState)&&Ee.controlled&&ue.type==="number"&&Ve(ue,"number",ue.value)}switch(Ee=oe?ro(oe):window,o){case"focusin":(W1(Ee)||Ee.contentEditable==="true")&&(Zi=Ee,_h=oe,Ra=null);break;case"focusout":Ra=_h=Zi=null;break;case"mousedown":Eh=!0;break;case"contextmenu":case"mouseup":case"dragend":Eh=!1,nN(fe,m,de);break;case"selectionchange":if(r5)break;case"keydown":case"keyup":nN(fe,m,de)}var je;if(Nh)e:{switch(o){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Ji?H1(o,m)&&(Me="onCompositionEnd"):o==="keydown"&&m.keyCode===229&&(Me="onCompositionStart");Me&&(B1&&m.locale!=="ko"&&(Ji||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Ji&&(je=L1()):(ps=de,gh="value"in ps?ps.value:ps.textContent,Ji=!0)),Ee=qc(oe,Me),0<Ee.length&&(Me=new F1(Me,o,null,m,de),fe.push({event:Me,listeners:Ee}),je?Me.data=je:(je=U1(m),je!==null&&(Me.data=je)))),(je=UL?WL(o,m):KL(o,m))&&(oe=qc(oe,"onBeforeInput"),0<oe.length&&(de=new F1("onBeforeInput","beforeinput",null,m,de),fe.push({event:de,listeners:oe}),de.data=je))}dN(fe,l)})}function La(o,l,m){return{instance:o,listener:l,currentTarget:m}}function qc(o,l){for(var m=l+"Capture",x=[];o!==null;){var C=o,j=C.stateNode;C.tag===5&&j!==null&&(C=j,j=$r(o,m),j!=null&&x.unshift(La(o,j,C)),j=$r(o,l),j!=null&&x.push(La(o,j,C))),o=o.return}return x}function to(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function hN(o,l,m,x,C){for(var j=l._reactName,R=[];m!==null&&m!==x;){var W=m,X=W.alternate,oe=W.stateNode;if(X!==null&&X===x)break;W.tag===5&&oe!==null&&(W=oe,C?(X=$r(m,j),X!=null&&R.unshift(La(m,X,W))):C||(X=$r(m,j),X!=null&&R.push(La(m,X,W)))),m=m.return}R.length!==0&&o.push({event:l,listeners:R})}var a5=/\r\n?/g,l5=/\u0000|\uFFFD/g;function pN(o){return(typeof o=="string"?o:""+o).replace(a5,`
38
+ `).replace(l5,"")}function Bc(o,l,m){if(l=pN(l),pN(o)!==l&&m)throw Error(n(425))}function zc(){}var Rh=null,Oh=null;function Ph(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Lh=typeof setTimeout=="function"?setTimeout:void 0,c5=typeof clearTimeout=="function"?clearTimeout:void 0,mN=typeof Promise=="function"?Promise:void 0,u5=typeof queueMicrotask=="function"?queueMicrotask:typeof mN<"u"?function(o){return mN.resolve(null).then(o).catch(d5)}:Lh;function d5(o){setTimeout(function(){throw o})}function Dh(o,l){var m=l,x=0;do{var C=m.nextSibling;if(o.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(x===0){o.removeChild(C),_a(l);return}x--}else m!=="$"&&m!=="$?"&&m!=="$!"||x++;m=C}while(m);_a(l)}function gs(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function gN(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var m=o.data;if(m==="$"||m==="$!"||m==="$?"){if(l===0)return o;l--}else m==="/$"&&l++}o=o.previousSibling}return null}var no=Math.random().toString(36).slice(2),hr="__reactFiber$"+no,Da="__reactProps$"+no,Fr="__reactContainer$"+no,$h="__reactEvents$"+no,f5="__reactListeners$"+no,h5="__reactHandles$"+no;function ni(o){var l=o[hr];if(l)return l;for(var m=o.parentNode;m;){if(l=m[Fr]||m[hr]){if(m=l.alternate,l.child!==null||m!==null&&m.child!==null)for(o=gN(o);o!==null;){if(m=o[hr])return m;o=gN(o)}return l}o=m,m=o.parentNode}return null}function $a(o){return o=o[hr]||o[Fr],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function ro(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Vc(o){return o[Da]||null}var Fh=[],so=-1;function ys(o){return{current:o}}function Ze(o){0>so||(o.current=Fh[so],Fh[so]=null,so--)}function Ye(o,l){so++,Fh[so]=o.current,o.current=l}var xs={},Pt=ys(xs),Kt=ys(!1),ri=xs;function io(o,l){var m=o.type.contextTypes;if(!m)return xs;var x=o.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===l)return x.__reactInternalMemoizedMaskedChildContext;var C={},j;for(j in m)C[j]=l[j];return x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=C),C}function Gt(o){return o=o.childContextTypes,o!=null}function Hc(){Ze(Kt),Ze(Pt)}function yN(o,l,m){if(Pt.current!==xs)throw Error(n(168));Ye(Pt,l),Ye(Kt,m)}function xN(o,l,m){var x=o.stateNode;if(l=l.childContextTypes,typeof x.getChildContext!="function")return m;x=x.getChildContext();for(var C in x)if(!(C in l))throw Error(n(108,ee(o)||"Unknown",C));return Y({},m,x)}function Uc(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||xs,ri=Pt.current,Ye(Pt,o),Ye(Kt,Kt.current),!0}function vN(o,l,m){var x=o.stateNode;if(!x)throw Error(n(169));m?(o=xN(o,l,ri),x.__reactInternalMemoizedMergedChildContext=o,Ze(Kt),Ze(Pt),Ye(Pt,o)):Ze(Kt),Ye(Kt,m)}var qr=null,Wc=!1,qh=!1;function bN(o){qr===null?qr=[o]:qr.push(o)}function p5(o){Wc=!0,bN(o)}function vs(){if(!qh&&qr!==null){qh=!0;var o=0,l=Ke;try{var m=qr;for(Ke=1;o<m.length;o++){var x=m[o];do x=x(!0);while(x!==null)}qr=null,Wc=!1}catch(C){throw qr!==null&&(qr=qr.slice(o+1)),wc(va,vs),C}finally{Ke=l,qh=!1}}return null}var oo=[],ao=0,Kc=null,Gc=0,Nn=[],kn=0,si=null,Br=1,zr="";function ii(o,l){oo[ao++]=Gc,oo[ao++]=Kc,Kc=o,Gc=l}function wN(o,l,m){Nn[kn++]=Br,Nn[kn++]=zr,Nn[kn++]=si,si=o;var x=Br;o=zr;var C=32-an(x)-1;x&=~(1<<C),m+=1;var j=32-an(l)+C;if(30<j){var R=C-C%5;j=(x&(1<<R)-1).toString(32),x>>=R,C-=R,Br=1<<32-an(l)+C|m<<C|x,zr=j+o}else Br=1<<j|m<<C|x,zr=o}function Bh(o){o.return!==null&&(ii(o,1),wN(o,1,0))}function zh(o){for(;o===Kc;)Kc=oo[--ao],oo[ao]=null,Gc=oo[--ao],oo[ao]=null;for(;o===si;)si=Nn[--kn],Nn[kn]=null,zr=Nn[--kn],Nn[kn]=null,Br=Nn[--kn],Nn[kn]=null}var cn=null,un=null,tt=!1,Bn=null;function NN(o,l){var m=En(5,null,null,0);m.elementType="DELETED",m.stateNode=l,m.return=o,l=o.deletions,l===null?(o.deletions=[m],o.flags|=16):l.push(m)}function kN(o,l){switch(o.tag){case 5:var m=o.type;return l=l.nodeType!==1||m.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,cn=o,un=gs(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,cn=o,un=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(m=si!==null?{id:Br,overflow:zr}:null,o.memoizedState={dehydrated:l,treeContext:m,retryLane:1073741824},m=En(18,null,null,0),m.stateNode=l,m.return=o,o.child=m,cn=o,un=null,!0):!1;default:return!1}}function Vh(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Hh(o){if(tt){var l=un;if(l){var m=l;if(!kN(o,l)){if(Vh(o))throw Error(n(418));l=gs(m.nextSibling);var x=cn;l&&kN(o,l)?NN(x,m):(o.flags=o.flags&-4097|2,tt=!1,cn=o)}}else{if(Vh(o))throw Error(n(418));o.flags=o.flags&-4097|2,tt=!1,cn=o}}}function SN(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;cn=o}function Yc(o){if(o!==cn)return!1;if(!tt)return SN(o),tt=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!Ph(o.type,o.memoizedProps)),l&&(l=un)){if(Vh(o))throw CN(),Error(n(418));for(;l;)NN(o,l),l=gs(l.nextSibling)}if(SN(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var m=o.data;if(m==="/$"){if(l===0){un=gs(o.nextSibling);break e}l--}else m!=="$"&&m!=="$!"&&m!=="$?"||l++}o=o.nextSibling}un=null}}else un=cn?gs(o.stateNode.nextSibling):null;return!0}function CN(){for(var o=un;o;)o=gs(o.nextSibling)}function lo(){un=cn=null,tt=!1}function Uh(o){Bn===null?Bn=[o]:Bn.push(o)}var m5=_.ReactCurrentBatchConfig;function Fa(o,l,m){if(o=m.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var x=m.stateNode}if(!x)throw Error(n(147,o));var C=x,j=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===j?l.ref:(l=function(R){var W=C.refs;R===null?delete W[j]:W[j]=R},l._stringRef=j,l)}if(typeof o!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,o))}return o}function Xc(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function _N(o){var l=o._init;return l(o._payload)}function EN(o){function l(te,J){if(o){var re=te.deletions;re===null?(te.deletions=[J],te.flags|=16):re.push(J)}}function m(te,J){if(!o)return null;for(;J!==null;)l(te,J),J=J.sibling;return null}function x(te,J){for(te=new Map;J!==null;)J.key!==null?te.set(J.key,J):te.set(J.index,J),J=J.sibling;return te}function C(te,J){return te=Es(te,J),te.index=0,te.sibling=null,te}function j(te,J,re){return te.index=re,o?(re=te.alternate,re!==null?(re=re.index,re<J?(te.flags|=2,J):re):(te.flags|=2,J)):(te.flags|=1048576,J)}function R(te){return o&&te.alternate===null&&(te.flags|=2),te}function W(te,J,re,me){return J===null||J.tag!==6?(J=Lp(re,te.mode,me),J.return=te,J):(J=C(J,re),J.return=te,J)}function X(te,J,re,me){var _e=re.type;return _e===T?de(te,J,re.props.children,me,re.key):J!==null&&(J.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===V&&_N(_e)===J.type)?(me=C(J,re.props),me.ref=Fa(te,J,re),me.return=te,me):(me=bu(re.type,re.key,re.props,null,te.mode,me),me.ref=Fa(te,J,re),me.return=te,me)}function oe(te,J,re,me){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=Dp(re,te.mode,me),J.return=te,J):(J=C(J,re.children||[]),J.return=te,J)}function de(te,J,re,me,_e){return J===null||J.tag!==7?(J=hi(re,te.mode,me,_e),J.return=te,J):(J=C(J,re),J.return=te,J)}function fe(te,J,re){if(typeof J=="string"&&J!==""||typeof J=="number")return J=Lp(""+J,te.mode,re),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return re=bu(J.type,J.key,J.props,null,te.mode,re),re.ref=Fa(te,null,J),re.return=te,re;case I:return J=Dp(J,te.mode,re),J.return=te,J;case V:var me=J._init;return fe(te,me(J._payload),re)}if(jt(J)||F(J))return J=hi(J,te.mode,re,null),J.return=te,J;Xc(te,J)}return null}function ue(te,J,re,me){var _e=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return _e!==null?null:W(te,J,""+re,me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case A:return re.key===_e?X(te,J,re,me):null;case I:return re.key===_e?oe(te,J,re,me):null;case V:return _e=re._init,ue(te,J,_e(re._payload),me)}if(jt(re)||F(re))return _e!==null?null:de(te,J,re,me,null);Xc(te,re)}return null}function ye(te,J,re,me,_e){if(typeof me=="string"&&me!==""||typeof me=="number")return te=te.get(re)||null,W(J,te,""+me,_e);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case A:return te=te.get(me.key===null?re:me.key)||null,X(J,te,me,_e);case I:return te=te.get(me.key===null?re:me.key)||null,oe(J,te,me,_e);case V:var Ee=me._init;return ye(te,J,re,Ee(me._payload),_e)}if(jt(me)||F(me))return te=te.get(re)||null,de(J,te,me,_e,null);Xc(J,me)}return null}function Ne(te,J,re,me){for(var _e=null,Ee=null,je=J,Me=J=0,Et=null;je!==null&&Me<re.length;Me++){je.index>Me?(Et=je,je=null):Et=je.sibling;var Be=ue(te,je,re[Me],me);if(Be===null){je===null&&(je=Et);break}o&&je&&Be.alternate===null&&l(te,je),J=j(Be,J,Me),Ee===null?_e=Be:Ee.sibling=Be,Ee=Be,je=Et}if(Me===re.length)return m(te,je),tt&&ii(te,Me),_e;if(je===null){for(;Me<re.length;Me++)je=fe(te,re[Me],me),je!==null&&(J=j(je,J,Me),Ee===null?_e=je:Ee.sibling=je,Ee=je);return tt&&ii(te,Me),_e}for(je=x(te,je);Me<re.length;Me++)Et=ye(je,te,Me,re[Me],me),Et!==null&&(o&&Et.alternate!==null&&je.delete(Et.key===null?Me:Et.key),J=j(Et,J,Me),Ee===null?_e=Et:Ee.sibling=Et,Ee=Et);return o&&je.forEach(function(js){return l(te,js)}),tt&&ii(te,Me),_e}function ke(te,J,re,me){var _e=F(re);if(typeof _e!="function")throw Error(n(150));if(re=_e.call(re),re==null)throw Error(n(151));for(var Ee=_e=null,je=J,Me=J=0,Et=null,Be=re.next();je!==null&&!Be.done;Me++,Be=re.next()){je.index>Me?(Et=je,je=null):Et=je.sibling;var js=ue(te,je,Be.value,me);if(js===null){je===null&&(je=Et);break}o&&je&&js.alternate===null&&l(te,je),J=j(js,J,Me),Ee===null?_e=js:Ee.sibling=js,Ee=js,je=Et}if(Be.done)return m(te,je),tt&&ii(te,Me),_e;if(je===null){for(;!Be.done;Me++,Be=re.next())Be=fe(te,Be.value,me),Be!==null&&(J=j(Be,J,Me),Ee===null?_e=Be:Ee.sibling=Be,Ee=Be);return tt&&ii(te,Me),_e}for(je=x(te,je);!Be.done;Me++,Be=re.next())Be=ye(je,te,Me,Be.value,me),Be!==null&&(o&&Be.alternate!==null&&je.delete(Be.key===null?Me:Be.key),J=j(Be,J,Me),Ee===null?_e=Be:Ee.sibling=Be,Ee=Be);return o&&je.forEach(function(G5){return l(te,G5)}),tt&&ii(te,Me),_e}function dt(te,J,re,me){if(typeof re=="object"&&re!==null&&re.type===T&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case A:e:{for(var _e=re.key,Ee=J;Ee!==null;){if(Ee.key===_e){if(_e=re.type,_e===T){if(Ee.tag===7){m(te,Ee.sibling),J=C(Ee,re.props.children),J.return=te,te=J;break e}}else if(Ee.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===V&&_N(_e)===Ee.type){m(te,Ee.sibling),J=C(Ee,re.props),J.ref=Fa(te,Ee,re),J.return=te,te=J;break e}m(te,Ee);break}else l(te,Ee);Ee=Ee.sibling}re.type===T?(J=hi(re.props.children,te.mode,me,re.key),J.return=te,te=J):(me=bu(re.type,re.key,re.props,null,te.mode,me),me.ref=Fa(te,J,re),me.return=te,te=me)}return R(te);case I:e:{for(Ee=re.key;J!==null;){if(J.key===Ee)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){m(te,J.sibling),J=C(J,re.children||[]),J.return=te,te=J;break e}else{m(te,J);break}else l(te,J);J=J.sibling}J=Dp(re,te.mode,me),J.return=te,te=J}return R(te);case V:return Ee=re._init,dt(te,J,Ee(re._payload),me)}if(jt(re))return Ne(te,J,re,me);if(F(re))return ke(te,J,re,me);Xc(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,J!==null&&J.tag===6?(m(te,J.sibling),J=C(J,re),J.return=te,te=J):(m(te,J),J=Lp(re,te.mode,me),J.return=te,te=J),R(te)):m(te,J)}return dt}var co=EN(!0),jN=EN(!1),Qc=ys(null),Jc=null,uo=null,Wh=null;function Kh(){Wh=uo=Jc=null}function Gh(o){var l=Qc.current;Ze(Qc),o._currentValue=l}function Yh(o,l,m){for(;o!==null;){var x=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,x!==null&&(x.childLanes|=l)):x!==null&&(x.childLanes&l)!==l&&(x.childLanes|=l),o===m)break;o=o.return}}function fo(o,l){Jc=o,Wh=uo=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(Yt=!0),o.firstContext=null)}function Sn(o){var l=o._currentValue;if(Wh!==o)if(o={context:o,memoizedValue:l,next:null},uo===null){if(Jc===null)throw Error(n(308));uo=o,Jc.dependencies={lanes:0,firstContext:o}}else uo=uo.next=o;return l}var oi=null;function Xh(o){oi===null?oi=[o]:oi.push(o)}function AN(o,l,m,x){var C=l.interleaved;return C===null?(m.next=m,Xh(l)):(m.next=C.next,C.next=m),l.interleaved=m,Vr(o,x)}function Vr(o,l){o.lanes|=l;var m=o.alternate;for(m!==null&&(m.lanes|=l),m=o,o=o.return;o!==null;)o.childLanes|=l,m=o.alternate,m!==null&&(m.childLanes|=l),m=o,o=o.return;return m.tag===3?m.stateNode:null}var bs=!1;function Qh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function TN(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Hr(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function ws(o,l,m){var x=o.updateQueue;if(x===null)return null;if(x=x.shared,(Fe&2)!==0){var C=x.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),x.pending=l,Vr(o,m)}return C=x.interleaved,C===null?(l.next=l,Xh(x)):(l.next=C.next,C.next=l),x.interleaved=l,Vr(o,m)}function Zc(o,l,m){if(l=l.updateQueue,l!==null&&(l=l.shared,(m&4194240)!==0)){var x=l.lanes;x&=o.pendingLanes,m|=x,l.lanes=m,dh(o,m)}}function IN(o,l){var m=o.updateQueue,x=o.alternate;if(x!==null&&(x=x.updateQueue,m===x)){var C=null,j=null;if(m=m.firstBaseUpdate,m!==null){do{var R={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};j===null?C=j=R:j=j.next=R,m=m.next}while(m!==null);j===null?C=j=l:j=j.next=l}else C=j=l;m={baseState:x.baseState,firstBaseUpdate:C,lastBaseUpdate:j,shared:x.shared,effects:x.effects},o.updateQueue=m;return}o=m.lastBaseUpdate,o===null?m.firstBaseUpdate=l:o.next=l,m.lastBaseUpdate=l}function eu(o,l,m,x){var C=o.updateQueue;bs=!1;var j=C.firstBaseUpdate,R=C.lastBaseUpdate,W=C.shared.pending;if(W!==null){C.shared.pending=null;var X=W,oe=X.next;X.next=null,R===null?j=oe:R.next=oe,R=X;var de=o.alternate;de!==null&&(de=de.updateQueue,W=de.lastBaseUpdate,W!==R&&(W===null?de.firstBaseUpdate=oe:W.next=oe,de.lastBaseUpdate=X))}if(j!==null){var fe=C.baseState;R=0,de=oe=X=null,W=j;do{var ue=W.lane,ye=W.eventTime;if((x&ue)===ue){de!==null&&(de=de.next={eventTime:ye,lane:0,tag:W.tag,payload:W.payload,callback:W.callback,next:null});e:{var Ne=o,ke=W;switch(ue=l,ye=m,ke.tag){case 1:if(Ne=ke.payload,typeof Ne=="function"){fe=Ne.call(ye,fe,ue);break e}fe=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=ke.payload,ue=typeof Ne=="function"?Ne.call(ye,fe,ue):Ne,ue==null)break e;fe=Y({},fe,ue);break e;case 2:bs=!0}}W.callback!==null&&W.lane!==0&&(o.flags|=64,ue=C.effects,ue===null?C.effects=[W]:ue.push(W))}else ye={eventTime:ye,lane:ue,tag:W.tag,payload:W.payload,callback:W.callback,next:null},de===null?(oe=de=ye,X=fe):de=de.next=ye,R|=ue;if(W=W.next,W===null){if(W=C.shared.pending,W===null)break;ue=W,W=ue.next,ue.next=null,C.lastBaseUpdate=ue,C.shared.pending=null}}while(!0);if(de===null&&(X=fe),C.baseState=X,C.firstBaseUpdate=oe,C.lastBaseUpdate=de,l=C.shared.interleaved,l!==null){C=l;do R|=C.lane,C=C.next;while(C!==l)}else j===null&&(C.shared.lanes=0);ci|=R,o.lanes=R,o.memoizedState=fe}}function MN(o,l,m){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var x=o[l],C=x.callback;if(C!==null){if(x.callback=null,x=m,typeof C!="function")throw Error(n(191,C));C.call(x)}}}var qa={},pr=ys(qa),Ba=ys(qa),za=ys(qa);function ai(o){if(o===qa)throw Error(n(174));return o}function Jh(o,l){switch(Ye(za,l),Ye(Ba,o),Ye(pr,qa),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:ut(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=ut(l,o)}Ze(pr),Ye(pr,l)}function ho(){Ze(pr),Ze(Ba),Ze(za)}function RN(o){ai(za.current);var l=ai(pr.current),m=ut(l,o.type);l!==m&&(Ye(Ba,o),Ye(pr,m))}function Zh(o){Ba.current===o&&(Ze(pr),Ze(Ba))}var at=ys(0);function tu(o){for(var l=o;l!==null;){if(l.tag===13){var m=l.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.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===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var ep=[];function tp(){for(var o=0;o<ep.length;o++)ep[o]._workInProgressVersionPrimary=null;ep.length=0}var nu=_.ReactCurrentDispatcher,np=_.ReactCurrentBatchConfig,li=0,lt=null,wt=null,Ct=null,ru=!1,Va=!1,Ha=0,g5=0;function Lt(){throw Error(n(321))}function rp(o,l){if(l===null)return!1;for(var m=0;m<l.length&&m<o.length;m++)if(!qn(o[m],l[m]))return!1;return!0}function sp(o,l,m,x,C,j){if(li=j,lt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,nu.current=o===null||o.memoizedState===null?b5:w5,o=m(x,C),Va){j=0;do{if(Va=!1,Ha=0,25<=j)throw Error(n(301));j+=1,Ct=wt=null,l.updateQueue=null,nu.current=N5,o=m(x,C)}while(Va)}if(nu.current=ou,l=wt!==null&&wt.next!==null,li=0,Ct=wt=lt=null,ru=!1,l)throw Error(n(300));return o}function ip(){var o=Ha!==0;return Ha=0,o}function mr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?lt.memoizedState=Ct=o:Ct=Ct.next=o,Ct}function Cn(){if(wt===null){var o=lt.alternate;o=o!==null?o.memoizedState:null}else o=wt.next;var l=Ct===null?lt.memoizedState:Ct.next;if(l!==null)Ct=l,wt=o;else{if(o===null)throw Error(n(310));wt=o,o={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},Ct===null?lt.memoizedState=Ct=o:Ct=Ct.next=o}return Ct}function Ua(o,l){return typeof l=="function"?l(o):l}function op(o){var l=Cn(),m=l.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=o;var x=wt,C=x.baseQueue,j=m.pending;if(j!==null){if(C!==null){var R=C.next;C.next=j.next,j.next=R}x.baseQueue=C=j,m.pending=null}if(C!==null){j=C.next,x=x.baseState;var W=R=null,X=null,oe=j;do{var de=oe.lane;if((li&de)===de)X!==null&&(X=X.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),x=oe.hasEagerState?oe.eagerState:o(x,oe.action);else{var fe={lane:de,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};X===null?(W=X=fe,R=x):X=X.next=fe,lt.lanes|=de,ci|=de}oe=oe.next}while(oe!==null&&oe!==j);X===null?R=x:X.next=W,qn(x,l.memoizedState)||(Yt=!0),l.memoizedState=x,l.baseState=R,l.baseQueue=X,m.lastRenderedState=x}if(o=m.interleaved,o!==null){C=o;do j=C.lane,lt.lanes|=j,ci|=j,C=C.next;while(C!==o)}else C===null&&(m.lanes=0);return[l.memoizedState,m.dispatch]}function ap(o){var l=Cn(),m=l.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=o;var x=m.dispatch,C=m.pending,j=l.memoizedState;if(C!==null){m.pending=null;var R=C=C.next;do j=o(j,R.action),R=R.next;while(R!==C);qn(j,l.memoizedState)||(Yt=!0),l.memoizedState=j,l.baseQueue===null&&(l.baseState=j),m.lastRenderedState=j}return[j,x]}function ON(){}function PN(o,l){var m=lt,x=Cn(),C=l(),j=!qn(x.memoizedState,C);if(j&&(x.memoizedState=C,Yt=!0),x=x.queue,lp($N.bind(null,m,x,o),[o]),x.getSnapshot!==l||j||Ct!==null&&Ct.memoizedState.tag&1){if(m.flags|=2048,Wa(9,DN.bind(null,m,x,C,l),void 0,null),_t===null)throw Error(n(349));(li&30)!==0||LN(m,l,C)}return C}function LN(o,l,m){o.flags|=16384,o={getSnapshot:l,value:m},l=lt.updateQueue,l===null?(l={lastEffect:null,stores:null},lt.updateQueue=l,l.stores=[o]):(m=l.stores,m===null?l.stores=[o]:m.push(o))}function DN(o,l,m,x){l.value=m,l.getSnapshot=x,FN(l)&&qN(o)}function $N(o,l,m){return m(function(){FN(l)&&qN(o)})}function FN(o){var l=o.getSnapshot;o=o.value;try{var m=l();return!qn(o,m)}catch{return!0}}function qN(o){var l=Vr(o,1);l!==null&&Un(l,o,1,-1)}function BN(o){var l=mr();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:o},l.queue=o,o=o.dispatch=v5.bind(null,lt,o),[l.memoizedState,o]}function Wa(o,l,m,x){return o={tag:o,create:l,destroy:m,deps:x,next:null},l=lt.updateQueue,l===null?(l={lastEffect:null,stores:null},lt.updateQueue=l,l.lastEffect=o.next=o):(m=l.lastEffect,m===null?l.lastEffect=o.next=o:(x=m.next,m.next=o,o.next=x,l.lastEffect=o)),o}function zN(){return Cn().memoizedState}function su(o,l,m,x){var C=mr();lt.flags|=o,C.memoizedState=Wa(1|l,m,void 0,x===void 0?null:x)}function iu(o,l,m,x){var C=Cn();x=x===void 0?null:x;var j=void 0;if(wt!==null){var R=wt.memoizedState;if(j=R.destroy,x!==null&&rp(x,R.deps)){C.memoizedState=Wa(l,m,j,x);return}}lt.flags|=o,C.memoizedState=Wa(1|l,m,j,x)}function VN(o,l){return su(8390656,8,o,l)}function lp(o,l){return iu(2048,8,o,l)}function HN(o,l){return iu(4,2,o,l)}function UN(o,l){return iu(4,4,o,l)}function WN(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function KN(o,l,m){return m=m!=null?m.concat([o]):null,iu(4,4,WN.bind(null,l,o),m)}function cp(){}function GN(o,l){var m=Cn();l=l===void 0?null:l;var x=m.memoizedState;return x!==null&&l!==null&&rp(l,x[1])?x[0]:(m.memoizedState=[o,l],o)}function YN(o,l){var m=Cn();l=l===void 0?null:l;var x=m.memoizedState;return x!==null&&l!==null&&rp(l,x[1])?x[0]:(o=o(),m.memoizedState=[o,l],o)}function XN(o,l,m){return(li&21)===0?(o.baseState&&(o.baseState=!1,Yt=!0),o.memoizedState=m):(qn(m,l)||(m=Yi(),lt.lanes|=m,ci|=m,o.baseState=!0),l)}function y5(o,l){var m=Ke;Ke=m!==0&&4>m?m:4,o(!0);var x=np.transition;np.transition={};try{o(!1),l()}finally{Ke=m,np.transition=x}}function QN(){return Cn().memoizedState}function x5(o,l,m){var x=Cs(o);if(m={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null},JN(o))ZN(l,m);else if(m=AN(o,l,m,x),m!==null){var C=Bt();Un(m,o,x,C),ek(m,l,x)}}function v5(o,l,m){var x=Cs(o),C={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null};if(JN(o))ZN(l,C);else{var j=o.alternate;if(o.lanes===0&&(j===null||j.lanes===0)&&(j=l.lastRenderedReducer,j!==null))try{var R=l.lastRenderedState,W=j(R,m);if(C.hasEagerState=!0,C.eagerState=W,qn(W,R)){var X=l.interleaved;X===null?(C.next=C,Xh(l)):(C.next=X.next,X.next=C),l.interleaved=C;return}}catch{}finally{}m=AN(o,l,C,x),m!==null&&(C=Bt(),Un(m,o,x,C),ek(m,l,x))}}function JN(o){var l=o.alternate;return o===lt||l!==null&&l===lt}function ZN(o,l){Va=ru=!0;var m=o.pending;m===null?l.next=l:(l.next=m.next,m.next=l),o.pending=l}function ek(o,l,m){if((m&4194240)!==0){var x=l.lanes;x&=o.pendingLanes,m|=x,l.lanes=m,dh(o,m)}}var ou={readContext:Sn,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useInsertionEffect:Lt,useLayoutEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useMutableSource:Lt,useSyncExternalStore:Lt,useId:Lt,unstable_isNewReconciler:!1},b5={readContext:Sn,useCallback:function(o,l){return mr().memoizedState=[o,l===void 0?null:l],o},useContext:Sn,useEffect:VN,useImperativeHandle:function(o,l,m){return m=m!=null?m.concat([o]):null,su(4194308,4,WN.bind(null,l,o),m)},useLayoutEffect:function(o,l){return su(4194308,4,o,l)},useInsertionEffect:function(o,l){return su(4,2,o,l)},useMemo:function(o,l){var m=mr();return l=l===void 0?null:l,o=o(),m.memoizedState=[o,l],o},useReducer:function(o,l,m){var x=mr();return l=m!==void 0?m(l):l,x.memoizedState=x.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},x.queue=o,o=o.dispatch=x5.bind(null,lt,o),[x.memoizedState,o]},useRef:function(o){var l=mr();return o={current:o},l.memoizedState=o},useState:BN,useDebugValue:cp,useDeferredValue:function(o){return mr().memoizedState=o},useTransition:function(){var o=BN(!1),l=o[0];return o=y5.bind(null,o[1]),mr().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,m){var x=lt,C=mr();if(tt){if(m===void 0)throw Error(n(407));m=m()}else{if(m=l(),_t===null)throw Error(n(349));(li&30)!==0||LN(x,l,m)}C.memoizedState=m;var j={value:m,getSnapshot:l};return C.queue=j,VN($N.bind(null,x,j,o),[o]),x.flags|=2048,Wa(9,DN.bind(null,x,j,m,l),void 0,null),m},useId:function(){var o=mr(),l=_t.identifierPrefix;if(tt){var m=zr,x=Br;m=(x&~(1<<32-an(x)-1)).toString(32)+m,l=":"+l+"R"+m,m=Ha++,0<m&&(l+="H"+m.toString(32)),l+=":"}else m=g5++,l=":"+l+"r"+m.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},w5={readContext:Sn,useCallback:GN,useContext:Sn,useEffect:lp,useImperativeHandle:KN,useInsertionEffect:HN,useLayoutEffect:UN,useMemo:YN,useReducer:op,useRef:zN,useState:function(){return op(Ua)},useDebugValue:cp,useDeferredValue:function(o){var l=Cn();return XN(l,wt.memoizedState,o)},useTransition:function(){var o=op(Ua)[0],l=Cn().memoizedState;return[o,l]},useMutableSource:ON,useSyncExternalStore:PN,useId:QN,unstable_isNewReconciler:!1},N5={readContext:Sn,useCallback:GN,useContext:Sn,useEffect:lp,useImperativeHandle:KN,useInsertionEffect:HN,useLayoutEffect:UN,useMemo:YN,useReducer:ap,useRef:zN,useState:function(){return ap(Ua)},useDebugValue:cp,useDeferredValue:function(o){var l=Cn();return wt===null?l.memoizedState=o:XN(l,wt.memoizedState,o)},useTransition:function(){var o=ap(Ua)[0],l=Cn().memoizedState;return[o,l]},useMutableSource:ON,useSyncExternalStore:PN,useId:QN,unstable_isNewReconciler:!1};function zn(o,l){if(o&&o.defaultProps){l=Y({},l),o=o.defaultProps;for(var m in o)l[m]===void 0&&(l[m]=o[m]);return l}return l}function up(o,l,m,x){l=o.memoizedState,m=m(x,l),m=m==null?l:Y({},l,m),o.memoizedState=m,o.lanes===0&&(o.updateQueue.baseState=m)}var au={isMounted:function(o){return(o=o._reactInternals)?dr(o)===o:!1},enqueueSetState:function(o,l,m){o=o._reactInternals;var x=Bt(),C=Cs(o),j=Hr(x,C);j.payload=l,m!=null&&(j.callback=m),l=ws(o,j,C),l!==null&&(Un(l,o,C,x),Zc(l,o,C))},enqueueReplaceState:function(o,l,m){o=o._reactInternals;var x=Bt(),C=Cs(o),j=Hr(x,C);j.tag=1,j.payload=l,m!=null&&(j.callback=m),l=ws(o,j,C),l!==null&&(Un(l,o,C,x),Zc(l,o,C))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var m=Bt(),x=Cs(o),C=Hr(m,x);C.tag=2,l!=null&&(C.callback=l),l=ws(o,C,x),l!==null&&(Un(l,o,x,m),Zc(l,o,x))}};function tk(o,l,m,x,C,j,R){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(x,j,R):l.prototype&&l.prototype.isPureReactComponent?!Ma(m,x)||!Ma(C,j):!0}function nk(o,l,m){var x=!1,C=xs,j=l.contextType;return typeof j=="object"&&j!==null?j=Sn(j):(C=Gt(l)?ri:Pt.current,x=l.contextTypes,j=(x=x!=null)?io(o,C):xs),l=new l(m,j),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=au,o.stateNode=l,l._reactInternals=o,x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=C,o.__reactInternalMemoizedMaskedChildContext=j),l}function rk(o,l,m,x){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(m,x),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(m,x),l.state!==o&&au.enqueueReplaceState(l,l.state,null)}function dp(o,l,m,x){var C=o.stateNode;C.props=m,C.state=o.memoizedState,C.refs={},Qh(o);var j=l.contextType;typeof j=="object"&&j!==null?C.context=Sn(j):(j=Gt(l)?ri:Pt.current,C.context=io(o,j)),C.state=o.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(up(o,l,j,m),C.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(l=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),l!==C.state&&au.enqueueReplaceState(C,C.state,null),eu(o,m,C,x),C.state=o.memoizedState),typeof C.componentDidMount=="function"&&(o.flags|=4194308)}function po(o,l){try{var m="",x=l;do m+=Q(x),x=x.return;while(x);var C=m}catch(j){C=`
39
+ Error generating stack: `+j.message+`
40
+ `+j.stack}return{value:o,source:l,stack:C,digest:null}}function fp(o,l,m){return{value:o,source:null,stack:m??null,digest:l??null}}function hp(o,l){try{console.error(l.value)}catch(m){setTimeout(function(){throw m})}}var k5=typeof WeakMap=="function"?WeakMap:Map;function sk(o,l,m){m=Hr(-1,m),m.tag=3,m.payload={element:null};var x=l.value;return m.callback=function(){pu||(pu=!0,jp=x),hp(o,l)},m}function ik(o,l,m){m=Hr(-1,m),m.tag=3;var x=o.type.getDerivedStateFromError;if(typeof x=="function"){var C=l.value;m.payload=function(){return x(C)},m.callback=function(){hp(o,l)}}var j=o.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(m.callback=function(){hp(o,l),typeof x!="function"&&(ks===null?ks=new Set([this]):ks.add(this));var R=l.stack;this.componentDidCatch(l.value,{componentStack:R!==null?R:""})}),m}function ok(o,l,m){var x=o.pingCache;if(x===null){x=o.pingCache=new k5;var C=new Set;x.set(l,C)}else C=x.get(l),C===void 0&&(C=new Set,x.set(l,C));C.has(m)||(C.add(m),o=D5.bind(null,o,l,m),l.then(o,o))}function ak(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function lk(o,l,m,x,C){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(l=Hr(-1,1),l.tag=2,ws(m,l,1))),m.lanes|=1),o):(o.flags|=65536,o.lanes=C,o)}var S5=_.ReactCurrentOwner,Yt=!1;function qt(o,l,m,x){l.child=o===null?jN(l,null,m,x):co(l,o.child,m,x)}function ck(o,l,m,x,C){m=m.render;var j=l.ref;return fo(l,C),x=sp(o,l,m,x,j,C),m=ip(),o!==null&&!Yt?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~C,Ur(o,l,C)):(tt&&m&&Bh(l),l.flags|=1,qt(o,l,x,C),l.child)}function uk(o,l,m,x,C){if(o===null){var j=m.type;return typeof j=="function"&&!Pp(j)&&j.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(l.tag=15,l.type=j,dk(o,l,j,x,C)):(o=bu(m.type,null,x,l,l.mode,C),o.ref=l.ref,o.return=l,l.child=o)}if(j=o.child,(o.lanes&C)===0){var R=j.memoizedProps;if(m=m.compare,m=m!==null?m:Ma,m(R,x)&&o.ref===l.ref)return Ur(o,l,C)}return l.flags|=1,o=Es(j,x),o.ref=l.ref,o.return=l,l.child=o}function dk(o,l,m,x,C){if(o!==null){var j=o.memoizedProps;if(Ma(j,x)&&o.ref===l.ref)if(Yt=!1,l.pendingProps=x=j,(o.lanes&C)!==0)(o.flags&131072)!==0&&(Yt=!0);else return l.lanes=o.lanes,Ur(o,l,C)}return pp(o,l,m,x,C)}function fk(o,l,m){var x=l.pendingProps,C=x.children,j=o!==null?o.memoizedState:null;if(x.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ye(go,dn),dn|=m;else{if((m&1073741824)===0)return o=j!==null?j.baseLanes|m:m,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Ye(go,dn),dn|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=j!==null?j.baseLanes:m,Ye(go,dn),dn|=x}else j!==null?(x=j.baseLanes|m,l.memoizedState=null):x=m,Ye(go,dn),dn|=x;return qt(o,l,C,m),l.child}function hk(o,l){var m=l.ref;(o===null&&m!==null||o!==null&&o.ref!==m)&&(l.flags|=512,l.flags|=2097152)}function pp(o,l,m,x,C){var j=Gt(m)?ri:Pt.current;return j=io(l,j),fo(l,C),m=sp(o,l,m,x,j,C),x=ip(),o!==null&&!Yt?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~C,Ur(o,l,C)):(tt&&x&&Bh(l),l.flags|=1,qt(o,l,m,C),l.child)}function pk(o,l,m,x,C){if(Gt(m)){var j=!0;Uc(l)}else j=!1;if(fo(l,C),l.stateNode===null)cu(o,l),nk(l,m,x),dp(l,m,x,C),x=!0;else if(o===null){var R=l.stateNode,W=l.memoizedProps;R.props=W;var X=R.context,oe=m.contextType;typeof oe=="object"&&oe!==null?oe=Sn(oe):(oe=Gt(m)?ri:Pt.current,oe=io(l,oe));var de=m.getDerivedStateFromProps,fe=typeof de=="function"||typeof R.getSnapshotBeforeUpdate=="function";fe||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(W!==x||X!==oe)&&rk(l,R,x,oe),bs=!1;var ue=l.memoizedState;R.state=ue,eu(l,x,R,C),X=l.memoizedState,W!==x||ue!==X||Kt.current||bs?(typeof de=="function"&&(up(l,m,de,x),X=l.memoizedState),(W=bs||tk(l,m,W,x,ue,X,oe))?(fe||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(l.flags|=4194308)):(typeof R.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=x,l.memoizedState=X),R.props=x,R.state=X,R.context=oe,x=W):(typeof R.componentDidMount=="function"&&(l.flags|=4194308),x=!1)}else{R=l.stateNode,TN(o,l),W=l.memoizedProps,oe=l.type===l.elementType?W:zn(l.type,W),R.props=oe,fe=l.pendingProps,ue=R.context,X=m.contextType,typeof X=="object"&&X!==null?X=Sn(X):(X=Gt(m)?ri:Pt.current,X=io(l,X));var ye=m.getDerivedStateFromProps;(de=typeof ye=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(W!==fe||ue!==X)&&rk(l,R,x,X),bs=!1,ue=l.memoizedState,R.state=ue,eu(l,x,R,C);var Ne=l.memoizedState;W!==fe||ue!==Ne||Kt.current||bs?(typeof ye=="function"&&(up(l,m,ye,x),Ne=l.memoizedState),(oe=bs||tk(l,m,oe,x,ue,Ne,X)||!1)?(de||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(x,Ne,X),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(x,Ne,X)),typeof R.componentDidUpdate=="function"&&(l.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof R.componentDidUpdate!="function"||W===o.memoizedProps&&ue===o.memoizedState||(l.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||W===o.memoizedProps&&ue===o.memoizedState||(l.flags|=1024),l.memoizedProps=x,l.memoizedState=Ne),R.props=x,R.state=Ne,R.context=X,x=oe):(typeof R.componentDidUpdate!="function"||W===o.memoizedProps&&ue===o.memoizedState||(l.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||W===o.memoizedProps&&ue===o.memoizedState||(l.flags|=1024),x=!1)}return mp(o,l,m,x,j,C)}function mp(o,l,m,x,C,j){hk(o,l);var R=(l.flags&128)!==0;if(!x&&!R)return C&&vN(l,m,!1),Ur(o,l,j);x=l.stateNode,S5.current=l;var W=R&&typeof m.getDerivedStateFromError!="function"?null:x.render();return l.flags|=1,o!==null&&R?(l.child=co(l,o.child,null,j),l.child=co(l,null,W,j)):qt(o,l,W,j),l.memoizedState=x.state,C&&vN(l,m,!0),l.child}function mk(o){var l=o.stateNode;l.pendingContext?yN(o,l.pendingContext,l.pendingContext!==l.context):l.context&&yN(o,l.context,!1),Jh(o,l.containerInfo)}function gk(o,l,m,x,C){return lo(),Uh(C),l.flags|=256,qt(o,l,m,x),l.child}var gp={dehydrated:null,treeContext:null,retryLane:0};function yp(o){return{baseLanes:o,cachePool:null,transitions:null}}function yk(o,l,m){var x=l.pendingProps,C=at.current,j=!1,R=(l.flags&128)!==0,W;if((W=R)||(W=o!==null&&o.memoizedState===null?!1:(C&2)!==0),W?(j=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(C|=1),Ye(at,C&1),o===null)return Hh(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(R=x.children,o=x.fallback,j?(x=l.mode,j=l.child,R={mode:"hidden",children:R},(x&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=R):j=wu(R,x,0,null),o=hi(o,x,m,null),j.return=l,o.return=l,j.sibling=o,l.child=j,l.child.memoizedState=yp(m),l.memoizedState=gp,o):xp(l,R));if(C=o.memoizedState,C!==null&&(W=C.dehydrated,W!==null))return C5(o,l,R,x,W,C,m);if(j){j=x.fallback,R=l.mode,C=o.child,W=C.sibling;var X={mode:"hidden",children:x.children};return(R&1)===0&&l.child!==C?(x=l.child,x.childLanes=0,x.pendingProps=X,l.deletions=null):(x=Es(C,X),x.subtreeFlags=C.subtreeFlags&14680064),W!==null?j=Es(W,j):(j=hi(j,R,m,null),j.flags|=2),j.return=l,x.return=l,x.sibling=j,l.child=x,x=j,j=l.child,R=o.child.memoizedState,R=R===null?yp(m):{baseLanes:R.baseLanes|m,cachePool:null,transitions:R.transitions},j.memoizedState=R,j.childLanes=o.childLanes&~m,l.memoizedState=gp,x}return j=o.child,o=j.sibling,x=Es(j,{mode:"visible",children:x.children}),(l.mode&1)===0&&(x.lanes=m),x.return=l,x.sibling=null,o!==null&&(m=l.deletions,m===null?(l.deletions=[o],l.flags|=16):m.push(o)),l.child=x,l.memoizedState=null,x}function xp(o,l){return l=wu({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function lu(o,l,m,x){return x!==null&&Uh(x),co(l,o.child,null,m),o=xp(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function C5(o,l,m,x,C,j,R){if(m)return l.flags&256?(l.flags&=-257,x=fp(Error(n(422))),lu(o,l,R,x)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(j=x.fallback,C=l.mode,x=wu({mode:"visible",children:x.children},C,0,null),j=hi(j,C,R,null),j.flags|=2,x.return=l,j.return=l,x.sibling=j,l.child=x,(l.mode&1)!==0&&co(l,o.child,null,R),l.child.memoizedState=yp(R),l.memoizedState=gp,j);if((l.mode&1)===0)return lu(o,l,R,null);if(C.data==="$!"){if(x=C.nextSibling&&C.nextSibling.dataset,x)var W=x.dgst;return x=W,j=Error(n(419)),x=fp(j,x,void 0),lu(o,l,R,x)}if(W=(R&o.childLanes)!==0,Yt||W){if(x=_t,x!==null){switch(R&-R){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(x.suspendedLanes|R))!==0?0:C,C!==0&&C!==j.retryLane&&(j.retryLane=C,Vr(o,C),Un(x,o,C,-1))}return Op(),x=fp(Error(n(421))),lu(o,l,R,x)}return C.data==="$?"?(l.flags|=128,l.child=o.child,l=$5.bind(null,o),C._reactRetry=l,null):(o=j.treeContext,un=gs(C.nextSibling),cn=l,tt=!0,Bn=null,o!==null&&(Nn[kn++]=Br,Nn[kn++]=zr,Nn[kn++]=si,Br=o.id,zr=o.overflow,si=l),l=xp(l,x.children),l.flags|=4096,l)}function xk(o,l,m){o.lanes|=l;var x=o.alternate;x!==null&&(x.lanes|=l),Yh(o.return,l,m)}function vp(o,l,m,x,C){var j=o.memoizedState;j===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:x,tail:m,tailMode:C}:(j.isBackwards=l,j.rendering=null,j.renderingStartTime=0,j.last=x,j.tail=m,j.tailMode=C)}function vk(o,l,m){var x=l.pendingProps,C=x.revealOrder,j=x.tail;if(qt(o,l,x.children,m),x=at.current,(x&2)!==0)x=x&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&xk(o,m,l);else if(o.tag===19)xk(o,m,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}x&=1}if(Ye(at,x),(l.mode&1)===0)l.memoizedState=null;else switch(C){case"forwards":for(m=l.child,C=null;m!==null;)o=m.alternate,o!==null&&tu(o)===null&&(C=m),m=m.sibling;m=C,m===null?(C=l.child,l.child=null):(C=m.sibling,m.sibling=null),vp(l,!1,C,m,j);break;case"backwards":for(m=null,C=l.child,l.child=null;C!==null;){if(o=C.alternate,o!==null&&tu(o)===null){l.child=C;break}o=C.sibling,C.sibling=m,m=C,C=o}vp(l,!0,m,null,j);break;case"together":vp(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function cu(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Ur(o,l,m){if(o!==null&&(l.dependencies=o.dependencies),ci|=l.lanes,(m&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,m=Es(o,o.pendingProps),l.child=m,m.return=l;o.sibling!==null;)o=o.sibling,m=m.sibling=Es(o,o.pendingProps),m.return=l;m.sibling=null}return l.child}function _5(o,l,m){switch(l.tag){case 3:mk(l),lo();break;case 5:RN(l);break;case 1:Gt(l.type)&&Uc(l);break;case 4:Jh(l,l.stateNode.containerInfo);break;case 10:var x=l.type._context,C=l.memoizedProps.value;Ye(Qc,x._currentValue),x._currentValue=C;break;case 13:if(x=l.memoizedState,x!==null)return x.dehydrated!==null?(Ye(at,at.current&1),l.flags|=128,null):(m&l.child.childLanes)!==0?yk(o,l,m):(Ye(at,at.current&1),o=Ur(o,l,m),o!==null?o.sibling:null);Ye(at,at.current&1);break;case 19:if(x=(m&l.childLanes)!==0,(o.flags&128)!==0){if(x)return vk(o,l,m);l.flags|=128}if(C=l.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Ye(at,at.current),x)break;return null;case 22:case 23:return l.lanes=0,fk(o,l,m)}return Ur(o,l,m)}var bk,bp,wk,Nk;bk=function(o,l){for(var m=l.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===l)break;for(;m.sibling===null;){if(m.return===null||m.return===l)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},bp=function(){},wk=function(o,l,m,x){var C=o.memoizedProps;if(C!==x){o=l.stateNode,ai(pr.current);var j=null;switch(m){case"input":C=ve(o,C),x=ve(o,x),j=[];break;case"select":C=Y({},C,{value:void 0}),x=Y({},x,{value:void 0}),j=[];break;case"textarea":C=mt(o,C),x=mt(o,x),j=[];break;default:typeof C.onClick!="function"&&typeof x.onClick=="function"&&(o.onclick=zc)}ls(m,x);var R;m=null;for(oe in C)if(!x.hasOwnProperty(oe)&&C.hasOwnProperty(oe)&&C[oe]!=null)if(oe==="style"){var W=C[oe];for(R in W)W.hasOwnProperty(R)&&(m||(m={}),m[R]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(s.hasOwnProperty(oe)?j||(j=[]):(j=j||[]).push(oe,null));for(oe in x){var X=x[oe];if(W=C!=null?C[oe]:void 0,x.hasOwnProperty(oe)&&X!==W&&(X!=null||W!=null))if(oe==="style")if(W){for(R in W)!W.hasOwnProperty(R)||X&&X.hasOwnProperty(R)||(m||(m={}),m[R]="");for(R in X)X.hasOwnProperty(R)&&W[R]!==X[R]&&(m||(m={}),m[R]=X[R])}else m||(j||(j=[]),j.push(oe,m)),m=X;else oe==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,W=W?W.__html:void 0,X!=null&&W!==X&&(j=j||[]).push(oe,X)):oe==="children"?typeof X!="string"&&typeof X!="number"||(j=j||[]).push(oe,""+X):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(s.hasOwnProperty(oe)?(X!=null&&oe==="onScroll"&&Je("scroll",o),j||W===X||(j=[])):(j=j||[]).push(oe,X))}m&&(j=j||[]).push("style",m);var oe=j;(l.updateQueue=oe)&&(l.flags|=4)}},Nk=function(o,l,m,x){m!==x&&(l.flags|=4)};function Ka(o,l){if(!tt)switch(o.tailMode){case"hidden":l=o.tail;for(var m=null;l!==null;)l.alternate!==null&&(m=l),l=l.sibling;m===null?o.tail=null:m.sibling=null;break;case"collapsed":m=o.tail;for(var x=null;m!==null;)m.alternate!==null&&(x=m),m=m.sibling;x===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:x.sibling=null}}function Dt(o){var l=o.alternate!==null&&o.alternate.child===o.child,m=0,x=0;if(l)for(var C=o.child;C!==null;)m|=C.lanes|C.childLanes,x|=C.subtreeFlags&14680064,x|=C.flags&14680064,C.return=o,C=C.sibling;else for(C=o.child;C!==null;)m|=C.lanes|C.childLanes,x|=C.subtreeFlags,x|=C.flags,C.return=o,C=C.sibling;return o.subtreeFlags|=x,o.childLanes=m,l}function E5(o,l,m){var x=l.pendingProps;switch(zh(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(l),null;case 1:return Gt(l.type)&&Hc(),Dt(l),null;case 3:return x=l.stateNode,ho(),Ze(Kt),Ze(Pt),tp(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(o===null||o.child===null)&&(Yc(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Bn!==null&&(Ip(Bn),Bn=null))),bp(o,l),Dt(l),null;case 5:Zh(l);var C=ai(za.current);if(m=l.type,o!==null&&l.stateNode!=null)wk(o,l,m,x,C),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!x){if(l.stateNode===null)throw Error(n(166));return Dt(l),null}if(o=ai(pr.current),Yc(l)){x=l.stateNode,m=l.type;var j=l.memoizedProps;switch(x[hr]=l,x[Da]=j,o=(l.mode&1)!==0,m){case"dialog":Je("cancel",x),Je("close",x);break;case"iframe":case"object":case"embed":Je("load",x);break;case"video":case"audio":for(C=0;C<Oa.length;C++)Je(Oa[C],x);break;case"source":Je("error",x);break;case"img":case"image":case"link":Je("error",x),Je("load",x);break;case"details":Je("toggle",x);break;case"input":xe(x,j),Je("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!j.multiple},Je("invalid",x);break;case"textarea":He(x,j),Je("invalid",x)}ls(m,j),C=null;for(var R in j)if(j.hasOwnProperty(R)){var W=j[R];R==="children"?typeof W=="string"?x.textContent!==W&&(j.suppressHydrationWarning!==!0&&Bc(x.textContent,W,o),C=["children",W]):typeof W=="number"&&x.textContent!==""+W&&(j.suppressHydrationWarning!==!0&&Bc(x.textContent,W,o),C=["children",""+W]):s.hasOwnProperty(R)&&W!=null&&R==="onScroll"&&Je("scroll",x)}switch(m){case"input":le(x),Ge(x,j,!0);break;case"textarea":le(x),Rt(x);break;case"select":case"option":break;default:typeof j.onClick=="function"&&(x.onclick=zc)}x=C,l.updateQueue=x,x!==null&&(l.flags|=4)}else{R=C.nodeType===9?C:C.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=rn(m)),o==="http://www.w3.org/1999/xhtml"?m==="script"?(o=R.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof x.is=="string"?o=R.createElement(m,{is:x.is}):(o=R.createElement(m),m==="select"&&(R=o,x.multiple?R.multiple=!0:x.size&&(R.size=x.size))):o=R.createElementNS(o,m),o[hr]=l,o[Da]=x,bk(o,l,!1,!1),l.stateNode=o;e:{switch(R=cr(m,x),m){case"dialog":Je("cancel",o),Je("close",o),C=x;break;case"iframe":case"object":case"embed":Je("load",o),C=x;break;case"video":case"audio":for(C=0;C<Oa.length;C++)Je(Oa[C],o);C=x;break;case"source":Je("error",o),C=x;break;case"img":case"image":case"link":Je("error",o),Je("load",o),C=x;break;case"details":Je("toggle",o),C=x;break;case"input":xe(o,x),C=ve(o,x),Je("invalid",o);break;case"option":C=x;break;case"select":o._wrapperState={wasMultiple:!!x.multiple},C=Y({},x,{value:void 0}),Je("invalid",o);break;case"textarea":He(o,x),C=mt(o,x),Je("invalid",o);break;default:C=x}ls(m,C),W=C;for(j in W)if(W.hasOwnProperty(j)){var X=W[j];j==="style"?sn(o,X):j==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&Pn(o,X)):j==="children"?typeof X=="string"?(m!=="textarea"||X!=="")&&ze(o,X):typeof X=="number"&&ze(o,""+X):j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&j!=="autoFocus"&&(s.hasOwnProperty(j)?X!=null&&j==="onScroll"&&Je("scroll",o):X!=null&&k(o,j,X,R))}switch(m){case"input":le(o),Ge(o,x,!1);break;case"textarea":le(o),Rt(o);break;case"option":x.value!=null&&o.setAttribute("value",""+se(x.value));break;case"select":o.multiple=!!x.multiple,j=x.value,j!=null?St(o,!!x.multiple,j,!1):x.defaultValue!=null&&St(o,!!x.multiple,x.defaultValue,!0);break;default:typeof C.onClick=="function"&&(o.onclick=zc)}switch(m){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Dt(l),null;case 6:if(o&&l.stateNode!=null)Nk(o,l,o.memoizedProps,x);else{if(typeof x!="string"&&l.stateNode===null)throw Error(n(166));if(m=ai(za.current),ai(pr.current),Yc(l)){if(x=l.stateNode,m=l.memoizedProps,x[hr]=l,(j=x.nodeValue!==m)&&(o=cn,o!==null))switch(o.tag){case 3:Bc(x.nodeValue,m,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Bc(x.nodeValue,m,(o.mode&1)!==0)}j&&(l.flags|=4)}else x=(m.nodeType===9?m:m.ownerDocument).createTextNode(x),x[hr]=l,l.stateNode=x}return Dt(l),null;case 13:if(Ze(at),x=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(tt&&un!==null&&(l.mode&1)!==0&&(l.flags&128)===0)CN(),lo(),l.flags|=98560,j=!1;else if(j=Yc(l),x!==null&&x.dehydrated!==null){if(o===null){if(!j)throw Error(n(318));if(j=l.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(n(317));j[hr]=l}else lo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Dt(l),j=!1}else Bn!==null&&(Ip(Bn),Bn=null),j=!0;if(!j)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=m,l):(x=x!==null,x!==(o!==null&&o.memoizedState!==null)&&x&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(at.current&1)!==0?Nt===0&&(Nt=3):Op())),l.updateQueue!==null&&(l.flags|=4),Dt(l),null);case 4:return ho(),bp(o,l),o===null&&Pa(l.stateNode.containerInfo),Dt(l),null;case 10:return Gh(l.type._context),Dt(l),null;case 17:return Gt(l.type)&&Hc(),Dt(l),null;case 19:if(Ze(at),j=l.memoizedState,j===null)return Dt(l),null;if(x=(l.flags&128)!==0,R=j.rendering,R===null)if(x)Ka(j,!1);else{if(Nt!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(R=tu(o),R!==null){for(l.flags|=128,Ka(j,!1),x=R.updateQueue,x!==null&&(l.updateQueue=x,l.flags|=4),l.subtreeFlags=0,x=m,m=l.child;m!==null;)j=m,o=x,j.flags&=14680066,R=j.alternate,R===null?(j.childLanes=0,j.lanes=o,j.child=null,j.subtreeFlags=0,j.memoizedProps=null,j.memoizedState=null,j.updateQueue=null,j.dependencies=null,j.stateNode=null):(j.childLanes=R.childLanes,j.lanes=R.lanes,j.child=R.child,j.subtreeFlags=0,j.deletions=null,j.memoizedProps=R.memoizedProps,j.memoizedState=R.memoizedState,j.updateQueue=R.updateQueue,j.type=R.type,o=R.dependencies,j.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),m=m.sibling;return Ye(at,at.current&1|2),l.child}o=o.sibling}j.tail!==null&&ot()>yo&&(l.flags|=128,x=!0,Ka(j,!1),l.lanes=4194304)}else{if(!x)if(o=tu(R),o!==null){if(l.flags|=128,x=!0,m=o.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),Ka(j,!0),j.tail===null&&j.tailMode==="hidden"&&!R.alternate&&!tt)return Dt(l),null}else 2*ot()-j.renderingStartTime>yo&&m!==1073741824&&(l.flags|=128,x=!0,Ka(j,!1),l.lanes=4194304);j.isBackwards?(R.sibling=l.child,l.child=R):(m=j.last,m!==null?m.sibling=R:l.child=R,j.last=R)}return j.tail!==null?(l=j.tail,j.rendering=l,j.tail=l.sibling,j.renderingStartTime=ot(),l.sibling=null,m=at.current,Ye(at,x?m&1|2:m&1),l):(Dt(l),null);case 22:case 23:return Rp(),x=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==x&&(l.flags|=8192),x&&(l.mode&1)!==0?(dn&1073741824)!==0&&(Dt(l),l.subtreeFlags&6&&(l.flags|=8192)):Dt(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function j5(o,l){switch(zh(l),l.tag){case 1:return Gt(l.type)&&Hc(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return ho(),Ze(Kt),Ze(Pt),tp(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Zh(l),null;case 13:if(Ze(at),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));lo()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Ze(at),null;case 4:return ho(),null;case 10:return Gh(l.type._context),null;case 22:case 23:return Rp(),null;case 24:return null;default:return null}}var uu=!1,$t=!1,A5=typeof WeakSet=="function"?WeakSet:Set,we=null;function mo(o,l){var m=o.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(x){ct(o,l,x)}else m.current=null}function wp(o,l,m){try{m()}catch(x){ct(o,l,x)}}var kk=!1;function T5(o,l){if(Rh=Tc,o=tN(),Ch(o)){if("selectionStart"in o)var m={start:o.selectionStart,end:o.selectionEnd};else e:{m=(m=o.ownerDocument)&&m.defaultView||window;var x=m.getSelection&&m.getSelection();if(x&&x.rangeCount!==0){m=x.anchorNode;var C=x.anchorOffset,j=x.focusNode;x=x.focusOffset;try{m.nodeType,j.nodeType}catch{m=null;break e}var R=0,W=-1,X=-1,oe=0,de=0,fe=o,ue=null;t:for(;;){for(var ye;fe!==m||C!==0&&fe.nodeType!==3||(W=R+C),fe!==j||x!==0&&fe.nodeType!==3||(X=R+x),fe.nodeType===3&&(R+=fe.nodeValue.length),(ye=fe.firstChild)!==null;)ue=fe,fe=ye;for(;;){if(fe===o)break t;if(ue===m&&++oe===C&&(W=R),ue===j&&++de===x&&(X=R),(ye=fe.nextSibling)!==null)break;fe=ue,ue=fe.parentNode}fe=ye}m=W===-1||X===-1?null:{start:W,end:X}}else m=null}m=m||{start:0,end:0}}else m=null;for(Oh={focusedElem:o,selectionRange:m},Tc=!1,we=l;we!==null;)if(l=we,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,we=o;else for(;we!==null;){l=we;try{var Ne=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var ke=Ne.memoizedProps,dt=Ne.memoizedState,te=l.stateNode,J=te.getSnapshotBeforeUpdate(l.elementType===l.type?ke:zn(l.type,ke),dt);te.__reactInternalSnapshotBeforeUpdate=J}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(me){ct(l,l.return,me)}if(o=l.sibling,o!==null){o.return=l.return,we=o;break}we=l.return}return Ne=kk,kk=!1,Ne}function Ga(o,l,m){var x=l.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var C=x=x.next;do{if((C.tag&o)===o){var j=C.destroy;C.destroy=void 0,j!==void 0&&wp(l,m,j)}C=C.next}while(C!==x)}}function du(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var m=l=l.next;do{if((m.tag&o)===o){var x=m.create;m.destroy=x()}m=m.next}while(m!==l)}}function Np(o){var l=o.ref;if(l!==null){var m=o.stateNode;switch(o.tag){case 5:o=m;break;default:o=m}typeof l=="function"?l(o):l.current=o}}function Sk(o){var l=o.alternate;l!==null&&(o.alternate=null,Sk(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[hr],delete l[Da],delete l[$h],delete l[f5],delete l[h5])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Ck(o){return o.tag===5||o.tag===3||o.tag===4}function _k(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Ck(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function kp(o,l,m){var x=o.tag;if(x===5||x===6)o=o.stateNode,l?m.nodeType===8?m.parentNode.insertBefore(o,l):m.insertBefore(o,l):(m.nodeType===8?(l=m.parentNode,l.insertBefore(o,m)):(l=m,l.appendChild(o)),m=m._reactRootContainer,m!=null||l.onclick!==null||(l.onclick=zc));else if(x!==4&&(o=o.child,o!==null))for(kp(o,l,m),o=o.sibling;o!==null;)kp(o,l,m),o=o.sibling}function Sp(o,l,m){var x=o.tag;if(x===5||x===6)o=o.stateNode,l?m.insertBefore(o,l):m.appendChild(o);else if(x!==4&&(o=o.child,o!==null))for(Sp(o,l,m),o=o.sibling;o!==null;)Sp(o,l,m),o=o.sibling}var At=null,Vn=!1;function Ns(o,l,m){for(m=m.child;m!==null;)Ek(o,l,m),m=m.sibling}function Ek(o,l,m){if(wn&&typeof wn.onCommitFiberUnmount=="function")try{wn.onCommitFiberUnmount(ei,m)}catch{}switch(m.tag){case 5:$t||mo(m,l);case 6:var x=At,C=Vn;At=null,Ns(o,l,m),At=x,Vn=C,At!==null&&(Vn?(o=At,m=m.stateNode,o.nodeType===8?o.parentNode.removeChild(m):o.removeChild(m)):At.removeChild(m.stateNode));break;case 18:At!==null&&(Vn?(o=At,m=m.stateNode,o.nodeType===8?Dh(o.parentNode,m):o.nodeType===1&&Dh(o,m),_a(o)):Dh(At,m.stateNode));break;case 4:x=At,C=Vn,At=m.stateNode.containerInfo,Vn=!0,Ns(o,l,m),At=x,Vn=C;break;case 0:case 11:case 14:case 15:if(!$t&&(x=m.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){C=x=x.next;do{var j=C,R=j.destroy;j=j.tag,R!==void 0&&((j&2)!==0||(j&4)!==0)&&wp(m,l,R),C=C.next}while(C!==x)}Ns(o,l,m);break;case 1:if(!$t&&(mo(m,l),x=m.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=m.memoizedProps,x.state=m.memoizedState,x.componentWillUnmount()}catch(W){ct(m,l,W)}Ns(o,l,m);break;case 21:Ns(o,l,m);break;case 22:m.mode&1?($t=(x=$t)||m.memoizedState!==null,Ns(o,l,m),$t=x):Ns(o,l,m);break;default:Ns(o,l,m)}}function jk(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var m=o.stateNode;m===null&&(m=o.stateNode=new A5),l.forEach(function(x){var C=F5.bind(null,o,x);m.has(x)||(m.add(x),x.then(C,C))})}}function Hn(o,l){var m=l.deletions;if(m!==null)for(var x=0;x<m.length;x++){var C=m[x];try{var j=o,R=l,W=R;e:for(;W!==null;){switch(W.tag){case 5:At=W.stateNode,Vn=!1;break e;case 3:At=W.stateNode.containerInfo,Vn=!0;break e;case 4:At=W.stateNode.containerInfo,Vn=!0;break e}W=W.return}if(At===null)throw Error(n(160));Ek(j,R,C),At=null,Vn=!1;var X=C.alternate;X!==null&&(X.return=null),C.return=null}catch(oe){ct(C,l,oe)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)Ak(l,o),l=l.sibling}function Ak(o,l){var m=o.alternate,x=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Hn(l,o),gr(o),x&4){try{Ga(3,o,o.return),du(3,o)}catch(ke){ct(o,o.return,ke)}try{Ga(5,o,o.return)}catch(ke){ct(o,o.return,ke)}}break;case 1:Hn(l,o),gr(o),x&512&&m!==null&&mo(m,m.return);break;case 5:if(Hn(l,o),gr(o),x&512&&m!==null&&mo(m,m.return),o.flags&32){var C=o.stateNode;try{ze(C,"")}catch(ke){ct(o,o.return,ke)}}if(x&4&&(C=o.stateNode,C!=null)){var j=o.memoizedProps,R=m!==null?m.memoizedProps:j,W=o.type,X=o.updateQueue;if(o.updateQueue=null,X!==null)try{W==="input"&&j.type==="radio"&&j.name!=null&&Ae(C,j),cr(W,R);var oe=cr(W,j);for(R=0;R<X.length;R+=2){var de=X[R],fe=X[R+1];de==="style"?sn(C,fe):de==="dangerouslySetInnerHTML"?Pn(C,fe):de==="children"?ze(C,fe):k(C,de,fe,oe)}switch(W){case"input":Se(C,j);break;case"textarea":nn(C,j);break;case"select":var ue=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!j.multiple;var ye=j.value;ye!=null?St(C,!!j.multiple,ye,!1):ue!==!!j.multiple&&(j.defaultValue!=null?St(C,!!j.multiple,j.defaultValue,!0):St(C,!!j.multiple,j.multiple?[]:"",!1))}C[Da]=j}catch(ke){ct(o,o.return,ke)}}break;case 6:if(Hn(l,o),gr(o),x&4){if(o.stateNode===null)throw Error(n(162));C=o.stateNode,j=o.memoizedProps;try{C.nodeValue=j}catch(ke){ct(o,o.return,ke)}}break;case 3:if(Hn(l,o),gr(o),x&4&&m!==null&&m.memoizedState.isDehydrated)try{_a(l.containerInfo)}catch(ke){ct(o,o.return,ke)}break;case 4:Hn(l,o),gr(o);break;case 13:Hn(l,o),gr(o),C=o.child,C.flags&8192&&(j=C.memoizedState!==null,C.stateNode.isHidden=j,!j||C.alternate!==null&&C.alternate.memoizedState!==null||(Ep=ot())),x&4&&jk(o);break;case 22:if(de=m!==null&&m.memoizedState!==null,o.mode&1?($t=(oe=$t)||de,Hn(l,o),$t=oe):Hn(l,o),gr(o),x&8192){if(oe=o.memoizedState!==null,(o.stateNode.isHidden=oe)&&!de&&(o.mode&1)!==0)for(we=o,de=o.child;de!==null;){for(fe=we=de;we!==null;){switch(ue=we,ye=ue.child,ue.tag){case 0:case 11:case 14:case 15:Ga(4,ue,ue.return);break;case 1:mo(ue,ue.return);var Ne=ue.stateNode;if(typeof Ne.componentWillUnmount=="function"){x=ue,m=ue.return;try{l=x,Ne.props=l.memoizedProps,Ne.state=l.memoizedState,Ne.componentWillUnmount()}catch(ke){ct(x,m,ke)}}break;case 5:mo(ue,ue.return);break;case 22:if(ue.memoizedState!==null){Mk(fe);continue}}ye!==null?(ye.return=ue,we=ye):Mk(fe)}de=de.sibling}e:for(de=null,fe=o;;){if(fe.tag===5){if(de===null){de=fe;try{C=fe.stateNode,oe?(j=C.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none"):(W=fe.stateNode,X=fe.memoizedProps.style,R=X!=null&&X.hasOwnProperty("display")?X.display:null,W.style.display=Wt("display",R))}catch(ke){ct(o,o.return,ke)}}}else if(fe.tag===6){if(de===null)try{fe.stateNode.nodeValue=oe?"":fe.memoizedProps}catch(ke){ct(o,o.return,ke)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===o)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===o)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===o)break e;de===fe&&(de=null),fe=fe.return}de===fe&&(de=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Hn(l,o),gr(o),x&4&&jk(o);break;case 21:break;default:Hn(l,o),gr(o)}}function gr(o){var l=o.flags;if(l&2){try{e:{for(var m=o.return;m!==null;){if(Ck(m)){var x=m;break e}m=m.return}throw Error(n(160))}switch(x.tag){case 5:var C=x.stateNode;x.flags&32&&(ze(C,""),x.flags&=-33);var j=_k(o);Sp(o,j,C);break;case 3:case 4:var R=x.stateNode.containerInfo,W=_k(o);kp(o,W,R);break;default:throw Error(n(161))}}catch(X){ct(o,o.return,X)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function I5(o,l,m){we=o,Tk(o)}function Tk(o,l,m){for(var x=(o.mode&1)!==0;we!==null;){var C=we,j=C.child;if(C.tag===22&&x){var R=C.memoizedState!==null||uu;if(!R){var W=C.alternate,X=W!==null&&W.memoizedState!==null||$t;W=uu;var oe=$t;if(uu=R,($t=X)&&!oe)for(we=C;we!==null;)R=we,X=R.child,R.tag===22&&R.memoizedState!==null?Rk(C):X!==null?(X.return=R,we=X):Rk(C);for(;j!==null;)we=j,Tk(j),j=j.sibling;we=C,uu=W,$t=oe}Ik(o)}else(C.subtreeFlags&8772)!==0&&j!==null?(j.return=C,we=j):Ik(o)}}function Ik(o){for(;we!==null;){var l=we;if((l.flags&8772)!==0){var m=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:$t||du(5,l);break;case 1:var x=l.stateNode;if(l.flags&4&&!$t)if(m===null)x.componentDidMount();else{var C=l.elementType===l.type?m.memoizedProps:zn(l.type,m.memoizedProps);x.componentDidUpdate(C,m.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var j=l.updateQueue;j!==null&&MN(l,j,x);break;case 3:var R=l.updateQueue;if(R!==null){if(m=null,l.child!==null)switch(l.child.tag){case 5:m=l.child.stateNode;break;case 1:m=l.child.stateNode}MN(l,R,m)}break;case 5:var W=l.stateNode;if(m===null&&l.flags&4){m=W;var X=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&m.focus();break;case"img":X.src&&(m.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var oe=l.alternate;if(oe!==null){var de=oe.memoizedState;if(de!==null){var fe=de.dehydrated;fe!==null&&_a(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}$t||l.flags&512&&Np(l)}catch(ue){ct(l,l.return,ue)}}if(l===o){we=null;break}if(m=l.sibling,m!==null){m.return=l.return,we=m;break}we=l.return}}function Mk(o){for(;we!==null;){var l=we;if(l===o){we=null;break}var m=l.sibling;if(m!==null){m.return=l.return,we=m;break}we=l.return}}function Rk(o){for(;we!==null;){var l=we;try{switch(l.tag){case 0:case 11:case 15:var m=l.return;try{du(4,l)}catch(X){ct(l,m,X)}break;case 1:var x=l.stateNode;if(typeof x.componentDidMount=="function"){var C=l.return;try{x.componentDidMount()}catch(X){ct(l,C,X)}}var j=l.return;try{Np(l)}catch(X){ct(l,j,X)}break;case 5:var R=l.return;try{Np(l)}catch(X){ct(l,R,X)}}}catch(X){ct(l,l.return,X)}if(l===o){we=null;break}var W=l.sibling;if(W!==null){W.return=l.return,we=W;break}we=l.return}}var M5=Math.ceil,fu=_.ReactCurrentDispatcher,Cp=_.ReactCurrentOwner,_n=_.ReactCurrentBatchConfig,Fe=0,_t=null,gt=null,Tt=0,dn=0,go=ys(0),Nt=0,Ya=null,ci=0,hu=0,_p=0,Xa=null,Xt=null,Ep=0,yo=1/0,Wr=null,pu=!1,jp=null,ks=null,mu=!1,Ss=null,gu=0,Qa=0,Ap=null,yu=-1,xu=0;function Bt(){return(Fe&6)!==0?ot():yu!==-1?yu:yu=ot()}function Cs(o){return(o.mode&1)===0?1:(Fe&2)!==0&&Tt!==0?Tt&-Tt:m5.transition!==null?(xu===0&&(xu=Yi()),xu):(o=Ke,o!==0||(o=window.event,o=o===void 0?16:P1(o.type)),o)}function Un(o,l,m,x){if(50<Qa)throw Qa=0,Ap=null,Error(n(185));ti(o,m,x),((Fe&2)===0||o!==_t)&&(o===_t&&((Fe&2)===0&&(hu|=m),Nt===4&&_s(o,Tt)),Qt(o,x),m===1&&Fe===0&&(l.mode&1)===0&&(yo=ot()+500,Wc&&vs()))}function Qt(o,l){var m=o.callbackNode;uh(o,l);var x=Gi(o,o===_t?Tt:0);if(x===0)m!==null&&Nc(m),o.callbackNode=null,o.callbackPriority=0;else if(l=x&-x,o.callbackPriority!==l){if(m!=null&&Nc(m),l===1)o.tag===0?p5(Pk.bind(null,o)):bN(Pk.bind(null,o)),u5(function(){(Fe&6)===0&&vs()}),m=null;else{switch(E1(x)){case 1:m=va;break;case 4:m=Sc;break;case 16:m=Ui;break;case 536870912:m=Cc;break;default:m=Ui}m=Vk(m,Ok.bind(null,o))}o.callbackPriority=l,o.callbackNode=m}}function Ok(o,l){if(yu=-1,xu=0,(Fe&6)!==0)throw Error(n(327));var m=o.callbackNode;if(xo()&&o.callbackNode!==m)return null;var x=Gi(o,o===_t?Tt:0);if(x===0)return null;if((x&30)!==0||(x&o.expiredLanes)!==0||l)l=vu(o,x);else{l=x;var C=Fe;Fe|=2;var j=Dk();(_t!==o||Tt!==l)&&(Wr=null,yo=ot()+500,di(o,l));do try{P5();break}catch(W){Lk(o,W)}while(!0);Kh(),fu.current=j,Fe=C,gt!==null?l=0:(_t=null,Tt=0,l=Nt)}if(l!==0){if(l===2&&(C=ba(o),C!==0&&(x=C,l=Tp(o,C))),l===1)throw m=Ya,di(o,0),_s(o,x),Qt(o,ot()),m;if(l===6)_s(o,x);else{if(C=o.current.alternate,(x&30)===0&&!R5(C)&&(l=vu(o,x),l===2&&(j=ba(o),j!==0&&(x=j,l=Tp(o,j))),l===1))throw m=Ya,di(o,0),_s(o,x),Qt(o,ot()),m;switch(o.finishedWork=C,o.finishedLanes=x,l){case 0:case 1:throw Error(n(345));case 2:fi(o,Xt,Wr);break;case 3:if(_s(o,x),(x&130023424)===x&&(l=Ep+500-ot(),10<l)){if(Gi(o,0)!==0)break;if(C=o.suspendedLanes,(C&x)!==x){Bt(),o.pingedLanes|=o.suspendedLanes&C;break}o.timeoutHandle=Lh(fi.bind(null,o,Xt,Wr),l);break}fi(o,Xt,Wr);break;case 4:if(_s(o,x),(x&4194240)===x)break;for(l=o.eventTimes,C=-1;0<x;){var R=31-an(x);j=1<<R,R=l[R],R>C&&(C=R),x&=~j}if(x=C,x=ot()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*M5(x/1960))-x,10<x){o.timeoutHandle=Lh(fi.bind(null,o,Xt,Wr),x);break}fi(o,Xt,Wr);break;case 5:fi(o,Xt,Wr);break;default:throw Error(n(329))}}}return Qt(o,ot()),o.callbackNode===m?Ok.bind(null,o):null}function Tp(o,l){var m=Xa;return o.current.memoizedState.isDehydrated&&(di(o,l).flags|=256),o=vu(o,l),o!==2&&(l=Xt,Xt=m,l!==null&&Ip(l)),o}function Ip(o){Xt===null?Xt=o:Xt.push.apply(Xt,o)}function R5(o){for(var l=o;;){if(l.flags&16384){var m=l.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var x=0;x<m.length;x++){var C=m[x],j=C.getSnapshot;C=C.value;try{if(!qn(j(),C))return!1}catch{return!1}}}if(m=l.child,l.subtreeFlags&16384&&m!==null)m.return=l,l=m;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function _s(o,l){for(l&=~_p,l&=~hu,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var m=31-an(l),x=1<<m;o[m]=-1,l&=~x}}function Pk(o){if((Fe&6)!==0)throw Error(n(327));xo();var l=Gi(o,0);if((l&1)===0)return Qt(o,ot()),null;var m=vu(o,l);if(o.tag!==0&&m===2){var x=ba(o);x!==0&&(l=x,m=Tp(o,x))}if(m===1)throw m=Ya,di(o,0),_s(o,l),Qt(o,ot()),m;if(m===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,fi(o,Xt,Wr),Qt(o,ot()),null}function Mp(o,l){var m=Fe;Fe|=1;try{return o(l)}finally{Fe=m,Fe===0&&(yo=ot()+500,Wc&&vs())}}function ui(o){Ss!==null&&Ss.tag===0&&(Fe&6)===0&&xo();var l=Fe;Fe|=1;var m=_n.transition,x=Ke;try{if(_n.transition=null,Ke=1,o)return o()}finally{Ke=x,_n.transition=m,Fe=l,(Fe&6)===0&&vs()}}function Rp(){dn=go.current,Ze(go)}function di(o,l){o.finishedWork=null,o.finishedLanes=0;var m=o.timeoutHandle;if(m!==-1&&(o.timeoutHandle=-1,c5(m)),gt!==null)for(m=gt.return;m!==null;){var x=m;switch(zh(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Hc();break;case 3:ho(),Ze(Kt),Ze(Pt),tp();break;case 5:Zh(x);break;case 4:ho();break;case 13:Ze(at);break;case 19:Ze(at);break;case 10:Gh(x.type._context);break;case 22:case 23:Rp()}m=m.return}if(_t=o,gt=o=Es(o.current,null),Tt=dn=l,Nt=0,Ya=null,_p=hu=ci=0,Xt=Xa=null,oi!==null){for(l=0;l<oi.length;l++)if(m=oi[l],x=m.interleaved,x!==null){m.interleaved=null;var C=x.next,j=m.pending;if(j!==null){var R=j.next;j.next=C,x.next=R}m.pending=x}oi=null}return o}function Lk(o,l){do{var m=gt;try{if(Kh(),nu.current=ou,ru){for(var x=lt.memoizedState;x!==null;){var C=x.queue;C!==null&&(C.pending=null),x=x.next}ru=!1}if(li=0,Ct=wt=lt=null,Va=!1,Ha=0,Cp.current=null,m===null||m.return===null){Nt=1,Ya=l,gt=null;break}e:{var j=o,R=m.return,W=m,X=l;if(l=Tt,W.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var oe=X,de=W,fe=de.tag;if((de.mode&1)===0&&(fe===0||fe===11||fe===15)){var ue=de.alternate;ue?(de.updateQueue=ue.updateQueue,de.memoizedState=ue.memoizedState,de.lanes=ue.lanes):(de.updateQueue=null,de.memoizedState=null)}var ye=ak(R);if(ye!==null){ye.flags&=-257,lk(ye,R,W,j,l),ye.mode&1&&ok(j,oe,l),l=ye,X=oe;var Ne=l.updateQueue;if(Ne===null){var ke=new Set;ke.add(X),l.updateQueue=ke}else Ne.add(X);break e}else{if((l&1)===0){ok(j,oe,l),Op();break e}X=Error(n(426))}}else if(tt&&W.mode&1){var dt=ak(R);if(dt!==null){(dt.flags&65536)===0&&(dt.flags|=256),lk(dt,R,W,j,l),Uh(po(X,W));break e}}j=X=po(X,W),Nt!==4&&(Nt=2),Xa===null?Xa=[j]:Xa.push(j),j=R;do{switch(j.tag){case 3:j.flags|=65536,l&=-l,j.lanes|=l;var te=sk(j,X,l);IN(j,te);break e;case 1:W=X;var J=j.type,re=j.stateNode;if((j.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(ks===null||!ks.has(re)))){j.flags|=65536,l&=-l,j.lanes|=l;var me=ik(j,W,l);IN(j,me);break e}}j=j.return}while(j!==null)}Fk(m)}catch(_e){l=_e,gt===m&&m!==null&&(gt=m=m.return);continue}break}while(!0)}function Dk(){var o=fu.current;return fu.current=ou,o===null?ou:o}function Op(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),_t===null||(ci&268435455)===0&&(hu&268435455)===0||_s(_t,Tt)}function vu(o,l){var m=Fe;Fe|=2;var x=Dk();(_t!==o||Tt!==l)&&(Wr=null,di(o,l));do try{O5();break}catch(C){Lk(o,C)}while(!0);if(Kh(),Fe=m,fu.current=x,gt!==null)throw Error(n(261));return _t=null,Tt=0,Nt}function O5(){for(;gt!==null;)$k(gt)}function P5(){for(;gt!==null&&!rh();)$k(gt)}function $k(o){var l=zk(o.alternate,o,dn);o.memoizedProps=o.pendingProps,l===null?Fk(o):gt=l,Cp.current=null}function Fk(o){var l=o;do{var m=l.alternate;if(o=l.return,(l.flags&32768)===0){if(m=E5(m,l,dn),m!==null){gt=m;return}}else{if(m=j5(m,l),m!==null){m.flags&=32767,gt=m;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Nt=6,gt=null;return}}if(l=l.sibling,l!==null){gt=l;return}gt=l=o}while(l!==null);Nt===0&&(Nt=5)}function fi(o,l,m){var x=Ke,C=_n.transition;try{_n.transition=null,Ke=1,L5(o,l,m,x)}finally{_n.transition=C,Ke=x}return null}function L5(o,l,m,x){do xo();while(Ss!==null);if((Fe&6)!==0)throw Error(n(327));m=o.finishedWork;var C=o.finishedLanes;if(m===null)return null;if(o.finishedWork=null,o.finishedLanes=0,m===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var j=m.lanes|m.childLanes;if(Ec(o,j),o===_t&&(gt=_t=null,Tt=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||mu||(mu=!0,Vk(Ui,function(){return xo(),null})),j=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||j){j=_n.transition,_n.transition=null;var R=Ke;Ke=1;var W=Fe;Fe|=4,Cp.current=null,T5(o,m),Ak(m,o),n5(Oh),Tc=!!Rh,Oh=Rh=null,o.current=m,I5(m),kc(),Fe=W,Ke=R,_n.transition=j}else o.current=m;if(mu&&(mu=!1,Ss=o,gu=C),j=o.pendingLanes,j===0&&(ks=null),oh(m.stateNode),Qt(o,ot()),l!==null)for(x=o.onRecoverableError,m=0;m<l.length;m++)C=l[m],x(C.value,{componentStack:C.stack,digest:C.digest});if(pu)throw pu=!1,o=jp,jp=null,o;return(gu&1)!==0&&o.tag!==0&&xo(),j=o.pendingLanes,(j&1)!==0?o===Ap?Qa++:(Qa=0,Ap=o):Qa=0,vs(),null}function xo(){if(Ss!==null){var o=E1(gu),l=_n.transition,m=Ke;try{if(_n.transition=null,Ke=16>o?16:o,Ss===null)var x=!1;else{if(o=Ss,Ss=null,gu=0,(Fe&6)!==0)throw Error(n(331));var C=Fe;for(Fe|=4,we=o.current;we!==null;){var j=we,R=j.child;if((we.flags&16)!==0){var W=j.deletions;if(W!==null){for(var X=0;X<W.length;X++){var oe=W[X];for(we=oe;we!==null;){var de=we;switch(de.tag){case 0:case 11:case 15:Ga(8,de,j)}var fe=de.child;if(fe!==null)fe.return=de,we=fe;else for(;we!==null;){de=we;var ue=de.sibling,ye=de.return;if(Sk(de),de===oe){we=null;break}if(ue!==null){ue.return=ye,we=ue;break}we=ye}}}var Ne=j.alternate;if(Ne!==null){var ke=Ne.child;if(ke!==null){Ne.child=null;do{var dt=ke.sibling;ke.sibling=null,ke=dt}while(ke!==null)}}we=j}}if((j.subtreeFlags&2064)!==0&&R!==null)R.return=j,we=R;else e:for(;we!==null;){if(j=we,(j.flags&2048)!==0)switch(j.tag){case 0:case 11:case 15:Ga(9,j,j.return)}var te=j.sibling;if(te!==null){te.return=j.return,we=te;break e}we=j.return}}var J=o.current;for(we=J;we!==null;){R=we;var re=R.child;if((R.subtreeFlags&2064)!==0&&re!==null)re.return=R,we=re;else e:for(R=J;we!==null;){if(W=we,(W.flags&2048)!==0)try{switch(W.tag){case 0:case 11:case 15:du(9,W)}}catch(_e){ct(W,W.return,_e)}if(W===R){we=null;break e}var me=W.sibling;if(me!==null){me.return=W.return,we=me;break e}we=W.return}}if(Fe=C,vs(),wn&&typeof wn.onPostCommitFiberRoot=="function")try{wn.onPostCommitFiberRoot(ei,o)}catch{}x=!0}return x}finally{Ke=m,_n.transition=l}}return!1}function qk(o,l,m){l=po(m,l),l=sk(o,l,1),o=ws(o,l,1),l=Bt(),o!==null&&(ti(o,1,l),Qt(o,l))}function ct(o,l,m){if(o.tag===3)qk(o,o,m);else for(;l!==null;){if(l.tag===3){qk(l,o,m);break}else if(l.tag===1){var x=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(ks===null||!ks.has(x))){o=po(m,o),o=ik(l,o,1),l=ws(l,o,1),o=Bt(),l!==null&&(ti(l,1,o),Qt(l,o));break}}l=l.return}}function D5(o,l,m){var x=o.pingCache;x!==null&&x.delete(l),l=Bt(),o.pingedLanes|=o.suspendedLanes&m,_t===o&&(Tt&m)===m&&(Nt===4||Nt===3&&(Tt&130023424)===Tt&&500>ot()-Ep?di(o,0):_p|=m),Qt(o,l)}function Bk(o,l){l===0&&((o.mode&1)===0?l=1:(l=Ki,Ki<<=1,(Ki&130023424)===0&&(Ki=4194304)));var m=Bt();o=Vr(o,l),o!==null&&(ti(o,l,m),Qt(o,m))}function $5(o){var l=o.memoizedState,m=0;l!==null&&(m=l.retryLane),Bk(o,m)}function F5(o,l){var m=0;switch(o.tag){case 13:var x=o.stateNode,C=o.memoizedState;C!==null&&(m=C.retryLane);break;case 19:x=o.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(l),Bk(o,m)}var zk;zk=function(o,l,m){if(o!==null)if(o.memoizedProps!==l.pendingProps||Kt.current)Yt=!0;else{if((o.lanes&m)===0&&(l.flags&128)===0)return Yt=!1,_5(o,l,m);Yt=(o.flags&131072)!==0}else Yt=!1,tt&&(l.flags&1048576)!==0&&wN(l,Gc,l.index);switch(l.lanes=0,l.tag){case 2:var x=l.type;cu(o,l),o=l.pendingProps;var C=io(l,Pt.current);fo(l,m),C=sp(null,l,x,o,C,m);var j=ip();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Gt(x)?(j=!0,Uc(l)):j=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Qh(l),C.updater=au,l.stateNode=C,C._reactInternals=l,dp(l,x,o,m),l=mp(null,l,x,!0,j,m)):(l.tag=0,tt&&j&&Bh(l),qt(null,l,C,m),l=l.child),l;case 16:x=l.elementType;e:{switch(cu(o,l),o=l.pendingProps,C=x._init,x=C(x._payload),l.type=x,C=l.tag=B5(x),o=zn(x,o),C){case 0:l=pp(null,l,x,o,m);break e;case 1:l=pk(null,l,x,o,m);break e;case 11:l=ck(null,l,x,o,m);break e;case 14:l=uk(null,l,x,zn(x.type,o),m);break e}throw Error(n(306,x,""))}return l;case 0:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:zn(x,C),pp(o,l,x,C,m);case 1:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:zn(x,C),pk(o,l,x,C,m);case 3:e:{if(mk(l),o===null)throw Error(n(387));x=l.pendingProps,j=l.memoizedState,C=j.element,TN(o,l),eu(l,x,null,m);var R=l.memoizedState;if(x=R.element,j.isDehydrated)if(j={element:x,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},l.updateQueue.baseState=j,l.memoizedState=j,l.flags&256){C=po(Error(n(423)),l),l=gk(o,l,x,m,C);break e}else if(x!==C){C=po(Error(n(424)),l),l=gk(o,l,x,m,C);break e}else for(un=gs(l.stateNode.containerInfo.firstChild),cn=l,tt=!0,Bn=null,m=jN(l,null,x,m),l.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(lo(),x===C){l=Ur(o,l,m);break e}qt(o,l,x,m)}l=l.child}return l;case 5:return RN(l),o===null&&Hh(l),x=l.type,C=l.pendingProps,j=o!==null?o.memoizedProps:null,R=C.children,Ph(x,C)?R=null:j!==null&&Ph(x,j)&&(l.flags|=32),hk(o,l),qt(o,l,R,m),l.child;case 6:return o===null&&Hh(l),null;case 13:return yk(o,l,m);case 4:return Jh(l,l.stateNode.containerInfo),x=l.pendingProps,o===null?l.child=co(l,null,x,m):qt(o,l,x,m),l.child;case 11:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:zn(x,C),ck(o,l,x,C,m);case 7:return qt(o,l,l.pendingProps,m),l.child;case 8:return qt(o,l,l.pendingProps.children,m),l.child;case 12:return qt(o,l,l.pendingProps.children,m),l.child;case 10:e:{if(x=l.type._context,C=l.pendingProps,j=l.memoizedProps,R=C.value,Ye(Qc,x._currentValue),x._currentValue=R,j!==null)if(qn(j.value,R)){if(j.children===C.children&&!Kt.current){l=Ur(o,l,m);break e}}else for(j=l.child,j!==null&&(j.return=l);j!==null;){var W=j.dependencies;if(W!==null){R=j.child;for(var X=W.firstContext;X!==null;){if(X.context===x){if(j.tag===1){X=Hr(-1,m&-m),X.tag=2;var oe=j.updateQueue;if(oe!==null){oe=oe.shared;var de=oe.pending;de===null?X.next=X:(X.next=de.next,de.next=X),oe.pending=X}}j.lanes|=m,X=j.alternate,X!==null&&(X.lanes|=m),Yh(j.return,m,l),W.lanes|=m;break}X=X.next}}else if(j.tag===10)R=j.type===l.type?null:j.child;else if(j.tag===18){if(R=j.return,R===null)throw Error(n(341));R.lanes|=m,W=R.alternate,W!==null&&(W.lanes|=m),Yh(R,m,l),R=j.sibling}else R=j.child;if(R!==null)R.return=j;else for(R=j;R!==null;){if(R===l){R=null;break}if(j=R.sibling,j!==null){j.return=R.return,R=j;break}R=R.return}j=R}qt(o,l,C.children,m),l=l.child}return l;case 9:return C=l.type,x=l.pendingProps.children,fo(l,m),C=Sn(C),x=x(C),l.flags|=1,qt(o,l,x,m),l.child;case 14:return x=l.type,C=zn(x,l.pendingProps),C=zn(x.type,C),uk(o,l,x,C,m);case 15:return dk(o,l,l.type,l.pendingProps,m);case 17:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:zn(x,C),cu(o,l),l.tag=1,Gt(x)?(o=!0,Uc(l)):o=!1,fo(l,m),nk(l,x,C),dp(l,x,C,m),mp(null,l,x,!0,o,m);case 19:return vk(o,l,m);case 22:return fk(o,l,m)}throw Error(n(156,l.tag))};function Vk(o,l){return wc(o,l)}function q5(o,l,m,x){this.tag=o,this.key=m,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=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(o,l,m,x){return new q5(o,l,m,x)}function Pp(o){return o=o.prototype,!(!o||!o.isReactComponent)}function B5(o){if(typeof o=="function")return Pp(o)?1:0;if(o!=null){if(o=o.$$typeof,o===P)return 11;if(o===z)return 14}return 2}function Es(o,l){var m=o.alternate;return m===null?(m=En(o.tag,l,o.key,o.mode),m.elementType=o.elementType,m.type=o.type,m.stateNode=o.stateNode,m.alternate=o,o.alternate=m):(m.pendingProps=l,m.type=o.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=o.flags&14680064,m.childLanes=o.childLanes,m.lanes=o.lanes,m.child=o.child,m.memoizedProps=o.memoizedProps,m.memoizedState=o.memoizedState,m.updateQueue=o.updateQueue,l=o.dependencies,m.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},m.sibling=o.sibling,m.index=o.index,m.ref=o.ref,m}function bu(o,l,m,x,C,j){var R=2;if(x=o,typeof o=="function")Pp(o)&&(R=1);else if(typeof o=="string")R=5;else e:switch(o){case T:return hi(m.children,C,j,l);case O:R=8,C|=8;break;case L:return o=En(12,m,l,C|2),o.elementType=L,o.lanes=j,o;case H:return o=En(13,m,l,C),o.elementType=H,o.lanes=j,o;case D:return o=En(19,m,l,C),o.elementType=D,o.lanes=j,o;case G:return wu(m,C,j,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case B:R=10;break e;case M:R=9;break e;case P:R=11;break e;case z:R=14;break e;case V:R=16,x=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=En(R,m,l,C),l.elementType=o,l.type=x,l.lanes=j,l}function hi(o,l,m,x){return o=En(7,o,x,l),o.lanes=m,o}function wu(o,l,m,x){return o=En(22,o,x,l),o.elementType=G,o.lanes=m,o.stateNode={isHidden:!1},o}function Lp(o,l,m){return o=En(6,o,null,l),o.lanes=m,o}function Dp(o,l,m){return l=En(4,o.children!==null?o.children:[],o.key,l),l.lanes=m,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function z5(o,l,m,x,C){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wa(0),this.expirationTimes=wa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wa(0),this.identifierPrefix=x,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function $p(o,l,m,x,C,j,R,W,X){return o=new z5(o,l,m,W,X),l===1?(l=1,j===!0&&(l|=8)):l=0,j=En(3,null,null,l),o.current=j,j.stateNode=o,j.memoizedState={element:x,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qh(j),o}function V5(o,l,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:x==null?null:""+x,children:o,containerInfo:l,implementation:m}}function Hk(o){if(!o)return xs;o=o._reactInternals;e:{if(dr(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Gt(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var m=o.type;if(Gt(m))return xN(o,m,l)}return l}function Uk(o,l,m,x,C,j,R,W,X){return o=$p(m,x,!0,o,C,j,R,W,X),o.context=Hk(null),m=o.current,x=Bt(),C=Cs(m),j=Hr(x,C),j.callback=l??null,ws(m,j,C),o.current.lanes=C,ti(o,C,x),Qt(o,x),o}function Nu(o,l,m,x){var C=l.current,j=Bt(),R=Cs(C);return m=Hk(m),l.context===null?l.context=m:l.pendingContext=m,l=Hr(j,R),l.payload={element:o},x=x===void 0?null:x,x!==null&&(l.callback=x),o=ws(C,l,R),o!==null&&(Un(o,C,R,j),Zc(o,C,R)),R}function ku(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function Wk(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var m=o.retryLane;o.retryLane=m!==0&&m<l?m:l}}function Fp(o,l){Wk(o,l),(o=o.alternate)&&Wk(o,l)}function H5(){return null}var Kk=typeof reportError=="function"?reportError:function(o){console.error(o)};function qp(o){this._internalRoot=o}Su.prototype.render=qp.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Nu(o,l,null,null)},Su.prototype.unmount=qp.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;ui(function(){Nu(null,o,null,null)}),l[Fr]=null}};function Su(o){this._internalRoot=o}Su.prototype.unstable_scheduleHydration=function(o){if(o){var l=T1();o={blockedOn:null,target:o,priority:l};for(var m=0;m<hs.length&&l!==0&&l<hs[m].priority;m++);hs.splice(m,0,o),m===0&&R1(o)}};function Bp(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Cu(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Gk(){}function U5(o,l,m,x,C){if(C){if(typeof x=="function"){var j=x;x=function(){var oe=ku(R);j.call(oe)}}var R=Uk(l,x,o,0,null,!1,!1,"",Gk);return o._reactRootContainer=R,o[Fr]=R.current,Pa(o.nodeType===8?o.parentNode:o),ui(),R}for(;C=o.lastChild;)o.removeChild(C);if(typeof x=="function"){var W=x;x=function(){var oe=ku(X);W.call(oe)}}var X=$p(o,0,!1,null,null,!1,!1,"",Gk);return o._reactRootContainer=X,o[Fr]=X.current,Pa(o.nodeType===8?o.parentNode:o),ui(function(){Nu(l,X,m,x)}),X}function _u(o,l,m,x,C){var j=m._reactRootContainer;if(j){var R=j;if(typeof C=="function"){var W=C;C=function(){var X=ku(R);W.call(X)}}Nu(l,R,o,C)}else R=U5(m,l,o,C,x);return ku(R)}j1=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var m=fr(l.pendingLanes);m!==0&&(dh(l,m|1),Qt(l,ot()),(Fe&6)===0&&(yo=ot()+500,vs()))}break;case 13:ui(function(){var x=Vr(o,1);if(x!==null){var C=Bt();Un(x,o,1,C)}}),Fp(o,1)}},fh=function(o){if(o.tag===13){var l=Vr(o,134217728);if(l!==null){var m=Bt();Un(l,o,134217728,m)}Fp(o,134217728)}},A1=function(o){if(o.tag===13){var l=Cs(o),m=Vr(o,l);if(m!==null){var x=Bt();Un(m,o,l,x)}Fp(o,l)}},T1=function(){return Ke},I1=function(o,l){var m=Ke;try{return Ke=o,l()}finally{Ke=m}},ur=function(o,l,m){switch(l){case"input":if(Se(o,m),l=m.name,m.type==="radio"&&l!=null){for(m=o;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<m.length;l++){var x=m[l];if(x!==o&&x.form===o.form){var C=Vc(x);if(!C)throw Error(n(90));he(x),Se(x,C)}}}break;case"textarea":nn(o,m);break;case"select":l=m.value,l!=null&&St(o,!!m.multiple,l,!1)}},be=Mp,We=ui;var W5={usingClientEntryPoint:!1,Events:[$a,ro,Vc,Qs,Ce,Mp]},Ja={findFiberByHostInstance:ni,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},K5={bundleType:Ja.bundleType,version:Ja.version,rendererPackageName:Ja.rendererPackageName,rendererConfig:Ja.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=vc(o),o===null?null:o.stateNode},findFiberByHostInstance:Ja.findFiberByHostInstance||H5,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{ei=Eu.inject(K5),wn=Eu}catch{}}return Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W5,Jt.createPortal=function(o,l){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Bp(l))throw Error(n(200));return V5(o,l,null,m)},Jt.createRoot=function(o,l){if(!Bp(o))throw Error(n(299));var m=!1,x="",C=Kk;return l!=null&&(l.unstable_strictMode===!0&&(m=!0),l.identifierPrefix!==void 0&&(x=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=$p(o,1,!1,null,null,m,!1,x,C),o[Fr]=l.current,Pa(o.nodeType===8?o.parentNode:o),new qp(l)},Jt.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=vc(l),o=o===null?null:o.stateNode,o},Jt.flushSync=function(o){return ui(o)},Jt.hydrate=function(o,l,m){if(!Cu(l))throw Error(n(200));return _u(null,o,l,!0,m)},Jt.hydrateRoot=function(o,l,m){if(!Bp(o))throw Error(n(405));var x=m!=null&&m.hydratedSources||null,C=!1,j="",R=Kk;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(j=m.identifierPrefix),m.onRecoverableError!==void 0&&(R=m.onRecoverableError)),l=Uk(l,null,o,1,m??null,C,!1,j,R),o[Fr]=l.current,Pa(o),x)for(o=0;o<x.length;o++)m=x[o],C=m._getVersion,C=C(m._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[m,C]:l.mutableSourceEagerHydrationData.push(m,C);return new Su(l)},Jt.render=function(o,l,m){if(!Cu(l))throw Error(n(200));return _u(null,o,l,!1,m)},Jt.unmountComponentAtNode=function(o){if(!Cu(o))throw Error(n(40));return o._reactRootContainer?(ui(function(){_u(null,null,o,!1,function(){o._reactRootContainer=null,o[Fr]=null})}),!0):!1},Jt.unstable_batchedUpdates=Mp,Jt.unstable_renderSubtreeIntoContainer=function(o,l,m,x){if(!Cu(m))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return _u(o,l,m,!1,x)},Jt.version="18.3.1-next-f1338f8080-20240426",Jt}var nS;function aI(){if(nS)return Hp.exports;nS=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(),Hp.exports=tD(),Hp.exports}var rS;function nD(){if(rS)return Au;rS=1;var e=aI();return Au.createRoot=e.createRoot,Au.hydrateRoot=e.hydrateRoot,Au}var rD=nD();const sD=Ul(rD);function vt(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=vt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var iD={value:()=>{}};function Wd(){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 sd(n)}function sd(e){this._=e}function oD(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}})}sd.prototype=Wd.prototype={constructor:sd,on:function(e,t){var n=this._,r=oD(e+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i<a;)if((s=(e=r[i]).type)&&(s=aD(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<a;)if(s=(e=r[i]).type)n[s]=sS(n[s],e.name,t);else if(t==null)for(s in n)n[s]=sS(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 sd(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,i;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,s=i.length;r<s;++r)i[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,i=r.length;s<i;++s)r[s].value.apply(t,n)}};function aD(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function sS(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=iD,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Y0="http://www.w3.org/1999/xhtml";const iS={svg:"http://www.w3.org/2000/svg",xhtml:Y0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Kd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),iS.hasOwnProperty(t)?{space:iS[t],local:e}:e}function lD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Y0&&t.documentElement.namespaceURI===Y0?t.createElement(e):t.createElementNS(n,e)}}function cD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function lI(e){var t=Kd(e);return(t.local?cD:lD)(t)}function uD(){}function Wb(e){return e==null?uD:function(){return this.querySelector(e)}}function dD(e){typeof e!="function"&&(e=Wb(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],a=i.length,c=r[s]=new Array(a),d,f,p=0;p<a;++p)(d=i[p])&&(f=e.call(d,d.__data__,p,i))&&("__data__"in d&&(f.__data__=d.__data__),c[p]=f);return new yn(r,this._parents)}function fD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function hD(){return[]}function cI(e){return e==null?hD:function(){return this.querySelectorAll(e)}}function pD(e){return function(){return fD(e.apply(this,arguments))}}function mD(e){typeof e=="function"?e=pD(e):e=cI(e);for(var t=this._groups,n=t.length,r=[],s=[],i=0;i<n;++i)for(var a=t[i],c=a.length,d,f=0;f<c;++f)(d=a[f])&&(r.push(e.call(d,d.__data__,f,a)),s.push(d));return new yn(r,s)}function uI(e){return function(){return this.matches(e)}}function dI(e){return function(t){return t.matches(e)}}var gD=Array.prototype.find;function yD(e){return function(){return gD.call(this.children,e)}}function xD(){return this.firstElementChild}function vD(e){return this.select(e==null?xD:yD(typeof e=="function"?e:dI(e)))}var bD=Array.prototype.filter;function wD(){return Array.from(this.children)}function ND(e){return function(){return bD.call(this.children,e)}}function kD(e){return this.selectAll(e==null?wD:ND(typeof e=="function"?e:dI(e)))}function SD(e){typeof e!="function"&&(e=uI(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],a=i.length,c=r[s]=[],d,f=0;f<a;++f)(d=i[f])&&e.call(d,d.__data__,f,i)&&c.push(d);return new yn(r,this._parents)}function fI(e){return new Array(e.length)}function CD(){return new yn(this._enter||this._groups.map(fI),this._parents)}function vd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}vd.prototype={constructor:vd,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 _D(e){return function(){return e}}function ED(e,t,n,r,s,i){for(var a=0,c,d=t.length,f=i.length;a<f;++a)(c=t[a])?(c.__data__=i[a],r[a]=c):n[a]=new vd(e,i[a]);for(;a<d;++a)(c=t[a])&&(s[a]=c)}function jD(e,t,n,r,s,i,a){var c,d,f=new Map,p=t.length,h=i.length,g=new Array(p),y;for(c=0;c<p;++c)(d=t[c])&&(g[c]=y=a.call(d,d.__data__,c,t)+"",f.has(y)?s[c]=d:f.set(y,d));for(c=0;c<h;++c)y=a.call(e,i[c],c,i)+"",(d=f.get(y))?(r[c]=d,d.__data__=i[c],f.delete(y)):n[c]=new vd(e,i[c]);for(c=0;c<p;++c)(d=t[c])&&f.get(g[c])===d&&(s[c]=d)}function AD(e){return e.__data__}function TD(e,t){if(!arguments.length)return Array.from(this,AD);var n=t?jD:ED,r=this._parents,s=this._groups;typeof e!="function"&&(e=_D(e));for(var i=s.length,a=new Array(i),c=new Array(i),d=new Array(i),f=0;f<i;++f){var p=r[f],h=s[f],g=h.length,y=ID(e.call(p,p&&p.__data__,f,r)),w=y.length,b=c[f]=new Array(w),v=a[f]=new Array(w),N=d[f]=new Array(g);n(p,h,b,v,N,y,t);for(var S=0,k=0,_,A;S<w;++S)if(_=b[S]){for(S>=k&&(k=S+1);!(A=v[k])&&++k<w;);_._next=A||null}}return a=new yn(a,r),a._enter=c,a._exit=d,a}function ID(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function MD(){return new yn(this._exit||this._groups.map(fI),this._parents)}function RD(e,t,n){var r=this.enter(),s=this,i=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?i.remove():n(i),r&&s?r.merge(s).order():s}function OD(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,i=r.length,a=Math.min(s,i),c=new Array(s),d=0;d<a;++d)for(var f=n[d],p=r[d],h=f.length,g=c[d]=new Array(h),y,w=0;w<h;++w)(y=f[w]||p[w])&&(g[w]=y);for(;d<s;++d)c[d]=n[d];return new yn(c,this._parents)}function PD(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,i=r[s],a;--s>=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function LD(e){e||(e=DD);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}for(var n=this._groups,r=n.length,s=new Array(r),i=0;i<r;++i){for(var a=n[i],c=a.length,d=s[i]=new Array(c),f,p=0;p<c;++p)(f=a[p])&&(d[p]=f);d.sort(t)}return new yn(s,this._parents).order()}function DD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $D(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function FD(){return Array.from(this)}function qD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length;s<i;++s){var a=r[s];if(a)return a}return null}function BD(){let e=0;for(const t of this)++e;return e}function zD(){return!this.node()}function VD(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],i=0,a=s.length,c;i<a;++i)(c=s[i])&&e.call(c,c.__data__,i,s);return this}function HD(e){return function(){this.removeAttribute(e)}}function UD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function WD(e,t){return function(){this.setAttribute(e,t)}}function KD(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function GD(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function YD(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 XD(e,t){var n=Kd(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?UD:HD:typeof t=="function"?n.local?YD:GD:n.local?KD:WD)(n,t))}function hI(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function QD(e){return function(){this.style.removeProperty(e)}}function JD(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ZD(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function e$(e,t,n){return arguments.length>1?this.each((t==null?QD:typeof t=="function"?ZD:JD)(e,t,n??"")):Bo(this.node(),e)}function Bo(e,t){return e.style.getPropertyValue(t)||hI(e).getComputedStyle(e,null).getPropertyValue(t)}function t$(e){return function(){delete this[e]}}function n$(e,t){return function(){this[e]=t}}function r$(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function s$(e,t){return arguments.length>1?this.each((t==null?t$:typeof t=="function"?r$:n$)(e,t)):this.node()[e]}function pI(e){return e.trim().split(/^|\s+/)}function Kb(e){return e.classList||new mI(e)}function mI(e){this._node=e,this._names=pI(e.getAttribute("class")||"")}mI.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 gI(e,t){for(var n=Kb(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function yI(e,t){for(var n=Kb(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function i$(e){return function(){gI(this,e)}}function o$(e){return function(){yI(this,e)}}function a$(e,t){return function(){(t.apply(this,arguments)?gI:yI)(this,e)}}function l$(e,t){var n=pI(e+"");if(arguments.length<2){for(var r=Kb(this.node()),s=-1,i=n.length;++s<i;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?a$:t?i$:o$)(n,t))}function c$(){this.textContent=""}function u$(e){return function(){this.textContent=e}}function d$(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function f$(e){return arguments.length?this.each(e==null?c$:(typeof e=="function"?d$:u$)(e)):this.node().textContent}function h$(){this.innerHTML=""}function p$(e){return function(){this.innerHTML=e}}function m$(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function g$(e){return arguments.length?this.each(e==null?h$:(typeof e=="function"?m$:p$)(e)):this.node().innerHTML}function y$(){this.nextSibling&&this.parentNode.appendChild(this)}function x$(){return this.each(y$)}function v$(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function b$(){return this.each(v$)}function w$(e){var t=typeof e=="function"?e:lI(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function N$(){return null}function k$(e,t){var n=typeof e=="function"?e:lI(e),r=t==null?N$:typeof t=="function"?t:Wb(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function S$(){var e=this.parentNode;e&&e.removeChild(this)}function C$(){return this.each(S$)}function _$(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function E$(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function j$(e){return this.select(e?E$:_$)}function A$(e){return arguments.length?this.property("__data__",e):this.node().__data__}function T$(e){return function(t){e.call(this,t,this.__data__)}}function I$(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 M$(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n<s;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function R$(e,t,n){return function(){var r=this.__on,s,i=T$(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=i,s.options=n),s.value=t;return}}this.addEventListener(e.type,i,n),s={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(s):this.__on=[s]}}function O$(e,t,n){var r=I$(e+""),s,i=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,f=c.length,p;d<f;++d)for(s=0,p=c[d];s<i;++s)if((a=r[s]).type===p.type&&a.name===p.name)return p.value}return}for(c=t?R$:M$,s=0;s<i;++s)this.each(c(r[s],t,n));return this}function xI(e,t,n){var r=hI(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 P$(e,t){return function(){return xI(this,e,t)}}function L$(e,t){return function(){return xI(this,e,t.apply(this,arguments))}}function D$(e,t){return this.each((typeof t=="function"?L$:P$)(e,t))}function*$$(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,i=r.length,a;s<i;++s)(a=r[s])&&(yield a)}var vI=[null];function yn(e,t){this._groups=e,this._parents=t}function Kl(){return new yn([[document.documentElement]],vI)}function F$(){return this}yn.prototype=Kl.prototype={constructor:yn,select:dD,selectAll:mD,selectChild:vD,selectChildren:kD,filter:SD,data:TD,enter:CD,exit:MD,join:RD,merge:OD,selection:F$,order:PD,sort:LD,call:$D,nodes:FD,node:qD,size:BD,empty:zD,each:VD,attr:XD,style:e$,property:s$,classed:l$,text:f$,html:g$,raise:x$,lower:b$,append:w$,insert:k$,remove:C$,clone:j$,datum:A$,on:O$,dispatch:D$,[Symbol.iterator]:$$};function mn(e){return typeof e=="string"?new yn([[document.querySelector(e)]],[document.documentElement]):new yn([[e]],vI)}function q$(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Gn(e,t){if(e=q$(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 B$={passive:!1},Sl={capture:!0,passive:!1};function Kp(e){e.stopImmediatePropagation()}function Ro(e){e.preventDefault(),e.stopImmediatePropagation()}function bI(e){var t=e.document.documentElement,n=mn(e).on("dragstart.drag",Ro,Sl);"onselectstart"in t?n.on("selectstart.drag",Ro,Sl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function wI(e,t){var n=e.document.documentElement,r=mn(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ro,Sl),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 Tu=e=>()=>e;function X0(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:c,dx:d,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}X0.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function z$(e){return!e.ctrlKey&&!e.button}function V$(){return this.parentNode}function H$(e,t){return t??{x:e.x,y:e.y}}function U$(){return navigator.maxTouchPoints||"ontouchstart"in this}function NI(){var e=z$,t=V$,n=H$,r=U$,s={},i=Wd("start","drag","end"),a=0,c,d,f,p,h=0;function g(_){_.on("mousedown.drag",y).filter(r).on("touchstart.drag",v).on("touchmove.drag",N,B$).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(_,A){if(!(p||!e.call(this,_,A))){var I=k(this,t.call(this,_,A),_,A,"mouse");I&&(mn(_.view).on("mousemove.drag",w,Sl).on("mouseup.drag",b,Sl),bI(_.view),Kp(_),f=!1,c=_.clientX,d=_.clientY,I("start",_))}}function w(_){if(Ro(_),!f){var A=_.clientX-c,I=_.clientY-d;f=A*A+I*I>h}s.mouse("drag",_)}function b(_){mn(_.view).on("mousemove.drag mouseup.drag",null),wI(_.view,f),Ro(_),s.mouse("end",_)}function v(_,A){if(e.call(this,_,A)){var I=_.changedTouches,T=t.call(this,_,A),O=I.length,L,B;for(L=0;L<O;++L)(B=k(this,T,_,A,I[L].identifier,I[L]))&&(Kp(_),B("start",_,I[L]))}}function N(_){var A=_.changedTouches,I=A.length,T,O;for(T=0;T<I;++T)(O=s[A[T].identifier])&&(Ro(_),O("drag",_,A[T]))}function S(_){var A=_.changedTouches,I=A.length,T,O;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),T=0;T<I;++T)(O=s[A[T].identifier])&&(Kp(_),O("end",_,A[T]))}function k(_,A,I,T,O,L){var B=i.copy(),M=Gn(L||I,A),P,H,D;if((D=n.call(_,new X0("beforestart",{sourceEvent:I,target:g,identifier:O,active:a,x:M[0],y:M[1],dx:0,dy:0,dispatch:B}),T))!=null)return P=D.x-M[0]||0,H=D.y-M[1]||0,function z(V,G,q){var F=M,Y;switch(V){case"start":s[O]=z,Y=a++;break;case"end":delete s[O],--a;case"drag":M=Gn(q||G,A),Y=a;break}B.call(V,_,new X0(V,{sourceEvent:G,subject:D,target:g,identifier:O,active:Y,x:M[0]+P,y:M[1]+H,dx:M[0]-F[0],dy:M[1]-F[1],dispatch:B}),T)}}return g.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Tu(!!_),g):e},g.container=function(_){return arguments.length?(t=typeof _=="function"?_:Tu(_),g):t},g.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Tu(_),g):n},g.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Tu(!!_),g):r},g.on=function(){var _=i.on.apply(i,arguments);return _===i?g:_},g.clickDistance=function(_){return arguments.length?(h=(_=+_)*_,g):Math.sqrt(h)},g}function Gb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Gl(){}var Cl=.7,bd=1/Cl,Oo="\\s*([+-]?\\d+)\\s*",_l="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",W$=/^#([0-9a-f]{3,8})$/,K$=new RegExp(`^rgb\\(${Oo},${Oo},${Oo}\\)$`),G$=new RegExp(`^rgb\\(${kr},${kr},${kr}\\)$`),Y$=new RegExp(`^rgba\\(${Oo},${Oo},${Oo},${_l}\\)$`),X$=new RegExp(`^rgba\\(${kr},${kr},${kr},${_l}\\)$`),Q$=new RegExp(`^hsl\\(${_l},${kr},${kr}\\)$`),J$=new RegExp(`^hsla\\(${_l},${kr},${kr},${_l}\\)$`),oS={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};Gb(Gl,ki,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:aS,formatHex:aS,formatHex8:Z$,formatHsl:eF,formatRgb:lS,toString:lS});function aS(){return this.rgb().formatHex()}function Z$(){return this.rgb().formatHex8()}function eF(){return SI(this).formatHsl()}function lS(){return this.rgb().formatRgb()}function ki(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=W$.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cS(t):n===3?new Zt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Iu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Iu(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=K$.exec(e))?new Zt(t[1],t[2],t[3],1):(t=G$.exec(e))?new Zt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Y$.exec(e))?Iu(t[1],t[2],t[3],t[4]):(t=X$.exec(e))?Iu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Q$.exec(e))?fS(t[1],t[2]/100,t[3]/100,1):(t=J$.exec(e))?fS(t[1],t[2]/100,t[3]/100,t[4]):oS.hasOwnProperty(e)?cS(oS[e]):e==="transparent"?new Zt(NaN,NaN,NaN,0):null}function cS(e){return new Zt(e>>16&255,e>>8&255,e&255,1)}function Iu(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zt(e,t,n,r)}function tF(e){return e instanceof Gl||(e=ki(e)),e?(e=e.rgb(),new Zt(e.r,e.g,e.b,e.opacity)):new Zt}function Q0(e,t,n,r){return arguments.length===1?tF(e):new Zt(e,t,n,r??1)}function Zt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Gb(Zt,Q0,kI(Gl,{brighter(e){return e=e==null?bd:Math.pow(bd,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cl:Math.pow(Cl,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zt(wi(this.r),wi(this.g),wi(this.b),wd(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:uS,formatHex:uS,formatHex8:nF,formatRgb:dS,toString:dS}));function uS(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}`}function nF(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}${xi((isNaN(this.opacity)?1:this.opacity)*255)}`}function dS(){const e=wd(this.opacity);return`${e===1?"rgb(":"rgba("}${wi(this.r)}, ${wi(this.g)}, ${wi(this.b)}${e===1?")":`, ${e})`}`}function wd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xi(e){return e=wi(e),(e<16?"0":"")+e.toString(16)}function fS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Xn(e,t,n,r)}function SI(e){if(e instanceof Xn)return new Xn(e.h,e.s,e.l,e.opacity);if(e instanceof Gl||(e=ki(e)),!e)return new Xn;if(e instanceof Xn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,c=i-s,d=(i+s)/2;return c?(t===i?a=(n-r)/c+(n<r)*6:n===i?a=(r-t)/c+2:a=(t-n)/c+4,c/=d<.5?i+s:2-i-s,a*=60):c=d>0&&d<1?0:a,new Xn(a,c,d,e.opacity)}function rF(e,t,n,r){return arguments.length===1?SI(e):new Xn(e,t,n,r??1)}function Xn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Gb(Xn,rF,kI(Gl,{brighter(e){return e=e==null?bd:Math.pow(bd,e),new Xn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cl:Math.pow(Cl,e),new Xn(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 Zt(Gp(e>=240?e-240:e+120,s,r),Gp(e,s,r),Gp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Xn(hS(this.h),Mu(this.s),Mu(this.l),wd(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=wd(this.opacity);return`${e===1?"hsl(":"hsla("}${hS(this.h)}, ${Mu(this.s)*100}%, ${Mu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hS(e){return e=(e||0)%360,e<0?e+360:e}function Mu(e){return Math.max(0,Math.min(1,e||0))}function Gp(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 Yb=e=>()=>e;function sF(e,t){return function(n){return e+n*t}}function iF(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 oF(e){return(e=+e)==1?CI:function(t,n){return n-t?iF(t,n,e):Yb(isNaN(t)?n:t)}}function CI(e,t){var n=t-e;return n?sF(e,n):Yb(isNaN(e)?t:e)}const Nd=(function e(t){var n=oF(t);function r(s,i){var a=n((s=Q0(s)).r,(i=Q0(i)).r),c=n(s.g,i.g),d=n(s.b,i.b),f=CI(s.opacity,i.opacity);return function(p){return s.r=a(p),s.g=c(p),s.b=d(p),s.opacity=f(p),s+""}}return r.gamma=e,r})(1);function aF(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;s<n;++s)r[s]=e[s]*(1-i)+t[s]*i;return r}}function lF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cF(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),i=new Array(n),a;for(a=0;a<r;++a)s[a]=yl(e[a],t[a]);for(;a<n;++a)i[a]=t[a];return function(c){for(a=0;a<r;++a)i[a]=s[a](c);return i}}function uF(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function yr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dF(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]=yl(e[s],t[s]):r[s]=t[s];return function(i){for(s in n)r[s]=n[s](i);return r}}var J0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yp=new RegExp(J0.source,"g");function fF(e){return function(){return e}}function hF(e){return function(t){return e(t)+""}}function _I(e,t){var n=J0.lastIndex=Yp.lastIndex=0,r,s,i,a=-1,c=[],d=[];for(e=e+"",t=t+"";(r=J0.exec(e))&&(s=Yp.exec(t));)(i=s.index)>n&&(i=t.slice(n,i),c[a]?c[a]+=i:c[++a]=i),(r=r[0])===(s=s[0])?c[a]?c[a]+=s:c[++a]=s:(c[++a]=null,d.push({i:a,x:yr(r,s)})),n=Yp.lastIndex;return n<t.length&&(i=t.slice(n),c[a]?c[a]+=i:c[++a]=i),c.length<2?d[0]?hF(d[0].x):fF(t):(t=d.length,function(f){for(var p=0,h;p<t;++p)c[(h=d[p]).i]=h.x(f);return c.join("")})}function yl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Yb(t):(n==="number"?yr:n==="string"?(r=ki(t))?(t=r,Nd):_I:t instanceof ki?Nd:t instanceof Date?uF:lF(t)?aF:Array.isArray(t)?cF:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?dF:yr)(e,t)}var pS=180/Math.PI,Z0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function EI(e,t,n,r,s,i){var a,c,d;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,d/=c),e*r<t*n&&(e=-e,t=-t,d=-d,a=-a),{translateX:s,translateY:i,rotate:Math.atan2(t,e)*pS,skewX:Math.atan(d)*pS,scaleX:a,scaleY:c}}var Ru;function pF(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Z0:EI(t.a,t.b,t.c,t.d,t.e,t.f)}function mF(e){return e==null||(Ru||(Ru=document.createElementNS("http://www.w3.org/2000/svg","g")),Ru.setAttribute("transform",e),!(e=Ru.transform.baseVal.consolidate()))?Z0:(e=e.matrix,EI(e.a,e.b,e.c,e.d,e.e,e.f))}function jI(e,t,n,r){function s(f){return f.length?f.pop()+" ":""}function i(f,p,h,g,y,w){if(f!==h||p!==g){var b=y.push("translate(",null,t,null,n);w.push({i:b-4,x:yr(f,h)},{i:b-2,x:yr(p,g)})}else(h||g)&&y.push("translate("+h+t+g+n)}function a(f,p,h,g){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),g.push({i:h.push(s(h)+"rotate(",null,r)-2,x:yr(f,p)})):p&&h.push(s(h)+"rotate("+p+r)}function c(f,p,h,g){f!==p?g.push({i:h.push(s(h)+"skewX(",null,r)-2,x:yr(f,p)}):p&&h.push(s(h)+"skewX("+p+r)}function d(f,p,h,g,y,w){if(f!==h||p!==g){var b=y.push(s(y)+"scale(",null,",",null,")");w.push({i:b-4,x:yr(f,h)},{i:b-2,x:yr(p,g)})}else(h!==1||g!==1)&&y.push(s(y)+"scale("+h+","+g+")")}return function(f,p){var h=[],g=[];return f=e(f),p=e(p),i(f.translateX,f.translateY,p.translateX,p.translateY,h,g),a(f.rotate,p.rotate,h,g),c(f.skewX,p.skewX,h,g),d(f.scaleX,f.scaleY,p.scaleX,p.scaleY,h,g),f=p=null,function(y){for(var w=-1,b=g.length,v;++w<b;)h[(v=g[w]).i]=v.x(y);return h.join("")}}}var gF=jI(pF,"px, ","px)","deg)"),yF=jI(mF,", ",")",")"),xF=1e-12;function mS(e){return((e=Math.exp(e))+1/e)/2}function vF(e){return((e=Math.exp(e))-1/e)/2}function bF(e){return((e=Math.exp(2*e))-1)/(e+1)}const id=(function e(t,n,r){function s(i,a){var c=i[0],d=i[1],f=i[2],p=a[0],h=a[1],g=a[2],y=p-c,w=h-d,b=y*y+w*w,v,N;if(b<xF)N=Math.log(g/f)/t,v=function(T){return[c+T*y,d+T*w,f*Math.exp(t*T*N)]};else{var S=Math.sqrt(b),k=(g*g-f*f+r*b)/(2*f*n*S),_=(g*g-f*f-r*b)/(2*g*n*S),A=Math.log(Math.sqrt(k*k+1)-k),I=Math.log(Math.sqrt(_*_+1)-_);N=(I-A)/t,v=function(T){var O=T*N,L=mS(A),B=f/(n*S)*(L*bF(t*O+A)-vF(A));return[c+B*y,d+B*w,f*L/mS(t*O+A)]}}return v.duration=N*1e3*t/Math.SQRT2,v}return s.rho=function(i){var a=Math.max(.001,+i),c=a*a,d=c*c;return e(a,c,d)},s})(Math.SQRT2,2,4);var zo=0,ol=0,el=0,AI=1e3,kd,al,Sd=0,Si=0,Gd=0,El=typeof performance=="object"&&performance.now?performance:Date,TI=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xb(){return Si||(TI(wF),Si=El.now()+Gd)}function wF(){Si=0}function Cd(){this._call=this._time=this._next=null}Cd.prototype=II.prototype={constructor:Cd,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Xb():+n)+(t==null?0:+t),!this._next&&al!==this&&(al?al._next=this:kd=this,al=this),this._call=e,this._time=n,eb()},stop:function(){this._call&&(this._call=null,this._time=1/0,eb())}};function II(e,t,n){var r=new Cd;return r.restart(e,t,n),r}function NF(){Xb(),++zo;for(var e=kd,t;e;)(t=Si-e._time)>=0&&e._call.call(void 0,t),e=e._next;--zo}function gS(){Si=(Sd=El.now())+Gd,zo=ol=0;try{NF()}finally{zo=0,SF(),Si=0}}function kF(){var e=El.now(),t=e-Sd;t>AI&&(Gd-=t,Sd=e)}function SF(){for(var e,t=kd,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:kd=n);al=e,eb(r)}function eb(e){if(!zo){ol&&(ol=clearTimeout(ol));var t=e-Si;t>24?(e<1/0&&(ol=setTimeout(gS,e-El.now()-Gd)),el&&(el=clearInterval(el))):(el||(Sd=El.now(),el=setInterval(kF,AI)),zo=1,TI(gS))}}function yS(e,t,n){var r=new Cd;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var CF=Wd("start","end","cancel","interrupt"),_F=[],MI=0,xS=1,tb=2,od=3,vS=4,nb=5,ad=6;function Yd(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;EF(e,n,{name:t,index:r,group:s,on:CF,tween:_F,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:MI})}function Qb(e,t){var n=sr(e,t);if(n.state>MI)throw new Error("too late; already scheduled");return n}function Or(e,t){var n=sr(e,t);if(n.state>od)throw new Error("too late; already running");return n}function sr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function EF(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=II(i,0,n.time);function i(f){n.state=xS,n.timer.restart(a,n.delay,n.time),n.delay<=f&&a(f-n.delay)}function a(f){var p,h,g,y;if(n.state!==xS)return d();for(p in r)if(y=r[p],y.name===n.name){if(y.state===od)return yS(a);y.state===vS?(y.state=ad,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[p]):+p<t&&(y.state=ad,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[p])}if(yS(function(){n.state===od&&(n.state=vS,n.timer.restart(c,n.delay,n.time),c(f))}),n.state=tb,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tb){for(n.state=od,s=new Array(g=n.tween.length),p=0,h=-1;p<g;++p)(y=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(s[++h]=y);s.length=h+1}}function c(f){for(var p=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(d),n.state=nb,1),h=-1,g=s.length;++h<g;)s[h].call(e,p);n.state===nb&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=ad,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function ld(e,t){var n=e.__transition,r,s,i=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){i=!1;continue}s=r.state>tb&&r.state<nb,r.state=ad,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}i&&delete e.__transition}}function jF(e){return this.each(function(){ld(this,e)})}function AF(e,t){var n,r;return function(){var s=Or(this,e),i=s.tween;if(i!==n){r=n=i;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 TF(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var i=Or(this,e),a=i.tween;if(a!==r){s=(r=a).slice();for(var c={name:t,value:n},d=0,f=s.length;d<f;++d)if(s[d].name===t){s[d]=c;break}d===f&&s.push(c)}i.tween=s}}function IF(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=sr(this.node(),n).tween,s=0,i=r.length,a;s<i;++s)if((a=r[s]).name===e)return a.value;return null}return this.each((t==null?AF:TF)(n,e,t))}function Jb(e,t,n){var r=e._id;return e.each(function(){var s=Or(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return sr(s,r).value[t]}}function RI(e,t){var n;return(typeof t=="number"?yr:t instanceof ki?Nd:(n=ki(t))?(t=n,Nd):_I)(e,t)}function MF(e){return function(){this.removeAttribute(e)}}function RF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function OF(e,t,n){var r,s=n+"",i;return function(){var a=this.getAttribute(e);return a===s?null:a===r?i:i=t(r=a,n)}}function PF(e,t,n){var r,s=n+"",i;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===r?i:i=t(r=a,n)}}function LF(e,t,n){var r,s,i;return function(){var a,c=n(this),d;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),d=c+"",a===d?null:a===r&&d===s?i:(s=d,i=t(r=a,c)))}}function DF(e,t,n){var r,s,i;return function(){var a,c=n(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),d=c+"",a===d?null:a===r&&d===s?i:(s=d,i=t(r=a,c)))}}function $F(e,t){var n=Kd(e),r=n==="transform"?yF:RI;return this.attrTween(e,typeof t=="function"?(n.local?DF:LF)(n,r,Jb(this,"attr."+e,t)):t==null?(n.local?RF:MF)(n):(n.local?PF:OF)(n,r,t))}function FF(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function qF(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function BF(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&qF(e,i)),n}return s._value=t,s}function zF(e,t){var n,r;function s(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&FF(e,i)),n}return s._value=t,s}function VF(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=Kd(e);return this.tween(n,(r.local?BF:zF)(r,t))}function HF(e,t){return function(){Qb(this,e).delay=+t.apply(this,arguments)}}function UF(e,t){return t=+t,function(){Qb(this,e).delay=t}}function WF(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?HF:UF)(t,e)):sr(this.node(),t).delay}function KF(e,t){return function(){Or(this,e).duration=+t.apply(this,arguments)}}function GF(e,t){return t=+t,function(){Or(this,e).duration=t}}function YF(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?KF:GF)(t,e)):sr(this.node(),t).duration}function XF(e,t){if(typeof t!="function")throw new Error;return function(){Or(this,e).ease=t}}function QF(e){var t=this._id;return arguments.length?this.each(XF(t,e)):sr(this.node(),t).ease}function JF(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Or(this,e).ease=n}}function ZF(e){if(typeof e!="function")throw new Error;return this.each(JF(this._id,e))}function e6(e){typeof e!="function"&&(e=uI(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var i=t[s],a=i.length,c=r[s]=[],d,f=0;f<a;++f)(d=i[f])&&e.call(d,d.__data__,f,i)&&c.push(d);return new es(r,this._parents,this._name,this._id)}function t6(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,i=Math.min(r,s),a=new Array(r),c=0;c<i;++c)for(var d=t[c],f=n[c],p=d.length,h=a[c]=new Array(p),g,y=0;y<p;++y)(g=d[y]||f[y])&&(h[y]=g);for(;c<r;++c)a[c]=t[c];return new es(a,this._parents,this._name,this._id)}function n6(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 r6(e,t,n){var r,s,i=n6(t)?Qb:Or;return function(){var a=i(this,e),c=a.on;c!==r&&(s=(r=c).copy()).on(t,n),a.on=s}}function s6(e,t){var n=this._id;return arguments.length<2?sr(this.node(),n).on.on(e):this.each(r6(n,e,t))}function i6(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function o6(){return this.on("end.remove",i6(this._id))}function a6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wb(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a<s;++a)for(var c=r[a],d=c.length,f=i[a]=new Array(d),p,h,g=0;g<d;++g)(p=c[g])&&(h=e.call(p,p.__data__,g,c))&&("__data__"in p&&(h.__data__=p.__data__),f[g]=h,Yd(f[g],t,n,g,f,sr(p,n)));return new es(i,this._parents,t,n)}function l6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cI(e));for(var r=this._groups,s=r.length,i=[],a=[],c=0;c<s;++c)for(var d=r[c],f=d.length,p,h=0;h<f;++h)if(p=d[h]){for(var g=e.call(p,p.__data__,h,d),y,w=sr(p,n),b=0,v=g.length;b<v;++b)(y=g[b])&&Yd(y,t,n,b,g,w);i.push(g),a.push(p)}return new es(i,a,t,n)}var c6=Kl.prototype.constructor;function u6(){return new c6(this._groups,this._parents)}function d6(e,t){var n,r,s;return function(){var i=Bo(this,e),a=(this.style.removeProperty(e),Bo(this,e));return i===a?null:i===n&&a===r?s:s=t(n=i,r=a)}}function OI(e){return function(){this.style.removeProperty(e)}}function f6(e,t,n){var r,s=n+"",i;return function(){var a=Bo(this,e);return a===s?null:a===r?i:i=t(r=a,n)}}function h6(e,t,n){var r,s,i;return function(){var a=Bo(this,e),c=n(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),Bo(this,e))),a===d?null:a===r&&d===s?i:(s=d,i=t(r=a,c))}}function p6(e,t){var n,r,s,i="style."+t,a="end."+i,c;return function(){var d=Or(this,e),f=d.on,p=d.value[i]==null?c||(c=OI(t)):void 0;(f!==n||s!==p)&&(r=(n=f).copy()).on(a,s=p),d.on=r}}function m6(e,t,n){var r=(e+="")=="transform"?gF:RI;return t==null?this.styleTween(e,d6(e,r)).on("end.style."+e,OI(e)):typeof t=="function"?this.styleTween(e,h6(e,r,Jb(this,"style."+e,t))).each(p6(this._id,e)):this.styleTween(e,f6(e,r,t),n).on("end.style."+e,null)}function g6(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function y6(e,t,n){var r,s;function i(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&g6(e,a,n)),r}return i._value=t,i}function x6(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,y6(e,t,n??""))}function v6(e){return function(){this.textContent=e}}function b6(e){return function(){var t=e(this);this.textContent=t??""}}function w6(e){return this.tween("text",typeof e=="function"?b6(Jb(this,"text",e)):v6(e==null?"":e+""))}function N6(e){return function(t){this.textContent=e.call(this,t)}}function k6(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&N6(s)),t}return r._value=e,r}function S6(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,k6(e))}function C6(){for(var e=this._name,t=this._id,n=PI(),r=this._groups,s=r.length,i=0;i<s;++i)for(var a=r[i],c=a.length,d,f=0;f<c;++f)if(d=a[f]){var p=sr(d,t);Yd(d,e,n,f,a,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new es(r,this._parents,e,n)}function _6(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(i,a){var c={value:a},d={value:function(){--s===0&&i()}};n.each(function(){var f=Or(this,r),p=f.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(d)),f.on=t}),s===0&&i()})}var E6=0;function es(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function PI(){return++E6}var Kr=Kl.prototype;es.prototype={constructor:es,select:a6,selectAll:l6,selectChild:Kr.selectChild,selectChildren:Kr.selectChildren,filter:e6,merge:t6,selection:u6,transition:C6,call:Kr.call,nodes:Kr.nodes,node:Kr.node,size:Kr.size,empty:Kr.empty,each:Kr.each,on:s6,attr:$F,attrTween:VF,style:m6,styleTween:x6,text:w6,textTween:S6,remove:o6,tween:IF,delay:WF,duration:YF,ease:QF,easeVarying:ZF,end:_6,[Symbol.iterator]:Kr[Symbol.iterator]};function j6(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var A6={time:null,delay:0,duration:250,ease:j6};function T6(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 I6(e){var t,n;e instanceof es?(t=e._id,e=e._name):(t=PI(),(n=A6).time=Xb(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,i=0;i<s;++i)for(var a=r[i],c=a.length,d,f=0;f<c;++f)(d=a[f])&&Yd(d,e,t,f,a,n||T6(d,t));return new es(r,this._parents,e,t)}Kl.prototype.interrupt=jF;Kl.prototype.transition=I6;const Ou=e=>()=>e;function M6(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 Xr(e,t,n){this.k=e,this.x=t,this.y=n}Xr.prototype={constructor:Xr,scale:function(e){return e===1?this:new Xr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xr(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 Xd=new Xr(1,0,0);LI.prototype=Xr.prototype;function LI(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Xd;return e.__zoom}function Xp(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}function R6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function O6(){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 bS(){return this.__zoom||Xd}function P6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L6(){return navigator.maxTouchPoints||"ontouchstart"in this}function D6(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],i=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>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function DI(){var e=R6,t=O6,n=D6,r=P6,s=L6,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,d=id,f=Wd("start","zoom","end"),p,h,g,y=500,w=150,b=0,v=10;function N(D){D.property("__zoom",bS).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(D,z,V,G){var q=D.selection?D.selection():D;q.property("__zoom",bS),D!==q?A(D,z,V,G):q.interrupt().each(function(){I(this,arguments).event(G).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},N.scaleBy=function(D,z,V,G){N.scaleTo(D,function(){var q=this.__zoom.k,F=typeof z=="function"?z.apply(this,arguments):z;return q*F},V,G)},N.scaleTo=function(D,z,V,G){N.transform(D,function(){var q=t.apply(this,arguments),F=this.__zoom,Y=V==null?_(q):typeof V=="function"?V.apply(this,arguments):V,$=F.invert(Y),K=typeof z=="function"?z.apply(this,arguments):z;return n(k(S(F,K),Y,$),q,a)},V,G)},N.translateBy=function(D,z,V,G){N.transform(D,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof V=="function"?V.apply(this,arguments):V),t.apply(this,arguments),a)},null,G)},N.translateTo=function(D,z,V,G,q){N.transform(D,function(){var F=t.apply(this,arguments),Y=this.__zoom,$=G==null?_(F):typeof G=="function"?G.apply(this,arguments):G;return n(Xd.translate($[0],$[1]).scale(Y.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof V=="function"?-V.apply(this,arguments):-V),F,a)},G,q)};function S(D,z){return z=Math.max(i[0],Math.min(i[1],z)),z===D.k?D:new Xr(z,D.x,D.y)}function k(D,z,V){var G=z[0]-V[0]*D.k,q=z[1]-V[1]*D.k;return G===D.x&&q===D.y?D:new Xr(D.k,G,q)}function _(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function A(D,z,V,G){D.on("start.zoom",function(){I(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(G).end()}).tween("zoom",function(){var q=this,F=arguments,Y=I(q,F).event(G),$=t.apply(q,F),K=V==null?_($):typeof V=="function"?V.apply(q,F):V,ie=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),U=q.__zoom,Q=typeof z=="function"?z.apply(q,F):z,Z=d(U.invert(K).concat(ie/U.k),Q.invert(K).concat(ie/Q.k));return function(ee){if(ee===1)ee=Q;else{var se=Z(ee),ae=ie/se[2];ee=new Xr(ae,K[0]-se[0]*ae,K[1]-se[1]*ae)}Y.zoom(null,ee)}})}function I(D,z,V){return!V&&D.__zooming||new T(D,z)}function T(D,z){this.that=D,this.args=z,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,z),this.taps=0}T.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,z){return this.mouse&&D!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var z=mn(this.that).datum();f.call(D,this.that,new M6(D,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:f}),z)}};function O(D,...z){if(!e.apply(this,arguments))return;var V=I(this,z).event(D),G=this.__zoom,q=Math.max(i[0],Math.min(i[1],G.k*Math.pow(2,r.apply(this,arguments)))),F=Gn(D);if(V.wheel)(V.mouse[0][0]!==F[0]||V.mouse[0][1]!==F[1])&&(V.mouse[1]=G.invert(V.mouse[0]=F)),clearTimeout(V.wheel);else{if(G.k===q)return;V.mouse=[F,G.invert(F)],ld(this),V.start()}tl(D),V.wheel=setTimeout(Y,w),V.zoom("mouse",n(k(S(G,q),V.mouse[0],V.mouse[1]),V.extent,a));function Y(){V.wheel=null,V.end()}}function L(D,...z){if(g||!e.apply(this,arguments))return;var V=D.currentTarget,G=I(this,z,!0).event(D),q=mn(D.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",ie,!0),F=Gn(D,V),Y=D.clientX,$=D.clientY;bI(D.view),Xp(D),G.mouse=[F,this.__zoom.invert(F)],ld(this),G.start();function K(U){if(tl(U),!G.moved){var Q=U.clientX-Y,Z=U.clientY-$;G.moved=Q*Q+Z*Z>b}G.event(U).zoom("mouse",n(k(G.that.__zoom,G.mouse[0]=Gn(U,V),G.mouse[1]),G.extent,a))}function ie(U){q.on("mousemove.zoom mouseup.zoom",null),wI(U.view,G.moved),tl(U),G.event(U).end()}}function B(D,...z){if(e.apply(this,arguments)){var V=this.__zoom,G=Gn(D.changedTouches?D.changedTouches[0]:D,this),q=V.invert(G),F=V.k*(D.shiftKey?.5:2),Y=n(k(S(V,F),G,q),t.apply(this,z),a);tl(D),c>0?mn(this).transition().duration(c).call(A,Y,G,D):mn(this).call(N.transform,Y,G,D)}}function M(D,...z){if(e.apply(this,arguments)){var V=D.touches,G=V.length,q=I(this,z,D.changedTouches.length===G).event(D),F,Y,$,K;for(Xp(D),Y=0;Y<G;++Y)$=V[Y],K=Gn($,this),K=[K,this.__zoom.invert(K),$.identifier],q.touch0?!q.touch1&&q.touch0[2]!==K[2]&&(q.touch1=K,q.taps=0):(q.touch0=K,F=!0,q.taps=1+!!p);p&&(p=clearTimeout(p)),F&&(q.taps<2&&(h=K[0],p=setTimeout(function(){p=null},y)),ld(this),q.start())}}function P(D,...z){if(this.__zooming){var V=I(this,z).event(D),G=D.changedTouches,q=G.length,F,Y,$,K;for(tl(D),F=0;F<q;++F)Y=G[F],$=Gn(Y,this),V.touch0&&V.touch0[2]===Y.identifier?V.touch0[0]=$:V.touch1&&V.touch1[2]===Y.identifier&&(V.touch1[0]=$);if(Y=V.that.__zoom,V.touch1){var ie=V.touch0[0],U=V.touch0[1],Q=V.touch1[0],Z=V.touch1[1],ee=(ee=Q[0]-ie[0])*ee+(ee=Q[1]-ie[1])*ee,se=(se=Z[0]-U[0])*se+(se=Z[1]-U[1])*se;Y=S(Y,Math.sqrt(ee/se)),$=[(ie[0]+Q[0])/2,(ie[1]+Q[1])/2],K=[(U[0]+Z[0])/2,(U[1]+Z[1])/2]}else if(V.touch0)$=V.touch0[0],K=V.touch0[1];else return;V.zoom("touch",n(k(Y,$,K),V.extent,a))}}function H(D,...z){if(this.__zooming){var V=I(this,z).event(D),G=D.changedTouches,q=G.length,F,Y;for(Xp(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},y),F=0;F<q;++F)Y=G[F],V.touch0&&V.touch0[2]===Y.identifier?delete V.touch0:V.touch1&&V.touch1[2]===Y.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(Y=Gn(Y,this),Math.hypot(h[0]-Y[0],h[1]-Y[1])<v)){var $=mn(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return N.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:Ou(+D),N):r},N.filter=function(D){return arguments.length?(e=typeof D=="function"?D:Ou(!!D),N):e},N.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:Ou(!!D),N):s},N.extent=function(D){return arguments.length?(t=typeof D=="function"?D:Ou([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),N):t},N.scaleExtent=function(D){return arguments.length?(i[0]=+D[0],i[1]=+D[1],N):[i[0],i[1]]},N.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],N):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},N.constrain=function(D){return arguments.length?(n=D,N):n},N.duration=function(D){return arguments.length?(c=+D,N):c},N.interpolate=function(D){return arguments.length?(d=D,N):d},N.on=function(){var D=f.on.apply(f,arguments);return D===f?N:D},N.clickDistance=function(D){return arguments.length?(b=(D=+D)*D,N):Math.sqrt(b)},N.tapDistance=function(D){return arguments.length?(v=+D,N):v},N}const Ar={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."},jl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],$I=["Enter"," ","Escape"],FI={"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 Vo;(function(e){e.Strict="strict",e.Loose="loose"})(Vo||(Vo={}));var Ni;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ni||(Ni={}));var Al;(function(e){e.Partial="partial",e.Full="full"})(Al||(Al={}));const qI={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var $s;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})($s||($s={}));var _d;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(_d||(_d={}));var ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ge||(ge={}));const wS={[ge.Left]:ge.Right,[ge.Right]:ge.Left,[ge.Top]:ge.Bottom,[ge.Bottom]:ge.Top};function BI(e){return e===null?null:e?"valid":"invalid"}const zI=e=>"id"in e&&"source"in e&&"target"in e,$6=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Zb=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Yl=(e,t=[0,0])=>{const{width:n,height:r}=is(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},F6=(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 i=typeof s=="string";let a=!t.nodeLookup&&!i?s:void 0;t.nodeLookup&&(a=i?t.nodeLookup.get(s):Zb(s)?s:t.nodeLookup.get(s.id));const c=a?Ed(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Qd(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Jd(n)},Xl=(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=Qd(n,Ed(s)),r=!0)}),r?Jd(n):{x:0,y:0,width:0,height:0}},ew=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const c={...Jl(t,[n,r,s]),width:t.width/s,height:t.height/s},d=[];for(const f of e.values()){const{measured:p,selectable:h=!0,hidden:g=!1}=f;if(a&&!h||g)continue;const y=p.width??f.width??f.initialWidth??null,w=p.height??f.height??f.initialHeight??null,b=Tl(c,Uo(f)),v=(y??0)*(w??0),N=i&&b>0;(!f.internals.handleBounds||N||b>=v||f.dragging)&&d.push(f)}return d},q6=(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 B6(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 z6({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return Promise.resolve(!0);const c=B6(e,a),d=Xl(c),f=tw(d,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(f,{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 VI({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:d,y:f}=c?c.internals.positionAbsolute:{x:0,y:0},p=a.origin??r;let h=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!c)i==null||i("005",Ar.error005());else{const y=c.measured.width,w=c.measured.height;y&&w&&(h=[[d,f],[d+y,f+w]])}else c&&Wo(a.extent)&&(h=[[a.extent[0][0]+d,a.extent[0][1]+f],[a.extent[1][0]+d,a.extent[1][1]+f]]);const g=Wo(h)?Ci(t,h,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",Ar.error015())),{position:{x:g.x-d+(a.measured.width??0)*p[0],y:g.y-f+(a.measured.height??0)*p[1]},positionAbsolute:g}}async function V6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const i=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const y=i.has(g.id),w=!y&&g.parentId&&a.find(b=>b.id===g.parentId);(y||w)&&a.push(g)}const c=new Set(t.map(g=>g.id)),d=r.filter(g=>g.deletable!==!1),p=q6(a,d);for(const g of d)c.has(g.id)&&!p.find(w=>w.id===g.id)&&p.push(g);if(!s)return{edges:p,nodes:a};const h=await s({nodes:a,edges:p});return typeof h=="boolean"?h?{edges:p,nodes:a}:{edges:[],nodes:[]}:h}const Ho=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ci=(e={x:0,y:0},t,n)=>({x:Ho(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ho(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function HI(e,t,n){const{width:r,height:s}=is(n),{x:i,y:a}=n.internals.positionAbsolute;return Ci(e,[[i,a],[i+r,a+s]],t)}const NS=(e,t,n)=>e<t?Ho(Math.abs(e-t),1,t)/t:e>n?-Ho(Math.abs(e-n),1,t)/t:0,UI=(e,t,n=15,r=40)=>{const s=NS(e.x,r,t.width-r)*n,i=NS(e.y,r,t.height-r)*n;return[s,i]},Qd=(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)}),rb=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Jd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Uo=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Zb(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:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Ed=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=Zb(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+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},WI=(e,t)=>Jd(Qd(rb(e),rb(t))),Tl=(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)},kS=e=>Qn(e.width)&&Qn(e.height)&&Qn(e.x)&&Qn(e.y),Qn=e=>!isNaN(e)&&isFinite(e),H6=(e,t)=>{},Ql=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Jl=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return i?Ql(c,a):c},jd=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function vo(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 U6(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=vo(e,n),s=vo(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=vo(e.top??e.y??0,n),s=vo(e.bottom??e.y??0,n),i=vo(e.left??e.x??0,t),a=vo(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function W6(e,t,n,r,s,i){const{x:a,y:c}=jd(e,[t,n,r]),{x:d,y:f}=jd({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=s-d,h=i-f;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(p),bottom:Math.floor(h)}}const tw=(e,t,n,r,s,i)=>{const a=U6(i,t,n),c=(t-a.x)/e.width,d=(n-a.y)/e.height,f=Math.min(c,d),p=Ho(f,r,s),h=e.x+e.width/2,g=e.y+e.height/2,y=t/2-h*p,w=n/2-g*p,b=W6(e,y,w,p,t,n),v={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:y-v.left+v.right,y:w-v.top+v.bottom,zoom:p}},Il=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Wo(e){return e!=null&&e!=="parent"}function is(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 KI(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 GI(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const c=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function SS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function K6(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function G6(e){return{...FI,...e||{}}}function xl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Jn(e),c=Jl({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:d,y:f}=n?Ql(c,t):c;return{xSnapped:d,ySnapped:f,...c}}const nw=e=>({width:e.offsetWidth,height:e.offsetHeight}),YI=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Y6=["INPUT","SELECT","TEXTAREA"];function XI(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:Y6.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const QI=e=>"clientX"in e,Jn=(e,t)=>{var i,a;const n=QI(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[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)}},CS=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).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,...nw(a)}})};function JI({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:c}){const d=e*.125+s*.375+a*.375+n*.125,f=t*.125+i*.375+c*.375+r*.125,p=Math.abs(d-e),h=Math.abs(f-t);return[d,f,p,h]}function Pu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function _S({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case ge.Left:return[t-Pu(t-r,i),n];case ge.Right:return[t+Pu(r-t,i),n];case ge.Top:return[t,n-Pu(n-s,i)];case ge.Bottom:return[t,n+Pu(s-n,i)]}}function ZI({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:r,targetY:s,targetPosition:i=ge.Top,curvature:a=.25}){const[c,d]=_S({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[f,p]=_S({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[h,g,y,w]=JI({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:d,targetControlX:f,targetControlY:p});return[`M${e},${t} C${c},${d} ${f},${p} ${r},${s}`,h,g,y,w]}function eM({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n<e?n+s:n-s,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[i,c,s,a]}function X6({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:i="basic"}){if(i==="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 Q6({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const i=Qd(Ed(e),Ed(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return Tl(a,Jd(i))>0}const J6=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Z6=(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)),tM=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||J6;let s;return zI(e)?s={...e}:s={...e,id:r(e)},Z6(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function nM({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,c]=eM({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,c]}const ES={[ge.Left]:{x:-1,y:0},[ge.Right]:{x:1,y:0},[ge.Top]:{x:0,y:-1},[ge.Bottom]:{x:0,y:1}},eq=({source:e,sourcePosition:t=ge.Bottom,target:n})=>t===ge.Left||t===ge.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},jS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tq({source:e,sourcePosition:t=ge.Bottom,target:n,targetPosition:r=ge.Top,center:s,offset:i,stepPosition:a}){const c=ES[t],d=ES[r],f={x:e.x+c.x*i,y:e.y+c.y*i},p={x:n.x+d.x*i,y:n.y+d.y*i},h=eq({source:f,sourcePosition:t,target:p}),g=h.x!==0?"x":"y",y=h[g];let w=[],b,v;const N={x:0,y:0},S={x:0,y:0},[,,k,_]=eM({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*d[g]===-1){g==="x"?(b=s.x??f.x+(p.x-f.x)*a,v=s.y??(f.y+p.y)/2):(b=s.x??(f.x+p.x)/2,v=s.y??f.y+(p.y-f.y)*a);const I=[{x:b,y:f.y},{x:b,y:p.y}],T=[{x:f.x,y:v},{x:p.x,y:v}];c[g]===y?w=g==="x"?I:T:w=g==="x"?T:I}else{const I=[{x:f.x,y:p.y}],T=[{x:p.x,y:f.y}];if(g==="x"?w=c.x===y?T:I:w=c.y===y?I:T,t===r){const P=Math.abs(e[g]-n[g]);if(P<=i){const H=Math.min(i-1,i-P);c[g]===y?N[g]=(f[g]>e[g]?-1:1)*H:S[g]=(p[g]>n[g]?-1:1)*H}}if(t!==r){const P=g==="x"?"y":"x",H=c[g]===d[P],D=f[P]>p[P],z=f[P]<p[P];(c[g]===1&&(!H&&D||H&&z)||c[g]!==1&&(!H&&z||H&&D))&&(w=g==="x"?I:T)}const O={x:f.x+N.x,y:f.y+N.y},L={x:p.x+S.x,y:p.y+S.y},B=Math.max(Math.abs(O.x-w[0].x),Math.abs(L.x-w[0].x)),M=Math.max(Math.abs(O.y-w[0].y),Math.abs(L.y-w[0].y));B>=M?(b=(O.x+L.x)/2,v=w[0].y):(b=w[0].x,v=(O.y+L.y)/2)}return[[e,{x:f.x+N.x,y:f.y+N.y},...w,{x:p.x+S.x,y:p.y+S.y},n],b,v,k,_]}function nq(e,t,n,r){const s=Math.min(jS(e,t)/2,jS(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){const f=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${i+s*f},${a}Q ${i},${a} ${i},${a+s*p}`}const c=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${i},${a+s*d}Q ${i},${a} ${i+s*c},${a}`}function sb({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:r,targetY:s,targetPosition:i=ge.Top,borderRadius:a=5,centerX:c,centerY:d,offset:f=20,stepPosition:p=.5}){const[h,g,y,w,b]=tq({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:i,center:{x:c,y:d},offset:f,stepPosition:p});return[h.reduce((N,S,k)=>{let _="";return k>0&&k<h.length-1?_=nq(h[k-1],S,h[k+1],a):_=`${k===0?"M":"L"}${S.x} ${S.y}`,N+=_,N},""),g,y,w,b]}function AS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function rq(e){var h;const{sourceNode:t,targetNode:n}=e;if(!AS(t)||!AS(n))return null;const r=t.internals.handleBounds||TS(t.handles),s=n.internals.handleBounds||TS(n.handles),i=IS((r==null?void 0:r.source)??[],e.sourceHandle),a=IS(e.connectionMode===Vo.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!i||!a)return(h=e.onError)==null||h.call(e,"008",Ar.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||ge.Bottom,d=(a==null?void 0:a.position)||ge.Top,f=_i(t,i,c),p=_i(n,a,d);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:c,targetPosition:d}}function TS(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 _i(e,t,n=ge.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??is(e);if(r)return{x:s+a/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case ge.Top:return{x:s+a/2,y:i};case ge.Right:return{x:s+a,y:i+c/2};case ge.Bottom:return{x:s+a/2,y:i+c};case ge.Left:return{x:s,y:i+c/2}}}function IS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function ib(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function sq(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||s].forEach(d=>{if(d&&typeof d=="object"){const f=ib(d,t);i.has(f)||(a.push({id:f,color:d.color||n,...d}),i.add(f))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const rM=1e3,iq=10,rw={nodeOrigin:[0,0],nodeExtent:jl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},oq={...rw,checkEquality:!0};function sw(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function aq(e,t,n){const r=sw(rw,n);for(const s of e.values())if(s.parentId)ow(s,e,t,r);else{const i=Yl(s,r.nodeOrigin),a=Wo(s.extent)?s.extent:r.nodeExtent,c=Ci(i,a,is(s));s.internals.positionAbsolute=c}}function lq(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 i={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(i):s.type==="target"&&r.push(i)}return{source:n,target:r}}function iw(e){return e==="manual"}function ob(e,t,n,r={}){var f,p;const s=sw(oq,r),i={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!iw(s.zIndexMode)?rM:0;let d=e.length>0;t.clear(),n.clear();for(const h of e){let g=a.get(h.id);if(s.checkEquality&&h===(g==null?void 0:g.internals.userNode))t.set(h.id,g);else{const y=Yl(h,s.nodeOrigin),w=Wo(h.extent)?h.extent:s.nodeExtent,b=Ci(y,w,is(h));g={...s.defaults,...h,measured:{width:(f=h.measured)==null?void 0:f.width,height:(p=h.measured)==null?void 0:p.height},internals:{positionAbsolute:b,handleBounds:lq(h,g),z:sM(h,c,s.zIndexMode),userNode:h}},t.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(d=!1),h.parentId&&ow(g,t,n,r,i)}return d}function cq(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 ow(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:c,zIndexMode:d}=sw(rw,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}cq(e,n),s&&!p.parentId&&p.internals.rootParentIndex===void 0&&d==="auto"&&(p.internals.rootParentIndex=++s.i,p.internals.z=p.internals.z+s.i*iq),s&&p.internals.rootParentIndex!==void 0&&(s.i=p.internals.rootParentIndex);const h=i&&!iw(d)?rM:0,{x:g,y,z:w}=uq(e,p,a,c,h,d),{positionAbsolute:b}=e.internals,v=g!==b.x||y!==b.y;(v||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:g,y}:b,z:w}})}function sM(e,t,n){const r=Qn(e.zIndex)?e.zIndex:0;return iw(n)?r:r+(e.selected?t:0)}function uq(e,t,n,r,s,i){const{x:a,y:c}=t.internals.positionAbsolute,d=is(e),f=Yl(e,n),p=Wo(e.extent)?Ci(f,e.extent,d):f;let h=Ci({x:a+p.x,y:c+p.y},r,d);e.extent==="parent"&&(h=HI(h,d,t));const g=sM(e,s,i),y=t.internals.z??0;return{x:h.x,y:h.y,z:y>=g?y+1:g}}function aw(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const c of e){const d=t.get(c.parentId);if(!d)continue;const f=((a=i.get(c.parentId))==null?void 0:a.expandedRect)??Uo(d),p=WI(f,c.rect);i.set(c.parentId,{expandedRect:p,parent:d})}return i.size>0&&i.forEach(({expandedRect:c,parent:d},f)=>{var k;const p=d.internals.positionAbsolute,h=is(d),g=d.origin??r,y=c.x<p.x?Math.round(Math.abs(p.x-c.x)):0,w=c.y<p.y?Math.round(Math.abs(p.y-c.y)):0,b=Math.max(h.width,Math.round(c.width)),v=Math.max(h.height,Math.round(c.height)),N=(b-h.width)*g[0],S=(v-h.height)*g[1];(y>0||w>0||N||S)&&(s.push({id:f,type:"position",position:{x:d.position.x-y+N,y:d.position.y-w+S}}),(k=n.get(f))==null||k.forEach(_=>{e.some(A=>A.id===_.id)||s.push({id:_.id,type:"position",position:{x:_.position.x+y,y:_.position.y+w}})})),(h.width<c.width||h.height<c.height||y||w)&&s.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:b+(y?g[0]*y-N:0),height:v+(w?g[1]*w-S:0)}})}),s}function dq(e,t,n,r,s,i,a){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let d=!1;if(!c)return{changes:[],updatedInternals:d};const f=[],p=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(p.transform),g=[];for(const y of e.values()){const w=t.get(y.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),d=!0;continue}const b=nw(y.nodeElement),v=w.measured.width!==b.width||w.measured.height!==b.height;if(!!(b.width&&b.height&&(v||!w.internals.handleBounds||y.force))){const S=y.nodeElement.getBoundingClientRect(),k=Wo(w.extent)?w.extent:i;let{positionAbsolute:_}=w.internals;w.parentId&&w.extent==="parent"?_=HI(_,b,t.get(w.parentId)):k&&(_=Ci(_,k,b));const A={...w,measured:b,internals:{...w.internals,positionAbsolute:_,handleBounds:{source:CS("source",y.nodeElement,S,h,w.id),target:CS("target",y.nodeElement,S,h,w.id)}}};t.set(w.id,A),w.parentId&&ow(A,t,n,{nodeOrigin:s,zIndexMode:a}),d=!0,v&&(f.push({id:w.id,type:"dimensions",dimensions:b}),w.expandParent&&w.parentId&&g.push({id:w.id,parentId:w.parentId,rect:Uo(A,s)}))}}if(g.length>0){const y=aw(g,t,n,s);f.push(...y)}return{changes:f,updatedInternals:d}}async function fq({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:i}){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,i]],r),c=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(c)}function MS(e,t,n,r,s,i){let a=s;const c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${s}-${e}`;const d=r.get(a)||new Map;if(r.set(a,d.set(n,t)),i){a=`${s}-${e}-${i}`;const f=r.get(a)||new Map;r.set(a,f.set(n,t))}}function iM(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:c=null}=r,d={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:c},f=`${s}-${a}--${i}-${c}`,p=`${i}-${c}--${s}-${a}`;MS("source",d,p,e,s,a),MS("target",d,f,e,i,c),t.set(r.id,r)}}function oM(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:oM(n,t):!1}function RS(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 hq(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!oM(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(i);c&&s.set(i,{id:i,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 Qp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,c,d;const s=[];for(const[f,p]of t){const h=(a=n.get(f))==null?void 0:a.internals.userNode;h&&s.push({...h,position:p.position,dragging:r})}if(!e)return[s[0],s];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((d=t.get(e))==null?void 0:d.position)||i.position,dragging:r}:s[0],s]}function pq({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:n-s.distance.x,y:r-s.distance.y},a=Ql(i,t);return{x:a.x-i.x,y:a.y-i.y}}function mq({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,c=new Map,d=!1,f={x:0,y:0},p=null,h=!1,g=null,y=!1,w=!1,b=null;function v({noDragClassName:S,handleSelector:k,domNode:_,isSelectable:A,nodeId:I,nodeClickDistance:T=0}){g=mn(_);function O({x:P,y:H}){const{nodeLookup:D,nodeExtent:z,snapGrid:V,snapToGrid:G,nodeOrigin:q,onNodeDrag:F,onSelectionDrag:Y,onError:$,updateNodePositions:K}=t();i={x:P,y:H};let ie=!1;const U=c.size>1,Q=U&&z?rb(Xl(c)):null,Z=U&&G?pq({dragItems:c,snapGrid:V,x:P,y:H}):null;for(const[ee,se]of c){if(!D.has(ee))continue;let ae={x:P-se.distance.x,y:H-se.distance.y};G&&(ae=Z?{x:Math.round(ae.x+Z.x),y:Math.round(ae.y+Z.y)}:Ql(ae,V));let ne=null;if(U&&z&&!se.extent&&Q){const{positionAbsolute:pe}=se.internals,ve=pe.x-Q.x+z[0][0],xe=pe.x+se.measured.width-Q.x2+z[1][0],Ae=pe.y-Q.y+z[0][1],Se=pe.y+se.measured.height-Q.y2+z[1][1];ne=[[ve,Ae],[xe,Se]]}const{position:le,positionAbsolute:he}=VI({nodeId:ee,nextPosition:ae,nodeLookup:D,nodeExtent:ne||z,nodeOrigin:q,onError:$});ie=ie||se.position.x!==le.x||se.position.y!==le.y,se.position=le,se.internals.positionAbsolute=he}if(w=w||ie,!!ie&&(K(c,!0),b&&(r||F||!I&&Y))){const[ee,se]=Qp({nodeId:I,dragItems:c,nodeLookup:D});r==null||r(b,c,ee,se),F==null||F(b,ee,se),I||Y==null||Y(b,se)}}async function L(){if(!p)return;const{transform:P,panBy:H,autoPanSpeed:D,autoPanOnNodeDrag:z}=t();if(!z){d=!1,cancelAnimationFrame(a);return}const[V,G]=UI(f,p,D);(V!==0||G!==0)&&(i.x=(i.x??0)-V/P[2],i.y=(i.y??0)-G/P[2],await H({x:V,y:G})&&O(i)),a=requestAnimationFrame(L)}function B(P){var U;const{nodeLookup:H,multiSelectionActive:D,nodesDraggable:z,transform:V,snapGrid:G,snapToGrid:q,selectNodesOnDrag:F,onNodeDragStart:Y,onSelectionDragStart:$,unselectNodesAndEdges:K}=t();h=!0,(!F||!A)&&!D&&I&&((U=H.get(I))!=null&&U.selected||K()),A&&F&&I&&(e==null||e(I));const ie=xl(P.sourceEvent,{transform:V,snapGrid:G,snapToGrid:q,containerBounds:p});if(i=ie,c=hq(H,z,ie,I),c.size>0&&(n||Y||!I&&$)){const[Q,Z]=Qp({nodeId:I,dragItems:c,nodeLookup:H});n==null||n(P.sourceEvent,c,Q,Z),Y==null||Y(P.sourceEvent,Q,Z),I||$==null||$(P.sourceEvent,Z)}}const M=NI().clickDistance(T).on("start",P=>{const{domNode:H,nodeDragThreshold:D,transform:z,snapGrid:V,snapToGrid:G}=t();p=(H==null?void 0:H.getBoundingClientRect())||null,y=!1,w=!1,b=P.sourceEvent,D===0&&B(P),i=xl(P.sourceEvent,{transform:z,snapGrid:V,snapToGrid:G,containerBounds:p}),f=Jn(P.sourceEvent,p)}).on("drag",P=>{const{autoPanOnNodeDrag:H,transform:D,snapGrid:z,snapToGrid:V,nodeDragThreshold:G,nodeLookup:q}=t(),F=xl(P.sourceEvent,{transform:D,snapGrid:z,snapToGrid:V,containerBounds:p});if(b=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||I&&!q.has(I))&&(y=!0),!y){if(!d&&H&&h&&(d=!0,L()),!h){const Y=Jn(P.sourceEvent,p),$=Y.x-f.x,K=Y.y-f.y;Math.sqrt($*$+K*K)>G&&B(P)}(i.x!==F.xSnapped||i.y!==F.ySnapped)&&c&&h&&(f=Jn(P.sourceEvent,p),O(F))}}).on("end",P=>{if(!(!h||y)&&(d=!1,h=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:H,updateNodePositions:D,onNodeDragStop:z,onSelectionDragStop:V}=t();if(w&&(D(c,!1),w=!1),s||z||!I&&V){const[G,q]=Qp({nodeId:I,dragItems:c,nodeLookup:H,dragging:!1});s==null||s(P.sourceEvent,c,G,q),z==null||z(P.sourceEvent,G,q),I||V==null||V(P.sourceEvent,q)}}}).filter(P=>{const H=P.target;return!P.button&&(!S||!RS(H,`.${S}`,_))&&(!k||RS(H,k,_))});g.call(M)}function N(){g==null||g.on(".drag",null)}return{update:v,destroy:N}}function gq(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Tl(s,Uo(i))>0&&r.push(i);return r}const yq=250;function xq(e,t,n,r){var c,d;let s=[],i=1/0;const a=gq(e,n,t+yq);for(const f of a){const p=[...((c=f.internals.handleBounds)==null?void 0:c.source)??[],...((d=f.internals.handleBounds)==null?void 0:d.target)??[]];for(const h of p){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:g,y}=_i(f,h,h.position,!0),w=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));w>t||(w<i?(s=[{...h,x:g,y}],i=w):w===i&&s.push({...h,x:g,y}))}}if(!s.length)return null;if(s.length>1){const f=r.type==="source"?"target":"source";return s.find(p=>p.type===f)??s[0]}return s[0]}function aM(e,t,n,r,s,i=!1){var f,p,h;const a=r.get(e);if(!a)return null;const c=s==="strict"?(f=a.internals.handleBounds)==null?void 0:f[t]:[...((p=a.internals.handleBounds)==null?void 0:p.source)??[],...((h=a.internals.handleBounds)==null?void 0:h.target)??[]],d=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return d&&i?{...d,..._i(a,d,d.position,!0)}:d}function lM(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function vq(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const cM=()=>!0;function bq(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:c,nodeLookup:d,lib:f,autoPanOnConnect:p,flowId:h,panBy:g,cancelConnection:y,onConnectStart:w,onConnect:b,onConnectEnd:v,isValidConnection:N=cM,onReconnectEnd:S,updateConnection:k,getTransform:_,getFromHandle:A,autoPanSpeed:I,dragThreshold:T=1,handleDomNode:O}){const L=YI(e.target);let B=0,M;const{x:P,y:H}=Jn(e),D=lM(i,O),z=c==null?void 0:c.getBoundingClientRect();let V=!1;if(!z||!D)return;const G=aM(s,D,r,d,t);if(!G)return;let q=Jn(e,z),F=!1,Y=null,$=!1,K=null;function ie(){if(!p||!z)return;const[le,he]=UI(q,z,I);g({x:le,y:he}),B=requestAnimationFrame(ie)}const U={...G,nodeId:s,type:D,position:G.position},Q=d.get(s);let ee={inProgress:!0,isValid:null,from:_i(Q,U,ge.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:Q,to:q,toHandle:null,toPosition:wS[U.position],toNode:null,pointer:q};function se(){V=!0,k(ee),w==null||w(e,{nodeId:s,handleId:r,handleType:D})}T===0&&se();function ae(le){if(!V){const{x:Se,y:Ge}=Jn(le),Ve=Se-P,jt=Ge-H;if(!(Ve*Ve+jt*jt>T*T))return;se()}if(!A()||!U){ne(le);return}const he=_();q=Jn(le,z),M=xq(Jl(q,he,!1,[1,1]),n,d,U),F||(ie(),F=!0);const pe=uM(le,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:N,doc:L,lib:f,flowId:h,nodeLookup:d});K=pe.handleDomNode,Y=pe.connection,$=vq(!!M,pe.isValid);const ve=d.get(s),xe=ve?_i(ve,U,ge.Left,!0):ee.from,Ae={...ee,from:xe,isValid:$,to:pe.toHandle&&$?jd({x:pe.toHandle.x,y:pe.toHandle.y},he):q,toHandle:pe.toHandle,toPosition:$&&pe.toHandle?pe.toHandle.position:wS[U.position],toNode:pe.toHandle?d.get(pe.toHandle.nodeId):null,pointer:q};k(Ae),ee=Ae}function ne(le){if(!("touches"in le&&le.touches.length>0)){if(V){(M||K)&&Y&&$&&(b==null||b(Y));const{inProgress:he,...pe}=ee,ve={...pe,toPosition:ee.toHandle?ee.toPosition:null};v==null||v(le,ve),i&&(S==null||S(le,ve))}y(),cancelAnimationFrame(B),F=!1,$=!1,Y=null,K=null,L.removeEventListener("mousemove",ae),L.removeEventListener("mouseup",ne),L.removeEventListener("touchmove",ae),L.removeEventListener("touchend",ne)}}L.addEventListener("mousemove",ae),L.addEventListener("mouseup",ne),L.addEventListener("touchmove",ae),L.addEventListener("touchend",ne)}function uM(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:c,flowId:d,isValidConnection:f=cM,nodeLookup:p}){const h=i==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${d}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:w}=Jn(e),b=a.elementFromPoint(y,w),v=b!=null&&b.classList.contains(`${c}-flow__handle`)?b:g,N={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const S=lM(void 0,v),k=v.getAttribute("data-nodeid"),_=v.getAttribute("data-handleid"),A=v.classList.contains("connectable"),I=v.classList.contains("connectableend");if(!k||!S)return N;const T={source:h?k:r,sourceHandle:h?_:s,target:h?r:k,targetHandle:h?s:_};N.connection=T;const L=A&&I&&(n===Vo.Strict?h&&S==="source"||!h&&S==="target":k!==r||_!==s);N.isValid=L&&f(T),N.toHandle=aM(k,S,_,p,n,!0)}return N}const ab={onPointerDown:bq,isValid:uM};function wq({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=mn(e);function i({translateExtent:c,width:d,height:f,zoomStep:p=1,pannable:h=!0,zoomable:g=!0,inversePan:y=!1}){const w=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const _=n(),A=k.sourceEvent.ctrlKey&&Il()?10:1,I=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*p,T=_[2]*Math.pow(2,I*A);t.scaleTo(T)};let b=[0,0];const v=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(b=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},N=k=>{const _=n();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!t)return;const A=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],I=[A[0]-b[0],A[1]-b[1]];b=A;const T=r()*Math.max(_[2],Math.log(_[2]))*(y?-1:1),O={x:_[0]-I[0]*T,y:_[1]-I[1]*T},L=[[0,0],[d,f]];t.setViewportConstrained({x:O.x,y:O.y,zoom:_[2]},L,c)},S=DI().on("start",v).on("zoom",h?N:null).on("zoom.wheel",g?w:null);s.call(S,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Gn}}const Zd=e=>({x:e.x,y:e.y,zoom:e.k}),Jp=({x:e,y:t,zoom:n})=>Xd.translate(e,t).scale(n),Eo=(e,t)=>e.target.closest(`.${t}`),dM=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Nq=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Zp=(e,t=0,n=Nq,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},fM=e=>{const t=e.ctrlKey&&Il()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function kq({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:d,onPanZoomEnd:f}){return p=>{if(Eo(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(p.ctrlKey&&a){const v=Gn(p),N=fM(p),S=h*Math.pow(2,N);r.scaleTo(n,S,v,p);return}const g=p.deltaMode===1?20:1;let y=s===Ni.Vertical?0:p.deltaX*g,w=s===Ni.Horizontal?0:p.deltaY*g;!Il()&&p.shiftKey&&s!==Ni.Vertical&&(y=p.deltaY*g,w=0),r.translateBy(n,-(y/h)*i,-(w/h)*i,{internal:!0});const b=Zd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d==null||d(p,b),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(p,b))}}function Sq({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,c=Eo(r,e);if(r.ctrlKey&&i&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,s)}}function Cq({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,c;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Zd(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 _q({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,c;e.usedRightMouseButton=!!(n&&dM(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((c=i.sourceEvent)!=null&&c.internal)&&(s==null||s(i.sourceEvent,Zd(i.transform)))}}function Eq({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&dM(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const d=Zd(a.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,d)},n?150:0)}}}function jq({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:c,noPanClassName:d,lib:f,connectionInProgress:p}){return h=>{var v;const g=e||t,y=n&&h.ctrlKey,w=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Eo(h,`${f}-flow__node`)||Eo(h,`${f}-flow__edge`)))return!0;if(!r&&!g&&!s&&!i&&!n||a||p&&!w||Eo(h,c)&&w||Eo(h,d)&&(!w||s&&w&&!e)||!n&&h.ctrlKey&&w)return!1;if(!n&&h.type==="touchstart"&&((v=h.touches)==null?void 0:v.length)>1)return h.preventDefault(),!1;if(!g&&!s&&!y&&w||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const b=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||w)&&b}}function Aq({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),h=DI().scaleExtent([t,n]).translateExtent(r),g=mn(e).call(h);S({x:s.x,y:s.y,zoom:Ho(s.zoom,t,n)},[[0,0],[p.width,p.height]],r);const y=g.on("wheel.zoom"),w=g.on("dblclick.zoom");h.wheelDelta(fM);function b(M,P){return g?new Promise(H=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?yl:id).transform(Zp(g,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>H(!0)),M)}):Promise.resolve(!1)}function v({noWheelClassName:M,noPanClassName:P,onPaneContextMenu:H,userSelectionActive:D,panOnScroll:z,panOnDrag:V,panOnScrollMode:G,panOnScrollSpeed:q,preventScrolling:F,zoomOnPinch:Y,zoomOnScroll:$,zoomOnDoubleClick:K,zoomActivationKeyPressed:ie,lib:U,onTransformChange:Q,connectionInProgress:Z,paneClickDistance:ee,selectionOnDrag:se}){D&&!f.isZoomingOrPanning&&N();const ae=z&&!ie&&!D;h.clickDistance(se?1/0:!Qn(ee)||ee<0?0:ee);const ne=ae?kq({zoomPanValues:f,noWheelClassName:M,d3Selection:g,d3Zoom:h,panOnScrollMode:G,panOnScrollSpeed:q,zoomOnPinch:Y,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:c}):Sq({noWheelClassName:M,preventScrolling:F,d3ZoomHandler:y});if(g.on("wheel.zoom",ne,{passive:!1}),!D){const he=Cq({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:a});h.on("start",he);const pe=_q({zoomPanValues:f,panOnDrag:V,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:Q});h.on("zoom",pe);const ve=Eq({zoomPanValues:f,panOnDrag:V,panOnScroll:z,onPaneContextMenu:H,onPanZoomEnd:c,onDraggingChange:d});h.on("end",ve)}const le=jq({zoomActivationKeyPressed:ie,panOnDrag:V,zoomOnScroll:$,panOnScroll:z,zoomOnDoubleClick:K,zoomOnPinch:Y,userSelectionActive:D,noPanClassName:P,noWheelClassName:M,lib:U,connectionInProgress:Z});h.filter(le),K?g.on("dblclick.zoom",w):g.on("dblclick.zoom",null)}function N(){h.on("zoom",null)}async function S(M,P,H){const D=Jp(M),z=h==null?void 0:h.constrain()(D,P,H);return z&&await b(z),new Promise(V=>V(z))}async function k(M,P){const H=Jp(M);return await b(H,P),new Promise(D=>D(H))}function _(M){if(g){const P=Jp(M),H=g.property("__zoom");(H.k!==M.zoom||H.x!==M.x||H.y!==M.y)&&(h==null||h.transform(g,P,null,{sync:!0}))}}function A(){const M=g?LI(g.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function I(M,P){return g?new Promise(H=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?yl:id).scaleTo(Zp(g,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>H(!0)),M)}):Promise.resolve(!1)}function T(M,P){return g?new Promise(H=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?yl:id).scaleBy(Zp(g,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>H(!0)),M)}):Promise.resolve(!1)}function O(M){h==null||h.scaleExtent(M)}function L(M){h==null||h.translateExtent(M)}function B(M){const P=!Qn(M)||M<0?0:M;h==null||h.clickDistance(P)}return{update:v,destroy:N,setViewport:k,setViewportConstrained:S,getViewport:A,scaleTo:I,scaleBy:T,setScaleExtent:O,setTranslateExtent:L,syncViewport:_,setClickDistance:B}}var Ei;(function(e){e.Line="line",e.Handle="handle"})(Ei||(Ei={}));const Tq=["top-left","top-right","bottom-left","bottom-right"],Iq=["top","right","bottom","left"];function Mq({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,c=n-r,d=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&s&&(d[0]=d[0]*-1),c&&i&&(d[1]=d[1]*-1),d}function OS(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 As(e,t){return Math.max(0,t-e)}function Ts(e,t){return Math.max(0,e-t)}function Lu(e,t,n){return Math.max(0,t-e,e-n)}function PS(e,t){return e?!t:t}function Rq(e,t,n,r,s,i,a,c){let{affectsX:d,affectsY:f}=t;const{isHorizontal:p,isVertical:h}=t,g=p&&h,{xSnapped:y,ySnapped:w}=n,{minWidth:b,maxWidth:v,minHeight:N,maxHeight:S}=r,{x:k,y:_,width:A,height:I,aspectRatio:T}=e;let O=Math.floor(p?y-e.pointerX:0),L=Math.floor(h?w-e.pointerY:0);const B=A+(d?-O:O),M=I+(f?-L:L),P=-i[0]*A,H=-i[1]*I;let D=Lu(B,b,v),z=Lu(M,N,S);if(a){let q=0,F=0;d&&O<0?q=As(k+O+P,a[0][0]):!d&&O>0&&(q=Ts(k+B+P,a[1][0])),f&&L<0?F=As(_+L+H,a[0][1]):!f&&L>0&&(F=Ts(_+M+H,a[1][1])),D=Math.max(D,q),z=Math.max(z,F)}if(c){let q=0,F=0;d&&O>0?q=Ts(k+O,c[0][0]):!d&&O<0&&(q=As(k+B,c[1][0])),f&&L>0?F=Ts(_+L,c[0][1]):!f&&L<0&&(F=As(_+M,c[1][1])),D=Math.max(D,q),z=Math.max(z,F)}if(s){if(p){const q=Lu(B/T,N,S)*T;if(D=Math.max(D,q),a){let F=0;!d&&!f||d&&!f&&g?F=Ts(_+H+B/T,a[1][1])*T:F=As(_+H+(d?O:-O)/T,a[0][1])*T,D=Math.max(D,F)}if(c){let F=0;!d&&!f||d&&!f&&g?F=As(_+B/T,c[1][1])*T:F=Ts(_+(d?O:-O)/T,c[0][1])*T,D=Math.max(D,F)}}if(h){const q=Lu(M*T,b,v)/T;if(z=Math.max(z,q),a){let F=0;!d&&!f||f&&!d&&g?F=Ts(k+M*T+P,a[1][0])/T:F=As(k+(f?L:-L)*T+P,a[0][0])/T,z=Math.max(z,F)}if(c){let F=0;!d&&!f||f&&!d&&g?F=As(k+M*T,c[1][0])/T:F=Ts(k+(f?L:-L)*T,c[0][0])/T,z=Math.max(z,F)}}}L=L+(L<0?z:-z),O=O+(O<0?D:-D),s&&(g?B>M*T?L=(PS(d,f)?-O:O)/T:O=(PS(d,f)?-L:L)*T:p?(L=O/T,f=d):(O=L*T,d=f));const V=d?k+O:k,G=f?_+L:_;return{width:A+(d?-O:O),height:I+(f?-L:L),x:i[0]*O*(d?-1:1)+V,y:i[1]*L*(f?-1:1)+G}}const hM={width:0,height:0,x:0,y:0},Oq={...hM,pointerX:0,pointerY:0,aspectRatio:1};function Pq(e){return[[0,0],[e.measured.width,e.measured.height]]}function Lq(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,c=n[0]*i,d=n[1]*a;return[[r-c,s-d],[r+i-c,s+a-d]]}function Dq({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=mn(e);let a={controlDirection:OS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:f,boundaries:p,keepAspectRatio:h,resizeDirection:g,onResizeStart:y,onResize:w,onResizeEnd:b,shouldResize:v}){let N={...hM},S={...Oq};a={boundaries:p,resizeDirection:g,keepAspectRatio:h,controlDirection:OS(f)};let k,_=null,A=[],I,T,O,L=!1;const B=NI().on("start",M=>{const{nodeLookup:P,transform:H,snapGrid:D,snapToGrid:z,nodeOrigin:V,paneDomNode:G}=n();if(k=P.get(t),!k)return;_=(G==null?void 0:G.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:F}=xl(M.sourceEvent,{transform:H,snapGrid:D,snapToGrid:z,containerBounds:_});N={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},S={...N,pointerX:q,pointerY:F,aspectRatio:N.width/N.height},I=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(I=P.get(k.parentId),T=I&&k.extent==="parent"?Pq(I):void 0),A=[],O=void 0;for(const[Y,$]of P)if($.parentId===t&&(A.push({id:Y,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const K=Lq($,k,$.origin??V);O?O=[[Math.min(K[0][0],O[0][0]),Math.min(K[0][1],O[0][1])],[Math.max(K[1][0],O[1][0]),Math.max(K[1][1],O[1][1])]]:O=K}y==null||y(M,{...N})}).on("drag",M=>{const{transform:P,snapGrid:H,snapToGrid:D,nodeOrigin:z}=n(),V=xl(M.sourceEvent,{transform:P,snapGrid:H,snapToGrid:D,containerBounds:_}),G=[];if(!k)return;const{x:q,y:F,width:Y,height:$}=N,K={},ie=k.origin??z,{width:U,height:Q,x:Z,y:ee}=Rq(S,a.controlDirection,V,a.boundaries,a.keepAspectRatio,ie,T,O),se=U!==Y,ae=Q!==$,ne=Z!==q&&se,le=ee!==F&&ae;if(!ne&&!le&&!se&&!ae)return;if((ne||le||ie[0]===1||ie[1]===1)&&(K.x=ne?Z:N.x,K.y=le?ee:N.y,N.x=K.x,N.y=K.y,A.length>0)){const xe=Z-q,Ae=ee-F;for(const Se of A)Se.position={x:Se.position.x-xe+ie[0]*(U-Y),y:Se.position.y-Ae+ie[1]*(Q-$)},G.push(Se)}if((se||ae)&&(K.width=se&&(!a.resizeDirection||a.resizeDirection==="horizontal")?U:N.width,K.height=ae&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:N.height,N.width=K.width,N.height=K.height),I&&k.expandParent){const xe=ie[0]*(K.width??0);K.x&&K.x<xe&&(N.x=xe,S.x=S.x-(K.x-xe));const Ae=ie[1]*(K.height??0);K.y&&K.y<Ae&&(N.y=Ae,S.y=S.y-(K.y-Ae))}const he=Mq({width:N.width,prevWidth:Y,height:N.height,prevHeight:$,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),pe={...N,direction:he};(v==null?void 0:v(M,pe))!==!1&&(L=!0,w==null||w(M,pe),r(K,G))}).on("end",M=>{L&&(b==null||b(M,{...N}),s==null||s({...N}),L=!1)});i.call(B)}function d(){i.on(".drag",null)}return{update:c,destroy:d}}var em={exports:{}},tm={},nm={exports:{}},rm={};/**
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 LS;function $q(){if(LS)return rm;LS=1;var e=Wl();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function c(h,g){var y=g(),w=r({inst:{value:y,getSnapshot:g}}),b=w[0].inst,v=w[1];return i(function(){b.value=y,b.getSnapshot=g,d(b)&&v({inst:b})},[h,y,g]),s(function(){return d(b)&&v({inst:b}),h(function(){d(b)&&v({inst:b})})},[h]),a(y),y}function d(h){var g=h.getSnapshot;h=h.value;try{var y=g();return!n(h,y)}catch{return!0}}function f(h,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return rm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,rm}var DS;function Fq(){return DS||(DS=1,nm.exports=$q()),nm.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 $S;function qq(){if($S)return tm;$S=1;var e=Wl(),t=Fq();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,c=e.useMemo,d=e.useDebugValue;return tm.useSyncExternalStoreWithSelector=function(f,p,h,g,y){var w=i(null);if(w.current===null){var b={hasValue:!1,value:null};w.current=b}else b=w.current;w=c(function(){function N(I){if(!S){if(S=!0,k=I,I=g(I),y!==void 0&&b.hasValue){var T=b.value;if(y(T,I))return _=T}return _=I}if(T=_,r(k,I))return T;var O=g(I);return y!==void 0&&y(T,O)?(k=I,T):(k=I,_=O)}var S=!1,k,_,A=h===void 0?null:h;return[function(){return N(p())},A===null?void 0:function(){return N(A())}]},[p,h,g,y]);var v=s(f,w[0],w[1]);return a(function(){b.hasValue=!0,b.value=v},[v]),d(v),v},tm}var FS;function Bq(){return FS||(FS=1,em.exports=qq()),em.exports}var zq=Bq();const Vq=Ul(zq),Hq={},qS=e=>{let t;const n=new Set,r=(p,h)=>{const g=typeof p=="function"?p(t):p;if(!Object.is(g,t)){const y=t;t=h??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(w=>w(t,y))}},s=()=>t,d={setState:r,getState:s,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(Hq?"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()}},f=t=e(r,s,d);return d},Uq=e=>e?qS(e):qS,{useDebugValue:Wq}=yt,{useSyncExternalStoreWithSelector:Kq}=Vq,Gq=e=>e;function pM(e,t=Gq,n){const r=Kq(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Wq(r),r}const BS=(e,t)=>{const n=Uq(e),r=(s,i=t)=>pM(n,s,i);return Object.assign(r,n),r},Yq=(e,t)=>e?BS(e,t):BS;function nt(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 lw=aI();const Xq=Ul(lw),ef=E.createContext(null),Qq=ef.Provider,mM=Ar.error001();function $e(e,t){const n=E.useContext(ef);if(n===null)throw new Error(mM);return pM(n,e,t)}function st(){const e=E.useContext(ef);if(e===null)throw new Error(mM);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zS={display:"none"},Jq={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},gM="react-flow__node-desc",yM="react-flow__edge-desc",Zq="react-flow__aria-live",eB=e=>e.ariaLiveMessage,tB=e=>e.ariaLabelConfig;function nB({rfId:e}){const t=$e(eB);return u.jsx("div",{id:`${Zq}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Jq,children:t})}function rB({rfId:e,disableKeyboardA11y:t}){const n=$e(tB);return u.jsxs(u.Fragment,{children:[u.jsx("div",{id:`${gM}-${e}`,style:zS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),u.jsx("div",{id:`${yM}-${e}`,style:zS,children:n["edge.a11yDescription.default"]}),!t&&u.jsx(nB,{rfId:e})]})}const tf=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return u.jsx("div",{className:vt(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});tf.displayName="Panel";function sB({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(tf,{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:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const iB=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}},Du=e=>e.id;function oB(e,t){return nt(e.selectedNodes.map(Du),t.selectedNodes.map(Du))&&nt(e.selectedEdges.map(Du),t.selectedEdges.map(Du))}function aB({onSelectionChange:e}){const t=st(),{selectedNodes:n,selectedEdges:r}=$e(iB,oB);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const lB=e=>!!e.onSelectionChangeHandlers;function cB({onSelectionChange:e}){const t=$e(lB);return e||t?u.jsx(aB,{onSelectionChange:e}):null}const xM=[0,0],uB={x:0,y:0,zoom:1},dB=["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"],VS=[...dB,"rfId"],fB=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}),HS={translateExtent:jl,nodeOrigin:xM,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function hB(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:d}=$e(fB,nt),f=st();E.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{p.current=HS,c()}),[]);const p=E.useRef(HS);return E.useEffect(()=>{for(const h of VS){const g=e[h],y=p.current[h];g!==y&&(typeof e[h]>"u"||(h==="nodes"?t(g):h==="edges"?n(g):h==="minZoom"?r(g):h==="maxZoom"?s(g):h==="translateExtent"?i(g):h==="nodeExtent"?a(g):h==="ariaLabelConfig"?f.setState({ariaLabelConfig:G6(g)}):h==="fitView"?f.setState({fitViewQueued:g}):h==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[h]:g})))}p.current=e},VS.map(h=>e[h])),null}function US(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function pB(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=US(),i=()=>n(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),t!==null?t:(r=US())!=null&&r.matches?"dark":"light"}const WS=typeof document<"u"?document:null;function Ml(e=null,t={target:WS,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),i=E.useRef(new Set([])),[a,c]=E.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),p=f.reduce((h,g)=>h.concat(...g),[]);return[f,p]}return[[],[]]},[e]);return E.useEffect(()=>{const d=(t==null?void 0:t.target)??WS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=y=>{var v,N;if(s.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!s.current||s.current&&!f)&&XI(y))return!1;const b=GS(y.code,c);if(i.current.add(y[b]),KS(a,i.current,!1)){const S=((N=(v=y.composedPath)==null?void 0:v.call(y))==null?void 0:N[0])||y.target,k=(S==null?void 0:S.nodeName)==="BUTTON"||(S==null?void 0:S.nodeName)==="A";t.preventDefault!==!1&&(s.current||!k)&&y.preventDefault(),r(!0)}},h=y=>{const w=GS(y.code,c);KS(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(y[w]),y.key==="Meta"&&i.current.clear(),s.current=!1},g=()=>{i.current.clear(),r(!1)};return d==null||d.addEventListener("keydown",p),d==null||d.addEventListener("keyup",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{d==null||d.removeEventListener("keydown",p),d==null||d.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function KS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function GS(e,t){return t.includes(e)?"code":"key"}const mB=()=>{const e=st();return E.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,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??i},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:i,maxZoom:a,panZoom:c}=e.getState(),d=tw(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(d,{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:i,domNode:a}=e.getState();if(!a)return t;const{x:c,y:d}=a.getBoundingClientRect(),f={x:t.x-c,y:t.y-d},p=n.snapGrid??s,h=n.snapToGrid??i;return Jl(f,r,h,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:i}=r.getBoundingClientRect(),a=jd(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function vM(e,t){const n=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of t){const a=r.get(i.id);if(!a){n.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...i};for(const d of a)gB(d,c);n.push(c)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function gB(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 bM(e,t){return vM(e,t)}function wM(e,t){return vM(e,t)}function mi(e,t){return{id:e,type:"select",selected:t}}function jo(e,t=new Set,n=!1){const r=[];for(const[s,i]of e){const a=t.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(n&&(i.selected=a),r.push(mi(i.id,a)))}return r}function YS({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const c=t.get(a.id),d=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;d!==void 0&&d!==a&&n.push({id:a.id,item:a,type:"replace"}),d===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function XS(e){return{id:e.id,type:"remove"}}const QS=e=>$6(e),yB=e=>zI(e);function NM(e){return E.forwardRef(e)}const xB=typeof window<"u"?E.useLayoutEffect:E.useEffect;function JS(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>vB(()=>n(s=>s+BigInt(1))));return xB(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function vB(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const kM=E.createContext(null);function bB({children:e}){const t=st(),n=E.useCallback(c=>{const{nodes:d=[],setNodes:f,hasDefaultNodes:p,onNodesChange:h,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:w}=t.getState();let b=d;for(const N of c)b=typeof N=="function"?N(b):N;let v=YS({items:b,lookup:g});for(const N of w.values())v=N(v);p&&f(b),v.length>0?h==null||h(v):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:S,setNodes:k}=t.getState();N&&k(S)})},[]),r=JS(n),s=E.useCallback(c=>{const{edges:d=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:h,edgeLookup:g}=t.getState();let y=d;for(const w of c)y=typeof w=="function"?w(y):w;p?f(y):h&&h(YS({items:y,lookup:g}))},[]),i=JS(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return u.jsx(kM.Provider,{value:a,children:e})}function wB(){const e=E.useContext(kM);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const NB=e=>!!e.panZoom;function Zo(){const e=mB(),t=st(),n=wB(),r=$e(NB),s=E.useMemo(()=>{const i=h=>t.getState().nodeLookup.get(h),a=h=>{n.nodeQueue.push(h)},c=h=>{n.edgeQueue.push(h)},d=h=>{var N,S;const{nodeLookup:g,nodeOrigin:y}=t.getState(),w=QS(h)?h:g.get(h.id),b=w.parentId?GI(w.position,w.measured,w.parentId,g,y):w.position,v={...w,position:b,width:((N=w.measured)==null?void 0:N.width)??w.width,height:((S=w.measured)==null?void 0:S.height)??w.height};return Uo(v)},f=(h,g,y={replace:!1})=>{a(w=>w.map(b=>{if(b.id===h){const v=typeof g=="function"?g(b):g;return y.replace&&QS(v)?v:{...b,...v}}return b}))},p=(h,g,y={replace:!1})=>{c(w=>w.map(b=>{if(b.id===h){const v=typeof g=="function"?g(b):g;return y.replace&&yB(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var g;return(g=i(h))==null?void 0:g.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(g=>({...g}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:a,setEdges:c,addNodes:h=>{const g=Array.isArray(h)?h:[h];n.nodeQueue.push(y=>[...y,...g])},addEdges:h=>{const g=Array.isArray(h)?h:[h];n.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:h=[],edges:g=[],transform:y}=t.getState(),[w,b,v]=y;return{nodes:h.map(N=>({...N})),edges:g.map(N=>({...N})),viewport:{x:w,y:b,zoom:v}}},deleteElements:async({nodes:h=[],edges:g=[]})=>{const{nodes:y,edges:w,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:N,triggerEdgeChanges:S,onDelete:k,onBeforeDelete:_}=t.getState(),{nodes:A,edges:I}=await V6({nodesToRemove:h,edgesToRemove:g,nodes:y,edges:w,onBeforeDelete:_}),T=I.length>0,O=A.length>0;if(T){const L=I.map(XS);v==null||v(I),S(L)}if(O){const L=A.map(XS);b==null||b(A),N(L)}return(O||T)&&(k==null||k({nodes:A,edges:I})),{deletedNodes:A,deletedEdges:I}},getIntersectingNodes:(h,g=!0,y)=>{const w=kS(h),b=w?h:d(h),v=y!==void 0;return b?(y||t.getState().nodes).filter(N=>{const S=t.getState().nodeLookup.get(N.id);if(S&&!w&&(N.id===h.id||!S.internals.positionAbsolute))return!1;const k=Uo(v?N:S),_=Tl(k,b);return g&&_>0||_>=k.width*k.height||_>=b.width*b.height}):[]},isNodeIntersecting:(h,g,y=!0)=>{const b=kS(h)?h:d(h);if(!b)return!1;const v=Tl(b,g);return y&&v>0||v>=g.width*g.height||v>=b.width*b.height},updateNode:f,updateNodeData:(h,g,y={replace:!1})=>{f(h,w=>{const b=typeof g=="function"?g(w):g;return y.replace?{...w,data:b}:{...w,data:{...w.data,...b}}},y)},updateEdge:p,updateEdgeData:(h,g,y={replace:!1})=>{p(h,w=>{const b=typeof g=="function"?g(w):g;return y.replace?{...w,data:b}:{...w,data:{...w.data,...b}}},y)},getNodesBounds:h=>{const{nodeLookup:g,nodeOrigin:y}=t.getState();return F6(h,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:h,id:g,nodeId:y})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${y}-${h}${g?`-${g}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:h,handleId:g,nodeId:y})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${y}${h?g?`-${h}-${g}`:`-${h}`:""}`))==null?void 0:w.values())??[])},fitView:async h=>{const g=t.getState().fitViewResolver??K6();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:g}),n.nodeQueue.push(y=>[...y]),g.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const ZS=e=>e.selected,kB=typeof window<"u"?window:void 0;function SB({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=st(),{deleteElements:r}=Zo(),s=Ml(e,{actInsideInputWithModifier:!1}),i=Ml(t,{target:kB});E.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();r({nodes:c.filter(ZS),edges:a.filter(ZS)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function CB(e){const t=st();E.useEffect(()=>{const n=()=>{var s,i,a,c;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=nw(e.current);(r.height===0||r.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",Ar.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 nf={position:"absolute",width:"100%",height:"100%",top:0,left:0},_B=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function EB({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Ni.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:d,translateExtent:f,minZoom:p,maxZoom:h,zoomActivationKeyCode:g,preventScrolling:y=!0,children:w,noWheelClassName:b,noPanClassName:v,onViewportChange:N,isControlledViewport:S,paneClickDistance:k,selectionOnDrag:_}){const A=st(),I=E.useRef(null),{userSelectionActive:T,lib:O,connectionInProgress:L}=$e(_B,nt),B=Ml(g),M=E.useRef();CB(I);const P=E.useCallback(H=>{N==null||N({x:H[0],y:H[1],zoom:H[2]}),S||A.setState({transform:H})},[N,S]);return E.useEffect(()=>{if(I.current){M.current=Aq({domNode:I.current,minZoom:p,maxZoom:h,translateExtent:f,viewport:d,onDraggingChange:V=>A.setState({paneDragging:V}),onPanZoomStart:(V,G)=>{const{onViewportChangeStart:q,onMoveStart:F}=A.getState();F==null||F(V,G),q==null||q(G)},onPanZoom:(V,G)=>{const{onViewportChange:q,onMove:F}=A.getState();F==null||F(V,G),q==null||q(G)},onPanZoomEnd:(V,G)=>{const{onViewportChangeEnd:q,onMoveEnd:F}=A.getState();F==null||F(V,G),q==null||q(G)}});const{x:H,y:D,zoom:z}=M.current.getViewport();return A.setState({panZoom:M.current,transform:[H,D,z],domNode:I.current.closest(".react-flow")}),()=>{var V;(V=M.current)==null||V.destroy()}}},[]),E.useEffect(()=>{var H;(H=M.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:B,preventScrolling:y,noPanClassName:v,userSelectionActive:T,noWheelClassName:b,lib:O,onTransformChange:P,connectionInProgress:L,selectionOnDrag:_,paneClickDistance:k})},[e,t,n,r,s,i,a,c,B,y,v,T,b,O,P,L,_,k]),u.jsx("div",{className:"react-flow__renderer",ref:I,style:nf,children:w})}const jB=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function AB(){const{userSelectionActive:e,userSelectionRect:t}=$e(jB,nt);return e&&t?u.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 sm=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},TB=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function IB({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Al.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:i,onSelectionStart:a,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:p,onPaneMouseEnter:h,onPaneMouseMove:g,onPaneMouseLeave:y,children:w}){const b=st(),{userSelectionActive:v,elementsSelectable:N,dragging:S,connectionInProgress:k}=$e(TB,nt),_=N&&(e||v),A=E.useRef(null),I=E.useRef(),T=E.useRef(new Set),O=E.useRef(new Set),L=E.useRef(!1),B=q=>{if(L.current||k){L.current=!1;return}d==null||d(q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},M=q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){q.preventDefault();return}f==null||f(q)},P=p?q=>p(q):void 0,H=q=>{L.current&&(q.stopPropagation(),L.current=!1)},D=q=>{var Q,Z;const{domNode:F}=b.getState();if(I.current=F==null?void 0:F.getBoundingClientRect(),!I.current)return;const Y=q.target===A.current;if(!Y&&!!q.target.closest(".nokey")||!e||!(i&&Y||t)||q.button!==0||!q.isPrimary)return;(Z=(Q=q.target)==null?void 0:Q.setPointerCapture)==null||Z.call(Q,q.pointerId),L.current=!1;const{x:ie,y:U}=Jn(q.nativeEvent,I.current);b.setState({userSelectionRect:{width:0,height:0,startX:ie,startY:U,x:ie,y:U}}),Y||(q.stopPropagation(),q.preventDefault())},z=q=>{const{userSelectionRect:F,transform:Y,nodeLookup:$,edgeLookup:K,connectionLookup:ie,triggerNodeChanges:U,triggerEdgeChanges:Q,defaultEdgeOptions:Z,resetSelectedElements:ee}=b.getState();if(!I.current||!F)return;const{x:se,y:ae}=Jn(q.nativeEvent,I.current),{startX:ne,startY:le}=F;if(!L.current){const Ae=t?0:s;if(Math.hypot(se-ne,ae-le)<=Ae)return;ee(),a==null||a(q)}L.current=!0;const he={startX:ne,startY:le,x:se<ne?se:ne,y:ae<le?ae:le,width:Math.abs(se-ne),height:Math.abs(ae-le)},pe=T.current,ve=O.current;T.current=new Set(ew($,he,Y,n===Al.Partial,!0).map(Ae=>Ae.id)),O.current=new Set;const xe=(Z==null?void 0:Z.selectable)??!0;for(const Ae of T.current){const Se=ie.get(Ae);if(Se)for(const{edgeId:Ge}of Se.values()){const Ve=K.get(Ge);Ve&&(Ve.selectable??xe)&&O.current.add(Ge)}}if(!SS(pe,T.current)){const Ae=jo($,T.current,!0);U(Ae)}if(!SS(ve,O.current)){const Ae=jo(K,O.current);Q(Ae)}b.setState({userSelectionRect:he,userSelectionActive:!0,nodesSelectionActive:!1})},V=q=>{var F,Y;q.button===0&&((Y=(F=q.target)==null?void 0:F.releasePointerCapture)==null||Y.call(F,q.pointerId),!v&&q.target===A.current&&b.getState().userSelectionRect&&(B==null||B(q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(c==null||c(q),b.setState({nodesSelectionActive:T.current.size>0})))},G=r===!0||Array.isArray(r)&&r.includes(0);return u.jsxs("div",{className:vt(["react-flow__pane",{draggable:G,dragging:S,selection:e}]),onClick:_?void 0:sm(B,A),onContextMenu:sm(M,A),onWheel:sm(P,A),onPointerEnter:_?void 0:h,onPointerMove:_?z:g,onPointerUp:_?V:void 0,onPointerDownCapture:_?D:void 0,onClickCapture:_?H:void 0,onPointerLeave:y,ref:A,style:nf,children:[w,u.jsx(AB,{})]})}function lb({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:c,onError:d}=t.getState(),f=c.get(e);if(!f){d==null||d("012",Ar.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&a)&&(i({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([e])}function SM({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const c=st(),[d,f]=E.useState(!1),p=E.useRef();return E.useEffect(()=>{p.current=mq({getStoreItems:()=>c.getState(),onNodeMouseDown:h=>{lb({id:h,store:c,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),E.useEffect(()=>{var h,g;if(t)(h=p.current)==null||h.destroy();else if(e.current)return(g=p.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var y;(y=p.current)==null||y.destroy()}},[n,r,t,i,e,s]),d}const MB=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function CM(){const e=st();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:c,updateNodePositions:d,nodeLookup:f,nodeOrigin:p}=e.getState(),h=new Map,g=MB(a),y=s?i[0]:5,w=s?i[1]:5,b=n.direction.x*y*n.factor,v=n.direction.y*w*n.factor;for(const[,N]of f){if(!g(N))continue;let S={x:N.internals.positionAbsolute.x+b,y:N.internals.positionAbsolute.y+v};s&&(S=Ql(S,i));const{position:k,positionAbsolute:_}=VI({nodeId:N.id,nextPosition:S,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:c});N.position=k,N.internals.positionAbsolute=_,h.set(N.id,N)}d(h)},[])}const cw=E.createContext(null),RB=cw.Provider;cw.Consumer;const _M=()=>E.useContext(cw),OB=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),PB=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:c,toHandle:d,isValid:f}=a,p=(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:p,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:i===Vo.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:p&&f}};function LB({type:e="source",position:t=ge.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:c,children:d,className:f,onMouseDown:p,onTouchStart:h,...g},y){var z,V;const w=a||null,b=e==="target",v=st(),N=_M(),{connectOnClick:S,noPanClassName:k,rfId:_}=$e(OB,nt),{connectingFrom:A,connectingTo:I,clickConnecting:T,isPossibleEndHandle:O,connectionInProcess:L,clickConnectionInProcess:B,valid:M}=$e(PB(N,w,e),nt);N||(V=(z=v.getState()).onError)==null||V.call(z,"010",Ar.error010());const P=G=>{const{defaultEdgeOptions:q,onConnect:F,hasDefaultEdges:Y}=v.getState(),$={...q,...G};if(Y){const{edges:K,setEdges:ie}=v.getState();ie(tM($,K))}F==null||F($),c==null||c($)},H=G=>{if(!N)return;const q=QI(G.nativeEvent);if(s&&(q&&G.button===0||!q)){const F=v.getState();ab.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:w,nodeId:N,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:F.onConnectEnd,updateConnection:F.updateConnection,onConnect:P,isValidConnection:n||F.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}q?p==null||p(G):h==null||h(G)},D=G=>{const{onClickConnectStart:q,onClickConnectEnd:F,connectionClickStartHandle:Y,connectionMode:$,isValidConnection:K,lib:ie,rfId:U,nodeLookup:Q,connection:Z}=v.getState();if(!N||!Y&&!s)return;if(!Y){q==null||q(G.nativeEvent,{nodeId:N,handleId:w,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:N,type:e,id:w}});return}const ee=YI(G.target),se=n||K,{connection:ae,isValid:ne}=ab.isValid(G.nativeEvent,{handle:{nodeId:N,id:w,type:e},connectionMode:$,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:se,flowId:U,doc:ee,lib:ie,nodeLookup:Q});ne&&ae&&P(ae);const le=structuredClone(Z);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,F==null||F(G,le),v.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":w,"data-nodeid":N,"data-handlepos":t,"data-id":`${_}-${N}-${w}-${e}`,className:vt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,f,{source:!b,target:b,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:A,connectingto:I,valid:M,connectionindicator:r&&(!L||O)&&(L||B?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:S?D:void 0,ref:y,...g,children:d})}const qe=E.memo(NM(LB));function DB({data:e,isConnectable:t,sourcePosition:n=ge.Bottom}){return u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(qe,{type:"source",position:n,isConnectable:t})]})}function $B({data:e,isConnectable:t,targetPosition:n=ge.Top,sourcePosition:r=ge.Bottom}){return u.jsxs(u.Fragment,{children:[u.jsx(qe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(qe,{type:"source",position:r,isConnectable:t})]})}function FB(){return null}function qB({data:e,isConnectable:t,targetPosition:n=ge.Top}){return u.jsxs(u.Fragment,{children:[u.jsx(qe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ad={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},e2={input:DB,default:$B,output:qB,group:FB};function BB(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 zB=e=>{const{width:t,height:n,x:r,y:s}=Xl(e.nodeLookup,{filter:i=>!!i.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 VB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=st(),{width:s,height:i,transformString:a,userSelectionActive:c}=$e(zB,nt),d=CM(),f=E.useRef(null);if(E.useEffect(()=>{var g;n||(g=f.current)==null||g.focus({preventScroll:!0})},[n]),SM({nodeRef:f}),c||!s||!i)return null;const p=e?g=>{const y=r.getState().nodes.filter(w=>w.selected);e(g,y)}:void 0,h=g=>{Object.prototype.hasOwnProperty.call(Ad,g.key)&&(g.preventDefault(),d({direction:Ad[g.key],factor:g.shiftKey?4:1}))};return u.jsx("div",{className:vt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:u.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:s,height:i}})})}const t2=typeof window<"u"?window:void 0,HB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function EM({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:w,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:N,zoomOnScroll:S,zoomOnPinch:k,panOnScroll:_,panOnScrollSpeed:A,panOnScrollMode:I,zoomOnDoubleClick:T,panOnDrag:O,defaultViewport:L,translateExtent:B,minZoom:M,maxZoom:P,preventScrolling:H,onSelectionContextMenu:D,noWheelClassName:z,noPanClassName:V,disableKeyboardA11y:G,onViewportChange:q,isControlledViewport:F}){const{nodesSelectionActive:Y,userSelectionActive:$}=$e(HB,nt),K=Ml(f,{target:t2}),ie=Ml(b,{target:t2}),U=ie||O,Q=ie||_,Z=p&&U!==!0,ee=K||$||Z;return SB({deleteKeyCode:d,multiSelectionKeyCode:w}),u.jsx(EB,{onPaneContextMenu:i,elementsSelectable:N,zoomOnScroll:S,zoomOnPinch:k,panOnScroll:Q,panOnScrollSpeed:A,panOnScrollMode:I,zoomOnDoubleClick:T,panOnDrag:!K&&U,defaultViewport:L,translateExtent:B,minZoom:M,maxZoom:P,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:z,noPanClassName:V,onViewportChange:q,isControlledViewport:F,paneClickDistance:c,selectionOnDrag:Z,children:u.jsxs(IB,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:U,isSelecting:!!ee,selectionMode:h,selectionKeyPressed:K,paneClickDistance:c,selectionOnDrag:Z,children:[e,Y&&u.jsx(VB,{onSelectionContextMenu:D,noPanClassName:V,disableKeyboardA11y:G})]})})}EM.displayName="FlowRenderer";const UB=E.memo(EM),WB=e=>t=>e?ew(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 KB(e){return $e(E.useCallback(WB(e),[e]),nt)}const GB=e=>e.updateNodeInternals;function YB(){const e=$e(GB),[t]=E.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function XB({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=st(),i=E.useRef(null),a=E.useRef(null),c=E.useRef(e.sourcePosition),d=E.useRef(e.targetPosition),f=E.useRef(t),p=n&&!!e.internals.handleBounds;return E.useEffect(()=>{i.current&&!e.hidden&&(!p||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[p,e.hidden]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(i.current){const h=f.current!==t,g=c.current!==e.sourcePosition,y=d.current!==e.targetPosition;(h||g||y)&&(f.current=t,c.current=e.sourcePosition,d.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function QB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:c,elementsSelectable:d,nodesConnectable:f,nodesFocusable:p,resizeObserver:h,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:w,rfId:b,nodeTypes:v,nodeClickDistance:N,onError:S}){const{node:k,internals:_,isParent:A}=$e(se=>{const ae=se.nodeLookup.get(e),ne=se.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:ne}},nt);let I=k.type||"default",T=(v==null?void 0:v[I])||e2[I];T===void 0&&(S==null||S("003",Ar.error003(I)),I="default",T=(v==null?void 0:v.default)||e2.default);const O=!!(k.draggable||c&&typeof k.draggable>"u"),L=!!(k.selectable||d&&typeof k.selectable>"u"),B=!!(k.connectable||f&&typeof k.connectable>"u"),M=!!(k.focusable||p&&typeof k.focusable>"u"),P=st(),H=KI(k),D=XB({node:k,nodeType:I,hasDimensions:H,resizeObserver:h}),z=SM({nodeRef:D,disabled:k.hidden||!O,noDragClassName:g,handleSelector:k.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:N}),V=CM();if(k.hidden)return null;const G=is(k),q=BB(k),F=L||O||t||n||r||s,Y=n?se=>n(se,{..._.userNode}):void 0,$=r?se=>r(se,{..._.userNode}):void 0,K=s?se=>s(se,{..._.userNode}):void 0,ie=i?se=>i(se,{..._.userNode}):void 0,U=a?se=>a(se,{..._.userNode}):void 0,Q=se=>{const{selectNodesOnDrag:ae,nodeDragThreshold:ne}=P.getState();L&&(!ae||!O||ne>0)&&lb({id:e,store:P,nodeRef:D}),t&&t(se,{..._.userNode})},Z=se=>{if(!(XI(se.nativeEvent)||w)){if($I.includes(se.key)&&L){const ae=se.key==="Escape";lb({id:e,store:P,unselect:ae,nodeRef:D})}else if(O&&k.selected&&Object.prototype.hasOwnProperty.call(Ad,se.key)){se.preventDefault();const{ariaLabelConfig:ae}=P.getState();P.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),V({direction:Ad[se.key],factor:se.shiftKey?4:1})}}},ee=()=>{var ve;if(w||!((ve=D.current)!=null&&ve.matches(":focus-visible")))return;const{transform:se,width:ae,height:ne,autoPanOnNodeFocus:le,setCenter:he}=P.getState();if(!le)return;ew(new Map([[e,k]]),{x:0,y:0,width:ae,height:ne},se,!0).length>0||he(k.position.x+G.width/2,k.position.y+G.height/2,{zoom:se[2]})};return u.jsx("div",{className:vt(["react-flow__node",`react-flow__node-${I}`,{[y]:O},k.className,{selected:k.selected,selectable:L,parent:A,draggable:O,dragging:z}]),ref:D,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:H?"visible":"hidden",...k.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Y,onMouseMove:$,onMouseLeave:K,onContextMenu:ie,onClick:Q,onDoubleClick:U,onKeyDown:M?Z:void 0,tabIndex:M?0:void 0,onFocus:M?ee:void 0,role:k.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${gM}-${b}`,"aria-label":k.ariaLabel,...k.domAttributes,children:u.jsx(RB,{value:e,children:u.jsx(T,{id:e,data:k.data,type:I,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:k.selected??!1,selectable:L,draggable:O,deletable:k.deletable??!0,isConnectable:B,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:z,dragHandle:k.dragHandle,zIndex:_.z,parentId:k.parentId,...G})})})}var JB=E.memo(QB);const ZB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function jM(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=$e(ZB,nt),a=KB(e.onlyRenderVisibleElements),c=YB();return u.jsx("div",{className:"react-flow__nodes",style:nf,children:a.map(d=>u.jsx(JB,{id:d,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:i},d))})}jM.displayName="NodeRenderer";const e8=E.memo(jM);function t8(e){return $e(E.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 i=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);i&&a&&Q6({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),nt)}const n8=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return u.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},r8=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return u.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},n2={[_d.Arrow]:n8,[_d.ArrowClosed]:r8};function s8(e){const t=st();return E.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(n2,e)?n2[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",Ar.error009(e)),null)},[e])}const i8=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const d=s8(t);return d?u.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:u.jsx(d,{color:n,strokeWidth:a})}):null},AM=({defaultColor:e,rfId:t})=>{const n=$e(i=>i.edges),r=$e(i=>i.defaultEdgeOptions),s=E.useMemo(()=>sq(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?u.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:u.jsx("defs",{children:s.map(i=>u.jsx(i8,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};AM.displayName="MarkerDefinitions";var o8=E.memo(AM);function TM({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:d,className:f,...p}){const[h,g]=E.useState({x:1,y:0,width:0,height:0}),y=vt(["react-flow__edge-textwrapper",f]),w=E.useRef(null);return E.useEffect(()=>{if(w.current){const b=w.current.getBBox();g({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?u.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:y,visibility:h.width?"visible":"hidden",...p,children:[s&&u.jsx("rect",{width:h.width+2*a[0],x:-a[0],y:-a[1],height:h.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),u.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:w,style:r,children:n}),d]}):null}TM.displayName="EdgeText";const a8=E.memo(TM);function rf({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d,interactionWidth:f=20,...p}){return u.jsxs(u.Fragment,{children:[u.jsx("path",{...p,d:e,fill:"none",className:vt(["react-flow__edge-path",p.className])}),f?u.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Qn(t)&&Qn(n)?u.jsx(a8,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d}):null]})}function r2({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===ge.Left||e===ge.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function IM({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:r,targetY:s,targetPosition:i=ge.Top}){const[a,c]=r2({pos:n,x1:e,y1:t,x2:r,y2:s}),[d,f]=r2({pos:i,x1:r,y1:s,x2:e,y2:t}),[p,h,g,y]=JI({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:f});return[`M${e},${t} C${a},${c} ${d},${f} ${r},${s}`,p,h,g,y]}function MM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:w,markerEnd:b,markerStart:v,interactionWidth:N})=>{const[S,k,_]=IM({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:c}),A=e.isInternal?void 0:t;return u.jsx(rf,{id:A,path:S,labelX:k,labelY:_,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:w,markerEnd:b,markerStart:v,interactionWidth:N})})}const l8=MM({isInternal:!1}),RM=MM({isInternal:!0});l8.displayName="SimpleBezierEdge";RM.displayName="SimpleBezierEdgeInternal";function OM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,sourcePosition:y=ge.Bottom,targetPosition:w=ge.Top,markerEnd:b,markerStart:v,pathOptions:N,interactionWidth:S})=>{const[k,_,A]=sb({sourceX:n,sourceY:r,sourcePosition:y,targetX:s,targetY:i,targetPosition:w,borderRadius:N==null?void 0:N.borderRadius,offset:N==null?void 0:N.offset,stepPosition:N==null?void 0:N.stepPosition}),I=e.isInternal?void 0:t;return u.jsx(rf,{id:I,path:k,labelX:_,labelY:A,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:b,markerStart:v,interactionWidth:S})})}const PM=OM({isInternal:!1}),LM=OM({isInternal:!0});PM.displayName="SmoothStepEdge";LM.displayName="SmoothStepEdgeInternal";function DM(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return u.jsx(PM,{...n,id:r,pathOptions:E.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const c8=DM({isInternal:!1}),$M=DM({isInternal:!0});c8.displayName="StepEdge";$M.displayName="StepEdgeInternal";function FM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:y,markerStart:w,interactionWidth:b})=>{const[v,N,S]=nM({sourceX:n,sourceY:r,targetX:s,targetY:i}),k=e.isInternal?void 0:t;return u.jsx(rf,{id:k,path:v,labelX:N,labelY:S,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:y,markerStart:w,interactionWidth:b})})}const u8=FM({isInternal:!1}),qM=FM({isInternal:!0});u8.displayName="StraightEdge";qM.displayName="StraightEdgeInternal";function BM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=ge.Bottom,targetPosition:c=ge.Top,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:w,markerEnd:b,markerStart:v,pathOptions:N,interactionWidth:S})=>{const[k,_,A]=ZI({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:c,curvature:N==null?void 0:N.curvature}),I=e.isInternal?void 0:t;return u.jsx(rf,{id:I,path:k,labelX:_,labelY:A,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:w,markerEnd:b,markerStart:v,interactionWidth:S})})}const d8=BM({isInternal:!1}),zM=BM({isInternal:!0});d8.displayName="BezierEdge";zM.displayName="BezierEdgeInternal";const s2={default:zM,straight:qM,step:$M,smoothstep:LM,simplebezier:RM},i2={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},f8=(e,t,n)=>n===ge.Left?e-t:n===ge.Right?e+t:e,h8=(e,t,n)=>n===ge.Top?e-t:n===ge.Bottom?e+t:e,o2="react-flow__edgeupdater";function a2({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:c}){return u.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:vt([o2,`${o2}-${c}`]),cx:f8(t,r,e),cy:h8(n,r,e),r,stroke:"transparent",fill:"transparent"})}function p8({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:c,targetPosition:d,onReconnect:f,onReconnectStart:p,onReconnectEnd:h,setReconnecting:g,setUpdateHover:y}){const w=st(),b=(_,A)=>{if(_.button!==0)return;const{autoPanOnConnect:I,domNode:T,isValidConnection:O,connectionMode:L,connectionRadius:B,lib:M,onConnectStart:P,onConnectEnd:H,cancelConnection:D,nodeLookup:z,rfId:V,panBy:G,updateConnection:q}=w.getState(),F=A.type==="target",Y=(ie,U)=>{g(!1),h==null||h(ie,n,A.type,U)},$=ie=>f==null?void 0:f(n,ie),K=(ie,U)=>{g(!0),p==null||p(_,n,A.type),P==null||P(ie,U)};ab.onPointerDown(_.nativeEvent,{autoPanOnConnect:I,connectionMode:L,connectionRadius:B,domNode:T,handleId:A.id,nodeId:A.nodeId,nodeLookup:z,isTarget:F,edgeUpdaterType:A.type,lib:M,flowId:V,cancelConnection:D,panBy:G,isValidConnection:O,onConnect:$,onConnectStart:K,onConnectEnd:H,onReconnectEnd:Y,updateConnection:q,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},v=_=>b(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),N=_=>b(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),S=()=>y(!0),k=()=>y(!1);return u.jsxs(u.Fragment,{children:[(e===!0||e==="source")&&u.jsx(a2,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:v,onMouseEnter:S,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&u.jsx(a2,{position:d,centerX:i,centerY:a,radius:t,onMouseDown:N,onMouseEnter:S,onMouseOut:k,type:"target"})]})}function m8({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:c,onMouseMove:d,onMouseLeave:f,reconnectRadius:p,onReconnect:h,onReconnectStart:g,onReconnectEnd:y,rfId:w,edgeTypes:b,noPanClassName:v,onError:N,disableKeyboardA11y:S}){let k=$e(he=>he.edgeLookup.get(e));const _=$e(he=>he.defaultEdgeOptions);k=_?{..._,...k}:k;let A=k.type||"default",I=(b==null?void 0:b[A])||s2[A];I===void 0&&(N==null||N("011",Ar.error011(A)),A="default",I=(b==null?void 0:b.default)||s2.default);const T=!!(k.focusable||t&&typeof k.focusable>"u"),O=typeof h<"u"&&(k.reconnectable||n&&typeof k.reconnectable>"u"),L=!!(k.selectable||r&&typeof k.selectable>"u"),B=E.useRef(null),[M,P]=E.useState(!1),[H,D]=E.useState(!1),z=st(),{zIndex:V,sourceX:G,sourceY:q,targetX:F,targetY:Y,sourcePosition:$,targetPosition:K}=$e(E.useCallback(he=>{const pe=he.nodeLookup.get(k.source),ve=he.nodeLookup.get(k.target);if(!pe||!ve)return{zIndex:k.zIndex,...i2};const xe=rq({id:e,sourceNode:pe,targetNode:ve,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:he.connectionMode,onError:N});return{zIndex:X6({selected:k.selected,zIndex:k.zIndex,sourceNode:pe,targetNode:ve,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...xe||i2}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),nt),ie=E.useMemo(()=>k.markerStart?`url('#${ib(k.markerStart,w)}')`:void 0,[k.markerStart,w]),U=E.useMemo(()=>k.markerEnd?`url('#${ib(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||G===null||q===null||F===null||Y===null)return null;const Q=he=>{var Ae;const{addSelectedEdges:pe,unselectNodesAndEdges:ve,multiSelectionActive:xe}=z.getState();L&&(z.setState({nodesSelectionActive:!1}),k.selected&&xe?(ve({nodes:[],edges:[k]}),(Ae=B.current)==null||Ae.blur()):pe([e])),s&&s(he,k)},Z=i?he=>{i(he,{...k})}:void 0,ee=a?he=>{a(he,{...k})}:void 0,se=c?he=>{c(he,{...k})}:void 0,ae=d?he=>{d(he,{...k})}:void 0,ne=f?he=>{f(he,{...k})}:void 0,le=he=>{var pe;if(!S&&$I.includes(he.key)&&L){const{unselectNodesAndEdges:ve,addSelectedEdges:xe}=z.getState();he.key==="Escape"?((pe=B.current)==null||pe.blur(),ve({edges:[k]})):xe([e])}};return u.jsx("svg",{style:{zIndex:V},children:u.jsxs("g",{className:vt(["react-flow__edge",`react-flow__edge-${A}`,k.className,v,{selected:k.selected,animated:k.animated,inactive:!L&&!s,updating:M,selectable:L}]),onClick:Q,onDoubleClick:Z,onContextMenu:ee,onMouseEnter:se,onMouseMove:ae,onMouseLeave:ne,onKeyDown:T?le:void 0,tabIndex:T?0:void 0,role:k.ariaRole??(T?"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":T?`${yM}-${w}`:void 0,ref:B,...k.domAttributes,children:[!H&&u.jsx(I,{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:G,sourceY:q,targetX:F,targetY:Y,sourcePosition:$,targetPosition:K,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:ie,markerEnd:U,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),O&&u.jsx(p8,{edge:k,isReconnectable:O,reconnectRadius:p,onReconnect:h,onReconnectStart:g,onReconnectEnd:y,sourceX:G,sourceY:q,targetX:F,targetY:Y,sourcePosition:$,targetPosition:K,setUpdateHover:P,setReconnecting:D})]})})}var g8=E.memo(m8);const y8=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function VM({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:h,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:w,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:N,elementsSelectable:S,onError:k}=$e(y8,nt),_=t8(t);return u.jsxs("div",{className:"react-flow__edges",children:[u.jsx(o8,{defaultColor:e,rfId:n}),_.map(A=>u.jsx(g8,{id:A,edgesFocusable:v,edgesReconnectable:N,elementsSelectable:S,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:c,onMouseMove:d,onMouseLeave:f,onClick:p,reconnectRadius:h,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:w,rfId:n,onError:k,edgeTypes:r,disableKeyboardA11y:b},A))]})}VM.displayName="EdgeRenderer";const x8=E.memo(VM),v8=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function b8({children:e}){const t=$e(v8);return u.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function w8(e){const t=Zo(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const N8=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function k8(e){const t=$e(N8),n=st();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function S8(e){return e.connection.inProgress?{...e.connection,to:Jl(e.connection.to,e.transform)}:{...e.connection}}function C8(e){return S8}function _8(e){const t=C8();return $e(t,nt)}const E8=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function j8({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:c,inProgress:d}=$e(E8,nt);return!(i&&s&&d)?null:u.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:u.jsx("g",{className:vt(["react-flow__connection",BI(c)]),children:u.jsx(HM,{style:t,type:n,CustomComponent:r,isValid:c})})})}const HM=({style:e,type:t=$s.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:c,fromPosition:d,to:f,toNode:p,toHandle:h,toPosition:g,pointer:y}=_8();if(!s)return;if(n)return u.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:i.x,fromY:i.y,toX:f.x,toY:f.y,fromPosition:d,toPosition:g,connectionStatus:BI(r),toNode:p,toHandle:h,pointer:y});let w="";const b={sourceX:i.x,sourceY:i.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case $s.Bezier:[w]=ZI(b);break;case $s.SimpleBezier:[w]=IM(b);break;case $s.Step:[w]=sb({...b,borderRadius:0});break;case $s.SmoothStep:[w]=sb(b);break;default:[w]=nM(b)}return u.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};HM.displayName="ConnectionLine";const A8={};function l2(e=A8){E.useRef(e),st(),E.useEffect(()=>{},[e])}function T8(){st(),E.useRef(!1),E.useEffect(()=>{},[])}function UM({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:h,onSelectionStart:g,onSelectionEnd:y,connectionLineType:w,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:N,selectionKeyCode:S,selectionOnDrag:k,selectionMode:_,multiSelectionKeyCode:A,panActivationKeyCode:I,zoomActivationKeyCode:T,deleteKeyCode:O,onlyRenderVisibleElements:L,elementsSelectable:B,defaultViewport:M,translateExtent:P,minZoom:H,maxZoom:D,preventScrolling:z,defaultMarkerColor:V,zoomOnScroll:G,zoomOnPinch:q,panOnScroll:F,panOnScrollSpeed:Y,panOnScrollMode:$,zoomOnDoubleClick:K,panOnDrag:ie,onPaneClick:U,onPaneMouseEnter:Q,onPaneMouseMove:Z,onPaneMouseLeave:ee,onPaneScroll:se,onPaneContextMenu:ae,paneClickDistance:ne,nodeClickDistance:le,onEdgeContextMenu:he,onEdgeMouseEnter:pe,onEdgeMouseMove:ve,onEdgeMouseLeave:xe,reconnectRadius:Ae,onReconnect:Se,onReconnectStart:Ge,onReconnectEnd:Ve,noDragClassName:jt,noWheelClassName:St,noPanClassName:mt,disableKeyboardA11y:He,nodeExtent:nn,rfId:Rt,viewport:rn,onViewportChange:ut}){return l2(e),l2(t),T8(),w8(n),k8(rn),u.jsx(UB,{onPaneClick:U,onPaneMouseEnter:Q,onPaneMouseMove:Z,onPaneMouseLeave:ee,onPaneContextMenu:ae,onPaneScroll:se,paneClickDistance:ne,deleteKeyCode:O,selectionKeyCode:S,selectionOnDrag:k,selectionMode:_,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:A,panActivationKeyCode:I,zoomActivationKeyCode:T,elementsSelectable:B,zoomOnScroll:G,zoomOnPinch:q,zoomOnDoubleClick:K,panOnScroll:F,panOnScrollSpeed:Y,panOnScrollMode:$,panOnDrag:ie,defaultViewport:M,translateExtent:P,minZoom:H,maxZoom:D,onSelectionContextMenu:h,preventScrolling:z,noDragClassName:jt,noWheelClassName:St,noPanClassName:mt,disableKeyboardA11y:He,onViewportChange:ut,isControlledViewport:!!rn,children:u.jsxs(b8,{children:[u.jsx(x8,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Se,onReconnectStart:Ge,onReconnectEnd:Ve,onlyRenderVisibleElements:L,onEdgeContextMenu:he,onEdgeMouseEnter:pe,onEdgeMouseMove:ve,onEdgeMouseLeave:xe,reconnectRadius:Ae,defaultMarkerColor:V,noPanClassName:mt,disableKeyboardA11y:He,rfId:Rt}),u.jsx(j8,{style:b,type:w,component:v,containerStyle:N}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(e8,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:le,onlyRenderVisibleElements:L,noPanClassName:mt,noDragClassName:jt,disableKeyboardA11y:He,nodeExtent:nn,rfId:Rt}),u.jsx("div",{className:"react-flow__viewport-portal"})]})})}UM.displayName="GraphView";const I8=E.memo(UM),c2=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:c,minZoom:d=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:h,zIndexMode:g="basic"}={})=>{const y=new Map,w=new Map,b=new Map,v=new Map,N=r??t??[],S=n??e??[],k=p??[0,0],_=h??jl;iM(b,v,N);const A=ob(S,y,w,{nodeOrigin:k,nodeExtent:_,zIndexMode:g});let I=[0,0,1];if(a&&s&&i){const T=Xl(y,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:O,y:L,zoom:B}=tw(T,s,i,d,f,(c==null?void 0:c.padding)??.1);I=[O,L,B]}return{rfId:"1",width:s??0,height:i??0,transform:I,nodes:S,nodesInitialized:A,nodeLookup:y,parentLookup:w,edges:N,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:d,maxZoom:f,translateExtent:jl,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Vo.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:{...qI},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:H6,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:FI,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},M8=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:f,nodeOrigin:p,nodeExtent:h,zIndexMode:g})=>Yq((y,w)=>{async function b(){const{nodeLookup:v,panZoom:N,fitViewOptions:S,fitViewResolver:k,width:_,height:A,minZoom:I,maxZoom:T}=w();N&&(await z6({nodes:v,width:_,height:A,panZoom:N,minZoom:I,maxZoom:T},S),k==null||k.resolve(!0),y({fitViewResolver:null}))}return{...c2({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:f,nodeOrigin:p,nodeExtent:h,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:v=>{const{nodeLookup:N,parentLookup:S,nodeOrigin:k,elevateNodesOnSelect:_,fitViewQueued:A,zIndexMode:I}=w(),T=ob(v,N,S,{nodeOrigin:k,nodeExtent:h,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:I});A&&T?(b(),y({nodes:v,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:v,nodesInitialized:T})},setEdges:v=>{const{connectionLookup:N,edgeLookup:S}=w();iM(N,S,v),y({edges:v})},setDefaultNodesAndEdges:(v,N)=>{if(v){const{setNodes:S}=w();S(v),y({hasDefaultNodes:!0})}if(N){const{setEdges:S}=w();S(N),y({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:N,nodeLookup:S,parentLookup:k,domNode:_,nodeOrigin:A,nodeExtent:I,debug:T,fitViewQueued:O,zIndexMode:L}=w(),{changes:B,updatedInternals:M}=dq(v,S,k,_,A,I,L);M&&(aq(S,k,{nodeOrigin:A,nodeExtent:I,zIndexMode:L}),O?(b(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(B==null?void 0:B.length)>0&&(T&&console.log("React Flow: trigger node changes",B),N==null||N(B)))},updateNodePositions:(v,N=!1)=>{const S=[];let k=[];const{nodeLookup:_,triggerNodeChanges:A,connection:I,updateConnection:T,onNodesChangeMiddlewareMap:O}=w();for(const[L,B]of v){const M=_.get(L),P=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(B!=null&&B.position)),H={id:L,type:"position",position:P?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:N};if(M&&I.inProgress&&I.fromNode.id===M.id){const D=_i(M,I.fromHandle,ge.Left,!0);T({...I,from:D})}P&&M.parentId&&S.push({id:L,parentId:M.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),k.push(H)}if(S.length>0){const{parentLookup:L,nodeOrigin:B}=w(),M=aw(S,_,L,B);k.push(...M)}for(const L of O.values())k=L(k);A(k)},triggerNodeChanges:v=>{const{onNodesChange:N,setNodes:S,nodes:k,hasDefaultNodes:_,debug:A}=w();if(v!=null&&v.length){if(_){const I=bM(v,k);S(I)}A&&console.log("React Flow: trigger node changes",v),N==null||N(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:N,setEdges:S,edges:k,hasDefaultEdges:_,debug:A}=w();if(v!=null&&v.length){if(_){const I=wM(v,k);S(I)}A&&console.log("React Flow: trigger edge changes",v),N==null||N(v)}},addSelectedNodes:v=>{const{multiSelectionActive:N,edgeLookup:S,nodeLookup:k,triggerNodeChanges:_,triggerEdgeChanges:A}=w();if(N){const I=v.map(T=>mi(T,!0));_(I);return}_(jo(k,new Set([...v]),!0)),A(jo(S))},addSelectedEdges:v=>{const{multiSelectionActive:N,edgeLookup:S,nodeLookup:k,triggerNodeChanges:_,triggerEdgeChanges:A}=w();if(N){const I=v.map(T=>mi(T,!0));A(I);return}A(jo(S,new Set([...v]))),_(jo(k,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:N}={})=>{const{edges:S,nodes:k,nodeLookup:_,triggerNodeChanges:A,triggerEdgeChanges:I}=w(),T=v||k,O=N||S,L=T.map(M=>{const P=_.get(M.id);return P&&(P.selected=!1),mi(M.id,!1)}),B=O.map(M=>mi(M.id,!1));A(L),I(B)},setMinZoom:v=>{const{panZoom:N,maxZoom:S}=w();N==null||N.setScaleExtent([v,S]),y({minZoom:v})},setMaxZoom:v=>{const{panZoom:N,minZoom:S}=w();N==null||N.setScaleExtent([S,v]),y({maxZoom:v})},setTranslateExtent:v=>{var N;(N=w().panZoom)==null||N.setTranslateExtent(v),y({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:N,triggerNodeChanges:S,triggerEdgeChanges:k,elementsSelectable:_}=w();if(!_)return;const A=N.reduce((T,O)=>O.selected?[...T,mi(O.id,!1)]:T,[]),I=v.reduce((T,O)=>O.selected?[...T,mi(O.id,!1)]:T,[]);S(A),k(I)},setNodeExtent:v=>{const{nodes:N,nodeLookup:S,parentLookup:k,nodeOrigin:_,elevateNodesOnSelect:A,nodeExtent:I,zIndexMode:T}=w();v[0][0]===I[0][0]&&v[0][1]===I[0][1]&&v[1][0]===I[1][0]&&v[1][1]===I[1][1]||(ob(N,S,k,{nodeOrigin:_,nodeExtent:v,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:T}),y({nodeExtent:v}))},panBy:v=>{const{transform:N,width:S,height:k,panZoom:_,translateExtent:A}=w();return fq({delta:v,panZoom:_,transform:N,translateExtent:A,width:S,height:k})},setCenter:async(v,N,S)=>{const{width:k,height:_,maxZoom:A,panZoom:I}=w();if(!I)return Promise.resolve(!1);const T=typeof(S==null?void 0:S.zoom)<"u"?S.zoom:A;return await I.setViewport({x:k/2-v*T,y:_/2-N*T,zoom:T},{duration:S==null?void 0:S.duration,ease:S==null?void 0:S.ease,interpolate:S==null?void 0:S.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...qI}})},updateConnection:v=>{y({connection:v})},reset:()=>y({...c2()})}},Object.is);function WM({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:d,fitView:f,nodeOrigin:p,nodeExtent:h,zIndexMode:g,children:y}){const[w]=E.useState(()=>M8({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:f,minZoom:a,maxZoom:c,fitViewOptions:d,nodeOrigin:p,nodeExtent:h,zIndexMode:g}));return u.jsx(Qq,{value:w,children:u.jsx(bB,{children:y})})}function R8({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:c,fitViewOptions:d,minZoom:f,maxZoom:p,nodeOrigin:h,nodeExtent:g,zIndexMode:y}){return E.useContext(ef)?u.jsx(u.Fragment,{children:e}):u.jsx(WM,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:c,initialFitViewOptions:d,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:h,nodeExtent:g,zIndexMode:y,children:e})}const O8={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function P8({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:c,onEdgeClick:d,onInit:f,onMove:p,onMoveStart:h,onMoveEnd:g,onConnect:y,onConnectStart:w,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:N,onNodeMouseEnter:S,onNodeMouseMove:k,onNodeMouseLeave:_,onNodeContextMenu:A,onNodeDoubleClick:I,onNodeDragStart:T,onNodeDrag:O,onNodeDragStop:L,onNodesDelete:B,onEdgesDelete:M,onDelete:P,onSelectionChange:H,onSelectionDragStart:D,onSelectionDrag:z,onSelectionDragStop:V,onSelectionContextMenu:G,onSelectionStart:q,onSelectionEnd:F,onBeforeDelete:Y,connectionMode:$,connectionLineType:K=$s.Bezier,connectionLineStyle:ie,connectionLineComponent:U,connectionLineContainerStyle:Q,deleteKeyCode:Z="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:se=!1,selectionMode:ae=Al.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:le=Il()?"Meta":"Control",zoomActivationKeyCode:he=Il()?"Meta":"Control",snapToGrid:pe,snapGrid:ve,onlyRenderVisibleElements:xe=!1,selectNodesOnDrag:Ae,nodesDraggable:Se,autoPanOnNodeFocus:Ge,nodesConnectable:Ve,nodesFocusable:jt,nodeOrigin:St=xM,edgesFocusable:mt,edgesReconnectable:He,elementsSelectable:nn=!0,defaultViewport:Rt=uB,minZoom:rn=.5,maxZoom:ut=2,translateExtent:Ot=jl,preventScrolling:Pn=!0,nodeExtent:ze,defaultMarkerColor:Ln="#b1b1b7",zoomOnScroll:Dr=!0,zoomOnPinch:Wt=!0,panOnScroll:sn=!1,panOnScrollSpeed:ma=.5,panOnScrollMode:ls=Ni.Free,zoomOnDoubleClick:cr=!0,panOnDrag:Xs=!0,onPaneClick:Dn,onPaneMouseEnter:ur,onPaneMouseMove:$n,onPaneMouseLeave:vn,onPaneScroll:cs,onPaneContextMenu:Qs,paneClickDistance:Ce=1,nodeClickDistance:be=0,children:We,onReconnect:bn,onReconnectStart:Fn,onReconnectEnd:$r,onEdgeContextMenu:on,onEdgeDoubleClick:Js,onEdgeMouseEnter:Jf,onEdgeMouseMove:Zs,onEdgeMouseLeave:Vi,reconnectRadius:Hi=10,onNodesChange:ga,onEdgesChange:Zf,noDragClassName:eh="nodrag",noWheelClassName:th="nowheel",noPanClassName:dr="nopan",fitView:ya,fitViewOptions:xa,connectOnClick:nh,attributionPosition:vc,proOptions:bc,defaultEdgeOptions:wc,elevateNodesOnSelect:Nc=!0,elevateEdgesOnSelect:rh=!1,disableKeyboardA11y:kc=!1,autoPanOnConnect:ot,autoPanOnNodeDrag:sh,autoPanSpeed:va,connectionRadius:Sc,isValidConnection:Ui,onError:ih,style:Cc,id:ei,nodeDragThreshold:wn,connectionDragThreshold:oh,viewport:an,onViewportChange:ah,width:lh,height:ch,colorMode:Wi="light",debug:Ki,onScroll:fr,ariaLabelConfig:Gi,zIndexMode:_c="basic",...uh},ba){const Yi=ei||"1",wa=pB(Wi),ti=E.useCallback(Ec=>{Ec.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fr==null||fr(Ec)},[fr]);return u.jsx("div",{"data-testid":"rf__wrapper",...uh,onScroll:ti,style:{...Cc,...O8},ref:ba,className:vt(["react-flow",s,wa]),id:ei,role:"application",children:u.jsxs(R8,{nodes:e,edges:t,width:lh,height:ch,fitView:ya,fitViewOptions:xa,minZoom:rn,maxZoom:ut,nodeOrigin:St,nodeExtent:ze,zIndexMode:_c,children:[u.jsx(I8,{onInit:f,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:S,onNodeMouseMove:k,onNodeMouseLeave:_,onNodeContextMenu:A,onNodeDoubleClick:I,nodeTypes:i,edgeTypes:a,connectionLineType:K,connectionLineStyle:ie,connectionLineComponent:U,connectionLineContainerStyle:Q,selectionKeyCode:ee,selectionOnDrag:se,selectionMode:ae,deleteKeyCode:Z,multiSelectionKeyCode:le,panActivationKeyCode:ne,zoomActivationKeyCode:he,onlyRenderVisibleElements:xe,defaultViewport:Rt,translateExtent:Ot,minZoom:rn,maxZoom:ut,preventScrolling:Pn,zoomOnScroll:Dr,zoomOnPinch:Wt,zoomOnDoubleClick:cr,panOnScroll:sn,panOnScrollSpeed:ma,panOnScrollMode:ls,panOnDrag:Xs,onPaneClick:Dn,onPaneMouseEnter:ur,onPaneMouseMove:$n,onPaneMouseLeave:vn,onPaneScroll:cs,onPaneContextMenu:Qs,paneClickDistance:Ce,nodeClickDistance:be,onSelectionContextMenu:G,onSelectionStart:q,onSelectionEnd:F,onReconnect:bn,onReconnectStart:Fn,onReconnectEnd:$r,onEdgeContextMenu:on,onEdgeDoubleClick:Js,onEdgeMouseEnter:Jf,onEdgeMouseMove:Zs,onEdgeMouseLeave:Vi,reconnectRadius:Hi,defaultMarkerColor:Ln,noDragClassName:eh,noWheelClassName:th,noPanClassName:dr,rfId:Yi,disableKeyboardA11y:kc,nodeExtent:ze,viewport:an,onViewportChange:ah}),u.jsx(hB,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:w,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:N,nodesDraggable:Se,autoPanOnNodeFocus:Ge,nodesConnectable:Ve,nodesFocusable:jt,edgesFocusable:mt,edgesReconnectable:He,elementsSelectable:nn,elevateNodesOnSelect:Nc,elevateEdgesOnSelect:rh,minZoom:rn,maxZoom:ut,nodeExtent:ze,onNodesChange:ga,onEdgesChange:Zf,snapToGrid:pe,snapGrid:ve,connectionMode:$,translateExtent:Ot,connectOnClick:nh,defaultEdgeOptions:wc,fitView:ya,fitViewOptions:xa,onNodesDelete:B,onEdgesDelete:M,onDelete:P,onNodeDragStart:T,onNodeDrag:O,onNodeDragStop:L,onSelectionDrag:z,onSelectionDragStart:D,onSelectionDragStop:V,onMove:p,onMoveStart:h,onMoveEnd:g,noPanClassName:dr,nodeOrigin:St,rfId:Yi,autoPanOnConnect:ot,autoPanOnNodeDrag:sh,autoPanSpeed:va,onError:ih,connectionRadius:Sc,isValidConnection:Ui,selectNodesOnDrag:Ae,nodeDragThreshold:wn,connectionDragThreshold:oh,onBeforeDelete:Y,debug:Ki,ariaLabelConfig:Gi,zIndexMode:_c}),u.jsx(cB,{onSelectionChange:H}),We,u.jsx(sB,{proOptions:bc,position:vc}),u.jsx(rB,{rfId:Yi,disableKeyboardA11y:kc})]})})}var L8=NM(P8);function D8({dimensions:e,lineWidth:t,variant:n,className:r}){return u.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:vt(["react-flow__background-pattern",n,r])})}function $8({radius:e,className:t}){return u.jsx("circle",{cx:e,cy:e,r:e,className:vt(["react-flow__background-pattern","dots",t])})}var Jr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Jr||(Jr={}));const F8={[Jr.Dots]:1,[Jr.Lines]:1,[Jr.Cross]:6},q8=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function KM({id:e,variant:t=Jr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:c,style:d,className:f,patternClassName:p}){const h=E.useRef(null),{transform:g,patternId:y}=$e(q8,nt),w=r||F8[t],b=t===Jr.Dots,v=t===Jr.Cross,N=Array.isArray(n)?n:[n,n],S=[N[0]*g[2]||1,N[1]*g[2]||1],k=w*g[2],_=Array.isArray(i)?i:[i,i],A=v?[k,k]:S,I=[_[0]*g[2]||1+A[0]/2,_[1]*g[2]||1+A[1]/2],T=`${y}${e||""}`;return u.jsxs("svg",{className:vt(["react-flow__background",f]),style:{...d,...nf,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:h,"data-testid":"rf__background",children:[u.jsx("pattern",{id:T,x:g[0]%S[0],y:g[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:b?u.jsx($8,{radius:k/2,className:p}):u.jsx(D8,{dimensions:A,lineWidth:s,variant:t,className:p})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}KM.displayName="Background";const B8=E.memo(KM);function z8(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function V8(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function H8(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.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 U8(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 W8(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 $u({children:e,className:t,...n}){return u.jsx("button",{type:"button",className:vt(["react-flow__controls-button",t]),...n,children:e})}const K8=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function GM({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:c,onInteractiveChange:d,className:f,children:p,position:h="bottom-left",orientation:g="vertical","aria-label":y}){const w=st(),{isInteractive:b,minZoomReached:v,maxZoomReached:N,ariaLabelConfig:S}=$e(K8,nt),{zoomIn:k,zoomOut:_,fitView:A}=Zo(),I=()=>{k(),i==null||i()},T=()=>{_(),a==null||a()},O=()=>{A(s),c==null||c()},L=()=>{w.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),d==null||d(!b)},B=g==="horizontal"?"horizontal":"vertical";return u.jsxs(tf,{className:vt(["react-flow__controls",B,f]),position:h,style:e,"data-testid":"rf__controls","aria-label":y??S["controls.ariaLabel"],children:[t&&u.jsxs(u.Fragment,{children:[u.jsx($u,{onClick:I,className:"react-flow__controls-zoomin",title:S["controls.zoomIn.ariaLabel"],"aria-label":S["controls.zoomIn.ariaLabel"],disabled:N,children:u.jsx(z8,{})}),u.jsx($u,{onClick:T,className:"react-flow__controls-zoomout",title:S["controls.zoomOut.ariaLabel"],"aria-label":S["controls.zoomOut.ariaLabel"],disabled:v,children:u.jsx(V8,{})})]}),n&&u.jsx($u,{className:"react-flow__controls-fitview",onClick:O,title:S["controls.fitView.ariaLabel"],"aria-label":S["controls.fitView.ariaLabel"],children:u.jsx(H8,{})}),r&&u.jsx($u,{className:"react-flow__controls-interactive",onClick:L,title:S["controls.interactive.ariaLabel"],"aria-label":S["controls.interactive.ariaLabel"],children:b?u.jsx(W8,{}):u.jsx(U8,{})}),p]})}GM.displayName="Controls";const G8=E.memo(GM);function Y8({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:c,strokeWidth:d,className:f,borderRadius:p,shapeRendering:h,selected:g,onClick:y}){const{background:w,backgroundColor:b}=i||{},v=a||w||b;return u.jsx("rect",{className:vt(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:p,ry:p,width:r,height:s,style:{fill:v,stroke:c,strokeWidth:d},shapeRendering:h,onClick:y?N=>y(N,e):void 0})}const X8=E.memo(Y8),Q8=e=>e.nodes.map(t=>t.id),im=e=>e instanceof Function?e:()=>e;function J8({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=X8,onClick:a}){const c=$e(Q8,nt),d=im(t),f=im(e),p=im(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return u.jsx(u.Fragment,{children:c.map(g=>u.jsx(ez,{id:g,nodeColorFunc:d,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:h},g))})}function Z8({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:c,onClick:d}){const{node:f,x:p,y:h,width:g,height:y}=$e(w=>{const{internals:b}=w.nodeLookup.get(e),v=b.userNode,{x:N,y:S}=b.positionAbsolute,{width:k,height:_}=is(v);return{node:v,x:N,y:S,width:k,height:_}},nt);return!f||f.hidden||!KI(f)?null:u.jsx(c,{x:p,y:h,width:g,height:y,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:s,strokeColor:n(f),strokeWidth:i,shapeRendering:a,onClick:d,id:f.id})}const ez=E.memo(Z8);var tz=E.memo(J8);const nz=200,rz=150,sz=e=>!e.hidden,iz=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?WI(Xl(e.nodeLookup,{filter:sz}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},oz="react-flow__minimap-desc";function YM({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:d,maskColor:f,maskStrokeColor:p,maskStrokeWidth:h,position:g="bottom-right",onClick:y,onNodeClick:w,pannable:b=!1,zoomable:v=!1,ariaLabel:N,inversePan:S,zoomStep:k=1,offsetScale:_=5}){const A=st(),I=E.useRef(null),{boundingRect:T,viewBB:O,rfId:L,panZoom:B,translateExtent:M,flowWidth:P,flowHeight:H,ariaLabelConfig:D}=$e(iz,nt),z=(e==null?void 0:e.width)??nz,V=(e==null?void 0:e.height)??rz,G=T.width/z,q=T.height/V,F=Math.max(G,q),Y=F*z,$=F*V,K=_*F,ie=T.x-(Y-T.width)/2-K,U=T.y-($-T.height)/2-K,Q=Y+K*2,Z=$+K*2,ee=`${oz}-${L}`,se=E.useRef(0),ae=E.useRef();se.current=F,E.useEffect(()=>{if(I.current&&B)return ae.current=wq({domNode:I.current,panZoom:B,getTransform:()=>A.getState().transform,getViewScale:()=>se.current}),()=>{var pe;(pe=ae.current)==null||pe.destroy()}},[B]),E.useEffect(()=>{var pe;(pe=ae.current)==null||pe.update({translateExtent:M,width:P,height:H,inversePan:S,pannable:b,zoomStep:k,zoomable:v})},[b,v,S,k,M,P,H]);const ne=y?pe=>{var Ae;const[ve,xe]=((Ae=ae.current)==null?void 0:Ae.pointer(pe))||[0,0];y(pe,{x:ve,y:xe})}:void 0,le=w?E.useCallback((pe,ve)=>{const xe=A.getState().nodeLookup.get(ve).internals.userNode;w(pe,xe)},[]):void 0,he=N??D["minimap.ariaLabel"];return u.jsx(tf,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*F: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:vt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:u.jsxs("svg",{width:z,height:V,viewBox:`${ie} ${U} ${Q} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ee,ref:I,onClick:ne,children:[he&&u.jsx("title",{id:ee,children:he}),u.jsx(tz,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),u.jsx("path",{className:"react-flow__minimap-mask",d:`M${ie-K},${U-K}h${Q+K*2}v${Z+K*2}h${-Q-K*2}z
62
+ M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}YM.displayName="MiniMap";const az=E.memo(YM),lz=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,cz={[Ei.Line]:"right",[Ei.Handle]:"bottom-right"};function uz({nodeId:e,position:t,variant:n=Ei.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:c=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:y=!0,shouldResize:w,onResizeStart:b,onResize:v,onResizeEnd:N}){const S=_M(),k=typeof e=="string"?e:S,_=st(),A=E.useRef(null),I=n===Ei.Handle,T=$e(E.useCallback(lz(I&&y),[I,y]),nt),O=E.useRef(null),L=t??cz[n];E.useEffect(()=>{if(!(!A.current||!k))return O.current||(O.current=Dq({domNode:A.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:M,transform:P,snapGrid:H,snapToGrid:D,nodeOrigin:z,domNode:V}=_.getState();return{nodeLookup:M,transform:P,snapGrid:H,snapToGrid:D,nodeOrigin:z,paneDomNode:V}},onChange:(M,P)=>{const{triggerNodeChanges:H,nodeLookup:D,parentLookup:z,nodeOrigin:V}=_.getState(),G=[],q={x:M.x,y:M.y},F=D.get(k);if(F&&F.expandParent&&F.parentId){const Y=F.origin??V,$=M.width??F.measured.width??0,K=M.height??F.measured.height??0,ie={id:F.id,parentId:F.parentId,rect:{width:$,height:K,...GI({x:M.x??F.position.x,y:M.y??F.position.y},{width:$,height:K},F.parentId,D,Y)}},U=aw([ie],D,z,V);G.push(...U),q.x=M.x?Math.max(Y[0]*$,M.x):void 0,q.y=M.y?Math.max(Y[1]*K,M.y):void 0}if(q.x!==void 0&&q.y!==void 0){const Y={id:k,type:"position",position:{...q}};G.push(Y)}if(M.width!==void 0&&M.height!==void 0){const $={id:k,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};G.push($)}for(const Y of P){const $={...Y,type:"position"};G.push($)}H(G)},onEnd:({width:M,height:P})=>{const H={id:k,type:"dimensions",resizing:!1,dimensions:{width:M,height:P}};_.getState().triggerNodeChanges([H])}})),O.current.update({controlPosition:L,boundaries:{minWidth:c,minHeight:d,maxWidth:f,maxHeight:p},keepAspectRatio:h,resizeDirection:g,onResizeStart:b,onResize:v,onResizeEnd:N,shouldResize:w}),()=>{var M;(M=O.current)==null||M.destroy()}},[L,c,d,f,p,h,b,v,N,w]);const B=L.split("-");return u.jsx("div",{className:vt(["react-flow__resize-control","nodrag",...B,n,r]),ref:A,style:{...s,scale:T,...a&&{[I?"backgroundColor":"borderColor"]:a}},children:i})}const u2=E.memo(uz);function XM({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:s,lineStyle:i,color:a,minWidth:c=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:h=!1,autoScale:g=!0,shouldResize:y,onResizeStart:w,onResize:b,onResizeEnd:v}){return t?u.jsxs(u.Fragment,{children:[Iq.map(N=>u.jsx(u2,{className:s,style:i,nodeId:e,position:N,variant:Ei.Line,color:a,minWidth:c,minHeight:d,maxWidth:f,maxHeight:p,onResizeStart:w,keepAspectRatio:h,autoScale:g,shouldResize:y,onResize:b,onResizeEnd:v},N)),Tq.map(N=>u.jsx(u2,{className:n,style:r,nodeId:e,position:N,color:a,minWidth:c,minHeight:d,maxWidth:f,maxHeight:p,onResizeStart:w,keepAspectRatio:h,autoScale:g,shouldResize:y,onResize:b,onResizeEnd:v},N))]}):null}/**
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 dz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),QM=(...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 fz={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 hz=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...c},d)=>E.createElement("svg",{ref:d,...fz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:QM("lucide",s),...c},[...a.map(([f,p])=>E.createElement(f,p)),...Array.isArray(i)?i:[i]]));/**
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 ce=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(hz,{ref:i,iconNode:t,className:QM(`lucide-${dz(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 pz=ce("AlignCenterHorizontal",[["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4",key:"11f1s0"}],["path",{d:"M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4",key:"t14dx9"}],["path",{d:"M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1",key:"1w07xs"}],["path",{d:"M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1",key:"1apec2"}]]);/**
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 mz=ce("AlignCenterVertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",key:"14d6g8"}],["path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",key:"1e2lrw"}],["path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",key:"1fkdwx"}],["path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",key:"1euafb"}]]);/**
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 gz=ce("AlignEndHorizontal",[["rect",{width:"6",height:"16",x:"4",y:"2",rx:"2",key:"z5wdxg"}],["rect",{width:"6",height:"9",x:"14",y:"9",rx:"2",key:"um7a8w"}],["path",{d:"M22 22H2",key:"19qnx5"}]]);/**
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 yz=ce("AlignEndVertical",[["rect",{width:"16",height:"6",x:"2",y:"4",rx:"2",key:"10wcwx"}],["rect",{width:"9",height:"6",x:"9",y:"14",rx:"2",key:"4p5bwg"}],["path",{d:"M22 22V2",key:"12ipfv"}]]);/**
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 xz=ce("AlignStartHorizontal",[["rect",{width:"6",height:"16",x:"4",y:"6",rx:"2",key:"1n4dg1"}],["rect",{width:"6",height:"9",x:"14",y:"6",rx:"2",key:"17khns"}],["path",{d:"M22 2H2",key:"fhrpnj"}]]);/**
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 vz=ce("AlignStartVertical",[["rect",{width:"9",height:"6",x:"6",y:"14",rx:"2",key:"lpm2y7"}],["rect",{width:"16",height:"6",x:"6",y:"4",rx:"2",key:"rdj6ps"}],["path",{d:"M2 2v20",key:"1ivd8o"}]]);/**
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 bz=ce("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
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 wz=ce("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
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 Rl=ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
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 Nz=ce("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
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 kz=ce("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
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 vl=ce("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"}]]);/**
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 d2=ce("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"}]]);/**
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 cb=ce("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"}]]);/**
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 Vs=ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 Sr=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 JM=ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
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 It=ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 Sz=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 Oi=ce("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"}]]);/**
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 Mt=ce("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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 Cz=ce("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"}]]);/**
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 rt=ce("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"}]]);/**
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 ub=ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 _z=ce("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"}]]);/**
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 Ht=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 Ez=ce("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
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 jz=ce("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
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 uw=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
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 Az=ce("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
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 ji=ce("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"}]]);/**
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 Tz=ce("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"}]]);/**
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 Iz=ce("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"}]]);/**
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 Mz=ce("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"}]]);/**
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 Rz=ce("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"}]]);/**
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 Oz=ce("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"}]]);/**
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 Ai=ce("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"}]]);/**
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 ZM=ce("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
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 Pz=ce("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"}]]);/**
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 Ol=ce("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"}]]);/**
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 Lz=ce("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
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 Td=ce("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"}]]);/**
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 eR=ce("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"}]]);/**
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 f2=ce("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"}]]);/**
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 Dz=ce("GitPullRequest",[["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"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
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 tR=ce("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"}]]);/**
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 $z=ce("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
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 nR=ce("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
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 h2=ce("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"}]]);/**
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 Fz=ce("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"}]]);/**
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 sf=ce("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"}]]);/**
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 qz=ce("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"}]]);/**
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 rR=ce("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 Bz=ce("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"}]]);/**
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 db=ce("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"}]]);/**
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 dw=ce("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
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 Cr=ce("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 zz=ce("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
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 sR=ce("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
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 p2=ce("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"}]]);/**
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 Vz=ce("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"}]]);/**
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 Hz=ce("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"}]]);/**
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 Uz=ce("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
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 iR=ce("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"}]]);/**
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 Wz=ce("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"}]]);/**
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 Kz=ce("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 Gz=ce("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
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 Yz=ce("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
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 Xz=ce("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
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 m2=ce("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
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 Qz=ce("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"}]]);/**
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 oR=ce("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"}]]);/**
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 Jz=ce("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
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 Zz=ce("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"}]]);/**
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 Pi=ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 of=ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 e9=ce("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"}]]);/**
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 t9=ce("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"}]]);/**
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 g2=ce("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"}]]);/**
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 aR=ce("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
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 y2=ce("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"}]]);/**
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 n9=ce("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"}]]);/**
493
+ * @license lucide-react v0.468.0 - ISC
494
+ *
495
+ * This source code is licensed under the ISC license.
496
+ * See the LICENSE file in the root directory of this source tree.
497
+ */const Pl=ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
498
+ * @license lucide-react v0.468.0 - ISC
499
+ *
500
+ * This source code is licensed under the ISC license.
501
+ * See the LICENSE file in the root directory of this source tree.
502
+ */const lR=ce("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"}]]);/**
503
+ * @license lucide-react v0.468.0 - ISC
504
+ *
505
+ * This source code is licensed under the ISC license.
506
+ * See the LICENSE file in the root directory of this source tree.
507
+ */const cR=ce("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
508
+ * @license lucide-react v0.468.0 - ISC
509
+ *
510
+ * This source code is licensed under the ISC license.
511
+ * See the LICENSE file in the root directory of this source tree.
512
+ */const Ko=ce("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"}]]);/**
513
+ * @license lucide-react v0.468.0 - ISC
514
+ *
515
+ * This source code is licensed under the ISC license.
516
+ * See the LICENSE file in the root directory of this source tree.
517
+ */const x2=ce("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"}]]);/**
518
+ * @license lucide-react v0.468.0 - ISC
519
+ *
520
+ * This source code is licensed under the ISC license.
521
+ * See the LICENSE file in the root directory of this source tree.
522
+ */const r9=ce("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"}]]);/**
523
+ * @license lucide-react v0.468.0 - ISC
524
+ *
525
+ * This source code is licensed under the ISC license.
526
+ * See the LICENSE file in the root directory of this source tree.
527
+ */const uR=ce("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
528
+ * @license lucide-react v0.468.0 - ISC
529
+ *
530
+ * This source code is licensed under the ISC license.
531
+ * See the LICENSE file in the root directory of this source tree.
532
+ */const dR=ce("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"}]]);/**
533
+ * @license lucide-react v0.468.0 - ISC
534
+ *
535
+ * This source code is licensed under the ISC license.
536
+ * See the LICENSE file in the root directory of this source tree.
537
+ */const s9=ce("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"}]]);/**
538
+ * @license lucide-react v0.468.0 - ISC
539
+ *
540
+ * This source code is licensed under the ISC license.
541
+ * See the LICENSE file in the root directory of this source tree.
542
+ */const i9=ce("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"}]]);/**
543
+ * @license lucide-react v0.468.0 - ISC
544
+ *
545
+ * This source code is licensed under the ISC license.
546
+ * See the LICENSE file in the root directory of this source tree.
547
+ */const fR=ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
548
+ * @license lucide-react v0.468.0 - ISC
549
+ *
550
+ * This source code is licensed under the ISC license.
551
+ * See the LICENSE file in the root directory of this source tree.
552
+ */const o9=ce("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
553
+ * @license lucide-react v0.468.0 - ISC
554
+ *
555
+ * This source code is licensed under the ISC license.
556
+ * See the LICENSE file in the root directory of this source tree.
557
+ */const a9=ce("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"}]]);/**
558
+ * @license lucide-react v0.468.0 - ISC
559
+ *
560
+ * This source code is licensed under the ISC license.
561
+ * See the LICENSE file in the root directory of this source tree.
562
+ */const l9=ce("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
563
+ * @license lucide-react v0.468.0 - ISC
564
+ *
565
+ * This source code is licensed under the ISC license.
566
+ * See the LICENSE file in the root directory of this source tree.
567
+ */const ea=ce("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"}]]);/**
568
+ * @license lucide-react v0.468.0 - ISC
569
+ *
570
+ * This source code is licensed under the ISC license.
571
+ * See the LICENSE file in the root directory of this source tree.
572
+ */const v2=ce("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"}]]);/**
573
+ * @license lucide-react v0.468.0 - ISC
574
+ *
575
+ * This source code is licensed under the ISC license.
576
+ * See the LICENSE file in the root directory of this source tree.
577
+ */const Zl=ce("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"}]]);/**
578
+ * @license lucide-react v0.468.0 - ISC
579
+ *
580
+ * This source code is licensed under the ISC license.
581
+ * See the LICENSE file in the root directory of this source tree.
582
+ */const c9=ce("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"}]]);/**
583
+ * @license lucide-react v0.468.0 - ISC
584
+ *
585
+ * This source code is licensed under the ISC license.
586
+ * See the LICENSE file in the root directory of this source tree.
587
+ */const hR=ce("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
588
+ * @license lucide-react v0.468.0 - ISC
589
+ *
590
+ * This source code is licensed under the ISC license.
591
+ * See the LICENSE file in the root directory of this source tree.
592
+ */const u9=ce("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
593
+ * @license lucide-react v0.468.0 - ISC
594
+ *
595
+ * This source code is licensed under the ISC license.
596
+ * See the LICENSE file in the root directory of this source tree.
597
+ */const d9=ce("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"}]]);/**
598
+ * @license lucide-react v0.468.0 - ISC
599
+ *
600
+ * This source code is licensed under the ISC license.
601
+ * See the LICENSE file in the root directory of this source tree.
602
+ */const ec=ce("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"}]]);/**
603
+ * @license lucide-react v0.468.0 - ISC
604
+ *
605
+ * This source code is licensed under the ISC license.
606
+ * See the LICENSE file in the root directory of this source tree.
607
+ */const f9=ce("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"}]]);/**
608
+ * @license lucide-react v0.468.0 - ISC
609
+ *
610
+ * This source code is licensed under the ISC license.
611
+ * See the LICENSE file in the root directory of this source tree.
612
+ */const h9=ce("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
613
+ * @license lucide-react v0.468.0 - ISC
614
+ *
615
+ * This source code is licensed under the ISC license.
616
+ * See the LICENSE file in the root directory of this source tree.
617
+ */const p9=ce("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
618
+ * @license lucide-react v0.468.0 - ISC
619
+ *
620
+ * This source code is licensed under the ISC license.
621
+ * See the LICENSE file in the root directory of this source tree.
622
+ */const Zn=ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
623
+ * @license lucide-react v0.468.0 - ISC
624
+ *
625
+ * This source code is licensed under the ISC license.
626
+ * See the LICENSE file in the root directory of this source tree.
627
+ */const Go=ce("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"}]]);/**
628
+ * @license lucide-react v0.468.0 - ISC
629
+ *
630
+ * This source code is licensed under the ISC license.
631
+ * See the LICENSE file in the root directory of this source tree.
632
+ */const m9=ce("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"}]]);/**
633
+ * @license lucide-react v0.468.0 - ISC
634
+ *
635
+ * This source code is licensed under the ISC license.
636
+ * See the LICENSE file in the root directory of this source tree.
637
+ */const g9=ce("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"}]]),b2=e=>{let t;const n=new Set,r=(f,p)=>{const h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){const g=t;t=p??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(y=>y(t,g))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f))},d=t=e(r,s,c);return c},y9=(e=>e?b2(e):b2),x9=e=>e;function v9(e,t=x9){const n=yt.useSyncExternalStore(e.subscribe,yt.useCallback(()=>t(e.getState()),[e,t]),yt.useCallback(()=>t(e.getInitialState()),[e,t]));return yt.useDebugValue(n),n}const w2=e=>{const t=y9(e),n=r=>v9(t,r);return Object.assign(n,t),n},xn=(e=>e?w2(e):w2),b9=[{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"}}],w9=[{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"}],_r=xn((e,t)=>({nodes:b9,edges:w9,past:[],future:[],maxHistorySize:50,clipboard:null,onNodesChange:n=>{n.some(s=>s.type!=="position"&&s.type!=="select"&&s.type!=="dimensions")&&t().saveCheckpoint(),e({nodes:bM(n,t().nodes)})},onEdgesChange:n=>{n.some(s=>s.type!=="select")&&t().saveCheckpoint(),e({edges:wM(n,t().edges)})},onConnect:n=>{t().saveCheckpoint(),e({edges:tM({...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:i}=t();if(s.length>0){const d=s[s.length-1];if(JSON.stringify(d.nodes)===JSON.stringify(n)&&JSON.stringify(d.edges)===JSON.stringify(r))return}const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=[...s,a];c.length>i&&c.shift(),e({past:c})},undo:()=>{const{nodes:n,edges:r,past:s,future:i}=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],d=s.slice(0,-1);e({nodes:c.nodes,edges:c.edges,past:d,future:[a,...i]})},redo:()=>{const{nodes:n,edges:r,past:s,future:i}=t();if(i.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=i[0],d=i.slice(1);e({nodes:c.nodes,edges:c.edges,past:[...s,a],future:d})},canUndo:()=>t().past.length>0,canRedo:()=>t().future.length>0,copySelected:()=>{const{nodes:n}=t(),r=n.filter(d=>d.selected);if(r.length===0)return;const s=new Set(r.map(d=>d.id)),{edges:i}=t(),a=i.filter(d=>s.has(d.source)&&s.has(d.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:i}=t();if(!r||r.nodes.length===0)return;t().saveCheckpoint();const a=new Map,c=Date.now().toString(36),d=r.nodes.map((h,g)=>{const y=`${h.id.split("-copy")[0]}-copy-${c}-${g}`;return a.set(h.id,y),{...h,id:y,position:{x:h.position.x+n.x,y:h.position.y+n.y},selected:!0,data:{...h.data,id:y}}}),f=r.edges.map((h,g)=>({...h,id:`${h.id.split("-copy")[0]}-copy-${c}-${g}`,source:a.get(h.source)||h.source,target:a.get(h.target)||h.target})),p=s.map(h=>({...h,selected:!1}));e({nodes:[...p,...d],edges:[...i,...f],future:[]})},canPaste:()=>{const{clipboard:n}=t();return n!==null&&n.nodes.length>0}})),N2=[{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"}],N9={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"}]},fb="marktoflow:selectedWorkflow",k9=()=>{try{return localStorage.getItem(fb)}catch{return null}},k2=e=>{try{e?localStorage.setItem(fb,e):localStorage.removeItem(fb)}catch{}},en=xn((e,t)=>({workflows:N2,selectedWorkflow:k9(),currentWorkflow:null,isLoading:!1,error:null,loadWorkflows:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/workflows");if(!n.ok)throw new Error("Failed to load workflows");const r=await n.json();console.log("Loaded workflows:",r.workflows.length),e({workflows:r.workflows,isLoading:!1});const s=t().selectedWorkflow;s&&t().loadWorkflow(s)}catch(n){console.error("Failed to load workflows, using demo data:",n),e({workflows:N2,isLoading:!1})}},fetchWorkflows:async()=>{await t().loadWorkflows()},selectWorkflow:n=>{e({selectedWorkflow:n}),k2(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:N9,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(),i=[...t().workflows,s.workflow];e({workflows:i,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 i=t().workflows.filter(c=>c.path!==n),a=((r=i[0])==null?void 0:r.path)||null;e({workflows:i,selectedWorkflow:a,isLoading:!1}),k2(a)}catch{e({error:"Failed to delete workflow",isLoading:!1})}}})),S9=()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.platform.toUpperCase().includes("MAC"),tc=()=>S9()?"⌘":"Ctrl",C9={slack:iR,github:Td,jira:_z,gmail:p2,outlook:cb,linear:v2,notion:Ai,discord:Uz,airtable:Iz,confluence:Ai,http:tR,claude:vl,opencode:vl,ollama:vl,webhook:Go,schedule:cb,trigger:Go,stripe:Tz,teams:d9,twilio:Zz,sendgrid:lR,shopify:r9,zendesk:Fz,mailchimp:p2,asana:s9,trello:v2,dropbox:Ez,s3:h2,"aws-s3":h2,parallel:db};function hb(e){const t=e.toLowerCase().split(".")[0];return C9[t]||Cz}function pR(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=pR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _9(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=pR(e))&&(r&&(r+=" "),r+=t);return r}const fw="-",E9=e=>{const t=A9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(fw);return c[0]===""&&c.length!==1&&c.shift(),mR(c,t)||j9(a)},getConflictingClassGroupIds:(a,c)=>{const d=n[a]||[];return c&&r[a]?[...d,...r[a]]:d}}},mR=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?mR(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(fw);return(a=t.validators.find(({validator:c})=>c(i)))==null?void 0:a.classGroupId},S2=/^\[(.+)\]$/,j9=e=>{if(S2.test(e)){const t=S2.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},A9=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return I9(Object.entries(e.classGroups),n).forEach(([i,a])=>{pb(a,r,i,t)}),r},pb=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:C2(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(T9(s)){pb(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{pb(a,C2(t,i),n,r)})})},C2=(e,t)=>{let n=e;return t.split(fw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},T9=e=>e.isThemeGetter,I9=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,c])=>[t+a,c])):i);return[n,s]}):e,M9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},gR="!",R9=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,a=c=>{const d=[];let f=0,p=0,h;for(let v=0;v<c.length;v++){let N=c[v];if(f===0){if(N===s&&(r||c.slice(v,v+i)===t)){d.push(c.slice(p,v)),p=v+i;continue}if(N==="/"){h=v;continue}}N==="["?f++:N==="]"&&f--}const g=d.length===0?c:c.substring(p),y=g.startsWith(gR),w=y?g.substring(1):g,b=h&&h>p?h-p:void 0;return{modifiers:d,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:a}):a},O9=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},P9=e=>({cache:M9(e.cacheSize),parseClassName:R9(e),...E9(e)}),L9=/\s+/,D9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],a=e.trim().split(L9);let c="";for(let d=a.length-1;d>=0;d-=1){const f=a[d],{modifiers:p,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:y}=n(f);let w=!!y,b=r(w?g.substring(0,y):g);if(!b){if(!w){c=f+(c.length>0?" "+c:c);continue}if(b=r(g),!b){c=f+(c.length>0?" "+c:c);continue}w=!1}const v=O9(p).join(":"),N=h?v+gR:v,S=N+b;if(i.includes(S))continue;i.push(S);const k=s(b,w);for(let _=0;_<k.length;++_){const A=k[_];i.push(N+A)}c=f+(c.length>0?" "+c:c)}return c};function $9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=yR(t))&&(r&&(r+=" "),r+=n);return r}const yR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=yR(e[r]))&&(n&&(n+=" "),n+=t);return n};function F9(e,...t){let n,r,s,i=a;function a(d){const f=t.reduce((p,h)=>h(p),e());return n=P9(f),r=n.cache.get,s=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const p=D9(d,n);return s(d,p),p}return function(){return i($9.apply(null,arguments))}}const et=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},xR=/^\[(?:([a-z-]+):)?(.+)\]$/i,q9=/^\d+\/\d+$/,B9=new Set(["px","full","screen"]),z9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V9=/\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$/,H9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,U9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gr=e=>Po(e)||B9.has(e)||q9.test(e),Is=e=>ta(e,"length",eV),Po=e=>!!e&&!Number.isNaN(Number(e)),om=e=>ta(e,"number",Po),nl=e=>!!e&&Number.isInteger(Number(e)),K9=e=>e.endsWith("%")&&Po(e.slice(0,-1)),Oe=e=>xR.test(e),Ms=e=>z9.test(e),G9=new Set(["length","size","percentage"]),Y9=e=>ta(e,G9,vR),X9=e=>ta(e,"position",vR),Q9=new Set(["image","url"]),J9=e=>ta(e,Q9,nV),Z9=e=>ta(e,"",tV),rl=()=>!0,ta=(e,t,n)=>{const r=xR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},eV=e=>V9.test(e)&&!H9.test(e),vR=()=>!1,tV=e=>U9.test(e),nV=e=>W9.test(e),rV=()=>{const e=et("colors"),t=et("spacing"),n=et("blur"),r=et("brightness"),s=et("borderColor"),i=et("borderRadius"),a=et("borderSpacing"),c=et("borderWidth"),d=et("contrast"),f=et("grayscale"),p=et("hueRotate"),h=et("invert"),g=et("gap"),y=et("gradientColorStops"),w=et("gradientColorStopPositions"),b=et("inset"),v=et("margin"),N=et("opacity"),S=et("padding"),k=et("saturate"),_=et("scale"),A=et("sepia"),I=et("skew"),T=et("space"),O=et("translate"),L=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Oe,t],P=()=>[Oe,t],H=()=>["",Gr,Is],D=()=>["auto",Po,Oe],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",Oe],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[Po,Oe];return{cacheSize:500,separator:":",theme:{colors:[rl],spacing:[Gr,Is],blur:["none","",Ms,Oe],brightness:$(),borderColor:[e],borderRadius:["none","","full",Ms,Oe],borderSpacing:P(),borderWidth:H(),contrast:$(),grayscale:F(),hueRotate:$(),invert:F(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[K9,Is],inset:M(),margin:M(),opacity:$(),padding:P(),saturate:$(),scale:$(),sepia:F(),skew:$(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",Oe]}],container:["container"],columns:[{columns:[Ms]}],"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:[...z(),Oe]}],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:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",nl,Oe]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Oe]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",nl,Oe]}],"grid-cols":[{"grid-cols":[rl]}],"col-start-end":[{col:["auto",{span:["full",nl,Oe]},Oe]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[rl]}],"row-start-end":[{row:["auto",{span:[nl,Oe]},Oe]}],"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",Oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Oe]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Oe,t]}],"min-w":[{"min-w":[Oe,t,"min","max","fit"]}],"max-w":[{"max-w":[Oe,t,"none","full","min","max","fit","prose",{screen:[Ms]},Ms]}],h:[{h:[Oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ms,Is]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",om]}],"font-family":[{font:[rl]}],"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",Oe]}],"line-clamp":[{"line-clamp":["none",Po,om]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gr,Oe]}],"list-image":[{"list-image":["none",Oe]}],"list-style-type":[{list:["none","disc","decimal",Oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gr,Is]}],"underline-offset":[{"underline-offset":["auto",Gr,Oe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe]}],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",Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),X9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Y9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},J9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[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":[N]}],"border-style":[{border:[...V(),"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":[N]}],"divide-style":[{divide:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[Gr,Oe]}],"outline-w":[{outline:[Gr,Is]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Gr,Is]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ms,Z9]}],"shadow-color":[{shadow:[rl]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ms,Oe]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[h]}],saturate:[{saturate:[k]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"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",Oe]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",Oe]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",Oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[nl,Oe]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Oe]}],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",Oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Gr,Is,om]}],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"]}}},sV=F9(rV);function Ue(...e){return sV(_9(e))}function iV({label:e,data:t,variant:n="output",className:r}){const[s,i]=E.useState(!1),[a,c]=E.useState(!1);if(t==null)return null;const d=oV(t),f=typeof t=="object",p=async h=>{h.stopPropagation();try{await navigator.clipboard.writeText(typeof t=="string"?t:JSON.stringify(t,null,2)),c(!0),setTimeout(()=>c(!1),2e3)}catch{}};return u.jsxs("div",{className:Ue("mt-1",r),children:[u.jsxs("button",{onClick:h=>{h.stopPropagation(),f&&i(!s)},className:Ue("flex items-center gap-1.5 px-2 py-1 rounded text-xs w-full text-left transition-colors",n==="input"?"bg-blue-500/10 text-blue-400":"bg-success/10 text-success"),children:[f&&(s?u.jsx(Sr,{className:"w-3 h-3 flex-shrink-0"}):u.jsx(It,{className:"w-3 h-3 flex-shrink-0"})),u.jsxs("span",{className:"font-medium flex-shrink-0",children:[e,":"]}),u.jsx("span",{className:"truncate font-mono opacity-75",children:d}),u.jsx("button",{onClick:p,className:"ml-auto flex-shrink-0 p-0.5 rounded hover:bg-white/10",title:"Copy value",children:a?u.jsx(Vs,{className:"w-3 h-3"}):u.jsx(ji,{className:"w-3 h-3 opacity-50"})})]}),s&&f&&u.jsx("pre",{className:"mt-1 px-2 py-1.5 bg-bg-surface rounded text-xs font-mono text-text-secondary overflow-x-auto max-h-[120px] overflow-y-auto",children:JSON.stringify(t,null,2)})]})}function oV(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e.length>40?e.slice(0,40)+"...":e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[${e.length} items]`;if(typeof e=="object"){const t=Object.keys(e);return`{${t.slice(0,3).join(", ")}${t.length>3?", ...":""}}`}return String(e)}const _2=E.memo(iV);function Te(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 E2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hw(...e){return t=>{let n=!1;const r=e.map(s=>{const i=E2(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():E2(e[s],null)}}}}function kt(...e){return E.useCallback(hw(...e),e)}function aV(e,t){const n=E.createContext(t),r=i=>{const{children:a,...c}=i,d=E.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function s(i){const a=E.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function Ks(e,t=[]){let n=[];function r(i,a){const c=E.createContext(a),d=n.length;n=[...n,a];const f=h=>{var N;const{scope:g,children:y,...w}=h,b=((N=g==null?void 0:g[e])==null?void 0:N[d])||c,v=E.useMemo(()=>w,Object.values(w));return u.jsx(b.Provider,{value:v,children:y})};f.displayName=i+"Provider";function p(h,g){var b;const y=((b=g==null?void 0:g[e])==null?void 0:b[d])||c,w=E.useContext(y);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[f,p]}const s=()=>{const i=n.map(a=>E.createContext(a));return function(c){const d=(c==null?void 0:c[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,lV(s,...t)]}function lV(...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(i){const a=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(i)[`__scope${f}`];return{...c,...h}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ll(e){const t=cV(e),n=E.forwardRef((r,s)=>{const{children:i,...a}=r,c=E.Children.toArray(i),d=c.find(dV);if(d){const f=d.props.children,p=c.map(h=>h===d?E.Children.count(f)>1?E.Children.only(null):E.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:s,children:E.isValidElement(f)?E.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function cV(e){const t=E.forwardRef((n,r)=>{const{children:s,...i}=n;if(E.isValidElement(s)){const a=hV(s),c=fV(i,s.props);return s.type!==E.Fragment&&(c.ref=r?hw(r,a):a),E.cloneElement(s,c)}return E.Children.count(s)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bR=Symbol("radix.slottable");function uV(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=bR,t}function dV(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bR}function fV(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function hV(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 pV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qe=pV.reduce((e,t)=>{const n=Ll(`Primitive.${t}`),r=E.forwardRef((s,i)=>{const{asChild:a,...c}=s,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wR(e,t){e&&lw.flushSync(()=>e.dispatchEvent(t))}function Tr(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function mV(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e);E.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 gV="DismissableLayer",mb="dismissableLayer.update",yV="dismissableLayer.pointerDownOutside",xV="dismissableLayer.focusOutside",j2,NR=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),af=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...d}=e,f=E.useContext(NR),[p,h]=E.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=E.useState({}),w=kt(t,T=>h(T)),b=Array.from(f.layers),[v]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(v),S=p?b.indexOf(p):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,_=S>=N,A=wV(T=>{const O=T.target,L=[...f.branches].some(B=>B.contains(O));!_||L||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},g),I=NV(T=>{const O=T.target;[...f.branches].some(B=>B.contains(O))||(i==null||i(T),a==null||a(T),T.defaultPrevented||c==null||c())},g);return mV(T=>{S===f.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),E.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(j2=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),A2(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=j2)}},[p,g,n,f]),E.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),A2())},[p,f]),E.useEffect(()=>{const T=()=>y({});return document.addEventListener(mb,T),()=>document.removeEventListener(mb,T)},[]),u.jsx(Qe.div,{...d,ref:w,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,A.onPointerDownCapture)})});af.displayName=gV;var vV="DismissableLayerBranch",bV=E.forwardRef((e,t)=>{const n=E.useContext(NR),r=E.useRef(null),s=kt(t,r);return E.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),u.jsx(Qe.div,{...e,ref:s})});bV.displayName=vV;function wV(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e),r=E.useRef(!1),s=E.useRef(()=>{});return E.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){kR(yV,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function NV(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e),r=E.useRef(!1);return E.useEffect(()=>{const s=i=>{i.target&&!r.current&&kR(xV,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function A2(){const e=new CustomEvent(mb);document.dispatchEvent(e)}function kR(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?wR(s,i):s.dispatchEvent(i)}var Hs=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},kV=oI[" useId ".trim().toString()]||(()=>{}),SV=0;function Lo(e){const[t,n]=E.useState(kV());return Hs(()=>{n(r=>r??String(SV++))},[e]),t?`radix-${t}`:""}const CV=["top","right","bottom","left"],Us=Math.min,hn=Math.max,Id=Math.round,Fu=Math.floor,Er=e=>({x:e,y:e}),_V={left:"right",right:"left",bottom:"top",top:"bottom"},EV={start:"end",end:"start"};function gb(e,t,n){return hn(e,Us(t,n))}function ts(e,t){return typeof e=="function"?e(t):e}function ns(e){return e.split("-")[0]}function na(e){return e.split("-")[1]}function pw(e){return e==="x"?"y":"x"}function mw(e){return e==="y"?"height":"width"}const jV=new Set(["top","bottom"]);function wr(e){return jV.has(ns(e))?"y":"x"}function gw(e){return pw(wr(e))}function AV(e,t,n){n===void 0&&(n=!1);const r=na(e),s=gw(e),i=mw(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Md(a)),[a,Md(a)]}function TV(e){const t=Md(e);return[yb(e),t,yb(t)]}function yb(e){return e.replace(/start|end/g,t=>EV[t])}const T2=["left","right"],I2=["right","left"],IV=["top","bottom"],MV=["bottom","top"];function RV(e,t,n){switch(e){case"top":case"bottom":return n?t?I2:T2:t?T2:I2;case"left":case"right":return t?IV:MV;default:return[]}}function OV(e,t,n,r){const s=na(e);let i=RV(ns(e),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(yb)))),i}function Md(e){return e.replace(/left|right|bottom|top/g,t=>_V[t])}function PV(e){return{top:0,right:0,bottom:0,left:0,...e}}function SR(e){return typeof e!="number"?PV(e):{top:e,right:e,bottom:e,left:e}}function Rd(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 M2(e,t,n){let{reference:r,floating:s}=e;const i=wr(t),a=gw(t),c=mw(a),d=ns(t),f=i==="y",p=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-s.width,y:h};break;default:y={x:r.x,y:r.y}}switch(na(t)){case"start":y[a]-=g*(n&&f?-1:1);break;case"end":y[a]+=g*(n&&f?-1:1);break}return y}const LV=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:h}=M2(f,r,d),g=r,y={},w=0;for(let b=0;b<c.length;b++){const{name:v,fn:N}=c[b],{x:S,y:k,data:_,reset:A}=await N({x:p,y:h,initialPlacement:r,placement:g,strategy:s,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=S??p,h=k??h,y={...y,[v]:{...y[v],..._}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:p,y:h}=M2(f,g,d)),b=-1)}return{x:p,y:h,placement:g,strategy:s,middlewareData:y}};async function Dl(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:g=!1,padding:y=0}=ts(t,e),w=SR(y),v=c[g?h==="floating"?"reference":"floating":h],N=Rd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),S=h==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),_=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},A=Rd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:k,strategy:d}):S);return{top:(N.top-A.top+w.top)/_.y,bottom:(A.bottom-N.bottom+w.bottom)/_.y,left:(N.left-A.left+w.left)/_.x,right:(A.right-N.right+w.right)/_.x}}const DV=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=ts(e,t)||{};if(f==null)return{};const h=SR(p),g={x:n,y:r},y=gw(s),w=mw(y),b=await a.getDimensions(f),v=y==="y",N=v?"top":"left",S=v?"bottom":"right",k=v?"clientHeight":"clientWidth",_=i.reference[w]+i.reference[y]-g[y]-i.floating[w],A=g[y]-i.reference[y],I=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let T=I?I[k]:0;(!T||!await(a.isElement==null?void 0:a.isElement(I)))&&(T=c.floating[k]||i.floating[w]);const O=_/2-A/2,L=T/2-b[w]/2-1,B=Us(h[N],L),M=Us(h[S],L),P=B,H=T-b[w]-M,D=T/2-b[w]/2+O,z=gb(P,D,H),V=!d.arrow&&na(s)!=null&&D!==z&&i.reference[w]/2-(D<P?B:M)-b[w]/2<0,G=V?D<P?D-P:D-H:0;return{[y]:g[y]+G,data:{[y]:z,centerOffset:D-z-G,...V&&{alignmentOffset:G}},reset:V}}}),$V=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:b=!0,...v}=ts(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const N=ns(s),S=wr(c),k=ns(c)===c,_=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=g||(k||!b?[Md(c)]:TV(c)),I=w!=="none";!g&&I&&A.push(...OV(c,b,w,_));const T=[c,...A],O=await Dl(t,v),L=[];let B=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&L.push(O[N]),h){const D=AV(s,a,_);L.push(O[D[0]],O[D[1]])}if(B=[...B,{placement:s,overflows:L}],!L.every(D=>D<=0)){var M,P;const D=(((M=i.flip)==null?void 0:M.index)||0)+1,z=T[D];if(z&&(!(h==="alignment"?S!==wr(z):!1)||B.every(q=>wr(q.placement)===S?q.overflows[0]>0:!0)))return{data:{index:D,overflows:B},reset:{placement:z}};let V=(P=B.filter(G=>G.overflows[0]<=0).sort((G,q)=>G.overflows[1]-q.overflows[1])[0])==null?void 0:P.placement;if(!V)switch(y){case"bestFit":{var H;const G=(H=B.filter(q=>{if(I){const F=wr(q.placement);return F===S||F==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((q,F)=>q[1]-F[1])[0])==null?void 0:H[0];G&&(V=G);break}case"initialPlacement":V=c;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function R2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O2(e){return CV.some(t=>e[t]>=0)}const FV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=ts(e,t);switch(r){case"referenceHidden":{const i=await Dl(t,{...s,elementContext:"reference"}),a=R2(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:O2(a)}}}case"escaped":{const i=await Dl(t,{...s,altBoundary:!0}),a=R2(i,n.floating);return{data:{escapedOffsets:a,escaped:O2(a)}}}default:return{}}}}},CR=new Set(["left","top"]);async function qV(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=ns(n),c=na(n),d=wr(n)==="y",f=CR.has(a)?-1:1,p=i&&d?-1:1,h=ts(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(y=c==="end"?w*-1:w),d?{x:y*p,y:g*f}:{x:g*f,y:y*p}}const BV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:a,middlewareData:c}=t,d=await qV(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:i+d.y,data:{...d,placement:a}}}}},zV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:N,y:S}=v;return{x:N,y:S}}},...d}=ts(e,t),f={x:n,y:r},p=await Dl(t,d),h=wr(ns(s)),g=pw(h);let y=f[g],w=f[h];if(i){const v=g==="y"?"top":"left",N=g==="y"?"bottom":"right",S=y+p[v],k=y-p[N];y=gb(S,y,k)}if(a){const v=h==="y"?"top":"left",N=h==="y"?"bottom":"right",S=w+p[v],k=w-p[N];w=gb(S,w,k)}const b=c.fn({...t,[g]:y,[h]:w});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:i,[h]:a}}}}}},VV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=ts(e,t),p={x:n,y:r},h=wr(s),g=pw(h);let y=p[g],w=p[h];const b=ts(c,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const k=g==="y"?"height":"width",_=i.reference[g]-i.floating[k]+v.mainAxis,A=i.reference[g]+i.reference[k]-v.mainAxis;y<_?y=_:y>A&&(y=A)}if(f){var N,S;const k=g==="y"?"width":"height",_=CR.has(ns(s)),A=i.reference[h]-i.floating[k]+(_&&((N=a.offset)==null?void 0:N[h])||0)+(_?0:v.crossAxis),I=i.reference[h]+i.reference[k]+(_?0:((S=a.offset)==null?void 0:S[h])||0)-(_?v.crossAxis:0);w<A?w=A:w>I&&(w=I)}return{[g]:y,[h]:w}}}},HV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:a,elements:c}=t,{apply:d=()=>{},...f}=ts(e,t),p=await Dl(t,f),h=ns(s),g=na(s),y=wr(s)==="y",{width:w,height:b}=i.floating;let v,N;h==="top"||h==="bottom"?(v=h,N=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(N=h,v=g==="end"?"top":"bottom");const S=b-p.top-p.bottom,k=w-p.left-p.right,_=Us(b-p[v],S),A=Us(w-p[N],k),I=!t.middlewareData.shift;let T=_,O=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=S),I&&!g){const B=hn(p.left,0),M=hn(p.right,0),P=hn(p.top,0),H=hn(p.bottom,0);y?O=w-2*(B!==0||M!==0?B+M:hn(p.left,p.right)):T=b-2*(P!==0||H!==0?P+H:hn(p.top,p.bottom))}await d({...t,availableWidth:O,availableHeight:T});const L=await a.getDimensions(c.floating);return w!==L.width||b!==L.height?{reset:{rects:!0}}:{}}}};function lf(){return typeof window<"u"}function ra(e){return _R(e)?(e.nodeName||"").toLowerCase():"#document"}function gn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pr(e){var t;return(t=(_R(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _R(e){return lf()?e instanceof Node||e instanceof gn(e).Node:!1}function er(e){return lf()?e instanceof Element||e instanceof gn(e).Element:!1}function Ir(e){return lf()?e instanceof HTMLElement||e instanceof gn(e).HTMLElement:!1}function P2(e){return!lf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gn(e).ShadowRoot}const UV=new Set(["inline","contents"]);function nc(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!UV.has(s)}const WV=new Set(["table","td","th"]);function KV(e){return WV.has(ra(e))}const GV=[":popover-open",":modal"];function cf(e){return GV.some(t=>{try{return e.matches(t)}catch{return!1}})}const YV=["transform","translate","scale","rotate","perspective"],XV=["transform","translate","scale","rotate","perspective","filter"],QV=["paint","layout","strict","content"];function yw(e){const t=xw(),n=er(e)?tr(e):e;return YV.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)||XV.some(r=>(n.willChange||"").includes(r))||QV.some(r=>(n.contain||"").includes(r))}function JV(e){let t=Ws(e);for(;Ir(t)&&!Yo(t);){if(yw(t))return t;if(cf(t))return null;t=Ws(t)}return null}function xw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ZV=new Set(["html","body","#document"]);function Yo(e){return ZV.has(ra(e))}function tr(e){return gn(e).getComputedStyle(e)}function uf(e){return er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ws(e){if(ra(e)==="html")return e;const t=e.assignedSlot||e.parentNode||P2(e)&&e.host||Pr(e);return P2(t)?t.host:t}function ER(e){const t=Ws(e);return Yo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ir(t)&&nc(t)?t:ER(t)}function $l(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=ER(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),a=gn(s);if(i){const c=xb(a);return t.concat(a,a.visualViewport||[],nc(s)?s:[],c&&n?$l(c):[])}return t.concat(s,$l(s,[],n))}function xb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jR(e){const t=tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Ir(e),i=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=Id(n)!==i||Id(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function vw(e){return er(e)?e:e.contextElement}function Do(e){const t=vw(e);if(!Ir(t))return Er(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=jR(t);let a=(i?Id(n.width):n.width)/r,c=(i?Id(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const e7=Er(0);function AR(e){const t=gn(e);return!xw()||!t.visualViewport?e7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function t7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gn(e)?!1:t}function Ti(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=vw(e);let a=Er(1);t&&(r?er(r)&&(a=Do(r)):a=Do(e));const c=t7(i,n,r)?AR(i):Er(0);let d=(s.left+c.x)/a.x,f=(s.top+c.y)/a.y,p=s.width/a.x,h=s.height/a.y;if(i){const g=gn(i),y=r&&er(r)?gn(r):r;let w=g,b=xb(w);for(;b&&r&&y!==w;){const v=Do(b),N=b.getBoundingClientRect(),S=tr(b),k=N.left+(b.clientLeft+parseFloat(S.paddingLeft))*v.x,_=N.top+(b.clientTop+parseFloat(S.paddingTop))*v.y;d*=v.x,f*=v.y,p*=v.x,h*=v.y,d+=k,f+=_,w=gn(b),b=xb(w)}}return Rd({width:p,height:h,x:d,y:f})}function df(e,t){const n=uf(e).scrollLeft;return t?t.left+n:Ti(Pr(e)).left+n}function TR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-df(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 i=s==="fixed",a=Pr(r),c=t?cf(t.floating):!1;if(r===a||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=Er(1);const p=Er(0),h=Ir(r);if((h||!h&&!i)&&((ra(r)!=="body"||nc(a))&&(d=uf(r)),Ir(r))){const y=Ti(r);f=Do(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const g=a&&!h&&!i?TR(a,d):Er(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+g.x,y:n.y*f.y-d.scrollTop*f.y+p.y+g.y}}function r7(e){return Array.from(e.getClientRects())}function s7(e){const t=Pr(e),n=uf(e),r=e.ownerDocument.body,s=hn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=hn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+df(e);const c=-n.scrollTop;return tr(r).direction==="rtl"&&(a+=hn(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:c}}const L2=25;function i7(e,t){const n=gn(e),r=Pr(e),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,d=0;if(s){i=s.width,a=s.height;const p=xw();(!p||p&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=df(r);if(f<=0){const p=r.ownerDocument,h=p.body,g=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-y);w<=L2&&(i-=w)}else f<=L2&&(i+=f);return{width:i,height:a,x:c,y:d}}const o7=new Set(["absolute","fixed"]);function a7(e,t){const n=Ti(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Ir(e)?Do(e):Er(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,d=s*i.x,f=r*i.y;return{width:a,height:c,x:d,y:f}}function D2(e,t,n){let r;if(t==="viewport")r=i7(e,n);else if(t==="document")r=s7(Pr(e));else if(er(t))r=a7(t,n);else{const s=AR(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Rd(r)}function IR(e,t){const n=Ws(e);return n===t||!er(n)||Yo(n)?!1:tr(n).position==="fixed"||IR(n,t)}function l7(e,t){const n=t.get(e);if(n)return n;let r=$l(e,[],!1).filter(c=>er(c)&&ra(c)!=="body"),s=null;const i=tr(e).position==="fixed";let a=i?Ws(e):e;for(;er(a)&&!Yo(a);){const c=tr(a),d=yw(a);!d&&c.position==="fixed"&&(s=null),(i?!d&&!s:!d&&c.position==="static"&&!!s&&o7.has(s.position)||nc(a)&&!d&&IR(e,a))?r=r.filter(p=>p!==a):s=c,a=Ws(a)}return t.set(e,r),r}function c7(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?cf(t)?[]:l7(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,p)=>{const h=D2(t,p,s);return f.top=hn(h.top,f.top),f.right=Us(h.right,f.right),f.bottom=Us(h.bottom,f.bottom),f.left=hn(h.left,f.left),f},D2(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function u7(e){const{width:t,height:n}=jR(e);return{width:t,height:n}}function d7(e,t,n){const r=Ir(t),s=Pr(t),i=n==="fixed",a=Ti(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=Er(0);function f(){d.x=df(s)}if(r||!r&&!i)if((ra(t)!=="body"||nc(s))&&(c=uf(t)),r){const y=Ti(t,!0,i,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else s&&f();i&&!r&&s&&f();const p=s&&!r&&!i?TR(s,c):Er(0),h=a.left+c.scrollLeft-d.x-p.x,g=a.top+c.scrollTop-d.y-p.y;return{x:h,y:g,width:a.width,height:a.height}}function am(e){return tr(e).position==="static"}function $2(e,t){if(!Ir(e)||tr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pr(e)===n&&(n=n.ownerDocument.body),n}function MR(e,t){const n=gn(e);if(cf(e))return n;if(!Ir(e)){let s=Ws(e);for(;s&&!Yo(s);){if(er(s)&&!am(s))return s;s=Ws(s)}return n}let r=$2(e,t);for(;r&&KV(r)&&am(r);)r=$2(r,t);return r&&Yo(r)&&am(r)&&!yw(r)?n:r||JV(e)||n}const f7=async function(e){const t=this.getOffsetParent||MR,n=this.getDimensions,r=await n(e.floating);return{reference:d7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function h7(e){return tr(e).direction==="rtl"}const p7={convertOffsetParentRelativeRectToViewportRelativeRect:n7,getDocumentElement:Pr,getClippingRect:c7,getOffsetParent:MR,getElementRects:f7,getClientRects:r7,getDimensions:u7,getScale:Do,isElement:er,isRTL:h7};function RR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function m7(e,t){let n=null,r;const s=Pr(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:p,top:h,width:g,height:y}=f;if(c||t(),!g||!y)return;const w=Fu(h),b=Fu(s.clientWidth-(p+g)),v=Fu(s.clientHeight-(h+y)),N=Fu(p),k={rootMargin:-w+"px "+-b+"px "+-v+"px "+-N+"px",threshold:hn(0,Us(1,d))||1};let _=!0;function A(I){const T=I[0].intersectionRatio;if(T!==d){if(!_)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!RR(f,e.getBoundingClientRect())&&a(),_=!1}try{n=new IntersectionObserver(A,{...k,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,k)}n.observe(e)}return a(!0),i}function g7(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=vw(e),p=s||i?[...f?$l(f):[],...$l(t)]:[];p.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const h=f&&c?m7(f,n):null;let g=-1,y=null;a&&(y=new ResizeObserver(N=>{let[S]=N;S&&S.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var k;(k=y)==null||k.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let w,b=d?Ti(e):null;d&&v();function v(){const N=Ti(e);b&&!RR(b,N)&&n(),b=N,w=requestAnimationFrame(v)}return n(),()=>{var N;p.forEach(S=>{s&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),h==null||h(),(N=y)==null||N.disconnect(),y=null,d&&cancelAnimationFrame(w)}}const y7=BV,x7=zV,v7=$V,b7=HV,w7=FV,F2=DV,N7=VV,k7=(e,t,n)=>{const r=new Map,s={platform:p7,...n},i={...s.platform,_c:r};return LV(e,t,{...s,platform:i})};var S7=typeof document<"u",C7=function(){},cd=S7?E.useLayoutEffect:C7;function Od(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(!Od(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 i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Od(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function OR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function q2(e,t){const n=OR(e);return Math.round(t*n)/n}function lm(e){const t=E.useRef(e);return cd(()=>{t.current=e}),t}function _7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,h]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=E.useState(r);Od(g,r)||y(r);const[w,b]=E.useState(null),[v,N]=E.useState(null),S=E.useCallback(q=>{q!==I.current&&(I.current=q,b(q))},[]),k=E.useCallback(q=>{q!==T.current&&(T.current=q,N(q))},[]),_=i||w,A=a||v,I=E.useRef(null),T=E.useRef(null),O=E.useRef(p),L=d!=null,B=lm(d),M=lm(s),P=lm(f),H=E.useCallback(()=>{if(!I.current||!T.current)return;const q={placement:t,strategy:n,middleware:g};M.current&&(q.platform=M.current),k7(I.current,T.current,q).then(F=>{const Y={...F,isPositioned:P.current!==!1};D.current&&!Od(O.current,Y)&&(O.current=Y,lw.flushSync(()=>{h(Y)}))})},[g,t,n,M,P]);cd(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,h(q=>({...q,isPositioned:!1})))},[f]);const D=E.useRef(!1);cd(()=>(D.current=!0,()=>{D.current=!1}),[]),cd(()=>{if(_&&(I.current=_),A&&(T.current=A),_&&A){if(B.current)return B.current(_,A,H);H()}},[_,A,H,B,L]);const z=E.useMemo(()=>({reference:I,floating:T,setReference:S,setFloating:k}),[S,k]),V=E.useMemo(()=>({reference:_,floating:A}),[_,A]),G=E.useMemo(()=>{const q={position:n,left:0,top:0};if(!V.floating)return q;const F=q2(V.floating,p.x),Y=q2(V.floating,p.y);return c?{...q,transform:"translate("+F+"px, "+Y+"px)",...OR(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Y}},[n,c,V.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:H,refs:z,elements:V,floatingStyles:G}),[p,H,z,V,G])}const E7=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?F2({element:r.current,padding:s}).fn(n):{}:r?F2({element:r,padding:s}).fn(n):{}}}},j7=(e,t)=>({...y7(e),options:[e,t]}),A7=(e,t)=>({...x7(e),options:[e,t]}),T7=(e,t)=>({...N7(e),options:[e,t]}),I7=(e,t)=>({...v7(e),options:[e,t]}),M7=(e,t)=>({...b7(e),options:[e,t]}),R7=(e,t)=>({...w7(e),options:[e,t]}),O7=(e,t)=>({...E7(e),options:[e,t]});var P7="Arrow",PR=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return u.jsx(Qe.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});PR.displayName=P7;var L7=PR;function D7(e){const[t,n]=E.useState(void 0);return Hs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,c;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.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 bw="Popper",[LR,ff]=Ks(bw),[$7,DR]=LR(bw),$R=e=>{const{__scopePopper:t,children:n}=e,[r,s]=E.useState(null);return u.jsx($7,{scope:t,anchor:r,onAnchorChange:s,children:n})};$R.displayName=bw;var FR="PopperAnchor",qR=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=DR(FR,n),a=E.useRef(null),c=kt(t,a),d=E.useRef(null);return E.useEffect(()=>{const f=d.current;d.current=(r==null?void 0:r.current)||a.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:u.jsx(Qe.div,{...s,ref:c})});qR.displayName=FR;var ww="PopperContent",[F7,q7]=LR(ww),BR=E.forwardRef((e,t)=>{var ee,se,ae,ne,le,he;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:w,...b}=e,v=DR(ww,n),[N,S]=E.useState(null),k=kt(t,pe=>S(pe)),[_,A]=E.useState(null),I=D7(_),T=(I==null?void 0:I.width)??0,O=(I==null?void 0:I.height)??0,L=r+(i!=="center"?"-"+i:""),B=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},M=Array.isArray(f)?f:[f],P=M.length>0,H={padding:B,boundary:M.filter(z7),altBoundary:P},{refs:D,floatingStyles:z,placement:V,isPositioned:G,middlewareData:q}=_7({strategy:"fixed",placement:L,whileElementsMounted:(...pe)=>g7(...pe,{animationFrame:y==="always"}),elements:{reference:v.anchor},middleware:[j7({mainAxis:s+O,alignmentAxis:a}),d&&A7({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?T7():void 0,...H}),d&&I7({...H}),M7({...H,apply:({elements:pe,rects:ve,availableWidth:xe,availableHeight:Ae})=>{const{width:Se,height:Ge}=ve.reference,Ve=pe.floating.style;Ve.setProperty("--radix-popper-available-width",`${xe}px`),Ve.setProperty("--radix-popper-available-height",`${Ae}px`),Ve.setProperty("--radix-popper-anchor-width",`${Se}px`),Ve.setProperty("--radix-popper-anchor-height",`${Ge}px`)}}),_&&O7({element:_,padding:c}),V7({arrowWidth:T,arrowHeight:O}),g&&R7({strategy:"referenceHidden",...H})]}),[F,Y]=HR(V),$=Tr(w);Hs(()=>{G&&($==null||$())},[G,$]);const K=(ee=q.arrow)==null?void 0:ee.x,ie=(se=q.arrow)==null?void 0:se.y,U=((ae=q.arrow)==null?void 0:ae.centerOffset)!==0,[Q,Z]=E.useState();return Hs(()=>{N&&Z(window.getComputedStyle(N).zIndex)},[N]),u.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:G?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ne=q.transformOrigin)==null?void 0:ne.x,(le=q.transformOrigin)==null?void 0:le.y].join(" "),...((he=q.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(F7,{scope:n,placedSide:F,onArrowChange:A,arrowX:K,arrowY:ie,shouldHideArrow:U,children:u.jsx(Qe.div,{"data-side":F,"data-align":Y,...b,ref:k,style:{...b.style,animation:G?void 0:"none"}})})})});BR.displayName=ww;var zR="PopperArrow",B7={top:"bottom",right:"left",bottom:"top",left:"right"},VR=E.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=q7(zR,r),a=B7[i.placedSide];return u.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:u.jsx(L7,{...s,ref:n,style:{...s.style,display:"block"}})})});VR.displayName=zR;function z7(e){return e!==null}var V7=e=>({name:"transformOrigin",options:e,fn(t){var v,N,S;const{placement:n,rects:r,middlewareData:s}=t,a=((v=s.arrow)==null?void 0:v.centerOffset)!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,p]=HR(n),h={start:"0%",center:"50%",end:"100%"}[p],g=(((N=s.arrow)==null?void 0:N.x)??0)+c/2,y=(((S=s.arrow)==null?void 0:S.y)??0)+d/2;let w="",b="";return f==="bottom"?(w=a?h:`${g}px`,b=`${-d}px`):f==="top"?(w=a?h:`${g}px`,b=`${r.floating.height+d}px`):f==="right"?(w=`${-d}px`,b=a?h:`${y}px`):f==="left"&&(w=`${r.floating.width+d}px`,b=a?h:`${y}px`),{data:{x:w,y:b}}}});function HR(e){const[t,n="center"]=e.split("-");return[t,n]}var UR=$R,WR=qR,KR=BR,GR=VR,H7="Portal",hf=E.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,i]=E.useState(!1);Hs(()=>i(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Xq.createPortal(u.jsx(Qe.div,{...r,ref:t}),a):null});hf.displayName=H7;function U7(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var ir=e=>{const{present:t,children:n}=e,r=W7(t),s=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=kt(r.ref,K7(s));return typeof n=="function"||r.isPresent?E.cloneElement(s,{ref:i}):null};ir.displayName="Presence";function W7(e){const[t,n]=E.useState(),r=E.useRef(null),s=E.useRef(e),i=E.useRef("none"),a=e?"mounted":"unmounted",[c,d]=U7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const f=qu(r.current);i.current=c==="mounted"?f:"none"},[c]),Hs(()=>{const f=r.current,p=s.current;if(p!==e){const g=i.current,y=qu(f);e?d("MOUNT"):y==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&g!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Hs(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=y=>{const b=qu(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&b&&(d("ANIMATION_END"),!s.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},g=y=>{y.target===t&&(i.current=qu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:E.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function qu(e){return(e==null?void 0:e.animationName)||"none"}function K7(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 G7=oI[" useInsertionEffect ".trim().toString()]||Hs;function pf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,a]=Y7({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s;{const p=E.useRef(e!==void 0);E.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=E.useCallback(p=>{var h;if(c){const g=X7(p)?p(e):p;g!==e&&((h=a.current)==null||h.call(a,g))}else i(p)},[c,e,i,a]);return[d,f]}function Y7({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),s=E.useRef(n),i=E.useRef(t);return G7(()=>{i.current=t},[t]),E.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function X7(e){return typeof e=="function"}var Q7=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),J7="VisuallyHidden",YR=E.forwardRef((e,t)=>u.jsx(Qe.span,{...e,ref:t,style:{...Q7,...e.style}}));YR.displayName=J7;var Z7=YR,[mf]=Ks("Tooltip",[ff]),gf=ff(),XR="TooltipProvider",eH=700,vb="tooltip.open",[tH,Nw]=mf(XR),QR=e=>{const{__scopeTooltip:t,delayDuration:n=eH,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,a=E.useRef(!0),c=E.useRef(!1),d=E.useRef(0);return E.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(tH,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:E.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};QR.displayName=XR;var Fl="Tooltip",[nH,rc]=mf(Fl),JR=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:c}=e,d=Nw(Fl,e.__scopeTooltip),f=gf(t),[p,h]=E.useState(null),g=Lo(),y=E.useRef(0),w=a??d.disableHoverableContent,b=c??d.delayDuration,v=E.useRef(!1),[N,S]=pf({prop:r,defaultProp:s??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(vb))):d.onClose(),i==null||i(T)},caller:Fl}),k=E.useMemo(()=>N?v.current?"delayed-open":"instant-open":"closed",[N]),_=E.useCallback(()=>{window.clearTimeout(y.current),y.current=0,v.current=!1,S(!0)},[S]),A=E.useCallback(()=>{window.clearTimeout(y.current),y.current=0,S(!1)},[S]),I=E.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{v.current=!0,S(!0),y.current=0},b)},[b,S]);return E.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(UR,{...f,children:u.jsx(nH,{scope:t,contentId:g,open:N,stateAttribute:k,trigger:p,onTriggerChange:h,onTriggerEnter:E.useCallback(()=>{d.isOpenDelayedRef.current?I():_()},[d.isOpenDelayedRef,I,_]),onTriggerLeave:E.useCallback(()=>{w?A():(window.clearTimeout(y.current),y.current=0)},[A,w]),onOpen:_,onClose:A,disableHoverableContent:w,children:n})})};JR.displayName=Fl;var bb="TooltipTrigger",ZR=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=rc(bb,n),i=Nw(bb,n),a=gf(n),c=E.useRef(null),d=kt(t,c,s.onTriggerChange),f=E.useRef(!1),p=E.useRef(!1),h=E.useCallback(()=>f.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(WR,{asChild:!0,...a,children:u.jsx(Qe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:Te(e.onPointerMove,g=>{g.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Te(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});ZR.displayName=bb;var kw="TooltipPortal",[rH,sH]=mf(kw,{forceMount:void 0}),eO=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=rc(kw,t);return u.jsx(rH,{scope:t,forceMount:n,children:u.jsx(ir,{present:n||i.open,children:u.jsx(hf,{asChild:!0,container:s,children:r})})})};eO.displayName=kw;var Xo="TooltipContent",tO=E.forwardRef((e,t)=>{const n=sH(Xo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,a=rc(Xo,e.__scopeTooltip);return u.jsx(ir,{present:r||a.open,children:a.disableHoverableContent?u.jsx(nO,{side:s,...i,ref:t}):u.jsx(iH,{side:s,...i,ref:t})})}),iH=E.forwardRef((e,t)=>{const n=rc(Xo,e.__scopeTooltip),r=Nw(Xo,e.__scopeTooltip),s=E.useRef(null),i=kt(t,s),[a,c]=E.useState(null),{trigger:d,onClose:f}=n,p=s.current,{onPointerInTransitChange:h}=r,g=E.useCallback(()=>{c(null),h(!1)},[h]),y=E.useCallback((w,b)=>{const v=w.currentTarget,N={x:w.clientX,y:w.clientY},S=cH(N,v.getBoundingClientRect()),k=uH(N,S),_=dH(b.getBoundingClientRect()),A=hH([...k,..._]);c(A),h(!0)},[h]);return E.useEffect(()=>()=>g(),[g]),E.useEffect(()=>{if(d&&p){const w=v=>y(v,p),b=v=>y(v,d);return d.addEventListener("pointerleave",w),p.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",b)}}},[d,p,y,g]),E.useEffect(()=>{if(a){const w=b=>{const v=b.target,N={x:b.clientX,y:b.clientY},S=(d==null?void 0:d.contains(v))||(p==null?void 0:p.contains(v)),k=!fH(N,a);S?g():k&&(g(),f())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,p,a,f,g]),u.jsx(nO,{...e,ref:i})}),[oH,aH]=mf(Fl,{isInside:!1}),lH=uV("TooltipContent"),nO=E.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...c}=e,d=rc(Xo,n),f=gf(n),{onClose:p}=d;return E.useEffect(()=>(document.addEventListener(vb,p),()=>document.removeEventListener(vb,p)),[p]),E.useEffect(()=>{if(d.trigger){const h=g=>{const y=g.target;y!=null&&y.contains(d.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,p]),u.jsx(af,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:u.jsxs(KR,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(lH,{children:r}),u.jsx(oH,{scope:n,isInside:!0,children:u.jsx(Z7,{id:d.contentId,role:"tooltip",children:s||r})})]})})});tO.displayName=Xo;var rO="TooltipArrow",sO=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=gf(n);return aH(rO,n).isInside?null:u.jsx(GR,{...s,...r,ref:t})});sO.displayName=rO;function cH(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function uH(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function dH(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function fH(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],d=t[a],f=c.x,p=c.y,h=d.x,g=d.y;p>r!=g>r&&n<(h-f)*(r-p)/(g-p)+f&&(s=!s)}return s}function hH(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),pH(t)}function pH(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var mH=QR,gH=JR,yH=ZR,xH=eO,vH=tO,bH=sO;function wH({children:e,name:t,action:n,status:r="pending",duration:s,error:i,disabled:a=!1}){if(a)return u.jsx(u.Fragment,{children:e});const d={pending:{icon:Ht,color:"text-gray-400",label:"Pending"},running:{icon:Ht,color:"text-warning",label:"Running"},completed:{icon:Mt,color:"text-success",label:"Completed"},failed:{icon:rt,color:"text-error",label:"Failed"},skipped:{icon:Oi,color:"text-gray-500",label:"Skipped"}}[r],f=d.icon;return u.jsx(mH,{delayDuration:400,children:u.jsxs(gH,{children:[u.jsx(yH,{asChild:!0,children:e}),u.jsx(xH,{children:u.jsxs(vH,{side:"top",sideOffset:8,className:"z-50 bg-bg-elevated border border-border-default rounded-lg shadow-xl px-3 py-2 max-w-[280px] animate-in fade-in-0 zoom-in-95",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:t}),n&&u.jsx("div",{className:"text-xs font-mono text-text-secondary",children:n}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(f,{className:Ue("w-3.5 h-3.5",d.color)}),u.jsx("span",{className:Ue("text-xs",d.color),children:d.label}),s!==void 0&&u.jsx("span",{className:"text-xs text-text-muted ml-auto",children:s<1e3?`${s}ms`:`${(s/1e3).toFixed(1)}s`})]}),i&&u.jsx("div",{className:"text-xs text-error bg-error/10 rounded px-2 py-1 truncate",children:i})]}),u.jsx(bH,{className:"fill-bg-elevated"})]})})]})})}const NH=E.memo(wH);function kH({data:e,selected:t}){var f,p;const n=((f=e.action)==null?void 0:f.split(".")[0])||"unknown",r=((p=e.action)==null?void 0:p.split(".").slice(1).join("."))||e.action,s=hb(n),i={pending:{icon:Ht,color:"text-text-muted",bgColor:"bg-gray-400/10"},running:{icon:Pi,color:"text-warning",bgColor:"bg-warning/10",animate:!0},completed:{icon:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:Oi,color:"text-text-muted",bgColor:"bg-gray-500/10"}},a=e.status||"pending",c=i[a],d=c.icon;return u.jsx(NH,{name:e.name||e.id,action:e.action,status:a,duration:e.duration,error:e.error,children:u.jsxs("div",{className:`step-node p-0 ${t?"selected":""} ${a==="running"?"running":""} ${a==="completed"?"completed":""} ${a==="failed"?"failed":""}`,children:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:u.jsx(s,{className:"w-5 h-5 text-primary"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||e.id}),u.jsx("div",{className:"text-xs text-text-secondary truncate",children:n})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${c.bgColor} flex items-center justify-center`,children:u.jsx(d,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3",children:[u.jsx("div",{className:"text-xs text-text-secondary font-mono truncate",children:r}),e.retryCount&&e.retryCount>0&&u.jsxs("div",{className:"mt-2 text-xs text-warning",children:["Retry #",e.retryCount]}),e.error&&u.jsx("div",{className:"mt-2 text-xs text-error truncate",children:e.error}),e.lastInput!==void 0&&u.jsx(_2,{label:"In",data:e.lastInput,variant:"input"}),e.lastOutput!==void 0&&u.jsx(_2,{label:"Out",data:e.lastOutput,variant:"output"})]}),u.jsx(qe,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})})}const SH=E.memo(kH),Sw=xn((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 CH({data:e,selected:t}){const[n,r]=E.useState(!1),{pushWorkflow:s,breadcrumbs:i,setRootWorkflow:a}=Sw(),{loadWorkflow:c,selectedWorkflow:d,currentWorkflow:f}=en(),p=E.useCallback(()=>{var y;i.length===0&&d&&f&&a({id:d,name:((y=f.metadata)==null?void 0:y.name)||"Main Workflow",path:d}),s({id:e.id,name:e.name||e.id,path:e.workflowPath}),c(e.workflowPath)},[e,s,i,a,d,f,c]),h={pending:"border-node-border",running:"border-warning",completed:"border-success",failed:"border-error"},g=e.status||"pending";return u.jsxs("div",{className:`step-node p-0 min-w-[250px] ${t?"selected":""} ${h[g]}`,children:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border bg-info/5",children:[u.jsx("button",{onClick:()=>r(!n),className:"w-6 h-6 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:n?u.jsx(Sr,{className:"w-4 h-4 text-info"}):u.jsx(It,{className:"w-4 h-4 text-info"})}),u.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/10 flex items-center justify-center",children:u.jsx(Ol,{className:"w-5 h-5 text-info"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||e.id}),u.jsx("div",{className:"text-xs text-text-secondary",children:"Sub-workflow"})]}),u.jsx("button",{onClick:p,className:"w-6 h-6 rounded flex items-center justify-center hover:bg-info/20 transition-colors",title:"Drill into sub-workflow",children:u.jsx(Rl,{className:"w-4 h-4 text-info"})})]}),u.jsxs("div",{className:"p-3",children:[u.jsx("div",{className:"text-xs text-text-secondary font-mono truncate",children:e.workflowPath}),e.stepCount!==void 0&&u.jsx("div",{className:"mt-2 flex items-center gap-2",children:u.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-info/10 text-info",children:[e.stepCount," steps"]})})]}),n&&u.jsx("div",{className:"border-t border-node-border p-3 bg-black/20",children:u.jsxs("button",{onClick:p,className:"w-full flex items-center justify-center gap-2 px-3 py-2 bg-info/10 hover:bg-info/20 rounded text-sm text-info transition-colors",children:[u.jsx(Ol,{className:"w-4 h-4"}),"Open Sub-workflow",u.jsx(Rl,{className:"w-4 h-4"})]})}),u.jsx(qe,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"})]})}const _H=E.memo(CH),B2={manual:{icon:Pi,color:"text-primary",bgColor:"bg-primary/10",borderColor:"border-primary",label:"Manual Trigger"},schedule:{icon:cb,color:"text-info",bgColor:"bg-info/10",borderColor:"border-info",label:"Schedule"},webhook:{icon:f9,color:"text-success",bgColor:"bg-success/10",borderColor:"border-success",label:"Webhook"},file:{icon:Ol,color:"text-warning",bgColor:"bg-warning/10",borderColor:"border-warning",label:"File Watcher"},event:{icon:Go,color:"text-purple-400",bgColor:"bg-purple-400/10",borderColor:"border-purple-400",label:"Event"}};function EH({data:e,selected:t}){const n=B2[e.type]||B2.manual,r=n.icon,s=()=>{var i;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((i=e.events)==null?void 0:i.join(", "))||"No events";default:return"Click to run"}};return u.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:[u.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[u.jsx("div",{className:`w-8 h-8 rounded-full ${n.bgColor} flex items-center justify-center`,children:u.jsx(r,{className:`w-4 h-4 ${n.color}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:n.label}),u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||"Trigger"})]}),e.active!==!1&&u.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-pulse",title:"Active"})]}),u.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-secondary font-mono truncate",title:s(),children:s()}),e.lastTriggered&&u.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["Last: ",new Date(e.lastTriggered).toLocaleString()]})]}),u.jsx(qe,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"})]})}const jH=E.memo(EH);function AH({data:e,selected:t}){const n={pending:{icon:Ht,color:"text-text-muted",borderColor:"border-gray-500",bgColor:"bg-gray-500/10"},completed:{icon:Mt,color:"text-success",borderColor:"border-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",borderColor:"border-error",bgColor:"bg-error/10"}},r=e.status||"pending",s=n[r],i=s.icon;return u.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:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"}),u.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[u.jsx("div",{className:`w-8 h-8 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(Pz,{className:`w-4 h-4 ${s.color}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:"Output"}),u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||"Workflow End"})]}),u.jsx(i,{className:`w-4 h-4 ${s.color}`})]}),e.variables&&e.variables.length>0&&u.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-muted mb-1",children:"Output Variables"}),u.jsx("div",{className:"flex flex-wrap gap-1",children:e.variables.map(a=>u.jsx("code",{className:"px-1.5 py-0.5 bg-white/5 text-primary text-xs rounded",children:a},a))})]}),e.description&&u.jsx("div",{className:"px-3 py-2 border-t border-border-subtle",children:u.jsx("div",{className:"text-xs text-text-secondary",children:e.description})}),r==="completed"&&e.result!==void 0&&u.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-muted mb-1",children:"Result"}),u.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 TH=E.memo(AH);function IH({data:e,selected:t}){const n={pending:{icon:Ht,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Td,color:"text-blue-400",bgColor:"bg-blue-400/10",animate:!0},completed:{icon:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:rt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],i=s.icon;return u.jsxs("div",{className:`control-flow-node if-else-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(Td,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"If/Else"}),u.jsx("div",{className:"text-xs text-white/70",children:"Conditional"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(i,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsx("div",{className:"text-xs text-white/90 font-mono mb-3",children:e.condition||"No condition set"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="then"?"bg-green-500/30 text-green-200 ring-1 ring-green-400/50":e.skippedBranch==="then"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✓ Then",e.skippedBranch==="then"&&u.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]}),u.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="else"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":e.skippedBranch==="else"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✗ Else",e.skippedBranch==="else"&&u.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]})]})]}),u.jsx(qe,{type:"source",position:ge.Bottom,id:"then",style:{left:"33%"},className:"!w-3 !h-3 !bg-green-500 !border-2 !border-node-bg"}),u.jsx(qe,{type:"source",position:ge.Bottom,id:"else",style:{left:"67%"},className:"!w-3 !h-3 !bg-red-500 !border-2 !border-node-bg"})]})}const MH=E.memo(IH);function RH({data:e,selected:t}){const n={pending:{icon:Ht,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:g2,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:rt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],i=s.icon;return u.jsxs("div",{className:`control-flow-node for-each-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(g2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"For Each"}),u.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(i,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[u.jsx("span",{className:"text-white/60",children:"Items:"})," ",u.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Variable:"})," ",u.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),e.earlyExit&&u.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[u.jsx(sR,{className:"w-4 h-4 text-orange-200"}),u.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":"Loop stopped on error"})]}),e.totalIterations!==void 0&&u.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs text-white/70",children:"Progress"}),u.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration||0," / ",e.totalIterations,e.earlyExit&&u.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),u.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:u.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-pink-400"}`,style:{width:`${(e.currentIteration||0)/e.totalIterations*100}%`}})})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsx("span",{children:"Access: loop.index, loop.first, loop.last"})]})]}),u.jsx(qe,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsx(qe,{id:"body",type:"source",position:ge.Right,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),u.jsx(qe,{id:"loop-back",type:"target",position:ge.Left,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const OH=E.memo(RH);function PH({data:e,selected:t}){const n={pending:{icon:Ht,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:y2,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:rt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],i=s.icon;return u.jsxs("div",{className:`control-flow-node while-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #fb923c 0%, #f97316 100%)"},children:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(y2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"While"}),u.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(i,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Condition:"})," ",u.jsx("span",{className:"font-mono",children:e.condition||"Not set"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Max Iterations:"})," ",u.jsx("span",{className:"font-medium",children:e.maxIterations||100})]}),e.earlyExit&&u.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[e.exitReason==="max_iterations"?u.jsx(Zl,{className:"w-4 h-4 text-orange-200"}):u.jsx(sR,{className:"w-4 h-4 text-orange-200"}),u.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":e.exitReason==="max_iterations"?"Max iterations reached":"Loop stopped on error"})]}),e.currentIteration!==void 0&&u.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs text-white/70",children:"Iterations"}),u.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration," / ",e.maxIterations||100,e.earlyExit&&u.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),u.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:u.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-orange-500"}`,style:{width:`${e.currentIteration/(e.maxIterations||100)*100}%`}})})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"⚠️"}),u.jsx("span",{children:"Exits when condition becomes false"})]})]}),u.jsx(qe,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsx(qe,{id:"body",type:"source",position:ge.Right,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),u.jsx(qe,{id:"loop-back",type:"target",position:ge.Left,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const LH=E.memo(PH);function DH({data:e,selected:t}){const n={pending:{icon:Ht,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:f2,color:"text-purple-400",bgColor:"bg-purple-400/10",animate:!0},completed:{icon:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:rt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],i=s.icon,a=Object.keys(e.cases||{}),c=a.slice(0,4),d=a.length>4,f=Math.min(a.length,4)+(e.hasDefault?1:0),p=h=>f===1?50:(h+1)/(f+1)*100;return u.jsxs("div",{className:`control-flow-node switch-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #a855f7 0%, #ec4899 100%)"},children:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(f2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Switch"}),u.jsx("div",{className:"text-xs text-white/70",children:"Multi-Branch Router"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(i,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Expression:"})," ",u.jsx("span",{className:"font-mono",children:e.expression||"Not set"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"text-xs text-white/70 font-medium mb-1",children:"Cases:"}),c.map((h,g)=>{var b;const y=e.activeCase===h,w=(b=e.skippedBranches)==null?void 0:b.includes(h);return u.jsx("div",{className:"relative",children:u.jsxs("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors relative ${y?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":w?"bg-gray-500/20 text-gray-400 line-through":"bg-white/5 text-white/70"}`,children:[h,w&&u.jsx("span",{className:"ml-2 text-[8px] px-1 py-0.5 rounded bg-gray-500/30",children:"SKIPPED"})]})},h)}),d&&u.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&&u.jsx("div",{className:"relative",children:u.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"})})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsxs("span",{children:[a.length," case",a.length!==1?"s":"",e.hasDefault?" + default":""]})]})]}),c.map((h,g)=>u.jsx(qe,{type:"source",position:ge.Bottom,id:`case-${h}`,style:{left:`${p(g)}%`},className:"!w-2.5 !h-2.5 !bg-purple-400 !border-2 !border-node-bg"},`handle-${h}`)),e.hasDefault&&u.jsx(qe,{type:"source",position:ge.Bottom,id:"case-default",style:{left:`${p(c.length)}%`},className:"!w-2.5 !h-2.5 !bg-gray-400 !border-2 !border-node-bg"})]})}const $H=E.memo(DH);function FH({data:e,selected:t}){var a,c;const n={pending:{icon:Ht,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:db,color:"text-green-400",bgColor:"bg-green-400/10",animate:!0},completed:{icon:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:rt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],i=s.icon;return u.jsxs("div",{className:`control-flow-node parallel-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)"},children:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(db,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Parallel"}),u.jsx("div",{className:"text-xs text-white/70",children:"Concurrent Execution"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(i,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[e.maxConcurrentExceeded&&u.jsxs("div",{className:"mb-3 p-2 bg-yellow-500/20 border border-yellow-500/30 rounded flex items-center gap-2",children:[u.jsx(Zl,{className:"w-4 h-4 text-yellow-200"}),u.jsx("span",{className:"text-xs text-yellow-200 font-medium",children:"Rate limiting active"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Branches:"})," ",u.jsx("span",{className:"font-medium",children:((a=e.branches)==null?void 0:a.length)||0}),e.maxConcurrent&&u.jsxs(u.Fragment,{children:[" ",u.jsx("span",{className:"text-white/60",children:"• Max Concurrent:"})," ",u.jsx("span",{className:`font-medium ${e.maxConcurrentExceeded?"text-yellow-300":""}`,children:e.maxConcurrent})]})]}),u.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(c=e.branches)==null?void 0:c.slice(0,6).map(d=>{var g,y,w;const f=(g=e.activeBranches)==null?void 0:g.includes(d.id),p=(y=e.completedBranches)==null?void 0:y.includes(d.id),h=(w=e.failedBranches)==null?void 0:w.includes(d.id);return u.jsx("div",{className:`px-2 py-1 rounded text-xs font-medium transition-colors ${h?"bg-red-500/30 text-red-200":p?"bg-green-500/30 text-green-200":f?"bg-blue-500/30 text-blue-200 animate-pulse":"bg-white/10 text-white/60"}`,title:d.name||d.id,children:d.name||`B${d.id.slice(-2)}`},d.id)}),e.branches&&e.branches.length>6&&u.jsxs("div",{className:"px-2 py-1 rounded text-xs font-medium bg-white/10 text-white/60",children:["+",e.branches.length-6]})]}),u.jsxs("div",{className:"text-xs text-white/50 flex items-center gap-1",children:[u.jsx("span",{children:"On Error:"}),u.jsx("span",{className:"font-medium",children:e.onError||"stop"})]})]}),u.jsx(qe,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const qH=E.memo(FH);function BH({data:e,selected:t}){const n={pending:{icon:Ht,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:x2,color:"text-yellow-400",bgColor:"bg-yellow-400/10",animate:!0},completed:{icon:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:rt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],i=s.icon;return u.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:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(x2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Try/Catch"}),u.jsx("div",{className:"text-xs text-white/70",children:"Error Handling"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(i,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[e.errorOccurred&&u.jsxs("div",{className:"mb-3 p-2 bg-red-500/20 border border-red-500/30 rounded flex items-center gap-2",children:[u.jsx(Zl,{className:"w-4 h-4 text-red-200"}),u.jsx("span",{className:"text-xs text-red-200 font-medium",children:"Error occurred"})]}),u.jsxs("div",{className:"space-y-2",children:[u.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&&u.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&&u.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"})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsx("span",{children:"Finally always executes"})]})]}),u.jsx(qe,{type:"source",position:ge.Bottom,id:"try",style:{left:"25%"},className:"!w-2.5 !h-2.5 !bg-blue-500 !border-2 !border-node-bg"}),e.hasCatch&&u.jsx(qe,{type:"source",position:ge.Bottom,id:"catch",style:{left:"50%"},className:"!w-2.5 !h-2.5 !bg-red-500 !border-2 !border-node-bg"}),e.hasFinally&&u.jsx(qe,{type:"source",position:ge.Bottom,id:"finally",style:{left:"75%"},className:"!w-2.5 !h-2.5 !bg-purple-500 !border-2 !border-node-bg"})]})}const zH=E.memo(BH);function VH({data:e,selected:t}){const n={map:{icon:Rl,label:"Map",color:"#14b8a6"},filter:{icon:ZM,label:"Filter",color:"#10b981"},reduce:{icon:Wz,label:"Reduce",color:"#06b6d4"}},r={pending:{icon:Ht,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:Mt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:rt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:rt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},s=e.status||"pending",i=r[s],a=i.icon,c=n[e.transformType],d=c.icon,f=e.transformType==="filter"?e.condition:e.transformType==="reduce"?`${e.accumulatorVariable||"acc"}: ${e.expression||"Not set"}`:e.expression;return u.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:[u.jsx(qe,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(d,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||c.label}),u.jsx("div",{className:"text-xs text-white/70",children:"Transform"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${i.bgColor} flex items-center justify-center`,children:u.jsx(a,{className:`w-4 h-4 ${i.color} ${i.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[u.jsx("span",{className:"text-white/60",children:"Items:"})," ",u.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Variable:"})," ",u.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),u.jsxs("div",{className:"mb-3 p-2 bg-white/5 rounded",children:[u.jsx("div",{className:"text-xs text-white/60 mb-1",children:e.transformType==="filter"?"Condition":e.transformType==="reduce"?"Reducer":"Expression"}),u.jsx("div",{className:"text-xs text-white font-mono break-all",children:f||"Not set"})]}),e.transformType==="reduce"&&e.initialValue!==void 0&&u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Initial:"})," ",u.jsx("span",{className:"font-mono",children:JSON.stringify(e.initialValue)})]}),(e.inputCount!==void 0||e.outputCount!==void 0)&&u.jsxs("div",{className:"mt-3 p-2 bg-white/5 rounded flex items-center justify-between",children:[u.jsxs("div",{className:"text-xs",children:[u.jsx("span",{className:"text-white/60",children:"In:"})," ",u.jsx("span",{className:"text-white font-medium",children:e.inputCount??"?"})]}),u.jsx("div",{className:"text-white/40",children:"→"}),u.jsxs("div",{className:"text-xs",children:[u.jsx("span",{className:"text-white/60",children:"Out:"})," ",u.jsx("span",{className:"text-white font-medium",children:e.outputCount??"?"})]})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsx("span",{children:e.transformType==="map"?"Transforms each item":e.transformType==="filter"?"Selects matching items":"Aggregates to single value"})]})]}),u.jsx(qe,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsx(qe,{id:"loop-back",type:"source",position:ge.Left,className:"!w-3 !h-3 !bg-teal-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const cm=E.memo(VH),z2={yellow:{bg:"bg-yellow-500/20",border:"border-yellow-500/40",text:"text-yellow-200"},blue:{bg:"bg-blue-500/20",border:"border-blue-500/40",text:"text-blue-200"},green:{bg:"bg-green-500/20",border:"border-green-500/40",text:"text-green-200"},pink:{bg:"bg-pink-500/20",border:"border-pink-500/40",text:"text-pink-200"},purple:{bg:"bg-purple-500/20",border:"border-purple-500/40",text:"text-purple-200"},orange:{bg:"bg-orange-500/20",border:"border-orange-500/40",text:"text-orange-200"}},HH=["yellow","blue","green","pink","purple","orange"];function UH({data:e,selected:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(!1),a=e.color||"yellow",c=z2[a],d=E.useCallback(f=>{},[]);return u.jsxs(u.Fragment,{children:[u.jsx(XM,{isVisible:t,minWidth:150,minHeight:100,lineClassName:"!border-primary",handleClassName:"!bg-primary !border-primary !w-2 !h-2"}),u.jsxs("div",{className:Ue("rounded-lg border-2 p-3 min-w-[150px] min-h-[100px] transition-shadow",c.bg,c.border,t&&"shadow-lg ring-2 ring-primary/30"),children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(o9,{className:Ue("w-3.5 h-3.5",c.text)}),u.jsx("span",{className:Ue("text-xs font-medium",c.text),children:"Note"})]}),u.jsx("button",{onClick:f=>{f.stopPropagation(),i(!s)},className:"p-1 rounded hover:bg-white/10 transition-colors",title:"Change color",children:u.jsx(Yz,{className:"w-3 h-3 text-text-muted"})})]}),s&&u.jsx("div",{className:"flex gap-1 mb-2 p-1 bg-bg-panel rounded border border-border-default",children:HH.map(f=>u.jsx("button",{onClick:p=>{p.stopPropagation(),i(!1)},className:Ue("w-5 h-5 rounded-full border-2 transition-transform",z2[f].bg,f===a?"border-white scale-110":"border-transparent hover:scale-110"),title:f},f))}),n?u.jsx("textarea",{defaultValue:e.text||"",onChange:d,onBlur:()=>r(!1),autoFocus:!0,className:"w-full bg-transparent text-sm text-text-primary resize-none focus:outline-none min-h-[60px]",placeholder:"Type a note...",onClick:f=>f.stopPropagation()}):u.jsx("div",{onDoubleClick:f=>{f.stopPropagation(),r(!0)},className:"text-sm text-text-primary whitespace-pre-wrap min-h-[60px] cursor-text",children:e.text||"Double-click to edit..."}),e.author&&u.jsx("div",{className:"mt-2 text-xs text-text-muted",children:e.author})]})]})}const WH=E.memo(UH),KH={default:{bg:"bg-gray-500/5",border:"border-gray-500/30",header:"bg-gray-500/10"},blue:{bg:"bg-blue-500/5",border:"border-blue-500/30",header:"bg-blue-500/10"},green:{bg:"bg-green-500/5",border:"border-green-500/30",header:"bg-green-500/10"},red:{bg:"bg-red-500/5",border:"border-red-500/30",header:"bg-red-500/10"},purple:{bg:"bg-purple-500/5",border:"border-purple-500/30",header:"bg-purple-500/10"}};function GH({data:e,selected:t}){const[n,r]=E.useState(!1),s=e.color||"default",i=KH[s],a=e.collapsed??!1,c=e.locked??!1;return u.jsxs(u.Fragment,{children:[u.jsx(XM,{isVisible:t&&!c,minWidth:200,minHeight:150,lineClassName:"!border-primary",handleClassName:"!bg-primary !border-primary !w-2 !h-2"}),u.jsxs("div",{className:Ue("rounded-xl border-2 border-dashed transition-all",i.bg,i.border,t&&"ring-2 ring-primary/30",a?"min-w-[200px] min-h-[48px]":"min-w-[300px] min-h-[200px]"),children:[u.jsxs("div",{className:Ue("flex items-center gap-2 px-3 py-2 rounded-t-xl cursor-pointer",i.header),children:[u.jsx("button",{onClick:d=>{d.stopPropagation()},className:"p-0.5 rounded hover:bg-white/10 transition-colors",children:a?u.jsx(It,{className:"w-4 h-4 text-text-secondary"}):u.jsx(Sr,{className:"w-4 h-4 text-text-secondary"})}),a?u.jsx(Lz,{className:"w-4 h-4 text-text-secondary"}):u.jsx(Ol,{className:"w-4 h-4 text-text-secondary"}),n?u.jsx("input",{defaultValue:e.label||"Group",autoFocus:!0,onBlur:()=>r(!1),onKeyDown:d=>{d.key==="Enter"&&r(!1)},className:"flex-1 bg-transparent text-sm font-medium text-text-primary focus:outline-none border-b border-primary",onClick:d=>d.stopPropagation()}):u.jsx("span",{onDoubleClick:d=>{d.stopPropagation(),c||r(!0)},className:"flex-1 text-sm font-medium text-text-primary truncate",children:e.label||"Group"}),c&&u.jsx(zz,{className:"w-3.5 h-3.5 text-warning"}),e.childNodeIds&&e.childNodeIds.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[e.childNodeIds.length," nodes"]})]}),!a&&u.jsx("div",{className:"p-4 min-h-[150px]",children:(!e.childNodeIds||e.childNodeIds.length===0)&&u.jsx("div",{className:"flex items-center justify-center h-full text-xs text-text-muted",children:"Drag nodes here to group them"})})]})]})}const YH=E.memo(GH);var um="focusScope.autoFocusOnMount",dm="focusScope.autoFocusOnUnmount",V2={bubbles:!1,cancelable:!0},XH="FocusScope",Cw=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,d]=E.useState(null),f=Tr(s),p=Tr(i),h=E.useRef(null),g=kt(t,b=>d(b)),y=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let b=function(k){if(y.paused||!c)return;const _=k.target;c.contains(_)?h.current=_:Ls(h.current,{select:!0})},v=function(k){if(y.paused||!c)return;const _=k.relatedTarget;_!==null&&(c.contains(_)||Ls(h.current,{select:!0}))},N=function(k){if(document.activeElement===document.body)for(const A of k)A.removedNodes.length>0&&Ls(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const S=new MutationObserver(N);return c&&S.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),S.disconnect()}}},[r,c,y.paused]),E.useEffect(()=>{if(c){U2.add(y);const b=document.activeElement;if(!c.contains(b)){const N=new CustomEvent(um,V2);c.addEventListener(um,f),c.dispatchEvent(N),N.defaultPrevented||(QH(nU(iO(c)),{select:!0}),document.activeElement===b&&Ls(c))}return()=>{c.removeEventListener(um,f),setTimeout(()=>{const N=new CustomEvent(dm,V2);c.addEventListener(dm,p),c.dispatchEvent(N),N.defaultPrevented||Ls(b??document.body,{select:!0}),c.removeEventListener(dm,p),U2.remove(y)},0)}}},[c,f,p,y]);const w=E.useCallback(b=>{if(!n&&!r||y.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(v&&N){const S=b.currentTarget,[k,_]=JH(S);k&&_?!b.shiftKey&&N===_?(b.preventDefault(),n&&Ls(k,{select:!0})):b.shiftKey&&N===k&&(b.preventDefault(),n&&Ls(_,{select:!0})):N===S&&b.preventDefault()}},[n,r,y.paused]);return u.jsx(Qe.div,{tabIndex:-1,...a,ref:g,onKeyDown:w})});Cw.displayName=XH;function QH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ls(r,{select:t}),document.activeElement!==n)return}function JH(e){const t=iO(e),n=H2(t,e),r=H2(t.reverse(),e);return[n,r]}function iO(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 H2(e,t){for(const n of e)if(!ZH(n,{upTo:t}))return n}function ZH(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 eU(e){return e instanceof HTMLInputElement&&"select"in e}function Ls(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eU(e)&&t&&e.select()}}var U2=tU();function tU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=W2(e,t),e.unshift(t)},remove(t){var n;e=W2(e,t),(n=e[0])==null||n.resume()}}}function W2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function nU(e){return e.filter(t=>t.tagName!=="A")}var fm=0;function oO(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??K2()),document.body.insertAdjacentElement("beforeend",e[1]??K2()),fm++,()=>{fm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fm--}},[])}function K2(){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 br=function(){return br=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},br.apply(this,arguments)};function aO(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 rU(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ud="right-scroll-bar-position",dd="width-before-scroll-bar",sU="with-scroll-bars-hidden",iU="--removed-body-scroll-bar-size";function hm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oU(e,t){var n=E.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 aU=typeof window<"u"?E.useLayoutEffect:E.useEffect,G2=new WeakMap;function lU(e,t){var n=oU(null,function(r){return e.forEach(function(s){return hm(s,r)})});return aU(function(){var r=G2.get(n);if(r){var s=new Set(r),i=new Set(e),a=n.current;s.forEach(function(c){i.has(c)||hm(c,null)}),i.forEach(function(c){s.has(c)||hm(c,a)})}G2.set(n,e)},[e]),n}function cU(e){return e}function uU(e,t){t===void 0&&(t=cU);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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var d=function(){var p=a;a=[],p.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){a.push(p),f()},filter:function(p){return a=a.filter(p),n}}}};return s}function dU(e){e===void 0&&(e={});var t=uU(null);return t.options=br({async:!0,ssr:!1},e),t}var lO=function(e){var t=e.sideCar,n=aO(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 E.createElement(r,br({},n))};lO.isSideCarExport=!0;function fU(e,t){return e.useMedium(t),lO}var cO=dU(),pm=function(){},yf=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:pm,onWheelCapture:pm,onTouchMoveCapture:pm}),s=r[0],i=r[1],a=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,g=e.sideCar,y=e.noRelative,w=e.noIsolation,b=e.inert,v=e.allowPinchZoom,N=e.as,S=N===void 0?"div":N,k=e.gapMode,_=aO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,I=lU([n,t]),T=br(br({},_),s);return E.createElement(E.Fragment,null,p&&E.createElement(A,{sideCar:cO,removeScrollBar:f,shards:h,noRelative:y,noIsolation:w,inert:b,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:k}),a?E.cloneElement(E.Children.only(c),br(br({},T),{ref:I})):E.createElement(S,br({},T,{className:d,ref:I}),c))});yf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yf.classNames={fullWidth:dd,zeroRight:ud};var hU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hU();return t&&e.setAttribute("nonce",t),e}function mU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pU())&&(mU(t,n),gU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xU=function(){var e=yU();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uO=function(){var e=xU(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},vU={left:0,top:0,right:0,gap:0},mm=function(e){return parseInt(e||"",10)||0},bU=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[mm(n),mm(r),mm(s)]},wU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vU;var t=bU(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])}},NU=uO(),$o="data-scroll-locked",kU=function(e,t,n,r){var s=e.left,i=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
638
+ .`.concat(sU,` {
639
+ overflow: hidden `).concat(r,`;
640
+ padding-right: `).concat(c,"px ").concat(r,`;
641
+ }
642
+ body[`).concat($o,`] {
643
+ overflow: hidden `).concat(r,`;
644
+ overscroll-behavior: contain;
645
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
646
+ padding-left: `.concat(s,`px;
647
+ padding-top: `).concat(i,`px;
648
+ padding-right: `).concat(a,`px;
649
+ margin-left:0;
650
+ margin-top:0;
651
+ margin-right: `).concat(c,"px ").concat(r,`;
652
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
653
+ }
654
+
655
+ .`).concat(ud,` {
656
+ right: `).concat(c,"px ").concat(r,`;
657
+ }
658
+
659
+ .`).concat(dd,` {
660
+ margin-right: `).concat(c,"px ").concat(r,`;
661
+ }
662
+
663
+ .`).concat(ud," .").concat(ud,` {
664
+ right: 0 `).concat(r,`;
665
+ }
666
+
667
+ .`).concat(dd," .").concat(dd,` {
668
+ margin-right: 0 `).concat(r,`;
669
+ }
670
+
671
+ body[`).concat($o,`] {
672
+ `).concat(iU,": ").concat(c,`px;
673
+ }
674
+ `)},Y2=function(){var e=parseInt(document.body.getAttribute($o)||"0",10);return isFinite(e)?e:0},SU=function(){E.useEffect(function(){return document.body.setAttribute($o,(Y2()+1).toString()),function(){var e=Y2()-1;e<=0?document.body.removeAttribute($o):document.body.setAttribute($o,e.toString())}},[])},CU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;SU();var i=E.useMemo(function(){return wU(s)},[s]);return E.createElement(NU,{styles:kU(i,!t,s,n?"":"!important")})},wb=!1;if(typeof window<"u")try{var Bu=Object.defineProperty({},"passive",{get:function(){return wb=!0,!0}});window.addEventListener("test",Bu,Bu),window.removeEventListener("test",Bu,Bu)}catch{wb=!1}var bo=wb?{passive:!1}:!1,_U=function(e){return e.tagName==="TEXTAREA"},dO=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_U(e)&&n[t]==="visible")},EU=function(e){return dO(e,"overflowY")},jU=function(e){return dO(e,"overflowX")},X2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=fO(e,r);if(s){var i=hO(e,r),a=i[1],c=i[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},AU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},TU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fO=function(e,t){return e==="v"?EU(t):jU(t)},hO=function(e,t){return e==="v"?AU(t):TU(t)},IU=function(e,t){return e==="h"&&t==="rtl"?-1:1},MU=function(e,t,n,r,s){var i=IU(e,window.getComputedStyle(t).direction),a=i*r,c=n.target,d=t.contains(c),f=!1,p=a>0,h=0,g=0;do{if(!c)break;var y=hO(e,c),w=y[0],b=y[1],v=y[2],N=b-v-i*w;(w||N)&&fO(e,c)&&(h+=N,g+=w);var S=c.parentNode;c=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(h)<1||!p&&Math.abs(g)<1)&&(f=!0),f},zu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Q2=function(e){return[e.deltaX,e.deltaY]},J2=function(e){return e&&"current"in e?e.current:e},RU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},OU=function(e){return`
675
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
676
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
677
+ `)},PU=0,wo=[];function LU(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),s=E.useState(PU++)[0],i=E.useState(uO)[0],a=E.useRef(e);E.useEffect(function(){a.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var b=rU([e.lockRef.current],(e.shards||[]).map(J2),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=E.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var N=zu(b),S=n.current,k="deltaX"in b?b.deltaX:S[0]-N[0],_="deltaY"in b?b.deltaY:S[1]-N[1],A,I=b.target,T=Math.abs(k)>Math.abs(_)?"h":"v";if("touches"in b&&T==="h"&&I.type==="range")return!1;var O=window.getSelection(),L=O&&O.anchorNode,B=L?L===I||L.contains(I):!1;if(B)return!1;var M=X2(T,I);if(!M)return!0;if(M?A=T:(A=T==="v"?"h":"v",M=X2(T,I)),!M)return!1;if(!r.current&&"changedTouches"in b&&(k||_)&&(r.current=A),!A)return!0;var P=r.current||A;return MU(P,v,b,P==="h"?k:_)},[]),d=E.useCallback(function(b){var v=b;if(!(!wo.length||wo[wo.length-1]!==i)){var N="deltaY"in v?Q2(v):zu(v),S=t.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&RU(A.delta,N)})[0];if(S&&S.should){v.cancelable&&v.preventDefault();return}if(!S){var k=(a.current.shards||[]).map(J2).filter(Boolean).filter(function(A){return A.contains(v.target)}),_=k.length>0?c(v,k[0]):!a.current.noIsolation;_&&v.cancelable&&v.preventDefault()}}},[]),f=E.useCallback(function(b,v,N,S){var k={name:b,delta:v,target:N,should:S,shadowParent:DU(N)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(_){return _!==k})},1)},[]),p=E.useCallback(function(b){n.current=zu(b),r.current=void 0},[]),h=E.useCallback(function(b){f(b.type,Q2(b),b.target,c(b,e.lockRef.current))},[]),g=E.useCallback(function(b){f(b.type,zu(b),b.target,c(b,e.lockRef.current))},[]);E.useEffect(function(){return wo.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",d,bo),document.addEventListener("touchmove",d,bo),document.addEventListener("touchstart",p,bo),function(){wo=wo.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,bo),document.removeEventListener("touchmove",d,bo),document.removeEventListener("touchstart",p,bo)}},[]);var y=e.removeScrollBar,w=e.inert;return E.createElement(E.Fragment,null,w?E.createElement(i,{styles:OU(s)}):null,y?E.createElement(CU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $U=fU(cO,LU);var _w=E.forwardRef(function(e,t){return E.createElement(yf,br({},e,{ref:t,sideCar:$U}))});_w.classNames=yf.classNames;var FU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},No=new WeakMap,Vu=new WeakMap,Hu={},gm=0,pO=function(e){return e&&(e.host||pO(e.parentNode))},qU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pO(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})},BU=function(e,t,n,r){var s=qU(t,Array.isArray(e)?e:[e]);Hu[n]||(Hu[n]=new WeakMap);var i=Hu[n],a=[],c=new Set,d=new Set(s),f=function(h){!h||c.has(h)||(c.add(h),f(h.parentNode))};s.forEach(f);var p=function(h){!h||d.has(h)||Array.prototype.forEach.call(h.children,function(g){if(c.has(g))p(g);else try{var y=g.getAttribute(r),w=y!==null&&y!=="false",b=(No.get(g)||0)+1,v=(i.get(g)||0)+1;No.set(g,b),i.set(g,v),a.push(g),b===1&&w&&Vu.set(g,!0),v===1&&g.setAttribute(n,"true"),w||g.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",g,N)}})};return p(t),c.clear(),gm++,function(){a.forEach(function(h){var g=No.get(h)-1,y=i.get(h)-1;No.set(h,g),i.set(h,y),g||(Vu.has(h)||h.removeAttribute(r),Vu.delete(h)),y||h.removeAttribute(n)}),gm--,gm||(No=new WeakMap,No=new WeakMap,Vu=new WeakMap,Hu={})}},mO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=FU(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),BU(r,s,n,"aria-hidden")):function(){return null}},xf="Dialog",[gO]=Ks(xf),[zU,or]=gO(xf),yO=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=E.useRef(null),d=E.useRef(null),[f,p]=pf({prop:r,defaultProp:s??!1,onChange:i,caller:xf});return u.jsx(zU,{scope:t,triggerRef:c,contentRef:d,contentId:Lo(),titleId:Lo(),descriptionId:Lo(),open:f,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(h=>!h),[p]),modal:a,children:n})};yO.displayName=xf;var xO="DialogTrigger",VU=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=or(xO,n),i=kt(t,s.triggerRef);return u.jsx(Qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Aw(s.open),...r,ref:i,onClick:Te(e.onClick,s.onOpenToggle)})});VU.displayName=xO;var Ew="DialogPortal",[HU,vO]=gO(Ew,{forceMount:void 0}),bO=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=or(Ew,t);return u.jsx(HU,{scope:t,forceMount:n,children:E.Children.map(r,a=>u.jsx(ir,{present:n||i.open,children:u.jsx(hf,{asChild:!0,container:s,children:a})}))})};bO.displayName=Ew;var Pd="DialogOverlay",wO=E.forwardRef((e,t)=>{const n=vO(Pd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=or(Pd,e.__scopeDialog);return i.modal?u.jsx(ir,{present:r||i.open,children:u.jsx(WU,{...s,ref:t})}):null});wO.displayName=Pd;var UU=Ll("DialogOverlay.RemoveScroll"),WU=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=or(Pd,n);return u.jsx(_w,{as:UU,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(Qe.div,{"data-state":Aw(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ii="DialogContent",NO=E.forwardRef((e,t)=>{const n=vO(Ii,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=or(Ii,e.__scopeDialog);return u.jsx(ir,{present:r||i.open,children:i.modal?u.jsx(KU,{...s,ref:t}):u.jsx(GU,{...s,ref:t})})});NO.displayName=Ii;var KU=E.forwardRef((e,t)=>{const n=or(Ii,e.__scopeDialog),r=E.useRef(null),s=kt(t,n.contentRef,r);return E.useEffect(()=>{const i=r.current;if(i)return mO(i)},[]),u.jsx(kO,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault())})}),GU=E.forwardRef((e,t)=>{const n=or(Ii,e.__scopeDialog),r=E.useRef(!1),s=E.useRef(!1);return u.jsx(kO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),kO=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,c=or(Ii,n),d=E.useRef(null),f=kt(t,d);return oO(),u.jsxs(u.Fragment,{children:[u.jsx(Cw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:u.jsx(af,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Aw(c.open),...a,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(YU,{titleId:c.titleId}),u.jsx(QU,{contentRef:d,descriptionId:c.descriptionId})]})]})}),jw="DialogTitle",SO=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=or(jw,n);return u.jsx(Qe.h2,{id:s.titleId,...r,ref:t})});SO.displayName=jw;var CO="DialogDescription",_O=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=or(CO,n);return u.jsx(Qe.p,{id:s.descriptionId,...r,ref:t})});_O.displayName=CO;var EO="DialogClose",jO=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=or(EO,n);return u.jsx(Qe.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});jO.displayName=EO;function Aw(e){return e?"open":"closed"}var AO="DialogTitleWarning",[Tne,TO]=aV(AO,{contentName:Ii,titleName:jw,docsSlug:"dialog"}),YU=({titleId:e})=>{const t=TO(AO),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
678
+
679
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
680
+
681
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},XU="DialogDescriptionWarning",QU=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${TO(XU).contentName}}.`;return E.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},JU=yO,ZU=bO,eW=wO,tW=NO,nW=SO,rW=_O,sW=jO;const iW={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]"};function rs({open:e,onOpenChange:t,title:n,description:r,children:s,className:i,size:a="md"}){return u.jsx(JU,{open:e,onOpenChange:t,children:u.jsxs(ZU,{children:[u.jsx(eW,{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"}),u.jsxs(tW,{className:Ue("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",iW[a],i),children:[(n||r)&&u.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-node-border",children:[u.jsxs("div",{children:[n&&u.jsx(nW,{className:"text-lg font-semibold text-white",children:n}),r&&u.jsx(rW,{className:"mt-1 text-sm text-gray-400",children:r})]}),u.jsx(sW,{className:"rounded-full p-1 hover:bg-white/10 transition-colors",children:u.jsx(Zn,{className:"w-5 h-5 text-gray-400"})})]}),u.jsx("div",{className:"max-h-[calc(85vh-8rem)] overflow-y-auto",children:s})]})]})})}function Mi({children:e,className:t}){return u.jsx("div",{className:Ue("flex items-center justify-end gap-3 p-4 border-t border-node-border",t),children:e})}const oW={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"},aW={sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},De=E.forwardRef(({className:e,variant:t="primary",size:n="md",loading:r,icon:s,disabled:i,children:a,...c},d)=>u.jsxs("button",{ref:d,disabled:i||r,className:Ue("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",oW[t],aW[n],e),...c,children:[r?u.jsx(Cr,{className:"w-4 h-4 animate-spin"}):s&&u.jsx("span",{className:"flex-shrink-0",children:s}),a]}));De.displayName="Button";function IO(e){const t=e+"CollectionProvider",[n,r]=Ks(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=b=>{const{scope:v,children:N}=b,S=yt.useRef(null),k=yt.useRef(new Map).current;return u.jsx(s,{scope:v,itemMap:k,collectionRef:S,children:N})};a.displayName=t;const c=e+"CollectionSlot",d=Ll(c),f=yt.forwardRef((b,v)=>{const{scope:N,children:S}=b,k=i(c,N),_=kt(v,k.collectionRef);return u.jsx(d,{ref:_,children:S})});f.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",g=Ll(p),y=yt.forwardRef((b,v)=>{const{scope:N,children:S,...k}=b,_=yt.useRef(null),A=kt(v,_),I=i(p,N);return yt.useEffect(()=>(I.itemMap.set(_,{ref:_,...k}),()=>void I.itemMap.delete(_))),u.jsx(g,{[h]:"",ref:A,children:S})});y.displayName=p;function w(b){const v=i(e+"CollectionConsumer",b);return yt.useCallback(()=>{const S=v.collectionRef.current;if(!S)return[];const k=Array.from(S.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((I,T)=>k.indexOf(I.ref.current)-k.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},w,r]}var lW=E.createContext(void 0);function Tw(e){const t=E.useContext(lW);return e||t||"ltr"}var ym="rovingFocusGroup.onEntryFocus",cW={bubbles:!1,cancelable:!0},sc="RovingFocusGroup",[Nb,MO,uW]=IO(sc),[dW,vf]=Ks(sc,[uW]),[fW,hW]=dW(sc),RO=E.forwardRef((e,t)=>u.jsx(Nb.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Nb.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(pW,{...e,ref:t})})}));RO.displayName=sc;var pW=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...h}=e,g=E.useRef(null),y=kt(t,g),w=Tw(i),[b,v]=pf({prop:a,defaultProp:c??null,onChange:d,caller:sc}),[N,S]=E.useState(!1),k=Tr(f),_=MO(n),A=E.useRef(!1),[I,T]=E.useState(0);return E.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(ym,k),()=>O.removeEventListener(ym,k)},[k]),u.jsx(fW,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:b,onItemFocus:E.useCallback(O=>v(O),[v]),onItemShiftTab:E.useCallback(()=>S(!0),[]),onFocusableItemAdd:E.useCallback(()=>T(O=>O+1),[]),onFocusableItemRemove:E.useCallback(()=>T(O=>O-1),[]),children:u.jsx(Qe.div,{tabIndex:N||I===0?-1:0,"data-orientation":r,...h,ref:y,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{A.current=!0}),onFocus:Te(e.onFocus,O=>{const L=!A.current;if(O.target===O.currentTarget&&L&&!N){const B=new CustomEvent(ym,cW);if(O.currentTarget.dispatchEvent(B),!B.defaultPrevented){const M=_().filter(V=>V.focusable),P=M.find(V=>V.active),H=M.find(V=>V.id===b),z=[P,H,...M].filter(Boolean).map(V=>V.ref.current);LO(z,p)}}A.current=!1}),onBlur:Te(e.onBlur,()=>S(!1))})})}),OO="RovingFocusGroupItem",PO=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...c}=e,d=Lo(),f=i||d,p=hW(OO,n),h=p.currentTabStopId===f,g=MO(n),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:b}=p;return E.useEffect(()=>{if(r)return y(),()=>w()},[r,y,w]),u.jsx(Nb.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:u.jsx(Qe.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:Te(e.onMouseDown,v=>{r?p.onItemFocus(f):v.preventDefault()}),onFocus:Te(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:Te(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){p.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const N=yW(v,p.orientation,p.dir);if(N!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let k=g().filter(_=>_.focusable).map(_=>_.ref.current);if(N==="last")k.reverse();else if(N==="prev"||N==="next"){N==="prev"&&k.reverse();const _=k.indexOf(v.currentTarget);k=p.loop?xW(k,_+1):k.slice(_+1)}setTimeout(()=>LO(k))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:b!=null}):a})})});PO.displayName=OO;var mW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yW(e,t,n){const r=gW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mW[r]}function LO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var DO=RO,$O=PO,bf="Tabs",[vW]=Ks(bf,[vf]),FO=vf(),[bW,Iw]=vW(bf),qO=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:d="automatic",...f}=e,p=Tw(c),[h,g]=pf({prop:r,onChange:s,defaultProp:i??"",caller:bf});return u.jsx(bW,{scope:n,baseId:Lo(),value:h,onValueChange:g,orientation:a,dir:p,activationMode:d,children:u.jsx(Qe.div,{dir:p,"data-orientation":a,...f,ref:t})})});qO.displayName=bf;var BO="TabsList",zO=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=Iw(BO,n),a=FO(n);return u.jsx(DO,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:u.jsx(Qe.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});zO.displayName=BO;var VO="TabsTrigger",HO=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,a=Iw(VO,n),c=FO(n),d=KO(a.baseId,r),f=GO(a.baseId,r),p=r===a.value;return u.jsx($O,{asChild:!0,...c,focusable:!s,active:p,children:u.jsx(Qe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...i,ref:t,onMouseDown:Te(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:Te(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const h=a.activationMode!=="manual";!p&&!s&&h&&a.onValueChange(r)})})})});HO.displayName=VO;var UO="TabsContent",WO=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=e,c=Iw(UO,n),d=KO(c.baseId,r),f=GO(c.baseId,r),p=r===c.value,h=E.useRef(p);return E.useEffect(()=>{const g=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(g)},[]),u.jsx(ir,{present:s||p,children:({present:g})=>u.jsx(Qe.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:g&&i})})});WO.displayName=UO;function KO(e,t){return`${e}-trigger-${t}`}function GO(e,t){return`${e}-content-${t}`}var wW=qO,YO=zO,XO=HO,QO=WO;const JO=wW,Mw=E.forwardRef(({className:e,...t},n)=>u.jsx(YO,{ref:n,className:Ue("inline-flex items-center gap-1 border-b border-node-border w-full px-2",e),...t}));Mw.displayName=YO.displayName;const xr=E.forwardRef(({className:e,...t},n)=>u.jsx(XO,{ref:n,className:Ue("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}));xr.displayName=XO.displayName;const vr=E.forwardRef(({className:e,...t},n)=>u.jsx(QO,{ref:n,className:Ue("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",e),...t}));vr.displayName=QO.displayName;function Z2(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 NW(e){if(Array.isArray(e))return e}function kW(e,t,n){return(t=TW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SW(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,a,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(p){f=!0,s=p}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw s}}return c}}function CW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
682
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eC(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 tC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eC(Object(n),!0).forEach(function(r){kW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _W(e,t){if(e==null)return{};var n,r,s=EW(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function EW(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 jW(e,t){return NW(e)||SW(e,t)||IW(e,t)||CW()}function AW(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 TW(e){var t=AW(e,"string");return typeof t=="symbol"?t:t+""}function IW(e,t){if(e){if(typeof e=="string")return Z2(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)?Z2(e,t):void 0}}function MW(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nC(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 rC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nC(Object(n),!0).forEach(function(r){MW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RW(){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,i){return i(s)},r)}}function ll(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(s,c))}}}function Ld(e){return{}.toString.call(e).includes("Object")}function OW(e){return!Object.keys(e).length}function ql(e){return typeof e=="function"}function PW(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function LW(e,t){return Ld(t)||qs("changeType"),Object.keys(t).some(function(n){return!PW(e,n)})&&qs("changeField"),t}function DW(e){ql(e)||qs("selectorType")}function $W(e){ql(e)||Ld(e)||qs("handlerType"),Ld(e)&&Object.values(e).some(function(t){return!ql(t)})&&qs("handlersType")}function FW(e){e||qs("initialIsRequired"),Ld(e)||qs("initialType"),OW(e)&&qs("initialContent")}function qW(e,t){throw new Error(e[t]||e.default)}var BW={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"},qs=ll(qW)(BW),Uu={changes:LW,selector:DW,handler:$W,initial:FW};function zW(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Uu.initial(e),Uu.handler(t);var n={current:e},r=ll(UW)(n,t),s=ll(HW)(n),i=ll(Uu.changes)(e),a=ll(VW)(n);function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Uu.selector(f),f(n.current)}function d(f){RW(r,s,i,a)(f)}return[c,d]}function VW(e,t){return ql(t)?t(e.current):t}function HW(e,t){return e.current=rC(rC({},e.current),t),t}function UW(e,t,n){return ql(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 WW={create:zW},KW={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function GW(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(s,c))}}}function YW(e){return{}.toString.call(e).includes("Object")}function XW(e){return e||sC("configIsRequired"),YW(e)||sC("configType"),e.urls?(QW(),{paths:{vs:e.urls.monacoBase}}):e}function QW(){console.warn(ZO.deprecation)}function JW(e,t){throw new Error(e[t]||e.default)}var ZO={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!
683
+ You are using deprecated way of configuration.
684
+
685
+ Instead of using
686
+ monaco.config({ urls: { monacoBase: '...' } })
687
+ use
688
+ monaco.config({ paths: { vs: '...' } })
689
+
690
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
691
+ `},sC=GW(JW)(ZO),ZW={config:XW},eK=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(i,a){return a(i)},s)}};function eP(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],eP(e[n],t[n]))}),tC(tC({},e),t)}var tK={type:"cancelation",msg:"operation is manually canceled"};function xm(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s(tK):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var nK=["monaco"],rK=WW.create({config:KW,isInitialized:!1,resolve:null,reject:null,monaco:null}),tP=jW(rK,2),ic=tP[0],wf=tP[1];function sK(e){var t=ZW.config(e),n=t.monaco,r=_W(t,nK);wf(function(s){return{config:eP(s.config,r),monaco:n}})}function iK(){var e=ic(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(wf({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),xm(vm);if(window.monaco&&window.monaco.editor)return nP(window.monaco),e.resolve(window.monaco),xm(vm);eK(oK,lK)(cK)}return xm(vm)}function oK(e){return document.body.appendChild(e)}function aK(e){var t=document.createElement("script");return e&&(t.src=e),t}function lK(e){var t=ic(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=aK("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function cK(){var e=ic(function(n){var r=n.config,s=n.resolve,i=n.reject;return{config:r,resolve:s,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;nP(r),e.resolve(r)},function(n){e.reject(n)})}function nP(e){ic().monaco||wf({monaco:e})}function uK(){return ic(function(e){var t=e.monaco;return t})}var vm=new Promise(function(e,t){return wf({resolve:e,reject:t})}),rP={config:sK,init:iK,__getMonacoInstance:uK},dK={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},bm=dK,fK={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},hK=fK;function pK({children:e}){return yt.createElement("div",{style:hK.container},e)}var mK=pK,gK=mK;function yK({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:a}){return yt.createElement("section",{style:{...bm.wrapper,width:e,height:t},...a},!n&&yt.createElement(gK,null,r),yt.createElement("div",{ref:s,style:{...bm.fullWidth,...!n&&bm.hide},className:i}))}var xK=yK,sP=E.memo(xK);function vK(e){E.useEffect(e,[])}var iP=vK;function bK(e,t,n=!0){let r=E.useRef(!0);E.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var fn=bK;function bl(){}function Ao(e,t,n,r){return wK(e,r)||NK(e,t,n,r)}function wK(e,t){return e.editor.getModel(oP(e,t))}function NK(e,t,n,r){return e.editor.createModel(t,n,r?oP(e,r):void 0)}function oP(e,t){return e.Uri.parse(t)}function kK({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:h={},height:g="100%",width:y="100%",className:w,wrapperProps:b={},beforeMount:v=bl,onMount:N=bl}){let[S,k]=E.useState(!1),[_,A]=E.useState(!0),I=E.useRef(null),T=E.useRef(null),O=E.useRef(null),L=E.useRef(N),B=E.useRef(v),M=E.useRef(!1);iP(()=>{let z=rP.init();return z.then(V=>(T.current=V)&&A(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>I.current?D():z.cancel()}),fn(()=>{if(I.current&&T.current){let z=I.current.getOriginalEditor(),V=Ao(T.current,e||"",r||n||"text",i||"");V!==z.getModel()&&z.setModel(V)}},[i],S),fn(()=>{if(I.current&&T.current){let z=I.current.getModifiedEditor(),V=Ao(T.current,t||"",s||n||"text",a||"");V!==z.getModel()&&z.setModel(V)}},[a],S),fn(()=>{let z=I.current.getModifiedEditor();z.getOption(T.current.editor.EditorOption.readOnly)?z.setValue(t||""):t!==z.getValue()&&(z.executeEdits("",[{range:z.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),z.pushUndoStop())},[t],S),fn(()=>{var z,V;(V=(z=I.current)==null?void 0:z.getModel())==null||V.original.setValue(e||"")},[e],S),fn(()=>{let{original:z,modified:V}=I.current.getModel();T.current.editor.setModelLanguage(z,r||n||"text"),T.current.editor.setModelLanguage(V,s||n||"text")},[n,r,s],S),fn(()=>{var z;(z=T.current)==null||z.editor.setTheme(f)},[f],S),fn(()=>{var z;(z=I.current)==null||z.updateOptions(h)},[h],S);let P=E.useCallback(()=>{var G;if(!T.current)return;B.current(T.current);let z=Ao(T.current,e||"",r||n||"text",i||""),V=Ao(T.current,t||"",s||n||"text",a||"");(G=I.current)==null||G.setModel({original:z,modified:V})},[n,t,s,e,r,i,a]),H=E.useCallback(()=>{var z;!M.current&&O.current&&(I.current=T.current.editor.createDiffEditor(O.current,{automaticLayout:!0,...h}),P(),(z=T.current)==null||z.editor.setTheme(f),k(!0),M.current=!0)},[h,f,P]);E.useEffect(()=>{S&&L.current(I.current,T.current)},[S]),E.useEffect(()=>{!_&&!S&&H()},[_,S,H]);function D(){var V,G,q,F;let z=(V=I.current)==null?void 0:V.getModel();c||((G=z==null?void 0:z.original)==null||G.dispose()),d||((q=z==null?void 0:z.modified)==null||q.dispose()),(F=I.current)==null||F.dispose()}return yt.createElement(sP,{width:y,height:g,isEditorReady:S,loading:p,_ref:O,className:w,wrapperProps:b})}var SK=kK;E.memo(SK);function CK(e){let t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}var _K=CK,Wu=new Map;function EK({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:h=!0,keepCurrentModel:g=!1,width:y="100%",height:w="100%",className:b,wrapperProps:v={},beforeMount:N=bl,onMount:S=bl,onChange:k,onValidate:_=bl}){let[A,I]=E.useState(!1),[T,O]=E.useState(!0),L=E.useRef(null),B=E.useRef(null),M=E.useRef(null),P=E.useRef(S),H=E.useRef(N),D=E.useRef(),z=E.useRef(r),V=_K(i),G=E.useRef(!1),q=E.useRef(!1);iP(()=>{let $=rP.init();return $.then(K=>(L.current=K)&&O(!1)).catch(K=>(K==null?void 0:K.type)!=="cancelation"&&console.error("Monaco initialization: error:",K)),()=>B.current?Y():$.cancel()}),fn(()=>{var K,ie,U,Q;let $=Ao(L.current,e||r||"",t||s||"",i||n||"");$!==((K=B.current)==null?void 0:K.getModel())&&(h&&Wu.set(V,(ie=B.current)==null?void 0:ie.saveViewState()),(U=B.current)==null||U.setModel($),h&&((Q=B.current)==null||Q.restoreViewState(Wu.get(i))))},[i],A),fn(()=>{var $;($=B.current)==null||$.updateOptions(f)},[f],A),fn(()=>{!B.current||r===void 0||(B.current.getOption(L.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(q.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),q.current=!1))},[r],A),fn(()=>{var K,ie;let $=(K=B.current)==null?void 0:K.getModel();$&&s&&((ie=L.current)==null||ie.editor.setModelLanguage($,s))},[s],A),fn(()=>{var $;c!==void 0&&(($=B.current)==null||$.revealLine(c))},[c],A),fn(()=>{var $;($=L.current)==null||$.editor.setTheme(a)},[a],A);let F=E.useCallback(()=>{var $;if(!(!M.current||!L.current)&&!G.current){H.current(L.current);let K=i||n,ie=Ao(L.current,r||e||"",t||s||"",K||"");B.current=($=L.current)==null?void 0:$.editor.create(M.current,{model:ie,automaticLayout:!0,...f},p),h&&B.current.restoreViewState(Wu.get(K)),L.current.editor.setTheme(a),c!==void 0&&B.current.revealLine(c),I(!0),G.current=!0}},[e,t,n,r,s,i,f,p,h,a,c]);E.useEffect(()=>{A&&P.current(B.current,L.current)},[A]),E.useEffect(()=>{!T&&!A&&F()},[T,A,F]),z.current=r,E.useEffect(()=>{var $,K;A&&k&&(($=D.current)==null||$.dispose(),D.current=(K=B.current)==null?void 0:K.onDidChangeModelContent(ie=>{q.current||k(B.current.getValue(),ie)}))},[A,k]),E.useEffect(()=>{if(A){let $=L.current.editor.onDidChangeMarkers(K=>{var U;let ie=(U=B.current.getModel())==null?void 0:U.uri;if(ie&&K.find(Q=>Q.path===ie.path)){let Q=L.current.editor.getModelMarkers({resource:ie});_==null||_(Q)}});return()=>{$==null||$.dispose()}}return()=>{}},[A,_]);function Y(){var $,K;($=D.current)==null||$.dispose(),g?h&&Wu.set(i,B.current.saveViewState()):(K=B.current.getModel())==null||K.dispose(),B.current.dispose()}return yt.createElement(sP,{width:y,height:w,isEditorReady:A,loading:d,_ref:M,className:b,wrapperProps:v})}var jK=EK,AK=E.memo(jK),wl=AK;const Rw=Symbol.for("yaml.alias"),kb=Symbol.for("yaml.document"),Bs=Symbol.for("yaml.map"),aP=Symbol.for("yaml.pair"),Mr=Symbol.for("yaml.scalar"),sa=Symbol.for("yaml.seq"),Mn=Symbol.for("yaml.node.type"),Li=e=>!!e&&typeof e=="object"&&e[Mn]===Rw,oc=e=>!!e&&typeof e=="object"&&e[Mn]===kb,ac=e=>!!e&&typeof e=="object"&&e[Mn]===Bs,pt=e=>!!e&&typeof e=="object"&&e[Mn]===aP,Xe=e=>!!e&&typeof e=="object"&&e[Mn]===Mr,lc=e=>!!e&&typeof e=="object"&&e[Mn]===sa;function ft(e){if(e&&typeof e=="object")switch(e[Mn]){case Bs:case sa:return!0}return!1}function ht(e){if(e&&typeof e=="object")switch(e[Mn]){case Rw:case Bs:case Mr:case sa:return!0}return!1}const lP=e=>(Xe(e)||ft(e))&&!!e.anchor,gi=Symbol("break visit"),TK=Symbol("skip children"),Nl=Symbol("remove node");function ia(e,t){const n=IK(t);oc(e)?To(null,e.contents,n,Object.freeze([e]))===Nl&&(e.contents=null):To(null,e,n,Object.freeze([]))}ia.BREAK=gi;ia.SKIP=TK;ia.REMOVE=Nl;function To(e,t,n,r){const s=MK(e,t,n,r);if(ht(s)||pt(s))return RK(e,r,s),To(e,s,n,r);if(typeof s!="symbol"){if(ft(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const a=To(i,t.items[i],n,r);if(typeof a=="number")i=a-1;else{if(a===gi)return gi;a===Nl&&(t.items.splice(i,1),i-=1)}}}else if(pt(t)){r=Object.freeze(r.concat(t));const i=To("key",t.key,n,r);if(i===gi)return gi;i===Nl&&(t.key=null);const a=To("value",t.value,n,r);if(a===gi)return gi;a===Nl&&(t.value=null)}}return s}function IK(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 MK(e,t,n,r){var s,i,a,c,d;if(typeof n=="function")return n(e,t,r);if(ac(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(lc(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,r);if(pt(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,r);if(Xe(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,r);if(Li(t))return(d=n.Alias)==null?void 0:d.call(n,e,t,r)}function RK(e,t,n){const r=t[t.length-1];if(ft(r))r.items[e]=n;else if(pt(r))e==="key"?r.key=n:r.value=n;else if(oc(r))r.contents=n;else{const s=Li(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const OK={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},PK=e=>e.replace(/[!,[\]{}]/g,t=>OK[t]);class zt{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},zt.defaultYaml,t),this.tags=Object.assign({},zt.defaultTags,n)}clone(){const t=new zt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new zt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:zt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},zt.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:zt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},zt.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[i,a]=r;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const a=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,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 i=this.tags[r];if(i)try{return i+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+PK(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&&ht(t.contents)){const i={};ia(t.contents,(a,c)=>{ht(c)&&c.tag&&(i[c.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(c=>c.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(`
692
+ `)}}zt.defaultYaml={explicit:!1,version:"1.2"};zt.defaultTags={"!!":"tag:yaml.org,2002:"};function cP(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 uP(e){const t=new Set;return ia(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function dP(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function LK(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=uP(e));const a=dP(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(Xe(a.node)||ft(a.node)))a.node.anchor=a.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=i,c}}},sourceObjects:r}}function Io(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const a=r[s],c=Io(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 i=r.get(s),a=Io(e,r,s,i);a===void 0?r.delete(s):a!==i&&r.set(s,a)}else if(r instanceof Set)for(const s of Array.from(r)){const i=Io(e,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const a=Io(e,r,s,i);a===void 0?delete r[s]:a!==i&&(r[s]=a)}return e.call(t,n,r)}function Tn(e,t,n){if(Array.isArray(e))return e.map((r,s)=>Tn(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!lP(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,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 Ow{constructor(t){Object.defineProperty(this,Mn,{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:i}={}){if(!oc(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=Tn(this,"",a);if(typeof s=="function")for(const{count:d,res:f}of a.anchors.values())s(f,d);return typeof i=="function"?Io(i,{"":c},"",c):c}}class Pw extends Ow{constructor(t){super(Rw),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=[],ia(t,{Node:(i,a)=>{(Li(a)||lP(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,a=this.resolve(s,n);if(!a){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let c=r.get(a);if(c||(Tn(a,null,n),c=r.get(a)),(c==null?void 0:c.res)===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(i>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=fd(s,a,r)),c.count*c.aliasCount>i)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(cP(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function fd(e,t,n){if(Li(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(ft(t)){let r=0;for(const s of t.items){const i=fd(e,s,n);i>r&&(r=i)}return r}else if(pt(t)){const r=fd(e,t.key,n),s=fd(e,t.value,n);return Math.max(r,s)}return 1}const fP=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Ow{constructor(t){super(Mr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Tn(this.value,t,n)}toString(){return String(this.value)}}Re.BLOCK_FOLDED="BLOCK_FOLDED";Re.BLOCK_LITERAL="BLOCK_LITERAL";Re.PLAIN="PLAIN";Re.QUOTE_DOUBLE="QUOTE_DOUBLE";Re.QUOTE_SINGLE="QUOTE_SINGLE";const DK="tag:yaml.org,2002:";function $K(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.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 Bl(e,t,n){var h,g,y;if(oc(e)&&(e=e.contents),ht(e))return e;if(pt(e)){const w=(g=(h=n.schema[Bs]).createNode)==null?void 0:g.call(h,n.schema,null,n);return w.items.push(e),w}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:a,sourceObjects:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=s(e)),new Pw(d.anchor);d={anchor:null,node:null},c.set(e,d)}t!=null&&t.startsWith("!!")&&(t=DK+t.slice(2));let f=$K(e,t,a.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const w=new Re(e);return d&&(d.node=w),w}f=e instanceof Map?a[Bs]:Symbol.iterator in Object(e)?a[sa]:a[Bs]}i&&(i(f),delete n.onTagObj);const p=f!=null&&f.createNode?f.createNode(n.schema,e,n):typeof((y=f==null?void 0:f.nodeClass)==null?void 0:y.from)=="function"?f.nodeClass.from(n.schema,e,n):new Re(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function Dd(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const a=[];a[i]=r,r=a}else r=new Map([[i,r]])}return Bl(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 cl=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let hP=class extends Ow{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=>ht(r)||pt(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cl(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(ft(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Dd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(ft(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&Xe(i)?i.value:i:ft(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!pt(n))return!1;const r=n.value;return r==null||t&&Xe(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 ft(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(ft(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Dd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};const FK=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Qr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const vi=(e,t,n)=>e.endsWith(`
693
+ `)?Qr(n,t):n.includes(`
694
+ `)?`
695
+ `+Qr(n,t):(e.endsWith(" ")?"":" ")+n,pP="flow",Sb="block",hd="quoted";function Nf(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:c}={}){if(!s||s<0)return e;s<i&&(i=0);const d=Math.max(1+i,1+s-t.length);if(e.length<=d)return e;const f=[],p={};let h=s-t.length;typeof r=="number"&&(r>s-Math.max(2,i)?f.push(0):h=s-r);let g,y,w=!1,b=-1,v=-1,N=-1;n===Sb&&(b=iC(e,b,t.length),b!==-1&&(h=b+d));for(let k;k=e[b+=1];){if(n===hd&&k==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}N=b}if(k===`
696
+ `)n===Sb&&(b=iC(e,b,t.length)),h=b+t.length+d,g=void 0;else{if(k===" "&&y&&y!==" "&&y!==`
697
+ `&&y!==" "){const _=e[b+1];_&&_!==" "&&_!==`
698
+ `&&_!==" "&&(g=b)}if(b>=h)if(g)f.push(g),h=g+d,g=void 0;else if(n===hd){for(;y===" "||y===" ";)y=k,k=e[b+=1],w=!0;const _=b>N+1?b-2:v-1;if(p[_])return e;f.push(_),p[_]=!0,h=_+d,g=void 0}else w=!0}y=k}if(w&&c&&c(),f.length===0)return e;a&&a();let S=e.slice(0,f[0]);for(let k=0;k<f.length;++k){const _=f[k],A=f[k+1]||e.length;_===0?S=`
699
+ ${t}${e.slice(0,A)}`:(n===hd&&p[_]&&(S+=`${e[_]}\\`),S+=`
700
+ ${t}${e.slice(_+1,A)}`)}return S}function iC(e,t,n){let r=t,s=t+1,i=e[s];for(;i===" "||i===" ";)if(t<s+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
701
+ `);r=t,s=t+1,i=e[s]}return r}const kf=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Sf=e=>/^(%|---|\.\.\.)/m.test(e);function qK(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,a=0;i<s;++i)if(e[i]===`
702
+ `){if(i-a>r)return!0;if(a=i+1,s-a<=r)return!1}return!0}function kl(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Sf(e)?" ":"");let a="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(a+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{a+=n.slice(c,d);const p=n.substr(d+2,4);switch(p){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:p.substr(0,2)==="00"?a+="\\x"+p.substr(2):a+=n.substr(d,6)}d+=5,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<s)d+=1;else{for(a+=n.slice(c,d)+`
703
+
704
+ `;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)a+=`
705
+ `,d+=2;a+=i,n[d+2]===" "&&(a+="\\"),d+=1,c=d+1}break;default:d+=1}return a=c?a+n.slice(c):n,r?a:Nf(a,i,hd,kf(t,!1))}function Cb(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
706
+ `)||/[ \t]\n|\n[ \t]/.test(e))return kl(e,t);const n=t.indent||(Sf(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
707
+ ${n}`)+"'";return t.implicitKey?r:Nf(r,n,pP,kf(t,!1))}function Mo(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=kl;else{const s=e.includes('"'),i=e.includes("'");s&&!i?r=Cb:i&&!s?r=kl:r=n?Cb:kl}return r(e,t)}let _b;try{_b=new RegExp(`(^|(?<!
708
+ ))
709
+ +(?!
710
+ |$)`,"g")}catch{_b=/\n+(?!\n|$)/g}function pd({comment:e,type:t,value:n},r,s,i){const{blockQuote:a,commentString:c,lineWidth:d}=r.options;if(!a||/\n[\t ]+$/.test(n))return Mo(n,r);const f=r.indent||(r.forceBlockIndent||Sf(n)?" ":""),p=a==="literal"?!0:a==="folded"||t===Re.BLOCK_FOLDED?!1:t===Re.BLOCK_LITERAL?!0:!qK(n,d,f.length);if(!n)return p?`|
711
+ `:`>
712
+ `;let h,g;for(g=n.length;g>0;--g){const A=n[g-1];if(A!==`
713
+ `&&A!==" "&&A!==" ")break}let y=n.substring(g);const w=y.indexOf(`
714
+ `);w===-1?h="-":n===y||w!==y.length-1?(h="+",i&&i()):h="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
715
+ `&&(y=y.slice(0,-1)),y=y.replace(_b,`$&${f}`));let b=!1,v,N=-1;for(v=0;v<n.length;++v){const A=n[v];if(A===" ")b=!0;else if(A===`
716
+ `)N=v;else break}let S=n.substring(0,N<v?N+1:v);S&&(n=n.substring(S.length),S=S.replace(/\n+/g,`$&${f}`));let _=(b?f?"2":"1":"")+h;if(e&&(_+=" "+c(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!p){const A=n.replace(/\n+/g,`
717
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let I=!1;const T=kf(r,!0);a!=="folded"&&t!==Re.BLOCK_FOLDED&&(T.onOverflow=()=>{I=!0});const O=Nf(`${S}${A}${y}`,f,Sb,T);if(!I)return`>${_}
718
+ ${f}${O}`}return n=n.replace(/\n+/g,`$&${f}`),`|${_}
719
+ ${f}${S}${n}${y}`}function BK(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&i.includes(`
720
+ `)||p&&/[[\]{},]/.test(i))return Mo(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return c||p||!i.includes(`
721
+ `)?Mo(i,t):pd(e,t,n,r);if(!c&&!p&&s!==Re.PLAIN&&i.includes(`
722
+ `))return pd(e,t,n,r);if(Sf(i)){if(d==="")return t.forceBlockIndent=!0,pd(e,t,n,r);if(c&&d===f)return Mo(i,t)}const h=i.replace(/\n+/g,`$&
723
+ ${d}`);if(a){const g=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(h))},{compat:y,tags:w}=t.doc.schema;if(w.some(g)||y!=null&&y.some(g))return Mo(i,t)}return c?h:Nf(h,d,pP,kf(t,!1))}function Lw(e,t,n,r){const{implicitKey:s,inFlow:i}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=Re.QUOTE_DOUBLE);const d=p=>{switch(p){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return s||i?Mo(a.value,t):pd(a,t,n,r);case Re.QUOTE_DOUBLE:return kl(a.value,t);case Re.QUOTE_SINGLE:return Cb(a.value,t);case Re.PLAIN:return BK(a,t,n,r);default:return null}};let f=d(c);if(f===null){const{defaultKeyType:p,defaultStringType:h}=t.options,g=s&&p||h;if(f=d(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function mP(e,t){const n=Object.assign({blockQuote:!0,commentString:FK,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 zK(e,t){var s;if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(Xe(t)){r=t.value;let i=e.filter(a=>{var c;return(c=a.identify)==null?void 0:c.call(a,r)});if(i.length>1){const a=i.filter(c=>c.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function VK(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Xe(e)||ft(e))&&e.anchor;i&&cP(i)&&(n.add(i),s.push(`&${i}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function Qo(e,t,n,r){var d;if(pt(e))return e.toString(t,n,r);if(Li(e)){if(t.doc.directives)return e.toString(t);if((d=t.resolvedAliases)!=null&&d.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 i=ht(e)?e:t.doc.createNode(e,{onTagObj:f=>s=f});s??(s=zK(t.doc.schema.tags,i));const a=VK(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const c=typeof s.stringify=="function"?s.stringify(i,t,n,r):Xe(i)?Lw(i,t,n,r):i.toString(t,n,r);return a?Xe(i)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
724
+ ${t.indent}${c}`:c}function HK({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:h}}=n;let g=ht(e)&&e.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ft(e)||!ht(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let y=!h&&(!e||g&&t==null&&!n.inFlow||ft(e)||(Xe(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(h||!i),indent:c+d});let w=!1,b=!1,v=Qo(e,n,()=>w=!0,()=>b=!0);if(!y&&!n.inFlow&&v.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(n.inFlow){if(i||t==null)return w&&r&&r(),v===""?"?":y?`? ${v}`:v}else if(i&&!h||t==null&&y)return v=`? ${v}`,g&&!w?v+=vi(v,n.indent,f(g)):b&&s&&s(),v;w&&(g=null),y?(g&&(v+=vi(v,n.indent,f(g))),v=`? ${v}
725
+ ${c}:`):(v=`${v}:`,g&&(v+=vi(v,n.indent,f(g))));let N,S,k;ht(t)?(N=!!t.spaceBefore,S=t.commentBefore,k=t.comment):(N=!1,S=null,k=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!y&&!g&&Xe(t)&&(n.indentAtStart=v.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!y&&lc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const A=Qo(t,n,()=>_=!0,()=>b=!0);let I=" ";if(g||N||S){if(I=N?`
726
+ `:"",S){const T=f(S);I+=`
727
+ ${Qr(T,n.indent)}`}A===""&&!n.inFlow?I===`
728
+ `&&k&&(I=`
729
+
730
+ `):I+=`
731
+ ${n.indent}`}else if(!y&&ft(t)){const T=A[0],O=A.indexOf(`
732
+ `),L=O!==-1,B=n.inFlow??t.flow??t.items.length===0;if(L||!B){let M=!1;if(L&&(T==="&"||T==="!")){let P=A.indexOf(" ");T==="&"&&P!==-1&&P<O&&A[P+1]==="!"&&(P=A.indexOf(" ",P+1)),(P===-1||O<P)&&(M=!0)}M||(I=`
733
+ ${n.indent}`)}}else(A===""||A[0]===`
734
+ `)&&(I="");return v+=I+A,n.inFlow?_&&r&&r():k&&!_?v+=vi(v,n.indent,f(k)):b&&s&&s(),v}function gP(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ku="<<",Zr={identify:e=>e===Ku||typeof e=="symbol"&&e.description===Ku,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Re(Symbol(Ku)),{addToJSMap:yP}),stringify:()=>Ku},UK=(e,t)=>(Zr.identify(t)||Xe(t)&&(!t.type||t.type===Re.PLAIN)&&Zr.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Zr.tag&&n.default));function yP(e,t,n){if(n=e&&Li(n)?n.resolve(e.doc):n,lc(n))for(const r of n.items)wm(e,t,r);else if(Array.isArray(n))for(const r of n)wm(e,t,r);else wm(e,t,n)}function wm(e,t,n){const r=e&&Li(n)?n.resolve(e.doc):n;if(!ac(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,a]of s)t instanceof Map?t.has(i)||t.set(i,a):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function xP(e,t,{key:n,value:r}){if(ht(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(UK(e,n))yP(e,t,r);else{const s=Tn(n,"",e);if(t instanceof Map)t.set(s,Tn(r,s,e));else if(t instanceof Set)t.add(s);else{const i=WK(n,s,e),a=Tn(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function WK(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ht(e)&&(n!=null&&n.doc)){const r=mP(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),gP(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function Dw(e,t,n){const r=Bl(e,void 0,n),s=Bl(t,void 0,n);return new Vt(r,s)}class Vt{constructor(t,n=null){Object.defineProperty(this,Mn,{value:aP}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return ht(n)&&(n=n.clone(t)),ht(r)&&(r=r.clone(t)),new Vt(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return xP(n,r,this)}toString(t,n,r){return t!=null&&t.doc?HK(this,t,n,r):JSON.stringify(this)}}function vP(e,t,n){return(t.inFlow??e.flow?GK:KK)(e,t,n)}function KK({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:c}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:i,type:null});let h=!1;const g=[];for(let w=0;w<t.length;++w){const b=t[w];let v=null;if(ht(b))!h&&b.spaceBefore&&g.push(""),$d(n,g,b.commentBefore,h),b.comment&&(v=b.comment);else if(pt(b)){const S=ht(b.key)?b.key:null;S&&(!h&&S.spaceBefore&&g.push(""),$d(n,g,S.commentBefore,h))}h=!1;let N=Qo(b,p,()=>v=null,()=>h=!0);v&&(N+=vi(N,i,f(v))),h&&v&&(h=!1),g.push(r+N)}let y;if(g.length===0)y=s.start+s.end;else{y=g[0];for(let w=1;w<g.length;++w){const b=g[w];y+=b?`
735
+ ${d}${b}`:`
736
+ `}}return e?(y+=`
737
+ `+Qr(f(e),d),c&&c()):h&&a&&a(),y}function GK({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:a,options:{commentString:c}}=t;r+=i;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const h=[];for(let w=0;w<e.length;++w){const b=e[w];let v=null;if(ht(b))b.spaceBefore&&h.push(""),$d(t,h,b.commentBefore,!1),b.comment&&(v=b.comment);else if(pt(b)){const S=ht(b.key)?b.key:null;S&&(S.spaceBefore&&h.push(""),$d(t,h,S.commentBefore,!1),S.comment&&(f=!0));const k=ht(b.value)?b.value:null;k?(k.comment&&(v=k.comment),k.commentBefore&&(f=!0)):b.value==null&&(S!=null&&S.comment)&&(v=S.comment)}v&&(f=!0);let N=Qo(b,d,()=>v=null);w<e.length-1&&(N+=","),v&&(N+=vi(N,r,c(v))),!f&&(h.length>p||N.includes(`
738
+ `))&&(f=!0),h.push(N),p=h.length}const{start:g,end:y}=n;if(h.length===0)return g+y;if(!f){const w=h.reduce((b,v)=>b+v.length+2,2);f=t.options.lineWidth>0&&w>t.options.lineWidth}if(f){let w=g;for(const b of h)w+=b?`
739
+ ${i}${s}${b}`:`
740
+ `;return`${w}
741
+ ${s}${y}`}else return`${g}${a}${h.join(" ")}${a}${y}`}function $d({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Qr(t(r),e);n.push(i.trimStart())}}function bi(e,t){const n=Xe(t)?t.value:t;for(const r of e)if(pt(r)&&(r.key===t||r.key===n||Xe(r.key)&&r.key.value===n))return r}class An extends hP{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Bs,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),c=(d,f)=>{if(typeof i=="function")f=i.call(n,d,f);else if(Array.isArray(i)&&!i.includes(d))return;(f!==void 0||s)&&a.items.push(Dw(d,f,r))};if(n instanceof Map)for(const[d,f]of n)c(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))c(d,n[d]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;pt(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Vt(t,t==null?void 0:t.value):r=new Vt(t.key,t.value);const s=bi(this.items,r.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Xe(s.value)&&fP(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const c=this.items.findIndex(d=>i(r,d)<0);c===-1?this.items.push(r):this.items.splice(c,0,r)}else this.items.push(r)}delete(t){const n=bi(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=bi(this.items,t),s=r==null?void 0:r.value;return(!n&&Xe(s)?s.value:s)??void 0}has(t){return!!bi(this.items,t)}set(t,n){this.add(new Vt(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 i of this.items)xP(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!pt(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})),vP(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const oa={collection:"map",default:!0,nodeClass:An,tag:"tag:yaml.org,2002:map",resolve(e,t){return ac(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>An.from(e,t,n)};class Ri extends hP{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(sa,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Gu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Gu(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Xe(s)?s.value:s}has(t){const n=Gu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Gu(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];Xe(s)&&fP(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 i of this.items)r.push(Tn(i,String(s++),n));return r}toString(t,n,r){return t?vP(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,i=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof s=="function"){const d=n instanceof Set?c:String(a++);c=s.call(n,d,c)}i.items.push(Bl(c,void 0,r))}}return i}}function Gu(e){let t=Xe(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const aa={collection:"seq",default:!0,nodeClass:Ri,tag:"tag:yaml.org,2002:seq",resolve(e,t){return lc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ri.from(e,t,n)},Cf={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),Lw(e,t,n,r)}},_f={identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Re(null),stringify:({source:e},t)=>typeof e=="string"&&_f.test.test(e)?e:t.options.nullStr},$w={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Re(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&$w.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 ar({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 i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let c=t-(i.length-a-1);for(;c-- >0;)i+="0"}return i}const bP={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:ar},wP={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():ar(e)}},NP={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 Re(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ar},Ef=e=>typeof e=="bigint"||Number.isInteger(e),Fw=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function kP(e,t,n){const{value:r}=e;return Ef(r)&&r>=0?n+r.toString(t):ar(e)}const SP={identify:e=>Ef(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Fw(e,2,8,n),stringify:e=>kP(e,8,"0o")},CP={identify:Ef,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Fw(e,0,10,n),stringify:ar},_P={identify:e=>Ef(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Fw(e,2,16,n),stringify:e=>kP(e,16,"0x")},YK=[oa,aa,Cf,_f,$w,SP,CP,_P,bP,wP,NP];function oC(e){return typeof e=="bigint"||Number.isInteger(e)}const Yu=({value:e})=>JSON.stringify(e),XK=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Yu},{identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Yu},{identify:oC,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})=>oC(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:Yu}],QK={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},JK=[oa,aa].concat(XK,QK),qw={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,i){if(!n)return"";const a=n;let c;if(typeof btoa=="function"){let d="";for(let f=0;f<a.length;++f)d+=String.fromCharCode(a[f]);c=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Re.BLOCK_LITERAL),t!==Re.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/d),p=new Array(f);for(let h=0,g=0;h<f;++h,g+=d)p[h]=c.substr(g,d);c=p.join(t===Re.BLOCK_LITERAL?`
742
+ `:" ")}return Lw({comment:e,type:t,value:c},r,s,i)}};function EP(e,t){if(lc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!pt(r)){if(ac(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new Vt(new Re(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
743
+ ${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment}
744
+ ${i.comment}`:r.comment}r=s}e.items[n]=pt(r)?r:new Vt(r)}}else t("Expected a sequence for this tag");return e}function jP(e,t,n){const{replacer:r}=n,s=new Ri(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(i++),a));let c,d;if(Array.isArray(a))if(a.length===2)c=a[0],d=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const f=Object.keys(a);if(f.length===1)c=f[0],d=a[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=a;s.items.push(Dw(c,d,n))}return s}const Bw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:EP,createNode:jP};class Fo extends Ri{constructor(){super(),this.add=An.prototype.add.bind(this),this.delete=An.prototype.delete.bind(this),this.get=An.prototype.get.bind(this),this.has=An.prototype.has.bind(this),this.set=An.prototype.set.bind(this),this.tag=Fo.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 i,a;if(pt(s)?(i=Tn(s.key,"",n),a=Tn(s.value,i,n)):i=Tn(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,a)}return r}static from(t,n,r){const s=jP(t,n,r),i=new this;return i.items=s.items,i}}Fo.tag="tag:yaml.org,2002:omap";const zw={collection:"seq",identify:e=>e instanceof Map,nodeClass:Fo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=EP(e,t),r=[];for(const{key:s}of n.items)Xe(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Fo,n)},createNode:(e,t,n)=>Fo.from(e,t,n)};function AP({value:e,source:t},n){return t&&(e?TP:IP).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const TP={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 Re(!0),stringify:AP},IP={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 Re(!1),stringify:AP},ZK={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:ar},eG={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():ar(e)}},tG={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 Re(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:ar},cc=e=>typeof e=="bigint"||Number.isInteger(e);function jf(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 i=parseInt(e,n);return s==="-"?-1*i:i}function Vw(e,t,n){const{value:r}=e;if(cc(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return ar(e)}const nG={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>jf(e,2,2,n),stringify:e=>Vw(e,2,"0b")},rG={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>jf(e,1,8,n),stringify:e=>Vw(e,8,"0")},sG={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>jf(e,0,10,n),stringify:ar},iG={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>jf(e,2,16,n),stringify:e=>Vw(e,16,"0x")};class qo extends An{constructor(t){super(t),this.tag=qo.tag}add(t){let n;pt(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Vt(t.key,null):n=new Vt(t,null),bi(this.items,n.key)||this.items.push(n)}get(t,n){const r=bi(this.items,t);return!n&&pt(r)?Xe(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=bi(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Vt(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,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),i.items.push(Dw(a,null,r));return i}}qo.tag="tag:yaml.org,2002:set";const Hw={collection:"map",identify:e=>e instanceof Set,nodeClass:qo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>qo.from(e,t,n),resolve(e,t){if(ac(e)){if(e.hasAllNullValues(!0))return Object.assign(new qo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Uw(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),i=r.replace(/_/g,"").split(":").reduce((a,c)=>a*s(60)+s(c),s(0));return n==="-"?s(-1)*i:i}function MP(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return ar(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const RP={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})=>Uw(e,n),stringify:MP},OP={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=>Uw(e,!1),stringify:MP},Af={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(Af.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,c]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,s,i||0,a||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let h=Uw(p,!1);Math.abs(h)<30&&(h*=60),f-=6e4*h}return new Date(f)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},aC=[oa,aa,Cf,_f,TP,IP,nG,rG,sG,iG,ZK,eG,tG,qw,Zr,zw,Bw,Hw,RP,OP,Af],lC=new Map([["core",YK],["failsafe",[oa,aa,Cf]],["json",JK],["yaml11",aC],["yaml-1.1",aC]]),cC={binary:qw,bool:$w,float:NP,floatExp:wP,floatNaN:bP,floatTime:OP,int:CP,intHex:_P,intOct:SP,intTime:RP,map:oa,merge:Zr,null:_f,omap:zw,pairs:Bw,seq:aa,set:Hw,timestamp:Af},oG={"tag:yaml.org,2002:binary":qw,"tag:yaml.org,2002:merge":Zr,"tag:yaml.org,2002:omap":zw,"tag:yaml.org,2002:pairs":Bw,"tag:yaml.org,2002:set":Hw,"tag:yaml.org,2002:timestamp":Af};function Nm(e,t,n){const r=lC.get(t);if(r&&!e)return n&&!r.includes(Zr)?r.concat(Zr):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(lC.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Zr)),s.reduce((i,a)=>{const c=typeof a=="string"?cC[a]:a;if(!c){const d=JSON.stringify(a),f=Object.keys(cC).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return i.includes(c)||i.push(c),i},[])}const aG=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Ww{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?Nm(t,"compat"):t?Nm(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?oG:{},this.tags=Nm(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Bs,{value:oa}),Object.defineProperty(this,Mr,{value:Cf}),Object.defineProperty(this,sa,{value:aa}),this.sortMapEntries=typeof a=="function"?a:a===!0?aG:null}clone(){const t=Object.create(Ww.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function lG(e,t){var d;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const f=e.directives.toString(e);f?(n.push(f),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=mP(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=i(e.commentBefore);n.unshift(Qr(f,""))}let a=!1,c=null;if(e.contents){if(ht(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const h=i(e.contents.commentBefore);n.push(Qr(h,""))}s.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>a=!0;let p=Qo(e.contents,s,()=>c=null,f);c&&(p+=vi(p,"",i(c))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(Qo(e.contents,s));if((d=e.directives)!=null&&d.docEnd)if(e.comment){const f=i(e.comment);f.includes(`
745
+ `)?(n.push("..."),n.push(Qr(f,""))):n.push(`... ${f}`)}else n.push("...");else{let f=e.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||c)&&n[n.length-1]!==""&&n.push(""),n.push(Qr(i(f),"")))}return n.join(`
746
+ `)+`
747
+ `}class uc{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Mn,{value:kb});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new zt({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(uc.prototype,{[Mn]:{value:kb}});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=ht(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ko(this.contents)&&this.contents.add(t)}addIn(t,n){ko(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=uP(this);t.anchor=!n||r.has(n)?dP(n||"a",r):n}return new Pw(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 v=S=>typeof S=="number"||S instanceof String||S instanceof Number,N=n.filter(v).map(String);N.length>0&&(n=n.concat(N)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:g,sourceObjects:y}=LK(this,a||"a"),w={aliasDuplicateObjects:i??!0,keepUndefined:d??!1,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:y},b=Bl(t,p,w);return c&&ft(b)&&(b.flow=!0),g(),b}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new Vt(s,i)}delete(t){return ko(this.contents)?this.contents.delete(t):!1}deleteIn(t){return cl(t)?this.contents==null?!1:(this.contents=null,!0):ko(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ft(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return cl(t)?!n&&Xe(this.contents)?this.contents.value:this.contents:ft(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ft(this.contents)?this.contents.has(t):!1}hasIn(t){return cl(t)?this.contents!==void 0:ft(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Dd(this.schema,[t],n):ko(this.contents)&&this.contents.set(t,n)}setIn(t,n){cl(t)?this.contents=n:this.contents==null?this.contents=Dd(this.schema,Array.from(t),n):ko(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 zt({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 zt({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 Ww(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:i,reviver:a}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},d=Tn(this.contents,n??"",c);if(typeof i=="function")for(const{count:f,res:p}of c.anchors.values())i(p,f);return typeof a=="function"?Io(a,{"":d},"",d):d}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 lG(this,t)}}function ko(e){if(ft(e))return!0;throw new Error("Expected a YAML collection as document contents")}class PP extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class ul extends PP{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class cG extends PP{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const uC=(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 i=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const c=Math.min(i-39,a.length-79);a="…"+a.substring(c),i-=c-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
748
+ `),a=c+a}if(/[^ ]/.test(a)){let c=1;const d=n.linePos[1];(d==null?void 0:d.line)===r&&d.col>s&&(c=Math.max(1,Math.min(d.col-s,80-i)));const f=" ".repeat(i)+"^".repeat(c);n.message+=`:
749
+
750
+ ${a}
751
+ ${f}
752
+ `}};function Jo(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:c}){let d=!1,f=c,p=c,h="",g="",y=!1,w=!1,b=null,v=null,N=null,S=null,k=null,_=null,A=null;for(const O of e)switch(w&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&i(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),b&&(f&&O.type!=="comment"&&O.type!=="newline"&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),O.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&O.source.includes(" ")&&(b=O),p=!0;break;case"comment":{p||i(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=O.source.substring(1)||" ";h?h+=g+L:h=L,g="",f=!1;break}case"newline":f?h?h+=O.source:(!_||n!=="seq-item-ind")&&(d=!0):g+=O.source,f=!0,y=!0,(v||N)&&(S=O),p=!0;break;case"anchor":v&&i(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&i(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=O,A??(A=O.offset),f=!1,p=!1,w=!0;break;case"tag":{N&&i(O,"MULTIPLE_TAGS","A node can have at most one tag"),N=O,A??(A=O.offset),f=!1,p=!1,w=!0;break}case n:(v||N)&&i(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),_&&i(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),_=O,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){k&&i(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=O,f=!1,p=!1;break}default:i(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),f=!1,p=!1}const I=e[e.length-1],T=I?I.offset+I.source.length:s;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(f&&b.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:_,spaceBefore:d,comment:h,hasNewline:y,anchor:v,tag:N,newlineAfterProp:S,end:T,start:A??T}}function zl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
753
+ `))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(zl(t.key)||zl(t.value))return!0}return!1;default:return!0}}function Eb(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&zl(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function LP(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||Xe(i)&&Xe(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const dC="All mapping items must start at the same column";function uG({composeNode:e,composeEmptyNode:t},n,r,s,i){var p;const a=(i==null?void 0:i.nodeClass)??An,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const h of r.items){const{start:g,key:y,sep:w,value:b}=h,v=Jo(g,{indicator:"explicit-key-ind",next:y??(w==null?void 0:w[0]),offset:d,onError:s,parentIndent:r.indent,startOnNewline:!0}),N=!v.found;if(N){if(y&&(y.type==="block-seq"?s(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&s(d,"BAD_INDENT",dC)),!v.anchor&&!v.tag&&!w){f=v.end,v.comment&&(c.comment?c.comment+=`
754
+ `+v.comment:c.comment=v.comment);continue}(v.newlineAfterProp||zl(y))&&s(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=v.found)==null?void 0:p.indent)!==r.indent&&s(d,"BAD_INDENT",dC);n.atKey=!0;const S=v.end,k=y?e(n,y,v,s):t(n,S,g,null,v,s);n.schema.compat&&Eb(r.indent,y,s),n.atKey=!1,LP(n,c.items,k)&&s(S,"DUPLICATE_KEY","Map keys must be unique");const _=Jo(w??[],{indicator:"map-value-ind",next:b,offset:k.range[2],onError:s,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=_.end,_.found){N&&((b==null?void 0:b.type)==="block-map"&&!_.hasNewline&&s(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.start<_.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 A=b?e(n,b,_,s):t(n,d,w,null,_,s);n.schema.compat&&Eb(r.indent,b,s),d=A.range[2];const I=new Vt(k,A);n.options.keepSourceTokens&&(I.srcToken=h),c.items.push(I)}else{N&&s(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(k.comment?k.comment+=`
755
+ `+_.comment:k.comment=_.comment);const A=new Vt(k);n.options.keepSourceTokens&&(A.srcToken=h),c.items.push(A)}}return f&&f<d&&s(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,d,f??d],c}function dG({composeNode:e,composeEmptyNode:t},n,r,s,i){const a=(i==null?void 0:i.nodeClass)??Ri,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:h}of r.items){const g=Jo(p,{indicator:"seq-item-ind",next:h,offset:d,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)(h==null?void 0:h.type)==="block-seq"?s(g.end,"BAD_INDENT","All sequence items must start at the same column"):s(d,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(c.comment=g.comment);continue}const y=h?e(n,h,g,s):t(n,g.end,p,null,g,s);n.schema.compat&&Eb(r.indent,h,s),d=y.range[2],c.items.push(y)}return c.range=[r.offset,d,f??d],c}function dc(e,t,n,r){let s="";if(e){let i=!1,a="";for(const c of e){const{source:d,type:f}=c;switch(f){case"space":i=!0;break;case"comment":{n&&!i&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";s?s+=a+p:s=p,a="";break}case"newline":s&&(a+=d),i=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:s,offset:t}}const km="Block collections are not allowed within flow collections",Sm=e=>e&&(e.type==="block-map"||e.type==="block-seq");function fG({composeNode:e,composeEmptyNode:t},n,r,s,i){var v;const a=r.start.source==="{",c=a?"flow map":"flow sequence",d=(i==null?void 0:i.nodeClass)??(a?An:Ri),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let h=r.offset+r.start.source.length;for(let N=0;N<r.items.length;++N){const S=r.items[N],{start:k,key:_,sep:A,value:I}=S,T=Jo(k,{flow:c,indicator:"explicit-key-ind",next:_??(A==null?void 0:A[0]),offset:h,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!A&&!I){N===0&&T.comma?s(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):N<r.items.length-1&&s(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),T.comment&&(f.comment?f.comment+=`
756
+ `+T.comment:f.comment=T.comment),h=T.end;continue}!a&&n.options.strict&&zl(_)&&s(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)T.comma&&s(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(T.comma||s(T.start,"MISSING_CHAR",`Missing , between ${c} items`),T.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=f.items[f.items.length-1];pt(L)&&(L=L.value??L.key),L.comment?L.comment+=`
757
+ `+O:L.comment=O,T.comment=T.comment.substring(O.length+1)}}if(!a&&!A&&!T.found){const O=I?e(n,I,T,s):t(n,T.end,A,null,T,s);f.items.push(O),h=O.range[2],Sm(I)&&s(O.range,"BLOCK_IN_FLOW",km)}else{n.atKey=!0;const O=T.end,L=_?e(n,_,T,s):t(n,O,k,null,T,s);Sm(_)&&s(L.range,"BLOCK_IN_FLOW",km),n.atKey=!1;const B=Jo(A??[],{flow:c,indicator:"map-value-ind",next:I,offset:L.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(B.found){if(!a&&!T.found&&n.options.strict){if(A)for(const H of A){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}}T.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 I&&("source"in I&&((v=I.source)==null?void 0:v[0])===":"?s(I,"MISSING_CHAR",`Missing space after : in ${c}`):s(B.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const M=I?e(n,I,B,s):B.found?t(n,B.end,A,null,B,s):null;M?Sm(I)&&s(M.range,"BLOCK_IN_FLOW",km):B.comment&&(L.comment?L.comment+=`
758
+ `+B.comment:L.comment=B.comment);const P=new Vt(L,M);if(n.options.keepSourceTokens&&(P.srcToken=S),a){const H=f;LP(n,H.items,L)&&s(O,"DUPLICATE_KEY","Map keys must be unique"),H.items.push(P)}else{const H=new An(n.schema);H.flow=!0,H.items.push(P);const D=(M??L).range;H.range=[L.range[0],D[1],D[2]],f.items.push(H)}h=M?M.range[2]:B.end}}const g=a?"}":"]",[y,...w]=r.end;let b=h;if((y==null?void 0:y.source)===g)b=y.offset+y.source.length;else{const N=c[0].toUpperCase()+c.substring(1),S=p?`${N} must end with a ${g}`:`${N} in block collection must be sufficiently indented and end with a ${g}`;s(h,p?"MISSING_CHAR":"BAD_INDENT",S),y&&y.source.length!==1&&w.unshift(y)}if(w.length>0){const N=dc(w,b,n.options.strict,s);N.comment&&(f.comment?f.comment+=`
759
+ `+N.comment:f.comment=N.comment),f.range=[r.offset,b,N.offset]}else f.range=[r.offset,b,b];return f}function Cm(e,t,n,r,s,i){const a=n.type==="block-map"?uG(e,t,n,r,i):n.type==="block-seq"?dG(e,t,n,r,i):fG(e,t,n,r,i),c=a.constructor;return s==="!"||s===c.tagName?(a.tag=c.tagName,a):(s&&(a.tag=s),a)}function hG(e,t,n,r,s){var g;const i=r.tag,a=i?t.directives.tagName(i.source,y=>s(i,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:w}=r,b=y&&i?y.offset>i.offset?y:i:y??i;b&&(!w||w.offset<b.offset)&&s(b,"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(!i||!a||a==="!"||a===An.tagName&&c==="map"||a===Ri.tagName&&c==="seq")return Cm(e,t,n,s,a);let d=t.schema.tags.find(y=>y.tag===a&&y.collection===c);if(!d){const y=t.schema.knownTags[a];if((y==null?void 0:y.collection)===c)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?s(i,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Cm(e,t,n,s,a)}const f=Cm(e,t,n,s,a,d),p=((g=d.resolve)==null?void 0:g.call(d,f,y=>s(i,"TAG_RESOLVE_FAILED",y),t.options))??f,h=ht(p)?p:new Re(p);return h.range=f.range,h.tag=a,d!=null&&d.format&&(h.format=d.format),h}function pG(e,t,n){const r=t.offset,s=mG(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?Re.BLOCK_FOLDED:Re.BLOCK_LITERAL,a=t.source?gG(t.source):[];let c=a.length;for(let b=a.length-1;b>=0;--b){const v=a[b][1];if(v===""||v==="\r")c=b;else break}if(c===0){const b=s.chomp==="+"&&a.length>0?`
760
+ `.repeat(Math.max(1,a.length-1)):"";let v=r+s.length;return t.source&&(v+=t.source.length),{value:b,type:i,comment:s.comment,range:[r,v,v]}}let d=t.indent+s.indent,f=t.offset+s.length,p=0;for(let b=0;b<c;++b){const[v,N]=a[b];if(N===""||N==="\r")s.indent===0&&v.length>d&&(d=v.length);else{v.length<d&&n(f+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(d=v.length),p=b,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=v.length+N.length+1}for(let b=a.length-1;b>=c;--b)a[b][0].length>d&&(c=b+1);let h="",g="",y=!1;for(let b=0;b<p;++b)h+=a[b][0].slice(d)+`
761
+ `;for(let b=p;b<c;++b){let[v,N]=a[b];f+=v.length+N.length+1;const S=N[N.length-1]==="\r";if(S&&(N=N.slice(0,-1)),N&&v.length<d){const _=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(f-N.length-(S?2:1),"BAD_INDENT",_),v=""}i===Re.BLOCK_LITERAL?(h+=g+v.slice(d)+N,g=`
762
+ `):v.length>d||N[0]===" "?(g===" "?g=`
763
+ `:!y&&g===`
764
+ `&&(g=`
765
+
766
+ `),h+=g+v.slice(d)+N,g=`
767
+ `,y=!0):N===""?g===`
768
+ `?h+=`
769
+ `:g=`
770
+ `:(h+=g+N,g=" ",y=!1)}switch(s.chomp){case"-":break;case"+":for(let b=c;b<a.length;++b)h+=`
771
+ `+a[b][0].slice(d);h[h.length-1]!==`
772
+ `&&(h+=`
773
+ `);break;default:h+=`
774
+ `}const w=r+s.length+t.source.length;return{value:h,type:i,comment:s.comment,range:[r,w,w]}}function mG({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],i=s[0];let a=0,c="",d=-1;for(let g=1;g<s.length;++g){const y=s[g];if(!c&&(y==="-"||y==="+"))c=y;else{const w=Number(y);!a&&w?a=w:d===-1&&(d=e+g)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let f=!1,p="",h=s.length;for(let g=1;g<t.length;++g){const y=t[g];switch(y.type){case"space":f=!0;case"newline":h+=y.source.length;break;case"comment":n&&!f&&r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=y.source.length,p=y.source.substring(1);break;case"error":r(y,"UNEXPECTED_TOKEN",y.message),h+=y.source.length;break;default:{const w=`Unexpected token in block scalar header: ${y.type}`;r(y,"UNEXPECTED_TOKEN",w);const b=y.source;b&&typeof b=="string"&&(h+=b.length)}}}return{mode:i,indent:a,chomp:c,comment:p,length:h}}function gG(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)i.push([t[a],t[a+1]]);return i}function yG(e,t,n){const{offset:r,type:s,source:i,end:a}=e;let c,d;const f=(g,y,w)=>n(r+g,y,w);switch(s){case"scalar":c=Re.PLAIN,d=xG(i,f);break;case"single-quoted-scalar":c=Re.QUOTE_SINGLE,d=vG(i,f);break;case"double-quoted-scalar":c=Re.QUOTE_DOUBLE,d=bG(i,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const p=r+i.length,h=dc(a,p,t,n);return{value:d,type:c,comment:h.comment,range:[r,p,h.offset]}}function xG(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}`),DP(e)}function vG(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),DP(e.slice(1,-1)).replace(/''/g,"'")}function DP(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
775
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
776
+ `,"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],i=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?i===`
777
+ `?s+=i:i=`
778
+ `:(s+=i+r[1],i=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),s+i+((r==null?void 0:r[1])??"")}function bG(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
779
+ `))if(s===`
780
+ `){const{fold:i,offset:a}=wG(e,r);n+=i,r=a}else if(s==="\\"){let i=e[++r];const a=NG[i];if(a)n+=a;else if(i===`
781
+ `)for(i=e[r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="\r"&&e[r+1]===`
782
+ `)for(i=e[++r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="x"||i==="u"||i==="U"){const c={x:2,u:4,U:8}[i];n+=kG(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 i=r;let a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
783
+ `&&!(a==="\r"&&e[r+2]===`
784
+ `)&&(n+=r>i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function wG(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
785
+ `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
786
+ `);)r===`
787
+ `&&(n+=`
788
+ `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const NG={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
789
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function kG(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 $P(e,t,n,r){const{value:s,type:i,comment:a,range:c}=t.type==="block-scalar"?pG(e,t,r):yG(t,e.options.strict,r),d=n?e.directives.tagName(n.source,h=>r(n,"TAG_RESOLVE_FAILED",h)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[Mr]:d?f=SG(e.schema,s,d,n,r):t.type==="scalar"?f=CG(e,s,t,r):f=e.schema[Mr];let p;try{const h=f.resolve(s,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);p=Xe(h)?h:new Re(h)}catch(h){const g=h instanceof Error?h.message:String(h);r(n??t,"TAG_RESOLVE_FAILED",g),p=new Re(s)}return p.range=c,p.source=s,i&&(p.type=i),d&&(p.tag=d),f.format&&(p.format=f.format),a&&(p.comment=a),p}function SG(e,t,n,r,s){var c;if(n==="!")return e[Mr];const i=[];for(const d of e.tags)if(!d.collection&&d.tag===n)if(d.default&&d.test)i.push(d);else return d;for(const d of i)if((c=d.test)!=null&&c.test(t))return d;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[Mr])}function CG({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(c=>{var d;return(c.default===!0||e&&c.default==="key")&&((d=c.test)==null?void 0:d.test(r))})||n[Mr];if(n.compat){const c=n.compat.find(d=>{var f;return d.default&&((f=d.test)==null?void 0:f.test(r))})??n[Mr];if(a.tag!==c.tag){const d=t.tagString(a.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;i(s,"TAG_RESOLVE_FAILED",p,!0)}}return a}function _G(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 EG={composeNode:FP,composeEmptyNode:Kw};function FP(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=jG(e,t,r),(c||d)&&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":f=$P(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=hG(EG,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const h=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",h),f=Kw(e,t.offset,void 0,null,n,r),p=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!Xe(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(f.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?f.comment=a:f.commentBefore=a),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function Kw(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:c,end:d},f){const p={type:"scalar",offset:_G(t,n,r),indent:-1,source:""},h=$P(e,p,c,f);return a&&(h.anchor=a.source.substring(1),h.anchor===""&&f(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(h.spaceBefore=!0),i&&(h.comment=i,h.range[2]=d),h}function jG({options:e},{offset:t,source:n,end:r},s){const i=new Pw(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,c=dc(r,a,e.strict,s);return i.range=[t,a,c.offset],c.comment&&(i.comment=c.comment),i}function AG(e,t,{offset:n,start:r,value:s,end:i},a){const c=Object.assign({_directives:t},e),d=new uc(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=Jo(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!p.hasNewline&&a(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=s?FP(f,s,p,a):Kw(f,p.end,r,null,p,a);const h=d.contents.range[2],g=dc(i,h,!1,a);return g.comment&&(d.comment=g.comment),d.range=[n,h,g.offset],d}function sl(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 fC(e){var s;let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":r?`
790
+
791
+ `:`
792
+ `)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[i+1])==null?void 0:s[0])!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class TG{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const a=sl(n);i?this.warnings.push(new cG(a,r,s)):this.errors.push(new ul(a,r,s))},this.directives=new zt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=fC(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment}
793
+ ${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(ft(i)&&!i.flow&&i.items.length>0){let a=i.items[0];pt(a)&&(a=a.key);const c=a.commentBefore;a.commentBefore=c?`${r}
794
+ ${c}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r}
795
+ ${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:fC(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 i=sl(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=AG(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 ul(sl(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 ul(sl(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=dc(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}
796
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ul(sl(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 uc(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 qP="\uFEFF",BP="",zP="",jb="";function IG(e){switch(e){case qP:return"byte-order-mark";case BP:return"doc-mode";case zP:return"flow-error-end";case jb:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
797
+ `:case`\r
798
+ `: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 Wn(e){switch(e){case void 0:case" ":case`
799
+ `:case"\r":case" ":return!0;default:return!1}}const hC=new Set("0123456789ABCDEFabcdef"),MG=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xu=new Set(",[]{}"),RG=new Set(` ,[]{}
800
+ \r `),_m=e=>!e||RG.has(e);class OG{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===`
801
+ `?!0:n==="\r"?this.buffer[t+1]===`
802
+ `:!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===`
803
+ `||!s&&!this.atEnd)return t+r+1}return n===`
804
+ `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Wn(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(`
805
+ `,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]===qP&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const i=t[r-1];if(i===" "||i===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const i=t[n-1];if(i===" "||i===" ")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 BP,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==="...")&&Wn(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&&!Wn(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===":")&&Wn(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(_m),"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("..."))&&Wn(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield zP,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"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(_m),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||Wn(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 i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
806
+ `,this.pos);if(s!==-1){for(;s!==-1;){const i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
807
+ `,i)}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=>Wn(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
808
+ `:t=i,n=0;break;case"\r":{const a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
809
+ `)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 i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(`
810
+ `,i)}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===`
811
+ `;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let i=t-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);const c=i;for(;a===" ";)a=this.buffer[--i];if(a===`
812
+ `&&i>=this.pos&&i+1+n>c)t=i;else break}while(!0);return yield jb,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 i=this.buffer[r+1];if(Wn(i)||t&&Xu.has(i))break;n=r}else if(Wn(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
813
+ `?(r+=1,s=`
814
+ `,i=this.buffer[r+1]):n=r),i==="#"||t&&Xu.has(i))break;if(s===`
815
+ `){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Xu.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield jb,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(_m))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Wn(n)||t&&Xu.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(;!Wn(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(MG.has(n))n=this.buffer[++t];else if(n==="%"&&hC.has(this.buffer[t+1])&&hC.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===`
816
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
817
+ `?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 PG{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const i=n+r>>1;this.lineStarts[i]<t?n=i+1:r=i}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 Ds(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function pC(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 VP(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 Qu(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 So(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 mC(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ds(t.start,"explicit-key-ind")&&!Ds(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,VP(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 LG{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 OG,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=IG(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"&&mC(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&&pC(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.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":{pC(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=Qu(this.peek(2)),r=So(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const i={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]=i}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(`
818
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
819
+ `,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,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.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],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.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,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const c=[];for(let d=0;d<n.sep.length;++d){const f=n.sep[d];switch(f.type){case"newline":c.push(d);break;case"space":break;case"comment":f.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":i||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):i||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(Ds(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(VP(n.key)&&!Ds(n.sep,"newline")){const c=So(n.start),d=n.key,f=n.sep;f.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:d,sep:f}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ds(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=So(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||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Ds(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);i||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&&!Ds(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,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.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],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.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||Ds(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=Qu(r),i=So(s);mC(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:i,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(`
820
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
821
+ `,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=Qu(t),r=So(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=Qu(t),r=So(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 DG(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new PG||null,prettyErrors:t}}function $G(e,t={}){const{lineCounter:n,prettyErrors:r}=DG(t),s=new LG(n==null?void 0:n.addNewLine),i=new TG(t);let a=null;for(const c of i.compose(s.parse(e),!0,e.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new ul(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(uC(e,n)),a.warnings.forEach(uC(e,n))),a}function HP(e,t,n){let r;const s=$G(e,n);if(!s)return null;if(s.warnings.forEach(i=>gP(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function Fd(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 oc(e)&&!r?e.toString(n):new uc(e,r,n).toString(n)}function FG({value:e,onChange:t}){const[n,r]=E.useState(""),[s,i]=E.useState(null),[a,c]=E.useState(!0);E.useEffect(()=>{try{const f=Fd(e,{indent:2,lineWidth:0});r(f),i(null),c(!0)}catch(f){i(f instanceof Error?f.message:"Failed to serialize"),c(!1)}},[e]);const d=f=>{if(f){r(f);try{const p=HP(f);if(!p.id)throw new Error("Step ID is required");if(!p.action&&!p.workflow)throw new Error("Either action or workflow is required");i(null),c(!0),t(p)}catch(p){i(p instanceof Error?p.message:"Invalid YAML"),c(!1)}}};return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"flex items-center gap-2",children:a?u.jsxs("span",{className:"flex items-center gap-1 text-xs text-success",children:[u.jsx(Vs,{className:"w-3 h-3"}),"Valid YAML"]}):u.jsxs("span",{className:"flex items-center gap-1 text-xs text-error",children:[u.jsx(Oi,{className:"w-3 h-3"}),s]})}),u.jsxs("span",{className:"text-xs text-gray-500",children:[n.split(`
822
+ `).length," lines"]})]}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(wl,{height:"400px",language:"yaml",value:n,onChange:d,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}}})}),u.jsx("div",{className:"text-xs text-gray-500",children:u.jsx("p",{children:"Edit the step configuration directly in YAML format. Changes are applied automatically when valid."})})]})}function qG({value:e,title:t}){const[n,r]=E.useState("");return E.useEffect(()=>{try{const s=Fd(e,{indent:2,lineWidth:0});r(s)}catch{r("# Failed to serialize value")}},[e]),u.jsxs("div",{className:"space-y-2",children:[t&&u.jsx("h4",{className:"text-sm font-medium text-gray-300",children:t}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(wl,{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 BG({inputs:e,onChange:t,availableVariables:n}){const[r,s]=E.useState(""),i=Object.entries(e),a=(h,g)=>{t({...e,[h]:g})},c=h=>{const g={...e};delete g[h],t(g)},d=()=>{r&&!e.hasOwnProperty(r)&&(t({...e,[r]:""}),s(""))},f=(h,g)=>{if(g&&g!==h&&!e.hasOwnProperty(g)){const y={};for(const[w,b]of Object.entries(e))w===h?y[g]=b:y[w]=b;t(y)}},p=(h,g)=>{const y=String(e[h]||"");a(h,y+`{{ ${g} }}`)};return u.jsxs("div",{className:"space-y-4",children:[i.length===0?u.jsx("div",{className:"text-center py-8",children:u.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No inputs defined"})}):u.jsx("div",{className:"space-y-3",children:i.map(([h,g])=>u.jsx(zG,{inputKey:h,value:g,onChange:y=>a(h,y),onRemove:()=>c(h),onRename:y=>f(h,y),availableVariables:n,onInsertVariable:y=>p(h,y)},h))}),u.jsxs("div",{className:"flex gap-2 pt-2 border-t border-node-border",children:[u.jsx("input",{type:"text",value:r,onChange:h=>s(h.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:h=>{h.key==="Enter"&&d()}}),u.jsx(De,{variant:"secondary",size:"sm",onClick:d,disabled:!r||e.hasOwnProperty(r),icon:u.jsx(of,{className:"w-4 h-4"}),children:"Add"})]}),n.length>0&&u.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(ec,{className:"w-4 h-4 text-primary"}),u.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Available Variables"})]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(h=>u.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded",children:h},h))}),u.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Click on an input field, then use the variable button to insert"})]})]})}function zG({inputKey:e,value:t,onChange:n,onRemove:r,onRename:s,availableVariables:i,onInsertVariable:a}){const[c,d]=E.useState(!1),[f,p]=E.useState(e),[h,g]=E.useState(!1),y=typeof t,w=y==="object"&&t!==null,b=Array.isArray(t),v=()=>{f!==e&&s(f),d(!1)},N=()=>b||w?u.jsx("textarea",{value:JSON.stringify(t,null,2),onChange:S=>{try{n(JSON.parse(S.target.value))}catch{n(S.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}):y==="boolean"?u.jsxs("select",{value:String(t),onChange:S=>n(S.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:[u.jsx("option",{value:"true",children:"true"}),u.jsx("option",{value:"false",children:"false"})]}):y==="number"?u.jsx("input",{type:"number",value:String(t),onChange:S=>n(parseFloat(S.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"}):u.jsx(VG,{value:String(t),onChange:S=>n(S),variables:i,placeholder:"Value or {{ variable }}"});return u.jsxs("div",{className:"p-3 bg-node-bg/50 rounded-lg border border-node-border space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[c?u.jsx("input",{type:"text",value:f,onChange:S=>p(S.target.value),onBlur:v,onKeyDown:S=>{S.key==="Enter"&&v(),S.key==="Escape"&&(p(e),d(!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}):u.jsx("button",{onClick:()=>d(!0),className:"flex-1 text-left px-2 py-1 text-sm font-mono text-primary hover:bg-white/5 rounded",children:e}),u.jsx("span",{className:"text-xs text-gray-500",children:y}),u.jsx(De,{variant:"ghost",size:"sm",onClick:r,className:"!p-1 text-gray-400 hover:text-error",children:u.jsx(ea,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"flex gap-2",children:[N(),i.length>0&&!b&&!w&&u.jsxs("div",{className:"relative",children:[u.jsx(De,{variant:"ghost",size:"sm",onClick:()=>g(!h),className:"!p-2",children:u.jsx(ec,{className:"w-4 h-4"})}),h&&u.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:[u.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Insert variable"}),u.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:i.map(S=>u.jsx("button",{onClick:()=>{a(S),g(!1)},className:"w-full text-left px-2 py-1 text-xs font-mono text-primary hover:bg-white/10 rounded",children:S},S))})]})]})]})]})}function VG({value:e,onChange:t,variables:n,placeholder:r}){const[s,i]=E.useState(!1),[a,c]=E.useState(0),[d,f]=E.useState(0),p=E.useRef(null),g=(()=>{const k=e.substring(0,a),_=k.lastIndexOf("{{");if(_===-1)return null;const A=k.substring(_);return A.includes("}}")?null:{text:A.substring(2).trim(),start:_,end:a}})(),y=g?n.filter(k=>k.toLowerCase().includes(g.text.toLowerCase())):[],w=s&&g&&y.length>0,b=k=>{t(k.target.value),c(k.target.selectionStart||0),i(!0),f(0)},v=k=>{const _=k.target;c(_.selectionStart||0)},N=k=>{if(w)switch(k.key){case"ArrowDown":k.preventDefault(),f(_=>_<y.length-1?_+1:0);break;case"ArrowUp":k.preventDefault(),f(_=>_>0?_-1:y.length-1);break;case"Enter":case"Tab":k.preventDefault(),S(y[d]);break;case"Escape":i(!1);break}},S=k=>{if(!g)return;const _=e.substring(0,g.start),A=e.substring(g.end),I=`${_}{{ ${k} }}${A}`;t(I),i(!1),setTimeout(()=>{if(p.current){const T=g.start+k.length+6;p.current.setSelectionRange(T,T),p.current.focus()}},0)};return E.useEffect(()=>{const k=()=>i(!1);return document.addEventListener("click",k),()=>document.removeEventListener("click",k)},[]),u.jsxs("div",{className:"relative flex-1",children:[u.jsx("input",{ref:p,type:"text",value:e,onChange:b,onSelect:v,onKeyDown:N,onFocus:()=>i(!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}),w&&u.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:[u.jsxs("div",{className:"text-xs text-gray-500 px-2 py-1 mb-1",children:['Variables matching "',(g==null?void 0:g.text)||"",'"']}),y.map((k,_)=>u.jsxs("button",{onClick:()=>S(k),className:`w-full text-left px-2 py-1.5 text-xs font-mono rounded flex items-center gap-2 ${_===d?"bg-primary/20 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[u.jsx(ec,{className:"w-3 h-3"}),k]},k)),u.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 gC(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 HG(e,t){const n=e.find(r=>r.field===t);return n==null?void 0:n.message}function UG({open:e,onOpenChange:t,step:n,onSave:r,availableVariables:s}){const[i,a]=E.useState(null),[c,d]=E.useState("properties"),[f,p]=E.useState([]),[h,g]=E.useState(!1);if(E.useEffect(()=>{n&&(a({...n}),d("properties"),p([]),g(!1))},[n]),E.useMemo(()=>i?gC(i):{valid:!0,errors:[]},[i]),!i)return null;const y=()=>{if(!i)return;const v=gC(i);if(p(v.errors),g(!0),v.valid)r(i),t(!1);else{const N=v.errors[0];N&&(N.field==="id"||N.field==="action"||N.field==="workflow"||N.field==="timeout"?d("properties"):N.field==="outputVariable"?d("output"):N.field.startsWith("errorHandling")?d("errors"):N.field.startsWith("conditions")&&d("conditions"))}},w=v=>{a(N=>N?{...N,...v}:null)},b=v=>{if(h)return HG(f,v)};return u.jsxs(rs,{open:e,onOpenChange:t,title:`Edit Step: ${i.name||i.id}`,description:i.action||i.workflow||"Configure step settings",size:"xl",children:[u.jsxs(JO,{value:c,onValueChange:d,children:[u.jsxs(Mw,{children:[u.jsxs(xr,{value:"properties",children:[u.jsx(Ko,{className:"w-4 h-4 mr-1.5"}),"Properties"]}),u.jsxs(xr,{value:"inputs",children:[u.jsx(Rz,{className:"w-4 h-4 mr-1.5"}),"Inputs"]}),u.jsxs(xr,{value:"output",children:[u.jsx(Oz,{className:"w-4 h-4 mr-1.5"}),"Output"]}),u.jsxs(xr,{value:"errors",children:[u.jsx(Zl,{className:"w-4 h-4 mr-1.5"}),"Errors"]}),u.jsxs(xr,{value:"conditions",children:[u.jsx(ZM,{className:"w-4 h-4 mr-1.5"}),"Conditions"]}),u.jsxs(xr,{value:"yaml",children:[u.jsx(uw,{className:"w-4 h-4 mr-1.5"}),"YAML"]})]}),u.jsxs("div",{className:"p-4",children:[u.jsx(vr,{value:"properties",children:u.jsx(WG,{step:i,onChange:w,getError:b})}),u.jsx(vr,{value:"inputs",children:u.jsx(BG,{inputs:i.inputs,onChange:v=>w({inputs:v}),availableVariables:s})}),u.jsx(vr,{value:"output",children:u.jsx(KG,{step:i,onChange:w})}),u.jsx(vr,{value:"errors",children:u.jsx(GG,{step:i,onChange:w})}),u.jsx(vr,{value:"conditions",children:u.jsx(YG,{step:i,onChange:w,availableVariables:s})}),u.jsx(vr,{value:"yaml",children:u.jsx(FG,{value:i,onChange:v=>a(v)})})]})]}),u.jsxs(Mi,{children:[h&&f.length>0&&u.jsxs("div",{className:"flex-1 flex items-center gap-2 text-error text-sm",children:[u.jsx(Oi,{className:"w-4 h-4 flex-shrink-0"}),u.jsxs("span",{children:[f.length," validation error",f.length>1?"s":""]})]}),u.jsx(De,{variant:"secondary",onClick:()=>t(!1),children:"Cancel"}),u.jsx(De,{onClick:y,children:"Save Changes"})]})]})}function WG({step:e,onChange:t,getError:n}){const r=n("id"),s=n("action"),i=n("workflow"),a=n("timeout");return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Step ID ",u.jsx("span",{className:"text-error",children:"*"})]}),u.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?u.jsx("p",{className:"mt-1 text-xs text-error",children:r}):u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Unique identifier for this step"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name"}),u.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"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Action ",!e.workflow&&u.jsx("span",{className:"text-error",children:"*"})]}),u.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?u.jsx("p",{className:"mt-1 text-xs text-error",children:s}):u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Format: service.method or service.namespace.method"})]}),e.workflow&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Sub-workflow Path"}),u.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 ${i?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"./path/to/workflow.md"}),i&&u.jsx("p",{className:"mt-1 text-xs text-error",children:i})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Timeout (seconds)"}),u.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&&u.jsx("p",{className:"mt-1 text-xs text-error",children:a})]})]})}function KG({step:e,onChange:t}){return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Output Variable"}),u.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"}),u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Store the step output in this variable for use in subsequent steps"})]}),u.jsxs("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:[u.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Usage Example"}),u.jsx("code",{className:"text-xs text-primary font-mono",children:"{{ "+(e.outputVariable||"variable_name")+" }}"}),u.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use this syntax in subsequent steps to reference the output"})]})]})}function GG({step:e,onChange:t}){const n=e.errorHandling||{action:"stop"},r=s=>{t({errorHandling:{...n,...s}})};return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Error Action"}),u.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:[u.jsx("option",{value:"stop",children:"Stop workflow on error"}),u.jsx("option",{value:"continue",children:"Continue to next step"}),u.jsx("option",{value:"retry",children:"Retry with backoff"})]})]}),n.action==="retry"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Max Retries"}),u.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"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Retry Delay (ms)"}),u.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"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Fallback Step (optional)"}),u.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"}),u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Jump to this step if the error action fails"})]})]})}function YG({step:e,onChange:t,availableVariables:n}){const r=e.conditions||[],s=()=>{t({conditions:[...r,""]})},i=(c,d)=>{const f=[...r];f[c]=d,t({conditions:f})},a=c=>{const d=r.filter((f,p)=>p!==c);t({conditions:d.length>0?d:void 0})};return u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-gray-400",children:"This step will only execute if all conditions evaluate to true."}),r.length===0?u.jsxs("div",{className:"text-center py-8",children:[u.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No conditions defined"}),u.jsx(De,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}):u.jsxs("div",{className:"space-y-3",children:[r.map((c,d)=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{type:"text",value:c,onChange:f=>i(d,f.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'"}),u.jsx(De,{variant:"ghost",size:"sm",onClick:()=>a(d),children:"×"})]},d)),u.jsx(De,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}),n.length>0&&u.jsxs("div",{className:"mt-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[u.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:"Available Variables"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(c=>u.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))})]})]})}var Ab=["Enter"," "],XG=["ArrowDown","PageUp","Home"],UP=["ArrowUp","PageDown","End"],QG=[...XG,...UP],JG={ltr:[...Ab,"ArrowRight"],rtl:[...Ab,"ArrowLeft"]},ZG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},fc="Menu",[Vl,eY,tY]=IO(fc),[Di,WP]=Ks(fc,[tY,ff,vf]),Tf=ff(),KP=vf(),[nY,$i]=Di(fc),[rY,hc]=Di(fc),GP=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=e,c=Tf(t),[d,f]=E.useState(null),p=E.useRef(!1),h=Tr(i),g=Tw(s);return E.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),u.jsx(UR,{...c,children:u.jsx(nY,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:f,children:u.jsx(rY,{scope:t,onClose:E.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:g,modal:a,children:r})})})};GP.displayName=fc;var sY="MenuAnchor",Gw=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Tf(n);return u.jsx(WR,{...s,...r,ref:t})});Gw.displayName=sY;var Yw="MenuPortal",[iY,YP]=Di(Yw,{forceMount:void 0}),XP=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=$i(Yw,t);return u.jsx(iY,{scope:t,forceMount:n,children:u.jsx(ir,{present:n||i.open,children:u.jsx(hf,{asChild:!0,container:s,children:r})})})};XP.displayName=Yw;var In="MenuContent",[oY,Xw]=Di(In),QP=E.forwardRef((e,t)=>{const n=YP(In,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=$i(In,e.__scopeMenu),a=hc(In,e.__scopeMenu);return u.jsx(Vl.Provider,{scope:e.__scopeMenu,children:u.jsx(ir,{present:r||i.open,children:u.jsx(Vl.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(aY,{...s,ref:t}):u.jsx(lY,{...s,ref:t})})})})}),aY=E.forwardRef((e,t)=>{const n=$i(In,e.__scopeMenu),r=E.useRef(null),s=kt(t,r);return E.useEffect(()=>{const i=r.current;if(i)return mO(i)},[]),u.jsx(Qw,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lY=E.forwardRef((e,t)=>{const n=$i(In,e.__scopeMenu);return u.jsx(Qw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),cY=Ll("MenuContent.ScrollLock"),Qw=E.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:g,onDismiss:y,disableOutsideScroll:w,...b}=e,v=$i(In,n),N=hc(In,n),S=Tf(n),k=KP(n),_=eY(n),[A,I]=E.useState(null),T=E.useRef(null),O=kt(t,T,v.onContentChange),L=E.useRef(0),B=E.useRef(""),M=E.useRef(0),P=E.useRef(null),H=E.useRef("right"),D=E.useRef(0),z=w?_w:E.Fragment,V=w?{as:cY,allowPinchZoom:!0}:void 0,G=F=>{var ee,se;const Y=B.current+F,$=_().filter(ae=>!ae.disabled),K=document.activeElement,ie=(ee=$.find(ae=>ae.ref.current===K))==null?void 0:ee.textValue,U=$.map(ae=>ae.textValue),Q=wY(U,Y,ie),Z=(se=$.find(ae=>ae.textValue===Q))==null?void 0:se.ref.current;(function ae(ne){B.current=ne,window.clearTimeout(L.current),ne!==""&&(L.current=window.setTimeout(()=>ae(""),1e3))})(Y),Z&&setTimeout(()=>Z.focus())};E.useEffect(()=>()=>window.clearTimeout(L.current),[]),oO();const q=E.useCallback(F=>{var $,K;return H.current===(($=P.current)==null?void 0:$.side)&&kY(F,(K=P.current)==null?void 0:K.area)},[]);return u.jsx(oY,{scope:n,searchRef:B,onItemEnter:E.useCallback(F=>{q(F)&&F.preventDefault()},[q]),onItemLeave:E.useCallback(F=>{var Y;q(F)||((Y=T.current)==null||Y.focus(),I(null))},[q]),onTriggerLeave:E.useCallback(F=>{q(F)&&F.preventDefault()},[q]),pointerGraceTimerRef:M,onPointerGraceIntentChange:E.useCallback(F=>{P.current=F},[]),children:u.jsx(z,{...V,children:u.jsx(Cw,{asChild:!0,trapped:s,onMountAutoFocus:Te(i,F=>{var Y;F.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(af,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:g,onDismiss:y,children:u.jsx(DO,{asChild:!0,...k,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:I,onEntryFocus:Te(d,F=>{N.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(KR,{role:"menu","aria-orientation":"vertical","data-state":h4(v.open),"data-radix-menu-content":"",dir:N.dir,...S,...b,ref:O,style:{outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,F=>{const $=F.target.closest("[data-radix-menu-content]")===F.currentTarget,K=F.ctrlKey||F.altKey||F.metaKey,ie=F.key.length===1;$&&(F.key==="Tab"&&F.preventDefault(),!K&&ie&&G(F.key));const U=T.current;if(F.target!==U||!QG.includes(F.key))return;F.preventDefault();const Z=_().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);UP.includes(F.key)&&Z.reverse(),vY(Z)}),onBlur:Te(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(L.current),B.current="")}),onPointerMove:Te(e.onPointerMove,Hl(F=>{const Y=F.target,$=D.current!==F.clientX;if(F.currentTarget.contains(Y)&&$){const K=F.clientX>D.current?"right":"left";H.current=K,D.current=F.clientX}}))})})})})})})});QP.displayName=In;var uY="MenuGroup",Jw=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Qe.div,{role:"group",...r,ref:t})});Jw.displayName=uY;var dY="MenuLabel",JP=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Qe.div,{...r,ref:t})});JP.displayName=dY;var qd="MenuItem",yC="menu.itemSelect",If=E.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=E.useRef(null),a=hc(qd,e.__scopeMenu),c=Xw(qd,e.__scopeMenu),d=kt(t,i),f=E.useRef(!1),p=()=>{const h=i.current;if(!n&&h){const g=new CustomEvent(yC,{bubbles:!0,cancelable:!0});h.addEventListener(yC,y=>r==null?void 0:r(y),{once:!0}),wR(h,g),g.defaultPrevented?f.current=!1:a.onClose()}};return u.jsx(ZP,{...s,ref:d,disabled:n,onClick:Te(e.onClick,p),onPointerDown:h=>{var g;(g=e.onPointerDown)==null||g.call(e,h),f.current=!0},onPointerUp:Te(e.onPointerUp,h=>{var g;f.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:Te(e.onKeyDown,h=>{const g=c.searchRef.current!=="";n||g&&h.key===" "||Ab.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});If.displayName=qd;var ZP=E.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,a=Xw(qd,n),c=KP(n),d=E.useRef(null),f=kt(t,d),[p,h]=E.useState(!1),[g,y]=E.useState("");return E.useEffect(()=>{const w=d.current;w&&y((w.textContent??"").trim())},[i.children]),u.jsx(Vl.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:u.jsx($O,{asChild:!0,...c,focusable:!r,children:u.jsx(Qe.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Te(e.onPointerMove,Hl(w=>{r?a.onItemLeave(w):(a.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,Hl(w=>a.onItemLeave(w))),onFocus:Te(e.onFocus,()=>h(!0)),onBlur:Te(e.onBlur,()=>h(!1))})})})}),fY="MenuCheckboxItem",e4=E.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return u.jsx(i4,{scope:e.__scopeMenu,checked:n,children:u.jsx(If,{role:"menuitemcheckbox","aria-checked":Bd(n)?"mixed":n,...s,ref:t,"data-state":e1(n),onSelect:Te(s.onSelect,()=>r==null?void 0:r(Bd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});e4.displayName=fY;var t4="MenuRadioGroup",[hY,pY]=Di(t4,{value:void 0,onValueChange:()=>{}}),n4=E.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Tr(r);return u.jsx(hY,{scope:e.__scopeMenu,value:n,onValueChange:i,children:u.jsx(Jw,{...s,ref:t})})});n4.displayName=t4;var r4="MenuRadioItem",s4=E.forwardRef((e,t)=>{const{value:n,...r}=e,s=pY(r4,e.__scopeMenu),i=n===s.value;return u.jsx(i4,{scope:e.__scopeMenu,checked:i,children:u.jsx(If,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":e1(i),onSelect:Te(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});s4.displayName=r4;var Zw="MenuItemIndicator",[i4,mY]=Di(Zw,{checked:!1}),o4=E.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=mY(Zw,n);return u.jsx(ir,{present:r||Bd(i.checked)||i.checked===!0,children:u.jsx(Qe.span,{...s,ref:t,"data-state":e1(i.checked)})})});o4.displayName=Zw;var gY="MenuSeparator",a4=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Qe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});a4.displayName=gY;var yY="MenuArrow",l4=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Tf(n);return u.jsx(GR,{...s,...r,ref:t})});l4.displayName=yY;var xY="MenuSub",[Mne,c4]=Di(xY),dl="MenuSubTrigger",u4=E.forwardRef((e,t)=>{const n=$i(dl,e.__scopeMenu),r=hc(dl,e.__scopeMenu),s=c4(dl,e.__scopeMenu),i=Xw(dl,e.__scopeMenu),a=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},p=E.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return E.useEffect(()=>p,[p]),E.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),d(null)}},[c,d]),u.jsx(Gw,{asChild:!0,...f,children:u.jsx(ZP,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":h4(n.open),...e,ref:hw(t,s.onTriggerChange),onClick:h=>{var g;(g=e.onClick)==null||g.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,Hl(h=>{i.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Te(e.onPointerLeave,Hl(h=>{var y,w;p();const g=(y=n.content)==null?void 0:y.getBoundingClientRect();if(g){const b=(w=n.content)==null?void 0:w.dataset.side,v=b==="right",N=v?-5:5,S=g[v?"left":"right"],k=g[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+N,y:h.clientY},{x:S,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:S,y:g.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,h=>{var y;const g=i.searchRef.current!=="";e.disabled||g&&h.key===" "||JG[r.dir].includes(h.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),h.preventDefault())})})})});u4.displayName=dl;var d4="MenuSubContent",f4=E.forwardRef((e,t)=>{const n=YP(In,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=$i(In,e.__scopeMenu),a=hc(In,e.__scopeMenu),c=c4(d4,e.__scopeMenu),d=E.useRef(null),f=kt(t,d);return u.jsx(Vl.Provider,{scope:e.__scopeMenu,children:u.jsx(ir,{present:r||i.open,children:u.jsx(Vl.Slot,{scope:e.__scopeMenu,children:u.jsx(Qw,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:f,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var h;a.isUsingKeyboardRef.current&&((h=d.current)==null||h.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Te(e.onFocusOutside,p=>{p.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Te(e.onKeyDown,p=>{var y;const h=p.currentTarget.contains(p.target),g=ZG[a.dir].includes(p.key);h&&g&&(i.onOpenChange(!1),(y=c.trigger)==null||y.focus(),p.preventDefault())})})})})})});f4.displayName=d4;function h4(e){return e?"open":"closed"}function Bd(e){return e==="indeterminate"}function e1(e){return Bd(e)?"indeterminate":e?"checked":"unchecked"}function vY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wY(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=bY(e,Math.max(i,0));s.length===1&&(a=a.filter(f=>f!==n));const d=a.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function NY(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],d=t[a],f=c.x,p=c.y,h=d.x,g=d.y;p>r!=g>r&&n<(h-f)*(r-p)/(g-p)+f&&(s=!s)}return s}function kY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return NY(n,t)}function Hl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var SY=GP,CY=Gw,_Y=XP,EY=QP,jY=Jw,AY=JP,TY=If,IY=e4,MY=n4,RY=s4,OY=o4,PY=a4,LY=l4,DY=u4,$Y=f4,t1="ContextMenu",[FY]=Ks(t1,[WP]),Ut=WP(),[qY,p4]=FY(t1),m4=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:i=!0}=e,[a,c]=E.useState(!1),d=Ut(t),f=Tr(r),p=E.useCallback(h=>{c(h),f(h)},[f]);return u.jsx(qY,{scope:t,open:a,onOpenChange:p,modal:i,children:u.jsx(SY,{...d,dir:s,open:a,onOpenChange:p,modal:i,children:n})})};m4.displayName=t1;var g4="ContextMenuTrigger",y4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,i=p4(g4,n),a=Ut(n),c=E.useRef({x:0,y:0}),d=E.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),f=E.useRef(0),p=E.useCallback(()=>window.clearTimeout(f.current),[]),h=g=>{c.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return E.useEffect(()=>p,[p]),E.useEffect(()=>void(r&&p()),[r,p]),u.jsxs(u.Fragment,{children:[u.jsx(CY,{...a,virtualRef:d}),u.jsx(Qe.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Te(e.onContextMenu,g=>{p(),h(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Te(e.onPointerDown,Ju(g=>{p(),f.current=window.setTimeout(()=>h(g),700)})),onPointerMove:r?e.onPointerMove:Te(e.onPointerMove,Ju(p)),onPointerCancel:r?e.onPointerCancel:Te(e.onPointerCancel,Ju(p)),onPointerUp:r?e.onPointerUp:Te(e.onPointerUp,Ju(p))})]})});y4.displayName=g4;var BY="ContextMenuPortal",x4=e=>{const{__scopeContextMenu:t,...n}=e,r=Ut(t);return u.jsx(_Y,{...r,...n})};x4.displayName=BY;var v4="ContextMenuContent",b4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=p4(v4,n),i=Ut(n),a=E.useRef(!1);return u.jsx(EY,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var d;(d=e.onCloseAutoFocus)==null||d.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var d;(d=e.onInteractOutside)==null||d.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)"}})});b4.displayName=v4;var zY="ContextMenuGroup",VY=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(jY,{...s,...r,ref:t})});VY.displayName=zY;var HY="ContextMenuLabel",w4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(AY,{...s,...r,ref:t})});w4.displayName=HY;var UY="ContextMenuItem",N4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(TY,{...s,...r,ref:t})});N4.displayName=UY;var WY="ContextMenuCheckboxItem",k4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(IY,{...s,...r,ref:t})});k4.displayName=WY;var KY="ContextMenuRadioGroup",GY=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(MY,{...s,...r,ref:t})});GY.displayName=KY;var YY="ContextMenuRadioItem",S4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(RY,{...s,...r,ref:t})});S4.displayName=YY;var XY="ContextMenuItemIndicator",C4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(OY,{...s,...r,ref:t})});C4.displayName=XY;var QY="ContextMenuSeparator",_4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(PY,{...s,...r,ref:t})});_4.displayName=QY;var JY="ContextMenuArrow",ZY=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(LY,{...s,...r,ref:t})});ZY.displayName=JY;var eX="ContextMenuSubTrigger",E4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx(DY,{...s,...r,ref:t})});E4.displayName=eX;var tX="ContextMenuSubContent",j4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Ut(n);return u.jsx($Y,{...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)"}})});j4.displayName=tX;function Ju(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var nX=m4,rX=y4,sX=x4,A4=b4,T4=w4,I4=N4,M4=k4,R4=S4,O4=C4,P4=_4,L4=E4,D4=j4;const iX=nX,oX=rX,aX=E.forwardRef(({className:e,inset:t,children:n,...r},s)=>u.jsxs(L4,{ref:s,className:Ue("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,u.jsx("span",{className:"ml-auto text-xs",children:"▶"})]}));aX.displayName=L4.displayName;const lX=E.forwardRef(({className:e,...t},n)=>u.jsx(D4,{ref:n,className:Ue("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}));lX.displayName=D4.displayName;const $4=E.forwardRef(({className:e,...t},n)=>u.jsx(sX,{children:u.jsx(A4,{ref:n,className:Ue("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})}));$4.displayName=A4.displayName;const _o=E.forwardRef(({className:e,inset:t,destructive:n,...r},s)=>u.jsx(I4,{ref:s,className:Ue("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}));_o.displayName=I4.displayName;const cX=E.forwardRef(({className:e,children:t,checked:n,...r},s)=>u.jsxs(M4,{ref:s,className:Ue("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(O4,{children:u.jsx("span",{className:"text-primary",children:"✓"})})}),t]}));cX.displayName=M4.displayName;const uX=E.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(R4,{ref:r,className:Ue("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(O4,{children:u.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));uX.displayName=R4.displayName;const dX=E.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(T4,{ref:r,className:Ue("px-2 py-1.5 text-xs font-semibold text-gray-400",t&&"pl-8",e),...n}));dX.displayName=T4.displayName;const Tb=E.forwardRef(({className:e,...t},n)=>u.jsx(P4,{ref:n,className:Ue("-mx-1 my-1 h-px bg-node-border",e),...t}));Tb.displayName=P4.displayName;const fl=({className:e,...t})=>u.jsx("span",{className:Ue("ml-auto text-xs tracking-widest text-gray-500",e),...t});fl.displayName="ContextMenuShortcut";function n1(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 Em,xC;function fX(){if(xC)return Em;xC=1;function e(){this.__data__=[],this.size=0}return Em=e,Em}var jm,vC;function la(){if(vC)return jm;vC=1;function e(t,n){return t===n||t!==t&&n!==n}return jm=e,jm}var Am,bC;function Mf(){if(bC)return Am;bC=1;var e=la();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return Am=t,Am}var Tm,wC;function hX(){if(wC)return Tm;wC=1;var e=Mf(),t=Array.prototype,n=t.splice;function r(s){var i=this.__data__,a=e(i,s);if(a<0)return!1;var c=i.length-1;return a==c?i.pop():n.call(i,a,1),--this.size,!0}return Tm=r,Tm}var Im,NC;function pX(){if(NC)return Im;NC=1;var e=Mf();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return Im=t,Im}var Mm,kC;function mX(){if(kC)return Mm;kC=1;var e=Mf();function t(n){return e(this.__data__,n)>-1}return Mm=t,Mm}var Rm,SC;function gX(){if(SC)return Rm;SC=1;var e=Mf();function t(n,r){var s=this.__data__,i=e(s,n);return i<0?(++this.size,s.push([n,r])):s[i][1]=r,this}return Rm=t,Rm}var Om,CC;function Rf(){if(CC)return Om;CC=1;var e=fX(),t=hX(),n=pX(),r=mX(),s=gX();function i(a){var c=-1,d=a==null?0:a.length;for(this.clear();++c<d;){var f=a[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,Om=i,Om}var Pm,_C;function yX(){if(_C)return Pm;_C=1;var e=Rf();function t(){this.__data__=new e,this.size=0}return Pm=t,Pm}var Lm,EC;function xX(){if(EC)return Lm;EC=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Lm=e,Lm}var Dm,jC;function vX(){if(jC)return Dm;jC=1;function e(t){return this.__data__.get(t)}return Dm=e,Dm}var $m,AC;function bX(){if(AC)return $m;AC=1;function e(t){return this.__data__.has(t)}return $m=e,$m}var Fm,TC;function F4(){if(TC)return Fm;TC=1;var e=typeof ju=="object"&&ju&&ju.Object===Object&&ju;return Fm=e,Fm}var qm,IC;function lr(){if(IC)return qm;IC=1;var e=F4(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return qm=n,qm}var Bm,MC;function ca(){if(MC)return Bm;MC=1;var e=lr(),t=e.Symbol;return Bm=t,Bm}var zm,RC;function wX(){if(RC)return zm;RC=1;var e=ca(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function i(a){var c=n.call(a,s),d=a[s];try{a[s]=void 0;var f=!0}catch{}var p=r.call(a);return f&&(c?a[s]=d:delete a[s]),p}return zm=i,zm}var Vm,OC;function NX(){if(OC)return Vm;OC=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Vm=n,Vm}var Hm,PC;function Fi(){if(PC)return Hm;PC=1;var e=ca(),t=wX(),n=NX(),r="[object Null]",s="[object Undefined]",i=e?e.toStringTag:void 0;function a(c){return c==null?c===void 0?s:r:i&&i in Object(c)?t(c):n(c)}return Hm=a,Hm}var Um,LC;function Rn(){if(LC)return Um;LC=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Um=e,Um}var Wm,DC;function pc(){if(DC)return Wm;DC=1;var e=Fi(),t=Rn(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",i="[object Proxy]";function a(c){if(!t(c))return!1;var d=e(c);return d==r||d==s||d==n||d==i}return Wm=a,Wm}var Km,$C;function kX(){if($C)return Km;$C=1;var e=lr(),t=e["__core-js_shared__"];return Km=t,Km}var Gm,FC;function SX(){if(FC)return Gm;FC=1;var e=kX(),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 Gm=n,Gm}var Ym,qC;function q4(){if(qC)return Ym;qC=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 Ym=n,Ym}var Xm,BC;function CX(){if(BC)return Xm;BC=1;var e=pc(),t=SX(),n=Rn(),r=q4(),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,d=a.toString,f=c.hasOwnProperty,p=RegExp("^"+d.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(g){if(!n(g)||t(g))return!1;var y=e(g)?p:i;return y.test(r(g))}return Xm=h,Xm}var Qm,zC;function _X(){if(zC)return Qm;zC=1;function e(t,n){return t==null?void 0:t[n]}return Qm=e,Qm}var Jm,VC;function qi(){if(VC)return Jm;VC=1;var e=CX(),t=_X();function n(r,s){var i=t(r,s);return e(i)?i:void 0}return Jm=n,Jm}var Zm,HC;function r1(){if(HC)return Zm;HC=1;var e=qi(),t=lr(),n=e(t,"Map");return Zm=n,Zm}var eg,UC;function Of(){if(UC)return eg;UC=1;var e=qi(),t=e(Object,"create");return eg=t,eg}var tg,WC;function EX(){if(WC)return tg;WC=1;var e=Of();function t(){this.__data__=e?e(null):{},this.size=0}return tg=t,tg}var ng,KC;function jX(){if(KC)return ng;KC=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return ng=e,ng}var rg,GC;function AX(){if(GC)return rg;GC=1;var e=Of(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(i){var a=this.__data__;if(e){var c=a[i];return c===t?void 0:c}return r.call(a,i)?a[i]:void 0}return rg=s,rg}var sg,YC;function TX(){if(YC)return sg;YC=1;var e=Of(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var i=this.__data__;return e?i[s]!==void 0:n.call(i,s)}return sg=r,sg}var ig,XC;function IX(){if(XC)return ig;XC=1;var e=Of(),t="__lodash_hash_undefined__";function n(r,s){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&s===void 0?t:s,this}return ig=n,ig}var og,QC;function MX(){if(QC)return og;QC=1;var e=EX(),t=jX(),n=AX(),r=TX(),s=IX();function i(a){var c=-1,d=a==null?0:a.length;for(this.clear();++c<d;){var f=a[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,og=i,og}var ag,JC;function RX(){if(JC)return ag;JC=1;var e=MX(),t=Rf(),n=r1();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return ag=r,ag}var lg,ZC;function OX(){if(ZC)return lg;ZC=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return lg=e,lg}var cg,e_;function Pf(){if(e_)return cg;e_=1;var e=OX();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return cg=t,cg}var ug,t_;function PX(){if(t_)return ug;t_=1;var e=Pf();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return ug=t,ug}var dg,n_;function LX(){if(n_)return dg;n_=1;var e=Pf();function t(n){return e(this,n).get(n)}return dg=t,dg}var fg,r_;function DX(){if(r_)return fg;r_=1;var e=Pf();function t(n){return e(this,n).has(n)}return fg=t,fg}var hg,s_;function $X(){if(s_)return hg;s_=1;var e=Pf();function t(n,r){var s=e(this,n),i=s.size;return s.set(n,r),this.size+=s.size==i?0:1,this}return hg=t,hg}var pg,i_;function s1(){if(i_)return pg;i_=1;var e=RX(),t=PX(),n=LX(),r=DX(),s=$X();function i(a){var c=-1,d=a==null?0:a.length;for(this.clear();++c<d;){var f=a[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,pg=i,pg}var mg,o_;function FX(){if(o_)return mg;o_=1;var e=Rf(),t=r1(),n=s1(),r=200;function s(i,a){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([i,a]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(i,a),this.size=c.size,this}return mg=s,mg}var gg,a_;function Lf(){if(a_)return gg;a_=1;var e=Rf(),t=yX(),n=xX(),r=vX(),s=bX(),i=FX();function a(c){var d=this.__data__=new e(c);this.size=d.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=s,a.prototype.set=i,gg=a,gg}var yg,l_;function i1(){if(l_)return yg;l_=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 yg=e,yg}var xg,c_;function B4(){if(c_)return xg;c_=1;var e=qi(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return xg=t,xg}var vg,u_;function Df(){if(u_)return vg;u_=1;var e=B4();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return vg=t,vg}var bg,d_;function $f(){if(d_)return bg;d_=1;var e=Df(),t=la(),n=Object.prototype,r=n.hasOwnProperty;function s(i,a,c){var d=i[a];(!(r.call(i,a)&&t(d,c))||c===void 0&&!(a in i))&&e(i,a,c)}return bg=s,bg}var wg,f_;function mc(){if(f_)return wg;f_=1;var e=$f(),t=Df();function n(r,s,i,a){var c=!i;i||(i={});for(var d=-1,f=s.length;++d<f;){var p=s[d],h=a?a(i[p],r[p],p,i,r):void 0;h===void 0&&(h=r[p]),c?t(i,p,h):e(i,p,h)}return i}return wg=n,wg}var Ng,h_;function qX(){if(h_)return Ng;h_=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return Ng=e,Ng}var kg,p_;function Lr(){if(p_)return kg;p_=1;function e(t){return t!=null&&typeof t=="object"}return kg=e,kg}var Sg,m_;function BX(){if(m_)return Sg;m_=1;var e=Fi(),t=Lr(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return Sg=r,Sg}var Cg,g_;function gc(){if(g_)return Cg;g_=1;var e=BX(),t=Lr(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!s.call(a,"callee")};return Cg=i,Cg}var _g,y_;function bt(){if(y_)return _g;y_=1;var e=Array.isArray;return _g=e,_g}var hl={exports:{}},Eg,x_;function zX(){if(x_)return Eg;x_=1;function e(){return!1}return Eg=e,Eg}hl.exports;var v_;function ua(){return v_||(v_=1,(function(e,t){var n=lr(),r=zX(),s=t&&!t.nodeType&&t,i=s&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===s,c=a?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(hl,hl.exports)),hl.exports}var jg,b_;function Ff(){if(b_)return jg;b_=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var i=typeof r;return s=s??e,!!s&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return jg=n,jg}var Ag,w_;function o1(){if(w_)return Ag;w_=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Ag=t,Ag}var Tg,N_;function VX(){if(N_)return Tg;N_=1;var e=Fi(),t=o1(),n=Lr(),r="[object Arguments]",s="[object Array]",i="[object Boolean]",a="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",p="[object Number]",h="[object Object]",g="[object RegExp]",y="[object Set]",w="[object String]",b="[object WeakMap]",v="[object ArrayBuffer]",N="[object DataView]",S="[object Float32Array]",k="[object Float64Array]",_="[object Int8Array]",A="[object Int16Array]",I="[object Int32Array]",T="[object Uint8Array]",O="[object Uint8ClampedArray]",L="[object Uint16Array]",B="[object Uint32Array]",M={};M[S]=M[k]=M[_]=M[A]=M[I]=M[T]=M[O]=M[L]=M[B]=!0,M[r]=M[s]=M[v]=M[i]=M[N]=M[a]=M[c]=M[d]=M[f]=M[p]=M[h]=M[g]=M[y]=M[w]=M[b]=!1;function P(H){return n(H)&&t(H.length)&&!!M[e(H)]}return Tg=P,Tg}var Ig,k_;function qf(){if(k_)return Ig;k_=1;function e(t){return function(n){return t(n)}}return Ig=e,Ig}var pl={exports:{}};pl.exports;var S_;function a1(){return S_||(S_=1,(function(e,t){var n=F4(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===r,a=i&&n.process,c=(function(){try{var d=s&&s.require&&s.require("util").types;return d||a&&a.binding&&a.binding("util")}catch{}})();e.exports=c})(pl,pl.exports)),pl.exports}var Mg,C_;function yc(){if(C_)return Mg;C_=1;var e=VX(),t=qf(),n=a1(),r=n&&n.isTypedArray,s=r?t(r):e;return Mg=s,Mg}var Rg,__;function z4(){if(__)return Rg;__=1;var e=qX(),t=gc(),n=bt(),r=ua(),s=Ff(),i=yc(),a=Object.prototype,c=a.hasOwnProperty;function d(f,p){var h=n(f),g=!h&&t(f),y=!h&&!g&&r(f),w=!h&&!g&&!y&&i(f),b=h||g||y||w,v=b?e(f.length,String):[],N=v.length;for(var S in f)(p||c.call(f,S))&&!(b&&(S=="length"||y&&(S=="offset"||S=="parent")||w&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||s(S,N)))&&v.push(S);return v}return Rg=d,Rg}var Og,E_;function Bf(){if(E_)return Og;E_=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return Og=t,Og}var Pg,j_;function V4(){if(j_)return Pg;j_=1;function e(t,n){return function(r){return t(n(r))}}return Pg=e,Pg}var Lg,A_;function HX(){if(A_)return Lg;A_=1;var e=V4(),t=e(Object.keys,Object);return Lg=t,Lg}var Dg,T_;function l1(){if(T_)return Dg;T_=1;var e=Bf(),t=HX(),n=Object.prototype,r=n.hasOwnProperty;function s(i){if(!e(i))return t(i);var a=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&a.push(c);return a}return Dg=s,Dg}var $g,I_;function os(){if(I_)return $g;I_=1;var e=pc(),t=o1();function n(r){return r!=null&&t(r.length)&&!e(r)}return $g=n,$g}var Fg,M_;function Gs(){if(M_)return Fg;M_=1;var e=z4(),t=l1(),n=os();function r(s){return n(s)?e(s):t(s)}return Fg=r,Fg}var qg,R_;function UX(){if(R_)return qg;R_=1;var e=mc(),t=Gs();function n(r,s){return r&&e(s,t(s),r)}return qg=n,qg}var Bg,O_;function WX(){if(O_)return Bg;O_=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return Bg=e,Bg}var zg,P_;function KX(){if(P_)return zg;P_=1;var e=Rn(),t=Bf(),n=WX(),r=Object.prototype,s=r.hasOwnProperty;function i(a){if(!e(a))return n(a);var c=t(a),d=[];for(var f in a)f=="constructor"&&(c||!s.call(a,f))||d.push(f);return d}return zg=i,zg}var Vg,L_;function Bi(){if(L_)return Vg;L_=1;var e=z4(),t=KX(),n=os();function r(s){return n(s)?e(s,!0):t(s)}return Vg=r,Vg}var Hg,D_;function GX(){if(D_)return Hg;D_=1;var e=mc(),t=Bi();function n(r,s){return r&&e(s,t(s),r)}return Hg=n,Hg}var ml={exports:{}};ml.exports;var $_;function H4(){return $_||($_=1,(function(e,t){var n=lr(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===r,a=i?n.Buffer:void 0,c=a?a.allocUnsafe:void 0;function d(f,p){if(p)return f.slice();var h=f.length,g=c?c(h):new f.constructor(h);return f.copy(g),g}e.exports=d})(ml,ml.exports)),ml.exports}var Ug,F_;function U4(){if(F_)return Ug;F_=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 Ug=e,Ug}var Wg,q_;function W4(){if(q_)return Wg;q_=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,i=0,a=[];++r<s;){var c=t[r];n(c,r,t)&&(a[i++]=c)}return a}return Wg=e,Wg}var Kg,B_;function K4(){if(B_)return Kg;B_=1;function e(){return[]}return Kg=e,Kg}var Gg,z_;function c1(){if(z_)return Gg;z_=1;var e=W4(),t=K4(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,i=s?function(a){return a==null?[]:(a=Object(a),e(s(a),function(c){return r.call(a,c)}))}:t;return Gg=i,Gg}var Yg,V_;function YX(){if(V_)return Yg;V_=1;var e=mc(),t=c1();function n(r,s){return e(r,t(r),s)}return Yg=n,Yg}var Xg,H_;function u1(){if(H_)return Xg;H_=1;function e(t,n){for(var r=-1,s=n.length,i=t.length;++r<s;)t[i+r]=n[r];return t}return Xg=e,Xg}var Qg,U_;function zf(){if(U_)return Qg;U_=1;var e=V4(),t=e(Object.getPrototypeOf,Object);return Qg=t,Qg}var Jg,W_;function G4(){if(W_)return Jg;W_=1;var e=u1(),t=zf(),n=c1(),r=K4(),s=Object.getOwnPropertySymbols,i=s?function(a){for(var c=[];a;)e(c,n(a)),a=t(a);return c}:r;return Jg=i,Jg}var Zg,K_;function XX(){if(K_)return Zg;K_=1;var e=mc(),t=G4();function n(r,s){return e(r,t(r),s)}return Zg=n,Zg}var ey,G_;function Y4(){if(G_)return ey;G_=1;var e=u1(),t=bt();function n(r,s,i){var a=s(r);return t(r)?a:e(a,i(r))}return ey=n,ey}var ty,Y_;function X4(){if(Y_)return ty;Y_=1;var e=Y4(),t=c1(),n=Gs();function r(s){return e(s,n,t)}return ty=r,ty}var ny,X_;function QX(){if(X_)return ny;X_=1;var e=Y4(),t=G4(),n=Bi();function r(s){return e(s,n,t)}return ny=r,ny}var ry,Q_;function JX(){if(Q_)return ry;Q_=1;var e=qi(),t=lr(),n=e(t,"DataView");return ry=n,ry}var sy,J_;function ZX(){if(J_)return sy;J_=1;var e=qi(),t=lr(),n=e(t,"Promise");return sy=n,sy}var iy,Z_;function Q4(){if(Z_)return iy;Z_=1;var e=qi(),t=lr(),n=e(t,"Set");return iy=n,iy}var oy,eE;function eQ(){if(eE)return oy;eE=1;var e=qi(),t=lr(),n=e(t,"WeakMap");return oy=n,oy}var ay,tE;function da(){if(tE)return ay;tE=1;var e=JX(),t=r1(),n=ZX(),r=Q4(),s=eQ(),i=Fi(),a=q4(),c="[object Map]",d="[object Object]",f="[object Promise]",p="[object Set]",h="[object WeakMap]",g="[object DataView]",y=a(e),w=a(t),b=a(n),v=a(r),N=a(s),S=i;return(e&&S(new e(new ArrayBuffer(1)))!=g||t&&S(new t)!=c||n&&S(n.resolve())!=f||r&&S(new r)!=p||s&&S(new s)!=h)&&(S=function(k){var _=i(k),A=_==d?k.constructor:void 0,I=A?a(A):"";if(I)switch(I){case y:return g;case w:return c;case b:return f;case v:return p;case N:return h}return _}),ay=S,ay}var ly,nE;function tQ(){if(nE)return ly;nE=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var s=r.length,i=new r.constructor(s);return s&&typeof r[0]=="string"&&t.call(r,"index")&&(i.index=r.index,i.input=r.input),i}return ly=n,ly}var cy,rE;function J4(){if(rE)return cy;rE=1;var e=lr(),t=e.Uint8Array;return cy=t,cy}var uy,sE;function d1(){if(sE)return uy;sE=1;var e=J4();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return uy=t,uy}var dy,iE;function nQ(){if(iE)return dy;iE=1;var e=d1();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}return dy=t,dy}var fy,oE;function rQ(){if(oE)return fy;oE=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return fy=t,fy}var hy,aE;function sQ(){if(aE)return hy;aE=1;var e=ca(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(s){return n?Object(n.call(s)):{}}return hy=r,hy}var py,lE;function Z4(){if(lE)return py;lE=1;var e=d1();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}return py=t,py}var my,cE;function iQ(){if(cE)return my;cE=1;var e=d1(),t=nQ(),n=rQ(),r=sQ(),s=Z4(),i="[object Boolean]",a="[object Date]",c="[object Map]",d="[object Number]",f="[object RegExp]",p="[object Set]",h="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",w="[object DataView]",b="[object Float32Array]",v="[object Float64Array]",N="[object Int8Array]",S="[object Int16Array]",k="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",I="[object Uint16Array]",T="[object Uint32Array]";function O(L,B,M){var P=L.constructor;switch(B){case y:return e(L);case i:case a:return new P(+L);case w:return t(L,M);case b:case v:case N:case S:case k:case _:case A:case I:case T:return s(L,M);case c:return new P;case d:case h:return new P(L);case f:return n(L);case p:return new P;case g:return r(L)}}return my=O,my}var gy,uE;function e3(){if(uE)return gy;uE=1;var e=Rn(),t=Object.create,n=(function(){function r(){}return function(s){if(!e(s))return{};if(t)return t(s);r.prototype=s;var i=new r;return r.prototype=void 0,i}})();return gy=n,gy}var yy,dE;function t3(){if(dE)return yy;dE=1;var e=e3(),t=zf(),n=Bf();function r(s){return typeof s.constructor=="function"&&!n(s)?e(t(s)):{}}return yy=r,yy}var xy,fE;function oQ(){if(fE)return xy;fE=1;var e=da(),t=Lr(),n="[object Map]";function r(s){return t(s)&&e(s)==n}return xy=r,xy}var vy,hE;function aQ(){if(hE)return vy;hE=1;var e=oQ(),t=qf(),n=a1(),r=n&&n.isMap,s=r?t(r):e;return vy=s,vy}var by,pE;function lQ(){if(pE)return by;pE=1;var e=da(),t=Lr(),n="[object Set]";function r(s){return t(s)&&e(s)==n}return by=r,by}var wy,mE;function cQ(){if(mE)return wy;mE=1;var e=lQ(),t=qf(),n=a1(),r=n&&n.isSet,s=r?t(r):e;return wy=s,wy}var Ny,gE;function n3(){if(gE)return Ny;gE=1;var e=Lf(),t=i1(),n=$f(),r=UX(),s=GX(),i=H4(),a=U4(),c=YX(),d=XX(),f=X4(),p=QX(),h=da(),g=tQ(),y=iQ(),w=t3(),b=bt(),v=ua(),N=aQ(),S=Rn(),k=cQ(),_=Gs(),A=Bi(),I=1,T=2,O=4,L="[object Arguments]",B="[object Array]",M="[object Boolean]",P="[object Date]",H="[object Error]",D="[object Function]",z="[object GeneratorFunction]",V="[object Map]",G="[object Number]",q="[object Object]",F="[object RegExp]",Y="[object Set]",$="[object String]",K="[object Symbol]",ie="[object WeakMap]",U="[object ArrayBuffer]",Q="[object DataView]",Z="[object Float32Array]",ee="[object Float64Array]",se="[object Int8Array]",ae="[object Int16Array]",ne="[object Int32Array]",le="[object Uint8Array]",he="[object Uint8ClampedArray]",pe="[object Uint16Array]",ve="[object Uint32Array]",xe={};xe[L]=xe[B]=xe[U]=xe[Q]=xe[M]=xe[P]=xe[Z]=xe[ee]=xe[se]=xe[ae]=xe[ne]=xe[V]=xe[G]=xe[q]=xe[F]=xe[Y]=xe[$]=xe[K]=xe[le]=xe[he]=xe[pe]=xe[ve]=!0,xe[H]=xe[D]=xe[ie]=!1;function Ae(Se,Ge,Ve,jt,St,mt){var He,nn=Ge&I,Rt=Ge&T,rn=Ge&O;if(Ve&&(He=St?Ve(Se,jt,St,mt):Ve(Se)),He!==void 0)return He;if(!S(Se))return Se;var ut=b(Se);if(ut){if(He=g(Se),!nn)return a(Se,He)}else{var Ot=h(Se),Pn=Ot==D||Ot==z;if(v(Se))return i(Se,nn);if(Ot==q||Ot==L||Pn&&!St){if(He=Rt||Pn?{}:w(Se),!nn)return Rt?d(Se,s(He,Se)):c(Se,r(He,Se))}else{if(!xe[Ot])return St?Se:{};He=y(Se,Ot,nn)}}mt||(mt=new e);var ze=mt.get(Se);if(ze)return ze;mt.set(Se,He),k(Se)?Se.forEach(function(Wt){He.add(Ae(Wt,Ge,Ve,Wt,Se,mt))}):N(Se)&&Se.forEach(function(Wt,sn){He.set(sn,Ae(Wt,Ge,Ve,sn,Se,mt))});var Ln=rn?Rt?p:f:Rt?A:_,Dr=ut?void 0:Ln(Se);return t(Dr||Se,function(Wt,sn){Dr&&(sn=Wt,Wt=Se[sn]),n(He,sn,Ae(Wt,Ge,Ve,sn,Se,mt))}),He}return Ny=Ae,Ny}var ky,yE;function uQ(){if(yE)return ky;yE=1;var e=n3(),t=4;function n(r){return e(r,t)}return ky=n,ky}var Sy,xE;function f1(){if(xE)return Sy;xE=1;function e(t){return function(){return t}}return Sy=e,Sy}var Cy,vE;function dQ(){if(vE)return Cy;vE=1;function e(t){return function(n,r,s){for(var i=-1,a=Object(n),c=s(n),d=c.length;d--;){var f=c[t?d:++i];if(r(a[f],f,a)===!1)break}return n}}return Cy=e,Cy}var _y,bE;function h1(){if(bE)return _y;bE=1;var e=dQ(),t=e();return _y=t,_y}var Ey,wE;function p1(){if(wE)return Ey;wE=1;var e=h1(),t=Gs();function n(r,s){return r&&e(r,s,t)}return Ey=n,Ey}var jy,NE;function fQ(){if(NE)return jy;NE=1;var e=os();function t(n,r){return function(s,i){if(s==null)return s;if(!e(s))return n(s,i);for(var a=s.length,c=r?a:-1,d=Object(s);(r?c--:++c<a)&&i(d[c],c,d)!==!1;);return s}}return jy=t,jy}var Ay,kE;function Vf(){if(kE)return Ay;kE=1;var e=p1(),t=fQ(),n=t(e);return Ay=n,Ay}var Ty,SE;function zi(){if(SE)return Ty;SE=1;function e(t){return t}return Ty=e,Ty}var Iy,CE;function r3(){if(CE)return Iy;CE=1;var e=zi();function t(n){return typeof n=="function"?n:e}return Iy=t,Iy}var My,_E;function s3(){if(_E)return My;_E=1;var e=i1(),t=Vf(),n=r3(),r=bt();function s(i,a){var c=r(i)?e:t;return c(i,n(a))}return My=s,My}var Ry,EE;function i3(){return EE||(EE=1,Ry=s3()),Ry}var Oy,jE;function hQ(){if(jE)return Oy;jE=1;var e=Vf();function t(n,r){var s=[];return e(n,function(i,a,c){r(i,a,c)&&s.push(i)}),s}return Oy=t,Oy}var Py,AE;function pQ(){if(AE)return Py;AE=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Py=t,Py}var Ly,TE;function mQ(){if(TE)return Ly;TE=1;function e(t){return this.__data__.has(t)}return Ly=e,Ly}var Dy,IE;function o3(){if(IE)return Dy;IE=1;var e=s1(),t=pQ(),n=mQ();function r(s){var i=-1,a=s==null?0:s.length;for(this.__data__=new e;++i<a;)this.add(s[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Dy=r,Dy}var $y,ME;function gQ(){if(ME)return $y;ME=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 $y=e,$y}var Fy,RE;function a3(){if(RE)return Fy;RE=1;function e(t,n){return t.has(n)}return Fy=e,Fy}var qy,OE;function l3(){if(OE)return qy;OE=1;var e=o3(),t=gQ(),n=a3(),r=1,s=2;function i(a,c,d,f,p,h){var g=d&r,y=a.length,w=c.length;if(y!=w&&!(g&&w>y))return!1;var b=h.get(a),v=h.get(c);if(b&&v)return b==c&&v==a;var N=-1,S=!0,k=d&s?new e:void 0;for(h.set(a,c),h.set(c,a);++N<y;){var _=a[N],A=c[N];if(f)var I=g?f(A,_,N,c,a,h):f(_,A,N,a,c,h);if(I!==void 0){if(I)continue;S=!1;break}if(k){if(!t(c,function(T,O){if(!n(k,O)&&(_===T||p(_,T,d,f,h)))return k.push(O)})){S=!1;break}}else if(!(_===A||p(_,A,d,f,h))){S=!1;break}}return h.delete(a),h.delete(c),S}return qy=i,qy}var By,PE;function yQ(){if(PE)return By;PE=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,i){r[++n]=[i,s]}),r}return By=e,By}var zy,LE;function m1(){if(LE)return zy;LE=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return zy=e,zy}var Vy,DE;function xQ(){if(DE)return Vy;DE=1;var e=ca(),t=J4(),n=la(),r=l3(),s=yQ(),i=m1(),a=1,c=2,d="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Map]",g="[object Number]",y="[object RegExp]",w="[object Set]",b="[object String]",v="[object Symbol]",N="[object ArrayBuffer]",S="[object DataView]",k=e?e.prototype:void 0,_=k?k.valueOf:void 0;function A(I,T,O,L,B,M,P){switch(O){case S:if(I.byteLength!=T.byteLength||I.byteOffset!=T.byteOffset)return!1;I=I.buffer,T=T.buffer;case N:return!(I.byteLength!=T.byteLength||!M(new t(I),new t(T)));case d:case f:case g:return n(+I,+T);case p:return I.name==T.name&&I.message==T.message;case y:case b:return I==T+"";case h:var H=s;case w:var D=L&a;if(H||(H=i),I.size!=T.size&&!D)return!1;var z=P.get(I);if(z)return z==T;L|=c,P.set(I,T);var V=r(H(I),H(T),L,B,M,P);return P.delete(I),V;case v:if(_)return _.call(I)==_.call(T)}return!1}return Vy=A,Vy}var Hy,$E;function vQ(){if($E)return Hy;$E=1;var e=X4(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(i,a,c,d,f,p){var h=c&t,g=e(i),y=g.length,w=e(a),b=w.length;if(y!=b&&!h)return!1;for(var v=y;v--;){var N=g[v];if(!(h?N in a:r.call(a,N)))return!1}var S=p.get(i),k=p.get(a);if(S&&k)return S==a&&k==i;var _=!0;p.set(i,a),p.set(a,i);for(var A=h;++v<y;){N=g[v];var I=i[N],T=a[N];if(d)var O=h?d(T,I,N,a,i,p):d(I,T,N,i,a,p);if(!(O===void 0?I===T||f(I,T,c,d,p):O)){_=!1;break}A||(A=N=="constructor")}if(_&&!A){var L=i.constructor,B=a.constructor;L!=B&&"constructor"in i&&"constructor"in a&&!(typeof L=="function"&&L instanceof L&&typeof B=="function"&&B instanceof B)&&(_=!1)}return p.delete(i),p.delete(a),_}return Hy=s,Hy}var Uy,FE;function bQ(){if(FE)return Uy;FE=1;var e=Lf(),t=l3(),n=xQ(),r=vQ(),s=da(),i=bt(),a=ua(),c=yc(),d=1,f="[object Arguments]",p="[object Array]",h="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function w(b,v,N,S,k,_){var A=i(b),I=i(v),T=A?p:s(b),O=I?p:s(v);T=T==f?h:T,O=O==f?h:O;var L=T==h,B=O==h,M=T==O;if(M&&a(b)){if(!a(v))return!1;A=!0,L=!1}if(M&&!L)return _||(_=new e),A||c(b)?t(b,v,N,S,k,_):n(b,v,T,N,S,k,_);if(!(N&d)){var P=L&&y.call(b,"__wrapped__"),H=B&&y.call(v,"__wrapped__");if(P||H){var D=P?b.value():b,z=H?v.value():v;return _||(_=new e),k(D,z,N,S,_)}}return M?(_||(_=new e),r(b,v,N,S,k,_)):!1}return Uy=w,Uy}var Wy,qE;function c3(){if(qE)return Wy;qE=1;var e=bQ(),t=Lr();function n(r,s,i,a,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,i,a,n,c)}return Wy=n,Wy}var Ky,BE;function wQ(){if(BE)return Ky;BE=1;var e=Lf(),t=c3(),n=1,r=2;function s(i,a,c,d){var f=c.length,p=f,h=!d;if(i==null)return!p;for(i=Object(i);f--;){var g=c[f];if(h&&g[2]?g[1]!==i[g[0]]:!(g[0]in i))return!1}for(;++f<p;){g=c[f];var y=g[0],w=i[y],b=g[1];if(h&&g[2]){if(w===void 0&&!(y in i))return!1}else{var v=new e;if(d)var N=d(w,b,y,i,a,v);if(!(N===void 0?t(b,w,n|r,d,v):N))return!1}}return!0}return Ky=s,Ky}var Gy,zE;function u3(){if(zE)return Gy;zE=1;var e=Rn();function t(n){return n===n&&!e(n)}return Gy=t,Gy}var Yy,VE;function NQ(){if(VE)return Yy;VE=1;var e=u3(),t=Gs();function n(r){for(var s=t(r),i=s.length;i--;){var a=s[i],c=r[a];s[i]=[a,c,e(c)]}return s}return Yy=n,Yy}var Xy,HE;function d3(){if(HE)return Xy;HE=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return Xy=e,Xy}var Qy,UE;function kQ(){if(UE)return Qy;UE=1;var e=wQ(),t=NQ(),n=d3();function r(s){var i=t(s);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(a){return a===s||e(a,s,i)}}return Qy=r,Qy}var Jy,WE;function fa(){if(WE)return Jy;WE=1;var e=Fi(),t=Lr(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return Jy=r,Jy}var Zy,KE;function g1(){if(KE)return Zy;KE=1;var e=bt(),t=fa(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(i,a){if(e(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||a!=null&&i in Object(a)}return Zy=s,Zy}var ex,GE;function SQ(){if(GE)return ex;GE=1;var e=s1(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var i=function(){var a=arguments,c=s?s.apply(this,a):a[0],d=i.cache;if(d.has(c))return d.get(c);var f=r.apply(this,a);return i.cache=d.set(c,f)||d,f};return i.cache=new(n.Cache||e),i}return n.Cache=e,ex=n,ex}var tx,YE;function CQ(){if(YE)return tx;YE=1;var e=SQ(),t=500;function n(r){var s=e(r,function(a){return i.size===t&&i.clear(),a}),i=s.cache;return s}return tx=n,tx}var nx,XE;function _Q(){if(XE)return nx;XE=1;var e=CQ(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var i=[];return s.charCodeAt(0)===46&&i.push(""),s.replace(t,function(a,c,d,f){i.push(d?f.replace(n,"$1"):c||a)}),i});return nx=r,nx}var rx,QE;function Hf(){if(QE)return rx;QE=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,i=Array(s);++r<s;)i[r]=n(t[r],r,t);return i}return rx=e,rx}var sx,JE;function EQ(){if(JE)return sx;JE=1;var e=ca(),t=Hf(),n=bt(),r=fa(),s=e?e.prototype:void 0,i=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 i?i.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return sx=a,sx}var ix,ZE;function f3(){if(ZE)return ix;ZE=1;var e=EQ();function t(n){return n==null?"":e(n)}return ix=t,ix}var ox,ej;function Uf(){if(ej)return ox;ej=1;var e=bt(),t=g1(),n=_Q(),r=f3();function s(i,a){return e(i)?i:t(i,a)?[i]:n(r(i))}return ox=s,ox}var ax,tj;function xc(){if(tj)return ax;tj=1;var e=fa();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return ax=t,ax}var lx,nj;function Wf(){if(nj)return lx;nj=1;var e=Uf(),t=xc();function n(r,s){s=e(s,r);for(var i=0,a=s.length;r!=null&&i<a;)r=r[t(s[i++])];return i&&i==a?r:void 0}return lx=n,lx}var cx,rj;function jQ(){if(rj)return cx;rj=1;var e=Wf();function t(n,r,s){var i=n==null?void 0:e(n,r);return i===void 0?s:i}return cx=t,cx}var ux,sj;function AQ(){if(sj)return ux;sj=1;function e(t,n){return t!=null&&n in Object(t)}return ux=e,ux}var dx,ij;function h3(){if(ij)return dx;ij=1;var e=Uf(),t=gc(),n=bt(),r=Ff(),s=o1(),i=xc();function a(c,d,f){d=e(d,c);for(var p=-1,h=d.length,g=!1;++p<h;){var y=i(d[p]);if(!(g=c!=null&&f(c,y)))break;c=c[y]}return g||++p!=h?g:(h=c==null?0:c.length,!!h&&s(h)&&r(y,h)&&(n(c)||t(c)))}return dx=a,dx}var fx,oj;function p3(){if(oj)return fx;oj=1;var e=AQ(),t=h3();function n(r,s){return r!=null&&t(r,s,e)}return fx=n,fx}var hx,aj;function TQ(){if(aj)return hx;aj=1;var e=c3(),t=jQ(),n=p3(),r=g1(),s=u3(),i=d3(),a=xc(),c=1,d=2;function f(p,h){return r(p)&&s(h)?i(a(p),h):function(g){var y=t(g,p);return y===void 0&&y===h?n(g,p):e(h,y,c|d)}}return hx=f,hx}var px,lj;function m3(){if(lj)return px;lj=1;function e(t){return function(n){return n==null?void 0:n[t]}}return px=e,px}var mx,cj;function IQ(){if(cj)return mx;cj=1;var e=Wf();function t(n){return function(r){return e(r,n)}}return mx=t,mx}var gx,uj;function MQ(){if(uj)return gx;uj=1;var e=m3(),t=IQ(),n=g1(),r=xc();function s(i){return n(i)?e(r(i)):t(i)}return gx=s,gx}var yx,dj;function as(){if(dj)return yx;dj=1;var e=kQ(),t=TQ(),n=zi(),r=bt(),s=MQ();function i(a){return typeof a=="function"?a:a==null?n:typeof a=="object"?r(a)?t(a[0],a[1]):e(a):s(a)}return yx=i,yx}var xx,fj;function g3(){if(fj)return xx;fj=1;var e=W4(),t=hQ(),n=as(),r=bt();function s(i,a){var c=r(i)?e:t;return c(i,n(a,3))}return xx=s,xx}var vx,hj;function RQ(){if(hj)return vx;hj=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,s){return r!=null&&t.call(r,s)}return vx=n,vx}var bx,pj;function y3(){if(pj)return bx;pj=1;var e=RQ(),t=h3();function n(r,s){return r!=null&&t(r,s,e)}return bx=n,bx}var wx,mj;function OQ(){if(mj)return wx;mj=1;var e=l1(),t=da(),n=gc(),r=bt(),s=os(),i=ua(),a=Bf(),c=yc(),d="[object Map]",f="[object Set]",p=Object.prototype,h=p.hasOwnProperty;function g(y){if(y==null)return!0;if(s(y)&&(r(y)||typeof y=="string"||typeof y.splice=="function"||i(y)||c(y)||n(y)))return!y.length;var w=t(y);if(w==d||w==f)return!y.size;if(a(y))return!e(y).length;for(var b in y)if(h.call(y,b))return!1;return!0}return wx=g,wx}var Nx,gj;function x3(){if(gj)return Nx;gj=1;function e(t){return t===void 0}return Nx=e,Nx}var kx,yj;function v3(){if(yj)return kx;yj=1;var e=Vf(),t=os();function n(r,s){var i=-1,a=t(r)?Array(r.length):[];return e(r,function(c,d,f){a[++i]=s(c,d,f)}),a}return kx=n,kx}var Sx,xj;function b3(){if(xj)return Sx;xj=1;var e=Hf(),t=as(),n=v3(),r=bt();function s(i,a){var c=r(i)?e:n;return c(i,t(a,3))}return Sx=s,Sx}var Cx,vj;function PQ(){if(vj)return Cx;vj=1;function e(t,n,r,s){var i=-1,a=t==null?0:t.length;for(s&&a&&(r=t[++i]);++i<a;)r=n(r,t[i],i,t);return r}return Cx=e,Cx}var _x,bj;function LQ(){if(bj)return _x;bj=1;function e(t,n,r,s,i){return i(t,function(a,c,d){r=s?(s=!1,a):n(r,a,c,d)}),r}return _x=e,_x}var Ex,wj;function w3(){if(wj)return Ex;wj=1;var e=PQ(),t=Vf(),n=as(),r=LQ(),s=bt();function i(a,c,d){var f=s(a)?e:r,p=arguments.length<3;return f(a,n(c,4),d,p,t)}return Ex=i,Ex}var jx,Nj;function DQ(){if(Nj)return jx;Nj=1;var e=Fi(),t=bt(),n=Lr(),r="[object String]";function s(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return jx=s,jx}var Ax,kj;function $Q(){if(kj)return Ax;kj=1;var e=m3(),t=e("length");return Ax=t,Ax}var Tx,Sj;function FQ(){if(Sj)return Tx;Sj=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",a="\\u200d",c=RegExp("["+a+e+s+i+"]");function d(f){return c.test(f)}return Tx=d,Tx}var Ix,Cj;function qQ(){if(Cj)return Ix;Cj=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",a="["+e+"]",c="["+s+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",p="[^"+e+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",w=f+"?",b="["+i+"]?",v="(?:"+y+"(?:"+[p,h,g].join("|")+")"+b+w+")*",N=b+w+v,S="(?:"+[p+c+"?",c,h,g,a].join("|")+")",k=RegExp(d+"(?="+d+")|"+S+N,"g");function _(A){for(var I=k.lastIndex=0;k.test(A);)++I;return I}return Ix=_,Ix}var Mx,_j;function BQ(){if(_j)return Mx;_j=1;var e=$Q(),t=FQ(),n=qQ();function r(s){return t(s)?n(s):e(s)}return Mx=r,Mx}var Rx,Ej;function zQ(){if(Ej)return Rx;Ej=1;var e=l1(),t=da(),n=os(),r=DQ(),s=BQ(),i="[object Map]",a="[object Set]";function c(d){if(d==null)return 0;if(n(d))return r(d)?s(d):d.length;var f=t(d);return f==i||f==a?d.size:e(d).length}return Rx=c,Rx}var Ox,jj;function VQ(){if(jj)return Ox;jj=1;var e=i1(),t=e3(),n=p1(),r=as(),s=zf(),i=bt(),a=ua(),c=pc(),d=Rn(),f=yc();function p(h,g,y){var w=i(h),b=w||a(h)||f(h);if(g=r(g,4),y==null){var v=h&&h.constructor;b?y=w?new v:[]:d(h)?y=c(v)?t(s(h)):{}:y={}}return(b?e:n)(h,function(N,S,k){return g(y,N,S,k)}),y}return Ox=p,Ox}var Px,Aj;function HQ(){if(Aj)return Px;Aj=1;var e=ca(),t=gc(),n=bt(),r=e?e.isConcatSpreadable:void 0;function s(i){return n(i)||t(i)||!!(r&&i&&i[r])}return Px=s,Px}var Lx,Tj;function y1(){if(Tj)return Lx;Tj=1;var e=u1(),t=HQ();function n(r,s,i,a,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var p=r[d];s>0&&i(p)?s>1?n(p,s-1,i,a,c):e(c,p):a||(c[c.length]=p)}return c}return Lx=n,Lx}var Dx,Ij;function UQ(){if(Ij)return Dx;Ij=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 Dx=e,Dx}var $x,Mj;function N3(){if(Mj)return $x;Mj=1;var e=UQ(),t=Math.max;function n(r,s,i){return s=t(s===void 0?r.length-1:s,0),function(){for(var a=arguments,c=-1,d=t(a.length-s,0),f=Array(d);++c<d;)f[c]=a[s+c];c=-1;for(var p=Array(s+1);++c<s;)p[c]=a[c];return p[s]=i(f),e(r,this,p)}}return $x=n,$x}var Fx,Rj;function WQ(){if(Rj)return Fx;Rj=1;var e=f1(),t=B4(),n=zi(),r=t?function(s,i){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Fx=r,Fx}var qx,Oj;function KQ(){if(Oj)return qx;Oj=1;var e=800,t=16,n=Date.now;function r(s){var i=0,a=0;return function(){var c=n(),d=t-(c-a);if(a=c,d>0){if(++i>=e)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}return qx=r,qx}var Bx,Pj;function k3(){if(Pj)return Bx;Pj=1;var e=WQ(),t=KQ(),n=t(e);return Bx=n,Bx}var zx,Lj;function Kf(){if(Lj)return zx;Lj=1;var e=zi(),t=N3(),n=k3();function r(s,i){return n(t(s,i,e),s+"")}return zx=r,zx}var Vx,Dj;function S3(){if(Dj)return Vx;Dj=1;function e(t,n,r,s){for(var i=t.length,a=r+(s?1:-1);s?a--:++a<i;)if(n(t[a],a,t))return a;return-1}return Vx=e,Vx}var Hx,$j;function GQ(){if($j)return Hx;$j=1;function e(t){return t!==t}return Hx=e,Hx}var Ux,Fj;function YQ(){if(Fj)return Ux;Fj=1;function e(t,n,r){for(var s=r-1,i=t.length;++s<i;)if(t[s]===n)return s;return-1}return Ux=e,Ux}var Wx,qj;function XQ(){if(qj)return Wx;qj=1;var e=S3(),t=GQ(),n=YQ();function r(s,i,a){return i===i?n(s,i,a):e(s,t,a)}return Wx=r,Wx}var Kx,Bj;function QQ(){if(Bj)return Kx;Bj=1;var e=XQ();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return Kx=t,Kx}var Gx,zj;function JQ(){if(zj)return Gx;zj=1;function e(t,n,r){for(var s=-1,i=t==null?0:t.length;++s<i;)if(r(n,t[s]))return!0;return!1}return Gx=e,Gx}var Yx,Vj;function ZQ(){if(Vj)return Yx;Vj=1;function e(){}return Yx=e,Yx}var Xx,Hj;function eJ(){if(Hj)return Xx;Hj=1;var e=Q4(),t=ZQ(),n=m1(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return Xx=s,Xx}var Qx,Uj;function tJ(){if(Uj)return Qx;Uj=1;var e=o3(),t=QQ(),n=JQ(),r=a3(),s=eJ(),i=m1(),a=200;function c(d,f,p){var h=-1,g=t,y=d.length,w=!0,b=[],v=b;if(p)w=!1,g=n;else if(y>=a){var N=f?null:s(d);if(N)return i(N);w=!1,g=r,v=new e}else v=f?[]:b;e:for(;++h<y;){var S=d[h],k=f?f(S):S;if(S=p||S!==0?S:0,w&&k===k){for(var _=v.length;_--;)if(v[_]===k)continue e;f&&v.push(k),b.push(S)}else g(v,k,p)||(v!==b&&v.push(k),b.push(S))}return b}return Qx=c,Qx}var Jx,Wj;function C3(){if(Wj)return Jx;Wj=1;var e=os(),t=Lr();function n(r){return t(r)&&e(r)}return Jx=n,Jx}var Zx,Kj;function nJ(){if(Kj)return Zx;Kj=1;var e=y1(),t=Kf(),n=tJ(),r=C3(),s=t(function(i){return n(e(i,1,r,!0))});return Zx=s,Zx}var ev,Gj;function rJ(){if(Gj)return ev;Gj=1;var e=Hf();function t(n,r){return e(r,function(s){return n[s]})}return ev=t,ev}var tv,Yj;function _3(){if(Yj)return tv;Yj=1;var e=rJ(),t=Gs();function n(r){return r==null?[]:e(r,t(r))}return tv=n,tv}var nv,Xj;function On(){if(Xj)return nv;Xj=1;var e;if(typeof n1=="function")try{e={clone:uQ(),constant:f1(),each:i3(),filter:g3(),has:y3(),isArray:bt(),isEmpty:OQ(),isFunction:pc(),isUndefined:x3(),keys:Gs(),map:b3(),reduce:w3(),size:zQ(),transform:VQ(),union:nJ(),values:_3()}}catch{}return e||(e=window._),nv=e,nv}var rv,Qj;function x1(){if(Qj)return rv;Qj=1;var e=On();rv=s;var t="\0",n="\0",r="";function s(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(p){return this._label=p,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return e.keys(this._nodes)},s.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(h){return e.isEmpty(p._in[h])})},s.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(h){return e.isEmpty(p._out[h])})},s.prototype.setNodes=function(p,h){var g=arguments,y=this;return e.each(p,function(w){g.length>1?y.setNode(w,h):y.setNode(w)}),this},s.prototype.setNode=function(p,h){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=h),this):(this._nodes[p]=arguments.length>1?h:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=n,this._children[p]={},this._children[n][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},s.prototype.node=function(p){return this._nodes[p]},s.prototype.hasNode=function(p){return e.has(this._nodes,p)},s.prototype.removeNode=function(p){var h=this;if(e.has(this._nodes,p)){var g=function(y){h.removeEdge(h._edgeObjs[y])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(y){h.setParent(y)}),delete this._children[p]),e.each(e.keys(this._in[p]),g),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),g),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},s.prototype.setParent=function(p,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(h))h=n;else{h+="";for(var g=h;!e.isUndefined(g);g=this.parent(g))if(g===p)throw new Error("Setting "+h+" as parent of "+p+" would create a cycle");this.setNode(h)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=h,this._children[h][p]=!0,this},s.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},s.prototype.parent=function(p){if(this._isCompound){var h=this._parent[p];if(h!==n)return h}},s.prototype.children=function(p){if(e.isUndefined(p)&&(p=n),this._isCompound){var h=this._children[p];if(h)return e.keys(h)}else{if(p===n)return this.nodes();if(this.hasNode(p))return[]}},s.prototype.predecessors=function(p){var h=this._preds[p];if(h)return e.keys(h)},s.prototype.successors=function(p){var h=this._sucs[p];if(h)return e.keys(h)},s.prototype.neighbors=function(p){var h=this.predecessors(p);if(h)return e.union(h,this.successors(p))},s.prototype.isLeaf=function(p){var h;return this.isDirected()?h=this.successors(p):h=this.neighbors(p),h.length===0},s.prototype.filterNodes=function(p){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var g=this;e.each(this._nodes,function(b,v){p(v)&&h.setNode(v,b)}),e.each(this._edgeObjs,function(b){h.hasNode(b.v)&&h.hasNode(b.w)&&h.setEdge(b,g.edge(b))});var y={};function w(b){var v=g.parent(b);return v===void 0||h.hasNode(v)?(y[b]=v,v):v in y?y[v]:w(v)}return this._isCompound&&e.each(h.nodes(),function(b){h.setParent(b,w(b))}),h},s.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return e.values(this._edgeObjs)},s.prototype.setPath=function(p,h){var g=this,y=arguments;return e.reduce(p,function(w,b){return y.length>1?g.setEdge(w,b,h):g.setEdge(w,b),b}),this},s.prototype.setEdge=function(){var p,h,g,y,w=!1,b=arguments[0];typeof b=="object"&&b!==null&&"v"in b?(p=b.v,h=b.w,g=b.name,arguments.length===2&&(y=arguments[1],w=!0)):(p=b,h=arguments[1],g=arguments[3],arguments.length>2&&(y=arguments[2],w=!0)),p=""+p,h=""+h,e.isUndefined(g)||(g=""+g);var v=c(this._isDirected,p,h,g);if(e.has(this._edgeLabels,v))return w&&(this._edgeLabels[v]=y),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(h),this._edgeLabels[v]=w?y:this._defaultEdgeLabelFn(p,h,g);var N=d(this._isDirected,p,h,g);return p=N.v,h=N.w,Object.freeze(N),this._edgeObjs[v]=N,i(this._preds[h],p),i(this._sucs[p],h),this._in[h][v]=N,this._out[p][v]=N,this._edgeCount++,this},s.prototype.edge=function(p,h,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,p,h,g);return this._edgeLabels[y]},s.prototype.hasEdge=function(p,h,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,p,h,g);return e.has(this._edgeLabels,y)},s.prototype.removeEdge=function(p,h,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,p,h,g),w=this._edgeObjs[y];return w&&(p=w.v,h=w.w,delete this._edgeLabels[y],delete this._edgeObjs[y],a(this._preds[h],p),a(this._sucs[p],h),delete this._in[h][y],delete this._out[p][y],this._edgeCount--),this},s.prototype.inEdges=function(p,h){var g=this._in[p];if(g){var y=e.values(g);return h?e.filter(y,function(w){return w.v===h}):y}},s.prototype.outEdges=function(p,h){var g=this._out[p];if(g){var y=e.values(g);return h?e.filter(y,function(w){return w.w===h}):y}},s.prototype.nodeEdges=function(p,h){var g=this.inEdges(p,h);if(g)return g.concat(this.outEdges(p,h))};function i(p,h){p[h]?p[h]++:p[h]=1}function a(p,h){--p[h]||delete p[h]}function c(p,h,g,y){var w=""+h,b=""+g;if(!p&&w>b){var v=w;w=b,b=v}return w+r+b+r+(e.isUndefined(y)?t:y)}function d(p,h,g,y){var w=""+h,b=""+g;if(!p&&w>b){var v=w;w=b,b=v}var N={v:w,w:b};return y&&(N.name=y),N}function f(p,h){return c(p,h.v,h.w,h.name)}return rv}var sv,Jj;function sJ(){return Jj||(Jj=1,sv="2.1.8"),sv}var iv,Zj;function iJ(){return Zj||(Zj=1,iv={Graph:x1(),version:sJ()}),iv}var ov,eA;function oJ(){if(eA)return ov;eA=1;var e=On(),t=x1();ov={write:n,read:i};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 d=a.node(c),f=a.parent(c),p={v:c};return e.isUndefined(d)||(p.value=d),e.isUndefined(f)||(p.parent=f),p})}function s(a){return e.map(a.edges(),function(c){var d=a.edge(c),f={v:c.v,w:c.w};return e.isUndefined(c.name)||(f.name=c.name),e.isUndefined(d)||(f.value=d),f})}function i(a){var c=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(d){c.setNode(d.v,d.value),d.parent&&c.setParent(d.v,d.parent)}),e.each(a.edges,function(d){c.setEdge({v:d.v,w:d.w,name:d.name},d.value)}),c}return ov}var av,tA;function aJ(){if(tA)return av;tA=1;var e=On();av=t;function t(n){var r={},s=[],i;function a(c){e.has(r,c)||(r[c]=!0,i.push(c),e.each(n.successors(c),a),e.each(n.predecessors(c),a))}return e.each(n.nodes(),function(c){i=[],a(c),i.length&&s.push(i)}),s}return av}var lv,nA;function E3(){if(nA)return lv;nA=1;var e=On();lv=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 i=this._arr,a=i.length;return s[n]=a,i.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,i=s+1,a=n;s<r.length&&(a=r[s].priority<r[a].priority?s:a,i<r.length&&(a=r[i].priority<r[a].priority?i:a),a!==n&&(this._swap(n,a),this._heapify(a)))},t.prototype._decrease=function(n){for(var r=this._arr,s=r[n].priority,i;n!==0&&(i=n>>1,!(r[i].priority<s));)this._swap(n,i),n=i},t.prototype._swap=function(n,r){var s=this._arr,i=this._keyIndices,a=s[n],c=s[r];s[n]=c,s[r]=a,i[c.key]=n,i[a.key]=r},lv}var cv,rA;function j3(){if(rA)return cv;rA=1;var e=On(),t=E3();cv=r;var n=e.constant(1);function r(i,a,c,d){return s(i,String(a),c||n,d||function(f){return i.outEdges(f)})}function s(i,a,c,d){var f={},p=new t,h,g,y=function(w){var b=w.v!==h?w.v:w.w,v=f[b],N=c(w),S=g.distance+N;if(N<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+w+" Weight: "+N);S<v.distance&&(v.distance=S,v.predecessor=h,p.decrease(b,S))};for(i.nodes().forEach(function(w){var b=w===a?0:Number.POSITIVE_INFINITY;f[w]={distance:b},p.add(w,b)});p.size()>0&&(h=p.removeMin(),g=f[h],g.distance!==Number.POSITIVE_INFINITY);)d(h).forEach(y);return f}return cv}var uv,sA;function lJ(){if(sA)return uv;sA=1;var e=j3(),t=On();uv=n;function n(r,s,i){return t.transform(r.nodes(),function(a,c){a[c]=e(r,c,s,i)},{})}return uv}var dv,iA;function A3(){if(iA)return dv;iA=1;var e=On();dv=t;function t(n){var r=0,s=[],i={},a=[];function c(d){var f=i[d]={onStack:!0,lowlink:r,index:r++};if(s.push(d),n.successors(d).forEach(function(g){e.has(i,g)?i[g].onStack&&(f.lowlink=Math.min(f.lowlink,i[g].index)):(c(g),f.lowlink=Math.min(f.lowlink,i[g].lowlink))}),f.lowlink===f.index){var p=[],h;do h=s.pop(),i[h].onStack=!1,p.push(h);while(d!==h);a.push(p)}}return n.nodes().forEach(function(d){e.has(i,d)||c(d)}),a}return dv}var fv,oA;function cJ(){if(oA)return fv;oA=1;var e=On(),t=A3();fv=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 fv}var hv,aA;function uJ(){if(aA)return hv;aA=1;var e=On();hv=n;var t=e.constant(1);function n(s,i,a){return r(s,i||t,a||function(c){return s.outEdges(c)})}function r(s,i,a){var c={},d=s.nodes();return d.forEach(function(f){c[f]={},c[f][f]={distance:0},d.forEach(function(p){f!==p&&(c[f][p]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(p){var h=p.v===f?p.w:p.v,g=i(p);c[f][h]={distance:g,predecessor:f}})}),d.forEach(function(f){var p=c[f];d.forEach(function(h){var g=c[h];d.forEach(function(y){var w=g[f],b=p[y],v=g[y],N=w.distance+b.distance;N<v.distance&&(v.distance=N,v.predecessor=b.predecessor)})})}),c}return hv}var pv,lA;function T3(){if(lA)return pv;lA=1;var e=On();pv=t,t.CycleException=n;function t(r){var s={},i={},a=[];function c(d){if(e.has(i,d))throw new n;e.has(s,d)||(i[d]=!0,s[d]=!0,e.each(r.predecessors(d),c),delete i[d],a.push(d))}if(e.each(r.sinks(),c),e.size(s)!==r.nodeCount())throw new n;return a}function n(){}return n.prototype=new Error,pv}var mv,cA;function dJ(){if(cA)return mv;cA=1;var e=T3();mv=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return mv}var gv,uA;function I3(){if(uA)return gv;uA=1;var e=On();gv=t;function t(r,s,i){e.isArray(s)||(s=[s]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),c=[],d={};return e.each(s,function(f){if(!r.hasNode(f))throw new Error("Graph does not have node: "+f);n(r,f,i==="post",d,a,c)}),c}function n(r,s,i,a,c,d){e.has(a,s)||(a[s]=!0,i||d.push(s),e.each(c(s),function(f){n(r,f,i,a,c,d)}),i&&d.push(s))}return gv}var yv,dA;function fJ(){if(dA)return yv;dA=1;var e=I3();yv=t;function t(n,r){return e(n,r,"post")}return yv}var xv,fA;function hJ(){if(fA)return xv;fA=1;var e=I3();xv=t;function t(n,r){return e(n,r,"pre")}return xv}var vv,hA;function pJ(){if(hA)return vv;hA=1;var e=On(),t=x1(),n=E3();vv=r;function r(s,i){var a=new t,c={},d=new n,f;function p(g){var y=g.v===f?g.w:g.v,w=d.priority(y);if(w!==void 0){var b=i(g);b<w&&(c[y]=f,d.decrease(y,b))}}if(s.nodeCount()===0)return a;e.each(s.nodes(),function(g){d.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),d.decrease(s.nodes()[0],0);for(var h=!1;d.size()>0;){if(f=d.removeMin(),e.has(c,f))a.setEdge(f,c[f]);else{if(h)throw new Error("Input graph is not connected: "+s);h=!0}s.nodeEdges(f).forEach(p)}return a}return vv}var bv,pA;function mJ(){return pA||(pA=1,bv={components:aJ(),dijkstra:j3(),dijkstraAll:lJ(),findCycles:cJ(),floydWarshall:uJ(),isAcyclic:dJ(),postorder:fJ(),preorder:hJ(),prim:pJ(),tarjan:A3(),topsort:T3()}),bv}var wv,mA;function gJ(){if(mA)return wv;mA=1;var e=iJ();return wv={Graph:e.Graph,json:oJ(),alg:mJ(),version:e.version},wv}var Nv,gA;function nr(){if(gA)return Nv;gA=1;var e;if(typeof n1=="function")try{e=gJ()}catch{}return e||(e=window.graphlib),Nv=e,Nv}var kv,yA;function yJ(){if(yA)return kv;yA=1;var e=n3(),t=1,n=4;function r(s){return e(s,t|n)}return kv=r,kv}var Sv,xA;function Gf(){if(xA)return Sv;xA=1;var e=la(),t=os(),n=Ff(),r=Rn();function s(i,a,c){if(!r(c))return!1;var d=typeof a;return(d=="number"?t(c)&&n(a,c.length):d=="string"&&a in c)?e(c[a],i):!1}return Sv=s,Sv}var Cv,vA;function xJ(){if(vA)return Cv;vA=1;var e=Kf(),t=la(),n=Gf(),r=Bi(),s=Object.prototype,i=s.hasOwnProperty,a=e(function(c,d){c=Object(c);var f=-1,p=d.length,h=p>2?d[2]:void 0;for(h&&n(d[0],d[1],h)&&(p=1);++f<p;)for(var g=d[f],y=r(g),w=-1,b=y.length;++w<b;){var v=y[w],N=c[v];(N===void 0||t(N,s[v])&&!i.call(c,v))&&(c[v]=g[v])}return c});return Cv=a,Cv}var _v,bA;function vJ(){if(bA)return _v;bA=1;var e=as(),t=os(),n=Gs();function r(s){return function(i,a,c){var d=Object(i);if(!t(i)){var f=e(a,3);i=n(i),a=function(h){return f(d[h],h,d)}}var p=s(i,a,c);return p>-1?d[f?i[p]:p]:void 0}}return _v=r,_v}var Ev,wA;function bJ(){if(wA)return Ev;wA=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Ev=t,Ev}var jv,NA;function wJ(){if(NA)return jv;NA=1;var e=bJ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return jv=n,jv}var Av,kA;function NJ(){if(kA)return Av;kA=1;var e=wJ(),t=Rn(),n=fa(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var p=typeof f.valueOf=="function"?f.valueOf():f;f=t(p)?p+"":p}if(typeof f!="string")return f===0?f:+f;f=e(f);var h=i.test(f);return h||a.test(f)?c(f.slice(2),h?2:8):s.test(f)?r:+f}return Av=d,Av}var Tv,SA;function M3(){if(SA)return Tv;SA=1;var e=NJ(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var i=s<0?-1:1;return i*n}return s===s?s:0}return Tv=r,Tv}var Iv,CA;function kJ(){if(CA)return Iv;CA=1;var e=M3();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return Iv=t,Iv}var Mv,_A;function SJ(){if(_A)return Mv;_A=1;var e=S3(),t=as(),n=kJ(),r=Math.max;function s(i,a,c){var d=i==null?0:i.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(i,t(a,3),f)}return Mv=s,Mv}var Rv,EA;function CJ(){if(EA)return Rv;EA=1;var e=vJ(),t=SJ(),n=e(t);return Rv=n,Rv}var Ov,jA;function R3(){if(jA)return Ov;jA=1;var e=y1();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return Ov=t,Ov}var Pv,AA;function _J(){if(AA)return Pv;AA=1;var e=h1(),t=r3(),n=Bi();function r(s,i){return s==null?s:e(s,t(i),n)}return Pv=r,Pv}var Lv,TA;function EJ(){if(TA)return Lv;TA=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Lv=e,Lv}var Dv,IA;function jJ(){if(IA)return Dv;IA=1;var e=Df(),t=p1(),n=as();function r(s,i){var a={};return i=n(i,3),t(s,function(c,d,f){e(a,d,i(c,d,f))}),a}return Dv=r,Dv}var $v,MA;function v1(){if(MA)return $v;MA=1;var e=fa();function t(n,r,s){for(var i=-1,a=n.length;++i<a;){var c=n[i],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):s(d,f)))var f=d,p=c}return p}return $v=t,$v}var Fv,RA;function AJ(){if(RA)return Fv;RA=1;function e(t,n){return t>n}return Fv=e,Fv}var qv,OA;function TJ(){if(OA)return qv;OA=1;var e=v1(),t=AJ(),n=zi();function r(s){return s&&s.length?e(s,n,t):void 0}return qv=r,qv}var Bv,PA;function O3(){if(PA)return Bv;PA=1;var e=Df(),t=la();function n(r,s,i){(i!==void 0&&!t(r[s],i)||i===void 0&&!(s in r))&&e(r,s,i)}return Bv=n,Bv}var zv,LA;function IJ(){if(LA)return zv;LA=1;var e=Fi(),t=zf(),n=Lr(),r="[object Object]",s=Function.prototype,i=Object.prototype,a=s.toString,c=i.hasOwnProperty,d=a.call(Object);function f(p){if(!n(p)||e(p)!=r)return!1;var h=t(p);if(h===null)return!0;var g=c.call(h,"constructor")&&h.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==d}return zv=f,zv}var Vv,DA;function P3(){if(DA)return Vv;DA=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return Vv=e,Vv}var Hv,$A;function MJ(){if($A)return Hv;$A=1;var e=mc(),t=Bi();function n(r){return e(r,t(r))}return Hv=n,Hv}var Uv,FA;function RJ(){if(FA)return Uv;FA=1;var e=O3(),t=H4(),n=Z4(),r=U4(),s=t3(),i=gc(),a=bt(),c=C3(),d=ua(),f=pc(),p=Rn(),h=IJ(),g=yc(),y=P3(),w=MJ();function b(v,N,S,k,_,A,I){var T=y(v,S),O=y(N,S),L=I.get(O);if(L){e(v,S,L);return}var B=A?A(T,O,S+"",v,N,I):void 0,M=B===void 0;if(M){var P=a(O),H=!P&&d(O),D=!P&&!H&&g(O);B=O,P||H||D?a(T)?B=T:c(T)?B=r(T):H?(M=!1,B=t(O,!0)):D?(M=!1,B=n(O,!0)):B=[]:h(O)||i(O)?(B=T,i(T)?B=w(T):(!p(T)||f(T))&&(B=s(O))):M=!1}M&&(I.set(O,B),_(B,O,k,A,I),I.delete(O)),e(v,S,B)}return Uv=b,Uv}var Wv,qA;function OJ(){if(qA)return Wv;qA=1;var e=Lf(),t=O3(),n=h1(),r=RJ(),s=Rn(),i=Bi(),a=P3();function c(d,f,p,h,g){d!==f&&n(f,function(y,w){if(g||(g=new e),s(y))r(d,f,w,p,c,h,g);else{var b=h?h(a(d,w),y,w+"",d,f,g):void 0;b===void 0&&(b=y),t(d,w,b)}},i)}return Wv=c,Wv}var Kv,BA;function PJ(){if(BA)return Kv;BA=1;var e=Kf(),t=Gf();function n(r){return e(function(s,i){var a=-1,c=i.length,d=c>1?i[c-1]:void 0,f=c>2?i[2]:void 0;for(d=r.length>3&&typeof d=="function"?(c--,d):void 0,f&&t(i[0],i[1],f)&&(d=c<3?void 0:d,c=1),s=Object(s);++a<c;){var p=i[a];p&&r(s,p,a,d)}return s})}return Kv=n,Kv}var Gv,zA;function LJ(){if(zA)return Gv;zA=1;var e=OJ(),t=PJ(),n=t(function(r,s,i){e(r,s,i)});return Gv=n,Gv}var Yv,VA;function L3(){if(VA)return Yv;VA=1;function e(t,n){return t<n}return Yv=e,Yv}var Xv,HA;function DJ(){if(HA)return Xv;HA=1;var e=v1(),t=L3(),n=zi();function r(s){return s&&s.length?e(s,n,t):void 0}return Xv=r,Xv}var Qv,UA;function $J(){if(UA)return Qv;UA=1;var e=v1(),t=as(),n=L3();function r(s,i){return s&&s.length?e(s,t(i,2),n):void 0}return Qv=r,Qv}var Jv,WA;function FJ(){if(WA)return Jv;WA=1;var e=lr(),t=function(){return e.Date.now()};return Jv=t,Jv}var Zv,KA;function qJ(){if(KA)return Zv;KA=1;var e=$f(),t=Uf(),n=Ff(),r=Rn(),s=xc();function i(a,c,d,f){if(!r(a))return a;c=t(c,a);for(var p=-1,h=c.length,g=h-1,y=a;y!=null&&++p<h;){var w=s(c[p]),b=d;if(w==="__proto__"||w==="constructor"||w==="prototype")return a;if(p!=g){var v=y[w];b=f?f(v,w,y):void 0,b===void 0&&(b=r(v)?v:n(c[p+1])?[]:{})}e(y,w,b),y=y[w]}return a}return Zv=i,Zv}var e0,GA;function BJ(){if(GA)return e0;GA=1;var e=Wf(),t=qJ(),n=Uf();function r(s,i,a){for(var c=-1,d=i.length,f={};++c<d;){var p=i[c],h=e(s,p);a(h,p)&&t(f,n(p,s),h)}return f}return e0=r,e0}var t0,YA;function zJ(){if(YA)return t0;YA=1;var e=BJ(),t=p3();function n(r,s){return e(r,s,function(i,a){return t(r,a)})}return t0=n,t0}var n0,XA;function VJ(){if(XA)return n0;XA=1;var e=R3(),t=N3(),n=k3();function r(s){return n(t(s,void 0,e),s+"")}return n0=r,n0}var r0,QA;function HJ(){if(QA)return r0;QA=1;var e=zJ(),t=VJ(),n=t(function(r,s){return r==null?{}:e(r,s)});return r0=n,r0}var s0,JA;function UJ(){if(JA)return s0;JA=1;var e=Math.ceil,t=Math.max;function n(r,s,i,a){for(var c=-1,d=t(e((s-r)/(i||1)),0),f=Array(d);d--;)f[a?d:++c]=r,r+=i;return f}return s0=n,s0}var i0,ZA;function WJ(){if(ZA)return i0;ZA=1;var e=UJ(),t=Gf(),n=M3();function r(s){return function(i,a,c){return c&&typeof c!="number"&&t(i,a,c)&&(a=c=void 0),i=n(i),a===void 0?(a=i,i=0):a=n(a),c=c===void 0?i<a?1:-1:n(c),e(i,a,c,s)}}return i0=r,i0}var o0,eT;function KJ(){if(eT)return o0;eT=1;var e=WJ(),t=e();return o0=t,o0}var a0,tT;function GJ(){if(tT)return a0;tT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return a0=e,a0}var l0,nT;function YJ(){if(nT)return l0;nT=1;var e=fa();function t(n,r){if(n!==r){var s=n!==void 0,i=n===null,a=n===n,c=e(n),d=r!==void 0,f=r===null,p=r===r,h=e(r);if(!f&&!h&&!c&&n>r||c&&d&&p&&!f&&!h||i&&d&&p||!s&&p||!a)return 1;if(!i&&!c&&!h&&n<r||h&&s&&a&&!i&&!c||f&&s&&a||!d&&a||!p)return-1}return 0}return l0=t,l0}var c0,rT;function XJ(){if(rT)return c0;rT=1;var e=YJ();function t(n,r,s){for(var i=-1,a=n.criteria,c=r.criteria,d=a.length,f=s.length;++i<d;){var p=e(a[i],c[i]);if(p){if(i>=f)return p;var h=s[i];return p*(h=="desc"?-1:1)}}return n.index-r.index}return c0=t,c0}var u0,sT;function QJ(){if(sT)return u0;sT=1;var e=Hf(),t=Wf(),n=as(),r=v3(),s=GJ(),i=qf(),a=XJ(),c=zi(),d=bt();function f(p,h,g){h.length?h=e(h,function(b){return d(b)?function(v){return t(v,b.length===1?b[0]:b)}:b}):h=[c];var y=-1;h=e(h,i(n));var w=r(p,function(b,v,N){var S=e(h,function(k){return k(b)});return{criteria:S,index:++y,value:b}});return s(w,function(b,v){return a(b,v,g)})}return u0=f,u0}var d0,iT;function JJ(){if(iT)return d0;iT=1;var e=y1(),t=QJ(),n=Kf(),r=Gf(),s=n(function(i,a){if(i==null)return[];var c=a.length;return c>1&&r(i,a[0],a[1])?a=[]:c>2&&r(a[0],a[1],a[2])&&(a=[a[0]]),t(i,e(a,1),[])});return d0=s,d0}var f0,oT;function ZJ(){if(oT)return f0;oT=1;var e=f3(),t=0;function n(r){var s=++t;return e(r)+s}return f0=n,f0}var h0,aT;function eZ(){if(aT)return h0;aT=1;function e(t,n,r){for(var s=-1,i=t.length,a=n.length,c={};++s<i;){var d=s<a?n[s]:void 0;r(c,t[s],d)}return c}return h0=e,h0}var p0,lT;function tZ(){if(lT)return p0;lT=1;var e=$f(),t=eZ();function n(r,s){return t(r||[],s||[],e)}return p0=n,p0}var m0,cT;function it(){if(cT)return m0;cT=1;var e;if(typeof n1=="function")try{e={cloneDeep:yJ(),constant:f1(),defaults:xJ(),each:i3(),filter:g3(),find:CJ(),flatten:R3(),forEach:s3(),forIn:_J(),has:y3(),isUndefined:x3(),last:EJ(),map:b3(),mapValues:jJ(),max:TJ(),merge:LJ(),min:DJ(),minBy:$J(),now:FJ(),pick:HJ(),range:KJ(),reduce:w3(),sortBy:JJ(),uniqueId:ZJ(),values:_3(),zipObject:tZ()}}catch{}return e||(e=window._),m0=e,m0}var g0,uT;function nZ(){if(uT)return g0;uT=1,g0=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,i=s._prev;i!==s;)r.push(JSON.stringify(i,n)),i=i._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 g0}var y0,dT;function rZ(){if(dT)return y0;dT=1;var e=it(),t=nr().Graph,n=nZ();y0=s;var r=e.constant(1);function s(f,p){if(f.nodeCount()<=1)return[];var h=c(f,p||r),g=i(h.graph,h.buckets,h.zeroIdx);return e.flatten(e.map(g,function(y){return f.outEdges(y.v,y.w)}),!0)}function i(f,p,h){for(var g=[],y=p[p.length-1],w=p[0],b;f.nodeCount();){for(;b=w.dequeue();)a(f,p,h,b);for(;b=y.dequeue();)a(f,p,h,b);if(f.nodeCount()){for(var v=p.length-2;v>0;--v)if(b=p[v].dequeue(),b){g=g.concat(a(f,p,h,b,!0));break}}}return g}function a(f,p,h,g,y){var w=y?[]:void 0;return e.forEach(f.inEdges(g.v),function(b){var v=f.edge(b),N=f.node(b.v);y&&w.push({v:b.v,w:b.w}),N.out-=v,d(p,h,N)}),e.forEach(f.outEdges(g.v),function(b){var v=f.edge(b),N=b.w,S=f.node(N);S.in-=v,d(p,h,S)}),f.removeNode(g.v),w}function c(f,p){var h=new t,g=0,y=0;e.forEach(f.nodes(),function(v){h.setNode(v,{v,in:0,out:0})}),e.forEach(f.edges(),function(v){var N=h.edge(v.v,v.w)||0,S=p(v),k=N+S;h.setEdge(v.v,v.w,k),y=Math.max(y,h.node(v.v).out+=S),g=Math.max(g,h.node(v.w).in+=S)});var w=e.range(y+g+3).map(function(){return new n}),b=g+1;return e.forEach(h.nodes(),function(v){d(w,b,h.node(v))}),{graph:h,buckets:w,zeroIdx:b}}function d(f,p,h){h.out?h.in?f[h.out-h.in+p].enqueue(h):f[f.length-1].enqueue(h):f[0].enqueue(h)}return y0}var x0,fT;function sZ(){if(fT)return x0;fT=1;var e=it(),t=rZ();x0={run:n,undo:s};function n(i){var a=i.graph().acyclicer==="greedy"?t(i,c(i)):r(i);e.forEach(a,function(d){var f=i.edge(d);i.removeEdge(d),f.forwardName=d.name,f.reversed=!0,i.setEdge(d.w,d.v,f,e.uniqueId("rev"))});function c(d){return function(f){return d.edge(f).weight}}}function r(i){var a=[],c={},d={};function f(p){e.has(d,p)||(d[p]=!0,c[p]=!0,e.forEach(i.outEdges(p),function(h){e.has(c,h.w)?a.push(h):f(h.w)}),delete c[p])}return e.forEach(i.nodes(),f),a}function s(i){e.forEach(i.edges(),function(a){var c=i.edge(a);if(c.reversed){i.removeEdge(a);var d=c.forwardName;delete c.reversed,delete c.forwardName,i.setEdge(a.w,a.v,c,d)}})}return x0}var v0,hT;function tn(){if(hT)return v0;hT=1;var e=it(),t=nr().Graph;v0={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:c,buildLayerMatrix:d,normalizeRanks:f,removeEmptyRanks:p,addBorderNode:h,maxRank:g,partition:y,time:w,notime:b};function n(v,N,S,k){var _;do _=e.uniqueId(k);while(v.hasNode(_));return S.dummy=N,v.setNode(_,S),_}function r(v){var N=new t().setGraph(v.graph());return e.forEach(v.nodes(),function(S){N.setNode(S,v.node(S))}),e.forEach(v.edges(),function(S){var k=N.edge(S.v,S.w)||{weight:0,minlen:1},_=v.edge(S);N.setEdge(S.v,S.w,{weight:k.weight+_.weight,minlen:Math.max(k.minlen,_.minlen)})}),N}function s(v){var N=new t({multigraph:v.isMultigraph()}).setGraph(v.graph());return e.forEach(v.nodes(),function(S){v.children(S).length||N.setNode(S,v.node(S))}),e.forEach(v.edges(),function(S){N.setEdge(S,v.edge(S))}),N}function i(v){var N=e.map(v.nodes(),function(S){var k={};return e.forEach(v.outEdges(S),function(_){k[_.w]=(k[_.w]||0)+v.edge(_).weight}),k});return e.zipObject(v.nodes(),N)}function a(v){var N=e.map(v.nodes(),function(S){var k={};return e.forEach(v.inEdges(S),function(_){k[_.v]=(k[_.v]||0)+v.edge(_).weight}),k});return e.zipObject(v.nodes(),N)}function c(v,N){var S=v.x,k=v.y,_=N.x-S,A=N.y-k,I=v.width/2,T=v.height/2;if(!_&&!A)throw new Error("Not possible to find intersection inside of the rectangle");var O,L;return Math.abs(A)*I>Math.abs(_)*T?(A<0&&(T=-T),O=T*_/A,L=T):(_<0&&(I=-I),O=I,L=I*A/_),{x:S+O,y:k+L}}function d(v){var N=e.map(e.range(g(v)+1),function(){return[]});return e.forEach(v.nodes(),function(S){var k=v.node(S),_=k.rank;e.isUndefined(_)||(N[_][k.order]=S)}),N}function f(v){var N=e.min(e.map(v.nodes(),function(S){return v.node(S).rank}));e.forEach(v.nodes(),function(S){var k=v.node(S);e.has(k,"rank")&&(k.rank-=N)})}function p(v){var N=e.min(e.map(v.nodes(),function(A){return v.node(A).rank})),S=[];e.forEach(v.nodes(),function(A){var I=v.node(A).rank-N;S[I]||(S[I]=[]),S[I].push(A)});var k=0,_=v.graph().nodeRankFactor;e.forEach(S,function(A,I){e.isUndefined(A)&&I%_!==0?--k:k&&e.forEach(A,function(T){v.node(T).rank+=k})})}function h(v,N,S,k){var _={width:0,height:0};return arguments.length>=4&&(_.rank=S,_.order=k),n(v,"border",_,N)}function g(v){return e.max(e.map(v.nodes(),function(N){var S=v.node(N).rank;if(!e.isUndefined(S))return S}))}function y(v,N){var S={lhs:[],rhs:[]};return e.forEach(v,function(k){N(k)?S.lhs.push(k):S.rhs.push(k)}),S}function w(v,N){var S=e.now();try{return N()}finally{console.log(v+" time: "+(e.now()-S)+"ms")}}function b(v,N){return N()}return v0}var b0,pT;function iZ(){if(pT)return b0;pT=1;var e=it(),t=tn();b0={run:n,undo:s};function n(i){i.graph().dummyChains=[],e.forEach(i.edges(),function(a){r(i,a)})}function r(i,a){var c=a.v,d=i.node(c).rank,f=a.w,p=i.node(f).rank,h=a.name,g=i.edge(a),y=g.labelRank;if(p!==d+1){i.removeEdge(a);var w,b,v;for(v=0,++d;d<p;++v,++d)g.points=[],b={width:0,height:0,edgeLabel:g,edgeObj:a,rank:d},w=t.addDummyNode(i,"edge",b,"_d"),d===y&&(b.width=g.width,b.height=g.height,b.dummy="edge-label",b.labelpos=g.labelpos),i.setEdge(c,w,{weight:g.weight},h),v===0&&i.graph().dummyChains.push(w),c=w;i.setEdge(c,f,{weight:g.weight},h)}}function s(i){e.forEach(i.graph().dummyChains,function(a){var c=i.node(a),d=c.edgeLabel,f;for(i.setEdge(c.edgeObj,d);c.dummy;)f=i.successors(a)[0],i.removeNode(a),d.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(d.x=c.x,d.y=c.y,d.width=c.width,d.height=c.height),a=f,c=i.node(a)})}return b0}var w0,mT;function zd(){if(mT)return w0;mT=1;var e=it();w0={longestPath:t,slack:n};function t(r){var s={};function i(a){var c=r.node(a);if(e.has(s,a))return c.rank;s[a]=!0;var d=e.min(e.map(r.outEdges(a),function(f){return i(f.w)-r.edge(f).minlen}));return(d===Number.POSITIVE_INFINITY||d===void 0||d===null)&&(d=0),c.rank=d}e.forEach(r.sources(),i)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return w0}var N0,gT;function D3(){if(gT)return N0;gT=1;var e=it(),t=nr().Graph,n=zd().slack;N0=r;function r(c){var d=new t({directed:!1}),f=c.nodes()[0],p=c.nodeCount();d.setNode(f,{});for(var h,g;s(d,c)<p;)h=i(d,c),g=d.hasNode(h.v)?n(c,h):-n(c,h),a(d,c,g);return d}function s(c,d){function f(p){e.forEach(d.nodeEdges(p),function(h){var g=h.v,y=p===g?h.w:g;!c.hasNode(y)&&!n(d,h)&&(c.setNode(y,{}),c.setEdge(p,y,{}),f(y))})}return e.forEach(c.nodes(),f),c.nodeCount()}function i(c,d){return e.minBy(d.edges(),function(f){if(c.hasNode(f.v)!==c.hasNode(f.w))return n(d,f)})}function a(c,d,f){e.forEach(c.nodes(),function(p){d.node(p).rank+=f})}return N0}var k0,yT;function oZ(){if(yT)return k0;yT=1;var e=it(),t=D3(),n=zd().slack,r=zd().longestPath,s=nr().alg.preorder,i=nr().alg.postorder,a=tn().simplify;k0=c,c.initLowLimValues=h,c.initCutValues=d,c.calcCutValue=p,c.leaveEdge=y,c.enterEdge=w,c.exchangeEdges=b;function c(k){k=a(k),r(k);var _=t(k);h(_),d(_,k);for(var A,I;A=y(_);)I=w(_,k,A),b(_,k,A,I)}function d(k,_){var A=i(k,k.nodes());A=A.slice(0,A.length-1),e.forEach(A,function(I){f(k,_,I)})}function f(k,_,A){var I=k.node(A),T=I.parent;k.edge(A,T).cutvalue=p(k,_,A)}function p(k,_,A){var I=k.node(A),T=I.parent,O=!0,L=_.edge(A,T),B=0;return L||(O=!1,L=_.edge(T,A)),B=L.weight,e.forEach(_.nodeEdges(A),function(M){var P=M.v===A,H=P?M.w:M.v;if(H!==T){var D=P===O,z=_.edge(M).weight;if(B+=D?z:-z,N(k,A,H)){var V=k.edge(A,H).cutvalue;B+=D?-V:V}}}),B}function h(k,_){arguments.length<2&&(_=k.nodes()[0]),g(k,{},1,_)}function g(k,_,A,I,T){var O=A,L=k.node(I);return _[I]=!0,e.forEach(k.neighbors(I),function(B){e.has(_,B)||(A=g(k,_,A,B,I))}),L.low=O,L.lim=A++,T?L.parent=T:delete L.parent,A}function y(k){return e.find(k.edges(),function(_){return k.edge(_).cutvalue<0})}function w(k,_,A){var I=A.v,T=A.w;_.hasEdge(I,T)||(I=A.w,T=A.v);var O=k.node(I),L=k.node(T),B=O,M=!1;O.lim>L.lim&&(B=L,M=!0);var P=e.filter(_.edges(),function(H){return M===S(k,k.node(H.v),B)&&M!==S(k,k.node(H.w),B)});return e.minBy(P,function(H){return n(_,H)})}function b(k,_,A,I){var T=A.v,O=A.w;k.removeEdge(T,O),k.setEdge(I.v,I.w,{}),h(k),d(k,_),v(k,_)}function v(k,_){var A=e.find(k.nodes(),function(T){return!_.node(T).parent}),I=s(k,A);I=I.slice(1),e.forEach(I,function(T){var O=k.node(T).parent,L=_.edge(T,O),B=!1;L||(L=_.edge(O,T),B=!0),_.node(T).rank=_.node(O).rank+(B?L.minlen:-L.minlen)})}function N(k,_,A){return k.hasEdge(_,A)}function S(k,_,A){return A.low<=_.lim&&_.lim<=A.lim}return k0}var S0,xT;function aZ(){if(xT)return S0;xT=1;var e=zd(),t=e.longestPath,n=D3(),r=oZ();S0=s;function s(d){switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":a(d);break;case"longest-path":i(d);break;default:c(d)}}var i=t;function a(d){t(d),n(d)}function c(d){r(d)}return S0}var C0,vT;function lZ(){if(vT)return C0;vT=1;var e=it();C0=t;function t(s){var i=r(s);e.forEach(s.graph().dummyChains,function(a){for(var c=s.node(a),d=c.edgeObj,f=n(s,i,d.v,d.w),p=f.path,h=f.lca,g=0,y=p[g],w=!0;a!==d.w;){if(c=s.node(a),w){for(;(y=p[g])!==h&&s.node(y).maxRank<c.rank;)g++;y===h&&(w=!1)}if(!w){for(;g<p.length-1&&s.node(y=p[g+1]).minRank<=c.rank;)g++;y=p[g]}s.setParent(a,y),a=s.successors(a)[0]}})}function n(s,i,a,c){var d=[],f=[],p=Math.min(i[a].low,i[c].low),h=Math.max(i[a].lim,i[c].lim),g,y;g=a;do g=s.parent(g),d.push(g);while(g&&(i[g].low>p||h>i[g].lim));for(y=g,g=c;(g=s.parent(g))!==y;)f.push(g);return{path:d.concat(f.reverse()),lca:y}}function r(s){var i={},a=0;function c(d){var f=a;e.forEach(s.children(d),c),i[d]={low:f,lim:a++}}return e.forEach(s.children(),c),i}return C0}var _0,bT;function cZ(){if(bT)return _0;bT=1;var e=it(),t=tn();_0={run:n,cleanup:a};function n(c){var d=t.addDummyNode(c,"root",{},"_root"),f=s(c),p=e.max(e.values(f))-1,h=2*p+1;c.graph().nestingRoot=d,e.forEach(c.edges(),function(y){c.edge(y).minlen*=h});var g=i(c)+1;e.forEach(c.children(),function(y){r(c,d,h,g,p,f,y)}),c.graph().nodeRankFactor=h}function r(c,d,f,p,h,g,y){var w=c.children(y);if(!w.length){y!==d&&c.setEdge(d,y,{weight:0,minlen:f});return}var b=t.addBorderNode(c,"_bt"),v=t.addBorderNode(c,"_bb"),N=c.node(y);c.setParent(b,y),N.borderTop=b,c.setParent(v,y),N.borderBottom=v,e.forEach(w,function(S){r(c,d,f,p,h,g,S);var k=c.node(S),_=k.borderTop?k.borderTop:S,A=k.borderBottom?k.borderBottom:S,I=k.borderTop?p:2*p,T=_!==A?1:h-g[y]+1;c.setEdge(b,_,{weight:I,minlen:T,nestingEdge:!0}),c.setEdge(A,v,{weight:I,minlen:T,nestingEdge:!0})}),c.parent(y)||c.setEdge(d,b,{weight:0,minlen:h+g[y]})}function s(c){var d={};function f(p,h){var g=c.children(p);g&&g.length&&e.forEach(g,function(y){f(y,h+1)}),d[p]=h}return e.forEach(c.children(),function(p){f(p,1)}),d}function i(c){return e.reduce(c.edges(),function(d,f){return d+c.edge(f).weight},0)}function a(c){var d=c.graph();c.removeNode(d.nestingRoot),delete d.nestingRoot,e.forEach(c.edges(),function(f){var p=c.edge(f);p.nestingEdge&&c.removeEdge(f)})}return _0}var E0,wT;function uZ(){if(wT)return E0;wT=1;var e=it(),t=tn();E0=n;function n(s){function i(a){var c=s.children(a),d=s.node(a);if(c.length&&e.forEach(c,i),e.has(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(var f=d.minRank,p=d.maxRank+1;f<p;++f)r(s,"borderLeft","_bl",a,d,f),r(s,"borderRight","_br",a,d,f)}}e.forEach(s.children(),i)}function r(s,i,a,c,d,f){var p={width:0,height:0,rank:f,borderType:i},h=d[i][f-1],g=t.addDummyNode(s,"border",p,a);d[i][f]=g,s.setParent(g,c),h&&s.setEdge(h,g,{weight:1})}return E0}var j0,NT;function dZ(){if(NT)return j0;NT=1;var e=it();j0={adjust:t,undo:n};function t(f){var p=f.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&r(f)}function n(f){var p=f.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&i(f),(p==="lr"||p==="rl")&&(c(f),r(f))}function r(f){e.forEach(f.nodes(),function(p){s(f.node(p))}),e.forEach(f.edges(),function(p){s(f.edge(p))})}function s(f){var p=f.width;f.width=f.height,f.height=p}function i(f){e.forEach(f.nodes(),function(p){a(f.node(p))}),e.forEach(f.edges(),function(p){var h=f.edge(p);e.forEach(h.points,a),e.has(h,"y")&&a(h)})}function a(f){f.y=-f.y}function c(f){e.forEach(f.nodes(),function(p){d(f.node(p))}),e.forEach(f.edges(),function(p){var h=f.edge(p);e.forEach(h.points,d),e.has(h,"x")&&d(h)})}function d(f){var p=f.x;f.x=f.y,f.y=p}return j0}var A0,kT;function fZ(){if(kT)return A0;kT=1;var e=it();A0=t;function t(n){var r={},s=e.filter(n.nodes(),function(f){return!n.children(f).length}),i=e.max(e.map(s,function(f){return n.node(f).rank})),a=e.map(e.range(i+1),function(){return[]});function c(f){if(!e.has(r,f)){r[f]=!0;var p=n.node(f);a[p.rank].push(f),e.forEach(n.successors(f),c)}}var d=e.sortBy(s,function(f){return n.node(f).rank});return e.forEach(d,c),a}return A0}var T0,ST;function hZ(){if(ST)return T0;ST=1;var e=it();T0=t;function t(r,s){for(var i=0,a=1;a<s.length;++a)i+=n(r,s[a-1],s[a]);return i}function n(r,s,i){for(var a=e.zipObject(i,e.map(i,function(g,y){return y})),c=e.flatten(e.map(s,function(g){return e.sortBy(e.map(r.outEdges(g),function(y){return{pos:a[y.w],weight:r.edge(y).weight}}),"pos")}),!0),d=1;d<i.length;)d<<=1;var f=2*d-1;d-=1;var p=e.map(new Array(f),function(){return 0}),h=0;return e.forEach(c.forEach(function(g){var y=g.pos+d;p[y]+=g.weight;for(var w=0;y>0;)y%2&&(w+=p[y+1]),y=y-1>>1,p[y]+=g.weight;h+=g.weight*w})),h}return T0}var I0,CT;function pZ(){if(CT)return I0;CT=1;var e=it();I0=t;function t(n,r){return e.map(r,function(s){var i=n.inEdges(s);if(i.length){var a=e.reduce(i,function(c,d){var f=n.edge(d),p=n.node(d.v);return{sum:c.sum+f.weight*p.order,weight:c.weight+f.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return I0}var M0,_T;function mZ(){if(_T)return M0;_T=1;var e=it();M0=t;function t(s,i){var a={};e.forEach(s,function(d,f){var p=a[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:f};e.isUndefined(d.barycenter)||(p.barycenter=d.barycenter,p.weight=d.weight)}),e.forEach(i.edges(),function(d){var f=a[d.v],p=a[d.w];!e.isUndefined(f)&&!e.isUndefined(p)&&(p.indegree++,f.out.push(a[d.w]))});var c=e.filter(a,function(d){return!d.indegree});return n(c)}function n(s){var i=[];function a(f){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(f.barycenter)||p.barycenter>=f.barycenter)&&r(f,p)}}function c(f){return function(p){p.in.push(f),--p.indegree===0&&s.push(p)}}for(;s.length;){var d=s.pop();i.push(d),e.forEach(d.in.reverse(),a(d)),e.forEach(d.out,c(d))}return e.map(e.filter(i,function(f){return!f.merged}),function(f){return e.pick(f,["vs","i","barycenter","weight"])})}function r(s,i){var a=0,c=0;s.weight&&(a+=s.barycenter*s.weight,c+=s.weight),i.weight&&(a+=i.barycenter*i.weight,c+=i.weight),s.vs=i.vs.concat(s.vs),s.barycenter=a/c,s.weight=c,s.i=Math.min(i.i,s.i),i.merged=!0}return M0}var R0,ET;function gZ(){if(ET)return R0;ET=1;var e=it(),t=tn();R0=n;function n(i,a){var c=t.partition(i,function(b){return e.has(b,"barycenter")}),d=c.lhs,f=e.sortBy(c.rhs,function(b){return-b.i}),p=[],h=0,g=0,y=0;d.sort(s(!!a)),y=r(p,f,y),e.forEach(d,function(b){y+=b.vs.length,p.push(b.vs),h+=b.barycenter*b.weight,g+=b.weight,y=r(p,f,y)});var w={vs:e.flatten(p,!0)};return g&&(w.barycenter=h/g,w.weight=g),w}function r(i,a,c){for(var d;a.length&&(d=e.last(a)).i<=c;)a.pop(),i.push(d.vs),c++;return c}function s(i){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:i?c.i-a.i:a.i-c.i}}return R0}var O0,jT;function yZ(){if(jT)return O0;jT=1;var e=it(),t=pZ(),n=mZ(),r=gZ();O0=s;function s(c,d,f,p){var h=c.children(d),g=c.node(d),y=g?g.borderLeft:void 0,w=g?g.borderRight:void 0,b={};y&&(h=e.filter(h,function(A){return A!==y&&A!==w}));var v=t(c,h);e.forEach(v,function(A){if(c.children(A.v).length){var I=s(c,A.v,f,p);b[A.v]=I,e.has(I,"barycenter")&&a(A,I)}});var N=n(v,f);i(N,b);var S=r(N,p);if(y&&(S.vs=e.flatten([y,S.vs,w],!0),c.predecessors(y).length)){var k=c.node(c.predecessors(y)[0]),_=c.node(c.predecessors(w)[0]);e.has(S,"barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+k.order+_.order)/(S.weight+2),S.weight+=2}return S}function i(c,d){e.forEach(c,function(f){f.vs=e.flatten(f.vs.map(function(p){return d[p]?d[p].vs:p}),!0)})}function a(c,d){e.isUndefined(c.barycenter)?(c.barycenter=d.barycenter,c.weight=d.weight):(c.barycenter=(c.barycenter*c.weight+d.barycenter*d.weight)/(c.weight+d.weight),c.weight+=d.weight)}return O0}var P0,AT;function xZ(){if(AT)return P0;AT=1;var e=it(),t=nr().Graph;P0=n;function n(s,i,a){var c=r(s),d=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(f){return s.node(f)});return e.forEach(s.nodes(),function(f){var p=s.node(f),h=s.parent(f);(p.rank===i||p.minRank<=i&&i<=p.maxRank)&&(d.setNode(f),d.setParent(f,h||c),e.forEach(s[a](f),function(g){var y=g.v===f?g.w:g.v,w=d.edge(y,f),b=e.isUndefined(w)?0:w.weight;d.setEdge(y,f,{weight:s.edge(g).weight+b})}),e.has(p,"minRank")&&d.setNode(f,{borderLeft:p.borderLeft[i],borderRight:p.borderRight[i]}))}),d}function r(s){for(var i;s.hasNode(i=e.uniqueId("_root")););return i}return P0}var L0,TT;function vZ(){if(TT)return L0;TT=1;var e=it();L0=t;function t(n,r,s){var i={},a;e.forEach(s,function(c){for(var d=n.parent(c),f,p;d;){if(f=n.parent(d),f?(p=i[f],i[f]=d):(p=a,a=d),p&&p!==d){r.setEdge(p,d);return}d=f}})}return L0}var D0,IT;function bZ(){if(IT)return D0;IT=1;var e=it(),t=fZ(),n=hZ(),r=yZ(),s=xZ(),i=vZ(),a=nr().Graph,c=tn();D0=d;function d(g){var y=c.maxRank(g),w=f(g,e.range(1,y+1),"inEdges"),b=f(g,e.range(y-1,-1,-1),"outEdges"),v=t(g);h(g,v);for(var N=Number.POSITIVE_INFINITY,S,k=0,_=0;_<4;++k,++_){p(k%2?w:b,k%4>=2),v=c.buildLayerMatrix(g);var A=n(g,v);A<N&&(_=0,S=e.cloneDeep(v),N=A)}h(g,S)}function f(g,y,w){return e.map(y,function(b){return s(g,b,w)})}function p(g,y){var w=new a;e.forEach(g,function(b){var v=b.graph().root,N=r(b,v,w,y);e.forEach(N.vs,function(S,k){b.node(S).order=k}),i(b,w,N.vs)})}function h(g,y){e.forEach(y,function(w){e.forEach(w,function(b,v){g.node(b).order=v})})}return D0}var $0,MT;function wZ(){if(MT)return $0;MT=1;var e=it(),t=nr().Graph,n=tn();$0={positionX:w,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:c,verticalAlignment:d,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:h,balance:y};function r(N,S){var k={};function _(A,I){var T=0,O=0,L=A.length,B=e.last(I);return e.forEach(I,function(M,P){var H=i(N,M),D=H?N.node(H).order:L;(H||M===B)&&(e.forEach(I.slice(O,P+1),function(z){e.forEach(N.predecessors(z),function(V){var G=N.node(V),q=G.order;(q<T||D<q)&&!(G.dummy&&N.node(z).dummy)&&a(k,V,z)})}),O=P+1,T=D)}),I}return e.reduce(S,_),k}function s(N,S){var k={};function _(I,T,O,L,B){var M;e.forEach(e.range(T,O),function(P){M=I[P],N.node(M).dummy&&e.forEach(N.predecessors(M),function(H){var D=N.node(H);D.dummy&&(D.order<L||D.order>B)&&a(k,H,M)})})}function A(I,T){var O=-1,L,B=0;return e.forEach(T,function(M,P){if(N.node(M).dummy==="border"){var H=N.predecessors(M);H.length&&(L=N.node(H[0]).order,_(T,B,P,O,L),B=P,O=L)}_(T,B,T.length,L,I.length)}),T}return e.reduce(S,A),k}function i(N,S){if(N.node(S).dummy)return e.find(N.predecessors(S),function(k){return N.node(k).dummy})}function a(N,S,k){if(S>k){var _=S;S=k,k=_}var A=N[S];A||(N[S]=A={}),A[k]=!0}function c(N,S,k){if(S>k){var _=S;S=k,k=_}return e.has(N[S],k)}function d(N,S,k,_){var A={},I={},T={};return e.forEach(S,function(O){e.forEach(O,function(L,B){A[L]=L,I[L]=L,T[L]=B})}),e.forEach(S,function(O){var L=-1;e.forEach(O,function(B){var M=_(B);if(M.length){M=e.sortBy(M,function(V){return T[V]});for(var P=(M.length-1)/2,H=Math.floor(P),D=Math.ceil(P);H<=D;++H){var z=M[H];I[B]===B&&L<T[z]&&!c(k,B,z)&&(I[z]=B,I[B]=A[B]=A[z],L=T[z])}}})}),{root:A,align:I}}function f(N,S,k,_,A){var I={},T=p(N,S,k,A),O=A?"borderLeft":"borderRight";function L(P,H){for(var D=T.nodes(),z=D.pop(),V={};z;)V[z]?P(z):(V[z]=!0,D.push(z),D=D.concat(H(z))),z=D.pop()}function B(P){I[P]=T.inEdges(P).reduce(function(H,D){return Math.max(H,I[D.v]+T.edge(D))},0)}function M(P){var H=T.outEdges(P).reduce(function(z,V){return Math.min(z,I[V.w]-T.edge(V))},Number.POSITIVE_INFINITY),D=N.node(P);H!==Number.POSITIVE_INFINITY&&D.borderType!==O&&(I[P]=Math.max(I[P],H))}return L(B,T.predecessors.bind(T)),L(M,T.successors.bind(T)),e.forEach(_,function(P){I[P]=I[k[P]]}),I}function p(N,S,k,_){var A=new t,I=N.graph(),T=b(I.nodesep,I.edgesep,_);return e.forEach(S,function(O){var L;e.forEach(O,function(B){var M=k[B];if(A.setNode(M),L){var P=k[L],H=A.edge(P,M);A.setEdge(P,M,Math.max(T(N,B,L),H||0))}L=B})}),A}function h(N,S){return e.minBy(e.values(S),function(k){var _=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;return e.forIn(k,function(I,T){var O=v(N,T)/2;_=Math.max(I+O,_),A=Math.min(I-O,A)}),_-A})}function g(N,S){var k=e.values(S),_=e.min(k),A=e.max(k);e.forEach(["u","d"],function(I){e.forEach(["l","r"],function(T){var O=I+T,L=N[O],B;if(L!==S){var M=e.values(L);B=T==="l"?_-e.min(M):A-e.max(M),B&&(N[O]=e.mapValues(L,function(P){return P+B}))}})})}function y(N,S){return e.mapValues(N.ul,function(k,_){if(S)return N[S.toLowerCase()][_];var A=e.sortBy(e.map(N,_));return(A[1]+A[2])/2})}function w(N){var S=n.buildLayerMatrix(N),k=e.merge(r(N,S),s(N,S)),_={},A;e.forEach(["u","d"],function(T){A=T==="u"?S:e.values(S).reverse(),e.forEach(["l","r"],function(O){O==="r"&&(A=e.map(A,function(P){return e.values(P).reverse()}));var L=(T==="u"?N.predecessors:N.successors).bind(N),B=d(N,A,k,L),M=f(N,A,B.root,B.align,O==="r");O==="r"&&(M=e.mapValues(M,function(P){return-P})),_[T+O]=M})});var I=h(N,_);return g(_,I),y(_,N.graph().align)}function b(N,S,k){return function(_,A,I){var T=_.node(A),O=_.node(I),L=0,B;if(L+=T.width/2,e.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":B=-T.width/2;break;case"r":B=T.width/2;break}if(B&&(L+=k?B:-B),B=0,L+=(T.dummy?S:N)/2,L+=(O.dummy?S:N)/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 v(N,S){return N.node(S).width}return $0}var F0,RT;function NZ(){if(RT)return F0;RT=1;var e=it(),t=tn(),n=wZ().positionX;F0=r;function r(i){i=t.asNonCompoundGraph(i),s(i),e.forEach(n(i),function(a,c){i.node(c).x=a})}function s(i){var a=t.buildLayerMatrix(i),c=i.graph().ranksep,d=0;e.forEach(a,function(f){var p=e.max(e.map(f,function(h){return i.node(h).height}));e.forEach(f,function(h){i.node(h).y=d+p/2}),d+=p+c})}return F0}var q0,OT;function kZ(){if(OT)return q0;OT=1;var e=it(),t=sZ(),n=iZ(),r=aZ(),s=tn().normalizeRanks,i=lZ(),a=tn().removeEmptyRanks,c=cZ(),d=uZ(),f=dZ(),p=bZ(),h=NZ(),g=tn(),y=nr().Graph;q0=w;function w(U,Q){var Z=Q&&Q.debugTiming?g.time:g.notime;Z("layout",function(){var ee=Z(" buildLayoutGraph",function(){return L(U)});Z(" runLayout",function(){b(ee,Z)}),Z(" updateInputGraph",function(){v(U,ee)})})}function b(U,Q){Q(" makeSpaceForEdgeLabels",function(){B(U)}),Q(" removeSelfEdges",function(){F(U)}),Q(" acyclic",function(){t.run(U)}),Q(" nestingGraph.run",function(){c.run(U)}),Q(" rank",function(){r(g.asNonCompoundGraph(U))}),Q(" injectEdgeLabelProxies",function(){M(U)}),Q(" removeEmptyRanks",function(){a(U)}),Q(" nestingGraph.cleanup",function(){c.cleanup(U)}),Q(" normalizeRanks",function(){s(U)}),Q(" assignRankMinMax",function(){P(U)}),Q(" removeEdgeLabelProxies",function(){H(U)}),Q(" normalize.run",function(){n.run(U)}),Q(" parentDummyChains",function(){i(U)}),Q(" addBorderSegments",function(){d(U)}),Q(" order",function(){p(U)}),Q(" insertSelfEdges",function(){Y(U)}),Q(" adjustCoordinateSystem",function(){f.adjust(U)}),Q(" position",function(){h(U)}),Q(" positionSelfEdges",function(){$(U)}),Q(" removeBorderNodes",function(){q(U)}),Q(" normalize.undo",function(){n.undo(U)}),Q(" fixupEdgeLabelCoords",function(){V(U)}),Q(" undoCoordinateSystem",function(){f.undo(U)}),Q(" translateGraph",function(){D(U)}),Q(" assignNodeIntersects",function(){z(U)}),Q(" reversePoints",function(){G(U)}),Q(" acyclic.undo",function(){t.undo(U)})}function v(U,Q){e.forEach(U.nodes(),function(Z){var ee=U.node(Z),se=Q.node(Z);ee&&(ee.x=se.x,ee.y=se.y,Q.children(Z).length&&(ee.width=se.width,ee.height=se.height))}),e.forEach(U.edges(),function(Z){var ee=U.edge(Z),se=Q.edge(Z);ee.points=se.points,e.has(se,"x")&&(ee.x=se.x,ee.y=se.y)}),U.graph().width=Q.graph().width,U.graph().height=Q.graph().height}var N=["nodesep","edgesep","ranksep","marginx","marginy"],S={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},k=["acyclicer","ranker","rankdir","align"],_=["width","height"],A={width:0,height:0},I=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function L(U){var Q=new y({multigraph:!0,compound:!0}),Z=ie(U.graph());return Q.setGraph(e.merge({},S,K(Z,N),e.pick(Z,k))),e.forEach(U.nodes(),function(ee){var se=ie(U.node(ee));Q.setNode(ee,e.defaults(K(se,_),A)),Q.setParent(ee,U.parent(ee))}),e.forEach(U.edges(),function(ee){var se=ie(U.edge(ee));Q.setEdge(ee,e.merge({},T,K(se,I),e.pick(se,O)))}),Q}function B(U){var Q=U.graph();Q.ranksep/=2,e.forEach(U.edges(),function(Z){var ee=U.edge(Z);ee.minlen*=2,ee.labelpos.toLowerCase()!=="c"&&(Q.rankdir==="TB"||Q.rankdir==="BT"?ee.width+=ee.labeloffset:ee.height+=ee.labeloffset)})}function M(U){e.forEach(U.edges(),function(Q){var Z=U.edge(Q);if(Z.width&&Z.height){var ee=U.node(Q.v),se=U.node(Q.w),ae={rank:(se.rank-ee.rank)/2+ee.rank,e:Q};g.addDummyNode(U,"edge-proxy",ae,"_ep")}})}function P(U){var Q=0;e.forEach(U.nodes(),function(Z){var ee=U.node(Z);ee.borderTop&&(ee.minRank=U.node(ee.borderTop).rank,ee.maxRank=U.node(ee.borderBottom).rank,Q=e.max(Q,ee.maxRank))}),U.graph().maxRank=Q}function H(U){e.forEach(U.nodes(),function(Q){var Z=U.node(Q);Z.dummy==="edge-proxy"&&(U.edge(Z.e).labelRank=Z.rank,U.removeNode(Q))})}function D(U){var Q=Number.POSITIVE_INFINITY,Z=0,ee=Number.POSITIVE_INFINITY,se=0,ae=U.graph(),ne=ae.marginx||0,le=ae.marginy||0;function he(pe){var ve=pe.x,xe=pe.y,Ae=pe.width,Se=pe.height;Q=Math.min(Q,ve-Ae/2),Z=Math.max(Z,ve+Ae/2),ee=Math.min(ee,xe-Se/2),se=Math.max(se,xe+Se/2)}e.forEach(U.nodes(),function(pe){he(U.node(pe))}),e.forEach(U.edges(),function(pe){var ve=U.edge(pe);e.has(ve,"x")&&he(ve)}),Q-=ne,ee-=le,e.forEach(U.nodes(),function(pe){var ve=U.node(pe);ve.x-=Q,ve.y-=ee}),e.forEach(U.edges(),function(pe){var ve=U.edge(pe);e.forEach(ve.points,function(xe){xe.x-=Q,xe.y-=ee}),e.has(ve,"x")&&(ve.x-=Q),e.has(ve,"y")&&(ve.y-=ee)}),ae.width=Z-Q+ne,ae.height=se-ee+le}function z(U){e.forEach(U.edges(),function(Q){var Z=U.edge(Q),ee=U.node(Q.v),se=U.node(Q.w),ae,ne;Z.points?(ae=Z.points[0],ne=Z.points[Z.points.length-1]):(Z.points=[],ae=se,ne=ee),Z.points.unshift(g.intersectRect(ee,ae)),Z.points.push(g.intersectRect(se,ne))})}function V(U){e.forEach(U.edges(),function(Q){var Z=U.edge(Q);if(e.has(Z,"x"))switch((Z.labelpos==="l"||Z.labelpos==="r")&&(Z.width-=Z.labeloffset),Z.labelpos){case"l":Z.x-=Z.width/2+Z.labeloffset;break;case"r":Z.x+=Z.width/2+Z.labeloffset;break}})}function G(U){e.forEach(U.edges(),function(Q){var Z=U.edge(Q);Z.reversed&&Z.points.reverse()})}function q(U){e.forEach(U.nodes(),function(Q){if(U.children(Q).length){var Z=U.node(Q),ee=U.node(Z.borderTop),se=U.node(Z.borderBottom),ae=U.node(e.last(Z.borderLeft)),ne=U.node(e.last(Z.borderRight));Z.width=Math.abs(ne.x-ae.x),Z.height=Math.abs(se.y-ee.y),Z.x=ae.x+Z.width/2,Z.y=ee.y+Z.height/2}}),e.forEach(U.nodes(),function(Q){U.node(Q).dummy==="border"&&U.removeNode(Q)})}function F(U){e.forEach(U.edges(),function(Q){if(Q.v===Q.w){var Z=U.node(Q.v);Z.selfEdges||(Z.selfEdges=[]),Z.selfEdges.push({e:Q,label:U.edge(Q)}),U.removeEdge(Q)}})}function Y(U){var Q=g.buildLayerMatrix(U);e.forEach(Q,function(Z){var ee=0;e.forEach(Z,function(se,ae){var ne=U.node(se);ne.order=ae+ee,e.forEach(ne.selfEdges,function(le){g.addDummyNode(U,"selfedge",{width:le.label.width,height:le.label.height,rank:ne.rank,order:ae+ ++ee,e:le.e,label:le.label},"_se")}),delete ne.selfEdges})})}function $(U){e.forEach(U.nodes(),function(Q){var Z=U.node(Q);if(Z.dummy==="selfedge"){var ee=U.node(Z.e.v),se=ee.x+ee.width/2,ae=ee.y,ne=Z.x-se,le=ee.height/2;U.setEdge(Z.e,Z.label),U.removeNode(Q),Z.label.points=[{x:se+2*ne/3,y:ae-le},{x:se+5*ne/6,y:ae-le},{x:se+ne,y:ae},{x:se+5*ne/6,y:ae+le},{x:se+2*ne/3,y:ae+le}],Z.label.x=Z.x,Z.label.y=Z.y}})}function K(U,Q){return e.mapValues(e.pick(U,Q),Number)}function ie(U){var Q={};return e.forEach(U,function(Z,ee){Q[ee.toLowerCase()]=Z}),Q}return q0}var B0,PT;function SZ(){if(PT)return B0;PT=1;var e=it(),t=tn(),n=nr().Graph;B0={debugOrdering:r};function r(s){var i=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(i,function(c,d){var f="layer"+d;a.setNode(f,{rank:"same"}),e.reduce(c,function(p,h){return a.setEdge(p,h,{style:"invis"}),h})}),a}return B0}var z0,LT;function CZ(){return LT||(LT=1,z0="0.8.5"),z0}var V0,DT;function _Z(){return DT||(DT=1,V0={graphlib:nr(),layout:kZ(),debug:SZ(),util:{time:tn().time,notime:tn().notime},version:CZ()}),V0}var EZ=_Z();const $T=Ul(EZ),FT={step:{width:240,height:110},trigger:{width:220,height:90},"control-flow":{width:260,height:130},switch:{width:280,height:140},parallel:{width:280,height:140},output:{width:200,height:80}},qT={width:240,height:110};function $3(e,t,n){if(e.length===0)return e;const r=new $T.graphlib.Graph;r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:"TB",nodesep:80,ranksep:100});for(const s of e){const i=FT[s.type??""]??qT;r.setNode(s.id,{width:i.width,height:i.height})}for(const s of t)r.setEdge(s.source,s.target);return $T.layout(r),e.map(s=>{const i=r.node(s.id),a=FT[s.type??""]??qT;return{...s,position:{x:i.x-a.width/2,y:i.y-a.height/2}}})}function F3(){const{nodes:e,edges:t,setNodes:n,setEdges:r,updateNodeData:s,clearCanvas:i}=_r(),a=Zo(),c=E.useMemo(()=>e.filter(M=>M.selected),[e]),d=E.useMemo(()=>t.filter(M=>M.selected),[t]),f=E.useCallback(M=>e.find(P=>P.id===M),[e]),p=E.useCallback(M=>t.find(P=>P.id===M),[t]),h=E.useCallback(M=>{n([...e,M])},[e,n]),g=E.useCallback(M=>{n(e.filter(P=>P.id!==M)),r(t.filter(P=>P.source!==M&&P.target!==M))},[e,t,n,r]),y=E.useCallback(()=>{const M=[],P=new Map;for(const D of c){const z=`${D.id}-copy-${Date.now()}`;P.set(D.id,z),M.push({...D,id:z,position:{x:D.position.x+50,y:D.position.y+50},selected:!1,data:{...D.data,id:z}})}n([...e,...M]);const H=[];for(const D of t)P.has(D.source)&&P.has(D.target)&&H.push({...D,id:`${D.id}-copy-${Date.now()}`,source:P.get(D.source),target:P.get(D.target)});H.length>0&&r([...t,...H])},[c,e,t,n,r]),w=E.useCallback(()=>{const M=new Set(c.map(H=>H.id)),P=new Set(d.map(H=>H.id));n(e.filter(H=>!M.has(H.id))),r(t.filter(H=>!P.has(H.id)&&!M.has(H.source)&&!M.has(H.target)))},[c,d,e,t,n,r]),b=E.useCallback(()=>{n($3(e,t)),setTimeout(()=>{a.fitView({padding:.2})},50)},[e,t,n,a]),v=E.useCallback(()=>{a.fitView({padding:.2})},[a]),N=E.useCallback(M=>{const P=f(M);P&&a.setCenter(P.position.x+100,P.position.y+50,{zoom:1.5,duration:300})},[f,a]),S=E.useCallback((M,P=!1)=>{n(e.map(H=>({...H,selected:P&&H.selected||H.id===M})))},[e,n]),k=E.useCallback(()=>{n(e.map(M=>({...M,selected:!1}))),r(t.map(M=>({...M,selected:!1})))},[e,t,n,r]),{undo:_,redo:A,canUndo:I,canRedo:T,copySelected:O,paste:L,canPaste:B}=_r();return{nodes:e,edges:t,selectedNodes:c,selectedEdges:d,getNode:f,getEdge:p,addNode:h,removeNode:g,updateNodeData:s,setNodes:n,setEdges:r,clearCanvas:i,selectNode:S,clearSelection:k,duplicateSelected:y,deleteSelected:w,autoLayout:b,fitView:v,zoomToNode:N,undo:_,redo:A,canUndo:I,canRedo:T,copySelected:O,paste:L,canPaste:B}}const jZ={step:SH,subworkflow:_H,trigger:jH,output:TH,if:MH,for_each:OH,while:LH,switch:$H,parallel:qH,try:zH,map:cm,filter:cm,reduce:cm,sticky:WH,group:YH};function AZ(){const{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,setNodes:i}=_r(),{autoLayout:a,deleteSelected:c,duplicateSelected:d}=F3(),f=en(ne=>ne.currentWorkflow),{screenToFlowPosition:p}=Zo(),h=tc(),[g,y]=E.useState(null),[w,b]=E.useState(!1),[v,N]=E.useState(null),[S,k]=E.useState(!1),[_,A]=E.useState(null),I=E.useRef(null),T=E.useCallback((ne,le)=>{if(ne.preventDefault(),le.type==="trigger"||le.type==="output")return;const he=f==null?void 0:f.steps.find(pe=>pe.id===le.data.id);he&&(y(he),b(!0))},[f]),O=E.useCallback(()=>{if(!f)return null;const ne=["step","if","for_each","while","switch","parallel","try","map","filter","reduce"],le=e.find(he=>he.selected&&ne.includes(he.type||""));return le&&f.steps.find(he=>he.id===le.data.id)||null},[f,e]),{undo:L,redo:B,canUndo:M,canRedo:P,copySelected:H,paste:D,canPaste:z}=_r(),V=E.useCallback(ne=>{const le=ne.metaKey||ne.ctrlKey;if((ne.key==="Backspace"||ne.key==="Delete")&&c(),le&&ne.key==="d"&&(ne.preventDefault(),d()),le&&ne.key==="l"&&(ne.preventDefault(),a()),le&&ne.key==="z"&&!ne.shiftKey&&(ne.preventDefault(),M()&&L()),(le&&ne.shiftKey&&ne.key==="z"||le&&ne.key==="y")&&(ne.preventDefault(),P()&&B()),le&&ne.key==="c"&&(ne.preventDefault(),H()),le&&ne.key==="v"&&(ne.preventDefault(),z()&&D()),ne.key==="e"&&!le&&!ne.shiftKey&&!ne.altKey){ne.preventDefault();const he=O();he&&(y(he),b(!0))}if(ne.key==="y"&&!le&&!ne.shiftKey&&!ne.altKey){ne.preventDefault();const he=O();he&&(N(he),k(!0))}},[c,d,a,O,L,B,M,P,H,D,z]),G=en(ne=>ne.saveWorkflow),{updateNodeData:q}=_r(),F=E.useCallback(ne=>{if(f){const le=f.steps.map(pe=>pe.id===ne.id?ne:pe),he={...f,steps:le};G(he),q(ne.id,{name:ne.name,action:ne.action,inputs:ne.inputs,outputVariable:ne.outputVariable})}b(!1),y(null)},[f,G,q]),Y=E.useCallback(()=>{if(!_||!f)return;const ne=f.steps.find(le=>le.id===_.data.id);ne&&(y(ne),b(!0)),A(null)},[_,f]),$=E.useCallback(()=>{if(!_||!f)return;const ne=f.steps.find(le=>le.id===_.data.id);ne&&(N(ne),k(!0)),A(null)},[_,f]),K=E.useCallback(()=>{_&&d(),A(null)},[_,d]),ie=E.useCallback(()=>{_&&c(),A(null)},[_,c]),U=en(ne=>ne.selectedWorkflow),Q=E.useCallback(async()=>{if(_&&U){const ne=_.data.id;try{q(ne,{status:"running"});const le=await fetch(`/api/execute/${encodeURIComponent(U)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inputs:{},stepId:ne})});if(!le.ok)throw new Error("Execution failed");const he=await le.json();q(ne,{status:he.status==="started"?"running":"completed"})}catch(le){console.error("Step execution failed:",le),q(ne,{status:"failed"})}}A(null)},[_,U,q]),Z=E.useCallback((ne,le)=>{ne.preventDefault(),["step","if","for_each","while","switch","parallel","try","map","filter","reduce","subworkflow"].includes(le.type||"")&&A(le)},[]),ee=E.useCallback(ne=>{ne.preventDefault(),ne.dataTransfer.dropEffect="copy"},[]),se=E.useCallback(ne=>{var he,pe;ne.preventDefault();const le=ne.dataTransfer.getData("application/marktoflow-tool");if(le)try{const ve=JSON.parse(le),xe=p({x:ne.clientX,y:ne.clientY}),Ae=ve.id+"-"+Date.now().toString(36),Se={id:Ae,type:"step",position:xe,data:{id:Ae,name:ve.name+" Action",action:ve.id+"."+(((he=ve.actions)==null?void 0:he[0])||"action"),status:"pending"}};if(i([...e,Se]),f){const Ge={id:Ae,name:ve.name+" Action",action:ve.id+"."+(((pe=ve.actions)==null?void 0:pe[0])||"action"),inputs:{}},Ve={...f,steps:[...f.steps,Ge]};G(Ve)}}catch(ve){console.error("Failed to parse dropped tool data:",ve)}},[e,i,p,f,G]),ae=E.useCallback(()=>{if(!f||!g)return[];const ne=[];if(f.inputs)for(const he of Object.keys(f.inputs))ne.push(`inputs.${he}`);const le=f.steps.findIndex(he=>he.id===g.id);for(let he=0;he<le;he++){const pe=f.steps[he];pe.outputVariable&&ne.push(pe.outputVariable)}return ne},[f,g]);return u.jsxs(iX,{children:[u.jsx(oX,{asChild:!0,children:u.jsx("div",{ref:I,className:"w-full h-full",onKeyDown:V,onDragOver:ee,onDrop:se,tabIndex:0,children:u.jsxs(L8,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,onNodeDoubleClick:T,onNodeContextMenu:Z,nodeTypes:jZ,fitView:!0,snapToGrid:!0,snapGrid:[16,16],defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},proOptions:{hideAttribution:!0},children:[u.jsx(B8,{variant:Jr.Dots,gap:24,size:1,color:"#3d3d5c"}),u.jsx(G8,{}),u.jsx(az,{nodeColor:ne=>{var le;switch((le=ne.data)==null?void 0:le.status){case"running":return"#f0ad4e";case"completed":return"#5cb85c";case"failed":return"#d9534f";default:return"#2d2d4a"}},maskColor:"rgba(26, 26, 46, 0.8)"})]})})}),u.jsxs($4,{children:[u.jsxs(_o,{onClick:Y,children:[u.jsx(i9,{className:"w-4 h-4 mr-2"}),"Edit Step",u.jsx(fl,{children:"E"})]}),u.jsxs(_o,{onClick:$,children:[u.jsx(uw,{className:"w-4 h-4 mr-2"}),"View YAML",u.jsx(fl,{children:"Y"})]}),u.jsx(Tb,{}),u.jsxs(_o,{onClick:Q,children:[u.jsx(Pi,{className:"w-4 h-4 mr-2"}),"Execute Step"]}),u.jsx(Tb,{}),u.jsxs(_o,{onClick:K,children:[u.jsx(ji,{className:"w-4 h-4 mr-2"}),"Duplicate",u.jsxs(fl,{children:[h,"D"]})]}),u.jsxs(_o,{onClick:ie,destructive:!0,children:[u.jsx(ea,{className:"w-4 h-4 mr-2"}),"Delete",u.jsx(fl,{children:"⌫"})]})]}),u.jsx(UG,{open:w,onOpenChange:b,step:g,onSave:F,availableVariables:ae()}),u.jsx(rs,{open:S,onOpenChange:k,title:`YAML: ${(v==null?void 0:v.name)||(v==null?void 0:v.id)}`,size:"lg",children:u.jsx("div",{className:"p-4",children:u.jsx(qG,{value:v})})})]})}const q3=xn((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:[]})})),B3=xn((e,t)=>({providers:[],activeProviderId:null,isLoading:!1,error:null,loadProviders:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/ai/providers");if(!n.ok)throw new Error("Failed to load providers");const r=await n.json();e({providers:r.providers,activeProviderId:r.activeProvider,isLoading:!1})}catch(n){console.error("Error loading providers:",n),e({error:n instanceof Error?n.message:"Unknown error",isLoading:!1})}},setProvider:async(n,r)=>{e({isLoading:!0,error:null});try{const s=await fetch(`/api/ai/providers/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r||{})});if(!s.ok){const a=await s.json();throw new Error(a.message||"Failed to set provider")}const i=await s.json();return i.success&&i.status?(e({providers:i.status.providers,activeProviderId:i.status.activeProvider,isLoading:!1}),!0):!1}catch(s){return console.error("Error setting provider:",s),e({error:s instanceof Error?s.message:"Unknown error",isLoading:!1}),!1}},refreshStatus:async()=>{await t().loadProviders()}}));function TZ({open:e,onOpenChange:t}){var L,B;const{providers:n,activeProviderId:r,isLoading:s,error:i,loadProviders:a,setProvider:c}=B3(),[d,f]=E.useState(null),[p,h]=E.useState(!1),[g,y]=E.useState({apiKey:"",baseUrl:"",model:""}),[w,b]=E.useState(""),[v,N]=E.useState(null);E.useEffect(()=>{e&&a()},[e,a]);const S=async M=>{const P=n.find(H=>H.id===M);P&&(P.authType==="sdk"||P.status==="needs_config"?(f(M),h(!0)):P.status==="ready"&&await c(M)&&t(!1))},k=M=>{f(M),h(!0)},_=async M=>{if(!w.trim()){N(null);return}await c(M,{model:w.trim()}),N(null),b("")},A=async()=>{if(!d)return;await c(d,g)&&(h(!1),y({apiKey:"",baseUrl:"",model:""}),t(!1))},I=async()=>{if(!d)return;const M=n.find(z=>z.id===d);if(!M||!(M.status==="ready"||M.status==="available"||M.authType==="sdk"&&M.status==="needs_config"))return;const H=g.model?{model:g.model}:void 0;await c(d,H)&&(h(!1),y({apiKey:"",baseUrl:"",model:""}),t(!1))},T=M=>{switch(M){case"ready":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"});case"available":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"});case"needs_config":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500"});case"unavailable":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500"});default:return u.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-500"})}},O=M=>{switch(M){case"ready":return"Ready";case"available":return"Available";case"needs_config":return"Needs Configuration";case"unavailable":return"Unavailable";default:return"Unknown"}};if(p){const M=n.find(H=>H.id===d);if(!M)return null;const P=M.authType==="sdk";return u.jsxs(rs,{open:p,onOpenChange:h,title:`Configure ${M.name}`,description:P?"SDK-based provider":"Enter configuration details for this provider",size:"md",children:[u.jsx("div",{className:"p-4 space-y-4",children:P?u.jsx(IZ,{provider:M,configData:g,setConfigData:y}):u.jsxs(u.Fragment,{children:[((L=M.configOptions)==null?void 0:L.apiKey)&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"API Key"}),u.jsx("input",{type:"password",value:g.apiKey,onChange:H=>y({...g,apiKey:H.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter API key"})]}),((B=M.configOptions)==null?void 0:B.baseUrl)&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Base URL"}),u.jsx("input",{type:"text",value:g.baseUrl,onChange:H=>y({...g,baseUrl:H.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter base URL"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Model"}),u.jsx("input",{type:"text",value:g.model,onChange:H=>y({...g,model:H.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter model name (e.g., gpt-4o, claude-sonnet-4-20250514)"})]})]})}),u.jsxs(Mi,{children:[u.jsx(De,{variant:"secondary",onClick:()=>h(!1),children:"Cancel"}),P?u.jsx(De,{variant:"primary",onClick:I,disabled:s||M.status!=="ready"&&M.status!=="available"&&M.authType!=="sdk",children:s?u.jsx(Cr,{className:"w-4 h-4 animate-spin"}):M.status==="ready"?"Activate":(M.status==="available","Connect & Activate")}):u.jsx(De,{variant:"primary",onClick:A,disabled:s,children:s?u.jsx(Cr,{className:"w-4 h-4 animate-spin"}):"Save & Activate"})]})]})}return u.jsxs(rs,{open:e,onOpenChange:t,title:"AI Provider",description:"Select which AI provider to use for agent prompts",size:"md",children:[u.jsxs("div",{className:"p-4 space-y-2",children:[i&&u.jsxs("div",{className:"flex items-center gap-2 p-3 bg-error/10 border border-error/30 rounded text-error text-sm",children:[u.jsx(Oi,{className:"w-4 h-4 flex-shrink-0"}),u.jsx("span",{children:i})]}),s&&n.length===0?u.jsx("div",{className:"flex items-center justify-center py-8",children:u.jsx(Cr,{className:"w-6 h-6 animate-spin text-gray-500"})}):u.jsx("div",{className:"space-y-2",children:n.map(M=>{var H;const P=M.status==="unavailable";return u.jsxs("button",{onClick:()=>S(M.id),disabled:P,className:`
823
+ w-full flex items-center justify-between p-3 rounded border transition-all
824
+ ${M.isActive?"bg-primary/10 border-primary text-white":"bg-node-bg border-node-border text-gray-300 hover:bg-white/5"}
825
+ ${P?"opacity-50 cursor-not-allowed":"cursor-pointer"}
826
+ `,children:[u.jsxs("div",{className:"flex items-center gap-3",children:[T(M.status),u.jsxs("div",{className:"text-left",children:[u.jsx("div",{className:"font-medium",children:M.name}),M.description&&u.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:M.description})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[M.isActive&&u.jsx(Vs,{className:"w-4 h-4 text-primary"}),M.status==="needs_config"&&!((H=M.authType)!=null&&H.startsWith("sdk"))&&u.jsx(Ko,{className:"w-4 h-4 text-yellow-500"}),M.authType==="sdk"&&M.status==="needs_config"&&u.jsx(rR,{className:"w-4 h-4 text-yellow-500"}),M.status==="ready"&&u.jsx("button",{onClick:D=>{D.stopPropagation(),k(M.id)},className:"p-1 rounded hover:bg-white/10 transition-colors",title:"Configure provider",children:u.jsx(Ko,{className:"w-3.5 h-3.5 text-gray-500 hover:text-gray-300"})}),u.jsx("span",{className:"text-xs text-gray-500",children:O(M.status)})]})]},M.id)})})]}),r&&n.find(M=>M.id===r&&M.status==="ready")&&u.jsx("div",{className:"px-4 pb-4",children:u.jsxs("div",{className:"p-3 bg-bg-surface border border-border-default rounded-lg",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("label",{className:"text-xs font-medium text-text-secondary",children:"Custom Model Name"}),v!==r&&u.jsx("button",{onClick:()=>{N(r),b("")},className:"p-1 rounded hover:bg-bg-hover transition-colors",title:"Edit model name",children:u.jsx(Jz,{className:"w-3 h-3 text-text-muted"})})]}),v===r?u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{type:"text",value:w,onChange:M=>b(M.target.value),onKeyDown:M=>{M.key==="Enter"&&_(r),M.key==="Escape"&&N(null)},className:"flex-1 px-2 py-1.5 bg-bg-canvas border border-border-default rounded text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent",placeholder:"e.g., gpt-4o, claude-sonnet-4-20250514",autoFocus:!0}),u.jsx(De,{variant:"primary",size:"sm",onClick:()=>_(r),children:"Save"}),u.jsx(De,{variant:"secondary",size:"sm",onClick:()=>N(null),children:"Cancel"})]}):u.jsx("p",{className:"text-xs text-text-muted",children:"Click the edit icon to set a custom model name for the active provider."})]})}),u.jsx(Mi,{children:u.jsx(De,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function IZ({provider:e,configData:t,setConfigData:n}){const r=e.status==="ready",s=e.status==="available";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:`flex items-center gap-2 p-3 rounded border ${r?"bg-green-500/10 border-green-500/30":s?"bg-blue-500/10 border-blue-500/30":"bg-yellow-500/10 border-yellow-500/30"}`,children:[u.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500":s?"bg-blue-500":"bg-yellow-500"}`}),u.jsx("span",{className:`text-sm ${r?"text-green-400":s?"text-blue-400":"text-yellow-400"}`,children:r?"Connected and ready":s?"Available - Click Connect below":"Not connected"})]}),e.authInstructions&&u.jsxs("div",{className:"flex items-start gap-2 p-3 bg-white/5 rounded border border-white/10",children:[u.jsx(rR,{className:"w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0"}),u.jsx("p",{className:"text-sm text-gray-300",children:e.authInstructions})]}),e.availableModels&&e.availableModels.length>0&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Model"}),u.jsxs("select",{value:t.model,onChange:i=>n({apiKey:"",baseUrl:"",model:i.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",children:[u.jsx("option",{value:"",children:"Default"}),e.availableModels.map(i=>u.jsx("option",{value:i,children:i},i))]})]})]})}function MZ({className:e}){const{nodes:t,setNodes:n,saveCheckpoint:r}=_r(),s=t.filter(d=>d.selected),i=s.length>=2,a=E.useCallback(d=>{if(s.length<2)return;r();const f=new Set(s.map(g=>g.id)),p=RZ(s),h=t.map(g=>{var v,N;if(!f.has(g.id))return g;let y={...g.position};const w=((v=g.measured)==null?void 0:v.width)||g.width||200,b=((N=g.measured)==null?void 0:N.height)||g.height||80;switch(d){case"left":y.x=p.minX;break;case"center-h":y.x=p.minX+(p.maxX-p.minX)/2-w/2;break;case"right":y.x=p.maxX-w;break;case"top":y.y=p.minY;break;case"center-v":y.y=p.minY+(p.maxY-p.minY)/2-b/2;break;case"bottom":y.y=p.maxY-b;break}return{...g,position:y}});n(h)},[t,s,n,r]),c=E.useCallback(d=>{if(s.length<3)return;r();const f=new Set(s.map(N=>N.id)),p=[...s].sort((N,S)=>d==="horizontal"?N.position.x-S.position.x:N.position.y-S.position.y),h=p[0],g=p[p.length-1],w=(d==="horizontal"?g.position.x-h.position.x:g.position.y-h.position.y)/(p.length-1),b=new Map;p.forEach((N,S)=>{const k={...N.position};d==="horizontal"?k.x=h.position.x+w*S:k.y=h.position.y+w*S,b.set(N.id,k)});const v=t.map(N=>{if(!f.has(N.id))return N;const S=b.get(N.id);return S?{...N,position:S}:N});n(v)},[t,s,n,r]);return u.jsxs("div",{className:Ue("flex items-center gap-0.5",e),children:[u.jsx(Rs,{icon:u.jsx(vz,{className:"w-4 h-4"}),label:"Align Left",onClick:()=>a("left"),disabled:!i}),u.jsx(Rs,{icon:u.jsx(mz,{className:"w-4 h-4"}),label:"Align Center Horizontally",onClick:()=>a("center-h"),disabled:!i}),u.jsx(Rs,{icon:u.jsx(yz,{className:"w-4 h-4"}),label:"Align Right",onClick:()=>a("right"),disabled:!i}),u.jsx("div",{className:"w-px h-5 bg-border-default mx-0.5"}),u.jsx(Rs,{icon:u.jsx(xz,{className:"w-4 h-4"}),label:"Align Top",onClick:()=>a("top"),disabled:!i}),u.jsx(Rs,{icon:u.jsx(pz,{className:"w-4 h-4"}),label:"Align Center Vertically",onClick:()=>a("center-v"),disabled:!i}),u.jsx(Rs,{icon:u.jsx(gz,{className:"w-4 h-4"}),label:"Align Bottom",onClick:()=>a("bottom"),disabled:!i}),u.jsx("div",{className:"w-px h-5 bg-border-default mx-0.5"}),u.jsx(Rs,{icon:u.jsx($z,{className:"w-4 h-4"}),label:"Distribute Horizontally",onClick:()=>c("horizontal"),disabled:s.length<3}),u.jsx(Rs,{icon:u.jsx(nR,{className:"w-4 h-4"}),label:"Distribute Vertically",onClick:()=>c("vertical"),disabled:s.length<3})]})}function Rs({icon:e,label:t,onClick:n,disabled:r}){return u.jsx("button",{onClick:n,disabled:r,className:"p-1.5 rounded text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:t,children:e})}function RZ(e){var i,a;let t=1/0,n=1/0,r=-1/0,s=-1/0;for(const c of e){const d=((i=c.measured)==null?void 0:i.width)||c.width||200,f=((a=c.measured)==null?void 0:a.height)||c.height||80;t=Math.min(t,c.position.x),n=Math.min(n,c.position.y),r=Math.max(r,c.position.x+d),s=Math.max(s,c.position.y+f)}return{minX:t,minY:n,maxX:r,maxY:s}}const OZ=E.memo(MZ);function PZ(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var i;const a=d=>d===null?null:JSON.parse(d,void 0),c=(i=n.getItem(s))!=null?i:null;return c instanceof Promise?c.then(a):a(c)},setItem:(s,i)=>n.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>n.removeItem(s)}}const Ib=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ib(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ib(r)(n)}}}},LZ=(e,t)=>(n,r,s)=>{let i={storage:PZ(()=>window.localStorage),partialize:v=>v,version:0,merge:(v,N)=>({...N,...v}),...t},a=!1,c=0;const d=new Set,f=new Set;let p=i.storage;if(!p)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,s);const h=()=>{const v=i.partialize({...r()});return p.setItem(i.name,{state:v,version:i.version})},g=s.setState;s.setState=(v,N)=>(g(v,N),h());const y=e((...v)=>(n(...v),h()),r,s);s.getInitialState=()=>y;let w;const b=()=>{var v,N;if(!p)return;const S=++c;a=!1,d.forEach(_=>{var A;return _((A=r())!=null?A:y)});const k=((N=i.onRehydrateStorage)==null?void 0:N.call(i,(v=r())!=null?v:y))||void 0;return Ib(p.getItem.bind(p))(i.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==i.version){if(i.migrate){const A=i.migrate(_.state,_.version);return A instanceof Promise?A.then(I=>[!0,I]):[!0,A]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var A;if(S!==c)return;const[I,T]=_;if(w=i.merge(T,(A=r())!=null?A:y),n(w,!0),I)return h()}).then(()=>{S===c&&(k==null||k(w,void 0),w=r(),a=!0,f.forEach(_=>_(w)))}).catch(_=>{S===c&&(k==null||k(void 0,_))})};return s.persist={setOptions:v=>{i={...i,...v},v.storage&&(p=v.storage)},clearStorage:()=>{p==null||p.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>a,onHydrate:v=>(d.add(v),()=>{d.delete(v)}),onFinishHydration:v=>(f.add(v),()=>{f.delete(v)})},i.skipHydration||b(),w||y},z3=LZ,BT={tablet:768,desktop:1024};function DZ(e){return e>=BT.desktop?"desktop":e>=BT.tablet?"tablet":"mobile"}const Yf=xn()(z3((e,t)=>({sidebarOpen:!0,propertiesPanelOpen:!0,mobileMenuOpen:!1,breakpoint:"desktop",toolbarVisible:!0,toolbarPosition:{x:0,y:0},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})},setToolbarVisible:n=>e({toolbarVisible:n}),setToolbarPosition:n=>e({toolbarPosition:n}),toggleToolbar:()=>e(n=>({toolbarVisible:!n.toolbarVisible})),closeAllPanels:()=>e({sidebarOpen:!1,propertiesPanelOpen:!1,mobileMenuOpen:!1})}),{name:"marktoflow-layout",partialize:e=>({sidebarOpen:e.sidebarOpen,propertiesPanelOpen:e.propertiesPanelOpen,toolbarVisible:e.toolbarVisible,toolbarPosition:e.toolbarPosition})}));function $Z({onAddStep:e,onExecute:t,onSave:n,onValidate:r,isExecuting:s=!1}){const{autoLayout:i,fitView:a,selectedNodes:c,deleteSelected:d,duplicateSelected:f}=F3(),{undo:p,redo:h,undoStack:g,redoStack:y}=q3(),{zoomIn:w,zoomOut:b}=Zo(),v=tc(),{providers:N,activeProviderId:S,loadProviders:k}=B3(),[_,A]=E.useState(!1),{toolbarVisible:I,toolbarPosition:T,setToolbarPosition:O,setToolbarVisible:L}=Yf(),B=g.length>0,M=y.length>0,P=c.length>0,H=E.useRef(null),D=E.useRef(!1),z=E.useRef({x:0,y:0}),V=E.useCallback(ie=>{if(!H.current)return;D.current=!0;const U=H.current.getBoundingClientRect();z.current={x:ie.clientX-U.left,y:ie.clientY-U.top},ie.target.setPointerCapture(ie.pointerId)},[]),G=E.useCallback(ie=>{if(!D.current)return;const U=ie.clientX-z.current.x,Q=ie.clientY-z.current.y;O({x:U,y:Q})},[O]),q=E.useCallback(()=>{D.current=!1},[]);E.useEffect(()=>{k()},[k]);const F=N.find(ie=>ie.id===S);if(!I)return null;const Y=T.x===0&&T.y===0,$=Y?{}:{left:T.x,top:T.y,transform:"none"},K=Y?"absolute top-4 left-1/2 -translate-x-1/2":"fixed";return u.jsxs("div",{ref:H,className:`${K} z-10 flex items-center gap-1 px-2 py-1.5 bg-bg-panel/95 backdrop-blur border border-border-default rounded-lg shadow-lg`,style:$,children:[u.jsx("div",{onPointerDown:V,onPointerMove:G,onPointerUp:q,className:"cursor-grab active:cursor-grabbing p-1 rounded hover:bg-bg-hover text-text-muted",title:"Drag to reposition",children:u.jsx(nR,{className:"w-4 h-4"})}),u.jsx(Os,{}),u.jsx(Kn,{icon:u.jsx(of,{className:"w-4 h-4"}),label:"Add Step",onClick:e,shortcut:"N"}),u.jsx(Os,{}),u.jsx(Kn,{icon:u.jsx(c9,{className:"w-4 h-4"}),label:"Undo",onClick:()=>p(),disabled:!B,shortcut:`${v}Z`}),u.jsx(Kn,{icon:u.jsx(e9,{className:"w-4 h-4"}),label:"Redo",onClick:()=>h(),disabled:!M,shortcut:`${v}⇧Z`}),u.jsx(Os,{}),u.jsx(Kn,{icon:u.jsx(ji,{className:"w-4 h-4"}),label:"Duplicate",onClick:f,disabled:!P,shortcut:`${v}D`}),u.jsx(Kn,{icon:u.jsx(ea,{className:"w-4 h-4"}),label:"Delete",onClick:d,disabled:!P,shortcut:"⌫"}),u.jsx(Os,{}),u.jsx(OZ,{}),u.jsx(Os,{}),u.jsx(Kn,{icon:u.jsx(Qz,{className:"w-4 h-4"}),label:"Auto Layout",onClick:i,shortcut:`${v}L`}),u.jsx(Kn,{icon:u.jsx(m9,{className:"w-4 h-4"}),label:"Zoom In",onClick:()=>w(),shortcut:`${v}+`}),u.jsx(Kn,{icon:u.jsx(g9,{className:"w-4 h-4"}),label:"Zoom Out",onClick:()=>b(),shortcut:`${v}-`}),u.jsx(Kn,{icon:u.jsx(Vz,{className:"w-4 h-4"}),label:"Fit View",onClick:a,shortcut:`${v}0`}),u.jsx(Os,{}),u.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 px-2 py-1.5 rounded text-sm text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors",title:"Select AI Provider",children:[u.jsx(vl,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline text-xs",children:(F==null?void 0:F.name)||"No Provider"}),u.jsx(Sr,{className:"w-3 h-3"})]}),u.jsx(Os,{}),r&&u.jsx(Kn,{icon:u.jsx(Mt,{className:"w-4 h-4"}),label:"Validate",onClick:r,shortcut:`${v}T`}),t&&u.jsxs("button",{onClick:()=>t(),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${s?"bg-error hover:bg-error/90 text-text-inverse":"bg-accent hover:bg-accent-hover text-text-inverse"}`,title:`${s?"Stop":"Execute"} (${v}⏎)`,children:[s?u.jsx(oR,{className:"w-4 h-4"}):u.jsx(Pi,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:s?"Stop":"Execute"})]}),n&&u.jsx(Kn,{icon:u.jsx(n9,{className:"w-4 h-4"}),label:"Save",onClick:n,shortcut:`${v}S`}),u.jsx(Os,{}),u.jsx("button",{onClick:()=>L(!1),className:"p-1.5 rounded hover:bg-bg-hover text-text-muted hover:text-text-secondary transition-colors",title:"Hide toolbar",children:u.jsx(Zn,{className:"w-3.5 h-3.5"})}),u.jsx(TZ,{open:_,onOpenChange:A})]})}function Kn({icon:e,label:t,onClick:n,disabled:r,shortcut:s,variant:i="default"}){const a={default:"text-text-secondary hover:text-text-primary hover:bg-bg-hover",primary:"text-accent hover:text-accent-hover hover:bg-accent-muted",destructive:"text-error hover:text-error hover:bg-error-bg"};return u.jsxs("button",{onClick:n,disabled:r,className:`relative group p-2 rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${a[i]}`,title:`${t}${s?` (${s})`:""}`,children:[e,u.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-bg-elevated border border-border-default rounded text-xs text-text-primary whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-tooltip shadow-lg",children:[t,s&&u.jsx("span",{className:"ml-2 text-text-muted",children:s})]})]})}function Os(){return u.jsx("div",{className:"w-px h-6 bg-border-default mx-1"})}const FZ={pending:"bg-gray-500",running:"bg-warning animate-pulse",completed:"bg-success",failed:"bg-error",skipped:"bg-gray-400"};function qZ({steps:e,totalDuration:t,className:n}){const{bars:r,maxDuration:s}=E.useMemo(()=>{const i=t||e.reduce((d,f)=>d+(f.duration||0),0)||1;let a=0;return{bars:e.map(d=>{const f=d.duration||0,p=a;return a+=f,{...d,offset:p,duration:f,widthPercent:Math.max(f/i*100,1),offsetPercent:p/i*100}}),maxDuration:i}},[e,t]);return e.length===0?u.jsx("div",{className:"text-center py-4 text-sm text-text-muted",children:"No execution data available"}):u.jsxs("div",{className:Ue("space-y-2",n),children:[u.jsxs("div",{className:"flex items-center justify-between text-xs text-text-muted",children:[u.jsx("span",{children:"Execution Timeline"}),u.jsx("span",{children:H0(s)})]}),u.jsx("div",{className:"space-y-1.5",children:r.map(i=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-28 text-xs text-text-secondary truncate flex-shrink-0",title:i.stepName,children:i.stepName}),u.jsx("div",{className:"flex-1 h-5 bg-bg-surface rounded overflow-hidden relative",children:u.jsx("div",{className:Ue("absolute top-0 h-full rounded transition-all duration-300",FZ[i.status]),style:{left:`${i.offsetPercent}%`,width:`${i.widthPercent}%`,minWidth:"4px"},title:`${i.stepName}: ${H0(i.duration)}`})}),u.jsx("div",{className:"w-16 text-xs text-text-muted text-right flex-shrink-0",children:i.duration>0?H0(i.duration):"-"})]},i.stepId))})]})}function H0(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`}const BZ=E.memo(qZ);function zZ({status:e}){switch(e){case"running":return u.jsx(Cr,{className:"w-5 h-5 text-primary animate-spin"});case"completed":return u.jsx(Mt,{className:"w-5 h-5 text-success"});case"failed":return u.jsx(rt,{className:"w-5 h-5 text-error"});case"cancelled":return u.jsx(fR,{className:"w-5 h-5 text-text-secondary"});default:return u.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-500"})}}function VZ({status:e}){switch(e){case"running":return u.jsx(Cr,{className:"w-4 h-4 text-warning animate-spin"});case"completed":return u.jsx(Mt,{className:"w-4 h-4 text-success"});case"failed":return u.jsx(rt,{className:"w-4 h-4 text-error"});case"skipped":return u.jsx(uR,{className:"w-4 h-4 text-text-secondary"});default:return u.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-500"})}}function HZ(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 UZ({steps:e,currentStepId:t,debugEnabled:n,breakpoints:r,onToggleBreakpoint:s}){return u.jsx("div",{className:"space-y-2",children:e.map(i=>{const a=r==null?void 0:r.has(i.stepId);return u.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${i.stepId===t?"bg-primary/10 border-primary":a?"bg-error/10 border-error/50":"bg-bg-surface border-border-default"}`,children:[n&&s&&u.jsx("button",{onClick:()=>s(i.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&&u.jsx(ub,{className:"w-2 h-2 fill-current text-text-primary"})}),u.jsx(VZ,{status:i.status}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:i.stepName||i.stepId}),i.error&&u.jsx("div",{className:"text-xs text-error mt-1 truncate",children:typeof i.error=="string"?i.error:i.error.message||JSON.stringify(i.error)})]}),i.duration!==void 0&&u.jsxs("div",{className:"text-xs text-text-secondary",children:[i.duration,"ms"]})]},i.stepId)})})}function WZ({logs:e}){return u.jsx("div",{className:"font-mono text-xs space-y-1",children:e.length===0?u.jsx("div",{className:"text-text-muted",children:"No logs yet..."}):e.map((t,n)=>u.jsx("div",{className:"text-text-primary",children:t},n))})}function Vd({value:e,onCopy:t,copiedKey:n,path:r,depth:s=0}){const[i,a]=E.useState(s<2);if(e===null)return u.jsx("span",{className:"text-text-muted font-mono text-xs",children:"null"});if(e===void 0)return u.jsx("span",{className:"text-text-muted font-mono text-xs",children:"undefined"});if(typeof e=="boolean")return u.jsx("span",{className:`font-mono text-xs ${e?"text-success":"text-error"}`,children:String(e)});if(typeof e=="number")return u.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 u.jsxs("span",{className:"text-success font-mono text-xs",children:['"',c,'"']})}if(Array.isArray(e))return e.length===0?u.jsx("span",{className:"text-text-secondary font-mono text-xs",children:"[]"}):u.jsxs("div",{className:"space-y-1",children:[u.jsxs("button",{onClick:()=>a(!i),className:"flex items-center gap-1 text-text-secondary hover:text-text-primary transition-colors",children:[i?u.jsx(Sr,{className:"w-3 h-3"}):u.jsx(It,{className:"w-3 h-3"}),u.jsxs("span",{className:"text-xs font-mono",children:["Array(",e.length,")"]})]}),i&&u.jsxs("div",{className:"ml-4 pl-2 border-l border-border-default space-y-1",children:[e.slice(0,20).map((c,d)=>u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsxs("span",{className:"text-text-muted font-mono text-xs",children:["[",d,"]:"]}),u.jsx(Vd,{value:c,onCopy:t,copiedKey:n,path:`${r}[${d}]`,depth:s+1})]},d)),e.length>20&&u.jsxs("div",{className:"text-text-muted text-xs",children:["... and ",e.length-20," more items"]})]})]});if(typeof e=="object"){const c=Object.entries(e);return c.length===0?u.jsx("span",{className:"text-text-secondary font-mono text-xs",children:"{}"}):u.jsxs("div",{className:"space-y-1",children:[u.jsxs("button",{onClick:()=>a(!i),className:"flex items-center gap-1 text-text-secondary hover:text-text-primary transition-colors",children:[i?u.jsx(Sr,{className:"w-3 h-3"}):u.jsx(It,{className:"w-3 h-3"}),u.jsxs("span",{className:"text-xs font-mono",children:["Object(",c.length," keys)"]})]}),i&&u.jsxs("div",{className:"ml-4 pl-2 border-l border-border-default space-y-1",children:[c.slice(0,30).map(([d,f])=>u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsxs("span",{className:"text-primary font-mono text-xs",children:[d,":"]}),u.jsx(Vd,{value:f,onCopy:t,copiedKey:n,path:`${r}.${d}`,depth:s+1})]},d)),c.length>30&&u.jsxs("div",{className:"text-text-muted text-xs",children:["... and ",c.length-30," more keys"]})]})]})}return u.jsx("span",{className:"text-text-secondary font-mono text-xs",children:String(e)})}function KZ({steps:e}){const[t,n]=E.useState(new Set),[r,s]=E.useState(new Set),[i,a]=E.useState(null),c=e.filter(h=>h.inputs!==void 0||h.output!==void 0&&h.outputVariable),d=h=>{n(g=>{const y=new Set(g);return y.has(h)?y.delete(h):y.add(h),y})},f=h=>{s(g=>{const y=new Set(g);return y.has(h)?y.delete(h):y.add(h),y})},p=async(h,g)=>{try{const y=typeof g=="string"?g:JSON.stringify(g,null,2);await navigator.clipboard.writeText(y),a(h),setTimeout(()=>a(null),2e3)}catch(y){console.error("Failed to copy:",y)}};return c.length===0?u.jsxs("div",{className:"text-center py-8 text-text-muted text-sm",children:["No data available yet.",u.jsx("br",{}),u.jsx("span",{className:"text-xs",children:"Step inputs and outputs will appear as steps execute."})]}):u.jsx("div",{className:"space-y-2",children:c.map(h=>{const g=t.has(h.stepId),y=h.inputs&&Object.keys(h.inputs).length>0,w=h.output!==void 0&&h.outputVariable;return u.jsxs("div",{className:"border border-border-default rounded-lg overflow-hidden",children:[u.jsxs("button",{onClick:()=>d(h.stepId),className:"w-full flex items-center gap-2 px-3 py-2 bg-bg-surface hover:bg-white/5 transition-colors",children:[g?u.jsx(Sr,{className:"w-4 h-4 text-text-secondary"}):u.jsx(It,{className:"w-4 h-4 text-text-secondary"}),u.jsx("code",{className:"text-sm text-text-primary font-mono",children:h.stepName||h.stepId}),u.jsxs("span",{className:"text-xs text-text-muted ml-auto",children:[y&&`${Object.keys(h.inputs).length} inputs`,y&&w&&" • ",w&&h.outputVariable]})]}),g&&u.jsxs("div",{className:"bg-bg-panel border-t border-border-default",children:[y&&u.jsxs("div",{className:"border-b border-border-default",children:[u.jsxs("button",{onClick:()=>f(`${h.stepId}-inputs`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${h.stepId}-inputs`)?u.jsx(Sr,{className:"w-3 h-3 text-text-secondary"}):u.jsx(It,{className:"w-3 h-3 text-text-secondary"}),u.jsxs("span",{className:"text-xs font-medium text-text-secondary",children:["Inputs (",Object.keys(h.inputs).length,")"]})]}),r.has(`${h.stepId}-inputs`)&&u.jsx("div",{className:"px-3 pb-3",children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("div",{className:"flex-1 overflow-x-auto",children:u.jsx(Vd,{value:h.inputs,onCopy:(b,v)=>p(b,v),copiedKey:i,path:"inputs"})}),u.jsx("button",{onClick:()=>p(`${h.stepId}-inputs`,h.inputs),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy inputs",children:i===`${h.stepId}-inputs`?u.jsx(Vs,{className:"w-4 h-4 text-success"}):u.jsx(ji,{className:"w-4 h-4 text-text-secondary"})})]})})]}),w&&u.jsxs("div",{children:[u.jsxs("button",{onClick:()=>f(`${h.stepId}-output`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${h.stepId}-output`)?u.jsx(Sr,{className:"w-3 h-3 text-text-secondary"}):u.jsx(It,{className:"w-3 h-3 text-text-secondary"}),u.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Output"}),u.jsx("code",{className:"text-xs text-primary font-mono ml-auto",children:h.outputVariable})]}),r.has(`${h.stepId}-output`)&&u.jsx("div",{className:"px-3 pb-3",children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("div",{className:"flex-1 overflow-x-auto",children:u.jsx(Vd,{value:h.output,onCopy:(b,v)=>p(b,v),copiedKey:i,path:h.outputVariable||"output"})}),u.jsx("button",{onClick:()=>p(h.outputVariable||"",h.output),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy output",children:i===h.outputVariable?u.jsx(Vs,{className:"w-4 h-4 text-success"}):u.jsx(ji,{className:"w-4 h-4 text-text-secondary"})})]})})]})]})]},h.stepId)})})}function GZ({debug:e,onClearBreakpoints:t,onAddWatchExpression:n,onRemoveWatchExpression:r}){const[s,i]=E.useState(""),a=()=>{s.trim()&&n&&(n(s.trim()),i(""))};return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("h4",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[u.jsx(ub,{className:"w-3 h-3 text-error"}),"Breakpoints (",e.breakpoints.size,")"]}),e.breakpoints.size>0&&t&&u.jsxs("button",{onClick:t,className:"text-xs text-text-secondary hover:text-text-primary flex items-center gap-1",children:[u.jsx(ea,{className:"w-3 h-3"})," Clear all"]})]}),u.jsx("div",{className:"bg-bg-surface rounded-lg p-3",children:e.breakpoints.size===0?u.jsx("div",{className:"text-xs text-text-muted",children:"No breakpoints set. Click the dot next to a step to add one."}):u.jsx("div",{className:"space-y-1",children:Array.from(e.breakpoints).map(c=>u.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-primary",children:[u.jsx(ub,{className:"w-2 h-2 fill-current text-error"}),u.jsx("span",{className:"font-mono",children:c})]},c))})})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Call Stack"}),u.jsx("div",{className:"bg-bg-surface rounded-lg p-3",children:e.callStack.length===0?u.jsx("div",{className:"text-xs text-text-muted",children:"No active call stack"}):u.jsx("div",{className:"space-y-1",children:e.callStack.map((c,d)=>u.jsxs("div",{className:`flex items-center gap-2 text-xs ${d===0?"text-primary":"text-text-secondary"}`,children:[u.jsx(Rl,{className:"w-3 h-3"}),u.jsx("span",{className:"font-mono",children:c})]},d))})})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Watch Expressions"}),u.jsxs("div",{className:"bg-bg-surface rounded-lg p-3 space-y-2",children:[n&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"text",value:s,onChange:c=>i(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),placeholder:"Add expression...",className:"flex-1 bg-transparent border border-border-default rounded px-2 py-1 text-xs text-text-primary placeholder-gray-500 focus:outline-none focus:border-primary"}),u.jsx("button",{onClick:a,disabled:!s.trim(),className:"p-1 text-text-secondary hover:text-text-primary disabled:opacity-50",children:u.jsx(of,{className:"w-4 h-4"})})]}),e.watchExpressions.length===0?u.jsx("div",{className:"text-xs text-text-muted",children:"No watch expressions. Add an expression to monitor its value."}):u.jsx("div",{className:"space-y-1",children:e.watchExpressions.map(c=>u.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs group",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:"text-primary font-mono truncate",children:c}),u.jsx("span",{className:"text-text-muted",children:"="}),u.jsx("span",{className:"text-text-primary font-mono truncate",children:"(not evaluated)"})]}),r&&u.jsx("button",{onClick:()=>r(c),className:"p-1 text-text-muted hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",children:u.jsx(Zn,{className:"w-3 h-3"})})]},c))})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Debug State"}),u.jsxs("div",{className:"bg-bg-surface rounded-lg p-3 text-xs space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-text-secondary",children:"Current Step:"}),u.jsx("span",{className:"text-text-primary font-mono",children:e.currentStepId||"(none)"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-text-secondary",children:"Paused at Breakpoint:"}),u.jsx("span",{className:e.pausedAtBreakpoint?"text-error":"text-text-muted",children:e.pausedAtBreakpoint?"Yes":"No"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-text-secondary",children:"Step Over Pending:"}),u.jsx("span",{className:e.stepOverPending?"text-warning":"text-text-muted",children:e.stepOverPending?"Yes":"No"})]})]})]})]})}function YZ({isExecuting:e,isPaused:t,workflowStatus:n,currentStepId:r,steps:s,logs:i,onPause:a,onResume:c,onStop:d,onStepOver:f,onClose:p,debug:h,onToggleDebugMode:g,onToggleBreakpoint:y,onStepInto:w,onStepOut:b,onClearBreakpoints:v,onAddWatchExpression:N,onRemoveWatchExpression:S}){const[k,_]=E.useState("steps"),A=(h==null?void 0:h.enabled)??!1,I=s.filter(L=>L.status==="completed").length,T=s.filter(L=>L.status==="failed").length,O=s.length>0?I/s.length*100:0;return!e&&n==="pending"?null:u.jsxs("div",{className:"absolute bottom-20 left-4 right-4 z-20 bg-bg-panel border border-border-default rounded-lg shadow-xl max-h-[400px] flex flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-default",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(zZ,{status:n}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:HZ(n)}),u.jsxs("div",{className:"text-xs text-text-secondary",children:[I,"/",s.length," steps completed",T>0&&` • ${T} failed`]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[g&&u.jsx(De,{variant:A?"primary":"ghost",size:"sm",onClick:g,icon:u.jsx(d2,{className:"w-4 h-4"}),title:A?"Disable debug mode":"Enable debug mode",children:"Debug"}),e&&u.jsxs(u.Fragment,{children:[t?u.jsx(De,{variant:"secondary",size:"sm",onClick:c,icon:u.jsx(Pi,{className:"w-4 h-4"}),children:"Resume"}):u.jsx(De,{variant:"secondary",size:"sm",onClick:a,icon:u.jsx(oR,{className:"w-4 h-4"}),children:"Pause"}),A&&t&&u.jsxs(u.Fragment,{children:[u.jsx(De,{variant:"secondary",size:"sm",onClick:f,icon:u.jsx(Rl,{className:"w-4 h-4"}),title:"Step Over (F10)",children:"Over"}),w&&u.jsx(De,{variant:"secondary",size:"sm",onClick:w,icon:u.jsx(wz,{className:"w-4 h-4"}),title:"Step Into (F11)",children:"Into"}),b&&u.jsx(De,{variant:"secondary",size:"sm",onClick:b,icon:u.jsx(Nz,{className:"w-4 h-4"}),title:"Step Out (Shift+F11)",children:"Out"})]}),!A&&u.jsx(De,{variant:"secondary",size:"sm",onClick:f,icon:u.jsx(uR,{className:"w-4 h-4"}),disabled:!t,children:"Step"}),u.jsx(De,{variant:"destructive",size:"sm",onClick:d,icon:u.jsx(fR,{className:"w-4 h-4"}),children:"Stop"})]}),!e&&u.jsx(De,{variant:"secondary",size:"sm",onClick:p,children:"Close"})]})]}),u.jsx("div",{className:"h-1 bg-bg-surface",children:u.jsx("div",{className:`h-full transition-all duration-300 ${n==="failed"?"bg-error":n==="completed"?"bg-success":"bg-primary"}`,style:{width:`${O}%`}})}),u.jsxs("div",{className:"flex border-b border-border-default",children:[["steps","variables","logs","timeline"].map(L=>u.jsx("button",{onClick:()=>_(L),className:`px-4 py-2 text-sm font-medium transition-colors capitalize ${k===L?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:L},L)),A&&u.jsxs("button",{onClick:()=>_("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-text-secondary hover:text-text-primary"}`,children:[u.jsx(d2,{className:"w-3 h-3"})," Debug"]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[k==="steps"&&u.jsx(UZ,{steps:s,currentStepId:r,debugEnabled:A,breakpoints:h==null?void 0:h.breakpoints,onToggleBreakpoint:y}),k==="variables"&&u.jsx(KZ,{steps:s}),k==="logs"&&u.jsx(WZ,{logs:i}),k==="timeline"&&u.jsx(BZ,{steps:s.map(L=>({...L,stepName:L.stepName||L.stepId}))}),k==="debug"&&A&&u.jsx(GZ,{debug:h,onClearBreakpoints:v,onAddWatchExpression:N,onRemoveWatchExpression:S})]})]})}function XZ({open:e,onOpenChange:t,inputs:n,onExecute:r,workflowName:s="Workflow"}){const[i,a]=E.useState(()=>{const y={};return Object.entries(n).forEach(([w,b])=>{y[w]=b.default??""}),y}),[c,d]=E.useState({}),f=E.useCallback(()=>{const y={};return Object.entries(n).forEach(([w,b])=>{var N;const v=i[w];if(b.required&&(v===""||v===null||v===void 0)){y[w]=`${b.description||w} is required`;return}if(v!==""&&v!==null&&v!==void 0)switch(b.type){case"number":isNaN(Number(v))&&(y[w]="Must be a valid number");break;case"boolean":typeof v!="boolean"&&v!=="true"&&v!=="false"&&(y[w]="Must be true or false");break}if((N=b.validation)!=null&&N.pattern&&v)try{new RegExp(b.validation.pattern).test(String(v))||(y[w]=b.validation.message||"Invalid format")}catch{console.warn("Invalid regex pattern:",b.validation.pattern)}}),d(y),Object.keys(y).length===0},[n,i]),p=E.useCallback(()=>{if(!f())return;const y={};Object.entries(i).forEach(([w,b])=>{const v=n[w];if(v&&!(b===""&&!v.required))switch(v.type){case"number":y[w]=Number(b);break;case"boolean":y[w]=b===!0||b==="true";break;default:y[w]=b}}),r(y),t(!1)},[f,i,n,r,t]),h=E.useCallback((y,w)=>{a(b=>({...b,[y]:w})),d(b=>{const v={...b};return delete v[y],v})},[]);if(!e)return null;const g=Object.values(n).some(y=>y.required);return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:()=>t(!1)}),u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:u.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-lg w-full max-h-[80vh] flex flex-col animate-fade-in",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Execute Workflow"}),u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:s})]}),u.jsx("button",{onClick:()=>t(!1),className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close dialog",children:u.jsx(Zn,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:Object.keys(n).length===0?u.jsx("div",{className:"text-center py-8 text-text-muted",children:"This workflow has no input parameters"}):Object.entries(n).map(([y,w])=>{var b;return u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-text-primary mb-2",children:[w.description||y,w.required&&u.jsx("span",{className:"text-error ml-1",children:"*"})]}),w.type==="boolean"?u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:i[y]===!0||i[y]==="true",onChange:v=>h(y,v.target.checked),className:"w-4 h-4 rounded border-border-default bg-bg-surface text-accent focus:ring-2 focus:ring-accent/50"}),u.jsx("span",{className:"text-sm text-text-secondary",children:w.description||"Enable this option"})]}):u.jsx("input",{type:w.type==="number"?"number":"text",value:i[y]??"",onChange:v=>h(y,v.target.value),placeholder:w.default!==void 0?String(w.default):"",className:`w-full px-3 py-2 bg-bg-surface border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 transition-colors ${c[y]?"border-error focus:ring-error/50":"border-border-default focus:ring-accent/50"}`}),c[y]&&u.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5 text-xs text-error",children:[u.jsx(Oi,{className:"w-3 h-3"}),u.jsx("span",{children:c[y]})]}),!c[y]&&((b=w.validation)==null?void 0:b.message)&&u.jsx("p",{className:"text-xs text-text-muted mt-1.5",children:w.validation.message})]},y)})}),u.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-muted",children:g&&u.jsx("span",{children:"* Required field"})}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:()=>t(!1),className:"px-4 py-2 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:"Cancel"}),u.jsxs("button",{onClick:p,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors flex items-center gap-2",children:[u.jsx(Pi,{className:"w-4 h-4"}),"Execute"]})]})]})]})})]})}function QZ({workflowPath:e,onClose:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(null);E.useEffect(()=>{e&&a(e)},[e]);const a=async c=>{r(!0),i(null);try{const d=await fetch(`/api/execute/${encodeURIComponent(c)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dryRun:!0})}),f=await d.json();d.ok?i(f):i({valid:!1,error:f.message||"Validation failed"})}catch(d){i({valid:!1,error:d instanceof Error?d.message:"Unknown error"})}finally{r(!1)}};return e?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:t}),u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:u.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-2xl w-full max-h-[80vh] flex flex-col animate-fade-in",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Workflow Validation"}),u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Dry-run analysis results"})]}),u.jsx("button",{onClick:t,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close validation panel",children:u.jsx(Zn,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:n?u.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[u.jsx(Cr,{className:"w-12 h-12 text-accent animate-spin mb-4"}),u.jsx("p",{className:"text-sm text-text-secondary",children:"Validating workflow..."})]}):s?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:`flex items-start gap-3 p-4 rounded-lg border ${s.valid?"bg-success-bg border-success/30":"bg-error-bg border-error/30"}`,children:[s.valid?u.jsx(Mt,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):u.jsx(rt,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h3",{className:`text-sm font-medium ${s.valid?"text-success":"text-error"}`,children:s.valid?"Workflow is valid":"Validation failed"}),s.error&&u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:s.error})]})]}),s.workflow&&u.jsxs("div",{className:"space-y-3",children:[u.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Workflow Details"}),u.jsxs("div",{className:"bg-bg-surface border border-border-default rounded-lg p-4 space-y-2",children:[u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{className:"text-text-secondary",children:"Name:"}),u.jsx("span",{className:"text-text-primary font-medium",children:s.workflow.name})]}),s.workflow.version&&u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{className:"text-text-secondary",children:"Version:"}),u.jsx("span",{className:"text-text-primary",children:s.workflow.version})]}),s.workflow.description&&u.jsxs("div",{className:"text-sm",children:[u.jsx("span",{className:"text-text-secondary",children:"Description:"}),u.jsx("p",{className:"text-text-primary mt-1",children:s.workflow.description})]})]})]}),s.steps&&s.steps.length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary",children:["Steps (",s.steps.length,")"]}),u.jsx("div",{className:"space-y-2",children:s.steps.map((c,d)=>u.jsx("div",{className:"bg-bg-surface border border-border-default rounded-lg p-3",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-accent/10 text-accent text-xs font-medium flex items-center justify-center",children:d+1}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-text-primary",children:c.action}),c.description&&u.jsx("p",{className:"text-xs text-text-secondary mt-1",children:c.description})]})]})},c.id))})]}),s.warnings&&s.warnings.length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[u.jsx(Zl,{className:"w-4 h-4 text-warning"}),"Warnings (",s.warnings.length,")"]}),u.jsx("div",{className:"space-y-2",children:s.warnings.map((c,d)=>u.jsx("div",{className:"bg-warning-bg border border-warning/30 rounded-lg p-3",children:u.jsx("p",{className:"text-sm text-text-primary",children:c})},d))})]}),s.inputs&&Object.keys(s.inputs).length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary",children:["Required Inputs (",Object.keys(s.inputs).length,")"]}),u.jsx("div",{className:"bg-bg-surface border border-border-default rounded-lg p-4 space-y-2",children:Object.entries(s.inputs).map(([c,d])=>u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsxs("span",{className:"text-text-secondary",children:[c,d.required&&u.jsx("span",{className:"text-error ml-1",children:"*"})]}),u.jsx("span",{className:"text-text-primary font-mono text-xs",children:d.type||"string"})]},c))})]})]}):null}),u.jsx("div",{className:"flex items-center justify-end p-6 border-t border-border-subtle",children:u.jsx("button",{onClick:t,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors",children:"Close"})})]})})]}):null}function JZ({open:e,onOpenChange:t,onImportComplete:n}){const[r,s]=E.useState(null),[i,a]=E.useState(!1),[c,d]=E.useState([]),[f,p]=E.useState(!1),h=E.useRef(null),g=_=>{var I;const A=(I=_.target.files)==null?void 0:I[0];A&&(s(A),d([]))},y=_=>{_.preventDefault(),_.stopPropagation(),p(!0)},w=_=>{_.preventDefault(),_.stopPropagation(),p(!1)},b=_=>{var I;_.preventDefault(),_.stopPropagation(),p(!1);const A=(I=_.dataTransfer.files)==null?void 0:I[0];A&&(s(A),d([]))},v=async()=>{if(r){a(!0),d([]);try{const _=new FormData;_.append("file",r);const A=await fetch("/api/workflows/import",{method:"POST",body:_});if(!A.ok){const T=await A.json();throw new Error(T.message||"Upload failed")}const I=await A.json();Array.isArray(I.results)?d(I.results):I.success&&d([{success:!0,filename:I.filename||r.name,message:I.message}]),setTimeout(()=>{n&&n()},1500)}catch(_){d([{success:!1,filename:r.name,message:_ instanceof Error?_.message:"Unknown error"}])}finally{a(!1)}}},N=()=>{s(null),d([]),t(!1)},S=_=>_?[".md",".yaml",".yml",".zip"].some(I=>_.name.toLowerCase().endsWith(I)):!1,k=_=>_.endsWith(".zip")?u.jsx(bz,{className:"w-5 h-5 text-purple-400"}):u.jsx(Ai,{className:"w-5 h-5 text-blue-400"});return u.jsxs(rs,{open:e,onOpenChange:t,title:"Import Workflow",description:"Upload workflow files from your computer",size:"md",children:[u.jsxs("div",{className:"p-4 space-y-4",children:[!r&&c.length===0&&u.jsxs("div",{onClick:()=>{var _;return(_=h.current)==null?void 0:_.click()},onDragOver:y,onDragLeave:w,onDrop:b,className:`
827
+ border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors
828
+ ${f?"border-primary bg-primary/10":"border-node-border hover:border-primary/50 hover:bg-white/5"}
829
+ `,children:[u.jsx(hR,{className:"w-12 h-12 mx-auto mb-4 text-gray-500"}),u.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"Drag and drop a file here, or click to browse"}),u.jsx("p",{className:"text-xs text-gray-500",children:"Supported formats: .md, .yaml, .yml, .zip"}),u.jsx("input",{ref:h,type:"file",accept:".md,.yaml,.yml,.zip",onChange:g,className:"hidden"})]}),r&&c.length===0&&u.jsxs("div",{className:"border border-node-border rounded-lg p-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[k(r.name),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-white truncate",children:r.name}),u.jsxs("p",{className:"text-xs text-gray-500",children:[(r.size/1024).toFixed(2)," KB"]})]}),!S(r)&&u.jsx(Oi,{className:"w-5 h-5 text-error flex-shrink-0"})]}),!S(r)&&u.jsx("p",{className:"text-xs text-error mt-2",children:"Invalid file type. Please select a .md, .yaml, .yml, or .zip file."})]}),c.length>0&&u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-white",children:"Import Results:"}),c.map((_,A)=>u.jsxs("div",{className:`
830
+ flex items-start gap-3 p-3 rounded-lg border
831
+ ${_.success?"border-success/30 bg-success/10":"border-error/30 bg-error/10"}
832
+ `,children:[_.success?u.jsx(Mt,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):u.jsx(rt,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-white truncate",children:_.filename}),_.message&&u.jsx("p",{className:"text-xs text-gray-400 mt-1",children:_.message})]})]},A))]})]}),u.jsx(Mi,{children:c.length>0?u.jsx(De,{variant:"secondary",onClick:N,children:"Close"}):u.jsxs(u.Fragment,{children:[u.jsx(De,{variant:"secondary",onClick:N,disabled:i,children:"Cancel"}),u.jsx(De,{variant:"primary",onClick:v,disabled:!r||!S(r)||i,children:i?"Uploading...":"Import"})]})})]})}const ZZ=[{id:"blank",name:"Blank Workflow",description:"Start from scratch with an empty workflow",icon:u.jsx(Ai,{className:"w-5 h-5"}),category:"General"},{id:"slack-notification",name:"Slack Notification",description:"Send messages to Slack channels",icon:u.jsx(iR,{className:"w-5 h-5"}),category:"Communication"},{id:"github-pr",name:"GitHub Pull Request",description:"Create and manage GitHub pull requests",icon:u.jsx(Dz,{className:"w-5 h-5"}),category:"Development"},{id:"http-request",name:"HTTP Request",description:"Make HTTP API calls and process responses",icon:u.jsx(tR,{className:"w-5 h-5"}),category:"Integration"},{id:"scheduled-task",name:"Scheduled Task",description:"Run workflows on a schedule with cron triggers",icon:u.jsx(Ht,{className:"w-5 h-5"}),category:"Automation"}];function eee({open:e,onOpenChange:t,onCreate:n}){const[r,s]=E.useState(""),[i,a]=E.useState("blank"),[c,d]=E.useState(""),f=E.useCallback(()=>{if(!r.trim()){d("Workflow name is required");return}n(r.trim(),i),s(""),a("blank"),d(""),t(!1)},[r,i,n,t]),p=E.useCallback(()=>{s(""),a("blank"),d(""),t(!1)},[t]);return e?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:p}),u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:u.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-2xl w-full max-h-[80vh] flex flex-col animate-fade-in",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Create New Workflow"}),u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Choose a template to get started quickly"})]}),u.jsx("button",{onClick:p,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close dialog",children:u.jsx(Zn,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-text-primary mb-2",children:["Workflow Name ",u.jsx("span",{className:"text-error",children:"*"})]}),u.jsx("input",{type:"text",value:r,onChange:h=>{s(h.target.value),d("")},placeholder:"e.g., Daily Standup Reminder",className:`w-full px-3 py-2 bg-bg-surface border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 transition-colors ${c?"border-error focus:ring-error/50":"border-border-default focus:ring-accent/50"}`,autoFocus:!0}),c&&u.jsx("p",{className:"text-xs text-error mt-1.5",children:c})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-text-primary mb-3",children:"Template"}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:ZZ.map(h=>u.jsx("button",{onClick:()=>a(h.id),className:`p-4 rounded-lg border-2 text-left transition-all ${i===h.id?"border-accent bg-accent-muted":"border-border-default hover:border-border-strong bg-bg-surface"}`,children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center ${i===h.id?"bg-accent text-text-inverse":"bg-bg-elevated text-text-secondary"}`,children:h.icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("h3",{className:"text-sm font-medium text-text-primary truncate",children:h.name}),i===h.id&&u.jsx("div",{className:"flex-shrink-0 w-2 h-2 rounded-full bg-accent"})]}),u.jsx("p",{className:"text-xs text-text-secondary line-clamp-2",children:h.description})]})]})},h.id))})]})]}),u.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:[u.jsx("button",{onClick:p,className:"px-4 py-2 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:"Cancel"}),u.jsx("button",{onClick:f,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors",children:"Create Workflow"})]})]})})]}):null}const pi={general:{theme:"dark"},canvas:{showGrid:!0,snapToGrid:!0,gridSize:20,showMinimap:!0,animateEdges:!0},editor:{autoSaveEnabled:!1,autoSaveIntervalMs:3e4,autoValidateOnChange:!0,confirmBeforeDelete:!0},execution:{confirmBeforeExecute:!0,autoScrollLogs:!0,showExecutionNotifications:!0},ai:{showPromptBar:!0,showAISuggestions:!0},notifications:{executionComplete:!0,executionFailed:!0,workflowSaved:!1,connectionStatus:!0}};function zT(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Mb(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 Fs=xn((e,t)=>({theme:"dark",resolvedTheme:"dark",setTheme:n=>{const r=n==="system"?zT():n;Mb(r),e({theme:n,resolvedTheme:r})},toggleTheme:()=>{const{theme:n}=t(),r=n==="dark"?"light":"dark",s=r==="system"?zT():r;Mb(s),e({theme:r,resolvedTheme:s})}}));Mb("dark");typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{const{theme:e,setTheme:t}=Fs.getState();e==="system"&&t("system")});const rr=xn((e,t)=>({settings:{...pi},loaded:!1,settingsOpen:!1,openSettings:()=>e({settingsOpen:!0}),closeSettings:()=>e({settingsOpen:!1}),loadSettings:async()=>{try{const n=await fetch("/api/settings");if(n.ok){const r=await n.json();e({settings:r,loaded:!0}),Fs.getState().setTheme(r.general.theme)}}catch{e({loaded:!0})}},updateSetting:(n,r,s)=>{const{settings:i}=t(),a={...i,[n]:{...i[n],[r]:s}};e({settings:a}),n==="general"&&r==="theme"&&Fs.getState().setTheme(s),fetch(`/api/settings/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:s})}).catch(()=>{})},updateCategory:(n,r)=>{const{settings:s}=t(),i={...s,[n]:{...s[n],...r}};e({settings:i}),n==="general"&&"theme"in r&&Fs.getState().setTheme(r.theme),fetch(`/api/settings/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).catch(()=>{})},resetCategory:n=>{const{settings:r}=t(),s={...r,[n]:{...pi[n]}};e({settings:s}),n==="general"&&Fs.getState().setTheme(pi.general.theme),fetch(`/api/settings/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(pi[n])}).catch(()=>{})},resetAll:()=>{e({settings:{...pi}}),Fs.getState().setTheme(pi.general.theme),fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(pi)}).catch(()=>{})}}));function tee({label:e,description:t,value:n,options:r,onChange:s}){return u.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:e}),t&&u.jsx("div",{className:"text-xs text-text-muted mt-0.5",children:t})]}),u.jsx("select",{value:n,onChange:i=>s(i.target.value),className:"bg-bg-surface border border-border-default rounded-lg px-3 py-1.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent",children:r.map(i=>u.jsx("option",{value:i.value,children:i.label},i.value))})]})}function nee(){const{settings:e,updateSetting:t}=rr();return u.jsx("div",{className:"divide-y divide-border-default",children:u.jsx(tee,{label:"Theme",description:"Choose the color scheme for the application",value:e.general.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],onChange:n=>t("general","theme",n)})})}function Ft({label:e,description:t,checked:n,onChange:r}){return u.jsxs("label",{className:"flex items-center justify-between gap-4 py-3 cursor-pointer group",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:e}),t&&u.jsx("div",{className:"text-xs text-text-muted mt-0.5",children:t})]}),u.jsx("button",{role:"switch","aria-checked":n,onClick:()=>r(!n),className:`relative inline-flex h-5 w-9 flex-shrink-0 rounded-full transition-colors duration-200 ${n?"bg-accent":"bg-bg-surface"}`,children:u.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transform transition-transform duration-200 mt-0.5 ${n?"translate-x-4 ml-0.5":"translate-x-0.5"}`})})]})}function V3({label:e,description:t,value:n,min:r,max:s,step:i=1,onChange:a}){return u.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:e}),t&&u.jsx("div",{className:"text-xs text-text-muted mt-0.5",children:t})]}),u.jsx("input",{type:"number",value:n,min:r,max:s,step:i,onChange:c=>{const d=Number(c.target.value);isNaN(d)||a(d)},className:"w-24 bg-bg-surface border border-border-default rounded-lg px-3 py-1.5 text-sm text-text-primary text-right focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent"})]})}function ree(){const{settings:e,updateSetting:t}=rr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Ft,{label:"Show Grid",description:"Display grid lines on the canvas background",checked:e.canvas.showGrid,onChange:n=>t("canvas","showGrid",n)}),u.jsx(Ft,{label:"Snap to Grid",description:"Nodes snap to grid positions when dragging",checked:e.canvas.snapToGrid,onChange:n=>t("canvas","snapToGrid",n)}),u.jsx(V3,{label:"Grid Size",description:"Grid spacing in pixels",value:e.canvas.gridSize,min:5,max:100,step:5,onChange:n=>t("canvas","gridSize",n)}),u.jsx(Ft,{label:"Show Minimap",description:"Display minimap navigation in the corner",checked:e.canvas.showMinimap,onChange:n=>t("canvas","showMinimap",n)}),u.jsx(Ft,{label:"Animate Edges",description:"Show animated flow along connection edges",checked:e.canvas.animateEdges,onChange:n=>t("canvas","animateEdges",n)})]})}function see(){const{settings:e,updateSetting:t}=rr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Ft,{label:"Auto-Save",description:"Automatically save workflows at a regular interval",checked:e.editor.autoSaveEnabled,onChange:n=>t("editor","autoSaveEnabled",n)}),e.editor.autoSaveEnabled&&u.jsx(V3,{label:"Auto-Save Interval",description:"Interval in seconds between automatic saves",value:e.editor.autoSaveIntervalMs/1e3,min:5,max:300,step:5,onChange:n=>t("editor","autoSaveIntervalMs",n*1e3)}),u.jsx(Ft,{label:"Auto-Validate on Change",description:"Run workflow validation after each edit",checked:e.editor.autoValidateOnChange,onChange:n=>t("editor","autoValidateOnChange",n)}),u.jsx(Ft,{label:"Confirm Before Delete",description:"Show confirmation dialog before deleting steps",checked:e.editor.confirmBeforeDelete,onChange:n=>t("editor","confirmBeforeDelete",n)})]})}function iee(){const{settings:e,updateSetting:t}=rr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Ft,{label:"Confirm Before Execute",description:"Show confirmation dialog before running workflows",checked:e.execution.confirmBeforeExecute,onChange:n=>t("execution","confirmBeforeExecute",n)}),u.jsx(Ft,{label:"Auto-Scroll Logs",description:"Automatically scroll to the latest log entry during execution",checked:e.execution.autoScrollLogs,onChange:n=>t("execution","autoScrollLogs",n)}),u.jsx(Ft,{label:"Show Execution Notifications",description:"Display toast notifications when execution completes or fails",checked:e.execution.showExecutionNotifications,onChange:n=>t("execution","showExecutionNotifications",n)})]})}function oee(){const{settings:e,updateSetting:t}=rr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Ft,{label:"Show Prompt Bar",description:"Display the AI prompt input at the bottom of the canvas",checked:e.ai.showPromptBar,onChange:n=>t("ai","showPromptBar",n)}),u.jsx(Ft,{label:"Show AI Suggestions",description:"Display AI-generated suggestions while editing workflows",checked:e.ai.showAISuggestions,onChange:n=>t("ai","showAISuggestions",n)})]})}function aee(){const{settings:e,updateSetting:t}=rr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Ft,{label:"Execution Complete",description:"Notify when a workflow execution finishes successfully",checked:e.notifications.executionComplete,onChange:n=>t("notifications","executionComplete",n)}),u.jsx(Ft,{label:"Execution Failed",description:"Notify when a workflow execution fails",checked:e.notifications.executionFailed,onChange:n=>t("notifications","executionFailed",n)}),u.jsx(Ft,{label:"Workflow Saved",description:"Notify when a workflow is saved",checked:e.notifications.workflowSaved,onChange:n=>t("notifications","workflowSaved",n)}),u.jsx(Ft,{label:"Connection Status",description:"Notify when WebSocket connection state changes",checked:e.notifications.connectionStatus,onChange:n=>t("notifications","connectionStatus",n)})]})}const VT=[{key:"general",label:"General",icon:cR,component:nee},{key:"canvas",label:"Canvas",icon:dw,component:ree},{key:"editor",label:"Editor",icon:jz,component:see},{key:"execution",label:"Execution",icon:Pi,component:iee},{key:"ai",label:"AI",icon:vl,component:oee},{key:"notifications",label:"Notifications",icon:kz,component:aee}];function lee(){const{settingsOpen:e,closeSettings:t,resetCategory:n}=rr(),[r,s]=E.useState("general"),i=VT.find(c=>c.key===r),a=i.component;return u.jsx(rs,{open:e,onOpenChange:c=>{c||t()},title:"Settings",size:"xl",children:u.jsxs("div",{className:"flex min-h-[400px]",children:[u.jsx("nav",{className:"w-48 border-r border-border-default p-2 flex-shrink-0",children:VT.map(({key:c,label:d,icon:f})=>u.jsxs("button",{onClick:()=>s(c),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors ${r===c?"bg-accent-muted text-accent":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"}`,children:[u.jsx(f,{className:"w-4 h-4"}),d]},c))}),u.jsxs("div",{className:"flex-1 p-6",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-base font-semibold text-text-primary",children:i.label}),u.jsxs("button",{onClick:()=>n(r),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",title:"Reset to defaults",children:[u.jsx(aR,{className:"w-3.5 h-3.5"}),"Reset"]})]}),u.jsx(a,{})]})]})})}function cee(){const[e,t]=E.useState("workflows"),{workflows:n,selectedWorkflow:r,selectWorkflow:s}=en(),{resetNavigation:i}=Sw(),{sidebarOpen:a,setSidebarOpen:c,breakpoint:d}=Yf(),f=E.useCallback(p=>{i(),s(p),d==="mobile"&&c(!1)},[i,s,d,c]);return!a&&d!=="mobile"?u.jsxs("button",{onClick:()=>c(!0),className:"w-12 bg-bg-panel border-r border-border-default flex flex-col items-center py-4 gap-4 hover:bg-bg-hover transition-colors","aria-label":"Expand sidebar",children:[u.jsx(It,{className:"w-4 h-4 text-text-secondary"}),u.jsx("img",{src:"/marktoflow-logo.png",alt:"Marktoflow",className:"w-6 h-6 rounded-full object-cover"})]}):d==="mobile"?a?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>c(!1)}),u.jsx("div",{className:"fixed inset-y-0 left-0 w-72 bg-bg-panel border-r border-border-default flex flex-col z-50 md:hidden animate-slide-in-left",children:u.jsx(HT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:!0})})]}):null:u.jsx("div",{className:"w-64 bg-bg-panel border-r border-border-default flex flex-col transition-all duration-300",children:u.jsx(HT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:d==="tablet"})})}function HT({activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:s,onClose:i,showClose:a}){const[c,d]=E.useState(!1),[f,p]=E.useState(!1),[h,g]=E.useState(""),{fetchWorkflows:y}=en(),w=E.useCallback(async(v,N)=>{try{const S=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v,template:N})});if(!S.ok){const _=await S.json();console.error("Failed to create workflow:",_);return}const k=await S.json();console.log("Created workflow:",k),await y(),k.path&&s(k.path)}catch(S){console.error("Failed to create workflow:",S)}},[y,s]),b=n.filter(v=>{if(!h.trim())return!0;const N=h.toLowerCase();return v.name.toLowerCase().includes(N)||v.path.toLowerCase().includes(N)});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"p-4 border-b border-border-default flex items-center justify-between",children:[u.jsxs("h1",{className:"text-lg font-semibold text-text-primary flex items-center gap-2",children:[u.jsx("img",{src:"/marktoflow-logo.png",alt:"Marktoflow",className:"w-8 h-8 rounded-full object-cover"}),"Marktoflow"]}),a&&u.jsx("button",{onClick:i,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Close sidebar",children:u.jsx(Zn,{className:"w-4 h-4 text-text-secondary"})})]}),u.jsxs("div",{className:"flex border-b border-border-default",children:[u.jsx("button",{onClick:()=>t("workflows"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="workflows"?"text-accent border-b-2 border-accent":"text-text-secondary hover:text-text-primary"}`,children:"Workflows"}),u.jsx("button",{onClick:()=>t("tools"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="tools"?"text-accent border-b-2 border-accent":"text-text-secondary hover:text-text-primary"}`,children:"Tools"})]}),u.jsx("div",{className:"p-3 border-b border-border-default",children:u.jsxs("div",{className:"relative",children:[u.jsx(Pl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted"}),u.jsx("input",{type:"text",value:h,onChange:v=>g(v.target.value),placeholder:`Search ${e}...`,className:"w-full pl-9 pr-3 py-2 bg-bg-surface border border-border-default rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent transition-colors"}),h&&u.jsx("button",{onClick:()=>g(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary","aria-label":"Clear search",children:u.jsx(Zn,{className:"w-4 h-4"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:e==="workflows"?u.jsx(uee,{workflows:b,selectedWorkflow:r,onSelect:s,searchQuery:h}):u.jsx(fee,{})}),e==="workflows"&&u.jsxs("div",{className:"p-3 border-t border-border-default space-y-2",children:[u.jsxs("button",{onClick:()=>p(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors shadow-sm",children:[u.jsx(of,{className:"w-4 h-4"}),"New Workflow"]}),u.jsxs("button",{onClick:()=>d(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:[u.jsx(hR,{className:"w-4 h-4"}),"Import"]})]}),u.jsx("div",{className:"p-3 border-t border-border-default",children:u.jsxs("button",{onClick:()=>rr.getState().openSettings(),className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg text-text-secondary hover:bg-bg-hover hover:text-text-primary transition-colors text-sm",title:"Settings (⌘,)",children:[u.jsx(cR,{className:"w-4 h-4"}),"Settings"]})}),u.jsx(JZ,{open:c,onOpenChange:d,onImportComplete:()=>y()}),u.jsx(eee,{open:f,onOpenChange:p,onCreate:w}),u.jsx(lee,{})]})}function uee({workflows:e,selectedWorkflow:t,onSelect:n,searchQuery:r=""}){return e.length===0?u.jsx("div",{className:"text-center py-8 text-text-muted text-sm",children:r?u.jsxs(u.Fragment,{children:[u.jsx(Pl,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),u.jsxs("p",{children:['No workflows match "',r,'"']})]}):u.jsxs(u.Fragment,{children:[u.jsx(Ai,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),u.jsx("p",{children:"No workflows found"}),u.jsx("p",{className:"text-xs mt-1 text-text-muted",children:"Create your first workflow to get started"})]})}):u.jsx("div",{className:"space-y-1",children:e.map(s=>u.jsxs("button",{onClick:()=>n(s.path),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors ${t===s.path?"bg-accent-muted text-accent border border-accent/20":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"}`,children:[u.jsx(Ai,{className:"w-4 h-4 flex-shrink-0"}),u.jsx("span",{className:"text-sm truncate",children:s.name}),u.jsx(It,{className:"w-4 h-4 ml-auto flex-shrink-0 opacity-50"})]},s.path))})}const dee=[{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 fee(){const[e,t]=E.useState(dee),[n,r]=E.useState(!0),[s,i]=E.useState("");E.useEffect(()=>{async function f(){try{const p=await fetch("/api/tools");if(p.ok){const h=await p.json();t(h.tools)}}catch(p){console.error("Failed to fetch tools:",p)}finally{r(!1)}}f()},[]);const a=s?e.filter(f=>{var p;return f.name.toLowerCase().includes(s.toLowerCase())||f.category.toLowerCase().includes(s.toLowerCase())||((p=f.description)==null?void 0:p.toLowerCase().includes(s.toLowerCase()))}):e,c=[...new Set(a.map(f=>f.category))],d=(f,p)=>{f.dataTransfer.setData("application/marktoflow-tool",JSON.stringify(p)),f.dataTransfer.effectAllowed="copy"};return n?u.jsx("div",{className:"flex items-center justify-center py-8",children:u.jsx(Cr,{className:"w-5 h-5 text-gray-500 animate-spin"})}):u.jsxs("div",{className:"space-y-4",children:[c.map(f=>u.jsxs("div",{children:[u.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider px-2 mb-2",children:f}),u.jsx("div",{className:"space-y-1",children:a.filter(p=>p.category===f).map(p=>u.jsxs("div",{draggable:!0,onDragStart:h=>d(h,p),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-gray-300 hover:bg-white/5 cursor-grab active:cursor-grabbing transition-colors group",title:p.description||(p.sdk?"SDK: "+p.sdk:void 0),children:[u.jsx("span",{className:"text-lg",children:p.icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"text-sm block truncate",children:p.name}),p.actionCount!==void 0&&u.jsxs("span",{className:"text-xs text-gray-500",children:[p.actionCount," actions"]})]})]},p.id))})]},f)),a.length===0&&u.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No tools found"})]})}const UT={enabled:!1,breakpoints:new Set,currentStepId:null,pausedAtBreakpoint:!1,stepOverPending:!1,watchExpressions:[],callStack:[]},H3=xn((e,t)=>({runs:[],currentRunId:null,isExecuting:!1,isPaused:!1,isLoadingHistory:!1,debug:UT,startExecution:(n,r,s,i)=>{const a=i||"run-"+Date.now()+"-"+Math.random().toString(36).slice(2,8),c={id:a,workflowId:n,workflowName:r,status:"running",startTime:new Date().toISOString(),steps:[],logs:["Starting workflow execution: "+r],inputs:s};return e({runs:[c,...t().runs].slice(0,50),currentRunId:a,isExecuting:!0,isPaused:!1}),a},updateStepStatus:(n,r,s,i,a,c,d)=>{const{debug:f}=t(),p=f.enabled&&s==="running"&&f.breakpoints.has(r);e({runs:t().runs.map(h=>{if(h.id!==n)return h;const g=h.steps.find(w=>w.stepId===r),y=new Date().toISOString();return g?{...h,steps:h.steps.map(w=>{if(w.stepId!==r)return w;const b=s!=="running"?y:void 0,v=b&&w.startTime?new Date(b).getTime()-new Date(w.startTime).getTime():void 0;return{...w,status:s,endTime:b,duration:v,inputs:d??w.inputs,output:i??w.output,outputVariable:c??w.outputVariable,error:a??w.error}})}:{...h,steps:[...h.steps,{stepId:r,stepName:r,status:s,startTime:y,inputs:d,output:i,outputVariable:c,error:a}]}}),...p?{isPaused:!0,debug:{...t().debug,currentStepId:r,pausedAtBreakpoint:!0,stepOverPending:!1}}:{debug:{...t().debug,currentStepId:s==="running"?r:t().debug.currentStepId}}}),p&&t().addLog(n,`⏸️ Paused at breakpoint: ${r}`)},completeExecution:(n,r,s)=>{const i=new Date().toISOString();e({runs:t().runs.map(a=>{if(a.id!==n)return a;const c=new Date(i).getTime()-new Date(a.startTime).getTime();return{...a,status:r,endTime:i,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(i=>i.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:{...UT,breakpoints:t().debug.breakpoints}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode disabled")},toggleBreakpoint:n=>{const{debug:r}=t(),s=new Set(r.breakpoints);s.has(n)?s.delete(n):s.add(n),e({debug:{...r,breakpoints:s}})},hasBreakpoint:n=>t().debug.breakpoints.has(n),clearAllBreakpoints:()=>{e({debug:{...t().debug,breakpoints:new Set}});const{currentRunId:n}=t();n&&t().addLog(n,"All breakpoints cleared")},stepOver:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"➡️ Step over"))},stepInto:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬇️ Step into"))},stepOut:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!1,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬆️ Step out"))},setCurrentDebugStep:n=>{e({debug:{...t().debug,currentStepId:n}})},addWatchExpression:n=>{const{debug:r}=t();r.watchExpressions.includes(n)||e({debug:{...r,watchExpressions:[...r.watchExpressions,n]}})},removeWatchExpression:n=>{const{debug:r}=t();e({debug:{...r,watchExpressions:r.watchExpressions.filter(s=>s!==n)}})},updateCallStack:n=>{e({debug:{...t().debug,callStack:n}})},loadHistory:async n=>{e({isLoadingHistory:!0});try{const r=n?`/api/executions?workflowId=${encodeURIComponent(n)}&limit=50`:"/api/executions?limit=50",s=await fetch(r);if(!s.ok)throw new Error("Failed to load execution history");const a=(await s.json()).map(f=>{var p;return{id:f.runId,workflowId:f.workflowId,workflowName:((p=f.workflowPath.split("/").pop())==null?void 0:p.replace(".md",""))||f.workflowId,status:f.status,startTime:f.startedAt,endTime:f.completedAt||void 0,duration:f.completedAt?new Date(f.completedAt).getTime()-new Date(f.startedAt).getTime():void 0,steps:[],logs:[],inputs:f.inputs||void 0,outputs:f.outputs||void 0}}),c=new Set(t().runs.map(f=>f.id)),d=a.filter(f=>!c.has(f.id));e({runs:[...t().runs,...d].slice(0,50),isLoadingHistory:!1})}catch(r){console.error("Error loading execution history:",r),e({isLoadingHistory:!1})}},syncRunWithBackend:async n=>{console.log("Syncing run with backend:",n)}}));function Rb(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 hee(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),s=Math.floor(r/1e3),i=Math.floor(s/60),a=Math.floor(i/60),c=Math.floor(a/24);return s<60?"just now":i<60?i+" min ago":a<24?a+" hour"+(a>1?"s":"")+" ago":c<7?c+" day"+(c>1?"s":"")+" ago":n.toLocaleDateString()}const pee=xn((e,t)=>({versions:[],isLoading:!1,compareMode:!1,selectedVersions:[null,null],loadVersions:async n=>{e({isLoading:!0});try{const r=await fetch(`/api/versions/${encodeURIComponent(n)}/versions`);if(!r.ok)throw new Error("Failed to load versions");const s=await r.json();e({versions:s.versions,isLoading:!1})}catch{e({isLoading:!1})}},createVersion:async(n,r,s)=>{try{await fetch(`/api/versions/${encodeURIComponent(n)}/versions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r,message:s})}),await t().loadVersions(n)}catch{}},restoreVersion:async(n,r)=>{try{const s=await fetch(`/api/versions/${encodeURIComponent(n)}/versions/${r}/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!s.ok)throw new Error("Failed to restore");const i=await s.json();return await t().loadVersions(n),i.restoredContent}catch{return null}},setCompareMode:n=>e({compareMode:n,selectedVersions:[null,null]}),selectForCompare:n=>{const{selectedVersions:r}=t();r[0]?r[1]?e({selectedVersions:[n,null]}):e({selectedVersions:[r[0],n]}):e({selectedVersions:[n,null]})}}));function mee({workflowPath:e,onRestore:t}){const{versions:n,isLoading:r,compareMode:s,selectedVersions:i,loadVersions:a,restoreVersion:c,setCompareMode:d,selectForCompare:f}=pee();E.useEffect(()=>{e&&a(e)},[e,a]);const p=async h=>{if(!e)return;const g=await c(e,h);g&&t&&t(g)};return e?u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-default",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[u.jsx(sf,{className:"w-4 h-4"}),"Version History"]}),u.jsxs(De,{variant:s?"primary":"secondary",size:"sm",onClick:()=>d(!s),children:[u.jsx(eR,{className:"w-3.5 h-3.5 mr-1"}),"Compare"]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:r?u.jsx("div",{className:"text-center py-8 text-sm text-text-muted",children:"Loading versions..."}):n.length===0?u.jsx("div",{className:"text-center py-8 text-sm text-text-muted",children:"No versions saved yet"}):n.map(h=>u.jsxs("div",{className:Ue("p-3 rounded-lg border transition-colors",s&&i.includes(h.id)?"border-primary bg-primary/10":"border-border-default bg-bg-surface hover:border-border-default/80"),children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsxs("span",{className:"text-sm font-medium text-text-primary flex items-center gap-1.5",children:[u.jsx(l9,{className:"w-3 h-3 text-primary"}),"v",h.version]}),u.jsx("span",{className:"text-xs text-text-muted font-mono",children:h.hash})]}),u.jsx("div",{className:"text-xs text-text-secondary mb-2",children:h.message}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(u9,{className:"w-3 h-3"}),h.author]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Ht,{className:"w-3 h-3"}),new Date(h.createdAt).toLocaleString()]})]}),u.jsx("div",{className:"flex gap-1",children:s?u.jsx("button",{onClick:()=>f(h.id),className:"px-2 py-1 text-xs rounded bg-bg-hover text-text-secondary hover:text-text-primary",children:"Select"}):u.jsxs("button",{onClick:()=>p(h.id),className:"px-2 py-1 text-xs rounded bg-bg-hover text-text-secondary hover:text-text-primary flex items-center gap-1",children:[u.jsx(aR,{className:"w-3 h-3"}),"Restore"]})})]}),h.isAutoSave&&u.jsx("span",{className:"mt-1 inline-block text-xs text-text-muted bg-bg-hover px-1.5 py-0.5 rounded",children:"auto"})]},h.id))})]}):u.jsx("div",{className:"p-4 text-sm text-text-muted text-center",children:"Select a workflow to view versions"})}const gee=E.memo(mee);function yee(){const[e,t]=E.useState("properties"),n=_r(f=>f.nodes),r=E.useMemo(()=>n.filter(f=>f.selected),[n]),s=en(f=>f.currentWorkflow),i=en(f=>f.selectedWorkflow),{propertiesPanelOpen:a,setPropertiesPanelOpen:c,breakpoint:d}=Yf();return d==="mobile"?a?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:()=>c(!1)}),u.jsx("div",{className:"fixed inset-y-0 right-0 w-80 max-w-[85vw] bg-bg-panel border-l border-border-default flex flex-col z-50 animate-slide-in-right",children:u.jsx(WT,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,selectedWorkflow:i,onClose:()=>c(!1),showClose:!0})})]}):null:a?u.jsx("div",{className:"w-80 bg-bg-panel border-l border-border-default flex flex-col transition-all duration-300",children:u.jsx(WT,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,selectedWorkflow:i,onClose:()=>c(!1),showClose:d==="tablet"})}):u.jsxs("button",{onClick:()=>c(!0),className:"w-10 bg-bg-panel border-l border-border-default flex flex-col items-center py-4 gap-4 hover:bg-bg-hover transition-colors","aria-label":"Expand properties panel",children:[u.jsx(JM,{className:"w-4 h-4 text-text-secondary"}),u.jsx(Ko,{className:"w-5 h-5 text-text-secondary"})]})}function WT({activeTab:e,setActiveTab:t,selectedNodes:n,workflow:r,selectedWorkflow:s,onClose:i,showClose:a}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border-default",children:[u.jsx("h2",{className:"text-sm font-medium text-text-primary",children:"Properties"}),a&&u.jsx("button",{onClick:i,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Close properties panel",children:u.jsx(Zn,{className:"w-4 h-4 text-text-secondary"})})]}),u.jsxs("div",{className:"flex border-b border-border-default",children:[u.jsx(Zu,{active:e==="properties",onClick:()=>t("properties"),icon:u.jsx(Ko,{className:"w-4 h-4"}),label:"Properties"}),u.jsx(Zu,{active:e==="variables",onClick:()=>t("variables"),icon:u.jsx(ec,{className:"w-4 h-4"}),label:"Variables"}),u.jsx(Zu,{active:e==="history",onClick:()=>t("history"),icon:u.jsx(sf,{className:"w-4 h-4"}),label:"History"}),u.jsx(Zu,{active:e==="versions",onClick:()=>t("versions"),icon:u.jsx(Td,{className:"w-4 h-4"}),label:"Versions"})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="properties"&&u.jsx(xee,{selectedNodes:n,workflow:r}),e==="variables"&&u.jsx(vee,{workflow:r}),e==="history"&&u.jsx(bee,{}),e==="versions"&&u.jsx(gee,{workflowPath:s})]})]})}function Zu({active:e,onClick:t,icon:n,label:r}){return u.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-accent border-b-2 border-accent -mb-px":"text-text-secondary hover:text-text-primary"}`,children:[n,r]})}function xee({selectedNodes:e,workflow:t}){var n,r,s,i,a,c,d,f,p,h,g,y,w,b,v;if(e.length===0)return u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsx(Co,{title:"Workflow",children:t?u.jsxs("div",{className:"space-y-3",children:[u.jsx(Ps,{label:"Name",value:((n=t.metadata)==null?void 0:n.name)||"Untitled"}),u.jsx(Ps,{label:"Version",value:((r=t.metadata)==null?void 0:r.version)||"1.0.0"}),u.jsx(Ps,{label:"Author",value:((s=t.metadata)==null?void 0:s.author)||"Unknown"}),u.jsx(Ps,{label:"Steps",value:`${((i=t.steps)==null?void 0:i.length)||0} steps`})]}):u.jsx("div",{className:"text-sm text-text-muted",children:"No workflow loaded"})}),((a=t==null?void 0:t.metadata)==null?void 0:a.description)&&u.jsx(Co,{title:"Description",children:u.jsx("p",{className:"text-sm text-text-primary",children:t.metadata.description})}),((c=t==null?void 0:t.metadata)==null?void 0:c.tags)&&t.metadata.tags.length>0&&u.jsx(Co,{title:"Tags",children:u.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.metadata.tags.map(N=>u.jsx("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-full",children:N},N))})})]});if(e.length===1){const N=e[0];return u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsx(Co,{title:"Step",children:u.jsxs("div",{className:"space-y-3",children:[u.jsx(Ps,{label:"ID",value:((d=N.data)==null?void 0:d.id)||N.id}),u.jsx(Ps,{label:"Name",value:((f=N.data)==null?void 0:f.name)||"(unnamed)"}),u.jsx(Ps,{label:"Action",value:((p=N.data)==null?void 0:p.action)||((h=N.data)==null?void 0:h.workflowPath)||"-"}),u.jsx(Ps,{label:"Status",value:((g=N.data)==null?void 0:g.status)||"pending",badge:!0,badgeColor:((y=N.data)==null?void 0:y.status)==="completed"?"success":((w=N.data)==null?void 0:w.status)==="failed"?"error":((b=N.data)==null?void 0:b.status)==="running"?"warning":"default"})]})}),((v=N.data)==null?void 0:v.error)&&u.jsx(Co,{title:"Error",children:u.jsx("div",{className:"p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono",children:N.data.error})}),u.jsx(Co,{title:"Actions",children:u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{className:"flex-1 px-3 py-1.5 bg-bg-surface border border-border-default rounded text-xs text-text-primary hover:border-accent transition-colors",children:"Edit"}),u.jsx("button",{className:"flex-1 px-3 py-1.5 bg-bg-surface border border-border-default rounded text-xs text-text-primary hover:border-accent transition-colors",children:"View YAML"})]})})]})}return u.jsx("div",{className:"p-4",children:u.jsxs("div",{className:"text-sm text-text-secondary",children:[e.length," nodes selected"]})})}function vee({workflow:e}){const t=E.useMemo(()=>{const n=[];return e!=null&&e.inputs&&Object.entries(e.inputs).forEach(([r,s])=>{n.push({name:`inputs.${r}`,value:s.default!==void 0?String(s.default):"(no default)",type:s.type||"string",source:"input"})}),e!=null&&e.steps&&e.steps.forEach(r=>{r.outputVariable&&n.push({name:r.outputVariable,value:`Output from step: ${r.name||r.id}`,type:"any",source:"output"})}),n},[e]);return t.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[u.jsx(ec,{className:"w-12 h-12 text-text-muted mb-3"}),u.jsx("p",{className:"text-sm text-text-secondary mb-1",children:"No variables yet"}),u.jsx("p",{className:"text-xs text-text-muted",children:"Define workflow inputs or add output variables to steps"})]}):u.jsx("div",{className:"p-4 space-y-2",children:t.map(n=>u.jsxs("div",{className:"p-3 bg-bg-surface rounded-lg border border-border-default",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs font-mono text-primary",children:n.name}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-bg-hover text-text-secondary",children:n.source==="input"?"input":"output"}),u.jsx("span",{className:"text-xs text-text-muted",children:n.type})]})]}),u.jsx("div",{className:"text-sm text-text-primary font-mono truncate",title:n.value,children:n.value})]},n.name))})}function bee(){const{runs:e,clearHistory:t}=H3(),[n,r]=E.useState(null);return n?u.jsx(wee,{run:n,onBack:()=>r(null)}):e.length===0?u.jsxs("div",{className:"p-4 text-center",children:[u.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-bg-surface flex items-center justify-center",children:u.jsx(sf,{className:"w-6 h-6 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary mb-1",children:"No execution history"}),u.jsx("p",{className:"text-xs text-text-muted",children:"Run a workflow to see execution history here"})]}):u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map(s=>u.jsxs("button",{onClick:()=>r(s),className:"w-full p-3 bg-bg-surface rounded-lg border border-border-default cursor-pointer hover:border-accent transition-colors text-left",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs font-medium text-white truncate max-w-[140px]",children:s.workflowName}),u.jsx(U3,{status:s.status})]}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-text-secondary",children:[u.jsx("span",{children:s.duration?Rb(s.duration):"-"}),u.jsx("span",{children:hee(s.startTime)})]}),s.steps.length>0&&u.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[s.steps.slice(0,5).map(i=>u.jsx(kee,{status:i.status},i.stepId)),s.steps.length>5&&u.jsxs("span",{className:"text-xs text-text-muted",children:["+",s.steps.length-5]})]})]},s.id))}),e.length>0&&u.jsx("div",{className:"p-3 border-t border-border-default",children:u.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-xs text-text-secondary hover:text-error transition-colors",children:[u.jsx(ea,{className:"w-3.5 h-3.5"}),"Clear History"]})})]})}function wee({run:e,onBack:t}){const[n,r]=E.useState(!1);return u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"p-3 border-b border-border-default",children:[u.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-text-secondary hover:text-text-primary mb-2",children:[u.jsx(It,{className:"w-3 h-3 rotate-180"}),"Back to history"]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm font-medium text-white truncate max-w-[180px]",children:e.workflowName}),u.jsx(U3,{status:e.status})]}),u.jsxs("div",{className:"flex items-center justify-between mt-1 text-xs text-text-secondary",children:[u.jsx("span",{children:e.duration?Rb(e.duration):"Running..."}),u.jsx("span",{children:new Date(e.startTime).toLocaleString()})]})]}),u.jsxs("div",{className:"flex border-b border-border-default",children:[u.jsxs("button",{onClick:()=>r(!1),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-text-secondary hover:text-text-primary":"text-primary border-b-2 border-primary -mb-px"}`,children:["Steps (",e.steps.length,")"]}),u.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-text-secondary hover:text-text-primary"}`,children:["Logs (",e.logs.length,")"]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?u.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.logs.map((s,i)=>u.jsx("div",{className:"text-text-primary break-words",children:s},i))}):u.jsx("div",{className:"space-y-2",children:e.steps.map(s=>u.jsxs("div",{className:"p-2 bg-bg-surface rounded border border-border-default",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-xs font-medium text-white truncate",children:s.stepName}),u.jsx(Nee,{status:s.status})]}),s.duration&&u.jsx("div",{className:"text-xs text-text-muted mt-1",children:Rb(s.duration)}),s.error&&u.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 U3({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning",icon:Cr},completed:{bg:"bg-success/10",text:"text-success",icon:Mt},failed:{bg:"bg-error/10",text:"text-error",icon:rt},cancelled:{bg:"bg-gray-500/10",text:"text-text-secondary",icon:rt},pending:{bg:"bg-gray-500/10",text:"text-text-secondary",icon:Ht}},{bg:n,text:r,icon:s}=t[e]||t.pending;return u.jsxs("span",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${n} ${r}`,children:[u.jsx(s,{className:`w-3 h-3 ${e==="running"?"animate-spin":""}`}),e]})}function Nee({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-text-secondary"}},{bg:n,text:r}=t[e]||t.pending;return u.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n} ${r}`,children:e})}function kee({status:e}){const t={running:"bg-warning",completed:"bg-success",failed:"bg-error",pending:"bg-gray-500"};return u.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]||t.pending} ${e==="running"?"animate-pulse":""}`,title:e})}function Co({title:e,children:t}){return u.jsxs("div",{children:[u.jsx("h3",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:e}),t]})}function Ps({label:e,value:t,badge:n,badgeColor:r="default"}){const s={default:"bg-gray-500/10 text-text-secondary",success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning"};return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-xs text-text-secondary",children:e}),n?u.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s[r]}`,children:t}):u.jsx("span",{className:"text-sm text-text-primary font-mono truncate max-w-[180px]",children:t})]})}function See(e){if(!e)return[];const t=[],n=/```yaml\s*\n([\s\S]*?)\n```/g;let r,s=0;for(;(r=n.exec(e))!==null;){const i=r[1];try{const a=HP(i);if(a&&a.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(a.type)){const c=a.id||`control-flow-${a.type}-${s++}`,d={...a,id:c,inputs:a.inputs||{}};t.push(d)}}catch(a){console.warn("Failed to parse control flow YAML block:",a)}}return t}function W3(e){const t=[],n=[],i=See(e.markdown),a=[...e.steps,...i],c=(g,y,w,b)=>{let v=w,N=null;return g.forEach((S,k)=>{var B,M,P,H,D;S.id||(S.id=b?`${b}-step-${k}`:`step-${Date.now()}-${k}`);const _=!!S.workflow,A=!!S.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(S.type);let I="step";_?I="subworkflow":A&&(I=S.type);const T={id:S.id,name:S.name,action:S.action,workflowPath:S.workflow,status:"pending"};let O={...T};if(S.type==="while")O={...T,condition:S.condition||"true",maxIterations:S.maxIterations||100,variables:S.variables};else if(S.type==="for_each"||S.type==="for"){const z=S.items||"[]";O={...T,items:z==="unknown"?"[]":z,itemVariable:(B=S.inputs)==null?void 0:B.itemVariable}}else if(S.type==="switch")O={...T,expression:((M=S.inputs)==null?void 0:M.expression)||S.condition||"",cases:{},hasDefault:!0};else if(S.type==="parallel")O={...T,branches:[],maxConcurrent:0};else if(S.type==="try")O={...T,hasCatch:!0,hasFinally:!1};else if(S.type==="if")O={...T,condition:S.condition||"true",hasElse:!0};else if(S.type==="map"||S.type==="filter"||S.type==="reduce"){const z=S.items||((P=S.inputs)==null?void 0:P.items)||"[]";O={...T,transformType:S.type,items:z==="unknown"?"[]":z,itemVariable:(H=S.inputs)==null?void 0:H.itemVariable,expression:(D=S.inputs)==null?void 0:D.expression,condition:S.condition}}else O={...T,condition:S.condition,items:S.items,maxIterations:S.maxIterations,variables:S.variables};const L={id:S.id,type:I,position:{x:y,y:v},data:O};if(t.push(L),N){const z={id:`e-${N}-${S.id}`,source:N,target:S.id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}};S.conditions&&S.conditions.length>0&&(z.label="conditional",z.labelStyle={fill:"#a0a0c0",fontSize:10},z.labelBgStyle={fill:"#232340"}),n.push(z)}if((S.type==="while"||S.type==="for_each"||S.type==="for")&&S.steps&&S.steps.length>0){const z=y+350,V=v+20,{lastNodeId:G,endY:q}=c(S.steps,z,V,S.id),F=S.type==="while"?"#fb923c":"#f093fb";n.push({id:`e-${S.id}-body-start`,source:S.id,target:S.steps[0].id,sourceHandle:"body",type:"smoothstep",animated:!0,style:{stroke:F,strokeWidth:2},label:S.type==="while"?"do":"each",labelStyle:{fill:F,fontSize:10},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}}),G&&n.push({id:`e-${G}-${S.id}-loop-back`,source:G,target:S.id,targetHandle:"loop-back",type:"smoothstep",animated:!0,style:{stroke:F,strokeWidth:2,strokeDasharray:"5,5"}}),v=Math.max(v+180,q)}else v+=180;N=S.id}),{lastNodeId:N,endY:v}};let d=0,f=null;if(e.triggers&&e.triggers.length>0){const g=e.triggers[0];f=`trigger-${e.metadata.id}`,t.push({id:f,type:"trigger",position:{x:250,y:d},data:{id:f,name:e.metadata.name,type:g.type||"manual",cron:g.cron,path:g.path,events:g.events,active:!0}}),d+=180}const{lastNodeId:p,endY:h}=c(a,250,d);if(f&&a.length>0&&n.push({id:`e-${f}-${a[0].id}`,source:f,target:a[0].id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}}),a.length>0){const g=`output-${e.metadata.id}`,y=N=>{let S=[];return N.forEach(k=>{S.push(k),k.steps&&(S=S.concat(y(k.steps)))}),S},w=y(a),b=w.filter(N=>N.outputVariable).map(N=>N.outputVariable);t.push({id:g,type:"output",position:{x:250,y:h},data:{id:g,name:"Workflow Output",variables:b,status:"pending"}}),p&&n.push({id:`e-${p}-${g}`,source:p,target:g,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}});const v=Cee(w);n.push(...v)}return{nodes:t,edges:n}}function Cee(e){const t=[],n=new Map;return e.forEach(r=>{r.outputVariable&&n.set(r.outputVariable,r.id)}),e.forEach(r=>{_ee(r.inputs).forEach(i=>{const a=i.split(".")[0],c=n.get(a);if(c&&c!==r.id){const d=`data-${c}-${r.id}-${a}`;t.find(f=>f.id===d)||t.push({id:d,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 _ee(e){const t=[];if(!e)return t;const n=/\{\{\s*([^}]+)\s*\}\}/g;function r(s){if(typeof s=="string"){let i;for(;(i=n.exec(s))!==null;){const c=i[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}const b1=xn((e,t)=>({isProcessing:!1,history:[],lastError:null,pendingChanges:null,sendPrompt:async n=>{e({isProcessing:!0,lastError:null});const r=en.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 i=await s.json(),a={prompt:n,response:i.explanation,timestamp:new Date,success:!0};e({history:[a,...t().history].slice(0,20),pendingChanges:i.workflow,isProcessing:!1}),i.workflow&&t().acceptChanges()}catch(s){const i=s instanceof Error?s.message:"Unknown error";e({history:[{prompt:n,response:i,timestamp:new Date,success:!1},...t().history].slice(0,20),lastError:i,isProcessing:!1}),console.log("AI Prompt (demo mode):",n),console.log("Current workflow:",r)}},acceptChanges:()=>{const n=t().pendingChanges;if(!n)return;en.getState().saveWorkflow(n);const{nodes:r,edges:s}=W3(n);_r.getState().setNodes(r),_r.getState().setEdges(s),e({pendingChanges:null})},rejectChanges:()=>{e({pendingChanges:null})},clearHistory:()=>{e({history:[]})}}));function Eee({onSelectPrompt:e}){const[t,n]=E.useState(!1),[r,s]=E.useState(null),[i,a]=E.useState(null),{history:c,clearHistory:d,sendPrompt:f,isProcessing:p}=b1(),h=async w=>{p||await f(w)},g=async(w,b)=>{try{await navigator.clipboard.writeText(w),a(b),setTimeout(()=>a(null),2e3)}catch(v){console.error("Failed to copy:",v)}},y=w=>{const v=new Date().getTime()-new Date(w).getTime();return v<6e4?"Just now":v<36e5?`${Math.floor(v/6e4)}m ago`:v<864e5?`${Math.floor(v/36e5)}h ago`:new Date(w).toLocaleDateString()};return c.length===0?null:u.jsxs("div",{className:"border-t border-node-border",children:[u.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:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(sf,{className:"w-4 h-4 text-gray-400"}),u.jsx("span",{className:"text-sm text-gray-300",children:"Prompt History"}),u.jsxs("span",{className:"text-xs text-gray-500",children:["(",c.length,")"]})]}),t?u.jsx(Sr,{className:"w-4 h-4 text-gray-400"}):u.jsx(Sz,{className:"w-4 h-4 text-gray-400"})]}),t&&u.jsxs("div",{className:"bg-panel-bg",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-node-border",children:[u.jsxs("span",{className:"text-xs text-gray-500",children:[c.filter(w=>w.success).length," successful,"," ",c.filter(w=>!w.success).length," failed"]}),u.jsx(De,{variant:"ghost",size:"sm",onClick:d,icon:u.jsx(ea,{className:"w-3 h-3"}),children:"Clear"})]}),u.jsx("div",{className:"max-h-64 overflow-y-auto",children:c.map((w,b)=>{const v=`${b}-${w.timestamp}`,N=r===w;return u.jsxs("div",{className:"border-b border-node-border last:border-b-0",children:[u.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 cursor-pointer transition-colors ${N?"bg-primary/10":"hover:bg-white/5"}`,onClick:()=>s(N?null:w),children:[w.success?u.jsx(Mt,{className:"w-4 h-4 text-success flex-shrink-0 mt-0.5"}):u.jsx(rt,{className:"w-4 h-4 text-error flex-shrink-0 mt-0.5"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm text-gray-300 line-clamp-2",children:w.prompt}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx(Ht,{className:"w-3 h-3 text-gray-500"}),u.jsx("span",{className:"text-xs text-gray-500",children:y(w.timestamp)})]})]}),u.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[u.jsx("button",{onClick:S=>{S.stopPropagation(),g(w.prompt,v)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy prompt",children:i===v?u.jsx(Vs,{className:"w-3.5 h-3.5 text-success"}):u.jsx(ji,{className:"w-3.5 h-3.5 text-gray-400"})}),u.jsx("button",{onClick:S=>{S.stopPropagation(),h(w.prompt)},disabled:p,className:"p-1.5 hover:bg-white/10 rounded transition-colors disabled:opacity-50",title:"Re-run prompt",children:u.jsx(t9,{className:`w-3.5 h-3.5 text-gray-400 ${p?"animate-spin":""}`})}),e&&u.jsx("button",{onClick:S=>{S.stopPropagation(),e(w.prompt)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Edit prompt",children:u.jsx("span",{className:"text-xs text-gray-400",children:"Edit"})})]})]}),N&&u.jsx("div",{className:"px-4 pb-3 pl-11",children:u.jsxs("div",{className:"bg-node-bg rounded-lg p-3",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase",children:"Response"}),u.jsx("button",{onClick:()=>g(w.response,`${v}-response`),className:"p-1 hover:bg-white/10 rounded transition-colors",children:i===`${v}-response`?u.jsx(Vs,{className:"w-3 h-3 text-success"}):u.jsx(ji,{className:"w-3 h-3 text-gray-400"})})]}),u.jsx("div",{className:`text-xs font-mono ${w.success?"text-gray-300":"text-error"}`,children:w.response||"No response"})]})})]},v)})})]})]})}function jee(){const[e,t]=E.useState(""),n=E.useRef(null),{isProcessing:r,history:s,sendPrompt:i}=b1(),a=tc();E.useEffect(()=>{n.current&&(n.current.style.height="auto",n.current.style.height=`${Math.min(n.current.scrollHeight,200)}px`)},[e]);const c=async()=>{!e.trim()||r||(await i(e),t(""))},d=p=>{p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),c()),p.key==="ArrowUp"&&!e&&s.length>0&&t(s[0].prompt)},f=["Add a Slack notification step","Add error handling with 3 retries","Convert to a sub-workflow","Add a condition to skip if draft"];return u.jsxs("div",{className:"bg-bg-panel",children:[u.jsx(Eee,{onSelectPrompt:t}),!e&&!r&&u.jsx("div",{className:"px-4 py-2 border-t border-border-default/50",children:u.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",children:[u.jsx(dR,{className:"w-4 h-4 text-primary flex-shrink-0"}),f.map(p=>u.jsx("button",{onClick:()=>t(p),className:"px-3 py-1 bg-bg-surface border border-border-default rounded-full text-xs text-text-primary hover:border-accent hover:text-accent transition-colors whitespace-nowrap",children:p},p))]})}),u.jsxs("div",{className:"p-4 flex items-end gap-3 border-t border-border-default",children:[u.jsxs("div",{className:"flex-1 relative",children:[u.jsx("textarea",{ref:n,value:e,onChange:p=>t(p.target.value),onKeyDown:d,placeholder:"Describe the changes you want to make to the workflow...",disabled:r,rows:1,className:"w-full px-4 py-3 bg-bg-surface border border-border-default rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/50 resize-none disabled:opacity-50"}),r&&u.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:u.jsx(Cr,{className:"w-5 h-5 text-primary animate-spin"})})]}),u.jsx("button",{onClick:c,disabled:!e.trim()||r,className:"w-10 h-10 rounded-lg bg-primary hover:bg-primary-dark disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-colors",children:u.jsx(lR,{className:"w-5 h-5 text-text-primary"})})]}),u.jsxs("div",{className:"px-4 pb-2 text-xs text-text-muted",children:["Press ",u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:a})," +"," ",u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:"Enter"})," to send",s.length>0&&u.jsxs("span",{className:"ml-4",children:[u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:"↑"})," for last prompt"]})]})]})}function Aee({open:e,onOpenChange:t,originalWorkflow:n,modifiedWorkflow:r,explanation:s,onAccept:i,onReject:a}){const[c,d]=E.useState("explanation"),f=n?Fd(n,{indent:2}):"",p=r?Fd(r,{indent:2}):"",h=()=>{i(),t(!1)},g=()=>{a(),t(!1)};return u.jsxs(rs,{open:e,onOpenChange:t,title:"Review Changes",description:"The AI has suggested the following changes to your workflow",size:"xl",children:[u.jsxs(JO,{value:c,onValueChange:d,children:[u.jsxs(Mw,{children:[u.jsxs(xr,{value:"explanation",children:[u.jsx(Mz,{className:"w-4 h-4 mr-1.5"}),"Explanation"]}),u.jsxs(xr,{value:"diff",children:[u.jsx(eR,{className:"w-4 h-4 mr-1.5"}),"Side by Side"]}),u.jsxs(xr,{value:"modified",children:[u.jsx(uw,{className:"w-4 h-4 mr-1.5"}),"Modified YAML"]})]}),u.jsxs("div",{className:"p-4",children:[u.jsx(vr,{value:"explanation",children:u.jsxs("div",{className:"prose prose-invert max-w-none",children:[u.jsx("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:u.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:s})}),r&&u.jsxs("div",{className:"mt-4",children:[u.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Changes Summary"}),u.jsx("ul",{className:"space-y-2",children:Tee(n,r).map((y,w)=>u.jsxs("li",{className:`flex items-start gap-2 text-sm ${y.type==="added"?"text-success":y.type==="removed"?"text-error":"text-warning"}`,children:[u.jsx("span",{className:"flex-shrink-0",children:y.type==="added"?"+":y.type==="removed"?"-":"~"}),u.jsx("span",{children:y.description})]},w))})]})]})}),u.jsx(vr,{value:"diff",children:u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Original"}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(wl,{height:"400px",language:"yaml",value:f,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Modified"}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(wl,{height:"400px",language:"yaml",value:p,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]})]})}),u.jsx(vr,{value:"modified",children:u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(wl,{height:"500px",language:"yaml",value:p,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1}})})})]})]}),u.jsxs(Mi,{children:[u.jsx(De,{variant:"secondary",onClick:g,icon:u.jsx(Zn,{className:"w-4 h-4"}),children:"Reject"}),u.jsx(De,{onClick:h,icon:u.jsx(Vs,{className:"w-4 h-4"}),children:"Accept Changes"})]})]})}function Tee(e,t){const n=[];if(!e||!t)return n;const r=new Set(e.steps.map(i=>i.id)),s=new Set(t.steps.map(i=>i.id));for(const i of t.steps)r.has(i.id)||n.push({type:"added",description:`Added step "${i.name||i.id}"`});for(const i of e.steps)s.has(i.id)||n.push({type:"removed",description:`Removed step "${i.name||i.id}"`});for(const i of t.steps)if(r.has(i.id)){const a=e.steps.find(c=>c.id===i.id);if(a&&JSON.stringify(a)!==JSON.stringify(i)){const c=[];a.action!==i.action&&c.push("action"),JSON.stringify(a.inputs)!==JSON.stringify(i.inputs)&&c.push("inputs"),JSON.stringify(a.errorHandling)!==JSON.stringify(i.errorHandling)&&c.push("error handling"),JSON.stringify(a.conditions)!==JSON.stringify(i.conditions)&&c.push("conditions"),c.length>0&&n.push({type:"modified",description:`Modified "${i.name||i.id}": ${c.join(", ")}`})}}return e.metadata.name!==t.metadata.name&&n.push({type:"modified",description:`Renamed workflow to "${t.metadata.name}"`}),n}const Yr={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"},ed={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"]},parallel:{name:"Parallel",icon:"parallel",methods:["spawn","map"]}};function Iee({open:e,onOpenChange:t,onCreateStep:n,position:r}){var L,B;const[s,i]=E.useState("select-type"),[a,c]=E.useState(""),[d,f]=E.useState("action"),[p,h]=E.useState(null),[g,y]=E.useState(null),[w,b]=E.useState({id:"",name:""}),v=()=>{i("select-type"),c(""),f("action"),h(null),y(null),b({id:"",name:""})},N=()=>{v(),t(!1)},S=M=>{f(M),i(M==="action"?"select-service":"configure")},k=M=>{h(M),i("select-method")},_=M=>{y(M);const P=ed[p];b({id:`${p}-${Date.now()}`,name:`${(P==null?void 0:P.name)||p} - ${M}`}),i("configure")},A=()=>{const M={id:w.id||`step-${Date.now()}`,name:w.name||void 0,inputs:{}};d==="action"&&p&&g&&(M.action=`${p}.${g}`),n(M),N()},I=Object.entries(ed).filter(([M,P])=>P.name.toLowerCase().includes(a.toLowerCase())||M.toLowerCase().includes(a.toLowerCase())),O=(p?((L=ed[p])==null?void 0:L.methods)||[]:[]).filter(M=>M.toLowerCase().includes(a.toLowerCase()));return u.jsxs(rs,{open:e,onOpenChange:N,title:"Add New Step",description:Mee(s),size:"lg",children:[u.jsxs("div",{className:"p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[u.jsx("button",{onClick:()=>i("select-type"),className:`${s==="select-type"?"text-primary":"text-gray-400 hover:text-white"}`,children:"Type"}),d==="action"&&u.jsxs(u.Fragment,{children:[u.jsx(It,{className:"w-4 h-4 text-gray-600"}),u.jsx("button",{onClick:()=>p&&i("select-service"),className:`${s==="select-service"?"text-primary":p?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!p,children:"Service"}),u.jsx(It,{className:"w-4 h-4 text-gray-600"}),u.jsx("button",{onClick:()=>g&&i("select-method"),className:`${s==="select-method"?"text-primary":g?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!g,children:"Method"})]}),u.jsx(It,{className:"w-4 h-4 text-gray-600"}),u.jsx("span",{className:`${s==="configure"?"text-primary":"text-gray-600"}`,children:"Configure"})]}),s==="select-type"&&u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("button",{onClick:()=>S("action"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[u.jsx(Go,{className:"w-8 h-8 text-primary mb-3"}),u.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Action Step"}),u.jsx("p",{className:"text-sm text-gray-400",children:"Execute an action using a service SDK (Slack, GitHub, etc.)"})]}),u.jsxs("button",{onClick:()=>S("subworkflow"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-info transition-colors text-left",children:[u.jsx(Ol,{className:"w-8 h-8 text-info mb-3"}),u.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Sub-workflow"}),u.jsx("p",{className:"text-sm text-gray-400",children:"Reference another workflow file for modular composition"})]})]}),s==="select-service"&&u.jsxs("div",{children:[u.jsxs("div",{className:"relative mb-4",children:[u.jsx(Pl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),u.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search services...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),u.jsx("div",{className:"grid grid-cols-3 gap-3 max-h-[400px] overflow-y-auto",children:I.map(([M,P])=>{const H=hb(M);return u.jsxs("button",{onClick:()=>k(M),className:"flex flex-col items-center gap-2 p-4 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors",children:[u.jsx(H,{className:"w-8 h-8 text-primary"}),u.jsx("span",{className:"text-sm text-white",children:P.name})]},M)})})]}),s==="select-method"&&p&&u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[(()=>{const M=hb(p);return u.jsx(M,{className:"w-6 h-6 text-primary"})})(),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium text-white",children:(B=ed[p])==null?void 0:B.name}),u.jsx("div",{className:"text-xs text-gray-400",children:"Select a method"})]})]}),u.jsxs("div",{className:"relative mb-4",children:[u.jsx(Pl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),u.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search methods...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),u.jsx("div",{className:"space-y-2 max-h-[350px] overflow-y-auto",children:O.map(M=>u.jsxs("button",{onClick:()=>_(M),className:"w-full flex items-center justify-between px-4 py-3 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[u.jsx("span",{className:"text-sm font-mono text-white",children:M}),u.jsx(It,{className:"w-4 h-4 text-gray-500"})]},M))})]}),s==="configure"&&u.jsxs("div",{className:"space-y-4",children:[d==="action"&&p&&g&&u.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[u.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Action"}),u.jsxs("div",{className:"text-sm font-mono text-primary",children:[p,".",g]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step ID"}),u.jsx("input",{type:"text",value:w.id,onChange:M=>b(P=>({...P,id:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"unique-step-id"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name (optional)"}),u.jsx("input",{type:"text",value:w.name,onChange:M=>b(P=>({...P,name:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),r&&u.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"})]})]}),u.jsxs(Mi,{children:[s!=="select-type"&&u.jsx(De,{variant:"ghost",onClick:()=>{s==="select-service"?i("select-type"):s==="select-method"?i("select-service"):s==="configure"&&i(d==="action"?"select-method":"select-type"),c("")},children:"Back"}),u.jsx(De,{variant:"secondary",onClick:N,children:"Cancel"}),s==="configure"&&u.jsx(De,{onClick:A,disabled:!w.id,children:"Create Step"})]})]})}function Mee(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 KT=[{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:["⌘","K"],description:"Open command palette",category:"General"},{keys:["⌘","P"],description:"Quick workflow switcher",category:"General"},{keys:["⌘","⇧","T"],description:"Toggle theme",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 Ree({open:e,onOpenChange:t}){const n=[...new Set(KT.map(s=>s.category))],r=tc();return u.jsxs(rs,{open:e,onOpenChange:t,title:"Keyboard Shortcuts",description:"Quick reference for all keyboard shortcuts",size:"md",children:[u.jsx("div",{className:"p-4 space-y-6 max-h-[60vh] overflow-y-auto",children:n.map(s=>u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider mb-3",children:s}),u.jsx("div",{className:"space-y-2",children:KT.filter(i=>i.category===s).map((i,a)=>u.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-node-border last:border-0",children:[u.jsx("span",{className:"text-sm text-gray-300",children:i.description}),u.jsx("div",{className:"flex items-center gap-1",children:i.keys.map((c,d)=>u.jsx("kbd",{className:"px-2 py-1 bg-node-bg border border-node-border rounded text-xs font-mono text-gray-300",children:c==="⌘"?r:c},d))})]},a))})]},s))}),u.jsx(Mi,{children:u.jsx(De,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function Oee(){const[e,t]=E.useState(!1);return E.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 Pee({onClick:e}){const t=tc();return u.jsxs("button",{onClick:e,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-gray-500 hover:text-gray-300 transition-colors",title:`Keyboard shortcuts (${t}/)`,children:[u.jsx(Bz,{className:"w-3.5 h-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"Shortcuts"})]})}function Lee({showLabel:e=!1}){const{theme:t}=Fs(),{updateSetting:n}=rr(),r=()=>{n("general","theme",t==="dark"?"light":"dark")};return u.jsxs("button",{onClick:r,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"?u.jsx(Kz,{className:"w-4 h-4 text-gray-400"}):u.jsx(a9,{className:"w-4 h-4 text-yellow-500"}),e&&u.jsx("span",{className:"text-xs text-gray-400",children:t==="dark"?"Dark":"Light"})]})}function Dee({items:e,onNavigate:t}){return e.length<=1?null:u.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)=>u.jsxs("div",{className:"flex items-center",children:[r>0&&u.jsx(It,{className:"w-4 h-4 text-gray-600 mx-1"}),u.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&&u.jsx(qz,{className:"w-3.5 h-3.5"}),u.jsx("span",{className:"max-w-[150px] truncate",children:n.name})]})]},n.id))})}function ss(e){return Array.isArray?Array.isArray(e):Y3(e)==="[object Array]"}function $ee(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Fee(e){return e==null?"":$ee(e)}function Nr(e){return typeof e=="string"}function K3(e){return typeof e=="number"}function qee(e){return e===!0||e===!1||Bee(e)&&Y3(e)=="[object Boolean]"}function G3(e){return typeof e=="object"}function Bee(e){return G3(e)&&e!==null}function pn(e){return e!=null}function U0(e){return!e.trim().length}function Y3(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const zee="Incorrect 'index' type",Vee=e=>`Invalid value for key ${e}`,Hee=e=>`Pattern length exceeds max of ${e}.`,Uee=e=>`Missing ${e} property in key`,Wee=e=>`Property 'weight' in key '${e}' must be a positive integer`,GT=Object.prototype.hasOwnProperty;class Kee{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let s=X3(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function X3(e){let t=null,n=null,r=null,s=1,i=null;if(Nr(e)||ss(e))r=e,t=YT(e),n=Ob(e);else{if(!GT.call(e,"name"))throw new Error(Uee("name"));const a=e.name;if(r=a,GT.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(Wee(a));t=YT(a),n=Ob(a),i=e.getFn}return{path:t,id:n,weight:s,src:r,getFn:i}}function YT(e){return ss(e)?e:e.split(".")}function Ob(e){return ss(e)?e.join("."):e}function Gee(e,t){let n=[],r=!1;const s=(i,a,c)=>{if(pn(i))if(!a[c])n.push(i);else{let d=a[c];const f=i[d];if(!pn(f))return;if(c===a.length-1&&(Nr(f)||K3(f)||qee(f)))n.push(Fee(f));else if(ss(f)){r=!0;for(let p=0,h=f.length;p<h;p+=1)s(f[p],a,c+1)}else a.length&&s(f,a,c+1)}};return s(e,Nr(t)?t.split("."):t,0),r?n:n[0]}const Yee={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Xee={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Qee={location:0,threshold:.6,distance:100},Jee={useExtendedSearch:!1,getFn:Gee,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Ie={...Xee,...Yee,...Qee,...Jee};const Zee=/[^ ]+/g;function ete(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){const i=s.match(Zee).length;if(n.has(i))return n.get(i);const a=1/Math.pow(i,.5*e),c=parseFloat(Math.round(a*r)/r);return n.set(i,c),c},clear(){n.clear()}}}class w1{constructor({getFn:t=Ie.getFn,fieldNormWeight:n=Ie.fieldNormWeight}={}){this.norm=ete(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Nr(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Nr(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!pn(t)||U0(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((s,i)=>{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(pn(a)){if(ss(a)){let c=[];const d=[{nestedArrIndex:-1,value:a}];for(;d.length;){const{nestedArrIndex:f,value:p}=d.pop();if(pn(p))if(Nr(p)&&!U0(p)){let h={v:p,i:f,n:this.norm.get(p)};c.push(h)}else ss(p)&&p.forEach((h,g)=>{d.push({nestedArrIndex:g,value:h})})}r.$[i]=c}else if(Nr(a)&&!U0(a)){let c={v:a,n:this.norm.get(a)};r.$[i]=c}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Q3(e,t,{getFn:n=Ie.getFn,fieldNormWeight:r=Ie.fieldNormWeight}={}){const s=new w1({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(X3)),s.setSources(t),s.create(),s}function tte(e,{getFn:t=Ie.getFn,fieldNormWeight:n=Ie.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new w1({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function td(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:s=Ie.distance,ignoreLocation:i=Ie.ignoreLocation}={}){const a=t/e.length;if(i)return a;const c=Math.abs(r-n);return s?a+c/s:c?1:a}function nte(e=[],t=Ie.minMatchCharLength){let n=[],r=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){let c=e[i];c&&r===-1?r=i:!c&&r!==-1&&(s=i-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}const yi=32;function rte(e,t,n,{location:r=Ie.location,distance:s=Ie.distance,threshold:i=Ie.threshold,findAllMatches:a=Ie.findAllMatches,minMatchCharLength:c=Ie.minMatchCharLength,includeMatches:d=Ie.includeMatches,ignoreLocation:f=Ie.ignoreLocation}={}){if(t.length>yi)throw new Error(Hee(yi));const p=t.length,h=e.length,g=Math.max(0,Math.min(r,h));let y=i,w=g;const b=c>1||d,v=b?Array(h):[];let N;for(;(N=e.indexOf(t,w))>-1;){let T=td(t,{currentLocation:N,expectedLocation:g,distance:s,ignoreLocation:f});if(y=Math.min(T,y),w=N+p,b){let O=0;for(;O<p;)v[N+O]=1,O+=1}}w=-1;let S=[],k=1,_=p+h;const A=1<<p-1;for(let T=0;T<p;T+=1){let O=0,L=_;for(;O<L;)td(t,{errors:T,currentLocation:g+L,expectedLocation:g,distance:s,ignoreLocation:f})<=y?O=L:_=L,L=Math.floor((_-O)/2+O);_=L;let B=Math.max(1,g-L+1),M=a?h:Math.min(g+L,h)+p,P=Array(M+2);P[M+1]=(1<<T)-1;for(let D=M;D>=B;D-=1){let z=D-1,V=n[e.charAt(z)];if(b&&(v[z]=+!!V),P[D]=(P[D+1]<<1|1)&V,T&&(P[D]|=(S[D+1]|S[D])<<1|1|S[D+1]),P[D]&A&&(k=td(t,{errors:T,currentLocation:z,expectedLocation:g,distance:s,ignoreLocation:f}),k<=y)){if(y=k,w=z,w<=g)break;B=Math.max(1,2*g-w)}}if(td(t,{errors:T+1,currentLocation:g,expectedLocation:g,distance:s,ignoreLocation:f})>y)break;S=P}const I={isMatch:w>=0,score:Math.max(.001,k)};if(b){const T=nte(v,c);T.length?d&&(I.indices=T):I.isMatch=!1}return I}function ste(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}const Hd=String.prototype.normalize?(e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(e=>e);class J3{constructor(t,{location:n=Ie.location,threshold:r=Ie.threshold,distance:s=Ie.distance,includeMatches:i=Ie.includeMatches,findAllMatches:a=Ie.findAllMatches,minMatchCharLength:c=Ie.minMatchCharLength,isCaseSensitive:d=Ie.isCaseSensitive,ignoreDiacritics:f=Ie.ignoreDiacritics,ignoreLocation:p=Ie.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:i,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:p},t=d?t:t.toLowerCase(),t=f?Hd(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const h=(y,w)=>{this.chunks.push({pattern:y,alphabet:ste(y),startIndex:w})},g=this.pattern.length;if(g>yi){let y=0;const w=g%yi,b=g-w;for(;y<b;)h(this.pattern.substr(y,yi),y),y+=yi;if(w){const v=g-yi;h(this.pattern.substr(v),v)}}else h(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(t=n?t:t.toLowerCase(),t=r?Hd(t):t,this.pattern===t){let b={isMatch:!0,score:0};return s&&(b.indices=[[0,t.length-1]]),b}const{location:i,distance:a,threshold:c,findAllMatches:d,minMatchCharLength:f,ignoreLocation:p}=this.options;let h=[],g=0,y=!1;this.chunks.forEach(({pattern:b,alphabet:v,startIndex:N})=>{const{isMatch:S,score:k,indices:_}=rte(t,b,v,{location:i+N,distance:a,threshold:c,findAllMatches:d,minMatchCharLength:f,includeMatches:s,ignoreLocation:p});S&&(y=!0),g+=k,S&&_&&(h=[...h,..._])});let w={isMatch:y,score:y?g/this.chunks.length:1};return y&&s&&(w.indices=h),w}}class Ys{constructor(t){this.pattern=t}static isMultiMatch(t){return XT(t,this.multiRegex)}static isSingleMatch(t){return XT(t,this.singleRegex)}search(){}}function XT(e,t){const n=e.match(t);return n?n[1]:null}class ite extends Ys{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class ote extends Ys{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class ate extends Ys{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class lte extends Ys{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class cte extends Ys{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class ute extends Ys{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Z3 extends Ys{constructor(t,{location:n=Ie.location,threshold:r=Ie.threshold,distance:s=Ie.distance,includeMatches:i=Ie.includeMatches,findAllMatches:a=Ie.findAllMatches,minMatchCharLength:c=Ie.minMatchCharLength,isCaseSensitive:d=Ie.isCaseSensitive,ignoreDiacritics:f=Ie.ignoreDiacritics,ignoreLocation:p=Ie.ignoreLocation}={}){super(t),this._bitapSearch=new J3(t,{location:n,threshold:r,distance:s,includeMatches:i,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:p})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class eL extends Ys{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const s=[],i=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+i,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const Pb=[ite,eL,ate,lte,ute,cte,ote,Z3],QT=Pb.length,dte=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fte="|";function hte(e,t={}){return e.split(fte).map(n=>{let r=n.trim().split(dte).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=r.length;i<a;i+=1){const c=r[i];let d=!1,f=-1;for(;!d&&++f<QT;){const p=Pb[f];let h=p.isMultiMatch(c);h&&(s.push(new p(h,t)),d=!0)}if(!d)for(f=-1;++f<QT;){const p=Pb[f];let h=p.isSingleMatch(c);if(h){s.push(new p(h,t));break}}}return s})}const pte=new Set([Z3.type,eL.type]);class mte{constructor(t,{isCaseSensitive:n=Ie.isCaseSensitive,ignoreDiacritics:r=Ie.ignoreDiacritics,includeMatches:s=Ie.includeMatches,minMatchCharLength:i=Ie.minMatchCharLength,ignoreLocation:a=Ie.ignoreLocation,findAllMatches:c=Ie.findAllMatches,location:d=Ie.location,threshold:f=Ie.threshold,distance:p=Ie.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:i,findAllMatches:c,ignoreLocation:a,location:d,threshold:f,distance:p},t=n?t:t.toLowerCase(),t=r?Hd(t):t,this.pattern=t,this.query=hte(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:s,ignoreDiacritics:i}=this.options;t=s?t:t.toLowerCase(),t=i?Hd(t):t;let a=0,c=[],d=0;for(let f=0,p=n.length;f<p;f+=1){const h=n[f];c.length=0,a=0;for(let g=0,y=h.length;g<y;g+=1){const w=h[g],{isMatch:b,indices:v,score:N}=w.search(t);if(b){if(a+=1,d+=N,r){const S=w.constructor.type;pte.has(S)?c=[...c,...v]:c.push(v)}}else{d=0,a=0,c.length=0;break}}if(a){let g={isMatch:!0,score:d/a};return r&&(g.indices=c),g}}return{isMatch:!1,score:1}}}const Lb=[];function gte(...e){Lb.push(...e)}function Db(e,t){for(let n=0,r=Lb.length;n<r;n+=1){let s=Lb[n];if(s.condition(e,t))return new s(e,t)}return new J3(e,t)}const Ud={AND:"$and",OR:"$or"},$b={PATH:"$path",PATTERN:"$val"},Fb=e=>!!(e[Ud.AND]||e[Ud.OR]),yte=e=>!!e[$b.PATH],xte=e=>!ss(e)&&G3(e)&&!Fb(e),JT=e=>({[Ud.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function tL(e,t,{auto:n=!0}={}){const r=s=>{let i=Object.keys(s);const a=yte(s);if(!a&&i.length>1&&!Fb(s))return r(JT(s));if(xte(s)){const d=a?s[$b.PATH]:i[0],f=a?s[$b.PATTERN]:s[d];if(!Nr(f))throw new Error(Vee(d));const p={keyId:Ob(d),pattern:f};return n&&(p.searcher=Db(f,t)),p}let c={children:[],operator:i[0]};return i.forEach(d=>{const f=s[d];ss(f)&&f.forEach(p=>{c.children.push(r(p))})}),c};return Fb(e)||(e=JT(e)),r(e)}function vte(e,{ignoreFieldNorm:t=Ie.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:s,norm:i,score:a})=>{const c=s?s.weight:null;r*=Math.pow(a===0&&c?Number.EPSILON:a,(c||1)*(t?1:i))}),n.score=r})}function bte(e,t){const n=e.matches;t.matches=[],pn(n)&&n.forEach(r=>{if(!pn(r.indices)||!r.indices.length)return;const{indices:s,value:i}=r;let a={indices:s,value:i};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),t.matches.push(a)})}function wte(e,t){t.score=e.score}function Nte(e,t,{includeMatches:n=Ie.includeMatches,includeScore:r=Ie.includeScore}={}){const s=[];return n&&s.push(bte),r&&s.push(wte),e.map(i=>{const{idx:a}=i,c={item:t[a],refIndex:a};return s.length&&s.forEach(d=>{d(i,c)}),c})}class ha{constructor(t,n={},r){this.options={...Ie,...n},this.options.useExtendedSearch,this._keyStore=new Kee(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof w1))throw new Error(zee);this._myIndex=n||Q3(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){pn(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,s=this._docs.length;r<s;r+=1){const i=this._docs[r];t(i,r)&&(this.removeAt(r),r-=1,s-=1,n.push(i))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:c}=this.options;let d=Nr(t)?Nr(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return vte(d,{ignoreFieldNorm:c}),i&&d.sort(a),K3(n)&&n>-1&&(d=d.slice(0,n)),Nte(d,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(t){const n=Db(t,this.options),{records:r}=this._myIndex,s=[];return r.forEach(({v:i,i:a,n:c})=>{if(!pn(i))return;const{isMatch:d,score:f,indices:p}=n.searchIn(i);d&&s.push({item:i,idx:a,matches:[{score:f,value:i,norm:c,indices:p}]})}),s}_searchLogical(t){const n=tL(t,this.options),r=(c,d,f)=>{if(!c.children){const{keyId:h,searcher:g}=c,y=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(d,h),searcher:g});return y&&y.length?[{idx:f,item:d,matches:y}]:[]}const p=[];for(let h=0,g=c.children.length;h<g;h+=1){const y=c.children[h],w=r(y,d,f);if(w.length)p.push(...w);else if(c.operator===Ud.AND)return[]}return p},s=this._myIndex.records,i={},a=[];return s.forEach(({$:c,i:d})=>{if(pn(c)){let f=r(n,c,d);f.length&&(i[d]||(i[d]={idx:d,item:c,matches:[]},a.push(i[d])),f.forEach(({matches:p})=>{i[d].matches.push(...p)}))}}),a}_searchObjectList(t){const n=Db(t,this.options),{keys:r,records:s}=this._myIndex,i=[];return s.forEach(({$:a,i:c})=>{if(!pn(a))return;let d=[];r.forEach((f,p)=>{d.push(...this._findMatches({key:f,value:a[p],searcher:n}))}),d.length&&i.push({idx:c,item:a,matches:d})}),i}_findMatches({key:t,value:n,searcher:r}){if(!pn(n))return[];let s=[];if(ss(n))n.forEach(({v:i,i:a,n:c})=>{if(!pn(i))return;const{isMatch:d,score:f,indices:p}=r.searchIn(i);d&&s.push({score:f,key:t,value:i,idx:a,norm:c,indices:p})});else{const{v:i,n:a}=n,{isMatch:c,score:d,indices:f}=r.searchIn(i);c&&s.push({score:d,key:t,value:i,norm:a,indices:f})}return s}}ha.version="7.1.0";ha.createIndex=Q3;ha.parseIndex=tte;ha.config=Ie;ha.parseQuery=tL;gte(mte);const ZT=5;function kte(){try{const e=localStorage.getItem("marktoflow-recent-commands");return e?JSON.parse(e):[]}catch{return[]}}function eI(e){try{localStorage.setItem("marktoflow-recent-commands",JSON.stringify(e))}catch{}}const nL=xn((e,t)=>({isOpen:!1,mode:"commands",query:"",selectedIndex:0,commands:[],recentCommandIds:kte(),open:(n="commands")=>{e({isOpen:!0,mode:n,query:"",selectedIndex:0})},close:()=>{e({isOpen:!1,query:"",selectedIndex:0})},setQuery:n=>{e({query:n,selectedIndex:0})},setSelectedIndex:n=>{e({selectedIndex:n})},registerCommand:n=>{e(r=>({commands:[...r.commands.filter(i=>i.id!==n.id),n]}))},registerCommands:n=>{e(r=>{const s=new Set(n.map(a=>a.id));return{commands:[...r.commands.filter(a=>!s.has(a.id)),...n]}})},unregisterCommand:n=>{e(r=>({commands:r.commands.filter(s=>s.id!==n)}))},executeSelected:()=>{const{selectedIndex:n,recentCommandIds:r}=t(),i=t().getFilteredCommands()[n];if(i){const a=[i.id,...r.filter(c=>c!==i.id)].slice(0,ZT);eI(a),e({isOpen:!1,query:"",selectedIndex:0,recentCommandIds:a}),i.execute()}},executeCommand:n=>{const{commands:r,recentCommandIds:s}=t(),i=r.find(a=>a.id===n);if(i){const a=[i.id,...s.filter(c=>c!==i.id)].slice(0,ZT);eI(a),e({isOpen:!1,query:"",selectedIndex:0,recentCommandIds:a}),i.execute()}},moveUp:()=>{const{selectedIndex:n}=t(),r=t().getFilteredCommands();e({selectedIndex:n>0?n-1:r.length-1})},moveDown:()=>{const{selectedIndex:n}=t(),r=t().getFilteredCommands();e({selectedIndex:n<r.length-1?n+1:0})},getFilteredCommands:()=>{const{commands:n,query:r,mode:s,recentCommandIds:i}=t();let a=n;if(s==="workflows"?a=n.filter(d=>d.category==="workflow"):s==="nodes"&&(a=n.filter(d=>d.category==="node")),!r.trim()){const d=new Set(i),f=i.map(h=>a.find(g=>g.id===h)).filter(Boolean),p=a.filter(h=>!d.has(h.id));return[...f,...p]}return new ha(a,{keys:[{name:"label",weight:.5},{name:"description",weight:.2},{name:"keywords",weight:.2},{name:"category",weight:.1}],threshold:.4,includeScore:!0}).search(r).map(d=>d.item)}})),Ste={action:Go,workflow:h9,node:dw,setting:Ko,navigation:Gz},Cte={action:"text-accent",workflow:"text-primary",node:"text-warning",setting:"text-gray-400",navigation:"text-success"};function _te({command:e,isSelected:t,onSelect:n,onExecute:r}){const s=Ste[e.category]||Go,i=Cte[e.category]||"text-gray-400";return u.jsxs("button",{className:`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors ${t?"bg-primary/10 text-text-primary":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"}`,onClick:r,onMouseEnter:n,role:"option","aria-selected":t,children:[u.jsx(s,{className:`w-4 h-4 flex-shrink-0 ${i}`}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium truncate",children:e.label}),e.description&&u.jsx("div",{className:"text-xs text-text-muted truncate",children:e.description})]}),e.shortcut&&u.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:e.shortcut.split("+").map((a,c)=>u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface border border-border-default rounded text-xs font-mono text-text-muted",children:a.trim()},c))}),u.jsx("span",{className:"text-xs text-text-muted capitalize flex-shrink-0",children:e.category})]})}const Ete=E.memo(_te);function jte(){var S;const{isOpen:e,mode:t,query:n,selectedIndex:r,close:s,setQuery:i,setSelectedIndex:a,executeSelected:c,moveUp:d,moveDown:f,getFilteredCommands:p,open:h}=nL(),g=E.useRef(null),y=E.useRef(null),w=e?p():[];E.useEffect(()=>{e&&requestAnimationFrame(()=>{var k;(k=g.current)==null||k.focus()})},[e]),E.useEffect(()=>{if(!y.current)return;const k=y.current.children[r];k&&k.scrollIntoView({block:"nearest"})},[r]);const b=E.useCallback(k=>{switch(k.key){case"ArrowDown":k.preventDefault(),f();break;case"ArrowUp":k.preventDefault(),d();break;case"Enter":k.preventDefault(),c();break;case"Escape":k.preventDefault(),s();break;case"Tab":k.preventDefault(),h(t==="commands"?"workflows":t==="workflows"?"nodes":"commands");break}},[f,d,c,s,t,h]);if(!e)return null;const v={commands:{icon:Az,placeholder:"Type a command...",label:"Commands"},workflows:{icon:Ai,placeholder:"Search workflows...",label:"Workflows"},nodes:{icon:dw,placeholder:"Search nodes...",label:"Nodes"}},N=v[t];return N.icon,u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 z-50",onClick:s,"aria-hidden":"true"}),u.jsxs("div",{className:"fixed top-[20%] left-1/2 -translate-x-1/2 w-full max-w-xl z-50 bg-bg-panel border border-border-default rounded-xl shadow-2xl overflow-hidden",role:"dialog","aria-label":"Command palette",onKeyDown:b,children:[u.jsx("div",{className:"flex border-b border-border-default",children:Object.keys(v).map(k=>{const _=v[k].icon;return u.jsxs("button",{onClick:()=>h(k),className:`flex items-center gap-1.5 px-4 py-2 text-xs font-medium transition-colors ${t===k?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:[u.jsx(_,{className:"w-3.5 h-3.5"}),v[k].label]},k)})}),u.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border-default",children:[u.jsx(Pl,{className:"w-5 h-5 text-text-muted flex-shrink-0"}),u.jsx("input",{ref:g,type:"text",value:n,onChange:k=>i(k.target.value),placeholder:N.placeholder,className:"flex-1 bg-transparent text-sm text-text-primary placeholder-text-muted focus:outline-none",autoComplete:"off",spellCheck:!1,role:"combobox","aria-expanded":"true","aria-controls":"command-list","aria-activedescendant":(S=w[r])==null?void 0:S.id}),u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface border border-border-default rounded text-xs font-mono text-text-muted",children:"Esc"})]}),u.jsx("div",{ref:y,id:"command-list",className:"max-h-[320px] overflow-y-auto py-1",role:"listbox",children:w.length===0?u.jsx("div",{className:"px-4 py-8 text-center text-sm text-text-muted",children:n?"No matching commands found":"No commands available"}):w.map((k,_)=>u.jsx(Ete,{command:k,isSelected:_===r,onSelect:()=>a(_),onExecute:()=>{a(_),c()}},k.id))}),u.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-border-default text-xs text-text-muted",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"px-1 py-0.5 bg-bg-surface border border-border-default rounded font-mono",children:"↑↓"}),"Navigate"]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"px-1 py-0.5 bg-bg-surface border border-border-default rounded font-mono",children:"↵"}),"Execute"]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"px-1 py-0.5 bg-bg-surface border border-border-default rounded font-mono",children:"Tab"}),"Switch mode"]})]}),u.jsxs("span",{children:[w.length," results"]})]})]})]})}const Ate=xn()(z3((e,t)=>({completed:!1,currentStep:0,totalSteps:6,skipped:!1,tourActive:!1,startTour:()=>e({tourActive:!0,currentStep:0,skipped:!1}),nextStep:()=>{const{currentStep:n,totalSteps:r}=t();n<r-1?e({currentStep:n+1}):t().completeTour()},prevStep:()=>{const{currentStep:n}=t();n>0&&e({currentStep:n-1})},skipTour:()=>e({tourActive:!1,skipped:!0,completed:!0}),completeTour:()=>e({tourActive:!1,completed:!0}),resetTour:()=>e({completed:!1,currentStep:0,skipped:!1,tourActive:!1})}),{name:"marktoflow-onboarding"})),Tte=[{title:"Welcome to Marktoflow!",description:"A visual workflow designer for building automation pipelines. Let us show you around.",target:"body"},{title:"Sidebar",description:"Browse your workflows and drag tools onto the canvas to build steps.",target:'[data-tour="sidebar"]'},{title:"Canvas",description:"This is where you design your workflow. Connect nodes to define the flow of execution.",target:'[data-tour="canvas"]'},{title:"Toolbar",description:"Use the toolbar to add steps, undo/redo, auto-layout, and execute your workflow.",target:'[data-tour="toolbar"]'},{title:"AI Assistant",description:"Type natural language prompts to generate or modify workflows using AI.",target:'[data-tour="prompt"]'},{title:"You're Ready!",description:"Start building your first workflow or explore the template gallery for inspiration.",target:"body"}];function Ite(){const{tourActive:e,currentStep:t,totalSteps:n,nextStep:r,prevStep:s,skipTour:i,completeTour:a}=Ate();if(!e)return null;const c=Tte[t],d=t===n-1,f=t===0;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60]"}),u.jsx("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-[61] w-full max-w-md bg-bg-panel border border-border-default rounded-xl shadow-2xl overflow-hidden",children:u.jsxs("div",{className:"p-5",children:[u.jsxs("div",{className:"flex items-start justify-between mb-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(dR,{className:"w-5 h-5 text-primary"}),u.jsx("h3",{className:"text-base font-medium text-text-primary",children:c.title})]}),u.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-bg-hover text-text-muted",children:u.jsx(Zn,{className:"w-4 h-4"})})]}),u.jsx("p",{className:"text-sm text-text-secondary mb-4",children:c.description}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"flex gap-1",children:Array.from({length:n}).map((p,h)=>u.jsx("div",{className:Ue("w-2 h-2 rounded-full transition-colors",h===t?"bg-primary":h<t?"bg-primary/40":"bg-bg-surface")},h))}),u.jsxs("div",{className:"flex items-center gap-2",children:[!f&&u.jsxs("button",{onClick:s,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary rounded hover:bg-bg-hover",children:[u.jsx(JM,{className:"w-4 h-4"})," Back"]}),u.jsxs("button",{onClick:d?a:r,className:"flex items-center gap-1 px-4 py-1.5 text-sm bg-primary text-white rounded hover:bg-primary/90",children:[d?"Get Started":"Next"," ",!d&&u.jsx(It,{className:"w-4 h-4"})]})]})]})]})})]})}const Mte=E.memo(Ite);function Rte(){return u.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-[100] focus:top-4 focus:left-4 focus:px-4 focus:py-2 focus:bg-primary focus:text-white focus:rounded-lg focus:shadow-lg",children:"Skip to main content"})}function Ote({message:e,role:t="status",clearAfter:n=5e3}){const[r,s]=E.useState(e);return E.useEffect(()=>{if(s(e),n>0&&e){const i=setTimeout(()=>s(""),n);return()=>clearTimeout(i)}},[e,n]),u.jsx("div",{"aria-live":t==="alert"?"assertive":"polite","aria-atomic":"true",role:t,className:"sr-only",children:r})}const Pte=E.memo(Ote),Rr=Object.create(null);Rr.open="0";Rr.close="1";Rr.ping="2";Rr.pong="3";Rr.message="4";Rr.upgrade="5";Rr.noop="6";const md=Object.create(null);Object.keys(Rr).forEach(e=>{md[Rr[e]]=e});const qb={type:"error",data:"parser error"},rL=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",sL=typeof ArrayBuffer=="function",iL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,N1=({type:e,data:t},n,r)=>rL&&t instanceof Blob?n?r(t):tI(t,r):sL&&(t instanceof ArrayBuffer||iL(t))?n?r(t):tI(new Blob([t]),r):r(Rr[e]+(t||"")),tI=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function nI(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let W0;function Lte(e,t){if(rL&&e.data instanceof Blob)return e.data.arrayBuffer().then(nI).then(t);if(sL&&(e.data instanceof ArrayBuffer||iL(e.data)))return t(nI(e.data));N1(e,!1,n=>{W0||(W0=new TextEncoder),t(W0.encode(n))})}const rI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<rI.length;e++)gl[rI.charCodeAt(e)]=e;const Dte=e=>{let t=e.length*.75,n=e.length,r,s=0,i,a,c,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),p=new Uint8Array(f);for(r=0;r<n;r+=4)i=gl[e.charCodeAt(r)],a=gl[e.charCodeAt(r+1)],c=gl[e.charCodeAt(r+2)],d=gl[e.charCodeAt(r+3)],p[s++]=i<<2|a>>4,p[s++]=(a&15)<<4|c>>2,p[s++]=(c&3)<<6|d&63;return f},$te=typeof ArrayBuffer=="function",k1=(e,t)=>{if(typeof e!="string")return{type:"message",data:oL(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Fte(e.substring(1),t)}:md[n]?e.length>1?{type:md[n],data:e.substring(1)}:{type:md[n]}:qb},Fte=(e,t)=>{if($te){const n=Dte(e);return oL(n,t)}else return{base64:!0,data:e}},oL=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},aL="",qte=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((i,a)=>{N1(i,!1,c=>{r[a]=c,++s===n&&t(r.join(aL))})})},Bte=(e,t)=>{const n=e.split(aL),r=[];for(let s=0;s<n.length;s++){const i=k1(n[s],t);if(r.push(i),i.type==="error")break}return r};function zte(){return new TransformStream({transform(e,t){Lte(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 i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let K0;function nd(e){return e.reduce((t,n)=>t+n.length,0)}function rd(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 Vte(e,t){K0||(K0=new TextDecoder);const n=[];let r=0,s=-1,i=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(nd(n)<1)break;const d=rd(n,1);i=(d[0]&128)===128,s=d[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(nd(n)<2)break;const d=rd(n,2);s=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),r=3}else if(r===2){if(nd(n)<8)break;const d=rd(n,8),f=new DataView(d.buffer,d.byteOffset,d.length),p=f.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(qb);break}s=p*Math.pow(2,32)+f.getUint32(4),r=3}else{if(nd(n)<s)break;const d=rd(n,s);c.enqueue(k1(i?d:K0.decode(d),t)),r=0}if(s===0||s>e){c.enqueue(qb);break}}}})}const lL=4;function xt(e){if(e)return Hte(e)}function Hte(e){for(var t in xt.prototype)e[t]=xt.prototype[t];return e}xt.prototype.on=xt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};xt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};xt.prototype.off=xt.prototype.removeListener=xt.prototype.removeAllListeners=xt.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};xt.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};xt.prototype.emitReserved=xt.prototype.emit;xt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};xt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Xf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),jn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ute="arraybuffer";function cL(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Wte=jn.setTimeout,Kte=jn.clearTimeout;function Qf(e,t){t.useNativeTimers?(e.setTimeoutFn=Wte.bind(jn),e.clearTimeoutFn=Kte.bind(jn)):(e.setTimeoutFn=jn.setTimeout.bind(jn),e.clearTimeoutFn=jn.clearTimeout.bind(jn))}const Gte=1.33;function Yte(e){return typeof e=="string"?Xte(e):Math.ceil((e.byteLength||e.size)*Gte)}function Xte(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 uL(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Qte(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Jte(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Zte extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class S1 extends xt{constructor(t){super(),this.writable=!1,Qf(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 Zte(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=k1(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=Qte(t);return n.length?"?"+n:""}}class ene extends S1{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)};Bte(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,qte(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]=uL()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let dL=!1;try{dL=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const tne=dL;function nne(){}class rne extends ene{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,i)=>{this.onError("xhr post error",s,i)})}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 jr extends xt{constructor(t,n,r){super(),this.createRequest=t,Qf(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=cL(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=jr.requestsCount++,jr.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=nne,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete jr.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()}}jr.requestsCount=0;jr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",sI);else if(typeof addEventListener=="function"){const e="onpagehide"in jn?"pagehide":"unload";addEventListener(e,sI,!1)}}function sI(){for(let e in jr.requests)jr.requests.hasOwnProperty(e)&&jr.requests[e].abort()}const sne=(function(){const e=fL({xdomain:!1});return e&&e.responseType!==null})();class ine extends rne{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=sne&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new jr(fL,this.uri(),t)}}function fL(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||tne))return new XMLHttpRequest}catch{}if(!t)try{return new jn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const hL=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class one extends S1{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=hL?{}:cL(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;N1(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}s&&Xf(()=>{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]=uL()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const G0=jn.WebSocket||jn.MozWebSocket;class ane extends one{createSocket(t,n,r){return hL?new G0(t,n,r):n?new G0(t,n):new G0(t)}doWrite(t,n){this.ws.send(n)}}class lne extends S1{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=Vte(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=zte();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const i=()=>{r.read().then(({done:c,value:d})=>{c||(this.onPacket(d),i())}).catch(c=>{})};i();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&&Xf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const cne={websocket:ane,webtransport:lne,polling:ine},une=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,dne=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Bb(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=une.exec(e||""),i={},a=14;for(;a--;)i[dne[a]]=s[a]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=fne(i,i.path),i.queryKey=hne(i,i.query),i}function fne(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 hne(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,i){s&&(n[s]=i)}),n}const zb=typeof addEventListener=="function"&&typeof removeEventListener=="function",gd=[];zb&&addEventListener("offline",()=>{gd.forEach(e=>e())},!1);class zs extends xt{constructor(t,n){if(super(),this.binaryType=Ute,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=Bb(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=Bb(n.host).host);Qf(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=Jte(this.opts.query)),zb&&(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"})},gd.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=lL,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&&zs.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",zs.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+=Yte(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,Xf(()=>{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 i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),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(zs.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(),zb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=gd.indexOf(this._offlineEventListener);r!==-1&&gd.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}zs.protocol=lL;class pne extends zs{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;zs.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;zs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function i(){r||(r=!0,p(),n.close(),n=null)}const a=h=>{const g=new Error("probe error: "+h);g.transport=n.name,i(),this.emitReserved("upgradeError",g)};function c(){a("transport closed")}function d(){a("socket closed")}function f(h){n&&h.name!==n.name&&i()}const p=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",c),this.off("close",d),this.off("upgrading",f)};n.once("open",s),n.once("error",a),n.once("close",c),this.once("close",d),this.once("upgrading",f),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 mne=class extends pne{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=>cne[s]).filter(s=>!!s)),super(t,r)}};function gne(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=Bb(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 i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const yne=typeof ArrayBuffer=="function",xne=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,pL=Object.prototype.toString,vne=typeof Blob=="function"||typeof Blob<"u"&&pL.call(Blob)==="[object BlobConstructor]",bne=typeof File=="function"||typeof File<"u"&&pL.call(File)==="[object FileConstructor]";function C1(e){return yne&&(e instanceof ArrayBuffer||xne(e))||vne&&e instanceof Blob||bne&&e instanceof File}function yd(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(yd(e[n]))return!0;return!1}if(C1(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return yd(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&yd(e[n]))return!0;return!1}function wne(e){const t=[],n=e.data,r=e;return r.data=Vb(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Vb(e,t){if(!e)return e;if(C1(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]=Vb(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]=Vb(e[r],t));return n}return e}function Nne(e,t){return e.data=Hb(e.data,t),delete e.attachments,e}function Hb(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]=Hb(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Hb(e[n],t));return e}const kne=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Le;(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"})(Le||(Le={}));class Sne{constructor(t){this.replacer=t}encode(t){return(t.type===Le.EVENT||t.type===Le.ACK)&&yd(t)?this.encodeAsBinary({type:t.type===Le.EVENT?Le.BINARY_EVENT:Le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Le.BINARY_EVENT||t.type===Le.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=wne(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class _1 extends xt{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===Le.BINARY_EVENT;r||n.type===Le.BINARY_ACK?(n.type=r?Le.EVENT:Le.ACK,this.reconstructor=new Cne(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(C1(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(Le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Le.BINARY_EVENT||r.type===Le.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(i,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const i=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(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(_1.isPayloadValid(r.type,i))r.data=i;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 Le.CONNECT:return iI(n);case Le.DISCONNECT:return n===void 0;case Le.CONNECT_ERROR:return typeof n=="string"||iI(n);case Le.EVENT:case Le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&kne.indexOf(n[0])===-1);case Le.ACK:case Le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Cne{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=Nne(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function iI(e){return Object.prototype.toString.call(e)==="[object Object]"}const _ne=Object.freeze(Object.defineProperty({__proto__:null,Decoder:_1,Encoder:Sne,get PacketType(){return Le}},Symbol.toStringTag,{value:"Module"}));function Yn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Ene=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class mL extends xt{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=[Yn(t,"open",this.onopen.bind(this)),Yn(t,"packet",this.onpacket.bind(this)),Yn(t,"error",this.onerror.bind(this)),Yn(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,i;if(Ene.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:Le.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const p=this.ids++,h=n.pop();this._registerAckCallback(p,h),a.id=p}const c=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,d=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!c||(d?(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 i=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(i),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const i=(a,c)=>a?s(a):r(c);i.withError=!0,n.push(i),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,...i)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...i)),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:Le.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 Le.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 Le.EVENT:case Le.BINARY_EVENT:this.onevent(t);break;case Le.ACK:case Le.BINARY_ACK:this.onack(t);break;case Le.DISCONNECT:this.ondisconnect();break;case Le.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:Le.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:Le.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 pa(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}pa.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};pa.prototype.reset=function(){this.attempts=0};pa.prototype.setMin=function(e){this.ms=e};pa.prototype.setMax=function(e){this.max=e};pa.prototype.setJitter=function(e){this.jitter=e};class Ub extends xt{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,Qf(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 pa({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||_ne;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 mne(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Yn(n,"open",function(){r.onopen(),t&&t()}),i=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=Yn(n,"error",i);if(this._timeout!==!1){const c=this._timeout,d=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),n.close()},c);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}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(Yn(t,"ping",this.onping.bind(this)),Yn(t,"data",this.ondata.bind(this)),Yn(t,"error",this.onerror.bind(this)),Yn(t,"close",this.onclose.bind(this)),Yn(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){Xf(()=>{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 mL(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 il={};function xd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=gne(e,t.path||"/socket.io"),r=n.source,s=n.id,i=n.path,a=il[s]&&i in il[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let d;return c?d=new Ub(r,t):(il[s]||(il[s]=new Ub(r,t)),d=il[s]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(xd,{Manager:Ub,Socket:mL,io:xd,connect:xd});function gL(e={}){const{autoConnect:t=!0,onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:i,onAIResponse:a}=e,c=E.useRef(null),[d,f]=E.useState(!1),p=E.useRef({onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:i,onAIResponse:a});E.useEffect(()=>{p.current={onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:i,onAIResponse:a}},[n,r,s,i,a]);const h=E.useCallback(()=>{var S;if((S=c.current)!=null&&S.connected)return;const N=xd({reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});N.on("connect",()=>{console.log("WebSocket connected"),f(!0)}),N.on("disconnect",()=>{console.log("WebSocket disconnected"),f(!1)}),N.on("connect_error",k=>{console.error("WebSocket connection error:",k),f(!1)}),N.on(Yr.WORKFLOW_UPDATED,k=>{var _,A;(A=(_=p.current).onWorkflowUpdated)==null||A.call(_,k)}),N.on(Yr.EXECUTION_STEP,k=>{var _,A;(A=(_=p.current).onExecutionStep)==null||A.call(_,k)}),N.on(Yr.EXECUTION_COMPLETED,k=>{var _,A;(A=(_=p.current).onExecutionCompleted)==null||A.call(_,k)}),N.on(Yr.AI_PROCESSING,({processing:k})=>{var _,A;(A=(_=p.current).onAIProcessing)==null||A.call(_,k)}),N.on(Yr.AI_RESPONSE,k=>{var _,A;(A=(_=p.current).onAIResponse)==null||A.call(_,k)}),c.current=N},[]),g=E.useCallback(()=>{c.current&&(c.current.disconnect(),c.current=null,f(!1))},[]),y=E.useCallback(N=>{var S;(S=c.current)==null||S.emit(Yr.WORKFLOW_SUBSCRIBE,N)},[]),w=E.useCallback(N=>{var S;(S=c.current)==null||S.emit(Yr.WORKFLOW_UNSUBSCRIBE,N)},[]),b=E.useCallback(N=>{var S;(S=c.current)==null||S.emit(Yr.EXECUTION_SUBSCRIBE,N)},[]),v=E.useCallback(N=>{var S;(S=c.current)==null||S.emit(Yr.EXECUTION_UNSUBSCRIBE,N)},[]);return E.useEffect(()=>(t&&h(),()=>{g()}),[t,h,g]),{connected:d,socket:c.current,subscribeToWorkflow:y,unsubscribeFromWorkflow:w,subscribeToExecution:b,unsubscribeFromExecution:v,connect:h,disconnect:g}}function jne(){const{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,loadWorkflows:i,selectWorkflow:a,loadWorkflow:c,saveWorkflow:d,createWorkflow:f,deleteWorkflow:p}=en(),{setNodes:h,setEdges:g}=_r(),{subscribeToWorkflow:y,unsubscribeFromWorkflow:w,connected:b}=gL({onWorkflowUpdated:A=>{A.path===t&&c(A.path),(A.event==="add"||A.event==="remove")&&i()}});E.useEffect(()=>{i()},[i]),E.useEffect(()=>{if(b&&t)return y(t),()=>{w(t)}},[b,t,y,w]),E.useEffect(()=>{if(n){const{nodes:A,edges:I}=W3(n);h($3(A,I)),g(I)}},[n,h,g]);const v=E.useCallback(A=>{a(A)},[a]),N=E.useCallback(async A=>{A&&await d(A)},[d]),S=E.useCallback(async A=>{await f(A)},[f]),k=E.useCallback(async A=>{await p(A)},[p]),_=E.useCallback(A=>{if(!n)return[];const I=[];if(n.inputs)for(const T of Object.keys(n.inputs))I.push(`inputs.${T}`);for(let T=0;T<A&&T<n.steps.length;T++){const O=n.steps[T];O.outputVariable&&I.push(O.outputVariable)}return I},[n]);return{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,selectWorkflow:v,saveWorkflow:N,createWorkflow:S,deleteWorkflow:k,refreshWorkflows:i,getAvailableVariables:_}}function Ane(){var Qs;const{currentWorkflow:e,selectedWorkflow:t,saveWorkflow:n,refreshWorkflows:r}=jne(),{isNewStepOpen:s,newStepPosition:i,openNewStepWizard:a,closeNewStepWizard:c}=q3(),{pendingChanges:d,acceptChanges:f,rejectChanges:p}=b1(),{isOpen:h,setIsOpen:g,openShortcuts:y}=Oee(),{breadcrumbs:w,popToIndex:b,resetNavigation:v}=Sw(),{loadWorkflow:N}=en(),S=E.useCallback((Ce,be)=>{b(be),N(Ce.path||"")},[b,N]),{connected:k,subscribeToExecution:_,unsubscribeFromExecution:A}=gL({onWorkflowUpdated:()=>{r()},onExecutionStep:Ce=>{Pn(Ce.stepId),Rt(be=>be.map(We=>We.stepId===Ce.stepId?{...We,status:Ce.status,duration:Ce.duration,error:Ce.error}:We)),ut(be=>[...be,`Step "${Ce.stepName||Ce.stepId}": ${Ce.status}${Ce.error?` - ${Ce.error}`:""}`]),ze.current&&(M(ze.current,Ce.stepId,Ce.status,Ce.output,Ce.error),H(ze.current,`Step "${Ce.stepName||Ce.stepId}": ${Ce.status}`))},onExecutionCompleted:Ce=>{He(Ce.status),Pn(null),ut(be=>[...be,Ce.status==="completed"?"Workflow completed successfully!":Ce.error||"Workflow execution failed"]),ze.current&&(P(ze.current,Ce.status),Ce.error&&H(ze.current,`Error: ${Ce.error}`)),Ce.runId&&A(Ce.runId),ze.current=null}}),{isExecuting:I,isPaused:T,currentRunId:O,runs:L,startExecution:B,updateStepStatus:M,completeExecution:P,addLog:H,pauseExecution:D,resumeExecution:z,cancelExecution:V,debug:G,enableDebugMode:q,disableDebugMode:F,toggleBreakpoint:Y,clearAllBreakpoints:$,stepOver:K,stepInto:ie,stepOut:U,addWatchExpression:Q,removeWatchExpression:Z}=H3(),{breakpoint:ee,setBreakpoint:se,sidebarOpen:ae,setSidebarOpen:ne,propertiesPanelOpen:le,setPropertiesPanelOpen:he,toolbarVisible:pe,setToolbarVisible:ve}=Yf(),{open:xe,registerCommands:Ae}=nL(),{toggleTheme:Se}=Fs(),{openSettings:Ge}=rr();E.useEffect(()=>{rr.getState().loadSettings()},[]);const{workflows:Ve}=en(),[jt,St]=E.useState("");E.useEffect(()=>{const Ce=[{id:"save",label:"Save Workflow",category:"action",shortcut:`${ee==="mobile"?"Ctrl":"⌘"} + S`,execute:()=>ur(),keywords:["save","persist"]},{id:"execute",label:"Execute Workflow",category:"action",shortcut:`${ee==="mobile"?"Ctrl":"⌘"} + Enter`,execute:()=>Dn(),keywords:["run","start"]},{id:"validate",label:"Validate Workflow",category:"action",execute:()=>$n(),keywords:["check","lint"]},{id:"add-step",label:"Add New Step",category:"action",shortcut:"N",execute:()=>cr(),keywords:["create","new"]},{id:"open-settings",label:"Open Settings",category:"setting",shortcut:`${ee==="mobile"?"Ctrl":"⌘"} + ,`,execute:()=>Ge(),keywords:["preferences","config"]},{id:"toggle-theme",label:"Toggle Theme",category:"setting",shortcut:`${ee==="mobile"?"Ctrl":"⌘"} + Shift + T`,execute:()=>Se(),keywords:["dark","light","mode"]},{id:"show-shortcuts",label:"Show Keyboard Shortcuts",category:"setting",shortcut:`${ee==="mobile"?"Ctrl":"⌘"} + /`,execute:()=>g(!0),keywords:["keys","hotkeys"]},{id:"toggle-sidebar",label:"Toggle Sidebar",category:"setting",execute:()=>ne(!ae),keywords:["panel","left"]},{id:"toggle-properties",label:"Toggle Properties Panel",category:"setting",execute:()=>he(!le),keywords:["panel","right"]},{id:"nav-back",label:"Navigate Back",category:"navigation",execute:()=>vn(),keywords:["parent","up"]},{id:"nav-root",label:"Navigate to Root",category:"navigation",execute:()=>cs(),keywords:["home","top"]},{id:"toggle-debug",label:"Toggle Debug Mode",category:"action",shortcut:"F9",execute:()=>G.enabled?F():q(),keywords:["breakpoint","inspect"]},...Ve.map(be=>({id:`workflow-${be.path}`,label:be.name,description:be.path,category:"workflow",execute:()=>{en.getState().selectWorkflow(be.path)},keywords:[be.name.toLowerCase()]}))];Ae(Ce)},[Ve,ae,le,ee,G.enabled]),E.useEffect(()=>{const Ce=()=>{const be=DZ(window.innerWidth);be!==ee&&se(be)};return Ce(),window.addEventListener("resize",Ce),()=>window.removeEventListener("resize",Ce)},[ee,se]);const[mt,He]=E.useState("pending"),[nn,Rt]=E.useState([]),[rn,ut]=E.useState([]),[Ot,Pn]=E.useState(null),ze=E.useRef(null),[Ln,Dr]=E.useState(!1),[Wt,sn]=E.useState({}),[ma,ls]=E.useState(!1),cr=E.useCallback(()=>{a()},[a]),Xs=E.useCallback(Ce=>{if(!e)return;const be={...e,steps:[...e.steps,Ce]};n(be),console.log("Created step:",Ce)},[e,n]),Dn=E.useCallback(async Ce=>{var be;if(I){if(ze.current)try{(await fetch(`/api/execute/cancel/${ze.current}`,{method:"POST"})).ok&&(V(ze.current),He("cancelled"),ut(bn=>[...bn,"Execution cancelled by user"]),ze.current=null)}catch(We){console.error("Failed to cancel execution:",We),ut(bn=>[...bn,"Failed to cancel execution"])}return}if(!(!e||!t)){if(!Ce&&e.inputs&&Object.keys(e.inputs).length>0){Dr(!0);return}try{He("running"),Pn(null),ut(["Starting workflow execution..."]),Rt(e.steps.map(on=>({stepId:on.id,stepName:on.name||on.id,status:"pending"})));const We=await fetch(`/api/execute/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inputs:Ce||{},dryRun:!1})});if(!We.ok){const on=await We.json();throw new Error(on.message||"Failed to start execution")}const Fn=(await We.json()).runId,$r=((be=e.metadata)==null?void 0:be.name)||"Untitled Workflow";B(t,$r,{},Fn),ze.current=Fn,_(Fn),ut(on=>[...on,`Execution started: ${Fn}`])}catch(We){const bn=We instanceof Error?We.message:"Unknown error";console.error("Failed to execute workflow:",We),He("failed"),ut(Fn=>[...Fn,`Error: ${bn}`]),ze.current&&(P(ze.current,"failed"),ze.current=null)}}},[I,e,t,B,V,_,M,H,P]),ur=E.useCallback(()=>{e&&n(e)},[e,n]),$n=E.useCallback(()=>{t&&ls(!0)},[t]),vn=E.useCallback(()=>{if(w.length>1){const Ce=w.length-2,be=w[Ce];b(Ce),N(be.path)}},[w,b,N]),cs=E.useCallback(()=>{if(w.length>1){const Ce=w[0];b(0),N(Ce.path)}},[w,b,N]);return E.useEffect(()=>{const Ce=be=>{if(be.target instanceof HTMLInputElement||be.target instanceof HTMLTextAreaElement)return;const We=be.metaKey||be.ctrlKey;if(We&&be.key===","){be.preventDefault(),Ge();return}if(We&&be.key==="k"){be.preventDefault(),xe("commands");return}if(We&&be.key==="p"){be.preventDefault(),xe("workflows");return}if(We&&be.shiftKey&&be.key==="t"){be.preventDefault(),Se();return}We&&be.key==="s"&&(be.preventDefault(),ur()),We&&be.key==="Enter"&&(be.preventDefault(),Dn()),be.key==="n"&&!We&&!be.shiftKey&&!be.altKey&&(be.preventDefault(),cr()),We&&be.key==="ArrowLeft"&&(be.preventDefault(),vn()),We&&be.key==="ArrowUp"&&(be.preventDefault(),cs()),be.key==="F9"&&(be.preventDefault(),G.enabled?F():q()),be.key==="F10"&&G.enabled&&T&&(be.preventDefault(),K()),be.key==="F11"&&!be.shiftKey&&G.enabled&&T&&(be.preventDefault(),ie()),be.key==="F11"&&be.shiftKey&&G.enabled&&T&&(be.preventDefault(),U()),be.key==="F5"&&T&&(be.preventDefault(),z())};return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[ur,Dn,cr,vn,cs,G.enabled,T,q,F,K,ie,U,z,xe,Se,Ge]),u.jsxs(WM,{children:[u.jsx(Rte,{}),u.jsx(Pte,{message:jt}),u.jsx(jte,{}),u.jsx(Mte,{}),u.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-bg-canvas",id:"main-content",children:[u.jsx(cee,{}),u.jsxs("div",{className:"flex flex-1 flex-col relative",children:[ee==="mobile"&&u.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-default bg-bg-panel",children:[u.jsx("button",{onClick:()=>ne(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Open menu",children:u.jsx(Hz,{className:"w-5 h-5 text-text-secondary"})}),u.jsxs("h1",{className:"text-sm font-medium text-text-primary flex items-center gap-1.5",children:[u.jsx("img",{src:"/marktoflow-logo.png",alt:"Marktoflow",className:"w-6 h-6 rounded-full object-cover"}),"Marktoflow"]}),u.jsx("button",{onClick:()=>he(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Open properties",children:u.jsx(m2,{className:"w-5 h-5 text-text-secondary"})})]}),ee!=="mobile"&&u.jsxs("div",{className:"absolute top-4 right-4 z-10 flex items-center gap-2",children:[u.jsx(Lee,{showLabel:!0}),u.jsx(Pee,{onClick:y}),u.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:[u.jsx("div",{className:`w-2 h-2 rounded-full ${k?"bg-success":"bg-error"}`}),k?"Connected":"Disconnected"]})]}),u.jsx($Z,{onAddStep:cr,onExecute:Dn,onSave:ur,onValidate:$n,isExecuting:I}),u.jsx(Dee,{items:w,onNavigate:S}),u.jsxs("div",{className:"flex-1 relative",children:[u.jsx(AZ,{}),!pe&&ee!=="mobile"&&u.jsx("button",{onClick:()=>ve(!0),className:"absolute top-4 left-1/2 -translate-x-1/2 z-10 p-2 bg-bg-panel/90 backdrop-blur border border-border-default rounded-lg shadow-md hover:bg-bg-hover transition-colors text-text-muted hover:text-text-primary",title:"Show toolbar",children:u.jsx(p9,{className:"w-4 h-4"})}),ee!=="mobile"&&u.jsx("button",{onClick:()=>ne(!ae),className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 p-1.5 bg-bg-panel/90 backdrop-blur border border-l-0 border-border-default rounded-r-lg shadow-sm hover:bg-bg-hover transition-colors text-text-muted hover:text-text-primary",title:ae?"Collapse sidebar":"Expand sidebar","aria-label":ae?"Collapse sidebar":"Expand sidebar",children:u.jsx(Xz,{className:"w-4 h-4"})}),ee!=="mobile"&&u.jsx("button",{onClick:()=>he(!le),className:"absolute right-0 top-1/2 -translate-y-1/2 z-10 p-1.5 bg-bg-panel/90 backdrop-blur border border-r-0 border-border-default rounded-l-lg shadow-sm hover:bg-bg-hover transition-colors text-text-muted hover:text-text-primary",title:le?"Collapse properties":"Expand properties","aria-label":le?"Collapse properties":"Expand properties",children:u.jsx(m2,{className:"w-4 h-4"})}),u.jsx(YZ,{isExecuting:I,isPaused:T,workflowStatus:mt,currentStepId:Ot,steps:nn,logs:rn,onPause:()=>D(),onResume:()=>z(),onStop:()=>{ze.current&&(V(ze.current),ze.current=null),He("cancelled")},onStepOver:()=>K(),onClose:()=>{He("pending"),Rt([]),ut([])},debug:G,onToggleDebugMode:()=>{G.enabled?F():q()},onToggleBreakpoint:Ce=>Y(Ce),onStepInto:()=>ie(),onStepOut:()=>U(),onClearBreakpoints:()=>$(),onAddWatchExpression:Ce=>Q(Ce),onRemoveWatchExpression:Ce=>Z(Ce)})]}),u.jsx(jee,{})]}),u.jsx(yee,{}),u.jsx(Iee,{open:s,onOpenChange:Ce=>{Ce||c()},onCreateStep:Xs,position:i||void 0}),d&&u.jsx(Aee,{open:!!d,onOpenChange:()=>p(),originalWorkflow:e,modifiedWorkflow:d,explanation:"AI has suggested the following changes to your workflow.",onAccept:f,onReject:p}),(e==null?void 0:e.inputs)&&u.jsx(XZ,{open:Ln,onOpenChange:Dr,inputs:e.inputs,onExecute:Dn,workflowName:(Qs=e.metadata)==null?void 0:Qs.name}),u.jsx(QZ,{workflowPath:ma?t:null,onClose:()=>ls(!1)}),u.jsx(Ree,{open:h,onOpenChange:g})]})]})}sD.createRoot(document.getElementById("root")).render(u.jsx(yt.StrictMode,{children:u.jsx(Ane,{})}));
833
+ //# sourceMappingURL=index-iXI2YSzR.js.map