@marktoflow/gui 2.0.0-alpha.1 → 2.0.0-alpha.3

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.
Files changed (74) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/README.md +38 -2
  3. package/dist/client/assets/index-C90Y_aBX.js +678 -0
  4. package/dist/client/assets/index-C90Y_aBX.js.map +1 -0
  5. package/dist/client/assets/index-CRWeQ3NN.css +1 -0
  6. package/dist/client/index.html +2 -2
  7. package/dist/server/server/index.js +1 -1
  8. package/dist/server/server/routes/tools.js +406 -0
  9. package/dist/server/server/routes/tools.js.map +1 -1
  10. package/dist/server/server/services/agents/codex-provider.js +270 -0
  11. package/dist/server/server/services/agents/codex-provider.js.map +1 -0
  12. package/dist/server/server/services/agents/prompts.js +27 -0
  13. package/dist/server/server/services/agents/prompts.js.map +1 -1
  14. package/dist/server/server/services/agents/registry.js +20 -0
  15. package/dist/server/server/services/agents/registry.js.map +1 -1
  16. package/package.json +6 -6
  17. package/src/client/components/Canvas/Canvas.tsx +24 -6
  18. package/src/client/components/Canvas/ForEachNode.tsx +128 -0
  19. package/src/client/components/Canvas/IfElseNode.tsx +126 -0
  20. package/src/client/components/Canvas/ParallelNode.tsx +140 -0
  21. package/src/client/components/Canvas/SwitchNode.tsx +164 -0
  22. package/src/client/components/Canvas/TransformNode.tsx +185 -0
  23. package/src/client/components/Canvas/TryCatchNode.tsx +164 -0
  24. package/src/client/components/Canvas/WhileNode.tsx +129 -0
  25. package/src/client/components/Canvas/index.ts +24 -0
  26. package/src/client/utils/serviceIcons.tsx +33 -0
  27. package/src/server/index.ts +1 -1
  28. package/src/server/routes/tools.ts +406 -0
  29. package/src/server/services/agents/codex-provider.ts +398 -0
  30. package/src/server/services/agents/prompts.ts +27 -0
  31. package/src/server/services/agents/registry.ts +21 -0
  32. package/tailwind.config.ts +1 -1
  33. package/tests/integration/api.test.ts +203 -1
  34. package/tests/integration/testApp.ts +1 -1
  35. package/tests/setup.ts +35 -0
  36. package/tests/unit/ForEachNode.test.tsx +218 -0
  37. package/tests/unit/IfElseNode.test.tsx +188 -0
  38. package/tests/unit/ParallelNode.test.tsx +264 -0
  39. package/tests/unit/SwitchNode.test.tsx +252 -0
  40. package/tests/unit/TransformNode.test.tsx +386 -0
  41. package/tests/unit/TryCatchNode.test.tsx +243 -0
  42. package/tests/unit/WhileNode.test.tsx +226 -0
  43. package/tests/unit/codexProvider.test.ts +399 -0
  44. package/tests/unit/serviceIcons.test.ts +197 -0
  45. package/.turbo/turbo-test.log +0 -22
  46. package/dist/client/assets/index-DwTI8opO.js +0 -608
  47. package/dist/client/assets/index-DwTI8opO.js.map +0 -1
  48. package/dist/client/assets/index-RoEdL6gO.css +0 -1
  49. package/dist/server/index.d.ts +0 -3
  50. package/dist/server/index.d.ts.map +0 -1
  51. package/dist/server/index.js +0 -56
  52. package/dist/server/index.js.map +0 -1
  53. package/dist/server/routes/ai.js +0 -50
  54. package/dist/server/routes/ai.js.map +0 -1
  55. package/dist/server/routes/execute.js +0 -62
  56. package/dist/server/routes/execute.js.map +0 -1
  57. package/dist/server/routes/workflows.js +0 -99
  58. package/dist/server/routes/workflows.js.map +0 -1
  59. package/dist/server/services/AIService.d.ts +0 -30
  60. package/dist/server/services/AIService.d.ts.map +0 -1
  61. package/dist/server/services/AIService.js +0 -216
  62. package/dist/server/services/AIService.js.map +0 -1
  63. package/dist/server/services/FileWatcher.d.ts +0 -10
  64. package/dist/server/services/FileWatcher.d.ts.map +0 -1
  65. package/dist/server/services/FileWatcher.js +0 -62
  66. package/dist/server/services/FileWatcher.js.map +0 -1
  67. package/dist/server/services/WorkflowService.d.ts +0 -54
  68. package/dist/server/services/WorkflowService.d.ts.map +0 -1
  69. package/dist/server/services/WorkflowService.js +0 -323
  70. package/dist/server/services/WorkflowService.js.map +0 -1
  71. package/dist/server/websocket/index.d.ts +0 -10
  72. package/dist/server/websocket/index.d.ts.map +0 -1
  73. package/dist/server/websocket/index.js +0 -85
  74. package/dist/server/websocket/index.js.map +0 -1
@@ -1,608 +0,0 @@
1
- function e3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Zc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var op={exports:{}},wa={},ap={exports:{}},Oe={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var uS;function t3(){if(uS)return Oe;uS=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(P){return P===null||typeof P!="object"?null:(P=p&&P[p]||P["@@iterator"],typeof P=="function"?P:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function w(P,W,se){this.props=P,this.context=W,this.refs=x,this.updater=se||v}w.prototype.isReactComponent={},w.prototype.setState=function(P,W){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,W,"setState")},w.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function S(){}S.prototype=w.prototype;function N(P,W,se){this.props=P,this.context=W,this.refs=x,this.updater=se||v}var k=N.prototype=new S;k.constructor=N,b(k,w.prototype),k.isPureReactComponent=!0;var E=Array.isArray,R=Object.prototype.hasOwnProperty,T={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function O(P,W,se){var K,J={},G=null,ee=null;if(W!=null)for(K in W.ref!==void 0&&(ee=W.ref),W.key!==void 0&&(G=""+W.key),W)R.call(W,K)&&!A.hasOwnProperty(K)&&(J[K]=W[K]);var te=arguments.length-2;if(te===1)J.children=se;else if(1<te){for(var oe=Array(te),fe=0;fe<te;fe++)oe[fe]=arguments[fe+2];J.children=oe}if(P&&P.defaultProps)for(K in te=P.defaultProps,te)J[K]===void 0&&(J[K]=te[K]);return{$$typeof:e,type:P,key:G,ref:ee,props:J,_owner:T.current}}function L(P,W){return{$$typeof:e,type:P.type,key:W,ref:P.ref,props:P.props,_owner:P._owner}}function B(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function I(P){var W={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(se){return W[se]})}var q=/\/+/g;function U(P,W){return typeof P=="object"&&P!==null&&P.key!=null?I(""+P.key):W.toString(36)}function D(P,W,se,K,J){var G=typeof P;(G==="undefined"||G==="boolean")&&(P=null);var ee=!1;if(P===null)ee=!0;else switch(G){case"string":case"number":ee=!0;break;case"object":switch(P.$$typeof){case e:case t:ee=!0}}if(ee)return ee=P,J=J(ee),P=K===""?"."+U(ee,0):K,E(J)?(se="",P!=null&&(se=P.replace(q,"$&/")+"/"),D(J,W,se,"",function(fe){return fe})):J!=null&&(B(J)&&(J=L(J,se+(!J.key||ee&&ee.key===J.key?"":(""+J.key).replace(q,"$&/")+"/")+P)),W.push(J)),1;if(ee=0,K=K===""?".":K+":",E(P))for(var te=0;te<P.length;te++){G=P[te];var oe=K+U(G,te);ee+=D(G,W,se,oe,J)}else if(oe=g(P),typeof oe=="function")for(P=oe.call(P),te=0;!(G=P.next()).done;)G=G.value,oe=K+U(G,te++),ee+=D(G,W,se,oe,J);else if(G==="object")throw W=String(P),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return ee}function V(P,W,se){if(P==null)return P;var K=[],J=0;return D(P,K,"","",function(G){return W.call(se,G,J++)}),K}function z(P){if(P._status===-1){var W=P._result;W=W(),W.then(function(se){(P._status===0||P._status===-1)&&(P._status=1,P._result=se)},function(se){(P._status===0||P._status===-1)&&(P._status=2,P._result=se)}),P._status===-1&&(P._status=0,P._result=W)}if(P._status===1)return P._result.default;throw P._result}var Q={current:null},F={transition:null},$={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:F,ReactCurrentOwner:T};function Y(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:V,forEach:function(P,W,se){V(P,function(){W.apply(this,arguments)},se)},count:function(P){var W=0;return V(P,function(){W++}),W},toArray:function(P){return V(P,function(W){return W})||[]},only:function(P){if(!B(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},Oe.Component=w,Oe.Fragment=n,Oe.Profiler=i,Oe.PureComponent=N,Oe.StrictMode=r,Oe.Suspense=u,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,Oe.act=Y,Oe.cloneElement=function(P,W,se){if(P==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+P+".");var K=b({},P.props),J=P.key,G=P.ref,ee=P._owner;if(W!=null){if(W.ref!==void 0&&(G=W.ref,ee=T.current),W.key!==void 0&&(J=""+W.key),P.type&&P.type.defaultProps)var te=P.type.defaultProps;for(oe in W)R.call(W,oe)&&!A.hasOwnProperty(oe)&&(K[oe]=W[oe]===void 0&&te!==void 0?te[oe]:W[oe])}var oe=arguments.length-2;if(oe===1)K.children=se;else if(1<oe){te=Array(oe);for(var fe=0;fe<oe;fe++)te[fe]=arguments[fe+2];K.children=te}return{$$typeof:e,type:P.type,key:J,ref:G,props:K,_owner:ee}},Oe.createContext=function(P){return P={$$typeof:a,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},P.Provider={$$typeof:o,_context:P},P.Consumer=P},Oe.createElement=O,Oe.createFactory=function(P){var W=O.bind(null,P);return W.type=P,W},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(P){return{$$typeof:c,render:P}},Oe.isValidElement=B,Oe.lazy=function(P){return{$$typeof:h,_payload:{_status:-1,_result:P},_init:z}},Oe.memo=function(P,W){return{$$typeof:f,type:P,compare:W===void 0?null:W}},Oe.startTransition=function(P){var W=F.transition;F.transition={};try{P()}finally{F.transition=W}},Oe.unstable_act=Y,Oe.useCallback=function(P,W){return Q.current.useCallback(P,W)},Oe.useContext=function(P){return Q.current.useContext(P)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(P){return Q.current.useDeferredValue(P)},Oe.useEffect=function(P,W){return Q.current.useEffect(P,W)},Oe.useId=function(){return Q.current.useId()},Oe.useImperativeHandle=function(P,W,se){return Q.current.useImperativeHandle(P,W,se)},Oe.useInsertionEffect=function(P,W){return Q.current.useInsertionEffect(P,W)},Oe.useLayoutEffect=function(P,W){return Q.current.useLayoutEffect(P,W)},Oe.useMemo=function(P,W){return Q.current.useMemo(P,W)},Oe.useReducer=function(P,W,se){return Q.current.useReducer(P,W,se)},Oe.useRef=function(P){return Q.current.useRef(P)},Oe.useState=function(P){return Q.current.useState(P)},Oe.useSyncExternalStore=function(P,W,se){return Q.current.useSyncExternalStore(P,W,se)},Oe.useTransition=function(){return Q.current.useTransition()},Oe.version="18.3.1",Oe}var fS;function dl(){return fS||(fS=1,ap.exports=t3()),ap.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var dS;function n3(){if(dS)return wa;dS=1;var e=dl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(c,u,f){var h,p={},g=null,v=null;f!==void 0&&(g=""+f),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)r.call(u,h)&&!o.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:t,type:c,key:g,ref:v,props:p,_owner:i.current}}return wa.Fragment=n,wa.jsx=a,wa.jsxs=a,wa}var hS;function r3(){return hS||(hS=1,op.exports=n3()),op.exports}var m=r3(),j=dl();const dt=fl(j),JR=e3({__proto__:null,default:dt},[j]);var eu={},lp={exports:{}},Gt={},cp={exports:{}},up={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var pS;function i3(){return pS||(pS=1,(function(e){function t(F,$){var Y=F.length;F.push($);e:for(;0<Y;){var P=Y-1>>>1,W=F[P];if(0<i(W,$))F[P]=$,F[Y]=W,Y=P;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var $=F[0],Y=F.pop();if(Y!==$){F[0]=Y;e:for(var P=0,W=F.length,se=W>>>1;P<se;){var K=2*(P+1)-1,J=F[K],G=K+1,ee=F[G];if(0>i(J,Y))G<W&&0>i(ee,J)?(F[P]=ee,F[G]=Y,P=G):(F[P]=J,F[K]=Y,P=K);else if(G<W&&0>i(ee,Y))F[P]=ee,F[G]=Y,P=G;else break e}}return $}function i(F,$){var Y=F.sortIndex-$.sortIndex;return Y!==0?Y:F.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],f=[],h=1,p=null,g=3,v=!1,b=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(F){for(var $=n(f);$!==null;){if($.callback===null)r(f);else if($.startTime<=F)r(f),$.sortIndex=$.expirationTime,t(u,$);else break;$=n(f)}}function E(F){if(x=!1,k(F),!b)if(n(u)!==null)b=!0,z(R);else{var $=n(f);$!==null&&Q(E,$.startTime-F)}}function R(F,$){b=!1,x&&(x=!1,S(O),O=-1),v=!0;var Y=g;try{for(k($),p=n(u);p!==null&&(!(p.expirationTime>$)||F&&!I());){var P=p.callback;if(typeof P=="function"){p.callback=null,g=p.priorityLevel;var W=P(p.expirationTime<=$);$=e.unstable_now(),typeof W=="function"?p.callback=W:p===n(u)&&r(u),k($)}else r(u);p=n(u)}if(p!==null)var se=!0;else{var K=n(f);K!==null&&Q(E,K.startTime-$),se=!1}return se}finally{p=null,g=Y,v=!1}}var T=!1,A=null,O=-1,L=5,B=-1;function I(){return!(e.unstable_now()-B<L)}function q(){if(A!==null){var F=e.unstable_now();B=F;var $=!0;try{$=A(!0,F)}finally{$?U():(T=!1,A=null)}}else T=!1}var U;if(typeof N=="function")U=function(){N(q)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,V=D.port2;D.port1.onmessage=q,U=function(){V.postMessage(null)}}else U=function(){w(q,0)};function z(F){A=F,T||(T=!0,U())}function Q(F,$){O=w(function(){F(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){b||v||(b=!0,z(R))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(F){switch(g){case 1:case 2:case 3:var $=3;break;default:$=g}var Y=g;g=$;try{return F()}finally{g=Y}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,$){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Y=g;g=F;try{return $()}finally{g=Y}},e.unstable_scheduleCallback=function(F,$,Y){var P=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?P+Y:P):Y=P,F){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=Y+W,F={id:h++,callback:$,priorityLevel:F,startTime:Y,expirationTime:W,sortIndex:-1},Y>P?(F.sortIndex=Y,t(f,F),n(u)===null&&F===n(f)&&(x?(S(O),O=-1):x=!0,Q(E,Y-P))):(F.sortIndex=W,t(u,F),b||v||(b=!0,z(R))),F},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(F){var $=g;return function(){var Y=g;g=$;try{return F.apply(this,arguments)}finally{g=Y}}}})(up)),up}var mS;function s3(){return mS||(mS=1,cp.exports=i3()),cp.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var gS;function o3(){if(gS)return Gt;gS=1;var e=dl(),t=s3();function n(s){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+s,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(s,l){a(s,l),a(s+"Capture",l)}function a(s,l){for(i[s]=l,s=0;s<l.length;s++)r.add(l[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=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]*$/,h={},p={};function g(s){return u.call(p,s)?!0:u.call(h,s)?!1:f.test(s)?p[s]=!0:(h[s]=!0,!1)}function v(s,l,d,y){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:d!==null?!d.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function b(s,l,d,y){if(l===null||typeof l>"u"||v(s,l,d,y))return!0;if(y)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function x(s,l,d,y,_,C,M){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=_,this.mustUseProperty=d,this.propertyName=s,this.type=l,this.sanitizeURL=C,this.removeEmptyString=M}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){w[s]=new x(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var l=s[0];w[l]=new x(l,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){w[s]=new x(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){w[s]=new x(s,2,!1,s,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(s){w[s]=new x(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){w[s]=new x(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){w[s]=new x(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){w[s]=new x(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){w[s]=new x(s,5,!1,s.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(s){return s[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(s){var l=s.replace(S,N);w[l]=new x(l,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var l=s.replace(S,N);w[l]=new x(l,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var l=s.replace(S,N);w[l]=new x(l,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){w[s]=new x(s,1,!1,s.toLowerCase(),null,!1,!1)}),w.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){w[s]=new x(s,1,!1,s.toLowerCase(),null,!0,!0)});function k(s,l,d,y){var _=w.hasOwnProperty(l)?w[l]:null;(_!==null?_.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(b(l,d,_,y)&&(d=null),y||_===null?g(l)&&(d===null?s.removeAttribute(l):s.setAttribute(l,""+d)):_.mustUseProperty?s[_.propertyName]=d===null?_.type===3?!1:"":d:(l=_.attributeName,y=_.attributeNamespace,d===null?s.removeAttribute(l):(_=_.type,d=_===3||_===4&&d===!0?"":""+d,y?s.setAttributeNS(y,l,d):s.setAttribute(l,d))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),T=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),I=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),F=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var Y=Object.assign,P;function W(s){if(P===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);P=l&&l[1]||""}return`
34
- `+P+s}var se=!1;function K(s,l){if(!s||se)return"";se=!0;var d=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(ie){var y=ie}Reflect.construct(s,[],l)}else{try{l.call()}catch(ie){y=ie}s.call(l.prototype)}else{try{throw Error()}catch(ie){y=ie}s()}}catch(ie){if(ie&&y&&typeof ie.stack=="string"){for(var _=ie.stack.split(`
35
- `),C=y.stack.split(`
36
- `),M=_.length-1,H=C.length-1;1<=M&&0<=H&&_[M]!==C[H];)H--;for(;1<=M&&0<=H;M--,H--)if(_[M]!==C[H]){if(M!==1||H!==1)do if(M--,H--,0>H||_[M]!==C[H]){var X=`
37
- `+_[M].replace(" at new "," at ");return s.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",s.displayName)),X}while(1<=M&&0<=H);break}}}finally{se=!1,Error.prepareStackTrace=d}return(s=s?s.displayName||s.name:"")?W(s):""}function J(s){switch(s.tag){case 5:return W(s.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return s=K(s.type,!1),s;case 11:return s=K(s.type.render,!1),s;case 1:return s=K(s.type,!0),s;default:return""}}function G(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case A:return"Fragment";case T:return"Portal";case L:return"Profiler";case O:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case I:return(s.displayName||"Context")+".Consumer";case B:return(s._context.displayName||"Context")+".Provider";case q:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case V:return l=s.displayName||null,l!==null?l:G(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return G(s(l))}catch{}}return null}function ee(s){var l=s.type;switch(s.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 s=l.render,s=s.displayName||s.name||"",l.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return G(l);case 8:return l===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function te(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function oe(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function fe(s){var l=oe(s)?"checked":"value",d=Object.getOwnPropertyDescriptor(s.constructor.prototype,l),y=""+s[l];if(!s.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var _=d.get,C=d.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return _.call(this)},set:function(M){y=""+M,C.call(this,M)}}),Object.defineProperty(s,l,{enumerable:d.enumerable}),{getValue:function(){return y},setValue:function(M){y=""+M},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function he(s){s._valueTracker||(s._valueTracker=fe(s))}function me(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var d=l.getValue(),y="";return s&&(y=oe(s)?s.checked?"true":"false":s.value),s=y,s!==d?(l.setValue(s),!0):!1}function de(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function _e(s,l){var d=l.checked;return Y({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??s._wrapperState.initialChecked})}function ve(s,l){var d=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;d=te(l.value!=null?l.value:d),s._wrapperState={initialChecked:y,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ne(s,l){l=l.checked,l!=null&&k(s,"checked",l,!1)}function Ee(s,l){Ne(s,l);var d=te(l.value),y=l.type;if(d!=null)y==="number"?(d===0&&s.value===""||s.value!=d)&&(s.value=""+d):s.value!==""+d&&(s.value=""+d);else if(y==="submit"||y==="reset"){s.removeAttribute("value");return}l.hasOwnProperty("value")?Le(s,l.type,d):l.hasOwnProperty("defaultValue")&&Le(s,l.type,te(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(s.defaultChecked=!!l.defaultChecked)}function et(s,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+s._wrapperState.initialValue,d||l===s.value||(s.value=l),s.defaultValue=l}d=s.name,d!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,d!==""&&(s.name=d)}function Le(s,l,d){(l!=="number"||de(s.ownerDocument)!==s)&&(d==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+d&&(s.defaultValue=""+d))}var gt=Array.isArray;function yt(s,l,d,y){if(s=s.options,l){l={};for(var _=0;_<d.length;_++)l["$"+d[_]]=!0;for(d=0;d<s.length;d++)_=l.hasOwnProperty("$"+s[d].value),s[d].selected!==_&&(s[d].selected=_),_&&y&&(s[d].defaultSelected=!0)}else{for(d=""+te(d),l=null,_=0;_<s.length;_++){if(s[_].value===d){s[_].selected=!0,y&&(s[_].defaultSelected=!0);return}l!==null||s[_].disabled||(l=s[_])}l!==null&&(l.selected=!0)}}function it(s,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return Y({},l,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function Ue(s,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(gt(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}s._wrapperState={initialValue:te(d)}}function At(s,l){var d=te(l.value),y=te(l.defaultValue);d!=null&&(d=""+d,d!==s.value&&(s.value=d),l.defaultValue==null&&s.defaultValue!==d&&(s.defaultValue=d)),y!=null&&(s.defaultValue=""+y)}function Tt(s){var l=s.textContent;l===s._wrapperState.initialValue&&l!==""&&l!==null&&(s.value=l)}function Bt(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Me(s,l){return s==null||s==="http://www.w3.org/1999/xhtml"?Bt(l):s==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var we,st=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,y,_){MSApp.execUnsafeLocalFunction(function(){return s(l,d,y,_)})}:s})(function(s,l){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=l;else{for(we=we||document.createElement("div"),we.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=we.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;l.firstChild;)s.appendChild(l.firstChild)}});function Be(s,l){if(l){var d=s.firstChild;if(d&&d===s.lastChild&&d.nodeType===3){d.nodeValue=l;return}}s.textContent=l}var zt={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},cn=["Webkit","ms","Moz","O"];Object.keys(zt).forEach(function(s){cn.forEach(function(l){l=l+s.charAt(0).toUpperCase()+s.substring(1),zt[l]=zt[s]})});function Mt(s,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||zt.hasOwnProperty(s)&&zt[s]?(""+l).trim():l+"px"}function It(s,l){s=s.style;for(var d in l)if(l.hasOwnProperty(d)){var y=d.indexOf("--")===0,_=Mt(d,l[d],y);d==="float"&&(d="cssFloat"),y?s.setProperty(d,_):s[d]=_}}var os=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 Ot(s,l){if(l){if(os[s]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,s));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 Qt(s,l){if(s.indexOf("-")===-1)return typeof l.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mo=null;function Io(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Oo=null,Lr=null,Dr=null;function ql(s){if(s=sa(s)){if(typeof Oo!="function")throw Error(n(280));var l=s.stateNode;l&&(l=pc(l),Oo(s.stateNode,s.type,l))}}function $l(s){Lr?Dr?Dr.push(s):Dr=[s]:Lr=s}function Fl(){if(Lr){var s=Lr,l=Dr;if(Dr=Lr=null,ql(s),l)for(s=0;s<l.length;s++)ql(l[s])}}function Bl(s,l){return s(l)}function zl(){}var Po=!1;function Vl(s,l,d){if(Po)return s(l,d);Po=!0;try{return Bl(s,l,d)}finally{Po=!1,(Lr!==null||Dr!==null)&&(zl(),Fl())}}function wi(s,l){var d=s.stateNode;if(d===null)return null;var y=pc(d);if(y===null)return null;d=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var Lo=!1;if(c)try{var bi={};Object.defineProperty(bi,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch{Lo=!1}function gd(s,l,d,y,_,C,M,H,X){var ie=Array.prototype.slice.call(arguments,3);try{l.apply(d,ie)}catch(le){this.onError(le)}}var _i=!1,as=null,ls=!1,Do=null,yd={onError:function(s){_i=!0,as=s}};function vd(s,l,d,y,_,C,M,H,X){_i=!1,as=null,gd.apply(yd,arguments)}function xd(s,l,d,y,_,C,M,H,X){if(vd.apply(this,arguments),_i){if(_i){var ie=as;_i=!1,as=null}else throw Error(n(198));ls||(ls=!0,Do=ie)}}function Hn(s){var l=s,d=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(d=l.return),s=l.return;while(s)}return l.tag===3?d:null}function qo(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function $o(s){if(Hn(s)!==s)throw Error(n(188))}function wd(s){var l=s.alternate;if(!l){if(l=Hn(s),l===null)throw Error(n(188));return l!==s?null:s}for(var d=s,y=l;;){var _=d.return;if(_===null)break;var C=_.alternate;if(C===null){if(y=_.return,y!==null){d=y;continue}break}if(_.child===C.child){for(C=_.child;C;){if(C===d)return $o(_),s;if(C===y)return $o(_),l;C=C.sibling}throw Error(n(188))}if(d.return!==y.return)d=_,y=C;else{for(var M=!1,H=_.child;H;){if(H===d){M=!0,d=_,y=C;break}if(H===y){M=!0,y=_,d=C;break}H=H.sibling}if(!M){for(H=C.child;H;){if(H===d){M=!0,d=C,y=_;break}if(H===y){M=!0,y=C,d=_;break}H=H.sibling}if(!M)throw Error(n(189))}}if(d.alternate!==y)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?s:l}function Ul(s){return s=wd(s),s!==null?Hl(s):null}function Hl(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var l=Hl(s);if(l!==null)return l;s=s.sibling}return null}var Wl=t.unstable_scheduleCallback,Kl=t.unstable_cancelCallback,bd=t.unstable_shouldYield,Gl=t.unstable_requestPaint,tt=t.unstable_now,_d=t.unstable_getCurrentPriorityLevel,Fo=t.unstable_ImmediatePriority,Yl=t.unstable_UserBlockingPriority,cs=t.unstable_NormalPriority,Sd=t.unstable_LowPriority,Xl=t.unstable_IdlePriority,Si=null,un=null;function kd(s){if(un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(Si,s,void 0,(s.current.flags&128)===128)}catch{}}var Jt=Math.clz32?Math.clz32:Cd,Ed=Math.log,Nd=Math.LN2;function Cd(s){return s>>>=0,s===0?32:31-(Ed(s)/Nd|0)|0}var us=64,fs=4194304;function Wn(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function ds(s,l){var d=s.pendingLanes;if(d===0)return 0;var y=0,_=s.suspendedLanes,C=s.pingedLanes,M=d&268435455;if(M!==0){var H=M&~_;H!==0?y=Wn(H):(C&=M,C!==0&&(y=Wn(C)))}else M=d&~_,M!==0?y=Wn(M):C!==0&&(y=Wn(C));if(y===0)return 0;if(l!==0&&l!==y&&(l&_)===0&&(_=y&-y,C=l&-l,_>=C||_===16&&(C&4194240)!==0))return l;if((y&4)!==0&&(y|=d&16),l=s.entangledLanes,l!==0)for(s=s.entanglements,l&=y;0<l;)d=31-Jt(l),_=1<<d,y|=s[d],l&=~_;return y}function Ql(s,l){switch(s){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 jd(s,l){for(var d=s.suspendedLanes,y=s.pingedLanes,_=s.expirationTimes,C=s.pendingLanes;0<C;){var M=31-Jt(C),H=1<<M,X=_[M];X===-1?((H&d)===0||(H&y)!==0)&&(_[M]=Ql(H,l)):X<=l&&(s.expiredLanes|=H),C&=~H}}function Bo(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function hs(){var s=us;return us<<=1,(us&4194240)===0&&(us=64),s}function zo(s){for(var l=[],d=0;31>d;d++)l.push(s);return l}function ki(s,l,d){s.pendingLanes|=l,l!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,l=31-Jt(l),s[l]=d}function Jl(s,l){var d=s.pendingLanes&~l;s.pendingLanes=l,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=l,s.mutableReadLanes&=l,s.entangledLanes&=l,l=s.entanglements;var y=s.eventTimes;for(s=s.expirationTimes;0<d;){var _=31-Jt(d),C=1<<_;l[_]=0,y[_]=-1,s[_]=-1,d&=~C}}function Rd(s,l){var d=s.entangledLanes|=l;for(s=s.entanglements;d;){var y=31-Jt(d),_=1<<y;_&l|s[y]&l&&(s[y]|=l),d&=~_}}var Fe=0;function zb(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Vb,Ad,Ub,Hb,Wb,Td=!1,Zl=[],qr=null,$r=null,Fr=null,Vo=new Map,Uo=new Map,Br=[],_L="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 Kb(s,l){switch(s){case"focusin":case"focusout":qr=null;break;case"dragenter":case"dragleave":$r=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":Vo.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(l.pointerId)}}function Ho(s,l,d,y,_,C){return s===null||s.nativeEvent!==C?(s={blockedOn:l,domEventName:d,eventSystemFlags:y,nativeEvent:C,targetContainers:[_]},l!==null&&(l=sa(l),l!==null&&Ad(l)),s):(s.eventSystemFlags|=y,l=s.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),s)}function SL(s,l,d,y,_){switch(l){case"focusin":return qr=Ho(qr,s,l,d,y,_),!0;case"dragenter":return $r=Ho($r,s,l,d,y,_),!0;case"mouseover":return Fr=Ho(Fr,s,l,d,y,_),!0;case"pointerover":var C=_.pointerId;return Vo.set(C,Ho(Vo.get(C)||null,s,l,d,y,_)),!0;case"gotpointercapture":return C=_.pointerId,Uo.set(C,Ho(Uo.get(C)||null,s,l,d,y,_)),!0}return!1}function Gb(s){var l=Ei(s.target);if(l!==null){var d=Hn(l);if(d!==null){if(l=d.tag,l===13){if(l=qo(d),l!==null){s.blockedOn=l,Wb(s.priority,function(){Ub(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){s.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}s.blockedOn=null}function ec(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var d=Id(s.domEventName,s.eventSystemFlags,l[0],s.nativeEvent);if(d===null){d=s.nativeEvent;var y=new d.constructor(d.type,d);Mo=y,d.target.dispatchEvent(y),Mo=null}else return l=sa(d),l!==null&&Ad(l),s.blockedOn=d,!1;l.shift()}return!0}function Yb(s,l,d){ec(s)&&d.delete(l)}function kL(){Td=!1,qr!==null&&ec(qr)&&(qr=null),$r!==null&&ec($r)&&($r=null),Fr!==null&&ec(Fr)&&(Fr=null),Vo.forEach(Yb),Uo.forEach(Yb)}function Wo(s,l){s.blockedOn===l&&(s.blockedOn=null,Td||(Td=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kL)))}function Ko(s){function l(_){return Wo(_,s)}if(0<Zl.length){Wo(Zl[0],s);for(var d=1;d<Zl.length;d++){var y=Zl[d];y.blockedOn===s&&(y.blockedOn=null)}}for(qr!==null&&Wo(qr,s),$r!==null&&Wo($r,s),Fr!==null&&Wo(Fr,s),Vo.forEach(l),Uo.forEach(l),d=0;d<Br.length;d++)y=Br[d],y.blockedOn===s&&(y.blockedOn=null);for(;0<Br.length&&(d=Br[0],d.blockedOn===null);)Gb(d),d.blockedOn===null&&Br.shift()}var ps=E.ReactCurrentBatchConfig,tc=!0;function EL(s,l,d,y){var _=Fe,C=ps.transition;ps.transition=null;try{Fe=1,Md(s,l,d,y)}finally{Fe=_,ps.transition=C}}function NL(s,l,d,y){var _=Fe,C=ps.transition;ps.transition=null;try{Fe=4,Md(s,l,d,y)}finally{Fe=_,ps.transition=C}}function Md(s,l,d,y){if(tc){var _=Id(s,l,d,y);if(_===null)Xd(s,l,y,nc,d),Kb(s,y);else if(SL(_,s,l,d,y))y.stopPropagation();else if(Kb(s,y),l&4&&-1<_L.indexOf(s)){for(;_!==null;){var C=sa(_);if(C!==null&&Vb(C),C=Id(s,l,d,y),C===null&&Xd(s,l,y,nc,d),C===_)break;_=C}_!==null&&y.stopPropagation()}else Xd(s,l,y,null,d)}}var nc=null;function Id(s,l,d,y){if(nc=null,s=Io(y),s=Ei(s),s!==null)if(l=Hn(s),l===null)s=null;else if(d=l.tag,d===13){if(s=qo(l),s!==null)return s;s=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null);return nc=s,null}function Xb(s){switch(s){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(_d()){case Fo:return 1;case Yl:return 4;case cs:case Sd:return 16;case Xl:return 536870912;default:return 16}default:return 16}}var zr=null,Od=null,rc=null;function Qb(){if(rc)return rc;var s,l=Od,d=l.length,y,_="value"in zr?zr.value:zr.textContent,C=_.length;for(s=0;s<d&&l[s]===_[s];s++);var M=d-s;for(y=1;y<=M&&l[d-y]===_[C-y];y++);return rc=_.slice(s,1<y?1-y:void 0)}function ic(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function sc(){return!0}function Jb(){return!1}function Zt(s){function l(d,y,_,C,M){this._reactName=d,this._targetInst=_,this.type=y,this.nativeEvent=C,this.target=M,this.currentTarget=null;for(var H in s)s.hasOwnProperty(H)&&(d=s[H],this[H]=d?d(C):C[H]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?sc:Jb,this.isPropagationStopped=Jb,this}return Y(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=sc)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=sc)},persist:function(){},isPersistent:sc}),l}var ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pd=Zt(ms),Go=Y({},ms,{view:0,detail:0}),CL=Zt(Go),Ld,Dd,Yo,oc=Y({},Go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$d,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Yo&&(Yo&&s.type==="mousemove"?(Ld=s.screenX-Yo.screenX,Dd=s.screenY-Yo.screenY):Dd=Ld=0,Yo=s),Ld)},movementY:function(s){return"movementY"in s?s.movementY:Dd}}),Zb=Zt(oc),jL=Y({},oc,{dataTransfer:0}),RL=Zt(jL),AL=Y({},Go,{relatedTarget:0}),qd=Zt(AL),TL=Y({},ms,{animationName:0,elapsedTime:0,pseudoElement:0}),ML=Zt(TL),IL=Y({},ms,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),OL=Zt(IL),PL=Y({},ms,{data:0}),e1=Zt(PL),LL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},qL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $L(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=qL[s])?!!l[s]:!1}function $d(){return $L}var FL=Y({},Go,{key:function(s){if(s.key){var l=LL[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=ic(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?DL[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$d,charCode:function(s){return s.type==="keypress"?ic(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?ic(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),BL=Zt(FL),zL=Y({},oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),t1=Zt(zL),VL=Y({},Go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$d}),UL=Zt(VL),HL=Y({},ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),WL=Zt(HL),KL=Y({},oc,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),GL=Zt(KL),YL=[9,13,27,32],Fd=c&&"CompositionEvent"in window,Xo=null;c&&"documentMode"in document&&(Xo=document.documentMode);var XL=c&&"TextEvent"in window&&!Xo,n1=c&&(!Fd||Xo&&8<Xo&&11>=Xo),r1=" ",i1=!1;function s1(s,l){switch(s){case"keyup":return YL.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function o1(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var gs=!1;function QL(s,l){switch(s){case"compositionend":return o1(l);case"keypress":return l.which!==32?null:(i1=!0,r1);case"textInput":return s=l.data,s===r1&&i1?null:s;default:return null}}function JL(s,l){if(gs)return s==="compositionend"||!Fd&&s1(s,l)?(s=Qb(),rc=Od=zr=null,gs=!1,s):null;switch(s){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 n1&&l.locale!=="ko"?null:l.data;default:return null}}var ZL={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 a1(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!ZL[s.type]:l==="textarea"}function l1(s,l,d,y){$l(y),l=fc(l,"onChange"),0<l.length&&(d=new Pd("onChange","change",null,d,y),s.push({event:d,listeners:l}))}var Qo=null,Jo=null;function e4(s){N1(s,0)}function ac(s){var l=bs(s);if(me(l))return s}function t4(s,l){if(s==="change")return l}var c1=!1;if(c){var Bd;if(c){var zd="oninput"in document;if(!zd){var u1=document.createElement("div");u1.setAttribute("oninput","return;"),zd=typeof u1.oninput=="function"}Bd=zd}else Bd=!1;c1=Bd&&(!document.documentMode||9<document.documentMode)}function f1(){Qo&&(Qo.detachEvent("onpropertychange",d1),Jo=Qo=null)}function d1(s){if(s.propertyName==="value"&&ac(Jo)){var l=[];l1(l,Jo,s,Io(s)),Vl(e4,l)}}function n4(s,l,d){s==="focusin"?(f1(),Qo=l,Jo=d,Qo.attachEvent("onpropertychange",d1)):s==="focusout"&&f1()}function r4(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return ac(Jo)}function i4(s,l){if(s==="click")return ac(l)}function s4(s,l){if(s==="input"||s==="change")return ac(l)}function o4(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var En=typeof Object.is=="function"?Object.is:o4;function Zo(s,l){if(En(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var d=Object.keys(s),y=Object.keys(l);if(d.length!==y.length)return!1;for(y=0;y<d.length;y++){var _=d[y];if(!u.call(l,_)||!En(s[_],l[_]))return!1}return!0}function h1(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function p1(s,l){var d=h1(s);s=0;for(var y;d;){if(d.nodeType===3){if(y=s+d.textContent.length,s<=l&&y>=l)return{node:d,offset:l-s};s=y}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=h1(d)}}function m1(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?m1(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function g1(){for(var s=window,l=de();l instanceof s.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)s=l.contentWindow;else break;l=de(s.document)}return l}function Vd(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}function a4(s){var l=g1(),d=s.focusedElem,y=s.selectionRange;if(l!==d&&d&&d.ownerDocument&&m1(d.ownerDocument.documentElement,d)){if(y!==null&&Vd(d)){if(l=y.start,s=y.end,s===void 0&&(s=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(s,d.value.length);else if(s=(l=d.ownerDocument||document)&&l.defaultView||window,s.getSelection){s=s.getSelection();var _=d.textContent.length,C=Math.min(y.start,_);y=y.end===void 0?C:Math.min(y.end,_),!s.extend&&C>y&&(_=y,y=C,C=_),_=p1(d,C);var M=p1(d,y);_&&M&&(s.rangeCount!==1||s.anchorNode!==_.node||s.anchorOffset!==_.offset||s.focusNode!==M.node||s.focusOffset!==M.offset)&&(l=l.createRange(),l.setStart(_.node,_.offset),s.removeAllRanges(),C>y?(s.addRange(l),s.extend(M.node,M.offset)):(l.setEnd(M.node,M.offset),s.addRange(l)))}}for(l=[],s=d;s=s.parentNode;)s.nodeType===1&&l.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)s=l[d],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var l4=c&&"documentMode"in document&&11>=document.documentMode,ys=null,Ud=null,ea=null,Hd=!1;function y1(s,l,d){var y=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Hd||ys==null||ys!==de(y)||(y=ys,"selectionStart"in y&&Vd(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ea&&Zo(ea,y)||(ea=y,y=fc(Ud,"onSelect"),0<y.length&&(l=new Pd("onSelect","select",null,l,d),s.push({event:l,listeners:y}),l.target=ys)))}function lc(s,l){var d={};return d[s.toLowerCase()]=l.toLowerCase(),d["Webkit"+s]="webkit"+l,d["Moz"+s]="moz"+l,d}var vs={animationend:lc("Animation","AnimationEnd"),animationiteration:lc("Animation","AnimationIteration"),animationstart:lc("Animation","AnimationStart"),transitionend:lc("Transition","TransitionEnd")},Wd={},v1={};c&&(v1=document.createElement("div").style,"AnimationEvent"in window||(delete vs.animationend.animation,delete vs.animationiteration.animation,delete vs.animationstart.animation),"TransitionEvent"in window||delete vs.transitionend.transition);function cc(s){if(Wd[s])return Wd[s];if(!vs[s])return s;var l=vs[s],d;for(d in l)if(l.hasOwnProperty(d)&&d in v1)return Wd[s]=l[d];return s}var x1=cc("animationend"),w1=cc("animationiteration"),b1=cc("animationstart"),_1=cc("transitionend"),S1=new Map,k1="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 Vr(s,l){S1.set(s,l),o(l,[s])}for(var Kd=0;Kd<k1.length;Kd++){var Gd=k1[Kd],c4=Gd.toLowerCase(),u4=Gd[0].toUpperCase()+Gd.slice(1);Vr(c4,"on"+u4)}Vr(x1,"onAnimationEnd"),Vr(w1,"onAnimationIteration"),Vr(b1,"onAnimationStart"),Vr("dblclick","onDoubleClick"),Vr("focusin","onFocus"),Vr("focusout","onBlur"),Vr(_1,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ta="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(" "),f4=new Set("cancel close invalid load scroll toggle".split(" ").concat(ta));function E1(s,l,d){var y=s.type||"unknown-event";s.currentTarget=d,xd(y,l,void 0,s),s.currentTarget=null}function N1(s,l){l=(l&4)!==0;for(var d=0;d<s.length;d++){var y=s[d],_=y.event;y=y.listeners;e:{var C=void 0;if(l)for(var M=y.length-1;0<=M;M--){var H=y[M],X=H.instance,ie=H.currentTarget;if(H=H.listener,X!==C&&_.isPropagationStopped())break e;E1(_,H,ie),C=X}else for(M=0;M<y.length;M++){if(H=y[M],X=H.instance,ie=H.currentTarget,H=H.listener,X!==C&&_.isPropagationStopped())break e;E1(_,H,ie),C=X}}}if(ls)throw s=Do,ls=!1,Do=null,s}function He(s,l){var d=l[nh];d===void 0&&(d=l[nh]=new Set);var y=s+"__bubble";d.has(y)||(C1(l,s,2,!1),d.add(y))}function Yd(s,l,d){var y=0;l&&(y|=4),C1(d,s,y,l)}var uc="_reactListening"+Math.random().toString(36).slice(2);function na(s){if(!s[uc]){s[uc]=!0,r.forEach(function(d){d!=="selectionchange"&&(f4.has(d)||Yd(d,!1,s),Yd(d,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[uc]||(l[uc]=!0,Yd("selectionchange",!1,l))}}function C1(s,l,d,y){switch(Xb(l)){case 1:var _=EL;break;case 4:_=NL;break;default:_=Md}d=_.bind(null,l,d,s),_=void 0,!Lo||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(_=!0),y?_!==void 0?s.addEventListener(l,d,{capture:!0,passive:_}):s.addEventListener(l,d,!0):_!==void 0?s.addEventListener(l,d,{passive:_}):s.addEventListener(l,d,!1)}function Xd(s,l,d,y,_){var C=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var M=y.tag;if(M===3||M===4){var H=y.stateNode.containerInfo;if(H===_||H.nodeType===8&&H.parentNode===_)break;if(M===4)for(M=y.return;M!==null;){var X=M.tag;if((X===3||X===4)&&(X=M.stateNode.containerInfo,X===_||X.nodeType===8&&X.parentNode===_))return;M=M.return}for(;H!==null;){if(M=Ei(H),M===null)return;if(X=M.tag,X===5||X===6){y=C=M;continue e}H=H.parentNode}}y=y.return}Vl(function(){var ie=C,le=Io(d),ce=[];e:{var ae=S1.get(s);if(ae!==void 0){var pe=Pd,xe=s;switch(s){case"keypress":if(ic(d)===0)break e;case"keydown":case"keyup":pe=BL;break;case"focusin":xe="focus",pe=qd;break;case"focusout":xe="blur",pe=qd;break;case"beforeblur":case"afterblur":pe=qd;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Zb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=RL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=UL;break;case x1:case w1:case b1:pe=ML;break;case _1:pe=WL;break;case"scroll":pe=CL;break;case"wheel":pe=GL;break;case"copy":case"cut":case"paste":pe=OL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=t1}var be=(l&4)!==0,at=!be&&s==="scroll",ne=be?ae!==null?ae+"Capture":null:ae;be=[];for(var Z=ie,re;Z!==null;){re=Z;var ue=re.stateNode;if(re.tag===5&&ue!==null&&(re=ue,ne!==null&&(ue=wi(Z,ne),ue!=null&&be.push(ra(Z,ue,re)))),at)break;Z=Z.return}0<be.length&&(ae=new pe(ae,xe,null,d,le),ce.push({event:ae,listeners:be}))}}if((l&7)===0){e:{if(ae=s==="mouseover"||s==="pointerover",pe=s==="mouseout"||s==="pointerout",ae&&d!==Mo&&(xe=d.relatedTarget||d.fromElement)&&(Ei(xe)||xe[pr]))break e;if((pe||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,pe?(xe=d.relatedTarget||d.toElement,pe=ie,xe=xe?Ei(xe):null,xe!==null&&(at=Hn(xe),xe!==at||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(pe=null,xe=ie),pe!==xe)){if(be=Zb,ue="onMouseLeave",ne="onMouseEnter",Z="mouse",(s==="pointerout"||s==="pointerover")&&(be=t1,ue="onPointerLeave",ne="onPointerEnter",Z="pointer"),at=pe==null?ae:bs(pe),re=xe==null?ae:bs(xe),ae=new be(ue,Z+"leave",pe,d,le),ae.target=at,ae.relatedTarget=re,ue=null,Ei(le)===ie&&(be=new be(ne,Z+"enter",xe,d,le),be.target=re,be.relatedTarget=at,ue=be),at=ue,pe&&xe)t:{for(be=pe,ne=xe,Z=0,re=be;re;re=xs(re))Z++;for(re=0,ue=ne;ue;ue=xs(ue))re++;for(;0<Z-re;)be=xs(be),Z--;for(;0<re-Z;)ne=xs(ne),re--;for(;Z--;){if(be===ne||ne!==null&&be===ne.alternate)break t;be=xs(be),ne=xs(ne)}be=null}else be=null;pe!==null&&j1(ce,ae,pe,be,!1),xe!==null&&at!==null&&j1(ce,at,xe,be,!0)}}e:{if(ae=ie?bs(ie):window,pe=ae.nodeName&&ae.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ae.type==="file")var Se=t4;else if(a1(ae))if(c1)Se=s4;else{Se=r4;var Ce=n4}else(pe=ae.nodeName)&&pe.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Se=i4);if(Se&&(Se=Se(s,ie))){l1(ce,Se,d,le);break e}Ce&&Ce(s,ae,ie),s==="focusout"&&(Ce=ae._wrapperState)&&Ce.controlled&&ae.type==="number"&&Le(ae,"number",ae.value)}switch(Ce=ie?bs(ie):window,s){case"focusin":(a1(Ce)||Ce.contentEditable==="true")&&(ys=Ce,Ud=ie,ea=null);break;case"focusout":ea=Ud=ys=null;break;case"mousedown":Hd=!0;break;case"contextmenu":case"mouseup":case"dragend":Hd=!1,y1(ce,d,le);break;case"selectionchange":if(l4)break;case"keydown":case"keyup":y1(ce,d,le)}var je;if(Fd)e:{switch(s){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else gs?s1(s,d)&&(Re="onCompositionEnd"):s==="keydown"&&d.keyCode===229&&(Re="onCompositionStart");Re&&(n1&&d.locale!=="ko"&&(gs||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&gs&&(je=Qb()):(zr=le,Od="value"in zr?zr.value:zr.textContent,gs=!0)),Ce=fc(ie,Re),0<Ce.length&&(Re=new e1(Re,s,null,d,le),ce.push({event:Re,listeners:Ce}),je?Re.data=je:(je=o1(d),je!==null&&(Re.data=je)))),(je=XL?QL(s,d):JL(s,d))&&(ie=fc(ie,"onBeforeInput"),0<ie.length&&(le=new e1("onBeforeInput","beforeinput",null,d,le),ce.push({event:le,listeners:ie}),le.data=je))}N1(ce,l)})}function ra(s,l,d){return{instance:s,listener:l,currentTarget:d}}function fc(s,l){for(var d=l+"Capture",y=[];s!==null;){var _=s,C=_.stateNode;_.tag===5&&C!==null&&(_=C,C=wi(s,d),C!=null&&y.unshift(ra(s,C,_)),C=wi(s,l),C!=null&&y.push(ra(s,C,_))),s=s.return}return y}function xs(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function j1(s,l,d,y,_){for(var C=l._reactName,M=[];d!==null&&d!==y;){var H=d,X=H.alternate,ie=H.stateNode;if(X!==null&&X===y)break;H.tag===5&&ie!==null&&(H=ie,_?(X=wi(d,C),X!=null&&M.unshift(ra(d,X,H))):_||(X=wi(d,C),X!=null&&M.push(ra(d,X,H)))),d=d.return}M.length!==0&&s.push({event:l,listeners:M})}var d4=/\r\n?/g,h4=/\u0000|\uFFFD/g;function R1(s){return(typeof s=="string"?s:""+s).replace(d4,`
38
- `).replace(h4,"")}function dc(s,l,d){if(l=R1(l),R1(s)!==l&&d)throw Error(n(425))}function hc(){}var Qd=null,Jd=null;function Zd(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var eh=typeof setTimeout=="function"?setTimeout:void 0,p4=typeof clearTimeout=="function"?clearTimeout:void 0,A1=typeof Promise=="function"?Promise:void 0,m4=typeof queueMicrotask=="function"?queueMicrotask:typeof A1<"u"?function(s){return A1.resolve(null).then(s).catch(g4)}:eh;function g4(s){setTimeout(function(){throw s})}function th(s,l){var d=l,y=0;do{var _=d.nextSibling;if(s.removeChild(d),_&&_.nodeType===8)if(d=_.data,d==="/$"){if(y===0){s.removeChild(_),Ko(l);return}y--}else d!=="$"&&d!=="$?"&&d!=="$!"||y++;d=_}while(d);Ko(l)}function Ur(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return s}function T1(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var d=s.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return s;l--}else d==="/$"&&l++}s=s.previousSibling}return null}var ws=Math.random().toString(36).slice(2),Kn="__reactFiber$"+ws,ia="__reactProps$"+ws,pr="__reactContainer$"+ws,nh="__reactEvents$"+ws,y4="__reactListeners$"+ws,v4="__reactHandles$"+ws;function Ei(s){var l=s[Kn];if(l)return l;for(var d=s.parentNode;d;){if(l=d[pr]||d[Kn]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(s=T1(s);s!==null;){if(d=s[Kn])return d;s=T1(s)}return l}s=d,d=s.parentNode}return null}function sa(s){return s=s[Kn]||s[pr],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function bs(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function pc(s){return s[ia]||null}var rh=[],_s=-1;function Hr(s){return{current:s}}function We(s){0>_s||(s.current=rh[_s],rh[_s]=null,_s--)}function ze(s,l){_s++,rh[_s]=s.current,s.current=l}var Wr={},Nt=Hr(Wr),Vt=Hr(!1),Ni=Wr;function Ss(s,l){var d=s.type.contextTypes;if(!d)return Wr;var y=s.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var _={},C;for(C in d)_[C]=l[C];return y&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=l,s.__reactInternalMemoizedMaskedChildContext=_),_}function Ut(s){return s=s.childContextTypes,s!=null}function mc(){We(Vt),We(Nt)}function M1(s,l,d){if(Nt.current!==Wr)throw Error(n(168));ze(Nt,l),ze(Vt,d)}function I1(s,l,d){var y=s.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return d;y=y.getChildContext();for(var _ in y)if(!(_ in l))throw Error(n(108,ee(s)||"Unknown",_));return Y({},d,y)}function gc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Wr,Ni=Nt.current,ze(Nt,s),ze(Vt,Vt.current),!0}function O1(s,l,d){var y=s.stateNode;if(!y)throw Error(n(169));d?(s=I1(s,l,Ni),y.__reactInternalMemoizedMergedChildContext=s,We(Vt),We(Nt),ze(Nt,s)):We(Vt),ze(Vt,d)}var mr=null,yc=!1,ih=!1;function P1(s){mr===null?mr=[s]:mr.push(s)}function x4(s){yc=!0,P1(s)}function Kr(){if(!ih&&mr!==null){ih=!0;var s=0,l=Fe;try{var d=mr;for(Fe=1;s<d.length;s++){var y=d[s];do y=y(!0);while(y!==null)}mr=null,yc=!1}catch(_){throw mr!==null&&(mr=mr.slice(s+1)),Wl(Fo,Kr),_}finally{Fe=l,ih=!1}}return null}var ks=[],Es=0,vc=null,xc=0,fn=[],dn=0,Ci=null,gr=1,yr="";function ji(s,l){ks[Es++]=xc,ks[Es++]=vc,vc=s,xc=l}function L1(s,l,d){fn[dn++]=gr,fn[dn++]=yr,fn[dn++]=Ci,Ci=s;var y=gr;s=yr;var _=32-Jt(y)-1;y&=~(1<<_),d+=1;var C=32-Jt(l)+_;if(30<C){var M=_-_%5;C=(y&(1<<M)-1).toString(32),y>>=M,_-=M,gr=1<<32-Jt(l)+_|d<<_|y,yr=C+s}else gr=1<<C|d<<_|y,yr=s}function sh(s){s.return!==null&&(ji(s,1),L1(s,1,0))}function oh(s){for(;s===vc;)vc=ks[--Es],ks[Es]=null,xc=ks[--Es],ks[Es]=null;for(;s===Ci;)Ci=fn[--dn],fn[dn]=null,yr=fn[--dn],fn[dn]=null,gr=fn[--dn],fn[dn]=null}var en=null,tn=null,Ye=!1,Nn=null;function D1(s,l){var d=gn(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=s,l=s.deletions,l===null?(s.deletions=[d],s.flags|=16):l.push(d)}function q1(s,l){switch(s.tag){case 5:var d=s.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(s.stateNode=l,en=s,tn=Ur(l.firstChild),!0):!1;case 6:return l=s.pendingProps===""||l.nodeType!==3?null:l,l!==null?(s.stateNode=l,en=s,tn=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=Ci!==null?{id:gr,overflow:yr}:null,s.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=gn(18,null,null,0),d.stateNode=l,d.return=s,s.child=d,en=s,tn=null,!0):!1;default:return!1}}function ah(s){return(s.mode&1)!==0&&(s.flags&128)===0}function lh(s){if(Ye){var l=tn;if(l){var d=l;if(!q1(s,l)){if(ah(s))throw Error(n(418));l=Ur(d.nextSibling);var y=en;l&&q1(s,l)?D1(y,d):(s.flags=s.flags&-4097|2,Ye=!1,en=s)}}else{if(ah(s))throw Error(n(418));s.flags=s.flags&-4097|2,Ye=!1,en=s}}}function $1(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;en=s}function wc(s){if(s!==en)return!1;if(!Ye)return $1(s),Ye=!0,!1;var l;if((l=s.tag!==3)&&!(l=s.tag!==5)&&(l=s.type,l=l!=="head"&&l!=="body"&&!Zd(s.type,s.memoizedProps)),l&&(l=tn)){if(ah(s))throw F1(),Error(n(418));for(;l;)D1(s,l),l=Ur(l.nextSibling)}if($1(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,l=0;s;){if(s.nodeType===8){var d=s.data;if(d==="/$"){if(l===0){tn=Ur(s.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}s=s.nextSibling}tn=null}}else tn=en?Ur(s.stateNode.nextSibling):null;return!0}function F1(){for(var s=tn;s;)s=Ur(s.nextSibling)}function Ns(){tn=en=null,Ye=!1}function ch(s){Nn===null?Nn=[s]:Nn.push(s)}var w4=E.ReactCurrentBatchConfig;function oa(s,l,d){if(s=d.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var y=d.stateNode}if(!y)throw Error(n(147,s));var _=y,C=""+s;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(M){var H=_.refs;M===null?delete H[C]:H[C]=M},l._stringRef=C,l)}if(typeof s!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,s))}return s}function bc(s,l){throw s=Object.prototype.toString.call(l),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s))}function B1(s){var l=s._init;return l(s._payload)}function z1(s){function l(ne,Z){if(s){var re=ne.deletions;re===null?(ne.deletions=[Z],ne.flags|=16):re.push(Z)}}function d(ne,Z){if(!s)return null;for(;Z!==null;)l(ne,Z),Z=Z.sibling;return null}function y(ne,Z){for(ne=new Map;Z!==null;)Z.key!==null?ne.set(Z.key,Z):ne.set(Z.index,Z),Z=Z.sibling;return ne}function _(ne,Z){return ne=ti(ne,Z),ne.index=0,ne.sibling=null,ne}function C(ne,Z,re){return ne.index=re,s?(re=ne.alternate,re!==null?(re=re.index,re<Z?(ne.flags|=2,Z):re):(ne.flags|=2,Z)):(ne.flags|=1048576,Z)}function M(ne){return s&&ne.alternate===null&&(ne.flags|=2),ne}function H(ne,Z,re,ue){return Z===null||Z.tag!==6?(Z=ep(re,ne.mode,ue),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function X(ne,Z,re,ue){var Se=re.type;return Se===A?le(ne,Z,re.props.children,ue,re.key):Z!==null&&(Z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===z&&B1(Se)===Z.type)?(ue=_(Z,re.props),ue.ref=oa(ne,Z,re),ue.return=ne,ue):(ue=Hc(re.type,re.key,re.props,null,ne.mode,ue),ue.ref=oa(ne,Z,re),ue.return=ne,ue)}function ie(ne,Z,re,ue){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=tp(re,ne.mode,ue),Z.return=ne,Z):(Z=_(Z,re.children||[]),Z.return=ne,Z)}function le(ne,Z,re,ue,Se){return Z===null||Z.tag!==7?(Z=Li(re,ne.mode,ue,Se),Z.return=ne,Z):(Z=_(Z,re),Z.return=ne,Z)}function ce(ne,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=ep(""+Z,ne.mode,re),Z.return=ne,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:return re=Hc(Z.type,Z.key,Z.props,null,ne.mode,re),re.ref=oa(ne,null,Z),re.return=ne,re;case T:return Z=tp(Z,ne.mode,re),Z.return=ne,Z;case z:var ue=Z._init;return ce(ne,ue(Z._payload),re)}if(gt(Z)||$(Z))return Z=Li(Z,ne.mode,re,null),Z.return=ne,Z;bc(ne,Z)}return null}function ae(ne,Z,re,ue){var Se=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Se!==null?null:H(ne,Z,""+re,ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case R:return re.key===Se?X(ne,Z,re,ue):null;case T:return re.key===Se?ie(ne,Z,re,ue):null;case z:return Se=re._init,ae(ne,Z,Se(re._payload),ue)}if(gt(re)||$(re))return Se!==null?null:le(ne,Z,re,ue,null);bc(ne,re)}return null}function pe(ne,Z,re,ue,Se){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return ne=ne.get(re)||null,H(Z,ne,""+ue,Se);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case R:return ne=ne.get(ue.key===null?re:ue.key)||null,X(Z,ne,ue,Se);case T:return ne=ne.get(ue.key===null?re:ue.key)||null,ie(Z,ne,ue,Se);case z:var Ce=ue._init;return pe(ne,Z,re,Ce(ue._payload),Se)}if(gt(ue)||$(ue))return ne=ne.get(re)||null,le(Z,ne,ue,Se,null);bc(Z,ue)}return null}function xe(ne,Z,re,ue){for(var Se=null,Ce=null,je=Z,Re=Z=0,_t=null;je!==null&&Re<re.length;Re++){je.index>Re?(_t=je,je=null):_t=je.sibling;var $e=ae(ne,je,re[Re],ue);if($e===null){je===null&&(je=_t);break}s&&je&&$e.alternate===null&&l(ne,je),Z=C($e,Z,Re),Ce===null?Se=$e:Ce.sibling=$e,Ce=$e,je=_t}if(Re===re.length)return d(ne,je),Ye&&ji(ne,Re),Se;if(je===null){for(;Re<re.length;Re++)je=ce(ne,re[Re],ue),je!==null&&(Z=C(je,Z,Re),Ce===null?Se=je:Ce.sibling=je,Ce=je);return Ye&&ji(ne,Re),Se}for(je=y(ne,je);Re<re.length;Re++)_t=pe(je,ne,Re,re[Re],ue),_t!==null&&(s&&_t.alternate!==null&&je.delete(_t.key===null?Re:_t.key),Z=C(_t,Z,Re),Ce===null?Se=_t:Ce.sibling=_t,Ce=_t);return s&&je.forEach(function(ni){return l(ne,ni)}),Ye&&ji(ne,Re),Se}function be(ne,Z,re,ue){var Se=$(re);if(typeof Se!="function")throw Error(n(150));if(re=Se.call(re),re==null)throw Error(n(151));for(var Ce=Se=null,je=Z,Re=Z=0,_t=null,$e=re.next();je!==null&&!$e.done;Re++,$e=re.next()){je.index>Re?(_t=je,je=null):_t=je.sibling;var ni=ae(ne,je,$e.value,ue);if(ni===null){je===null&&(je=_t);break}s&&je&&ni.alternate===null&&l(ne,je),Z=C(ni,Z,Re),Ce===null?Se=ni:Ce.sibling=ni,Ce=ni,je=_t}if($e.done)return d(ne,je),Ye&&ji(ne,Re),Se;if(je===null){for(;!$e.done;Re++,$e=re.next())$e=ce(ne,$e.value,ue),$e!==null&&(Z=C($e,Z,Re),Ce===null?Se=$e:Ce.sibling=$e,Ce=$e);return Ye&&ji(ne,Re),Se}for(je=y(ne,je);!$e.done;Re++,$e=re.next())$e=pe(je,ne,Re,$e.value,ue),$e!==null&&(s&&$e.alternate!==null&&je.delete($e.key===null?Re:$e.key),Z=C($e,Z,Re),Ce===null?Se=$e:Ce.sibling=$e,Ce=$e);return s&&je.forEach(function(Z4){return l(ne,Z4)}),Ye&&ji(ne,Re),Se}function at(ne,Z,re,ue){if(typeof re=="object"&&re!==null&&re.type===A&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case R:e:{for(var Se=re.key,Ce=Z;Ce!==null;){if(Ce.key===Se){if(Se=re.type,Se===A){if(Ce.tag===7){d(ne,Ce.sibling),Z=_(Ce,re.props.children),Z.return=ne,ne=Z;break e}}else if(Ce.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===z&&B1(Se)===Ce.type){d(ne,Ce.sibling),Z=_(Ce,re.props),Z.ref=oa(ne,Ce,re),Z.return=ne,ne=Z;break e}d(ne,Ce);break}else l(ne,Ce);Ce=Ce.sibling}re.type===A?(Z=Li(re.props.children,ne.mode,ue,re.key),Z.return=ne,ne=Z):(ue=Hc(re.type,re.key,re.props,null,ne.mode,ue),ue.ref=oa(ne,Z,re),ue.return=ne,ne=ue)}return M(ne);case T:e:{for(Ce=re.key;Z!==null;){if(Z.key===Ce)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){d(ne,Z.sibling),Z=_(Z,re.children||[]),Z.return=ne,ne=Z;break e}else{d(ne,Z);break}else l(ne,Z);Z=Z.sibling}Z=tp(re,ne.mode,ue),Z.return=ne,ne=Z}return M(ne);case z:return Ce=re._init,at(ne,Z,Ce(re._payload),ue)}if(gt(re))return xe(ne,Z,re,ue);if($(re))return be(ne,Z,re,ue);bc(ne,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Z!==null&&Z.tag===6?(d(ne,Z.sibling),Z=_(Z,re),Z.return=ne,ne=Z):(d(ne,Z),Z=ep(re,ne.mode,ue),Z.return=ne,ne=Z),M(ne)):d(ne,Z)}return at}var Cs=z1(!0),V1=z1(!1),_c=Hr(null),Sc=null,js=null,uh=null;function fh(){uh=js=Sc=null}function dh(s){var l=_c.current;We(_c),s._currentValue=l}function hh(s,l,d){for(;s!==null;){var y=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),s===d)break;s=s.return}}function Rs(s,l){Sc=s,uh=js=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&l)!==0&&(Ht=!0),s.firstContext=null)}function hn(s){var l=s._currentValue;if(uh!==s)if(s={context:s,memoizedValue:l,next:null},js===null){if(Sc===null)throw Error(n(308));js=s,Sc.dependencies={lanes:0,firstContext:s}}else js=js.next=s;return l}var Ri=null;function ph(s){Ri===null?Ri=[s]:Ri.push(s)}function U1(s,l,d,y){var _=l.interleaved;return _===null?(d.next=d,ph(l)):(d.next=_.next,_.next=d),l.interleaved=d,vr(s,y)}function vr(s,l){s.lanes|=l;var d=s.alternate;for(d!==null&&(d.lanes|=l),d=s,s=s.return;s!==null;)s.childLanes|=l,d=s.alternate,d!==null&&(d.childLanes|=l),d=s,s=s.return;return d.tag===3?d.stateNode:null}var Gr=!1;function mh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function H1(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function xr(s,l){return{eventTime:s,lane:l,tag:0,payload:null,callback:null,next:null}}function Yr(s,l,d){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(qe&2)!==0){var _=y.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),y.pending=l,vr(s,d)}return _=y.interleaved,_===null?(l.next=l,ph(y)):(l.next=_.next,_.next=l),y.interleaved=l,vr(s,d)}function kc(s,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var y=l.lanes;y&=s.pendingLanes,d|=y,l.lanes=d,Rd(s,d)}}function W1(s,l){var d=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var _=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var M={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?_=C=M:C=C.next=M,d=d.next}while(d!==null);C===null?_=C=l:C=C.next=l}else _=C=l;d={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:C,shared:y.shared,effects:y.effects},s.updateQueue=d;return}s=d.lastBaseUpdate,s===null?d.firstBaseUpdate=l:s.next=l,d.lastBaseUpdate=l}function Ec(s,l,d,y){var _=s.updateQueue;Gr=!1;var C=_.firstBaseUpdate,M=_.lastBaseUpdate,H=_.shared.pending;if(H!==null){_.shared.pending=null;var X=H,ie=X.next;X.next=null,M===null?C=ie:M.next=ie,M=X;var le=s.alternate;le!==null&&(le=le.updateQueue,H=le.lastBaseUpdate,H!==M&&(H===null?le.firstBaseUpdate=ie:H.next=ie,le.lastBaseUpdate=X))}if(C!==null){var ce=_.baseState;M=0,le=ie=X=null,H=C;do{var ae=H.lane,pe=H.eventTime;if((y&ae)===ae){le!==null&&(le=le.next={eventTime:pe,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var xe=s,be=H;switch(ae=l,pe=d,be.tag){case 1:if(xe=be.payload,typeof xe=="function"){ce=xe.call(pe,ce,ae);break e}ce=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=be.payload,ae=typeof xe=="function"?xe.call(pe,ce,ae):xe,ae==null)break e;ce=Y({},ce,ae);break e;case 2:Gr=!0}}H.callback!==null&&H.lane!==0&&(s.flags|=64,ae=_.effects,ae===null?_.effects=[H]:ae.push(H))}else pe={eventTime:pe,lane:ae,tag:H.tag,payload:H.payload,callback:H.callback,next:null},le===null?(ie=le=pe,X=ce):le=le.next=pe,M|=ae;if(H=H.next,H===null){if(H=_.shared.pending,H===null)break;ae=H,H=ae.next,ae.next=null,_.lastBaseUpdate=ae,_.shared.pending=null}}while(!0);if(le===null&&(X=ce),_.baseState=X,_.firstBaseUpdate=ie,_.lastBaseUpdate=le,l=_.shared.interleaved,l!==null){_=l;do M|=_.lane,_=_.next;while(_!==l)}else C===null&&(_.shared.lanes=0);Mi|=M,s.lanes=M,s.memoizedState=ce}}function K1(s,l,d){if(s=l.effects,l.effects=null,s!==null)for(l=0;l<s.length;l++){var y=s[l],_=y.callback;if(_!==null){if(y.callback=null,y=d,typeof _!="function")throw Error(n(191,_));_.call(y)}}}var aa={},Gn=Hr(aa),la=Hr(aa),ca=Hr(aa);function Ai(s){if(s===aa)throw Error(n(174));return s}function gh(s,l){switch(ze(ca,l),ze(la,s),ze(Gn,aa),s=l.nodeType,s){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Me(null,"");break;default:s=s===8?l.parentNode:l,l=s.namespaceURI||null,s=s.tagName,l=Me(l,s)}We(Gn),ze(Gn,l)}function As(){We(Gn),We(la),We(ca)}function G1(s){Ai(ca.current);var l=Ai(Gn.current),d=Me(l,s.type);l!==d&&(ze(la,s),ze(Gn,d))}function yh(s){la.current===s&&(We(Gn),We(la))}var nt=Hr(0);function Nc(s){for(var l=s;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.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===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var vh=[];function xh(){for(var s=0;s<vh.length;s++)vh[s]._workInProgressVersionPrimary=null;vh.length=0}var Cc=E.ReactCurrentDispatcher,wh=E.ReactCurrentBatchConfig,Ti=0,rt=null,vt=null,wt=null,jc=!1,ua=!1,fa=0,b4=0;function Ct(){throw Error(n(321))}function bh(s,l){if(l===null)return!1;for(var d=0;d<l.length&&d<s.length;d++)if(!En(s[d],l[d]))return!1;return!0}function _h(s,l,d,y,_,C){if(Ti=C,rt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Cc.current=s===null||s.memoizedState===null?E4:N4,s=d(y,_),ua){C=0;do{if(ua=!1,fa=0,25<=C)throw Error(n(301));C+=1,wt=vt=null,l.updateQueue=null,Cc.current=C4,s=d(y,_)}while(ua)}if(Cc.current=Tc,l=vt!==null&&vt.next!==null,Ti=0,wt=vt=rt=null,jc=!1,l)throw Error(n(300));return s}function Sh(){var s=fa!==0;return fa=0,s}function Yn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?rt.memoizedState=wt=s:wt=wt.next=s,wt}function pn(){if(vt===null){var s=rt.alternate;s=s!==null?s.memoizedState:null}else s=vt.next;var l=wt===null?rt.memoizedState:wt.next;if(l!==null)wt=l,vt=s;else{if(s===null)throw Error(n(310));vt=s,s={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},wt===null?rt.memoizedState=wt=s:wt=wt.next=s}return wt}function da(s,l){return typeof l=="function"?l(s):l}function kh(s){var l=pn(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=s;var y=vt,_=y.baseQueue,C=d.pending;if(C!==null){if(_!==null){var M=_.next;_.next=C.next,C.next=M}y.baseQueue=_=C,d.pending=null}if(_!==null){C=_.next,y=y.baseState;var H=M=null,X=null,ie=C;do{var le=ie.lane;if((Ti&le)===le)X!==null&&(X=X.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),y=ie.hasEagerState?ie.eagerState:s(y,ie.action);else{var ce={lane:le,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};X===null?(H=X=ce,M=y):X=X.next=ce,rt.lanes|=le,Mi|=le}ie=ie.next}while(ie!==null&&ie!==C);X===null?M=y:X.next=H,En(y,l.memoizedState)||(Ht=!0),l.memoizedState=y,l.baseState=M,l.baseQueue=X,d.lastRenderedState=y}if(s=d.interleaved,s!==null){_=s;do C=_.lane,rt.lanes|=C,Mi|=C,_=_.next;while(_!==s)}else _===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function Eh(s){var l=pn(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=s;var y=d.dispatch,_=d.pending,C=l.memoizedState;if(_!==null){d.pending=null;var M=_=_.next;do C=s(C,M.action),M=M.next;while(M!==_);En(C,l.memoizedState)||(Ht=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,y]}function Y1(){}function X1(s,l){var d=rt,y=pn(),_=l(),C=!En(y.memoizedState,_);if(C&&(y.memoizedState=_,Ht=!0),y=y.queue,Nh(Z1.bind(null,d,y,s),[s]),y.getSnapshot!==l||C||wt!==null&&wt.memoizedState.tag&1){if(d.flags|=2048,ha(9,J1.bind(null,d,y,_,l),void 0,null),bt===null)throw Error(n(349));(Ti&30)!==0||Q1(d,l,_)}return _}function Q1(s,l,d){s.flags|=16384,s={getSnapshot:l,value:d},l=rt.updateQueue,l===null?(l={lastEffect:null,stores:null},rt.updateQueue=l,l.stores=[s]):(d=l.stores,d===null?l.stores=[s]:d.push(s))}function J1(s,l,d,y){l.value=d,l.getSnapshot=y,e_(l)&&t_(s)}function Z1(s,l,d){return d(function(){e_(l)&&t_(s)})}function e_(s){var l=s.getSnapshot;s=s.value;try{var d=l();return!En(s,d)}catch{return!0}}function t_(s){var l=vr(s,1);l!==null&&An(l,s,1,-1)}function n_(s){var l=Yn();return typeof s=="function"&&(s=s()),l.memoizedState=l.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:s},l.queue=s,s=s.dispatch=k4.bind(null,rt,s),[l.memoizedState,s]}function ha(s,l,d,y){return s={tag:s,create:l,destroy:d,deps:y,next:null},l=rt.updateQueue,l===null?(l={lastEffect:null,stores:null},rt.updateQueue=l,l.lastEffect=s.next=s):(d=l.lastEffect,d===null?l.lastEffect=s.next=s:(y=d.next,d.next=s,s.next=y,l.lastEffect=s)),s}function r_(){return pn().memoizedState}function Rc(s,l,d,y){var _=Yn();rt.flags|=s,_.memoizedState=ha(1|l,d,void 0,y===void 0?null:y)}function Ac(s,l,d,y){var _=pn();y=y===void 0?null:y;var C=void 0;if(vt!==null){var M=vt.memoizedState;if(C=M.destroy,y!==null&&bh(y,M.deps)){_.memoizedState=ha(l,d,C,y);return}}rt.flags|=s,_.memoizedState=ha(1|l,d,C,y)}function i_(s,l){return Rc(8390656,8,s,l)}function Nh(s,l){return Ac(2048,8,s,l)}function s_(s,l){return Ac(4,2,s,l)}function o_(s,l){return Ac(4,4,s,l)}function a_(s,l){if(typeof l=="function")return s=s(),l(s),function(){l(null)};if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function l_(s,l,d){return d=d!=null?d.concat([s]):null,Ac(4,4,a_.bind(null,l,s),d)}function Ch(){}function c_(s,l){var d=pn();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&bh(l,y[1])?y[0]:(d.memoizedState=[s,l],s)}function u_(s,l){var d=pn();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&bh(l,y[1])?y[0]:(s=s(),d.memoizedState=[s,l],s)}function f_(s,l,d){return(Ti&21)===0?(s.baseState&&(s.baseState=!1,Ht=!0),s.memoizedState=d):(En(d,l)||(d=hs(),rt.lanes|=d,Mi|=d,s.baseState=!0),l)}function _4(s,l){var d=Fe;Fe=d!==0&&4>d?d:4,s(!0);var y=wh.transition;wh.transition={};try{s(!1),l()}finally{Fe=d,wh.transition=y}}function d_(){return pn().memoizedState}function S4(s,l,d){var y=Zr(s);if(d={lane:y,action:d,hasEagerState:!1,eagerState:null,next:null},h_(s))p_(l,d);else if(d=U1(s,l,d,y),d!==null){var _=Lt();An(d,s,y,_),m_(d,l,y)}}function k4(s,l,d){var y=Zr(s),_={lane:y,action:d,hasEagerState:!1,eagerState:null,next:null};if(h_(s))p_(l,_);else{var C=s.alternate;if(s.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var M=l.lastRenderedState,H=C(M,d);if(_.hasEagerState=!0,_.eagerState=H,En(H,M)){var X=l.interleaved;X===null?(_.next=_,ph(l)):(_.next=X.next,X.next=_),l.interleaved=_;return}}catch{}finally{}d=U1(s,l,_,y),d!==null&&(_=Lt(),An(d,s,y,_),m_(d,l,y))}}function h_(s){var l=s.alternate;return s===rt||l!==null&&l===rt}function p_(s,l){ua=jc=!0;var d=s.pending;d===null?l.next=l:(l.next=d.next,d.next=l),s.pending=l}function m_(s,l,d){if((d&4194240)!==0){var y=l.lanes;y&=s.pendingLanes,d|=y,l.lanes=d,Rd(s,d)}}var Tc={readContext:hn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},E4={readContext:hn,useCallback:function(s,l){return Yn().memoizedState=[s,l===void 0?null:l],s},useContext:hn,useEffect:i_,useImperativeHandle:function(s,l,d){return d=d!=null?d.concat([s]):null,Rc(4194308,4,a_.bind(null,l,s),d)},useLayoutEffect:function(s,l){return Rc(4194308,4,s,l)},useInsertionEffect:function(s,l){return Rc(4,2,s,l)},useMemo:function(s,l){var d=Yn();return l=l===void 0?null:l,s=s(),d.memoizedState=[s,l],s},useReducer:function(s,l,d){var y=Yn();return l=d!==void 0?d(l):l,y.memoizedState=y.baseState=l,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:l},y.queue=s,s=s.dispatch=S4.bind(null,rt,s),[y.memoizedState,s]},useRef:function(s){var l=Yn();return s={current:s},l.memoizedState=s},useState:n_,useDebugValue:Ch,useDeferredValue:function(s){return Yn().memoizedState=s},useTransition:function(){var s=n_(!1),l=s[0];return s=_4.bind(null,s[1]),Yn().memoizedState=s,[l,s]},useMutableSource:function(){},useSyncExternalStore:function(s,l,d){var y=rt,_=Yn();if(Ye){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),bt===null)throw Error(n(349));(Ti&30)!==0||Q1(y,l,d)}_.memoizedState=d;var C={value:d,getSnapshot:l};return _.queue=C,i_(Z1.bind(null,y,C,s),[s]),y.flags|=2048,ha(9,J1.bind(null,y,C,d,l),void 0,null),d},useId:function(){var s=Yn(),l=bt.identifierPrefix;if(Ye){var d=yr,y=gr;d=(y&~(1<<32-Jt(y)-1)).toString(32)+d,l=":"+l+"R"+d,d=fa++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=b4++,l=":"+l+"r"+d.toString(32)+":";return s.memoizedState=l},unstable_isNewReconciler:!1},N4={readContext:hn,useCallback:c_,useContext:hn,useEffect:Nh,useImperativeHandle:l_,useInsertionEffect:s_,useLayoutEffect:o_,useMemo:u_,useReducer:kh,useRef:r_,useState:function(){return kh(da)},useDebugValue:Ch,useDeferredValue:function(s){var l=pn();return f_(l,vt.memoizedState,s)},useTransition:function(){var s=kh(da)[0],l=pn().memoizedState;return[s,l]},useMutableSource:Y1,useSyncExternalStore:X1,useId:d_,unstable_isNewReconciler:!1},C4={readContext:hn,useCallback:c_,useContext:hn,useEffect:Nh,useImperativeHandle:l_,useInsertionEffect:s_,useLayoutEffect:o_,useMemo:u_,useReducer:Eh,useRef:r_,useState:function(){return Eh(da)},useDebugValue:Ch,useDeferredValue:function(s){var l=pn();return vt===null?l.memoizedState=s:f_(l,vt.memoizedState,s)},useTransition:function(){var s=Eh(da)[0],l=pn().memoizedState;return[s,l]},useMutableSource:Y1,useSyncExternalStore:X1,useId:d_,unstable_isNewReconciler:!1};function Cn(s,l){if(s&&s.defaultProps){l=Y({},l),s=s.defaultProps;for(var d in s)l[d]===void 0&&(l[d]=s[d]);return l}return l}function jh(s,l,d,y){l=s.memoizedState,d=d(y,l),d=d==null?l:Y({},l,d),s.memoizedState=d,s.lanes===0&&(s.updateQueue.baseState=d)}var Mc={isMounted:function(s){return(s=s._reactInternals)?Hn(s)===s:!1},enqueueSetState:function(s,l,d){s=s._reactInternals;var y=Lt(),_=Zr(s),C=xr(y,_);C.payload=l,d!=null&&(C.callback=d),l=Yr(s,C,_),l!==null&&(An(l,s,_,y),kc(l,s,_))},enqueueReplaceState:function(s,l,d){s=s._reactInternals;var y=Lt(),_=Zr(s),C=xr(y,_);C.tag=1,C.payload=l,d!=null&&(C.callback=d),l=Yr(s,C,_),l!==null&&(An(l,s,_,y),kc(l,s,_))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var d=Lt(),y=Zr(s),_=xr(d,y);_.tag=2,l!=null&&(_.callback=l),l=Yr(s,_,y),l!==null&&(An(l,s,y,d),kc(l,s,y))}};function g_(s,l,d,y,_,C,M){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,C,M):l.prototype&&l.prototype.isPureReactComponent?!Zo(d,y)||!Zo(_,C):!0}function y_(s,l,d){var y=!1,_=Wr,C=l.contextType;return typeof C=="object"&&C!==null?C=hn(C):(_=Ut(l)?Ni:Nt.current,y=l.contextTypes,C=(y=y!=null)?Ss(s,_):Wr),l=new l(d,C),s.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Mc,s.stateNode=l,l._reactInternals=s,y&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=_,s.__reactInternalMemoizedMaskedChildContext=C),l}function v_(s,l,d,y){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,y),l.state!==s&&Mc.enqueueReplaceState(l,l.state,null)}function Rh(s,l,d,y){var _=s.stateNode;_.props=d,_.state=s.memoizedState,_.refs={},mh(s);var C=l.contextType;typeof C=="object"&&C!==null?_.context=hn(C):(C=Ut(l)?Ni:Nt.current,_.context=Ss(s,C)),_.state=s.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(jh(s,l,C,d),_.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(l=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),l!==_.state&&Mc.enqueueReplaceState(_,_.state,null),Ec(s,d,_,y),_.state=s.memoizedState),typeof _.componentDidMount=="function"&&(s.flags|=4194308)}function Ts(s,l){try{var d="",y=l;do d+=J(y),y=y.return;while(y);var _=d}catch(C){_=`
39
- Error generating stack: `+C.message+`
40
- `+C.stack}return{value:s,source:l,stack:_,digest:null}}function Ah(s,l,d){return{value:s,source:null,stack:d??null,digest:l??null}}function Th(s,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var j4=typeof WeakMap=="function"?WeakMap:Map;function x_(s,l,d){d=xr(-1,d),d.tag=3,d.payload={element:null};var y=l.value;return d.callback=function(){$c||($c=!0,Wh=y),Th(s,l)},d}function w_(s,l,d){d=xr(-1,d),d.tag=3;var y=s.type.getDerivedStateFromError;if(typeof y=="function"){var _=l.value;d.payload=function(){return y(_)},d.callback=function(){Th(s,l)}}var C=s.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){Th(s,l),typeof y!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var M=l.stack;this.componentDidCatch(l.value,{componentStack:M!==null?M:""})}),d}function b_(s,l,d){var y=s.pingCache;if(y===null){y=s.pingCache=new j4;var _=new Set;y.set(l,_)}else _=y.get(l),_===void 0&&(_=new Set,y.set(l,_));_.has(d)||(_.add(d),s=z4.bind(null,s,l,d),l.then(s,s))}function __(s){do{var l;if((l=s.tag===13)&&(l=s.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return s;s=s.return}while(s!==null);return null}function S_(s,l,d,y,_){return(s.mode&1)===0?(s===l?s.flags|=65536:(s.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=xr(-1,1),l.tag=2,Yr(d,l,1))),d.lanes|=1),s):(s.flags|=65536,s.lanes=_,s)}var R4=E.ReactCurrentOwner,Ht=!1;function Pt(s,l,d,y){l.child=s===null?V1(l,null,d,y):Cs(l,s.child,d,y)}function k_(s,l,d,y,_){d=d.render;var C=l.ref;return Rs(l,_),y=_h(s,l,d,y,C,_),d=Sh(),s!==null&&!Ht?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~_,wr(s,l,_)):(Ye&&d&&sh(l),l.flags|=1,Pt(s,l,y,_),l.child)}function E_(s,l,d,y,_){if(s===null){var C=d.type;return typeof C=="function"&&!Zh(C)&&C.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=C,N_(s,l,C,y,_)):(s=Hc(d.type,null,y,l,l.mode,_),s.ref=l.ref,s.return=l,l.child=s)}if(C=s.child,(s.lanes&_)===0){var M=C.memoizedProps;if(d=d.compare,d=d!==null?d:Zo,d(M,y)&&s.ref===l.ref)return wr(s,l,_)}return l.flags|=1,s=ti(C,y),s.ref=l.ref,s.return=l,l.child=s}function N_(s,l,d,y,_){if(s!==null){var C=s.memoizedProps;if(Zo(C,y)&&s.ref===l.ref)if(Ht=!1,l.pendingProps=y=C,(s.lanes&_)!==0)(s.flags&131072)!==0&&(Ht=!0);else return l.lanes=s.lanes,wr(s,l,_)}return Mh(s,l,d,y,_)}function C_(s,l,d){var y=l.pendingProps,_=y.children,C=s!==null?s.memoizedState:null;if(y.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(Is,nn),nn|=d;else{if((d&1073741824)===0)return s=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:s,cachePool:null,transitions:null},l.updateQueue=null,ze(Is,nn),nn|=s,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=C!==null?C.baseLanes:d,ze(Is,nn),nn|=y}else C!==null?(y=C.baseLanes|d,l.memoizedState=null):y=d,ze(Is,nn),nn|=y;return Pt(s,l,_,d),l.child}function j_(s,l){var d=l.ref;(s===null&&d!==null||s!==null&&s.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function Mh(s,l,d,y,_){var C=Ut(d)?Ni:Nt.current;return C=Ss(l,C),Rs(l,_),d=_h(s,l,d,y,C,_),y=Sh(),s!==null&&!Ht?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~_,wr(s,l,_)):(Ye&&y&&sh(l),l.flags|=1,Pt(s,l,d,_),l.child)}function R_(s,l,d,y,_){if(Ut(d)){var C=!0;gc(l)}else C=!1;if(Rs(l,_),l.stateNode===null)Oc(s,l),y_(l,d,y),Rh(l,d,y,_),y=!0;else if(s===null){var M=l.stateNode,H=l.memoizedProps;M.props=H;var X=M.context,ie=d.contextType;typeof ie=="object"&&ie!==null?ie=hn(ie):(ie=Ut(d)?Ni:Nt.current,ie=Ss(l,ie));var le=d.getDerivedStateFromProps,ce=typeof le=="function"||typeof M.getSnapshotBeforeUpdate=="function";ce||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(H!==y||X!==ie)&&v_(l,M,y,ie),Gr=!1;var ae=l.memoizedState;M.state=ae,Ec(l,y,M,_),X=l.memoizedState,H!==y||ae!==X||Vt.current||Gr?(typeof le=="function"&&(jh(l,d,le,y),X=l.memoizedState),(H=Gr||g_(l,d,H,y,ae,X,ie))?(ce||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(l.flags|=4194308)):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=X),M.props=y,M.state=X,M.context=ie,y=H):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{M=l.stateNode,H1(s,l),H=l.memoizedProps,ie=l.type===l.elementType?H:Cn(l.type,H),M.props=ie,ce=l.pendingProps,ae=M.context,X=d.contextType,typeof X=="object"&&X!==null?X=hn(X):(X=Ut(d)?Ni:Nt.current,X=Ss(l,X));var pe=d.getDerivedStateFromProps;(le=typeof pe=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(H!==ce||ae!==X)&&v_(l,M,y,X),Gr=!1,ae=l.memoizedState,M.state=ae,Ec(l,y,M,_);var xe=l.memoizedState;H!==ce||ae!==xe||Vt.current||Gr?(typeof pe=="function"&&(jh(l,d,pe,y),xe=l.memoizedState),(ie=Gr||g_(l,d,ie,y,ae,xe,X)||!1)?(le||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(y,xe,X),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(y,xe,X)),typeof M.componentDidUpdate=="function"&&(l.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof M.componentDidUpdate!="function"||H===s.memoizedProps&&ae===s.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||H===s.memoizedProps&&ae===s.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=xe),M.props=y,M.state=xe,M.context=X,y=ie):(typeof M.componentDidUpdate!="function"||H===s.memoizedProps&&ae===s.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||H===s.memoizedProps&&ae===s.memoizedState||(l.flags|=1024),y=!1)}return Ih(s,l,d,y,C,_)}function Ih(s,l,d,y,_,C){j_(s,l);var M=(l.flags&128)!==0;if(!y&&!M)return _&&O1(l,d,!1),wr(s,l,C);y=l.stateNode,R4.current=l;var H=M&&typeof d.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,s!==null&&M?(l.child=Cs(l,s.child,null,C),l.child=Cs(l,null,H,C)):Pt(s,l,H,C),l.memoizedState=y.state,_&&O1(l,d,!0),l.child}function A_(s){var l=s.stateNode;l.pendingContext?M1(s,l.pendingContext,l.pendingContext!==l.context):l.context&&M1(s,l.context,!1),gh(s,l.containerInfo)}function T_(s,l,d,y,_){return Ns(),ch(_),l.flags|=256,Pt(s,l,d,y),l.child}var Oh={dehydrated:null,treeContext:null,retryLane:0};function Ph(s){return{baseLanes:s,cachePool:null,transitions:null}}function M_(s,l,d){var y=l.pendingProps,_=nt.current,C=!1,M=(l.flags&128)!==0,H;if((H=M)||(H=s!==null&&s.memoizedState===null?!1:(_&2)!==0),H?(C=!0,l.flags&=-129):(s===null||s.memoizedState!==null)&&(_|=1),ze(nt,_&1),s===null)return lh(l),s=l.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((l.mode&1)===0?l.lanes=1:s.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(M=y.children,s=y.fallback,C?(y=l.mode,C=l.child,M={mode:"hidden",children:M},(y&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=M):C=Wc(M,y,0,null),s=Li(s,y,d,null),C.return=l,s.return=l,C.sibling=s,l.child=C,l.child.memoizedState=Ph(d),l.memoizedState=Oh,s):Lh(l,M));if(_=s.memoizedState,_!==null&&(H=_.dehydrated,H!==null))return A4(s,l,M,y,H,_,d);if(C){C=y.fallback,M=l.mode,_=s.child,H=_.sibling;var X={mode:"hidden",children:y.children};return(M&1)===0&&l.child!==_?(y=l.child,y.childLanes=0,y.pendingProps=X,l.deletions=null):(y=ti(_,X),y.subtreeFlags=_.subtreeFlags&14680064),H!==null?C=ti(H,C):(C=Li(C,M,d,null),C.flags|=2),C.return=l,y.return=l,y.sibling=C,l.child=y,y=C,C=l.child,M=s.child.memoizedState,M=M===null?Ph(d):{baseLanes:M.baseLanes|d,cachePool:null,transitions:M.transitions},C.memoizedState=M,C.childLanes=s.childLanes&~d,l.memoizedState=Oh,y}return C=s.child,s=C.sibling,y=ti(C,{mode:"visible",children:y.children}),(l.mode&1)===0&&(y.lanes=d),y.return=l,y.sibling=null,s!==null&&(d=l.deletions,d===null?(l.deletions=[s],l.flags|=16):d.push(s)),l.child=y,l.memoizedState=null,y}function Lh(s,l){return l=Wc({mode:"visible",children:l},s.mode,0,null),l.return=s,s.child=l}function Ic(s,l,d,y){return y!==null&&ch(y),Cs(l,s.child,null,d),s=Lh(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function A4(s,l,d,y,_,C,M){if(d)return l.flags&256?(l.flags&=-257,y=Ah(Error(n(422))),Ic(s,l,M,y)):l.memoizedState!==null?(l.child=s.child,l.flags|=128,null):(C=y.fallback,_=l.mode,y=Wc({mode:"visible",children:y.children},_,0,null),C=Li(C,_,M,null),C.flags|=2,y.return=l,C.return=l,y.sibling=C,l.child=y,(l.mode&1)!==0&&Cs(l,s.child,null,M),l.child.memoizedState=Ph(M),l.memoizedState=Oh,C);if((l.mode&1)===0)return Ic(s,l,M,null);if(_.data==="$!"){if(y=_.nextSibling&&_.nextSibling.dataset,y)var H=y.dgst;return y=H,C=Error(n(419)),y=Ah(C,y,void 0),Ic(s,l,M,y)}if(H=(M&s.childLanes)!==0,Ht||H){if(y=bt,y!==null){switch(M&-M){case 4:_=2;break;case 16:_=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(y.suspendedLanes|M))!==0?0:_,_!==0&&_!==C.retryLane&&(C.retryLane=_,vr(s,_),An(y,s,_,-1))}return Jh(),y=Ah(Error(n(421))),Ic(s,l,M,y)}return _.data==="$?"?(l.flags|=128,l.child=s.child,l=V4.bind(null,s),_._reactRetry=l,null):(s=C.treeContext,tn=Ur(_.nextSibling),en=l,Ye=!0,Nn=null,s!==null&&(fn[dn++]=gr,fn[dn++]=yr,fn[dn++]=Ci,gr=s.id,yr=s.overflow,Ci=l),l=Lh(l,y.children),l.flags|=4096,l)}function I_(s,l,d){s.lanes|=l;var y=s.alternate;y!==null&&(y.lanes|=l),hh(s.return,l,d)}function Dh(s,l,d,y,_){var C=s.memoizedState;C===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:_}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=y,C.tail=d,C.tailMode=_)}function O_(s,l,d){var y=l.pendingProps,_=y.revealOrder,C=y.tail;if(Pt(s,l,y.children,d),y=nt.current,(y&2)!==0)y=y&1|2,l.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&I_(s,d,l);else if(s.tag===19)I_(s,d,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}y&=1}if(ze(nt,y),(l.mode&1)===0)l.memoizedState=null;else switch(_){case"forwards":for(d=l.child,_=null;d!==null;)s=d.alternate,s!==null&&Nc(s)===null&&(_=d),d=d.sibling;d=_,d===null?(_=l.child,l.child=null):(_=d.sibling,d.sibling=null),Dh(l,!1,_,d,C);break;case"backwards":for(d=null,_=l.child,l.child=null;_!==null;){if(s=_.alternate,s!==null&&Nc(s)===null){l.child=_;break}s=_.sibling,_.sibling=d,d=_,_=s}Dh(l,!0,d,null,C);break;case"together":Dh(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Oc(s,l){(l.mode&1)===0&&s!==null&&(s.alternate=null,l.alternate=null,l.flags|=2)}function wr(s,l,d){if(s!==null&&(l.dependencies=s.dependencies),Mi|=l.lanes,(d&l.childLanes)===0)return null;if(s!==null&&l.child!==s.child)throw Error(n(153));if(l.child!==null){for(s=l.child,d=ti(s,s.pendingProps),l.child=d,d.return=l;s.sibling!==null;)s=s.sibling,d=d.sibling=ti(s,s.pendingProps),d.return=l;d.sibling=null}return l.child}function T4(s,l,d){switch(l.tag){case 3:A_(l),Ns();break;case 5:G1(l);break;case 1:Ut(l.type)&&gc(l);break;case 4:gh(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,_=l.memoizedProps.value;ze(_c,y._currentValue),y._currentValue=_;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(ze(nt,nt.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?M_(s,l,d):(ze(nt,nt.current&1),s=wr(s,l,d),s!==null?s.sibling:null);ze(nt,nt.current&1);break;case 19:if(y=(d&l.childLanes)!==0,(s.flags&128)!==0){if(y)return O_(s,l,d);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),ze(nt,nt.current),y)break;return null;case 22:case 23:return l.lanes=0,C_(s,l,d)}return wr(s,l,d)}var P_,qh,L_,D_;P_=function(s,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},qh=function(){},L_=function(s,l,d,y){var _=s.memoizedProps;if(_!==y){s=l.stateNode,Ai(Gn.current);var C=null;switch(d){case"input":_=_e(s,_),y=_e(s,y),C=[];break;case"select":_=Y({},_,{value:void 0}),y=Y({},y,{value:void 0}),C=[];break;case"textarea":_=it(s,_),y=it(s,y),C=[];break;default:typeof _.onClick!="function"&&typeof y.onClick=="function"&&(s.onclick=hc)}Ot(d,y);var M;d=null;for(ie in _)if(!y.hasOwnProperty(ie)&&_.hasOwnProperty(ie)&&_[ie]!=null)if(ie==="style"){var H=_[ie];for(M in H)H.hasOwnProperty(M)&&(d||(d={}),d[M]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(i.hasOwnProperty(ie)?C||(C=[]):(C=C||[]).push(ie,null));for(ie in y){var X=y[ie];if(H=_!=null?_[ie]:void 0,y.hasOwnProperty(ie)&&X!==H&&(X!=null||H!=null))if(ie==="style")if(H){for(M in H)!H.hasOwnProperty(M)||X&&X.hasOwnProperty(M)||(d||(d={}),d[M]="");for(M in X)X.hasOwnProperty(M)&&H[M]!==X[M]&&(d||(d={}),d[M]=X[M])}else d||(C||(C=[]),C.push(ie,d)),d=X;else ie==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,H=H?H.__html:void 0,X!=null&&H!==X&&(C=C||[]).push(ie,X)):ie==="children"?typeof X!="string"&&typeof X!="number"||(C=C||[]).push(ie,""+X):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(i.hasOwnProperty(ie)?(X!=null&&ie==="onScroll"&&He("scroll",s),C||H===X||(C=[])):(C=C||[]).push(ie,X))}d&&(C=C||[]).push("style",d);var ie=C;(l.updateQueue=ie)&&(l.flags|=4)}},D_=function(s,l,d,y){d!==y&&(l.flags|=4)};function pa(s,l){if(!Ye)switch(s.tailMode){case"hidden":l=s.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?s.tail=null:d.sibling=null;break;case"collapsed":d=s.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function jt(s){var l=s.alternate!==null&&s.alternate.child===s.child,d=0,y=0;if(l)for(var _=s.child;_!==null;)d|=_.lanes|_.childLanes,y|=_.subtreeFlags&14680064,y|=_.flags&14680064,_.return=s,_=_.sibling;else for(_=s.child;_!==null;)d|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=s,_=_.sibling;return s.subtreeFlags|=y,s.childLanes=d,l}function M4(s,l,d){var y=l.pendingProps;switch(oh(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(l),null;case 1:return Ut(l.type)&&mc(),jt(l),null;case 3:return y=l.stateNode,As(),We(Vt),We(Nt),xh(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(s===null||s.child===null)&&(wc(l)?l.flags|=4:s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Nn!==null&&(Yh(Nn),Nn=null))),qh(s,l),jt(l),null;case 5:yh(l);var _=Ai(ca.current);if(d=l.type,s!==null&&l.stateNode!=null)L_(s,l,d,y,_),s.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(n(166));return jt(l),null}if(s=Ai(Gn.current),wc(l)){y=l.stateNode,d=l.type;var C=l.memoizedProps;switch(y[Kn]=l,y[ia]=C,s=(l.mode&1)!==0,d){case"dialog":He("cancel",y),He("close",y);break;case"iframe":case"object":case"embed":He("load",y);break;case"video":case"audio":for(_=0;_<ta.length;_++)He(ta[_],y);break;case"source":He("error",y);break;case"img":case"image":case"link":He("error",y),He("load",y);break;case"details":He("toggle",y);break;case"input":ve(y,C),He("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!C.multiple},He("invalid",y);break;case"textarea":Ue(y,C),He("invalid",y)}Ot(d,C),_=null;for(var M in C)if(C.hasOwnProperty(M)){var H=C[M];M==="children"?typeof H=="string"?y.textContent!==H&&(C.suppressHydrationWarning!==!0&&dc(y.textContent,H,s),_=["children",H]):typeof H=="number"&&y.textContent!==""+H&&(C.suppressHydrationWarning!==!0&&dc(y.textContent,H,s),_=["children",""+H]):i.hasOwnProperty(M)&&H!=null&&M==="onScroll"&&He("scroll",y)}switch(d){case"input":he(y),et(y,C,!0);break;case"textarea":he(y),Tt(y);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(y.onclick=hc)}y=_,l.updateQueue=y,y!==null&&(l.flags|=4)}else{M=_.nodeType===9?_:_.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Bt(d)),s==="http://www.w3.org/1999/xhtml"?d==="script"?(s=M.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof y.is=="string"?s=M.createElement(d,{is:y.is}):(s=M.createElement(d),d==="select"&&(M=s,y.multiple?M.multiple=!0:y.size&&(M.size=y.size))):s=M.createElementNS(s,d),s[Kn]=l,s[ia]=y,P_(s,l,!1,!1),l.stateNode=s;e:{switch(M=Qt(d,y),d){case"dialog":He("cancel",s),He("close",s),_=y;break;case"iframe":case"object":case"embed":He("load",s),_=y;break;case"video":case"audio":for(_=0;_<ta.length;_++)He(ta[_],s);_=y;break;case"source":He("error",s),_=y;break;case"img":case"image":case"link":He("error",s),He("load",s),_=y;break;case"details":He("toggle",s),_=y;break;case"input":ve(s,y),_=_e(s,y),He("invalid",s);break;case"option":_=y;break;case"select":s._wrapperState={wasMultiple:!!y.multiple},_=Y({},y,{value:void 0}),He("invalid",s);break;case"textarea":Ue(s,y),_=it(s,y),He("invalid",s);break;default:_=y}Ot(d,_),H=_;for(C in H)if(H.hasOwnProperty(C)){var X=H[C];C==="style"?It(s,X):C==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&st(s,X)):C==="children"?typeof X=="string"?(d!=="textarea"||X!=="")&&Be(s,X):typeof X=="number"&&Be(s,""+X):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(i.hasOwnProperty(C)?X!=null&&C==="onScroll"&&He("scroll",s):X!=null&&k(s,C,X,M))}switch(d){case"input":he(s),et(s,y,!1);break;case"textarea":he(s),Tt(s);break;case"option":y.value!=null&&s.setAttribute("value",""+te(y.value));break;case"select":s.multiple=!!y.multiple,C=y.value,C!=null?yt(s,!!y.multiple,C,!1):y.defaultValue!=null&&yt(s,!!y.multiple,y.defaultValue,!0);break;default:typeof _.onClick=="function"&&(s.onclick=hc)}switch(d){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return jt(l),null;case 6:if(s&&l.stateNode!=null)D_(s,l,s.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(d=Ai(ca.current),Ai(Gn.current),wc(l)){if(y=l.stateNode,d=l.memoizedProps,y[Kn]=l,(C=y.nodeValue!==d)&&(s=en,s!==null))switch(s.tag){case 3:dc(y.nodeValue,d,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&dc(y.nodeValue,d,(s.mode&1)!==0)}C&&(l.flags|=4)}else y=(d.nodeType===9?d:d.ownerDocument).createTextNode(y),y[Kn]=l,l.stateNode=y}return jt(l),null;case 13:if(We(nt),y=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Ye&&tn!==null&&(l.mode&1)!==0&&(l.flags&128)===0)F1(),Ns(),l.flags|=98560,C=!1;else if(C=wc(l),y!==null&&y.dehydrated!==null){if(s===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Kn]=l}else Ns(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;jt(l),C=!1}else Nn!==null&&(Yh(Nn),Nn=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(y=y!==null,y!==(s!==null&&s.memoizedState!==null)&&y&&(l.child.flags|=8192,(l.mode&1)!==0&&(s===null||(nt.current&1)!==0?xt===0&&(xt=3):Jh())),l.updateQueue!==null&&(l.flags|=4),jt(l),null);case 4:return As(),qh(s,l),s===null&&na(l.stateNode.containerInfo),jt(l),null;case 10:return dh(l.type._context),jt(l),null;case 17:return Ut(l.type)&&mc(),jt(l),null;case 19:if(We(nt),C=l.memoizedState,C===null)return jt(l),null;if(y=(l.flags&128)!==0,M=C.rendering,M===null)if(y)pa(C,!1);else{if(xt!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(M=Nc(s),M!==null){for(l.flags|=128,pa(C,!1),y=M.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=d,d=l.child;d!==null;)C=d,s=y,C.flags&=14680066,M=C.alternate,M===null?(C.childLanes=0,C.lanes=s,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=M.childLanes,C.lanes=M.lanes,C.child=M.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=M.memoizedProps,C.memoizedState=M.memoizedState,C.updateQueue=M.updateQueue,C.type=M.type,s=M.dependencies,C.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),d=d.sibling;return ze(nt,nt.current&1|2),l.child}s=s.sibling}C.tail!==null&&tt()>Os&&(l.flags|=128,y=!0,pa(C,!1),l.lanes=4194304)}else{if(!y)if(s=Nc(M),s!==null){if(l.flags|=128,y=!0,d=s.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),pa(C,!0),C.tail===null&&C.tailMode==="hidden"&&!M.alternate&&!Ye)return jt(l),null}else 2*tt()-C.renderingStartTime>Os&&d!==1073741824&&(l.flags|=128,y=!0,pa(C,!1),l.lanes=4194304);C.isBackwards?(M.sibling=l.child,l.child=M):(d=C.last,d!==null?d.sibling=M:l.child=M,C.last=M)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=tt(),l.sibling=null,d=nt.current,ze(nt,y?d&1|2:d&1),l):(jt(l),null);case 22:case 23:return Qh(),y=l.memoizedState!==null,s!==null&&s.memoizedState!==null!==y&&(l.flags|=8192),y&&(l.mode&1)!==0?(nn&1073741824)!==0&&(jt(l),l.subtreeFlags&6&&(l.flags|=8192)):jt(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function I4(s,l){switch(oh(l),l.tag){case 1:return Ut(l.type)&&mc(),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return As(),We(Vt),We(Nt),xh(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 5:return yh(l),null;case 13:if(We(nt),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Ns()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return We(nt),null;case 4:return As(),null;case 10:return dh(l.type._context),null;case 22:case 23:return Qh(),null;case 24:return null;default:return null}}var Pc=!1,Rt=!1,O4=typeof WeakSet=="function"?WeakSet:Set,ye=null;function Ms(s,l){var d=s.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(y){ot(s,l,y)}else d.current=null}function $h(s,l,d){try{d()}catch(y){ot(s,l,y)}}var q_=!1;function P4(s,l){if(Qd=tc,s=g1(),Vd(s)){if("selectionStart"in s)var d={start:s.selectionStart,end:s.selectionEnd};else e:{d=(d=s.ownerDocument)&&d.defaultView||window;var y=d.getSelection&&d.getSelection();if(y&&y.rangeCount!==0){d=y.anchorNode;var _=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{d.nodeType,C.nodeType}catch{d=null;break e}var M=0,H=-1,X=-1,ie=0,le=0,ce=s,ae=null;t:for(;;){for(var pe;ce!==d||_!==0&&ce.nodeType!==3||(H=M+_),ce!==C||y!==0&&ce.nodeType!==3||(X=M+y),ce.nodeType===3&&(M+=ce.nodeValue.length),(pe=ce.firstChild)!==null;)ae=ce,ce=pe;for(;;){if(ce===s)break t;if(ae===d&&++ie===_&&(H=M),ae===C&&++le===y&&(X=M),(pe=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=pe}d=H===-1||X===-1?null:{start:H,end:X}}else d=null}d=d||{start:0,end:0}}else d=null;for(Jd={focusedElem:s,selectionRange:d},tc=!1,ye=l;ye!==null;)if(l=ye,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,ye=s;else for(;ye!==null;){l=ye;try{var xe=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var be=xe.memoizedProps,at=xe.memoizedState,ne=l.stateNode,Z=ne.getSnapshotBeforeUpdate(l.elementType===l.type?be:Cn(l.type,be),at);ne.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var re=l.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ue){ot(l,l.return,ue)}if(s=l.sibling,s!==null){s.return=l.return,ye=s;break}ye=l.return}return xe=q_,q_=!1,xe}function ma(s,l,d){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var _=y=y.next;do{if((_.tag&s)===s){var C=_.destroy;_.destroy=void 0,C!==void 0&&$h(l,d,C)}_=_.next}while(_!==y)}}function Lc(s,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&s)===s){var y=d.create;d.destroy=y()}d=d.next}while(d!==l)}}function Fh(s){var l=s.ref;if(l!==null){var d=s.stateNode;switch(s.tag){case 5:s=d;break;default:s=d}typeof l=="function"?l(s):l.current=s}}function $_(s){var l=s.alternate;l!==null&&(s.alternate=null,$_(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&(delete l[Kn],delete l[ia],delete l[nh],delete l[y4],delete l[v4])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function F_(s){return s.tag===5||s.tag===3||s.tag===4}function B_(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||F_(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Bh(s,l,d){var y=s.tag;if(y===5||y===6)s=s.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(s,l):d.insertBefore(s,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(s,d)):(l=d,l.appendChild(s)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=hc));else if(y!==4&&(s=s.child,s!==null))for(Bh(s,l,d),s=s.sibling;s!==null;)Bh(s,l,d),s=s.sibling}function zh(s,l,d){var y=s.tag;if(y===5||y===6)s=s.stateNode,l?d.insertBefore(s,l):d.appendChild(s);else if(y!==4&&(s=s.child,s!==null))for(zh(s,l,d),s=s.sibling;s!==null;)zh(s,l,d),s=s.sibling}var St=null,jn=!1;function Xr(s,l,d){for(d=d.child;d!==null;)z_(s,l,d),d=d.sibling}function z_(s,l,d){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Si,d)}catch{}switch(d.tag){case 5:Rt||Ms(d,l);case 6:var y=St,_=jn;St=null,Xr(s,l,d),St=y,jn=_,St!==null&&(jn?(s=St,d=d.stateNode,s.nodeType===8?s.parentNode.removeChild(d):s.removeChild(d)):St.removeChild(d.stateNode));break;case 18:St!==null&&(jn?(s=St,d=d.stateNode,s.nodeType===8?th(s.parentNode,d):s.nodeType===1&&th(s,d),Ko(s)):th(St,d.stateNode));break;case 4:y=St,_=jn,St=d.stateNode.containerInfo,jn=!0,Xr(s,l,d),St=y,jn=_;break;case 0:case 11:case 14:case 15:if(!Rt&&(y=d.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){_=y=y.next;do{var C=_,M=C.destroy;C=C.tag,M!==void 0&&((C&2)!==0||(C&4)!==0)&&$h(d,l,M),_=_.next}while(_!==y)}Xr(s,l,d);break;case 1:if(!Rt&&(Ms(d,l),y=d.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=d.memoizedProps,y.state=d.memoizedState,y.componentWillUnmount()}catch(H){ot(d,l,H)}Xr(s,l,d);break;case 21:Xr(s,l,d);break;case 22:d.mode&1?(Rt=(y=Rt)||d.memoizedState!==null,Xr(s,l,d),Rt=y):Xr(s,l,d);break;default:Xr(s,l,d)}}function V_(s){var l=s.updateQueue;if(l!==null){s.updateQueue=null;var d=s.stateNode;d===null&&(d=s.stateNode=new O4),l.forEach(function(y){var _=U4.bind(null,s,y);d.has(y)||(d.add(y),y.then(_,_))})}}function Rn(s,l){var d=l.deletions;if(d!==null)for(var y=0;y<d.length;y++){var _=d[y];try{var C=s,M=l,H=M;e:for(;H!==null;){switch(H.tag){case 5:St=H.stateNode,jn=!1;break e;case 3:St=H.stateNode.containerInfo,jn=!0;break e;case 4:St=H.stateNode.containerInfo,jn=!0;break e}H=H.return}if(St===null)throw Error(n(160));z_(C,M,_),St=null,jn=!1;var X=_.alternate;X!==null&&(X.return=null),_.return=null}catch(ie){ot(_,l,ie)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)U_(l,s),l=l.sibling}function U_(s,l){var d=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Rn(l,s),Xn(s),y&4){try{ma(3,s,s.return),Lc(3,s)}catch(be){ot(s,s.return,be)}try{ma(5,s,s.return)}catch(be){ot(s,s.return,be)}}break;case 1:Rn(l,s),Xn(s),y&512&&d!==null&&Ms(d,d.return);break;case 5:if(Rn(l,s),Xn(s),y&512&&d!==null&&Ms(d,d.return),s.flags&32){var _=s.stateNode;try{Be(_,"")}catch(be){ot(s,s.return,be)}}if(y&4&&(_=s.stateNode,_!=null)){var C=s.memoizedProps,M=d!==null?d.memoizedProps:C,H=s.type,X=s.updateQueue;if(s.updateQueue=null,X!==null)try{H==="input"&&C.type==="radio"&&C.name!=null&&Ne(_,C),Qt(H,M);var ie=Qt(H,C);for(M=0;M<X.length;M+=2){var le=X[M],ce=X[M+1];le==="style"?It(_,ce):le==="dangerouslySetInnerHTML"?st(_,ce):le==="children"?Be(_,ce):k(_,le,ce,ie)}switch(H){case"input":Ee(_,C);break;case"textarea":At(_,C);break;case"select":var ae=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!C.multiple;var pe=C.value;pe!=null?yt(_,!!C.multiple,pe,!1):ae!==!!C.multiple&&(C.defaultValue!=null?yt(_,!!C.multiple,C.defaultValue,!0):yt(_,!!C.multiple,C.multiple?[]:"",!1))}_[ia]=C}catch(be){ot(s,s.return,be)}}break;case 6:if(Rn(l,s),Xn(s),y&4){if(s.stateNode===null)throw Error(n(162));_=s.stateNode,C=s.memoizedProps;try{_.nodeValue=C}catch(be){ot(s,s.return,be)}}break;case 3:if(Rn(l,s),Xn(s),y&4&&d!==null&&d.memoizedState.isDehydrated)try{Ko(l.containerInfo)}catch(be){ot(s,s.return,be)}break;case 4:Rn(l,s),Xn(s);break;case 13:Rn(l,s),Xn(s),_=s.child,_.flags&8192&&(C=_.memoizedState!==null,_.stateNode.isHidden=C,!C||_.alternate!==null&&_.alternate.memoizedState!==null||(Hh=tt())),y&4&&V_(s);break;case 22:if(le=d!==null&&d.memoizedState!==null,s.mode&1?(Rt=(ie=Rt)||le,Rn(l,s),Rt=ie):Rn(l,s),Xn(s),y&8192){if(ie=s.memoizedState!==null,(s.stateNode.isHidden=ie)&&!le&&(s.mode&1)!==0)for(ye=s,le=s.child;le!==null;){for(ce=ye=le;ye!==null;){switch(ae=ye,pe=ae.child,ae.tag){case 0:case 11:case 14:case 15:ma(4,ae,ae.return);break;case 1:Ms(ae,ae.return);var xe=ae.stateNode;if(typeof xe.componentWillUnmount=="function"){y=ae,d=ae.return;try{l=y,xe.props=l.memoizedProps,xe.state=l.memoizedState,xe.componentWillUnmount()}catch(be){ot(y,d,be)}}break;case 5:Ms(ae,ae.return);break;case 22:if(ae.memoizedState!==null){K_(ce);continue}}pe!==null?(pe.return=ae,ye=pe):K_(ce)}le=le.sibling}e:for(le=null,ce=s;;){if(ce.tag===5){if(le===null){le=ce;try{_=ce.stateNode,ie?(C=_.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(H=ce.stateNode,X=ce.memoizedProps.style,M=X!=null&&X.hasOwnProperty("display")?X.display:null,H.style.display=Mt("display",M))}catch(be){ot(s,s.return,be)}}}else if(ce.tag===6){if(le===null)try{ce.stateNode.nodeValue=ie?"":ce.memoizedProps}catch(be){ot(s,s.return,be)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===s)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===s)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===s)break e;le===ce&&(le=null),ce=ce.return}le===ce&&(le=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:Rn(l,s),Xn(s),y&4&&V_(s);break;case 21:break;default:Rn(l,s),Xn(s)}}function Xn(s){var l=s.flags;if(l&2){try{e:{for(var d=s.return;d!==null;){if(F_(d)){var y=d;break e}d=d.return}throw Error(n(160))}switch(y.tag){case 5:var _=y.stateNode;y.flags&32&&(Be(_,""),y.flags&=-33);var C=B_(s);zh(s,C,_);break;case 3:case 4:var M=y.stateNode.containerInfo,H=B_(s);Bh(s,H,M);break;default:throw Error(n(161))}}catch(X){ot(s,s.return,X)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function L4(s,l,d){ye=s,H_(s)}function H_(s,l,d){for(var y=(s.mode&1)!==0;ye!==null;){var _=ye,C=_.child;if(_.tag===22&&y){var M=_.memoizedState!==null||Pc;if(!M){var H=_.alternate,X=H!==null&&H.memoizedState!==null||Rt;H=Pc;var ie=Rt;if(Pc=M,(Rt=X)&&!ie)for(ye=_;ye!==null;)M=ye,X=M.child,M.tag===22&&M.memoizedState!==null?G_(_):X!==null?(X.return=M,ye=X):G_(_);for(;C!==null;)ye=C,H_(C),C=C.sibling;ye=_,Pc=H,Rt=ie}W_(s)}else(_.subtreeFlags&8772)!==0&&C!==null?(C.return=_,ye=C):W_(s)}}function W_(s){for(;ye!==null;){var l=ye;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Rt||Lc(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!Rt)if(d===null)y.componentDidMount();else{var _=l.elementType===l.type?d.memoizedProps:Cn(l.type,d.memoizedProps);y.componentDidUpdate(_,d.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&K1(l,C,y);break;case 3:var M=l.updateQueue;if(M!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}K1(l,M,d)}break;case 5:var H=l.stateNode;if(d===null&&l.flags&4){d=H;var X=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&d.focus();break;case"img":X.src&&(d.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ie=l.alternate;if(ie!==null){var le=ie.memoizedState;if(le!==null){var ce=le.dehydrated;ce!==null&&Ko(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Rt||l.flags&512&&Fh(l)}catch(ae){ot(l,l.return,ae)}}if(l===s){ye=null;break}if(d=l.sibling,d!==null){d.return=l.return,ye=d;break}ye=l.return}}function K_(s){for(;ye!==null;){var l=ye;if(l===s){ye=null;break}var d=l.sibling;if(d!==null){d.return=l.return,ye=d;break}ye=l.return}}function G_(s){for(;ye!==null;){var l=ye;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{Lc(4,l)}catch(X){ot(l,d,X)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var _=l.return;try{y.componentDidMount()}catch(X){ot(l,_,X)}}var C=l.return;try{Fh(l)}catch(X){ot(l,C,X)}break;case 5:var M=l.return;try{Fh(l)}catch(X){ot(l,M,X)}}}catch(X){ot(l,l.return,X)}if(l===s){ye=null;break}var H=l.sibling;if(H!==null){H.return=l.return,ye=H;break}ye=l.return}}var D4=Math.ceil,Dc=E.ReactCurrentDispatcher,Vh=E.ReactCurrentOwner,mn=E.ReactCurrentBatchConfig,qe=0,bt=null,ft=null,kt=0,nn=0,Is=Hr(0),xt=0,ga=null,Mi=0,qc=0,Uh=0,ya=null,Wt=null,Hh=0,Os=1/0,br=null,$c=!1,Wh=null,Qr=null,Fc=!1,Jr=null,Bc=0,va=0,Kh=null,zc=-1,Vc=0;function Lt(){return(qe&6)!==0?tt():zc!==-1?zc:zc=tt()}function Zr(s){return(s.mode&1)===0?1:(qe&2)!==0&&kt!==0?kt&-kt:w4.transition!==null?(Vc===0&&(Vc=hs()),Vc):(s=Fe,s!==0||(s=window.event,s=s===void 0?16:Xb(s.type)),s)}function An(s,l,d,y){if(50<va)throw va=0,Kh=null,Error(n(185));ki(s,d,y),((qe&2)===0||s!==bt)&&(s===bt&&((qe&2)===0&&(qc|=d),xt===4&&ei(s,kt)),Kt(s,y),d===1&&qe===0&&(l.mode&1)===0&&(Os=tt()+500,yc&&Kr()))}function Kt(s,l){var d=s.callbackNode;jd(s,l);var y=ds(s,s===bt?kt:0);if(y===0)d!==null&&Kl(d),s.callbackNode=null,s.callbackPriority=0;else if(l=y&-y,s.callbackPriority!==l){if(d!=null&&Kl(d),l===1)s.tag===0?x4(X_.bind(null,s)):P1(X_.bind(null,s)),m4(function(){(qe&6)===0&&Kr()}),d=null;else{switch(zb(y)){case 1:d=Fo;break;case 4:d=Yl;break;case 16:d=cs;break;case 536870912:d=Xl;break;default:d=cs}d=iS(d,Y_.bind(null,s))}s.callbackPriority=l,s.callbackNode=d}}function Y_(s,l){if(zc=-1,Vc=0,(qe&6)!==0)throw Error(n(327));var d=s.callbackNode;if(Ps()&&s.callbackNode!==d)return null;var y=ds(s,s===bt?kt:0);if(y===0)return null;if((y&30)!==0||(y&s.expiredLanes)!==0||l)l=Uc(s,y);else{l=y;var _=qe;qe|=2;var C=J_();(bt!==s||kt!==l)&&(br=null,Os=tt()+500,Oi(s,l));do try{F4();break}catch(H){Q_(s,H)}while(!0);fh(),Dc.current=C,qe=_,ft!==null?l=0:(bt=null,kt=0,l=xt)}if(l!==0){if(l===2&&(_=Bo(s),_!==0&&(y=_,l=Gh(s,_))),l===1)throw d=ga,Oi(s,0),ei(s,y),Kt(s,tt()),d;if(l===6)ei(s,y);else{if(_=s.current.alternate,(y&30)===0&&!q4(_)&&(l=Uc(s,y),l===2&&(C=Bo(s),C!==0&&(y=C,l=Gh(s,C))),l===1))throw d=ga,Oi(s,0),ei(s,y),Kt(s,tt()),d;switch(s.finishedWork=_,s.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:Pi(s,Wt,br);break;case 3:if(ei(s,y),(y&130023424)===y&&(l=Hh+500-tt(),10<l)){if(ds(s,0)!==0)break;if(_=s.suspendedLanes,(_&y)!==y){Lt(),s.pingedLanes|=s.suspendedLanes&_;break}s.timeoutHandle=eh(Pi.bind(null,s,Wt,br),l);break}Pi(s,Wt,br);break;case 4:if(ei(s,y),(y&4194240)===y)break;for(l=s.eventTimes,_=-1;0<y;){var M=31-Jt(y);C=1<<M,M=l[M],M>_&&(_=M),y&=~C}if(y=_,y=tt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*D4(y/1960))-y,10<y){s.timeoutHandle=eh(Pi.bind(null,s,Wt,br),y);break}Pi(s,Wt,br);break;case 5:Pi(s,Wt,br);break;default:throw Error(n(329))}}}return Kt(s,tt()),s.callbackNode===d?Y_.bind(null,s):null}function Gh(s,l){var d=ya;return s.current.memoizedState.isDehydrated&&(Oi(s,l).flags|=256),s=Uc(s,l),s!==2&&(l=Wt,Wt=d,l!==null&&Yh(l)),s}function Yh(s){Wt===null?Wt=s:Wt.push.apply(Wt,s)}function q4(s){for(var l=s;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var y=0;y<d.length;y++){var _=d[y],C=_.getSnapshot;_=_.value;try{if(!En(C(),_))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ei(s,l){for(l&=~Uh,l&=~qc,s.suspendedLanes|=l,s.pingedLanes&=~l,s=s.expirationTimes;0<l;){var d=31-Jt(l),y=1<<d;s[d]=-1,l&=~y}}function X_(s){if((qe&6)!==0)throw Error(n(327));Ps();var l=ds(s,0);if((l&1)===0)return Kt(s,tt()),null;var d=Uc(s,l);if(s.tag!==0&&d===2){var y=Bo(s);y!==0&&(l=y,d=Gh(s,y))}if(d===1)throw d=ga,Oi(s,0),ei(s,l),Kt(s,tt()),d;if(d===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=l,Pi(s,Wt,br),Kt(s,tt()),null}function Xh(s,l){var d=qe;qe|=1;try{return s(l)}finally{qe=d,qe===0&&(Os=tt()+500,yc&&Kr())}}function Ii(s){Jr!==null&&Jr.tag===0&&(qe&6)===0&&Ps();var l=qe;qe|=1;var d=mn.transition,y=Fe;try{if(mn.transition=null,Fe=1,s)return s()}finally{Fe=y,mn.transition=d,qe=l,(qe&6)===0&&Kr()}}function Qh(){nn=Is.current,We(Is)}function Oi(s,l){s.finishedWork=null,s.finishedLanes=0;var d=s.timeoutHandle;if(d!==-1&&(s.timeoutHandle=-1,p4(d)),ft!==null)for(d=ft.return;d!==null;){var y=d;switch(oh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&mc();break;case 3:As(),We(Vt),We(Nt),xh();break;case 5:yh(y);break;case 4:As();break;case 13:We(nt);break;case 19:We(nt);break;case 10:dh(y.type._context);break;case 22:case 23:Qh()}d=d.return}if(bt=s,ft=s=ti(s.current,null),kt=nn=l,xt=0,ga=null,Uh=qc=Mi=0,Wt=ya=null,Ri!==null){for(l=0;l<Ri.length;l++)if(d=Ri[l],y=d.interleaved,y!==null){d.interleaved=null;var _=y.next,C=d.pending;if(C!==null){var M=C.next;C.next=_,y.next=M}d.pending=y}Ri=null}return s}function Q_(s,l){do{var d=ft;try{if(fh(),Cc.current=Tc,jc){for(var y=rt.memoizedState;y!==null;){var _=y.queue;_!==null&&(_.pending=null),y=y.next}jc=!1}if(Ti=0,wt=vt=rt=null,ua=!1,fa=0,Vh.current=null,d===null||d.return===null){xt=1,ga=l,ft=null;break}e:{var C=s,M=d.return,H=d,X=l;if(l=kt,H.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ie=X,le=H,ce=le.tag;if((le.mode&1)===0&&(ce===0||ce===11||ce===15)){var ae=le.alternate;ae?(le.updateQueue=ae.updateQueue,le.memoizedState=ae.memoizedState,le.lanes=ae.lanes):(le.updateQueue=null,le.memoizedState=null)}var pe=__(M);if(pe!==null){pe.flags&=-257,S_(pe,M,H,C,l),pe.mode&1&&b_(C,ie,l),l=pe,X=ie;var xe=l.updateQueue;if(xe===null){var be=new Set;be.add(X),l.updateQueue=be}else xe.add(X);break e}else{if((l&1)===0){b_(C,ie,l),Jh();break e}X=Error(n(426))}}else if(Ye&&H.mode&1){var at=__(M);if(at!==null){(at.flags&65536)===0&&(at.flags|=256),S_(at,M,H,C,l),ch(Ts(X,H));break e}}C=X=Ts(X,H),xt!==4&&(xt=2),ya===null?ya=[C]:ya.push(C),C=M;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var ne=x_(C,X,l);W1(C,ne);break e;case 1:H=X;var Z=C.type,re=C.stateNode;if((C.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(Qr===null||!Qr.has(re)))){C.flags|=65536,l&=-l,C.lanes|=l;var ue=w_(C,H,l);W1(C,ue);break e}}C=C.return}while(C!==null)}eS(d)}catch(Se){l=Se,ft===d&&d!==null&&(ft=d=d.return);continue}break}while(!0)}function J_(){var s=Dc.current;return Dc.current=Tc,s===null?Tc:s}function Jh(){(xt===0||xt===3||xt===2)&&(xt=4),bt===null||(Mi&268435455)===0&&(qc&268435455)===0||ei(bt,kt)}function Uc(s,l){var d=qe;qe|=2;var y=J_();(bt!==s||kt!==l)&&(br=null,Oi(s,l));do try{$4();break}catch(_){Q_(s,_)}while(!0);if(fh(),qe=d,Dc.current=y,ft!==null)throw Error(n(261));return bt=null,kt=0,xt}function $4(){for(;ft!==null;)Z_(ft)}function F4(){for(;ft!==null&&!bd();)Z_(ft)}function Z_(s){var l=rS(s.alternate,s,nn);s.memoizedProps=s.pendingProps,l===null?eS(s):ft=l,Vh.current=null}function eS(s){var l=s;do{var d=l.alternate;if(s=l.return,(l.flags&32768)===0){if(d=M4(d,l,nn),d!==null){ft=d;return}}else{if(d=I4(d,l),d!==null){d.flags&=32767,ft=d;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{xt=6,ft=null;return}}if(l=l.sibling,l!==null){ft=l;return}ft=l=s}while(l!==null);xt===0&&(xt=5)}function Pi(s,l,d){var y=Fe,_=mn.transition;try{mn.transition=null,Fe=1,B4(s,l,d,y)}finally{mn.transition=_,Fe=y}return null}function B4(s,l,d,y){do Ps();while(Jr!==null);if((qe&6)!==0)throw Error(n(327));d=s.finishedWork;var _=s.finishedLanes;if(d===null)return null;if(s.finishedWork=null,s.finishedLanes=0,d===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var C=d.lanes|d.childLanes;if(Jl(s,C),s===bt&&(ft=bt=null,kt=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Fc||(Fc=!0,iS(cs,function(){return Ps(),null})),C=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||C){C=mn.transition,mn.transition=null;var M=Fe;Fe=1;var H=qe;qe|=4,Vh.current=null,P4(s,d),U_(d,s),a4(Jd),tc=!!Qd,Jd=Qd=null,s.current=d,L4(d),Gl(),qe=H,Fe=M,mn.transition=C}else s.current=d;if(Fc&&(Fc=!1,Jr=s,Bc=_),C=s.pendingLanes,C===0&&(Qr=null),kd(d.stateNode),Kt(s,tt()),l!==null)for(y=s.onRecoverableError,d=0;d<l.length;d++)_=l[d],y(_.value,{componentStack:_.stack,digest:_.digest});if($c)throw $c=!1,s=Wh,Wh=null,s;return(Bc&1)!==0&&s.tag!==0&&Ps(),C=s.pendingLanes,(C&1)!==0?s===Kh?va++:(va=0,Kh=s):va=0,Kr(),null}function Ps(){if(Jr!==null){var s=zb(Bc),l=mn.transition,d=Fe;try{if(mn.transition=null,Fe=16>s?16:s,Jr===null)var y=!1;else{if(s=Jr,Jr=null,Bc=0,(qe&6)!==0)throw Error(n(331));var _=qe;for(qe|=4,ye=s.current;ye!==null;){var C=ye,M=C.child;if((ye.flags&16)!==0){var H=C.deletions;if(H!==null){for(var X=0;X<H.length;X++){var ie=H[X];for(ye=ie;ye!==null;){var le=ye;switch(le.tag){case 0:case 11:case 15:ma(8,le,C)}var ce=le.child;if(ce!==null)ce.return=le,ye=ce;else for(;ye!==null;){le=ye;var ae=le.sibling,pe=le.return;if($_(le),le===ie){ye=null;break}if(ae!==null){ae.return=pe,ye=ae;break}ye=pe}}}var xe=C.alternate;if(xe!==null){var be=xe.child;if(be!==null){xe.child=null;do{var at=be.sibling;be.sibling=null,be=at}while(be!==null)}}ye=C}}if((C.subtreeFlags&2064)!==0&&M!==null)M.return=C,ye=M;else e:for(;ye!==null;){if(C=ye,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:ma(9,C,C.return)}var ne=C.sibling;if(ne!==null){ne.return=C.return,ye=ne;break e}ye=C.return}}var Z=s.current;for(ye=Z;ye!==null;){M=ye;var re=M.child;if((M.subtreeFlags&2064)!==0&&re!==null)re.return=M,ye=re;else e:for(M=Z;ye!==null;){if(H=ye,(H.flags&2048)!==0)try{switch(H.tag){case 0:case 11:case 15:Lc(9,H)}}catch(Se){ot(H,H.return,Se)}if(H===M){ye=null;break e}var ue=H.sibling;if(ue!==null){ue.return=H.return,ye=ue;break e}ye=H.return}}if(qe=_,Kr(),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(Si,s)}catch{}y=!0}return y}finally{Fe=d,mn.transition=l}}return!1}function tS(s,l,d){l=Ts(d,l),l=x_(s,l,1),s=Yr(s,l,1),l=Lt(),s!==null&&(ki(s,1,l),Kt(s,l))}function ot(s,l,d){if(s.tag===3)tS(s,s,d);else for(;l!==null;){if(l.tag===3){tS(l,s,d);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Qr===null||!Qr.has(y))){s=Ts(d,s),s=w_(l,s,1),l=Yr(l,s,1),s=Lt(),l!==null&&(ki(l,1,s),Kt(l,s));break}}l=l.return}}function z4(s,l,d){var y=s.pingCache;y!==null&&y.delete(l),l=Lt(),s.pingedLanes|=s.suspendedLanes&d,bt===s&&(kt&d)===d&&(xt===4||xt===3&&(kt&130023424)===kt&&500>tt()-Hh?Oi(s,0):Uh|=d),Kt(s,l)}function nS(s,l){l===0&&((s.mode&1)===0?l=1:(l=fs,fs<<=1,(fs&130023424)===0&&(fs=4194304)));var d=Lt();s=vr(s,l),s!==null&&(ki(s,l,d),Kt(s,d))}function V4(s){var l=s.memoizedState,d=0;l!==null&&(d=l.retryLane),nS(s,d)}function U4(s,l){var d=0;switch(s.tag){case 13:var y=s.stateNode,_=s.memoizedState;_!==null&&(d=_.retryLane);break;case 19:y=s.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(l),nS(s,d)}var rS;rS=function(s,l,d){if(s!==null)if(s.memoizedProps!==l.pendingProps||Vt.current)Ht=!0;else{if((s.lanes&d)===0&&(l.flags&128)===0)return Ht=!1,T4(s,l,d);Ht=(s.flags&131072)!==0}else Ht=!1,Ye&&(l.flags&1048576)!==0&&L1(l,xc,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;Oc(s,l),s=l.pendingProps;var _=Ss(l,Nt.current);Rs(l,d),_=_h(null,l,y,s,_,d);var C=Sh();return l.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Ut(y)?(C=!0,gc(l)):C=!1,l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,mh(l),_.updater=Mc,l.stateNode=_,_._reactInternals=l,Rh(l,y,s,d),l=Ih(null,l,y,!0,C,d)):(l.tag=0,Ye&&C&&sh(l),Pt(null,l,_,d),l=l.child),l;case 16:y=l.elementType;e:{switch(Oc(s,l),s=l.pendingProps,_=y._init,y=_(y._payload),l.type=y,_=l.tag=W4(y),s=Cn(y,s),_){case 0:l=Mh(null,l,y,s,d);break e;case 1:l=R_(null,l,y,s,d);break e;case 11:l=k_(null,l,y,s,d);break e;case 14:l=E_(null,l,y,Cn(y.type,s),d);break e}throw Error(n(306,y,""))}return l;case 0:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Cn(y,_),Mh(s,l,y,_,d);case 1:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Cn(y,_),R_(s,l,y,_,d);case 3:e:{if(A_(l),s===null)throw Error(n(387));y=l.pendingProps,C=l.memoizedState,_=C.element,H1(s,l),Ec(l,y,null,d);var M=l.memoizedState;if(y=M.element,C.isDehydrated)if(C={element:y,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){_=Ts(Error(n(423)),l),l=T_(s,l,y,d,_);break e}else if(y!==_){_=Ts(Error(n(424)),l),l=T_(s,l,y,d,_);break e}else for(tn=Ur(l.stateNode.containerInfo.firstChild),en=l,Ye=!0,Nn=null,d=V1(l,null,y,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Ns(),y===_){l=wr(s,l,d);break e}Pt(s,l,y,d)}l=l.child}return l;case 5:return G1(l),s===null&&lh(l),y=l.type,_=l.pendingProps,C=s!==null?s.memoizedProps:null,M=_.children,Zd(y,_)?M=null:C!==null&&Zd(y,C)&&(l.flags|=32),j_(s,l),Pt(s,l,M,d),l.child;case 6:return s===null&&lh(l),null;case 13:return M_(s,l,d);case 4:return gh(l,l.stateNode.containerInfo),y=l.pendingProps,s===null?l.child=Cs(l,null,y,d):Pt(s,l,y,d),l.child;case 11:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Cn(y,_),k_(s,l,y,_,d);case 7:return Pt(s,l,l.pendingProps,d),l.child;case 8:return Pt(s,l,l.pendingProps.children,d),l.child;case 12:return Pt(s,l,l.pendingProps.children,d),l.child;case 10:e:{if(y=l.type._context,_=l.pendingProps,C=l.memoizedProps,M=_.value,ze(_c,y._currentValue),y._currentValue=M,C!==null)if(En(C.value,M)){if(C.children===_.children&&!Vt.current){l=wr(s,l,d);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var H=C.dependencies;if(H!==null){M=C.child;for(var X=H.firstContext;X!==null;){if(X.context===y){if(C.tag===1){X=xr(-1,d&-d),X.tag=2;var ie=C.updateQueue;if(ie!==null){ie=ie.shared;var le=ie.pending;le===null?X.next=X:(X.next=le.next,le.next=X),ie.pending=X}}C.lanes|=d,X=C.alternate,X!==null&&(X.lanes|=d),hh(C.return,d,l),H.lanes|=d;break}X=X.next}}else if(C.tag===10)M=C.type===l.type?null:C.child;else if(C.tag===18){if(M=C.return,M===null)throw Error(n(341));M.lanes|=d,H=M.alternate,H!==null&&(H.lanes|=d),hh(M,d,l),M=C.sibling}else M=C.child;if(M!==null)M.return=C;else for(M=C;M!==null;){if(M===l){M=null;break}if(C=M.sibling,C!==null){C.return=M.return,M=C;break}M=M.return}C=M}Pt(s,l,_.children,d),l=l.child}return l;case 9:return _=l.type,y=l.pendingProps.children,Rs(l,d),_=hn(_),y=y(_),l.flags|=1,Pt(s,l,y,d),l.child;case 14:return y=l.type,_=Cn(y,l.pendingProps),_=Cn(y.type,_),E_(s,l,y,_,d);case 15:return N_(s,l,l.type,l.pendingProps,d);case 17:return y=l.type,_=l.pendingProps,_=l.elementType===y?_:Cn(y,_),Oc(s,l),l.tag=1,Ut(y)?(s=!0,gc(l)):s=!1,Rs(l,d),y_(l,y,_),Rh(l,y,_,d),Ih(null,l,y,!0,s,d);case 19:return O_(s,l,d);case 22:return C_(s,l,d)}throw Error(n(156,l.tag))};function iS(s,l){return Wl(s,l)}function H4(s,l,d,y){this.tag=s,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(s,l,d,y){return new H4(s,l,d,y)}function Zh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function W4(s){if(typeof s=="function")return Zh(s)?1:0;if(s!=null){if(s=s.$$typeof,s===q)return 11;if(s===V)return 14}return 2}function ti(s,l){var d=s.alternate;return d===null?(d=gn(s.tag,l,s.key,s.mode),d.elementType=s.elementType,d.type=s.type,d.stateNode=s.stateNode,d.alternate=s,s.alternate=d):(d.pendingProps=l,d.type=s.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=s.flags&14680064,d.childLanes=s.childLanes,d.lanes=s.lanes,d.child=s.child,d.memoizedProps=s.memoizedProps,d.memoizedState=s.memoizedState,d.updateQueue=s.updateQueue,l=s.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=s.sibling,d.index=s.index,d.ref=s.ref,d}function Hc(s,l,d,y,_,C){var M=2;if(y=s,typeof s=="function")Zh(s)&&(M=1);else if(typeof s=="string")M=5;else e:switch(s){case A:return Li(d.children,_,C,l);case O:M=8,_|=8;break;case L:return s=gn(12,d,l,_|2),s.elementType=L,s.lanes=C,s;case U:return s=gn(13,d,l,_),s.elementType=U,s.lanes=C,s;case D:return s=gn(19,d,l,_),s.elementType=D,s.lanes=C,s;case Q:return Wc(d,_,C,l);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case B:M=10;break e;case I:M=9;break e;case q:M=11;break e;case V:M=14;break e;case z:M=16,y=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return l=gn(M,d,l,_),l.elementType=s,l.type=y,l.lanes=C,l}function Li(s,l,d,y){return s=gn(7,s,y,l),s.lanes=d,s}function Wc(s,l,d,y){return s=gn(22,s,y,l),s.elementType=Q,s.lanes=d,s.stateNode={isHidden:!1},s}function ep(s,l,d){return s=gn(6,s,null,l),s.lanes=d,s}function tp(s,l,d){return l=gn(4,s.children!==null?s.children:[],s.key,l),l.lanes=d,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}function K4(s,l,d,y,_){this.tag=l,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zo(0),this.expirationTimes=zo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zo(0),this.identifierPrefix=y,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function np(s,l,d,y,_,C,M,H,X){return s=new K4(s,l,d,H,X),l===1?(l=1,C===!0&&(l|=8)):l=0,C=gn(3,null,null,l),s.current=C,C.stateNode=s,C.memoizedState={element:y,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},mh(C),s}function G4(s,l,d){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:y==null?null:""+y,children:s,containerInfo:l,implementation:d}}function sS(s){if(!s)return Wr;s=s._reactInternals;e:{if(Hn(s)!==s||s.tag!==1)throw Error(n(170));var l=s;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Ut(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(s.tag===1){var d=s.type;if(Ut(d))return I1(s,d,l)}return l}function oS(s,l,d,y,_,C,M,H,X){return s=np(d,y,!0,s,_,C,M,H,X),s.context=sS(null),d=s.current,y=Lt(),_=Zr(d),C=xr(y,_),C.callback=l??null,Yr(d,C,_),s.current.lanes=_,ki(s,_,y),Kt(s,y),s}function Kc(s,l,d,y){var _=l.current,C=Lt(),M=Zr(_);return d=sS(d),l.context===null?l.context=d:l.pendingContext=d,l=xr(C,M),l.payload={element:s},y=y===void 0?null:y,y!==null&&(l.callback=y),s=Yr(_,l,M),s!==null&&(An(s,_,M,C),kc(s,_,M)),M}function Gc(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function aS(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var d=s.retryLane;s.retryLane=d!==0&&d<l?d:l}}function rp(s,l){aS(s,l),(s=s.alternate)&&aS(s,l)}function Y4(){return null}var lS=typeof reportError=="function"?reportError:function(s){console.error(s)};function ip(s){this._internalRoot=s}Yc.prototype.render=ip.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(n(409));Kc(s,l,null,null)},Yc.prototype.unmount=ip.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;Ii(function(){Kc(null,s,null,null)}),l[pr]=null}};function Yc(s){this._internalRoot=s}Yc.prototype.unstable_scheduleHydration=function(s){if(s){var l=Hb();s={blockedOn:null,target:s,priority:l};for(var d=0;d<Br.length&&l!==0&&l<Br[d].priority;d++);Br.splice(d,0,s),d===0&&Gb(s)}};function sp(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Xc(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function cS(){}function X4(s,l,d,y,_){if(_){if(typeof y=="function"){var C=y;y=function(){var ie=Gc(M);C.call(ie)}}var M=oS(l,y,s,0,null,!1,!1,"",cS);return s._reactRootContainer=M,s[pr]=M.current,na(s.nodeType===8?s.parentNode:s),Ii(),M}for(;_=s.lastChild;)s.removeChild(_);if(typeof y=="function"){var H=y;y=function(){var ie=Gc(X);H.call(ie)}}var X=np(s,0,!1,null,null,!1,!1,"",cS);return s._reactRootContainer=X,s[pr]=X.current,na(s.nodeType===8?s.parentNode:s),Ii(function(){Kc(l,X,d,y)}),X}function Qc(s,l,d,y,_){var C=d._reactRootContainer;if(C){var M=C;if(typeof _=="function"){var H=_;_=function(){var X=Gc(M);H.call(X)}}Kc(l,M,s,_)}else M=X4(d,l,s,_,y);return Gc(M)}Vb=function(s){switch(s.tag){case 3:var l=s.stateNode;if(l.current.memoizedState.isDehydrated){var d=Wn(l.pendingLanes);d!==0&&(Rd(l,d|1),Kt(l,tt()),(qe&6)===0&&(Os=tt()+500,Kr()))}break;case 13:Ii(function(){var y=vr(s,1);if(y!==null){var _=Lt();An(y,s,1,_)}}),rp(s,1)}},Ad=function(s){if(s.tag===13){var l=vr(s,134217728);if(l!==null){var d=Lt();An(l,s,134217728,d)}rp(s,134217728)}},Ub=function(s){if(s.tag===13){var l=Zr(s),d=vr(s,l);if(d!==null){var y=Lt();An(d,s,l,y)}rp(s,l)}},Hb=function(){return Fe},Wb=function(s,l){var d=Fe;try{return Fe=s,l()}finally{Fe=d}},Oo=function(s,l,d){switch(l){case"input":if(Ee(s,d),l=d.name,d.type==="radio"&&l!=null){for(d=s;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var y=d[l];if(y!==s&&y.form===s.form){var _=pc(y);if(!_)throw Error(n(90));me(y),Ee(y,_)}}}break;case"textarea":At(s,d);break;case"select":l=d.value,l!=null&&yt(s,!!d.multiple,l,!1)}},Bl=Xh,zl=Ii;var Q4={usingClientEntryPoint:!1,Events:[sa,bs,pc,$l,Fl,Xh]},xa={findFiberByHostInstance:Ei,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},J4={bundleType:xa.bundleType,version:xa.version,rendererPackageName:xa.rendererPackageName,rendererConfig:xa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Ul(s),s===null?null:s.stateNode},findFiberByHostInstance:xa.findFiberByHostInstance||Y4,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 Jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jc.isDisabled&&Jc.supportsFiber)try{Si=Jc.inject(J4),un=Jc}catch{}}return Gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q4,Gt.createPortal=function(s,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sp(l))throw Error(n(200));return G4(s,l,null,d)},Gt.createRoot=function(s,l){if(!sp(s))throw Error(n(299));var d=!1,y="",_=lS;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),l=np(s,1,!1,null,null,d,!1,y,_),s[pr]=l.current,na(s.nodeType===8?s.parentNode:s),new ip(l)},Gt.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=Ul(l),s=s===null?null:s.stateNode,s},Gt.flushSync=function(s){return Ii(s)},Gt.hydrate=function(s,l,d){if(!Xc(l))throw Error(n(200));return Qc(null,s,l,!0,d)},Gt.hydrateRoot=function(s,l,d){if(!sp(s))throw Error(n(405));var y=d!=null&&d.hydratedSources||null,_=!1,C="",M=lS;if(d!=null&&(d.unstable_strictMode===!0&&(_=!0),d.identifierPrefix!==void 0&&(C=d.identifierPrefix),d.onRecoverableError!==void 0&&(M=d.onRecoverableError)),l=oS(l,null,s,1,d??null,_,!1,C,M),s[pr]=l.current,na(s),y)for(s=0;s<y.length;s++)d=y[s],_=d._getVersion,_=_(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,_]:l.mutableSourceEagerHydrationData.push(d,_);return new Yc(l)},Gt.render=function(s,l,d){if(!Xc(l))throw Error(n(200));return Qc(null,s,l,!1,d)},Gt.unmountComponentAtNode=function(s){if(!Xc(s))throw Error(n(40));return s._reactRootContainer?(Ii(function(){Qc(null,null,s,!1,function(){s._reactRootContainer=null,s[pr]=null})}),!0):!1},Gt.unstable_batchedUpdates=Xh,Gt.unstable_renderSubtreeIntoContainer=function(s,l,d,y){if(!Xc(d))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return Qc(s,l,d,!1,y)},Gt.version="18.3.1-next-f1338f8080-20240426",Gt}var yS;function ZR(){if(yS)return lp.exports;yS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),lp.exports=o3(),lp.exports}var vS;function a3(){if(vS)return eu;vS=1;var e=ZR();return eu.createRoot=e.createRoot,eu.hydrateRoot=e.hydrateRoot,eu}var l3=a3();const c3=fl(l3);function pt(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=pt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var u3={value:()=>{}};function gf(){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 ju(n)}function ju(e){this._=e}function f3(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ju.prototype=gf.prototype={constructor:ju,on:function(e,t){var n=this._,r=f3(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=d3(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=xS(n[i],e.name,t);else if(t==null)for(i in n)n[i]=xS(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ju(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function d3(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function xS(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=u3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var mx="http://www.w3.org/1999/xhtml";const wS={svg:"http://www.w3.org/2000/svg",xhtml:mx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yf(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),wS.hasOwnProperty(t)?{space:wS[t],local:e}:e}function h3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mx&&t.documentElement.namespaceURI===mx?t.createElement(e):t.createElementNS(n,e)}}function p3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function eA(e){var t=yf(e);return(t.local?p3:h3)(t)}function m3(){}function iw(e){return e==null?m3:function(){return this.querySelector(e)}}function g3(e){typeof e!="function"&&(e=iw(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,c=r[i]=new Array(a),u,f,h=0;h<a;++h)(u=o[h])&&(f=e.call(u,u.__data__,h,o))&&("__data__"in u&&(f.__data__=u.__data__),c[h]=f);return new ln(r,this._parents)}function y3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function v3(){return[]}function tA(e){return e==null?v3:function(){return this.querySelectorAll(e)}}function x3(e){return function(){return y3(e.apply(this,arguments))}}function w3(e){typeof e=="function"?e=x3(e):e=tA(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],c=a.length,u,f=0;f<c;++f)(u=a[f])&&(r.push(e.call(u,u.__data__,f,a)),i.push(u));return new ln(r,i)}function nA(e){return function(){return this.matches(e)}}function rA(e){return function(t){return t.matches(e)}}var b3=Array.prototype.find;function _3(e){return function(){return b3.call(this.children,e)}}function S3(){return this.firstElementChild}function k3(e){return this.select(e==null?S3:_3(typeof e=="function"?e:rA(e)))}var E3=Array.prototype.filter;function N3(){return Array.from(this.children)}function C3(e){return function(){return E3.call(this.children,e)}}function j3(e){return this.selectAll(e==null?N3:C3(typeof e=="function"?e:rA(e)))}function R3(e){typeof e!="function"&&(e=nA(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,c=r[i]=[],u,f=0;f<a;++f)(u=o[f])&&e.call(u,u.__data__,f,o)&&c.push(u);return new ln(r,this._parents)}function iA(e){return new Array(e.length)}function A3(){return new ln(this._enter||this._groups.map(iA),this._parents)}function Vu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Vu.prototype={constructor:Vu,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 T3(e){return function(){return e}}function M3(e,t,n,r,i,o){for(var a=0,c,u=t.length,f=o.length;a<f;++a)(c=t[a])?(c.__data__=o[a],r[a]=c):n[a]=new Vu(e,o[a]);for(;a<u;++a)(c=t[a])&&(i[a]=c)}function I3(e,t,n,r,i,o,a){var c,u,f=new Map,h=t.length,p=o.length,g=new Array(h),v;for(c=0;c<h;++c)(u=t[c])&&(g[c]=v=a.call(u,u.__data__,c,t)+"",f.has(v)?i[c]=u:f.set(v,u));for(c=0;c<p;++c)v=a.call(e,o[c],c,o)+"",(u=f.get(v))?(r[c]=u,u.__data__=o[c],f.delete(v)):n[c]=new Vu(e,o[c]);for(c=0;c<h;++c)(u=t[c])&&f.get(g[c])===u&&(i[c]=u)}function O3(e){return e.__data__}function P3(e,t){if(!arguments.length)return Array.from(this,O3);var n=t?I3:M3,r=this._parents,i=this._groups;typeof e!="function"&&(e=T3(e));for(var o=i.length,a=new Array(o),c=new Array(o),u=new Array(o),f=0;f<o;++f){var h=r[f],p=i[f],g=p.length,v=L3(e.call(h,h&&h.__data__,f,r)),b=v.length,x=c[f]=new Array(b),w=a[f]=new Array(b),S=u[f]=new Array(g);n(h,p,x,w,S,v,t);for(var N=0,k=0,E,R;N<b;++N)if(E=x[N]){for(N>=k&&(k=N+1);!(R=w[k])&&++k<b;);E._next=R||null}}return a=new ln(a,r),a._enter=c,a._exit=u,a}function L3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function D3(){return new ln(this._exit||this._groups.map(iA),this._parents)}function q3(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function $3(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),c=new Array(i),u=0;u<a;++u)for(var f=n[u],h=r[u],p=f.length,g=c[u]=new Array(p),v,b=0;b<p;++b)(v=f[b]||h[b])&&(g[b]=v);for(;u<i;++u)c[u]=n[u];return new ln(c,this._parents)}function F3(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function B3(e){e||(e=z3);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],c=a.length,u=i[o]=new Array(c),f,h=0;h<c;++h)(f=a[h])&&(u[h]=f);u.sort(t)}return new ln(i,this._parents).order()}function z3(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function V3(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function U3(){return Array.from(this)}function H3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function W3(){let e=0;for(const t of this)++e;return e}function K3(){return!this.node()}function G3(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,c;o<a;++o)(c=i[o])&&e.call(c,c.__data__,o,i);return this}function Y3(e){return function(){this.removeAttribute(e)}}function X3(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Q3(e,t){return function(){this.setAttribute(e,t)}}function J3(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Z3(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function eD(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 tD(e,t){var n=yf(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?X3:Y3:typeof t=="function"?n.local?eD:Z3:n.local?J3:Q3)(n,t))}function sA(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nD(e){return function(){this.style.removeProperty(e)}}function rD(e,t,n){return function(){this.style.setProperty(e,t,n)}}function iD(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function sD(e,t,n){return arguments.length>1?this.each((t==null?nD:typeof t=="function"?iD:rD)(e,t,n??"")):ro(this.node(),e)}function ro(e,t){return e.style.getPropertyValue(t)||sA(e).getComputedStyle(e,null).getPropertyValue(t)}function oD(e){return function(){delete this[e]}}function aD(e,t){return function(){this[e]=t}}function lD(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function cD(e,t){return arguments.length>1?this.each((t==null?oD:typeof t=="function"?lD:aD)(e,t)):this.node()[e]}function oA(e){return e.trim().split(/^|\s+/)}function sw(e){return e.classList||new aA(e)}function aA(e){this._node=e,this._names=oA(e.getAttribute("class")||"")}aA.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 lA(e,t){for(var n=sw(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function cA(e,t){for(var n=sw(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function uD(e){return function(){lA(this,e)}}function fD(e){return function(){cA(this,e)}}function dD(e,t){return function(){(t.apply(this,arguments)?lA:cA)(this,e)}}function hD(e,t){var n=oA(e+"");if(arguments.length<2){for(var r=sw(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?dD:t?uD:fD)(n,t))}function pD(){this.textContent=""}function mD(e){return function(){this.textContent=e}}function gD(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yD(e){return arguments.length?this.each(e==null?pD:(typeof e=="function"?gD:mD)(e)):this.node().textContent}function vD(){this.innerHTML=""}function xD(e){return function(){this.innerHTML=e}}function wD(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function bD(e){return arguments.length?this.each(e==null?vD:(typeof e=="function"?wD:xD)(e)):this.node().innerHTML}function _D(){this.nextSibling&&this.parentNode.appendChild(this)}function SD(){return this.each(_D)}function kD(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ED(){return this.each(kD)}function ND(e){var t=typeof e=="function"?e:eA(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function CD(){return null}function jD(e,t){var n=typeof e=="function"?e:eA(e),r=t==null?CD:typeof t=="function"?t:iw(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function RD(){var e=this.parentNode;e&&e.removeChild(this)}function AD(){return this.each(RD)}function TD(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function MD(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ID(e){return this.select(e?MD:TD)}function OD(e){return arguments.length?this.property("__data__",e):this.node().__data__}function PD(e){return function(t){e.call(this,t,this.__data__)}}function LD(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 DD(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function qD(e,t,n){return function(){var r=this.__on,i,o=PD(t);if(r){for(var a=0,c=r.length;a<c;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function $D(e,t,n){var r=LD(e+""),i,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,f=c.length,h;u<f;++u)for(i=0,h=c[u];i<o;++i)if((a=r[i]).type===h.type&&a.name===h.name)return h.value}return}for(c=t?qD:DD,i=0;i<o;++i)this.each(c(r[i],t,n));return this}function uA(e,t,n){var r=sA(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function FD(e,t){return function(){return uA(this,e,t)}}function BD(e,t){return function(){return uA(this,e,t.apply(this,arguments))}}function zD(e,t){return this.each((typeof t=="function"?BD:FD)(e,t))}function*VD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var fA=[null];function ln(e,t){this._groups=e,this._parents=t}function hl(){return new ln([[document.documentElement]],fA)}function UD(){return this}ln.prototype=hl.prototype={constructor:ln,select:g3,selectAll:w3,selectChild:k3,selectChildren:j3,filter:R3,data:P3,enter:A3,exit:D3,join:q3,merge:$3,selection:UD,order:F3,sort:B3,call:V3,nodes:U3,node:H3,size:W3,empty:K3,each:G3,attr:tD,style:sD,property:cD,classed:hD,text:yD,html:bD,raise:SD,lower:ED,append:ND,insert:jD,remove:AD,clone:ID,datum:OD,on:$D,dispatch:zD,[Symbol.iterator]:VD};function on(e){return typeof e=="string"?new ln([[document.querySelector(e)]],[document.documentElement]):new ln([[e]],fA)}function HD(e){let t;for(;t=e.sourceEvent;)e=t;return e}function In(e,t){if(e=HD(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const WD={passive:!1},Ha={capture:!0,passive:!1};function fp(e){e.stopImmediatePropagation()}function Xs(e){e.preventDefault(),e.stopImmediatePropagation()}function dA(e){var t=e.document.documentElement,n=on(e).on("dragstart.drag",Xs,Ha);"onselectstart"in t?n.on("selectstart.drag",Xs,Ha):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hA(e,t){var n=e.document.documentElement,r=on(e).on("dragstart.drag",null);t&&(r.on("click.drag",Xs,Ha),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 gx(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:c,dx:u,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}gx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function KD(e){return!e.ctrlKey&&!e.button}function GD(){return this.parentNode}function YD(e,t){return t??{x:e.x,y:e.y}}function XD(){return navigator.maxTouchPoints||"ontouchstart"in this}function pA(){var e=KD,t=GD,n=YD,r=XD,i={},o=gf("start","drag","end"),a=0,c,u,f,h,p=0;function g(E){E.on("mousedown.drag",v).filter(r).on("touchstart.drag",w).on("touchmove.drag",S,WD).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(E,R){if(!(h||!e.call(this,E,R))){var T=k(this,t.call(this,E,R),E,R,"mouse");T&&(on(E.view).on("mousemove.drag",b,Ha).on("mouseup.drag",x,Ha),dA(E.view),fp(E),f=!1,c=E.clientX,u=E.clientY,T("start",E))}}function b(E){if(Xs(E),!f){var R=E.clientX-c,T=E.clientY-u;f=R*R+T*T>p}i.mouse("drag",E)}function x(E){on(E.view).on("mousemove.drag mouseup.drag",null),hA(E.view,f),Xs(E),i.mouse("end",E)}function w(E,R){if(e.call(this,E,R)){var T=E.changedTouches,A=t.call(this,E,R),O=T.length,L,B;for(L=0;L<O;++L)(B=k(this,A,E,R,T[L].identifier,T[L]))&&(fp(E),B("start",E,T[L]))}}function S(E){var R=E.changedTouches,T=R.length,A,O;for(A=0;A<T;++A)(O=i[R[A].identifier])&&(Xs(E),O("drag",E,R[A]))}function N(E){var R=E.changedTouches,T=R.length,A,O;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),A=0;A<T;++A)(O=i[R[A].identifier])&&(fp(E),O("end",E,R[A]))}function k(E,R,T,A,O,L){var B=o.copy(),I=In(L||T,R),q,U,D;if((D=n.call(E,new gx("beforestart",{sourceEvent:T,target:g,identifier:O,active:a,x:I[0],y:I[1],dx:0,dy:0,dispatch:B}),A))!=null)return q=D.x-I[0]||0,U=D.y-I[1]||0,function V(z,Q,F){var $=I,Y;switch(z){case"start":i[O]=V,Y=a++;break;case"end":delete i[O],--a;case"drag":I=In(F||Q,R),Y=a;break}B.call(z,E,new gx(z,{sourceEvent:Q,subject:D,target:g,identifier:O,active:Y,x:I[0]+q,y:I[1]+U,dx:I[0]-$[0],dy:I[1]-$[1],dispatch:B}),A)}}return g.filter=function(E){return arguments.length?(e=typeof E=="function"?E:tu(!!E),g):e},g.container=function(E){return arguments.length?(t=typeof E=="function"?E:tu(E),g):t},g.subject=function(E){return arguments.length?(n=typeof E=="function"?E:tu(E),g):n},g.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:tu(!!E),g):r},g.on=function(){var E=o.on.apply(o,arguments);return E===o?g:E},g.clickDistance=function(E){return arguments.length?(p=(E=+E)*E,g):Math.sqrt(p)},g}function ow(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mA(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pl(){}var Wa=.7,Uu=1/Wa,Qs="\\s*([+-]?\\d+)\\s*",Ka="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",QD=/^#([0-9a-f]{3,8})$/,JD=new RegExp(`^rgb\\(${Qs},${Qs},${Qs}\\)$`),ZD=new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),e5=new RegExp(`^rgba\\(${Qs},${Qs},${Qs},${Ka}\\)$`),t5=new RegExp(`^rgba\\(${nr},${nr},${nr},${Ka}\\)$`),n5=new RegExp(`^hsl\\(${Ka},${nr},${nr}\\)$`),r5=new RegExp(`^hsla\\(${Ka},${nr},${nr},${Ka}\\)$`),bS={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};ow(pl,Ui,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_S,formatHex:_S,formatHex8:i5,formatHsl:s5,formatRgb:SS,toString:SS});function _S(){return this.rgb().formatHex()}function i5(){return this.rgb().formatHex8()}function s5(){return gA(this).formatHsl()}function SS(){return this.rgb().formatRgb()}function Ui(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=QD.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kS(t):n===3?new Yt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?nu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?nu(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=JD.exec(e))?new Yt(t[1],t[2],t[3],1):(t=ZD.exec(e))?new Yt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=e5.exec(e))?nu(t[1],t[2],t[3],t[4]):(t=t5.exec(e))?nu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=n5.exec(e))?CS(t[1],t[2]/100,t[3]/100,1):(t=r5.exec(e))?CS(t[1],t[2]/100,t[3]/100,t[4]):bS.hasOwnProperty(e)?kS(bS[e]):e==="transparent"?new Yt(NaN,NaN,NaN,0):null}function kS(e){return new Yt(e>>16&255,e>>8&255,e&255,1)}function nu(e,t,n,r){return r<=0&&(e=t=n=NaN),new Yt(e,t,n,r)}function o5(e){return e instanceof pl||(e=Ui(e)),e?(e=e.rgb(),new Yt(e.r,e.g,e.b,e.opacity)):new Yt}function yx(e,t,n,r){return arguments.length===1?o5(e):new Yt(e,t,n,r??1)}function Yt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ow(Yt,yx,mA(pl,{brighter(e){return e=e==null?Uu:Math.pow(Uu,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wa:Math.pow(Wa,e),new Yt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yt(zi(this.r),zi(this.g),zi(this.b),Hu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ES,formatHex:ES,formatHex8:a5,formatRgb:NS,toString:NS}));function ES(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}`}function a5(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}${$i((isNaN(this.opacity)?1:this.opacity)*255)}`}function NS(){const e=Hu(this.opacity);return`${e===1?"rgb(":"rgba("}${zi(this.r)}, ${zi(this.g)}, ${zi(this.b)}${e===1?")":`, ${e})`}`}function Hu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $i(e){return e=zi(e),(e<16?"0":"")+e.toString(16)}function CS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pn(e,t,n,r)}function gA(e){if(e instanceof Pn)return new Pn(e.h,e.s,e.l,e.opacity);if(e instanceof pl||(e=Ui(e)),!e)return new Pn;if(e instanceof Pn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,c=o-i,u=(o+i)/2;return c?(t===o?a=(n-r)/c+(n<r)*6:n===o?a=(r-t)/c+2:a=(t-n)/c+4,c/=u<.5?o+i:2-o-i,a*=60):c=u>0&&u<1?0:a,new Pn(a,c,u,e.opacity)}function l5(e,t,n,r){return arguments.length===1?gA(e):new Pn(e,t,n,r??1)}function Pn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ow(Pn,l5,mA(pl,{brighter(e){return e=e==null?Uu:Math.pow(Uu,e),new Pn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wa:Math.pow(Wa,e),new Pn(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,i=2*n-r;return new Yt(dp(e>=240?e-240:e+120,i,r),dp(e,i,r),dp(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Pn(jS(this.h),ru(this.s),ru(this.l),Hu(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=Hu(this.opacity);return`${e===1?"hsl(":"hsla("}${jS(this.h)}, ${ru(this.s)*100}%, ${ru(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jS(e){return e=(e||0)%360,e<0?e+360:e}function ru(e){return Math.max(0,Math.min(1,e||0))}function dp(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 aw=e=>()=>e;function c5(e,t){return function(n){return e+n*t}}function u5(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 f5(e){return(e=+e)==1?yA:function(t,n){return n-t?u5(t,n,e):aw(isNaN(t)?n:t)}}function yA(e,t){var n=t-e;return n?c5(e,n):aw(isNaN(e)?t:e)}const Wu=(function e(t){var n=f5(t);function r(i,o){var a=n((i=yx(i)).r,(o=yx(o)).r),c=n(i.g,o.g),u=n(i.b,o.b),f=yA(i.opacity,o.opacity);return function(h){return i.r=a(h),i.g=c(h),i.b=u(h),i.opacity=f(h),i+""}}return r.gamma=e,r})(1);function d5(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function h5(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function p5(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=qa(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(c){for(a=0;a<r;++a)o[a]=i[a](c);return o}}function m5(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Qn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function g5(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=qa(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var vx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hp=new RegExp(vx.source,"g");function y5(e){return function(){return e}}function v5(e){return function(t){return e(t)+""}}function vA(e,t){var n=vx.lastIndex=hp.lastIndex=0,r,i,o,a=-1,c=[],u=[];for(e=e+"",t=t+"";(r=vx.exec(e))&&(i=hp.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),c[a]?c[a]+=o:c[++a]=o),(r=r[0])===(i=i[0])?c[a]?c[a]+=i:c[++a]=i:(c[++a]=null,u.push({i:a,x:Qn(r,i)})),n=hp.lastIndex;return n<t.length&&(o=t.slice(n),c[a]?c[a]+=o:c[++a]=o),c.length<2?u[0]?v5(u[0].x):y5(t):(t=u.length,function(f){for(var h=0,p;h<t;++h)c[(p=u[h]).i]=p.x(f);return c.join("")})}function qa(e,t){var n=typeof t,r;return t==null||n==="boolean"?aw(t):(n==="number"?Qn:n==="string"?(r=Ui(t))?(t=r,Wu):vA:t instanceof Ui?Wu:t instanceof Date?m5:h5(t)?d5:Array.isArray(t)?p5:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?g5:Qn)(e,t)}var RS=180/Math.PI,xx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xA(e,t,n,r,i,o){var a,c,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*RS,skewX:Math.atan(u)*RS,scaleX:a,scaleY:c}}var iu;function x5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?xx:xA(t.a,t.b,t.c,t.d,t.e,t.f)}function w5(e){return e==null||(iu||(iu=document.createElementNS("http://www.w3.org/2000/svg","g")),iu.setAttribute("transform",e),!(e=iu.transform.baseVal.consolidate()))?xx:(e=e.matrix,xA(e.a,e.b,e.c,e.d,e.e,e.f))}function wA(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function o(f,h,p,g,v,b){if(f!==p||h!==g){var x=v.push("translate(",null,t,null,n);b.push({i:x-4,x:Qn(f,p)},{i:x-2,x:Qn(h,g)})}else(p||g)&&v.push("translate("+p+t+g+n)}function a(f,h,p,g){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),g.push({i:p.push(i(p)+"rotate(",null,r)-2,x:Qn(f,h)})):h&&p.push(i(p)+"rotate("+h+r)}function c(f,h,p,g){f!==h?g.push({i:p.push(i(p)+"skewX(",null,r)-2,x:Qn(f,h)}):h&&p.push(i(p)+"skewX("+h+r)}function u(f,h,p,g,v,b){if(f!==p||h!==g){var x=v.push(i(v)+"scale(",null,",",null,")");b.push({i:x-4,x:Qn(f,p)},{i:x-2,x:Qn(h,g)})}else(p!==1||g!==1)&&v.push(i(v)+"scale("+p+","+g+")")}return function(f,h){var p=[],g=[];return f=e(f),h=e(h),o(f.translateX,f.translateY,h.translateX,h.translateY,p,g),a(f.rotate,h.rotate,p,g),c(f.skewX,h.skewX,p,g),u(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,g),f=h=null,function(v){for(var b=-1,x=g.length,w;++b<x;)p[(w=g[b]).i]=w.x(v);return p.join("")}}}var b5=wA(x5,"px, ","px)","deg)"),_5=wA(w5,", ",")",")"),S5=1e-12;function AS(e){return((e=Math.exp(e))+1/e)/2}function k5(e){return((e=Math.exp(e))-1/e)/2}function E5(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ru=(function e(t,n,r){function i(o,a){var c=o[0],u=o[1],f=o[2],h=a[0],p=a[1],g=a[2],v=h-c,b=p-u,x=v*v+b*b,w,S;if(x<S5)S=Math.log(g/f)/t,w=function(A){return[c+A*v,u+A*b,f*Math.exp(t*A*S)]};else{var N=Math.sqrt(x),k=(g*g-f*f+r*x)/(2*f*n*N),E=(g*g-f*f-r*x)/(2*g*n*N),R=Math.log(Math.sqrt(k*k+1)-k),T=Math.log(Math.sqrt(E*E+1)-E);S=(T-R)/t,w=function(A){var O=A*S,L=AS(R),B=f/(n*N)*(L*E5(t*O+R)-k5(R));return[c+B*v,u+B*b,f*L/AS(t*O+R)]}}return w.duration=S*1e3*t/Math.SQRT2,w}return i.rho=function(o){var a=Math.max(.001,+o),c=a*a,u=c*c;return e(a,c,u)},i})(Math.SQRT2,2,4);var io=0,Ca=0,ba=0,bA=1e3,Ku,ja,Gu=0,Hi=0,vf=0,Ga=typeof performance=="object"&&performance.now?performance:Date,_A=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lw(){return Hi||(_A(N5),Hi=Ga.now()+vf)}function N5(){Hi=0}function Yu(){this._call=this._time=this._next=null}Yu.prototype=SA.prototype={constructor:Yu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?lw():+n)+(t==null?0:+t),!this._next&&ja!==this&&(ja?ja._next=this:Ku=this,ja=this),this._call=e,this._time=n,wx()},stop:function(){this._call&&(this._call=null,this._time=1/0,wx())}};function SA(e,t,n){var r=new Yu;return r.restart(e,t,n),r}function C5(){lw(),++io;for(var e=Ku,t;e;)(t=Hi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--io}function TS(){Hi=(Gu=Ga.now())+vf,io=Ca=0;try{C5()}finally{io=0,R5(),Hi=0}}function j5(){var e=Ga.now(),t=e-Gu;t>bA&&(vf-=t,Gu=e)}function R5(){for(var e,t=Ku,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:Ku=n);ja=e,wx(r)}function wx(e){if(!io){Ca&&(Ca=clearTimeout(Ca));var t=e-Hi;t>24?(e<1/0&&(Ca=setTimeout(TS,e-Ga.now()-vf)),ba&&(ba=clearInterval(ba))):(ba||(Gu=Ga.now(),ba=setInterval(j5,bA)),io=1,_A(TS))}}function MS(e,t,n){var r=new Yu;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var A5=gf("start","end","cancel","interrupt"),T5=[],kA=0,IS=1,bx=2,Au=3,OS=4,_x=5,Tu=6;function xf(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;M5(e,n,{name:t,index:r,group:i,on:A5,tween:T5,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:kA})}function cw(e,t){var n=Bn(e,t);if(n.state>kA)throw new Error("too late; already scheduled");return n}function fr(e,t){var n=Bn(e,t);if(n.state>Au)throw new Error("too late; already running");return n}function Bn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function M5(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=SA(o,0,n.time);function o(f){n.state=IS,n.timer.restart(a,n.delay,n.time),n.delay<=f&&a(f-n.delay)}function a(f){var h,p,g,v;if(n.state!==IS)return u();for(h in r)if(v=r[h],v.name===n.name){if(v.state===Au)return MS(a);v.state===OS?(v.state=Tu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[h]):+h<t&&(v.state=Tu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[h])}if(MS(function(){n.state===Au&&(n.state=OS,n.timer.restart(c,n.delay,n.time),c(f))}),n.state=bx,n.on.call("start",e,e.__data__,n.index,n.group),n.state===bx){for(n.state=Au,i=new Array(g=n.tween.length),h=0,p=-1;h<g;++h)(v=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(i[++p]=v);i.length=p+1}}function c(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=_x,1),p=-1,g=i.length;++p<g;)i[p].call(e,h);n.state===_x&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Tu,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Mu(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>bx&&r.state<_x,r.state=Tu,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function I5(e){return this.each(function(){Mu(this,e)})}function O5(e,t){var n,r;return function(){var i=fr(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function P5(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=fr(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var c={name:t,value:n},u=0,f=i.length;u<f;++u)if(i[u].name===t){i[u]=c;break}u===f&&i.push(c)}o.tween=i}}function L5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Bn(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?O5:P5)(n,e,t))}function uw(e,t,n){var r=e._id;return e.each(function(){var i=fr(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Bn(i,r).value[t]}}function EA(e,t){var n;return(typeof t=="number"?Qn:t instanceof Ui?Wu:(n=Ui(t))?(t=n,Wu):vA)(e,t)}function D5(e){return function(){this.removeAttribute(e)}}function q5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $5(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function F5(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function B5(e,t,n){var r,i,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=c+"",a===u?null:a===r&&u===i?o:(i=u,o=t(r=a,c)))}}function z5(e,t,n){var r,i,o;return function(){var a,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=c+"",a===u?null:a===r&&u===i?o:(i=u,o=t(r=a,c)))}}function V5(e,t){var n=yf(e),r=n==="transform"?_5:EA;return this.attrTween(e,typeof t=="function"?(n.local?z5:B5)(n,r,uw(this,"attr."+e,t)):t==null?(n.local?q5:D5)(n):(n.local?F5:$5)(n,r,t))}function U5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function H5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function W5(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&H5(e,o)),n}return i._value=t,i}function K5(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&U5(e,o)),n}return i._value=t,i}function G5(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=yf(e);return this.tween(n,(r.local?W5:K5)(r,t))}function Y5(e,t){return function(){cw(this,e).delay=+t.apply(this,arguments)}}function X5(e,t){return t=+t,function(){cw(this,e).delay=t}}function Q5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Y5:X5)(t,e)):Bn(this.node(),t).delay}function J5(e,t){return function(){fr(this,e).duration=+t.apply(this,arguments)}}function Z5(e,t){return t=+t,function(){fr(this,e).duration=t}}function eq(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?J5:Z5)(t,e)):Bn(this.node(),t).duration}function tq(e,t){if(typeof t!="function")throw new Error;return function(){fr(this,e).ease=t}}function nq(e){var t=this._id;return arguments.length?this.each(tq(t,e)):Bn(this.node(),t).ease}function rq(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;fr(this,e).ease=n}}function iq(e){if(typeof e!="function")throw new Error;return this.each(rq(this._id,e))}function sq(e){typeof e!="function"&&(e=nA(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,c=r[i]=[],u,f=0;f<a;++f)(u=o[f])&&e.call(u,u.__data__,f,o)&&c.push(u);return new Rr(r,this._parents,this._name,this._id)}function oq(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),c=0;c<o;++c)for(var u=t[c],f=n[c],h=u.length,p=a[c]=new Array(h),g,v=0;v<h;++v)(g=u[v]||f[v])&&(p[v]=g);for(;c<r;++c)a[c]=t[c];return new Rr(a,this._parents,this._name,this._id)}function aq(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 lq(e,t,n){var r,i,o=aq(t)?cw:fr;return function(){var a=o(this,e),c=a.on;c!==r&&(i=(r=c).copy()).on(t,n),a.on=i}}function cq(e,t){var n=this._id;return arguments.length<2?Bn(this.node(),n).on.on(e):this.each(lq(n,e,t))}function uq(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fq(){return this.on("end.remove",uq(this._id))}function dq(e){var t=this._name,n=this._id;typeof e!="function"&&(e=iw(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var c=r[a],u=c.length,f=o[a]=new Array(u),h,p,g=0;g<u;++g)(h=c[g])&&(p=e.call(h,h.__data__,g,c))&&("__data__"in h&&(p.__data__=h.__data__),f[g]=p,xf(f[g],t,n,g,f,Bn(h,n)));return new Rr(o,this._parents,t,n)}function hq(e){var t=this._name,n=this._id;typeof e!="function"&&(e=tA(e));for(var r=this._groups,i=r.length,o=[],a=[],c=0;c<i;++c)for(var u=r[c],f=u.length,h,p=0;p<f;++p)if(h=u[p]){for(var g=e.call(h,h.__data__,p,u),v,b=Bn(h,n),x=0,w=g.length;x<w;++x)(v=g[x])&&xf(v,t,n,x,g,b);o.push(g),a.push(h)}return new Rr(o,a,t,n)}var pq=hl.prototype.constructor;function mq(){return new pq(this._groups,this._parents)}function gq(e,t){var n,r,i;return function(){var o=ro(this,e),a=(this.style.removeProperty(e),ro(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function NA(e){return function(){this.style.removeProperty(e)}}function yq(e,t,n){var r,i=n+"",o;return function(){var a=ro(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function vq(e,t,n){var r,i,o;return function(){var a=ro(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),ro(this,e))),a===u?null:a===r&&u===i?o:(i=u,o=t(r=a,c))}}function xq(e,t){var n,r,i,o="style."+t,a="end."+o,c;return function(){var u=fr(this,e),f=u.on,h=u.value[o]==null?c||(c=NA(t)):void 0;(f!==n||i!==h)&&(r=(n=f).copy()).on(a,i=h),u.on=r}}function wq(e,t,n){var r=(e+="")=="transform"?b5:EA;return t==null?this.styleTween(e,gq(e,r)).on("end.style."+e,NA(e)):typeof t=="function"?this.styleTween(e,vq(e,r,uw(this,"style."+e,t))).each(xq(this._id,e)):this.styleTween(e,yq(e,r,t),n).on("end.style."+e,null)}function bq(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _q(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&bq(e,a,n)),r}return o._value=t,o}function Sq(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,_q(e,t,n??""))}function kq(e){return function(){this.textContent=e}}function Eq(e){return function(){var t=e(this);this.textContent=t??""}}function Nq(e){return this.tween("text",typeof e=="function"?Eq(uw(this,"text",e)):kq(e==null?"":e+""))}function Cq(e){return function(t){this.textContent=e.call(this,t)}}function jq(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cq(i)),t}return r._value=e,r}function Rq(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,jq(e))}function Aq(){for(var e=this._name,t=this._id,n=CA(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],c=a.length,u,f=0;f<c;++f)if(u=a[f]){var h=Bn(u,t);xf(u,e,n,f,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Rr(r,this._parents,e,n)}function Tq(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var c={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var f=fr(this,r),h=f.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),f.on=t}),i===0&&o()})}var Mq=0;function Rr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function CA(){return++Mq}var _r=hl.prototype;Rr.prototype={constructor:Rr,select:dq,selectAll:hq,selectChild:_r.selectChild,selectChildren:_r.selectChildren,filter:sq,merge:oq,selection:mq,transition:Aq,call:_r.call,nodes:_r.nodes,node:_r.node,size:_r.size,empty:_r.empty,each:_r.each,on:cq,attr:V5,attrTween:G5,style:wq,styleTween:Sq,text:Nq,textTween:Rq,remove:fq,tween:L5,delay:Q5,duration:eq,ease:nq,easeVarying:iq,end:Tq,[Symbol.iterator]:_r[Symbol.iterator]};function Iq(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Oq={time:null,delay:0,duration:250,ease:Iq};function Pq(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 Lq(e){var t,n;e instanceof Rr?(t=e._id,e=e._name):(t=CA(),(n=Oq).time=lw(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],c=a.length,u,f=0;f<c;++f)(u=a[f])&&xf(u,e,t,f,a,n||Pq(u,t));return new Rr(r,this._parents,e,t)}hl.prototype.interrupt=I5;hl.prototype.transition=Lq;const su=e=>()=>e;function Dq(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Er(e,t,n){this.k=e,this.x=t,this.y=n}Er.prototype={constructor:Er,scale:function(e){return e===1?this:new Er(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Er(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 wf=new Er(1,0,0);jA.prototype=Er.prototype;function jA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wf;return e.__zoom}function pp(e){e.stopImmediatePropagation()}function _a(e){e.preventDefault(),e.stopImmediatePropagation()}function qq(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $q(){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 PS(){return this.__zoom||wf}function Fq(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Bq(){return navigator.maxTouchPoints||"ontouchstart"in this}function zq(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function RA(){var e=qq,t=$q,n=zq,r=Fq,i=Bq,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Ru,f=gf("start","zoom","end"),h,p,g,v=500,b=150,x=0,w=10;function S(D){D.property("__zoom",PS).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",I).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(D,V,z,Q){var F=D.selection?D.selection():D;F.property("__zoom",PS),D!==F?R(D,V,z,Q):F.interrupt().each(function(){T(this,arguments).event(Q).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},S.scaleBy=function(D,V,z,Q){S.scaleTo(D,function(){var F=this.__zoom.k,$=typeof V=="function"?V.apply(this,arguments):V;return F*$},z,Q)},S.scaleTo=function(D,V,z,Q){S.transform(D,function(){var F=t.apply(this,arguments),$=this.__zoom,Y=z==null?E(F):typeof z=="function"?z.apply(this,arguments):z,P=$.invert(Y),W=typeof V=="function"?V.apply(this,arguments):V;return n(k(N($,W),Y,P),F,a)},z,Q)},S.translateBy=function(D,V,z,Q){S.transform(D,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),a)},null,Q)},S.translateTo=function(D,V,z,Q,F){S.transform(D,function(){var $=t.apply(this,arguments),Y=this.__zoom,P=Q==null?E($):typeof Q=="function"?Q.apply(this,arguments):Q;return n(wf.translate(P[0],P[1]).scale(Y.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof z=="function"?-z.apply(this,arguments):-z),$,a)},Q,F)};function N(D,V){return V=Math.max(o[0],Math.min(o[1],V)),V===D.k?D:new Er(V,D.x,D.y)}function k(D,V,z){var Q=V[0]-z[0]*D.k,F=V[1]-z[1]*D.k;return Q===D.x&&F===D.y?D:new Er(D.k,Q,F)}function E(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function R(D,V,z,Q){D.on("start.zoom",function(){T(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(Q).end()}).tween("zoom",function(){var F=this,$=arguments,Y=T(F,$).event(Q),P=t.apply(F,$),W=z==null?E(P):typeof z=="function"?z.apply(F,$):z,se=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),K=F.__zoom,J=typeof V=="function"?V.apply(F,$):V,G=u(K.invert(W).concat(se/K.k),J.invert(W).concat(se/J.k));return function(ee){if(ee===1)ee=J;else{var te=G(ee),oe=se/te[2];ee=new Er(oe,W[0]-te[0]*oe,W[1]-te[1]*oe)}Y.zoom(null,ee)}})}function T(D,V,z){return!z&&D.__zooming||new A(D,V)}function A(D,V){this.that=D,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,V),this.taps=0}A.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,V){return this.mouse&&D!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var V=on(this.that).datum();f.call(D,this.that,new Dq(D,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),V)}};function O(D,...V){if(!e.apply(this,arguments))return;var z=T(this,V).event(D),Q=this.__zoom,F=Math.max(o[0],Math.min(o[1],Q.k*Math.pow(2,r.apply(this,arguments)))),$=In(D);if(z.wheel)(z.mouse[0][0]!==$[0]||z.mouse[0][1]!==$[1])&&(z.mouse[1]=Q.invert(z.mouse[0]=$)),clearTimeout(z.wheel);else{if(Q.k===F)return;z.mouse=[$,Q.invert($)],Mu(this),z.start()}_a(D),z.wheel=setTimeout(Y,b),z.zoom("mouse",n(k(N(Q,F),z.mouse[0],z.mouse[1]),z.extent,a));function Y(){z.wheel=null,z.end()}}function L(D,...V){if(g||!e.apply(this,arguments))return;var z=D.currentTarget,Q=T(this,V,!0).event(D),F=on(D.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",se,!0),$=In(D,z),Y=D.clientX,P=D.clientY;dA(D.view),pp(D),Q.mouse=[$,this.__zoom.invert($)],Mu(this),Q.start();function W(K){if(_a(K),!Q.moved){var J=K.clientX-Y,G=K.clientY-P;Q.moved=J*J+G*G>x}Q.event(K).zoom("mouse",n(k(Q.that.__zoom,Q.mouse[0]=In(K,z),Q.mouse[1]),Q.extent,a))}function se(K){F.on("mousemove.zoom mouseup.zoom",null),hA(K.view,Q.moved),_a(K),Q.event(K).end()}}function B(D,...V){if(e.apply(this,arguments)){var z=this.__zoom,Q=In(D.changedTouches?D.changedTouches[0]:D,this),F=z.invert(Q),$=z.k*(D.shiftKey?.5:2),Y=n(k(N(z,$),Q,F),t.apply(this,V),a);_a(D),c>0?on(this).transition().duration(c).call(R,Y,Q,D):on(this).call(S.transform,Y,Q,D)}}function I(D,...V){if(e.apply(this,arguments)){var z=D.touches,Q=z.length,F=T(this,V,D.changedTouches.length===Q).event(D),$,Y,P,W;for(pp(D),Y=0;Y<Q;++Y)P=z[Y],W=In(P,this),W=[W,this.__zoom.invert(W),P.identifier],F.touch0?!F.touch1&&F.touch0[2]!==W[2]&&(F.touch1=W,F.taps=0):(F.touch0=W,$=!0,F.taps=1+!!h);h&&(h=clearTimeout(h)),$&&(F.taps<2&&(p=W[0],h=setTimeout(function(){h=null},v)),Mu(this),F.start())}}function q(D,...V){if(this.__zooming){var z=T(this,V).event(D),Q=D.changedTouches,F=Q.length,$,Y,P,W;for(_a(D),$=0;$<F;++$)Y=Q[$],P=In(Y,this),z.touch0&&z.touch0[2]===Y.identifier?z.touch0[0]=P:z.touch1&&z.touch1[2]===Y.identifier&&(z.touch1[0]=P);if(Y=z.that.__zoom,z.touch1){var se=z.touch0[0],K=z.touch0[1],J=z.touch1[0],G=z.touch1[1],ee=(ee=J[0]-se[0])*ee+(ee=J[1]-se[1])*ee,te=(te=G[0]-K[0])*te+(te=G[1]-K[1])*te;Y=N(Y,Math.sqrt(ee/te)),P=[(se[0]+J[0])/2,(se[1]+J[1])/2],W=[(K[0]+G[0])/2,(K[1]+G[1])/2]}else if(z.touch0)P=z.touch0[0],W=z.touch0[1];else return;z.zoom("touch",n(k(Y,P,W),z.extent,a))}}function U(D,...V){if(this.__zooming){var z=T(this,V).event(D),Q=D.changedTouches,F=Q.length,$,Y;for(pp(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),$=0;$<F;++$)Y=Q[$],z.touch0&&z.touch0[2]===Y.identifier?delete z.touch0:z.touch1&&z.touch1[2]===Y.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(Y=In(Y,this),Math.hypot(p[0]-Y[0],p[1]-Y[1])<w)){var P=on(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return S.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:su(+D),S):r},S.filter=function(D){return arguments.length?(e=typeof D=="function"?D:su(!!D),S):e},S.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:su(!!D),S):i},S.extent=function(D){return arguments.length?(t=typeof D=="function"?D:su([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),S):t},S.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],S):[o[0],o[1]]},S.translateExtent=function(D){return arguments.length?(a[0][0]=+D[0][0],a[1][0]=+D[1][0],a[0][1]=+D[0][1],a[1][1]=+D[1][1],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function(D){return arguments.length?(n=D,S):n},S.duration=function(D){return arguments.length?(c=+D,S):c},S.interpolate=function(D){return arguments.length?(u=D,S):u},S.on=function(){var D=f.on.apply(f,arguments);return D===f?S:D},S.clickDistance=function(D){return arguments.length?(x=(D=+D)*D,S):Math.sqrt(x)},S.tapDistance=function(D){return arguments.length?(w=+D,S):w},S}const sr={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."},Ya=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],AA=["Enter"," ","Escape"],TA={"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 so;(function(e){e.Strict="strict",e.Loose="loose"})(so||(so={}));var Vi;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Vi||(Vi={}));var Xa;(function(e){e.Partial="partial",e.Full="full"})(Xa||(Xa={}));const MA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ui;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ui||(ui={}));var Xu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Xu||(Xu={}));var ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ke||(ke={}));const LS={[ke.Left]:ke.Right,[ke.Right]:ke.Left,[ke.Top]:ke.Bottom,[ke.Bottom]:ke.Top};function IA(e){return e===null?null:e?"valid":"invalid"}const OA=e=>"id"in e&&"source"in e&&"target"in e,Vq=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),fw=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ml=(e,t=[0,0])=>{const{width:n,height:r}=Mr(e),i=e.origin??t,o=n*i[0],a=r*i[1];return{x:e.position.x-o,y:e.position.y-a}},Uq=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let a=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(a=o?t.nodeLookup.get(i):fw(i)?i:t.nodeLookup.get(i.id));const c=a?Qu(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bf(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _f(n)},gl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=bf(n,Qu(i)),r=!0)}),r?_f(n):{x:0,y:0,width:0,height:0}},dw=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1)=>{const c={...vl(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const f of e.values()){const{measured:h,selectable:p=!0,hidden:g=!1}=f;if(a&&!p||g)continue;const v=h.width??f.width??f.initialWidth??null,b=h.height??f.height??f.initialHeight??null,x=Qa(c,ao(f)),w=(v??0)*(b??0),S=o&&x>0;(!f.internals.handleBounds||S||x>=w||f.dragging)&&u.push(f)}return u},Hq=(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 Wq(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Kq({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},a){if(e.size===0)return Promise.resolve(!0);const c=Wq(e,a),u=gl(c),f=hw(u,t,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??o,(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 PA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:u,y:f}=c?c.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let p=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!c)o==null||o("005",sr.error005());else{const v=c.measured.width,b=c.measured.height;v&&b&&(p=[[u,f],[u+v,f+b]])}else c&&lo(a.extent)&&(p=[[a.extent[0][0]+u,a.extent[0][1]+f],[a.extent[1][0]+u,a.extent[1][1]+f]]);const g=lo(p)?Wi(t,p,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(o==null||o("015",sr.error015())),{position:{x:g.x-u+(a.measured.width??0)*h[0],y:g.y-f+(a.measured.height??0)*h[1]},positionAbsolute:g}}async function Gq({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const v=o.has(g.id),b=!v&&g.parentId&&a.find(x=>x.id===g.parentId);(v||b)&&a.push(g)}const c=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),h=Hq(a,u);for(const g of u)c.has(g.id)&&!h.find(b=>b.id===g.id)&&h.push(g);if(!i)return{edges:h,nodes:a};const p=await i({nodes:a,edges:h});return typeof p=="boolean"?p?{edges:h,nodes:a}:{edges:[],nodes:[]}:p}const oo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Wi=(e={x:0,y:0},t,n)=>({x:oo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:oo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function LA(e,t,n){const{width:r,height:i}=Mr(n),{x:o,y:a}=n.internals.positionAbsolute;return Wi(e,[[o,a],[o+r,a+i]],t)}const DS=(e,t,n)=>e<t?oo(Math.abs(e-t),1,t)/t:e>n?-oo(Math.abs(e-n),1,t)/t:0,DA=(e,t,n=15,r=40)=>{const i=DS(e.x,r,t.width-r)*n,o=DS(e.y,r,t.height-r)*n;return[i,o]},bf=(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)}),Sx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),_f=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ao=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=fw(e)?e.internals.positionAbsolute:ml(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Qu=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=fw(e)?e.internals.positionAbsolute:ml(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},qA=(e,t)=>_f(bf(Sx(e),Sx(t))),Qa=(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)},qS=e=>Ln(e.width)&&Ln(e.height)&&Ln(e.x)&&Ln(e.y),Ln=e=>!isNaN(e)&&isFinite(e),Yq=(e,t)=>{},yl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),vl=({x:e,y:t},[n,r,i],o=!1,a=[1,1])=>{const c={x:(e-n)/i,y:(t-r)/i};return o?yl(c,a):c},Ju=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Ls(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 Xq(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ls(e,n),i=Ls(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Ls(e.top??e.y??0,n),i=Ls(e.bottom??e.y??0,n),o=Ls(e.left??e.x??0,t),a=Ls(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:o,x:o+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Qq(e,t,n,r,i,o){const{x:a,y:c}=Ju(e,[t,n,r]),{x:u,y:f}=Ju({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=i-u,p=o-f;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(h),bottom:Math.floor(p)}}const hw=(e,t,n,r,i,o)=>{const a=Xq(o,t,n),c=(t-a.x)/e.width,u=(n-a.y)/e.height,f=Math.min(c,u),h=oo(f,r,i),p=e.x+e.width/2,g=e.y+e.height/2,v=t/2-p*h,b=n/2-g*h,x=Qq(e,v,b,h,t,n),w={left:Math.min(x.left-a.left,0),top:Math.min(x.top-a.top,0),right:Math.min(x.right-a.right,0),bottom:Math.min(x.bottom-a.bottom,0)};return{x:v-w.left+w.right,y:b-w.top+w.bottom,zoom:h}},Ja=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function lo(e){return e!=null&&e!=="parent"}function Mr(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 $A(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 FA(e,t={width:0,height:0},n,r,i){const o={...e},a=r.get(n);if(a){const c=a.origin||i;o.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],o.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return o}function $S(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Jq(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Zq(e){return{...TA,...e||{}}}function $a(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:a}=Dn(e),c=vl({x:o-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},r),{x:u,y:f}=n?yl(c,t):c;return{xSnapped:u,ySnapped:f,...c}}const pw=e=>({width:e.offsetWidth,height:e.offsetHeight}),BA=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},e$=["INPUT","SELECT","TEXTAREA"];function zA(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:e$.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const VA=e=>"clientX"in e,Dn=(e,t)=>{var o,a;const n=VA(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},FS=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...pw(a)}})};function UA({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:c}){const u=e*.125+i*.375+a*.375+n*.125,f=t*.125+o*.375+c*.375+r*.125,h=Math.abs(u-e),p=Math.abs(f-t);return[u,f,h,p]}function ou(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function BS({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case ke.Left:return[t-ou(t-r,o),n];case ke.Right:return[t+ou(r-t,o),n];case ke.Top:return[t,n-ou(n-i,o)];case ke.Bottom:return[t,n+ou(i-n,o)]}}function HA({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:r,targetY:i,targetPosition:o=ke.Top,curvature:a=.25}){const[c,u]=BS({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[f,h]=BS({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[p,g,v,b]=UA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:u,targetControlX:f,targetControlY:h});return[`M${e},${t} C${c},${u} ${f},${h} ${r},${i}`,p,g,v,b]}function WA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[o,c,i,a]}function t$({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const a=i&&n?r+1e3:r,c=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+c}function n$({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=bf(Qu(e),Qu(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Qa(a,_f(o))>0}const r$=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,i$=(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)),KA=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||r$;let i;return OA(e)?i={...e}:i={...e,id:r(e)},i$(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function GA({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,a,c]=WA({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,c]}const zS={[ke.Left]:{x:-1,y:0},[ke.Right]:{x:1,y:0},[ke.Top]:{x:0,y:-1},[ke.Bottom]:{x:0,y:1}},s$=({source:e,sourcePosition:t=ke.Bottom,target:n})=>t===ke.Left||t===ke.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},VS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function o$({source:e,sourcePosition:t=ke.Bottom,target:n,targetPosition:r=ke.Top,center:i,offset:o,stepPosition:a}){const c=zS[t],u=zS[r],f={x:e.x+c.x*o,y:e.y+c.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},p=s$({source:f,sourcePosition:t,target:h}),g=p.x!==0?"x":"y",v=p[g];let b=[],x,w;const S={x:0,y:0},N={x:0,y:0},[,,k,E]=WA({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*u[g]===-1){g==="x"?(x=i.x??f.x+(h.x-f.x)*a,w=i.y??(f.y+h.y)/2):(x=i.x??(f.x+h.x)/2,w=i.y??f.y+(h.y-f.y)*a);const T=[{x,y:f.y},{x,y:h.y}],A=[{x:f.x,y:w},{x:h.x,y:w}];c[g]===v?b=g==="x"?T:A:b=g==="x"?A:T}else{const T=[{x:f.x,y:h.y}],A=[{x:h.x,y:f.y}];if(g==="x"?b=c.x===v?A:T:b=c.y===v?T:A,t===r){const q=Math.abs(e[g]-n[g]);if(q<=o){const U=Math.min(o-1,o-q);c[g]===v?S[g]=(f[g]>e[g]?-1:1)*U:N[g]=(h[g]>n[g]?-1:1)*U}}if(t!==r){const q=g==="x"?"y":"x",U=c[g]===u[q],D=f[q]>h[q],V=f[q]<h[q];(c[g]===1&&(!U&&D||U&&V)||c[g]!==1&&(!U&&V||U&&D))&&(b=g==="x"?T:A)}const O={x:f.x+S.x,y:f.y+S.y},L={x:h.x+N.x,y:h.y+N.y},B=Math.max(Math.abs(O.x-b[0].x),Math.abs(L.x-b[0].x)),I=Math.max(Math.abs(O.y-b[0].y),Math.abs(L.y-b[0].y));B>=I?(x=(O.x+L.x)/2,w=b[0].y):(x=b[0].x,w=(O.y+L.y)/2)}return[[e,{x:f.x+S.x,y:f.y+S.y},...b,{x:h.x+N.x,y:h.y+N.y},n],x,w,k,E]}function a$(e,t,n,r){const i=Math.min(VS(e,t)/2,VS(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const f=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${o+i*f},${a}Q ${o},${a} ${o},${a+i*h}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${a+i*u}Q ${o},${a} ${o+i*c},${a}`}function kx({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:r,targetY:i,targetPosition:o=ke.Top,borderRadius:a=5,centerX:c,centerY:u,offset:f=20,stepPosition:h=.5}){const[p,g,v,b,x]=o$({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:c,y:u},offset:f,stepPosition:h});return[p.reduce((S,N,k)=>{let E="";return k>0&&k<p.length-1?E=a$(p[k-1],N,p[k+1],a):E=`${k===0?"M":"L"}${N.x} ${N.y}`,S+=E,S},""),g,v,b,x]}function US(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function l$(e){var p;const{sourceNode:t,targetNode:n}=e;if(!US(t)||!US(n))return null;const r=t.internals.handleBounds||HS(t.handles),i=n.internals.handleBounds||HS(n.handles),o=WS((r==null?void 0:r.source)??[],e.sourceHandle),a=WS(e.connectionMode===so.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!a)return(p=e.onError)==null||p.call(e,"008",sr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(o==null?void 0:o.position)||ke.Bottom,u=(a==null?void 0:a.position)||ke.Top,f=Ki(t,o,c),h=Ki(n,a,u);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:c,targetPosition:u}}function HS(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 Ki(e,t,n=ke.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??Mr(e);if(r)return{x:i+a/2,y:o+c/2};switch((t==null?void 0:t.position)??n){case ke.Top:return{x:i+a/2,y:o};case ke.Right:return{x:i+a,y:o+c/2};case ke.Bottom:return{x:i+a/2,y:o+c};case ke.Left:return{x:i,y:o+c/2}}}function WS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ex(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function c$(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const f=Ex(u,t);o.has(f)||(a.push({id:f,color:u.color||n,...u}),o.add(f))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const YA=1e3,u$=10,mw={nodeOrigin:[0,0],nodeExtent:Ya,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},f$={...mw,checkEquality:!0};function gw(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function d$(e,t,n){const r=gw(mw,n);for(const i of e.values())if(i.parentId)vw(i,e,t,r);else{const o=ml(i,r.nodeOrigin),a=lo(i.extent)?i.extent:r.nodeExtent,c=Wi(o,a,Mr(i));i.internals.positionAbsolute=c}}function h$(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const o={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(o):i.type==="target"&&r.push(o)}return{source:n,target:r}}function yw(e){return e==="manual"}function Nx(e,t,n,r={}){var f,h;const i=gw(f$,r),o={i:0},a=new Map(t),c=i!=null&&i.elevateNodesOnSelect&&!yw(i.zIndexMode)?YA:0;let u=e.length>0;t.clear(),n.clear();for(const p of e){let g=a.get(p.id);if(i.checkEquality&&p===(g==null?void 0:g.internals.userNode))t.set(p.id,g);else{const v=ml(p,i.nodeOrigin),b=lo(p.extent)?p.extent:i.nodeExtent,x=Wi(v,b,Mr(p));g={...i.defaults,...p,measured:{width:(f=p.measured)==null?void 0:f.width,height:(h=p.measured)==null?void 0:h.height},internals:{positionAbsolute:x,handleBounds:h$(p,g),z:XA(p,c,i.zIndexMode),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),p.parentId&&vw(g,t,n,r,o)}return u}function p$(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 vw(e,t,n,r,i){const{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:c,zIndexMode:u}=gw(mw,r),f=e.parentId,h=t.get(f);if(!h){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}p$(e,n),i&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++i.i,h.internals.z=h.internals.z+i.i*u$),i&&h.internals.rootParentIndex!==void 0&&(i.i=h.internals.rootParentIndex);const p=o&&!yw(u)?YA:0,{x:g,y:v,z:b}=m$(e,h,a,c,p,u),{positionAbsolute:x}=e.internals,w=g!==x.x||v!==x.y;(w||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:g,y:v}:x,z:b}})}function XA(e,t,n){const r=Ln(e.zIndex)?e.zIndex:0;return yw(n)?r:r+(e.selected?t:0)}function m$(e,t,n,r,i,o){const{x:a,y:c}=t.internals.positionAbsolute,u=Mr(e),f=ml(e,n),h=lo(e.extent)?Wi(f,e.extent,u):f;let p=Wi({x:a+h.x,y:c+h.y},r,u);e.extent==="parent"&&(p=LA(p,u,t));const g=XA(e,i,o),v=t.internals.z??0;return{x:p.x,y:p.y,z:v>=g?v+1:g}}function xw(e,t,n,r=[0,0]){var a;const i=[],o=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const f=((a=o.get(c.parentId))==null?void 0:a.expandedRect)??ao(u),h=qA(f,c.rect);o.set(c.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:c,parent:u},f)=>{var k;const h=u.internals.positionAbsolute,p=Mr(u),g=u.origin??r,v=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,b=c.y<h.y?Math.round(Math.abs(h.y-c.y)):0,x=Math.max(p.width,Math.round(c.width)),w=Math.max(p.height,Math.round(c.height)),S=(x-p.width)*g[0],N=(w-p.height)*g[1];(v>0||b>0||S||N)&&(i.push({id:f,type:"position",position:{x:u.position.x-v+S,y:u.position.y-b+N}}),(k=n.get(f))==null||k.forEach(E=>{e.some(R=>R.id===E.id)||i.push({id:E.id,type:"position",position:{x:E.position.x+v,y:E.position.y+b}})})),(p.width<c.width||p.height<c.height||v||b)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:x+(v?g[0]*v-S:0),height:w+(b?g[1]*b-N:0)}})}),i}function g$(e,t,n,r,i,o,a){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const f=[],h=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(h.transform),g=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const x=pw(v.nodeElement),w=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(w||!b.internals.handleBounds||v.force))){const N=v.nodeElement.getBoundingClientRect(),k=lo(b.extent)?b.extent:o;let{positionAbsolute:E}=b.internals;b.parentId&&b.extent==="parent"?E=LA(E,x,t.get(b.parentId)):k&&(E=Wi(E,k,x));const R={...b,measured:x,internals:{...b.internals,positionAbsolute:E,handleBounds:{source:FS("source",v.nodeElement,N,p,b.id),target:FS("target",v.nodeElement,N,p,b.id)}}};t.set(b.id,R),b.parentId&&vw(R,t,n,{nodeOrigin:i,zIndexMode:a}),u=!0,w&&(f.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:ao(R,i)}))}}if(g.length>0){const v=xw(g,t,n,i);f.push(...v)}return{changes:f,updatedInternals:u}}async function y$({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),c=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(c)}function KS(e,t,n,r,i,o){let a=i;const c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${i}-${e}`;const u=r.get(a)||new Map;if(r.set(a,u.set(n,t)),o){a=`${i}-${e}-${o}`;const f=r.get(a)||new Map;r.set(a,f.set(n,t))}}function QA(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:a=null,targetHandle:c=null}=r,u={edgeId:r.id,source:i,target:o,sourceHandle:a,targetHandle:c},f=`${i}-${a}--${o}-${c}`,h=`${o}-${c}--${i}-${a}`;KS("source",u,h,e,i,a),KS("target",u,f,e,o,c),t.set(r.id,r)}}function JA(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:JA(n,t):!1}function GS(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function v$(e,t,n,r){const i=new Map;for(const[o,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!JA(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(o);c&&i.set(o,{id:o,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return i}function mp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,c,u;const i=[];for(const[f,h]of t){const p=(a=n.get(f))==null?void 0:a.internals.userNode;p&&i.push({...p,position:h.position,dragging:r})}if(!e)return[i[0],i];const o=(c=n.get(e))==null?void 0:c.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:i[0],i]}function x$({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const o={x:n-i.distance.x,y:r-i.distance.y},a=yl(o,t);return{x:a.x-o.x,y:a.y-o.y}}function w$({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},a=0,c=new Map,u=!1,f={x:0,y:0},h=null,p=!1,g=null,v=!1,b=!1,x=null;function w({noDragClassName:N,handleSelector:k,domNode:E,isSelectable:R,nodeId:T,nodeClickDistance:A=0}){g=on(E);function O({x:q,y:U}){const{nodeLookup:D,nodeExtent:V,snapGrid:z,snapToGrid:Q,nodeOrigin:F,onNodeDrag:$,onSelectionDrag:Y,onError:P,updateNodePositions:W}=t();o={x:q,y:U};let se=!1;const K=c.size>1,J=K&&V?Sx(gl(c)):null,G=K&&Q?x$({dragItems:c,snapGrid:z,x:q,y:U}):null;for(const[ee,te]of c){if(!D.has(ee))continue;let oe={x:q-te.distance.x,y:U-te.distance.y};Q&&(oe=G?{x:Math.round(oe.x+G.x),y:Math.round(oe.y+G.y)}:yl(oe,z));let fe=null;if(K&&V&&!te.extent&&J){const{positionAbsolute:de}=te.internals,_e=de.x-J.x+V[0][0],ve=de.x+te.measured.width-J.x2+V[1][0],Ne=de.y-J.y+V[0][1],Ee=de.y+te.measured.height-J.y2+V[1][1];fe=[[_e,Ne],[ve,Ee]]}const{position:he,positionAbsolute:me}=PA({nodeId:ee,nextPosition:oe,nodeLookup:D,nodeExtent:fe||V,nodeOrigin:F,onError:P});se=se||te.position.x!==he.x||te.position.y!==he.y,te.position=he,te.internals.positionAbsolute=me}if(b=b||se,!!se&&(W(c,!0),x&&(r||$||!T&&Y))){const[ee,te]=mp({nodeId:T,dragItems:c,nodeLookup:D});r==null||r(x,c,ee,te),$==null||$(x,ee,te),T||Y==null||Y(x,te)}}async function L(){if(!h)return;const{transform:q,panBy:U,autoPanSpeed:D,autoPanOnNodeDrag:V}=t();if(!V){u=!1,cancelAnimationFrame(a);return}const[z,Q]=DA(f,h,D);(z!==0||Q!==0)&&(o.x=(o.x??0)-z/q[2],o.y=(o.y??0)-Q/q[2],await U({x:z,y:Q})&&O(o)),a=requestAnimationFrame(L)}function B(q){var K;const{nodeLookup:U,multiSelectionActive:D,nodesDraggable:V,transform:z,snapGrid:Q,snapToGrid:F,selectNodesOnDrag:$,onNodeDragStart:Y,onSelectionDragStart:P,unselectNodesAndEdges:W}=t();p=!0,(!$||!R)&&!D&&T&&((K=U.get(T))!=null&&K.selected||W()),R&&$&&T&&(e==null||e(T));const se=$a(q.sourceEvent,{transform:z,snapGrid:Q,snapToGrid:F,containerBounds:h});if(o=se,c=v$(U,V,se,T),c.size>0&&(n||Y||!T&&P)){const[J,G]=mp({nodeId:T,dragItems:c,nodeLookup:U});n==null||n(q.sourceEvent,c,J,G),Y==null||Y(q.sourceEvent,J,G),T||P==null||P(q.sourceEvent,G)}}const I=pA().clickDistance(A).on("start",q=>{const{domNode:U,nodeDragThreshold:D,transform:V,snapGrid:z,snapToGrid:Q}=t();h=(U==null?void 0:U.getBoundingClientRect())||null,v=!1,b=!1,x=q.sourceEvent,D===0&&B(q),o=$a(q.sourceEvent,{transform:V,snapGrid:z,snapToGrid:Q,containerBounds:h}),f=Dn(q.sourceEvent,h)}).on("drag",q=>{const{autoPanOnNodeDrag:U,transform:D,snapGrid:V,snapToGrid:z,nodeDragThreshold:Q,nodeLookup:F}=t(),$=$a(q.sourceEvent,{transform:D,snapGrid:V,snapToGrid:z,containerBounds:h});if(x=q.sourceEvent,(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1||T&&!F.has(T))&&(v=!0),!v){if(!u&&U&&p&&(u=!0,L()),!p){const Y=Dn(q.sourceEvent,h),P=Y.x-f.x,W=Y.y-f.y;Math.sqrt(P*P+W*W)>Q&&B(q)}(o.x!==$.xSnapped||o.y!==$.ySnapped)&&c&&p&&(f=Dn(q.sourceEvent,h),O($))}}).on("end",q=>{if(!(!p||v)&&(u=!1,p=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:U,updateNodePositions:D,onNodeDragStop:V,onSelectionDragStop:z}=t();if(b&&(D(c,!1),b=!1),i||V||!T&&z){const[Q,F]=mp({nodeId:T,dragItems:c,nodeLookup:U,dragging:!1});i==null||i(q.sourceEvent,c,Q,F),V==null||V(q.sourceEvent,Q,F),T||z==null||z(q.sourceEvent,F)}}}).filter(q=>{const U=q.target;return!q.button&&(!N||!GS(U,`.${N}`,E))&&(!k||GS(U,k,E))});g.call(I)}function S(){g==null||g.on(".drag",null)}return{update:w,destroy:S}}function b$(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Qa(i,ao(o))>0&&r.push(o);return r}const _$=250;function S$(e,t,n,r){var c,u;let i=[],o=1/0;const a=b$(e,n,t+_$);for(const f of a){const h=[...((c=f.internals.handleBounds)==null?void 0:c.source)??[],...((u=f.internals.handleBounds)==null?void 0:u.target)??[]];for(const p of h){if(r.nodeId===p.nodeId&&r.type===p.type&&r.id===p.id)continue;const{x:g,y:v}=Ki(f,p,p.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<o?(i=[{...p,x:g,y:v}],o=b):b===o&&i.push({...p,x:g,y:v}))}}if(!i.length)return null;if(i.length>1){const f=r.type==="source"?"target":"source";return i.find(h=>h.type===f)??i[0]}return i[0]}function ZA(e,t,n,r,i,o=!1){var f,h,p;const a=r.get(e);if(!a)return null;const c=i==="strict"?(f=a.internals.handleBounds)==null?void 0:f[t]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((p=a.internals.handleBounds)==null?void 0:p.target)??[]],u=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return u&&o?{...u,...Ki(a,u,u.position,!0)}:u}function eT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function k$(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const tT=()=>!0;function E$(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:a,domNode:c,nodeLookup:u,lib:f,autoPanOnConnect:h,flowId:p,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:x,onConnectEnd:w,isValidConnection:S=tT,onReconnectEnd:N,updateConnection:k,getTransform:E,getFromHandle:R,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:O}){const L=BA(e.target);let B=0,I;const{x:q,y:U}=Dn(e),D=eT(o,O),V=c==null?void 0:c.getBoundingClientRect();let z=!1;if(!V||!D)return;const Q=ZA(i,D,r,u,t);if(!Q)return;let F=Dn(e,V),$=!1,Y=null,P=!1,W=null;function se(){if(!h||!V)return;const[he,me]=DA(F,V,T);g({x:he,y:me}),B=requestAnimationFrame(se)}const K={...Q,nodeId:i,type:D,position:Q.position},J=u.get(i);let ee={inProgress:!0,isValid:null,from:Ki(J,K,ke.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:J,to:F,toHandle:null,toPosition:LS[K.position],toNode:null,pointer:F};function te(){z=!0,k(ee),b==null||b(e,{nodeId:i,handleId:r,handleType:D})}A===0&&te();function oe(he){if(!z){const{x:Ee,y:et}=Dn(he),Le=Ee-q,gt=et-U;if(!(Le*Le+gt*gt>A*A))return;te()}if(!R()||!K){fe(he);return}const me=E();F=Dn(he,V),I=S$(vl(F,me,!1,[1,1]),n,u,K),$||(se(),$=!0);const de=nT(he,{handle:I,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:S,doc:L,lib:f,flowId:p,nodeLookup:u});W=de.handleDomNode,Y=de.connection,P=k$(!!I,de.isValid);const _e=u.get(i),ve=_e?Ki(_e,K,ke.Left,!0):ee.from,Ne={...ee,from:ve,isValid:P,to:de.toHandle&&P?Ju({x:de.toHandle.x,y:de.toHandle.y},me):F,toHandle:de.toHandle,toPosition:P&&de.toHandle?de.toHandle.position:LS[K.position],toNode:de.toHandle?u.get(de.toHandle.nodeId):null,pointer:F};k(Ne),ee=Ne}function fe(he){if(!("touches"in he&&he.touches.length>0)){if(z){(I||W)&&Y&&P&&(x==null||x(Y));const{inProgress:me,...de}=ee,_e={...de,toPosition:ee.toHandle?ee.toPosition:null};w==null||w(he,_e),o&&(N==null||N(he,_e))}v(),cancelAnimationFrame(B),$=!1,P=!1,Y=null,W=null,L.removeEventListener("mousemove",oe),L.removeEventListener("mouseup",fe),L.removeEventListener("touchmove",oe),L.removeEventListener("touchend",fe)}}L.addEventListener("mousemove",oe),L.addEventListener("mouseup",fe),L.addEventListener("touchmove",oe),L.addEventListener("touchend",fe)}function nT(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:a,lib:c,flowId:u,isValidConnection:f=tT,nodeLookup:h}){const p=o==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Dn(e),x=a.elementFromPoint(v,b),w=x!=null&&x.classList.contains(`${c}-flow__handle`)?x:g,S={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const N=eT(void 0,w),k=w.getAttribute("data-nodeid"),E=w.getAttribute("data-handleid"),R=w.classList.contains("connectable"),T=w.classList.contains("connectableend");if(!k||!N)return S;const A={source:p?k:r,sourceHandle:p?E:i,target:p?r:k,targetHandle:p?i:E};S.connection=A;const L=R&&T&&(n===so.Strict?p&&N==="source"||!p&&N==="target":k!==r||E!==i);S.isValid=L&&f(A),S.toHandle=ZA(k,N,E,h,n,!0)}return S}const Cx={onPointerDown:E$,isValid:nT};function N$({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=on(e);function o({translateExtent:c,width:u,height:f,zoomStep:h=1,pannable:p=!0,zoomable:g=!0,inversePan:v=!1}){const b=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const E=n(),R=k.sourceEvent.ctrlKey&&Ja()?10:1,T=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*h,A=E[2]*Math.pow(2,T*R);t.scaleTo(A)};let x=[0,0];const w=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(x=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},S=k=>{const E=n();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!t)return;const R=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],T=[R[0]-x[0],R[1]-x[1]];x=R;const A=r()*Math.max(E[2],Math.log(E[2]))*(v?-1:1),O={x:E[0]-T[0]*A,y:E[1]-T[1]*A},L=[[0,0],[u,f]];t.setViewportConstrained({x:O.x,y:O.y,zoom:E[2]},L,c)},N=RA().on("start",w).on("zoom",p?S:null).on("zoom.wheel",g?b:null);i.call(N,{})}function a(){i.on("zoom",null)}return{update:o,destroy:a,pointer:In}}const Sf=e=>({x:e.x,y:e.y,zoom:e.k}),gp=({x:e,y:t,zoom:n})=>wf.translate(e,t).scale(n),Us=(e,t)=>e.target.closest(`.${t}`),rT=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),C$=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,yp=(e,t=0,n=C$,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},iT=e=>{const t=e.ctrlKey&&Ja()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function j$({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:f}){return h=>{if(Us(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(h.ctrlKey&&a){const w=In(h),S=iT(h),N=p*Math.pow(2,S);r.scaleTo(n,N,w,h);return}const g=h.deltaMode===1?20:1;let v=i===Vi.Vertical?0:h.deltaX*g,b=i===Vi.Horizontal?0:h.deltaY*g;!Ja()&&h.shiftKey&&i!==Vi.Vertical&&(v=h.deltaY*g,b=0),r.translateBy(n,-(v/p)*o,-(b/p)*o,{internal:!0});const x=Sf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,x),e.panScrollTimeout=setTimeout(()=>{f==null||f(h,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(h,x))}}function R$({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const o=r.type==="wheel",a=!t&&o&&!r.ctrlKey,c=Us(r,e);if(r.ctrlKey&&o&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,i)}}function A$({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,a,c;if((o=r.sourceEvent)!=null&&o.internal)return;const i=Sf(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function T$({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var a,c;e.usedRightMouseButton=!!(n&&rT(t,e.mouseButton??0)),(a=o.sourceEvent)!=null&&a.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((c=o.sourceEvent)!=null&&c.internal)&&(i==null||i(o.sourceEvent,Sf(o.transform)))}}function M$({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,o&&rT(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const u=Sf(a.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,u)},n?150:0)}}}function I$({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:c,noPanClassName:u,lib:f,connectionInProgress:h}){return p=>{var w;const g=e||t,v=n&&p.ctrlKey,b=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Us(p,`${f}-flow__node`)||Us(p,`${f}-flow__edge`)))return!0;if(!r&&!g&&!i&&!o&&!n||a||h&&!b||Us(p,c)&&b||Us(p,u)&&(!b||i&&b&&!e)||!n&&p.ctrlKey&&b)return!1;if(!n&&p.type==="touchstart"&&((w=p.touches)==null?void 0:w.length)>1)return p.preventDefault(),!1;if(!g&&!i&&!v&&b||!r&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(r)&&!r.includes(p.button)&&p.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||b)&&x}}function O$({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),p=RA().scaleExtent([t,n]).translateExtent(r),g=on(e).call(p);N({x:i.x,y:i.y,zoom:oo(i.zoom,t,n)},[[0,0],[h.width,h.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");p.wheelDelta(iT);function x(I,q){return g?new Promise(U=>{p==null||p.interpolate((q==null?void 0:q.interpolate)==="linear"?qa:Ru).transform(yp(g,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>U(!0)),I)}):Promise.resolve(!1)}function w({noWheelClassName:I,noPanClassName:q,onPaneContextMenu:U,userSelectionActive:D,panOnScroll:V,panOnDrag:z,panOnScrollMode:Q,panOnScrollSpeed:F,preventScrolling:$,zoomOnPinch:Y,zoomOnScroll:P,zoomOnDoubleClick:W,zoomActivationKeyPressed:se,lib:K,onTransformChange:J,connectionInProgress:G,paneClickDistance:ee,selectionOnDrag:te}){D&&!f.isZoomingOrPanning&&S();const oe=V&&!se&&!D;p.clickDistance(te?1/0:!Ln(ee)||ee<0?0:ee);const fe=oe?j$({zoomPanValues:f,noWheelClassName:I,d3Selection:g,d3Zoom:p,panOnScrollMode:Q,panOnScrollSpeed:F,zoomOnPinch:Y,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:c}):R$({noWheelClassName:I,preventScrolling:$,d3ZoomHandler:v});if(g.on("wheel.zoom",fe,{passive:!1}),!D){const me=A$({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:a});p.on("start",me);const de=T$({zoomPanValues:f,panOnDrag:z,onPaneContextMenu:!!U,onPanZoom:o,onTransformChange:J});p.on("zoom",de);const _e=M$({zoomPanValues:f,panOnDrag:z,panOnScroll:V,onPaneContextMenu:U,onPanZoomEnd:c,onDraggingChange:u});p.on("end",_e)}const he=I$({zoomActivationKeyPressed:se,panOnDrag:z,zoomOnScroll:P,panOnScroll:V,zoomOnDoubleClick:W,zoomOnPinch:Y,userSelectionActive:D,noPanClassName:q,noWheelClassName:I,lib:K,connectionInProgress:G});p.filter(he),W?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function S(){p.on("zoom",null)}async function N(I,q,U){const D=gp(I),V=p==null?void 0:p.constrain()(D,q,U);return V&&await x(V),new Promise(z=>z(V))}async function k(I,q){const U=gp(I);return await x(U,q),new Promise(D=>D(U))}function E(I){if(g){const q=gp(I),U=g.property("__zoom");(U.k!==I.zoom||U.x!==I.x||U.y!==I.y)&&(p==null||p.transform(g,q,null,{sync:!0}))}}function R(){const I=g?jA(g.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function T(I,q){return g?new Promise(U=>{p==null||p.interpolate((q==null?void 0:q.interpolate)==="linear"?qa:Ru).scaleTo(yp(g,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>U(!0)),I)}):Promise.resolve(!1)}function A(I,q){return g?new Promise(U=>{p==null||p.interpolate((q==null?void 0:q.interpolate)==="linear"?qa:Ru).scaleBy(yp(g,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>U(!0)),I)}):Promise.resolve(!1)}function O(I){p==null||p.scaleExtent(I)}function L(I){p==null||p.translateExtent(I)}function B(I){const q=!Ln(I)||I<0?0:I;p==null||p.clickDistance(q)}return{update:w,destroy:S,setViewport:k,setViewportConstrained:N,getViewport:R,scaleTo:T,scaleBy:A,setScaleExtent:O,setTranslateExtent:L,syncViewport:E,setClickDistance:B}}var co;(function(e){e.Line="line",e.Handle="handle"})(co||(co={}));function P$({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const a=e-t,c=n-r,u=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&i&&(u[0]=u[0]*-1),c&&o&&(u[1]=u[1]*-1),u}function YS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function ri(e,t){return Math.max(0,t-e)}function ii(e,t){return Math.max(0,e-t)}function au(e,t,n){return Math.max(0,t-e,e-n)}function XS(e,t){return e?!t:t}function L$(e,t,n,r,i,o,a,c){let{affectsX:u,affectsY:f}=t;const{isHorizontal:h,isVertical:p}=t,g=h&&p,{xSnapped:v,ySnapped:b}=n,{minWidth:x,maxWidth:w,minHeight:S,maxHeight:N}=r,{x:k,y:E,width:R,height:T,aspectRatio:A}=e;let O=Math.floor(h?v-e.pointerX:0),L=Math.floor(p?b-e.pointerY:0);const B=R+(u?-O:O),I=T+(f?-L:L),q=-o[0]*R,U=-o[1]*T;let D=au(B,x,w),V=au(I,S,N);if(a){let F=0,$=0;u&&O<0?F=ri(k+O+q,a[0][0]):!u&&O>0&&(F=ii(k+B+q,a[1][0])),f&&L<0?$=ri(E+L+U,a[0][1]):!f&&L>0&&($=ii(E+I+U,a[1][1])),D=Math.max(D,F),V=Math.max(V,$)}if(c){let F=0,$=0;u&&O>0?F=ii(k+O,c[0][0]):!u&&O<0&&(F=ri(k+B,c[1][0])),f&&L>0?$=ii(E+L,c[0][1]):!f&&L<0&&($=ri(E+I,c[1][1])),D=Math.max(D,F),V=Math.max(V,$)}if(i){if(h){const F=au(B/A,S,N)*A;if(D=Math.max(D,F),a){let $=0;!u&&!f||u&&!f&&g?$=ii(E+U+B/A,a[1][1])*A:$=ri(E+U+(u?O:-O)/A,a[0][1])*A,D=Math.max(D,$)}if(c){let $=0;!u&&!f||u&&!f&&g?$=ri(E+B/A,c[1][1])*A:$=ii(E+(u?O:-O)/A,c[0][1])*A,D=Math.max(D,$)}}if(p){const F=au(I*A,x,w)/A;if(V=Math.max(V,F),a){let $=0;!u&&!f||f&&!u&&g?$=ii(k+I*A+q,a[1][0])/A:$=ri(k+(f?L:-L)*A+q,a[0][0])/A,V=Math.max(V,$)}if(c){let $=0;!u&&!f||f&&!u&&g?$=ri(k+I*A,c[1][0])/A:$=ii(k+(f?L:-L)*A,c[0][0])/A,V=Math.max(V,$)}}}L=L+(L<0?V:-V),O=O+(O<0?D:-D),i&&(g?B>I*A?L=(XS(u,f)?-O:O)/A:O=(XS(u,f)?-L:L)*A:h?(L=O/A,f=u):(O=L*A,u=f));const z=u?k+O:k,Q=f?E+L:E;return{width:R+(u?-O:O),height:T+(f?-L:L),x:o[0]*O*(u?-1:1)+z,y:o[1]*L*(f?-1:1)+Q}}const sT={width:0,height:0,x:0,y:0},D$={...sT,pointerX:0,pointerY:0,aspectRatio:1};function q$(e){return[[0,0],[e.measured.width,e.measured.height]]}function $$(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,a=e.measured.height??0,c=n[0]*o,u=n[1]*a;return[[r-c,i-u],[r+o-c,i+a-u]]}function F$({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=on(e);let a={controlDirection:YS("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:h,keepAspectRatio:p,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:x,shouldResize:w}){let S={...sT},N={...D$};a={boundaries:h,resizeDirection:g,keepAspectRatio:p,controlDirection:YS(f)};let k,E=null,R=[],T,A,O,L=!1;const B=pA().on("start",I=>{const{nodeLookup:q,transform:U,snapGrid:D,snapToGrid:V,nodeOrigin:z,paneDomNode:Q}=n();if(k=q.get(t),!k)return;E=(Q==null?void 0:Q.getBoundingClientRect())??null;const{xSnapped:F,ySnapped:$}=$a(I.sourceEvent,{transform:U,snapGrid:D,snapToGrid:V,containerBounds:E});S={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},N={...S,pointerX:F,pointerY:$,aspectRatio:S.width/S.height},T=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(T=q.get(k.parentId),A=T&&k.extent==="parent"?q$(T):void 0),R=[],O=void 0;for(const[Y,P]of q)if(P.parentId===t&&(R.push({id:Y,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const W=$$(P,k,P.origin??z);O?O=[[Math.min(W[0][0],O[0][0]),Math.min(W[0][1],O[0][1])],[Math.max(W[1][0],O[1][0]),Math.max(W[1][1],O[1][1])]]:O=W}v==null||v(I,{...S})}).on("drag",I=>{const{transform:q,snapGrid:U,snapToGrid:D,nodeOrigin:V}=n(),z=$a(I.sourceEvent,{transform:q,snapGrid:U,snapToGrid:D,containerBounds:E}),Q=[];if(!k)return;const{x:F,y:$,width:Y,height:P}=S,W={},se=k.origin??V,{width:K,height:J,x:G,y:ee}=L$(N,a.controlDirection,z,a.boundaries,a.keepAspectRatio,se,A,O),te=K!==Y,oe=J!==P,fe=G!==F&&te,he=ee!==$&&oe;if(!fe&&!he&&!te&&!oe)return;if((fe||he||se[0]===1||se[1]===1)&&(W.x=fe?G:S.x,W.y=he?ee:S.y,S.x=W.x,S.y=W.y,R.length>0)){const ve=G-F,Ne=ee-$;for(const Ee of R)Ee.position={x:Ee.position.x-ve+se[0]*(K-Y),y:Ee.position.y-Ne+se[1]*(J-P)},Q.push(Ee)}if((te||oe)&&(W.width=te&&(!a.resizeDirection||a.resizeDirection==="horizontal")?K:S.width,W.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?J:S.height,S.width=W.width,S.height=W.height),T&&k.expandParent){const ve=se[0]*(W.width??0);W.x&&W.x<ve&&(S.x=ve,N.x=N.x-(W.x-ve));const Ne=se[1]*(W.height??0);W.y&&W.y<Ne&&(S.y=Ne,N.y=N.y-(W.y-Ne))}const me=P$({width:S.width,prevWidth:Y,height:S.height,prevHeight:P,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),de={...S,direction:me};(w==null?void 0:w(I,de))!==!1&&(L=!0,b==null||b(I,de),r(W,Q))}).on("end",I=>{L&&(x==null||x(I,{...S}),i==null||i({...S}),L=!1)});o.call(B)}function u(){o.on(".drag",null)}return{update:c,destroy:u}}var vp={exports:{}},xp={},wp={exports:{}},bp={};/**
41
- * @license React
42
- * use-sync-external-store-shim.production.js
43
- *
44
- * Copyright (c) Meta Platforms, Inc. and affiliates.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */var QS;function B$(){if(QS)return bp;QS=1;var e=dl();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(p,g){var v=g(),b=r({inst:{value:v,getSnapshot:g}}),x=b[0].inst,w=b[1];return o(function(){x.value=v,x.getSnapshot=g,u(x)&&w({inst:x})},[p,v,g]),i(function(){return u(x)&&w({inst:x}),p(function(){u(x)&&w({inst:x})})},[p]),a(v),v}function u(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!n(p,v)}catch{return!0}}function f(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return bp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,bp}var JS;function z$(){return JS||(JS=1,wp.exports=B$()),wp.exports}/**
49
- * @license React
50
- * use-sync-external-store-shim/with-selector.production.js
51
- *
52
- * Copyright (c) Meta Platforms, Inc. and affiliates.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE file in the root directory of this source tree.
56
- */var ZS;function V$(){if(ZS)return xp;ZS=1;var e=dl(),t=z$();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return xp.useSyncExternalStoreWithSelector=function(f,h,p,g,v){var b=o(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=c(function(){function S(T){if(!N){if(N=!0,k=T,T=g(T),v!==void 0&&x.hasValue){var A=x.value;if(v(A,T))return E=A}return E=T}if(A=E,r(k,T))return A;var O=g(T);return v!==void 0&&v(A,O)?(k=T,A):(k=T,E=O)}var N=!1,k,E,R=p===void 0?null:p;return[function(){return S(h())},R===null?void 0:function(){return S(R())}]},[h,p,g,v]);var w=i(f,b[0],b[1]);return a(function(){x.hasValue=!0,x.value=w},[w]),u(w),w},xp}var ek;function U$(){return ek||(ek=1,vp.exports=V$()),vp.exports}var H$=U$();const W$=fl(H$),K$={},tk=e=>{let t;const n=new Set,r=(h,p)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const v=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(K$?"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,i,u);return u},G$=e=>e?tk(e):tk,{useDebugValue:Y$}=dt,{useSyncExternalStoreWithSelector:X$}=W$,Q$=e=>e;function oT(e,t=Q$,n){const r=X$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Y$(r),r}const nk=(e,t)=>{const n=G$(e),r=(i,o=t)=>oT(n,i,o);return Object.assign(r,n),r},J$=(e,t)=>e?nk(e,t):nk;function Xe(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,i]of e)if(!Object.is(i,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 ww=ZR();const Z$=fl(ww),kf=j.createContext(null),eF=kf.Provider,aT=sr.error001();function De(e,t){const n=j.useContext(kf);if(n===null)throw new Error(aT);return oT(n,e,t)}function Qe(){const e=j.useContext(kf);if(e===null)throw new Error(aT);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const rk={display:"none"},tF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},lT="react-flow__node-desc",cT="react-flow__edge-desc",nF="react-flow__aria-live",rF=e=>e.ariaLiveMessage,iF=e=>e.ariaLabelConfig;function sF({rfId:e}){const t=De(rF);return m.jsx("div",{id:`${nF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:tF,children:t})}function oF({rfId:e,disableKeyboardA11y:t}){const n=De(iF);return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:`${lT}-${e}`,style:rk,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),m.jsx("div",{id:`${cT}-${e}`,style:rk,children:n["edge.a11yDescription.default"]}),!t&&m.jsx(sF,{rfId:e})]})}const Ef=j.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const a=`${e}`.split("-");return m.jsx("div",{className:pt(["react-flow__panel",n,...a]),style:r,ref:o,...i,children:t})});Ef.displayName="Panel";function aF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:m.jsx(Ef,{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:m.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const lF=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}},lu=e=>e.id;function cF(e,t){return Xe(e.selectedNodes.map(lu),t.selectedNodes.map(lu))&&Xe(e.selectedEdges.map(lu),t.selectedEdges.map(lu))}function uF({onSelectionChange:e}){const t=Qe(),{selectedNodes:n,selectedEdges:r}=De(lF,cF);return j.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const fF=e=>!!e.onSelectionChangeHandlers;function dF({onSelectionChange:e}){const t=De(fF);return e||t?m.jsx(uF,{onSelectionChange:e}):null}const uT=[0,0],hF={x:0,y:0,zoom:1},pF=["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"],ik=[...pF,"rfId"],mF=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}),sk={translateExtent:Ya,nodeOrigin:uT,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function gF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:u}=De(mF,Xe),f=Qe();j.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=sk,c()}),[]);const h=j.useRef(sk);return j.useEffect(()=>{for(const p of ik){const g=e[p],v=h.current[p];g!==v&&(typeof e[p]>"u"||(p==="nodes"?t(g):p==="edges"?n(g):p==="minZoom"?r(g):p==="maxZoom"?i(g):p==="translateExtent"?o(g):p==="nodeExtent"?a(g):p==="ariaLabelConfig"?f.setState({ariaLabelConfig:Zq(g)}):p==="fitView"?f.setState({fitViewQueued:g}):p==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[p]:g})))}h.current=e},ik.map(p=>e[p])),null}function ok(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function yF(e){var r;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const i=ok(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=ok())!=null&&r.matches?"dark":"light"}const ak=typeof document<"u"?document:null;function Za(e=null,t={target:ak,actInsideInputWithModifier:!0}){const[n,r]=j.useState(!1),i=j.useRef(!1),o=j.useRef(new Set([])),[a,c]=j.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),h=f.reduce((p,g)=>p.concat(...g),[]);return[f,h]}return[[],[]]},[e]);return j.useEffect(()=>{const u=(t==null?void 0:t.target)??ak,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=v=>{var w,S;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!f)&&zA(v))return!1;const x=ck(v.code,c);if(o.current.add(v[x]),lk(a,o.current,!1)){const N=((S=(w=v.composedPath)==null?void 0:w.call(v))==null?void 0:S[0])||v.target,k=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";t.preventDefault!==!1&&(i.current||!k)&&v.preventDefault(),r(!0)}},p=v=>{const b=ck(v.code,c);lk(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(v[b]),v.key==="Meta"&&o.current.clear(),i.current=!1},g=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function lk(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function ck(e,t){return t.includes(e)?"code":"key"}const vF=()=>{const e=Qe();return j.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:a,panZoom:c}=e.getState(),u=hw(t,r,i,o,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:c,y:u}=a.getBoundingClientRect(),f={x:t.x-c,y:t.y-u},h=n.snapGrid??i,p=n.snapToGrid??o;return vl(f,r,p,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),a=Ju(t,n);return{x:a.x+i,y:a.y+o}}}),[])};function fT(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const a=r.get(o.id);a?a.push(o):r.set(o.id,[o])}for(const o of t){const a=r.get(o.id);if(!a){n.push(o);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...o};for(const u of a)xF(u,c);n.push(c)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function xF(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 dT(e,t){return fT(e,t)}function hT(e,t){return fT(e,t)}function Di(e,t){return{id:e,type:"select",selected:t}}function Hs(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const a=t.has(i);!(o.selected===void 0&&!a)&&o.selected!==a&&(n&&(o.selected=a),r.push(Di(o.id,a)))}return r}function uk({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,a]of e.entries()){const c=t.get(a.id),u=((i=c==null?void 0:c.internals)==null?void 0:i.userNode)??c;u!==void 0&&u!==a&&n.push({id:a.id,item:a,type:"replace"}),u===void 0&&n.push({item:a,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function fk(e){return{id:e.id,type:"remove"}}const dk=e=>Vq(e),wF=e=>OA(e);function pT(e){return j.forwardRef(e)}const bF=typeof window<"u"?j.useLayoutEffect:j.useEffect;function hk(e){const[t,n]=j.useState(BigInt(0)),[r]=j.useState(()=>_F(()=>n(i=>i+BigInt(1))));return bF(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function _F(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const mT=j.createContext(null);function SF({children:e}){const t=Qe(),n=j.useCallback(c=>{const{nodes:u=[],setNodes:f,hasDefaultNodes:h,onNodesChange:p,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let x=u;for(const S of c)x=typeof S=="function"?S(x):S;let w=uk({items:x,lookup:g});for(const S of b.values())w=S(w);h&&f(x),w.length>0?p==null||p(w):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:N,setNodes:k}=t.getState();S&&k(N)})},[]),r=hk(n),i=j.useCallback(c=>{const{edges:u=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:p,edgeLookup:g}=t.getState();let v=u;for(const b of c)v=typeof b=="function"?b(v):b;h?f(v):p&&p(uk({items:v,lookup:g}))},[]),o=hk(i),a=j.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return m.jsx(mT.Provider,{value:a,children:e})}function kF(){const e=j.useContext(mT);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const EF=e=>!!e.panZoom;function mo(){const e=vF(),t=Qe(),n=kF(),r=De(EF),i=j.useMemo(()=>{const o=p=>t.getState().nodeLookup.get(p),a=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},u=p=>{var S,N;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=dk(p)?p:g.get(p.id),x=b.parentId?FA(b.position,b.measured,b.parentId,g,v):b.position,w={...b,position:x,width:((S=b.measured)==null?void 0:S.width)??b.width,height:((N=b.measured)==null?void 0:N.height)??b.height};return ao(w)},f=(p,g,v={replace:!1})=>{a(b=>b.map(x=>{if(x.id===p){const w=typeof g=="function"?g(x):g;return v.replace&&dk(w)?w:{...x,...w}}return x}))},h=(p,g,v={replace:!1})=>{c(b=>b.map(x=>{if(x.id===p){const w=typeof g=="function"?g(x):g;return v.replace&&wF(w)?w:{...x,...w}}return x}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var g;return(g=o(p))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(g=>({...g}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:a,setEdges:c,addNodes:p=>{const g=Array.isArray(p)?p:[p];n.nodeQueue.push(v=>[...v,...g])},addEdges:p=>{const g=Array.isArray(p)?p:[p];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:p=[],edges:g=[],transform:v}=t.getState(),[b,x,w]=v;return{nodes:p.map(S=>({...S})),edges:g.map(S=>({...S})),viewport:{x:b,y:x,zoom:w}}},deleteElements:async({nodes:p=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:x,onEdgesDelete:w,triggerNodeChanges:S,triggerEdgeChanges:N,onDelete:k,onBeforeDelete:E}=t.getState(),{nodes:R,edges:T}=await Gq({nodesToRemove:p,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:E}),A=T.length>0,O=R.length>0;if(A){const L=T.map(fk);w==null||w(T),N(L)}if(O){const L=R.map(fk);x==null||x(R),S(L)}return(O||A)&&(k==null||k({nodes:R,edges:T})),{deletedNodes:R,deletedEdges:T}},getIntersectingNodes:(p,g=!0,v)=>{const b=qS(p),x=b?p:u(p),w=v!==void 0;return x?(v||t.getState().nodes).filter(S=>{const N=t.getState().nodeLookup.get(S.id);if(N&&!b&&(S.id===p.id||!N.internals.positionAbsolute))return!1;const k=ao(w?S:N),E=Qa(k,x);return g&&E>0||E>=k.width*k.height||E>=x.width*x.height}):[]},isNodeIntersecting:(p,g,v=!0)=>{const x=qS(p)?p:u(p);if(!x)return!1;const w=Qa(x,g);return v&&w>0||w>=g.width*g.height||w>=x.width*x.height},updateNode:f,updateNodeData:(p,g,v={replace:!1})=>{f(p,b=>{const x=typeof g=="function"?g(b):g;return v.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},v)},updateEdge:h,updateEdgeData:(p,g,v={replace:!1})=>{h(p,b=>{const x=typeof g=="function"?g(b):g;return v.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},v)},getNodesBounds:p=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return Uq(p,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:p,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${p}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:p,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${p?g?`-${p}-${g}`:`-${p}`:""}`))==null?void 0:b.values())??[])},fitView:async p=>{const g=t.getState().fitViewResolver??Jq();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return j.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const pk=e=>e.selected,NF=typeof window<"u"?window:void 0;function CF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Qe(),{deleteElements:r}=mo(),i=Za(e,{actInsideInputWithModifier:!1}),o=Za(t,{target:NF});j.useEffect(()=>{if(i){const{edges:a,nodes:c}=n.getState();r({nodes:c.filter(pk),edges:a.filter(pk)}),n.setState({nodesSelectionActive:!1})}},[i]),j.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function jF(e){const t=Qe();j.useEffect(()=>{const n=()=>{var i,o,a,c;if(!e.current||!(((o=(i=e.current).checkVisibility)==null?void 0:o.call(i))??!0))return!1;const r=pw(e.current);(r.height===0||r.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",sr.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},RF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function AF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=Vi.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:f,minZoom:h,maxZoom:p,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:x,noPanClassName:w,onViewportChange:S,isControlledViewport:N,paneClickDistance:k,selectionOnDrag:E}){const R=Qe(),T=j.useRef(null),{userSelectionActive:A,lib:O,connectionInProgress:L}=De(RF,Xe),B=Za(g),I=j.useRef();jF(T);const q=j.useCallback(U=>{S==null||S({x:U[0],y:U[1],zoom:U[2]}),N||R.setState({transform:U})},[S,N]);return j.useEffect(()=>{if(T.current){I.current=O$({domNode:T.current,minZoom:h,maxZoom:p,translateExtent:f,viewport:u,onDraggingChange:z=>R.setState({paneDragging:z}),onPanZoomStart:(z,Q)=>{const{onViewportChangeStart:F,onMoveStart:$}=R.getState();$==null||$(z,Q),F==null||F(Q)},onPanZoom:(z,Q)=>{const{onViewportChange:F,onMove:$}=R.getState();$==null||$(z,Q),F==null||F(Q)},onPanZoomEnd:(z,Q)=>{const{onViewportChangeEnd:F,onMoveEnd:$}=R.getState();$==null||$(z,Q),F==null||F(Q)}});const{x:U,y:D,zoom:V}=I.current.getViewport();return R.setState({panZoom:I.current,transform:[U,D,V],domNode:T.current.closest(".react-flow")}),()=>{var z;(z=I.current)==null||z.destroy()}}},[]),j.useEffect(()=>{var U;(U=I.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:w,userSelectionActive:A,noWheelClassName:x,lib:O,onTransformChange:q,connectionInProgress:L,selectionOnDrag:E,paneClickDistance:k})},[e,t,n,r,i,o,a,c,B,v,w,A,x,O,q,L,E,k]),m.jsx("div",{className:"react-flow__renderer",ref:T,style:Nf,children:b})}const TF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function MF(){const{userSelectionActive:e,userSelectionRect:t}=De(TF,Xe);return e&&t?m.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const _p=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},IF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function OF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xa.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:o,onSelectionStart:a,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:f,onPaneScroll:h,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const x=Qe(),{userSelectionActive:w,elementsSelectable:S,dragging:N,connectionInProgress:k}=De(IF,Xe),E=S&&(e||w),R=j.useRef(null),T=j.useRef(),A=j.useRef(new Set),O=j.useRef(new Set),L=j.useRef(!1),B=F=>{if(L.current||k){L.current=!1;return}u==null||u(F),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},I=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}f==null||f(F)},q=h?F=>h(F):void 0,U=F=>{L.current&&(F.stopPropagation(),L.current=!1)},D=F=>{var J,G;const{domNode:$}=x.getState();if(T.current=$==null?void 0:$.getBoundingClientRect(),!T.current)return;const Y=F.target===R.current;if(!Y&&!!F.target.closest(".nokey")||!e||!(o&&Y||t)||F.button!==0||!F.isPrimary)return;(G=(J=F.target)==null?void 0:J.setPointerCapture)==null||G.call(J,F.pointerId),L.current=!1;const{x:se,y:K}=Dn(F.nativeEvent,T.current);x.setState({userSelectionRect:{width:0,height:0,startX:se,startY:K,x:se,y:K}}),Y||(F.stopPropagation(),F.preventDefault())},V=F=>{const{userSelectionRect:$,transform:Y,nodeLookup:P,edgeLookup:W,connectionLookup:se,triggerNodeChanges:K,triggerEdgeChanges:J,defaultEdgeOptions:G,resetSelectedElements:ee}=x.getState();if(!T.current||!$)return;const{x:te,y:oe}=Dn(F.nativeEvent,T.current),{startX:fe,startY:he}=$;if(!L.current){const Ne=t?0:i;if(Math.hypot(te-fe,oe-he)<=Ne)return;ee(),a==null||a(F)}L.current=!0;const me={startX:fe,startY:he,x:te<fe?te:fe,y:oe<he?oe:he,width:Math.abs(te-fe),height:Math.abs(oe-he)},de=A.current,_e=O.current;A.current=new Set(dw(P,me,Y,n===Xa.Partial,!0).map(Ne=>Ne.id)),O.current=new Set;const ve=(G==null?void 0:G.selectable)??!0;for(const Ne of A.current){const Ee=se.get(Ne);if(Ee)for(const{edgeId:et}of Ee.values()){const Le=W.get(et);Le&&(Le.selectable??ve)&&O.current.add(et)}}if(!$S(de,A.current)){const Ne=Hs(P,A.current,!0);K(Ne)}if(!$S(_e,O.current)){const Ne=Hs(W,O.current);J(Ne)}x.setState({userSelectionRect:me,userSelectionActive:!0,nodesSelectionActive:!1})},z=F=>{var $,Y;F.button===0&&((Y=($=F.target)==null?void 0:$.releasePointerCapture)==null||Y.call($,F.pointerId),!w&&F.target===R.current&&x.getState().userSelectionRect&&(B==null||B(F)),x.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(c==null||c(F),x.setState({nodesSelectionActive:A.current.size>0})))},Q=r===!0||Array.isArray(r)&&r.includes(0);return m.jsxs("div",{className:pt(["react-flow__pane",{draggable:Q,dragging:N,selection:e}]),onClick:E?void 0:_p(B,R),onContextMenu:_p(I,R),onWheel:_p(q,R),onPointerEnter:E?void 0:p,onPointerMove:E?V:g,onPointerUp:E?z:void 0,onPointerDownCapture:E?D:void 0,onClickCapture:E?U:void 0,onPointerLeave:v,ref:R,style:Nf,children:[b,m.jsx(MF,{})]})}function jx({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:a,nodeLookup:c,onError:u}=t.getState(),f=c.get(e);if(!f){u==null||u("012",sr.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&a)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):i([e])}function gT({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:a}){const c=Qe(),[u,f]=j.useState(!1),h=j.useRef();return j.useEffect(()=>{h.current=w$({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{jx({id:p,store:c,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),j.useEffect(()=>{var p,g;if(t)(p=h.current)==null||p.destroy();else if(e.current)return(g=h.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:a}),()=>{var v;(v=h.current)==null||v.destroy()}},[n,r,t,o,e,i]),u}const PF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function yT(){const e=Qe();return j.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:a,onError:c,updateNodePositions:u,nodeLookup:f,nodeOrigin:h}=e.getState(),p=new Map,g=PF(a),v=i?o[0]:5,b=i?o[1]:5,x=n.direction.x*v*n.factor,w=n.direction.y*b*n.factor;for(const[,S]of f){if(!g(S))continue;let N={x:S.internals.positionAbsolute.x+x,y:S.internals.positionAbsolute.y+w};i&&(N=yl(N,o));const{position:k,positionAbsolute:E}=PA({nodeId:S.id,nextPosition:N,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:c});S.position=k,S.internals.positionAbsolute=E,p.set(S.id,S)}u(p)},[])}const bw=j.createContext(null),LF=bw.Provider;bw.Consumer;const vT=()=>j.useContext(bw),DF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),qF=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:a}=r,{fromHandle:c,toHandle:u,isValid:f}=a,h=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:h,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===so.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:!!i,valid:h&&f}};function $F({type:e="source",position:t=ke.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:c,children:u,className:f,onMouseDown:h,onTouchStart:p,...g},v){var V,z;const b=a||null,x=e==="target",w=Qe(),S=vT(),{connectOnClick:N,noPanClassName:k,rfId:E}=De(DF,Xe),{connectingFrom:R,connectingTo:T,clickConnecting:A,isPossibleEndHandle:O,connectionInProcess:L,clickConnectionInProcess:B,valid:I}=De(qF(S,b,e),Xe);S||(z=(V=w.getState()).onError)==null||z.call(V,"010",sr.error010());const q=Q=>{const{defaultEdgeOptions:F,onConnect:$,hasDefaultEdges:Y}=w.getState(),P={...F,...Q};if(Y){const{edges:W,setEdges:se}=w.getState();se(KA(P,W))}$==null||$(P),c==null||c(P)},U=Q=>{if(!S)return;const F=VA(Q.nativeEvent);if(i&&(F&&Q.button===0||!F)){const $=w.getState();Cx.onPointerDown(Q.nativeEvent,{handleDomNode:Q.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:x,handleId:b,nodeId:S,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:$.onConnectEnd,updateConnection:$.updateConnection,onConnect:q,isValidConnection:n||$.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}F?h==null||h(Q):p==null||p(Q)},D=Q=>{const{onClickConnectStart:F,onClickConnectEnd:$,connectionClickStartHandle:Y,connectionMode:P,isValidConnection:W,lib:se,rfId:K,nodeLookup:J,connection:G}=w.getState();if(!S||!Y&&!i)return;if(!Y){F==null||F(Q.nativeEvent,{nodeId:S,handleId:b,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:S,type:e,id:b}});return}const ee=BA(Q.target),te=n||W,{connection:oe,isValid:fe}=Cx.isValid(Q.nativeEvent,{handle:{nodeId:S,id:b,type:e},connectionMode:P,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:te,flowId:K,doc:ee,lib:se,nodeLookup:J});fe&&oe&&q(oe);const he=structuredClone(G);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,$==null||$(Q,he),w.setState({connectionClickStartHandle:null})};return m.jsx("div",{"data-handleid":b,"data-nodeid":S,"data-handlepos":t,"data-id":`${E}-${S}-${b}-${e}`,className:pt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,f,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:o,clickconnecting:A,connectingfrom:R,connectingto:T,valid:I,connectionindicator:r&&(!L||O)&&(L||B?o:i)}]),onMouseDown:U,onTouchStart:U,onClick:N?D:void 0,ref:v,...g,children:u})}const or=j.memo(pT($F));function FF({data:e,isConnectable:t,sourcePosition:n=ke.Bottom}){return m.jsxs(m.Fragment,{children:[e==null?void 0:e.label,m.jsx(or,{type:"source",position:n,isConnectable:t})]})}function BF({data:e,isConnectable:t,targetPosition:n=ke.Top,sourcePosition:r=ke.Bottom}){return m.jsxs(m.Fragment,{children:[m.jsx(or,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,m.jsx(or,{type:"source",position:r,isConnectable:t})]})}function zF(){return null}function VF({data:e,isConnectable:t,targetPosition:n=ke.Top}){return m.jsxs(m.Fragment,{children:[m.jsx(or,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Zu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},mk={input:FF,default:BF,output:VF,group:zF};function UF(e){var t,n,r,i;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??((i=e.style)==null?void 0:i.height)}}const HF=e=>{const{width:t,height:n,x:r,y:i}=gl(e.nodeLookup,{filter:o=>!!o.selected});return{width:Ln(t)?t:null,height:Ln(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function WF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Qe(),{width:i,height:o,transformString:a,userSelectionActive:c}=De(HF,Xe),u=yT(),f=j.useRef(null);if(j.useEffect(()=>{var g;n||(g=f.current)==null||g.focus({preventScroll:!0})},[n]),gT({nodeRef:f}),c||!i||!o)return null;const h=e?g=>{const v=r.getState().nodes.filter(b=>b.selected);e(g,v)}:void 0,p=g=>{Object.prototype.hasOwnProperty.call(Zu,g.key)&&(g.preventDefault(),u({direction:Zu[g.key],factor:g.shiftKey?4:1}))};return m.jsx("div",{className:pt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:m.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:i,height:o}})})}const gk=typeof window<"u"?window:void 0,KF=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function xT({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:f,selectionOnDrag:h,selectionMode:p,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:w,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:k,panOnScroll:E,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:O,defaultViewport:L,translateExtent:B,minZoom:I,maxZoom:q,preventScrolling:U,onSelectionContextMenu:D,noWheelClassName:V,noPanClassName:z,disableKeyboardA11y:Q,onViewportChange:F,isControlledViewport:$}){const{nodesSelectionActive:Y,userSelectionActive:P}=De(KF,Xe),W=Za(f,{target:gk}),se=Za(x,{target:gk}),K=se||O,J=se||E,G=h&&K!==!0,ee=W||P||G;return CF({deleteKeyCode:u,multiSelectionKeyCode:b}),m.jsx(AF,{onPaneContextMenu:o,elementsSelectable:S,zoomOnScroll:N,zoomOnPinch:k,panOnScroll:J,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!W&&K,defaultViewport:L,translateExtent:B,minZoom:I,maxZoom:q,zoomActivationKeyCode:w,preventScrolling:U,noWheelClassName:V,noPanClassName:z,onViewportChange:F,isControlledViewport:$,paneClickDistance:c,selectionOnDrag:G,children:m.jsxs(OF,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:K,isSelecting:!!ee,selectionMode:p,selectionKeyPressed:W,paneClickDistance:c,selectionOnDrag:G,children:[e,Y&&m.jsx(WF,{onSelectionContextMenu:D,noPanClassName:z,disableKeyboardA11y:Q})]})})}xT.displayName="FlowRenderer";const GF=j.memo(xT),YF=e=>t=>e?dw(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 XF(e){return De(j.useCallback(YF(e),[e]),Xe)}const QF=e=>e.updateNodeInternals;function JF(){const e=De(QF),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return j.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function ZF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Qe(),o=j.useRef(null),a=j.useRef(null),c=j.useRef(e.sourcePosition),u=j.useRef(e.targetPosition),f=j.useRef(t),h=n&&!!e.internals.handleBounds;return j.useEffect(()=>{o.current&&!e.hidden&&(!h||a.current!==o.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(o.current),a.current=o.current)},[h,e.hidden]),j.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),j.useEffect(()=>{if(o.current){const p=f.current!==t,g=c.current!==e.sourcePosition,v=u.current!==e.targetPosition;(p||g||v)&&(f.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function eB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:a,nodesDraggable:c,elementsSelectable:u,nodesConnectable:f,nodesFocusable:h,resizeObserver:p,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:x,nodeTypes:w,nodeClickDistance:S,onError:N}){const{node:k,internals:E,isParent:R}=De(te=>{const oe=te.nodeLookup.get(e),fe=te.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:fe}},Xe);let T=k.type||"default",A=(w==null?void 0:w[T])||mk[T];A===void 0&&(N==null||N("003",sr.error003(T)),T="default",A=(w==null?void 0:w.default)||mk.default);const O=!!(k.draggable||c&&typeof k.draggable>"u"),L=!!(k.selectable||u&&typeof k.selectable>"u"),B=!!(k.connectable||f&&typeof k.connectable>"u"),I=!!(k.focusable||h&&typeof k.focusable>"u"),q=Qe(),U=$A(k),D=ZF({node:k,nodeType:T,hasDimensions:U,resizeObserver:p}),V=gT({nodeRef:D,disabled:k.hidden||!O,noDragClassName:g,handleSelector:k.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:S}),z=yT();if(k.hidden)return null;const Q=Mr(k),F=UF(k),$=L||O||t||n||r||i,Y=n?te=>n(te,{...E.userNode}):void 0,P=r?te=>r(te,{...E.userNode}):void 0,W=i?te=>i(te,{...E.userNode}):void 0,se=o?te=>o(te,{...E.userNode}):void 0,K=a?te=>a(te,{...E.userNode}):void 0,J=te=>{const{selectNodesOnDrag:oe,nodeDragThreshold:fe}=q.getState();L&&(!oe||!O||fe>0)&&jx({id:e,store:q,nodeRef:D}),t&&t(te,{...E.userNode})},G=te=>{if(!(zA(te.nativeEvent)||b)){if(AA.includes(te.key)&&L){const oe=te.key==="Escape";jx({id:e,store:q,unselect:oe,nodeRef:D})}else if(O&&k.selected&&Object.prototype.hasOwnProperty.call(Zu,te.key)){te.preventDefault();const{ariaLabelConfig:oe}=q.getState();q.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),z({direction:Zu[te.key],factor:te.shiftKey?4:1})}}},ee=()=>{var _e;if(b||!((_e=D.current)!=null&&_e.matches(":focus-visible")))return;const{transform:te,width:oe,height:fe,autoPanOnNodeFocus:he,setCenter:me}=q.getState();if(!he)return;dw(new Map([[e,k]]),{x:0,y:0,width:oe,height:fe},te,!0).length>0||me(k.position.x+Q.width/2,k.position.y+Q.height/2,{zoom:te[2]})};return m.jsx("div",{className:pt(["react-flow__node",`react-flow__node-${T}`,{[v]:O},k.className,{selected:k.selected,selectable:L,parent:R,draggable:O,dragging:V}]),ref:D,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:U?"visible":"hidden",...k.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Y,onMouseMove:P,onMouseLeave:W,onContextMenu:se,onClick:J,onDoubleClick:K,onKeyDown:I?G:void 0,tabIndex:I?0:void 0,onFocus:I?ee:void 0,role:k.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${lT}-${x}`,"aria-label":k.ariaLabel,...k.domAttributes,children:m.jsx(LF,{value:e,children:m.jsx(A,{id:e,data:k.data,type:T,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:k.selected??!1,selectable:L,draggable:O,deletable:k.deletable??!0,isConnectable:B,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:V,dragHandle:k.dragHandle,zIndex:E.z,parentId:k.parentId,...Q})})})}var tB=j.memo(eB);const nB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function wT(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=De(nB,Xe),a=XF(e.onlyRenderVisibleElements),c=JF();return m.jsx("div",{className:"react-flow__nodes",style:Nf,children:a.map(u=>m.jsx(tB,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}wT.displayName="NodeRenderer";const rB=j.memo(wT);function iB(e){return De(j.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);o&&a&&n$({sourceNode:o,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Xe)}const sB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return m.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},oB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return m.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},yk={[Xu.Arrow]:sB,[Xu.ArrowClosed]:oB};function aB(e){const t=Qe();return j.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(yk,e)?yk[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",sr.error009(e)),null)},[e])}const lB=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const u=aB(t);return u?m.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0",children:m.jsx(u,{color:n,strokeWidth:a})}):null},bT=({defaultColor:e,rfId:t})=>{const n=De(o=>o.edges),r=De(o=>o.defaultEdgeOptions),i=j.useMemo(()=>c$(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?m.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:m.jsx("defs",{children:i.map(o=>m.jsx(lB,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};bT.displayName="MarkerDefinitions";var cB=j.memo(bT);function _T({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:u,className:f,...h}){const[p,g]=j.useState({x:1,y:0,width:0,height:0}),v=pt(["react-flow__edge-textwrapper",f]),b=j.useRef(null);return j.useEffect(()=>{if(b.current){const x=b.current.getBBox();g({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?m.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...h,children:[i&&m.jsx("rect",{width:p.width+2*a[0],x:-a[0],y:-a[1],height:p.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),m.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}_T.displayName="EdgeText";const uB=j.memo(_T);function Cf({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:f=20,...h}){return m.jsxs(m.Fragment,{children:[m.jsx("path",{...h,d:e,fill:"none",className:pt(["react-flow__edge-path",h.className])}),f?m.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Ln(t)&&Ln(n)?m.jsx(uB,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function vk({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===ke.Left||e===ke.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function ST({sourceX:e,sourceY:t,sourcePosition:n=ke.Bottom,targetX:r,targetY:i,targetPosition:o=ke.Top}){const[a,c]=vk({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,f]=vk({pos:o,x1:r,y1:i,x2:e,y2:t}),[h,p,g,v]=UA({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${t} C${a},${c} ${u},${f} ${r},${i}`,h,p,g,v]}function kT(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:a,targetPosition:c,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})=>{const[N,k,E]=ST({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:o,targetPosition:c}),R=e.isInternal?void 0:t;return m.jsx(Cf,{id:R,path:N,labelX:k,labelY:E,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:S})})}const fB=kT({isInternal:!1}),ET=kT({isInternal:!0});fB.displayName="SimpleBezierEdge";ET.displayName="SimpleBezierEdgeInternal";function NT(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,sourcePosition:v=ke.Bottom,targetPosition:b=ke.Top,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:N})=>{const[k,E,R]=kx({sourceX:n,sourceY:r,sourcePosition:v,targetX:i,targetY:o,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),T=e.isInternal?void 0:t;return m.jsx(Cf,{id:T,path:k,labelX:E,labelY:R,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:x,markerStart:w,interactionWidth:N})})}const CT=NT({isInternal:!1}),jT=NT({isInternal:!0});CT.displayName="SmoothStepEdge";jT.displayName="SmoothStepEdgeInternal";function RT(e){return j.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return m.jsx(CT,{...n,id:r,pathOptions:j.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const dB=RT({isInternal:!1}),AT=RT({isInternal:!0});dB.displayName="StepEdge";AT.displayName="StepEdgeInternal";function TT(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:b,interactionWidth:x})=>{const[w,S,N]=GA({sourceX:n,sourceY:r,targetX:i,targetY:o}),k=e.isInternal?void 0:t;return m.jsx(Cf,{id:k,path:w,labelX:S,labelY:N,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:b,interactionWidth:x})})}const hB=TT({isInternal:!1}),MT=TT({isInternal:!0});hB.displayName="StraightEdge";MT.displayName="StraightEdgeInternal";function IT(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:a=ke.Bottom,targetPosition:c=ke.Top,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,pathOptions:S,interactionWidth:N})=>{const[k,E,R]=HA({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:o,targetPosition:c,curvature:S==null?void 0:S.curvature}),T=e.isInternal?void 0:t;return m.jsx(Cf,{id:T,path:k,labelX:E,labelY:R,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:x,markerStart:w,interactionWidth:N})})}const pB=IT({isInternal:!1}),OT=IT({isInternal:!0});pB.displayName="BezierEdge";OT.displayName="BezierEdgeInternal";const xk={default:OT,straight:MT,step:AT,smoothstep:jT,simplebezier:ET},wk={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},mB=(e,t,n)=>n===ke.Left?e-t:n===ke.Right?e+t:e,gB=(e,t,n)=>n===ke.Top?e-t:n===ke.Bottom?e+t:e,bk="react-flow__edgeupdater";function _k({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:c}){return m.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:pt([bk,`${bk}-${c}`]),cx:mB(t,r,e),cy:gB(n,r,e),r,stroke:"transparent",fill:"transparent"})}function yB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:a,sourcePosition:c,targetPosition:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,setReconnecting:g,setUpdateHover:v}){const b=Qe(),x=(E,R)=>{if(E.button!==0)return;const{autoPanOnConnect:T,domNode:A,isValidConnection:O,connectionMode:L,connectionRadius:B,lib:I,onConnectStart:q,onConnectEnd:U,cancelConnection:D,nodeLookup:V,rfId:z,panBy:Q,updateConnection:F}=b.getState(),$=R.type==="target",Y=(se,K)=>{g(!1),p==null||p(se,n,R.type,K)},P=se=>f==null?void 0:f(n,se),W=(se,K)=>{g(!0),h==null||h(E,n,R.type),q==null||q(se,K)};Cx.onPointerDown(E.nativeEvent,{autoPanOnConnect:T,connectionMode:L,connectionRadius:B,domNode:A,handleId:R.id,nodeId:R.nodeId,nodeLookup:V,isTarget:$,edgeUpdaterType:R.type,lib:I,flowId:z,cancelConnection:D,panBy:Q,isValidConnection:O,onConnect:P,onConnectStart:W,onConnectEnd:U,onReconnectEnd:Y,updateConnection:F,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},w=E=>x(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=E=>x(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>v(!0),k=()=>v(!1);return m.jsxs(m.Fragment,{children:[(e===!0||e==="source")&&m.jsx(_k,{position:c,centerX:r,centerY:i,radius:t,onMouseDown:w,onMouseEnter:N,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&m.jsx(_k,{position:u,centerX:o,centerY:a,radius:t,onMouseDown:S,onMouseEnter:N,onMouseOut:k,type:"target"})]})}function vB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:x,noPanClassName:w,onError:S,disableKeyboardA11y:N}){let k=De(me=>me.edgeLookup.get(e));const E=De(me=>me.defaultEdgeOptions);k=E?{...E,...k}:k;let R=k.type||"default",T=(x==null?void 0:x[R])||xk[R];T===void 0&&(S==null||S("011",sr.error011(R)),R="default",T=(x==null?void 0:x.default)||xk.default);const A=!!(k.focusable||t&&typeof k.focusable>"u"),O=typeof p<"u"&&(k.reconnectable||n&&typeof k.reconnectable>"u"),L=!!(k.selectable||r&&typeof k.selectable>"u"),B=j.useRef(null),[I,q]=j.useState(!1),[U,D]=j.useState(!1),V=Qe(),{zIndex:z,sourceX:Q,sourceY:F,targetX:$,targetY:Y,sourcePosition:P,targetPosition:W}=De(j.useCallback(me=>{const de=me.nodeLookup.get(k.source),_e=me.nodeLookup.get(k.target);if(!de||!_e)return{zIndex:k.zIndex,...wk};const ve=l$({id:e,sourceNode:de,targetNode:_e,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:me.connectionMode,onError:S});return{zIndex:t$({selected:k.selected,zIndex:k.zIndex,sourceNode:de,targetNode:_e,elevateOnSelect:me.elevateEdgesOnSelect,zIndexMode:me.zIndexMode}),...ve||wk}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Xe),se=j.useMemo(()=>k.markerStart?`url('#${Ex(k.markerStart,b)}')`:void 0,[k.markerStart,b]),K=j.useMemo(()=>k.markerEnd?`url('#${Ex(k.markerEnd,b)}')`:void 0,[k.markerEnd,b]);if(k.hidden||Q===null||F===null||$===null||Y===null)return null;const J=me=>{var Ne;const{addSelectedEdges:de,unselectNodesAndEdges:_e,multiSelectionActive:ve}=V.getState();L&&(V.setState({nodesSelectionActive:!1}),k.selected&&ve?(_e({nodes:[],edges:[k]}),(Ne=B.current)==null||Ne.blur()):de([e])),i&&i(me,k)},G=o?me=>{o(me,{...k})}:void 0,ee=a?me=>{a(me,{...k})}:void 0,te=c?me=>{c(me,{...k})}:void 0,oe=u?me=>{u(me,{...k})}:void 0,fe=f?me=>{f(me,{...k})}:void 0,he=me=>{var de;if(!N&&AA.includes(me.key)&&L){const{unselectNodesAndEdges:_e,addSelectedEdges:ve}=V.getState();me.key==="Escape"?((de=B.current)==null||de.blur(),_e({edges:[k]})):ve([e])}};return m.jsx("svg",{style:{zIndex:z},children:m.jsxs("g",{className:pt(["react-flow__edge",`react-flow__edge-${R}`,k.className,w,{selected:k.selected,animated:k.animated,inactive:!L&&!i,updating:I,selectable:L}]),onClick:J,onDoubleClick:G,onContextMenu:ee,onMouseEnter:te,onMouseMove:oe,onMouseLeave:fe,onKeyDown:A?he:void 0,tabIndex:A?0:void 0,role:k.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":A?`${cT}-${b}`:void 0,ref:B,...k.domAttributes,children:[!U&&m.jsx(T,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:L,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:Q,sourceY:F,targetX:$,targetY:Y,sourcePosition:P,targetPosition:W,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:se,markerEnd:K,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),O&&m.jsx(yB,{edge:k,isReconnectable:O,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:v,sourceX:Q,sourceY:F,targetX:$,targetY:Y,sourcePosition:P,targetPosition:W,setUpdateHover:q,setReconnecting:D})]})})}var xB=j.memo(vB);const wB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function PT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:p,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:x}){const{edgesFocusable:w,edgesReconnectable:S,elementsSelectable:N,onError:k}=De(wB,Xe),E=iB(t);return m.jsxs("div",{className:"react-flow__edges",children:[m.jsx(cB,{defaultColor:e,rfId:n}),E.map(R=>m.jsx(xB,{id:R,edgesFocusable:w,edgesReconnectable:S,elementsSelectable:N,noPanClassName:i,onReconnect:o,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,onClick:h,reconnectRadius:p,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:k,edgeTypes:r,disableKeyboardA11y:x},R))]})}PT.displayName="EdgeRenderer";const bB=j.memo(PT),_B=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function SB({children:e}){const t=De(_B);return m.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function kB(e){const t=mo(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const EB=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function NB(e){const t=De(EB),n=Qe();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function CB(e){return e.connection.inProgress?{...e.connection,to:vl(e.connection.to,e.transform)}:{...e.connection}}function jB(e){return CB}function RB(e){const t=jB();return De(t,Xe)}const AB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function TB({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:a,isValid:c,inProgress:u}=De(AB,Xe);return!(o&&i&&u)?null:m.jsx("svg",{style:e,width:o,height:a,className:"react-flow__connectionline react-flow__container",children:m.jsx("g",{className:pt(["react-flow__connection",IA(c)]),children:m.jsx(LT,{style:t,type:n,CustomComponent:r,isValid:c})})})}const LT=({style:e,type:t=ui.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:a,fromHandle:c,fromPosition:u,to:f,toNode:h,toHandle:p,toPosition:g,pointer:v}=RB();if(!i)return;if(n)return m.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:o.x,fromY:o.y,toX:f.x,toY:f.y,fromPosition:u,toPosition:g,connectionStatus:IA(r),toNode:h,toHandle:p,pointer:v});let b="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case ui.Bezier:[b]=HA(x);break;case ui.SimpleBezier:[b]=ST(x);break;case ui.Step:[b]=kx({...x,borderRadius:0});break;case ui.SmoothStep:[b]=kx(x);break;default:[b]=GA(x)}return m.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};LT.displayName="ConnectionLine";const MB={};function Sk(e=MB){j.useRef(e),Qe(),j.useEffect(()=>{},[e])}function IB(){Qe(),j.useRef(!1),j.useEffect(()=>{},[])}function DT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:w,connectionLineContainerStyle:S,selectionKeyCode:N,selectionOnDrag:k,selectionMode:E,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:O,onlyRenderVisibleElements:L,elementsSelectable:B,defaultViewport:I,translateExtent:q,minZoom:U,maxZoom:D,preventScrolling:V,defaultMarkerColor:z,zoomOnScroll:Q,zoomOnPinch:F,panOnScroll:$,panOnScrollSpeed:Y,panOnScrollMode:P,zoomOnDoubleClick:W,panOnDrag:se,onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:G,onPaneMouseLeave:ee,onPaneScroll:te,onPaneContextMenu:oe,paneClickDistance:fe,nodeClickDistance:he,onEdgeContextMenu:me,onEdgeMouseEnter:de,onEdgeMouseMove:_e,onEdgeMouseLeave:ve,reconnectRadius:Ne,onReconnect:Ee,onReconnectStart:et,onReconnectEnd:Le,noDragClassName:gt,noWheelClassName:yt,noPanClassName:it,disableKeyboardA11y:Ue,nodeExtent:At,rfId:Tt,viewport:Bt,onViewportChange:Me}){return Sk(e),Sk(t),IB(),kB(n),NB(Bt),m.jsx(GF,{onPaneClick:K,onPaneMouseEnter:J,onPaneMouseMove:G,onPaneMouseLeave:ee,onPaneContextMenu:oe,onPaneScroll:te,paneClickDistance:fe,deleteKeyCode:O,selectionKeyCode:N,selectionOnDrag:k,selectionMode:E,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:B,zoomOnScroll:Q,zoomOnPinch:F,zoomOnDoubleClick:W,panOnScroll:$,panOnScrollSpeed:Y,panOnScrollMode:P,panOnDrag:se,defaultViewport:I,translateExtent:q,minZoom:U,maxZoom:D,onSelectionContextMenu:p,preventScrolling:V,noDragClassName:gt,noWheelClassName:yt,noPanClassName:it,disableKeyboardA11y:Ue,onViewportChange:Me,isControlledViewport:!!Bt,children:m.jsxs(SB,{children:[m.jsx(bB,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:Ee,onReconnectStart:et,onReconnectEnd:Le,onlyRenderVisibleElements:L,onEdgeContextMenu:me,onEdgeMouseEnter:de,onEdgeMouseMove:_e,onEdgeMouseLeave:ve,reconnectRadius:Ne,defaultMarkerColor:z,noPanClassName:it,disableKeyboardA11y:Ue,rfId:Tt}),m.jsx(TB,{style:x,type:b,component:w,containerStyle:S}),m.jsx("div",{className:"react-flow__edgelabel-renderer"}),m.jsx(rB,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:he,onlyRenderVisibleElements:L,noPanClassName:it,noDragClassName:gt,disableKeyboardA11y:Ue,nodeExtent:At,rfId:Tt}),m.jsx("div",{className:"react-flow__viewport-portal"})]})})}DT.displayName="GraphView";const OB=j.memo(DT),kk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:a,fitViewOptions:c,minZoom:u=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:p,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,x=new Map,w=new Map,S=r??t??[],N=n??e??[],k=h??[0,0],E=p??Ya;QA(x,w,S);const R=Nx(N,v,b,{nodeOrigin:k,nodeExtent:E,zIndexMode:g});let T=[0,0,1];if(a&&i&&o){const A=gl(v,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:O,y:L,zoom:B}=hw(A,i,o,u,f,(c==null?void 0:c.padding)??.1);T=[O,L,B]}return{rfId:"1",width:i??0,height:o??0,transform:T,nodes:N,nodesInitialized:R,nodeLookup:v,parentLookup:b,edges:S,edgeLookup:w,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:f,translateExtent:Ya,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:so.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:{...MA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Yq,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:TA,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},PB=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,zIndexMode:g})=>J$((v,b)=>{async function x(){const{nodeLookup:w,panZoom:S,fitViewOptions:N,fitViewResolver:k,width:E,height:R,minZoom:T,maxZoom:A}=b();S&&(await Kq({nodes:w,width:E,height:R,panZoom:S,minZoom:T,maxZoom:A},N),k==null||k.resolve(!0),v({fitViewResolver:null}))}return{...kk({nodes:e,edges:t,width:i,height:o,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:w=>{const{nodeLookup:S,parentLookup:N,nodeOrigin:k,elevateNodesOnSelect:E,fitViewQueued:R,zIndexMode:T}=b(),A=Nx(w,S,N,{nodeOrigin:k,nodeExtent:p,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:T});R&&A?(x(),v({nodes:w,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:w,nodesInitialized:A})},setEdges:w=>{const{connectionLookup:S,edgeLookup:N}=b();QA(S,N,w),v({edges:w})},setDefaultNodesAndEdges:(w,S)=>{if(w){const{setNodes:N}=b();N(w),v({hasDefaultNodes:!0})}if(S){const{setEdges:N}=b();N(S),v({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:S,nodeLookup:N,parentLookup:k,domNode:E,nodeOrigin:R,nodeExtent:T,debug:A,fitViewQueued:O,zIndexMode:L}=b(),{changes:B,updatedInternals:I}=g$(w,N,k,E,R,T,L);I&&(d$(N,k,{nodeOrigin:R,nodeExtent:T,zIndexMode:L}),O?(x(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(A&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(w,S=!1)=>{const N=[];let k=[];const{nodeLookup:E,triggerNodeChanges:R,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:O}=b();for(const[L,B]of w){const I=E.get(L),q=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(B!=null&&B.position)),U={id:L,type:"position",position:q?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(I&&T.inProgress&&T.fromNode.id===I.id){const D=Ki(I,T.fromHandle,ke.Left,!0);A({...T,from:D})}q&&I.parentId&&N.push({id:L,parentId:I.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),k.push(U)}if(N.length>0){const{parentLookup:L,nodeOrigin:B}=b(),I=xw(N,E,L,B);k.push(...I)}for(const L of O.values())k=L(k);R(k)},triggerNodeChanges:w=>{const{onNodesChange:S,setNodes:N,nodes:k,hasDefaultNodes:E,debug:R}=b();if(w!=null&&w.length){if(E){const T=dT(w,k);N(T)}R&&console.log("React Flow: trigger node changes",w),S==null||S(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:S,setEdges:N,edges:k,hasDefaultEdges:E,debug:R}=b();if(w!=null&&w.length){if(E){const T=hT(w,k);N(T)}R&&console.log("React Flow: trigger edge changes",w),S==null||S(w)}},addSelectedNodes:w=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:k,triggerNodeChanges:E,triggerEdgeChanges:R}=b();if(S){const T=w.map(A=>Di(A,!0));E(T);return}E(Hs(k,new Set([...w]),!0)),R(Hs(N))},addSelectedEdges:w=>{const{multiSelectionActive:S,edgeLookup:N,nodeLookup:k,triggerNodeChanges:E,triggerEdgeChanges:R}=b();if(S){const T=w.map(A=>Di(A,!0));R(T);return}R(Hs(N,new Set([...w]))),E(Hs(k,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:S}={})=>{const{edges:N,nodes:k,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:T}=b(),A=w||k,O=S||N,L=A.map(I=>{const q=E.get(I.id);return q&&(q.selected=!1),Di(I.id,!1)}),B=O.map(I=>Di(I.id,!1));R(L),T(B)},setMinZoom:w=>{const{panZoom:S,maxZoom:N}=b();S==null||S.setScaleExtent([w,N]),v({minZoom:w})},setMaxZoom:w=>{const{panZoom:S,minZoom:N}=b();S==null||S.setScaleExtent([N,w]),v({maxZoom:w})},setTranslateExtent:w=>{var S;(S=b().panZoom)==null||S.setTranslateExtent(w),v({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:S,triggerNodeChanges:N,triggerEdgeChanges:k,elementsSelectable:E}=b();if(!E)return;const R=S.reduce((A,O)=>O.selected?[...A,Di(O.id,!1)]:A,[]),T=w.reduce((A,O)=>O.selected?[...A,Di(O.id,!1)]:A,[]);N(R),k(T)},setNodeExtent:w=>{const{nodes:S,nodeLookup:N,parentLookup:k,nodeOrigin:E,elevateNodesOnSelect:R,nodeExtent:T,zIndexMode:A}=b();w[0][0]===T[0][0]&&w[0][1]===T[0][1]&&w[1][0]===T[1][0]&&w[1][1]===T[1][1]||(Nx(S,N,k,{nodeOrigin:E,nodeExtent:w,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:A}),v({nodeExtent:w}))},panBy:w=>{const{transform:S,width:N,height:k,panZoom:E,translateExtent:R}=b();return y$({delta:w,panZoom:E,transform:S,translateExtent:R,width:N,height:k})},setCenter:async(w,S,N)=>{const{width:k,height:E,maxZoom:R,panZoom:T}=b();if(!T)return Promise.resolve(!1);const A=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:R;return await T.setViewport({x:k/2-w*A,y:E/2-S*A,zoom:A},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...MA}})},updateConnection:w=>{v({connection:w})},reset:()=>v({...kk()})}},Object.is);function qT({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:u,fitView:f,nodeOrigin:h,nodeExtent:p,zIndexMode:g,children:v}){const[b]=j.useState(()=>PB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:f,minZoom:a,maxZoom:c,fitViewOptions:u,nodeOrigin:h,nodeExtent:p,zIndexMode:g}));return m.jsx(eF,{value:b,children:m.jsx(SF,{children:v})})}function LB({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:a,fitView:c,fitViewOptions:u,minZoom:f,maxZoom:h,nodeOrigin:p,nodeExtent:g,zIndexMode:v}){return j.useContext(kf)?m.jsx(m.Fragment,{children:e}):m.jsx(qT,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:a,fitView:c,initialFitViewOptions:u,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:p,nodeExtent:g,zIndexMode:v,children:e})}const DB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function qB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:a,onNodeClick:c,onEdgeClick:u,onInit:f,onMove:h,onMoveStart:p,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:S,onNodeMouseEnter:N,onNodeMouseMove:k,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:O,onNodeDragStop:L,onNodesDelete:B,onEdgesDelete:I,onDelete:q,onSelectionChange:U,onSelectionDragStart:D,onSelectionDrag:V,onSelectionDragStop:z,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:$,onBeforeDelete:Y,connectionMode:P,connectionLineType:W=ui.Bezier,connectionLineStyle:se,connectionLineComponent:K,connectionLineContainerStyle:J,deleteKeyCode:G="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:te=!1,selectionMode:oe=Xa.Full,panActivationKeyCode:fe="Space",multiSelectionKeyCode:he=Ja()?"Meta":"Control",zoomActivationKeyCode:me=Ja()?"Meta":"Control",snapToGrid:de,snapGrid:_e,onlyRenderVisibleElements:ve=!1,selectNodesOnDrag:Ne,nodesDraggable:Ee,autoPanOnNodeFocus:et,nodesConnectable:Le,nodesFocusable:gt,nodeOrigin:yt=uT,edgesFocusable:it,edgesReconnectable:Ue,elementsSelectable:At=!0,defaultViewport:Tt=hF,minZoom:Bt=.5,maxZoom:Me=2,translateExtent:we=Ya,preventScrolling:st=!0,nodeExtent:Be,defaultMarkerColor:zt="#b1b1b7",zoomOnScroll:cn=!0,zoomOnPinch:Mt=!0,panOnScroll:It=!1,panOnScrollSpeed:os=.5,panOnScrollMode:Ot=Vi.Free,zoomOnDoubleClick:Qt=!0,panOnDrag:Mo=!0,onPaneClick:Io,onPaneMouseEnter:Oo,onPaneMouseMove:Lr,onPaneMouseLeave:Dr,onPaneScroll:ql,onPaneContextMenu:$l,paneClickDistance:Fl=1,nodeClickDistance:Bl=0,children:zl,onReconnect:Po,onReconnectStart:Vl,onReconnectEnd:wi,onEdgeContextMenu:Lo,onEdgeDoubleClick:bi,onEdgeMouseEnter:gd,onEdgeMouseMove:_i,onEdgeMouseLeave:as,reconnectRadius:ls=10,onNodesChange:Do,onEdgesChange:yd,noDragClassName:vd="nodrag",noWheelClassName:xd="nowheel",noPanClassName:Hn="nopan",fitView:qo,fitViewOptions:$o,connectOnClick:wd,attributionPosition:Ul,proOptions:Hl,defaultEdgeOptions:Wl,elevateNodesOnSelect:Kl=!0,elevateEdgesOnSelect:bd=!1,disableKeyboardA11y:Gl=!1,autoPanOnConnect:tt,autoPanOnNodeDrag:_d,autoPanSpeed:Fo,connectionRadius:Yl,isValidConnection:cs,onError:Sd,style:Xl,id:Si,nodeDragThreshold:un,connectionDragThreshold:kd,viewport:Jt,onViewportChange:Ed,width:Nd,height:Cd,colorMode:us="light",debug:fs,onScroll:Wn,ariaLabelConfig:ds,zIndexMode:Ql="basic",...jd},Bo){const hs=Si||"1",zo=yF(us),ki=j.useCallback(Jl=>{Jl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Wn==null||Wn(Jl)},[Wn]);return m.jsx("div",{"data-testid":"rf__wrapper",...jd,onScroll:ki,style:{...Xl,...DB},ref:Bo,className:pt(["react-flow",i,zo]),id:Si,role:"application",children:m.jsxs(LB,{nodes:e,edges:t,width:Nd,height:Cd,fitView:qo,fitViewOptions:$o,minZoom:Bt,maxZoom:Me,nodeOrigin:yt,nodeExtent:Be,zIndexMode:Ql,children:[m.jsx(OB,{onInit:f,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:N,onNodeMouseMove:k,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:T,nodeTypes:o,edgeTypes:a,connectionLineType:W,connectionLineStyle:se,connectionLineComponent:K,connectionLineContainerStyle:J,selectionKeyCode:ee,selectionOnDrag:te,selectionMode:oe,deleteKeyCode:G,multiSelectionKeyCode:he,panActivationKeyCode:fe,zoomActivationKeyCode:me,onlyRenderVisibleElements:ve,defaultViewport:Tt,translateExtent:we,minZoom:Bt,maxZoom:Me,preventScrolling:st,zoomOnScroll:cn,zoomOnPinch:Mt,zoomOnDoubleClick:Qt,panOnScroll:It,panOnScrollSpeed:os,panOnScrollMode:Ot,panOnDrag:Mo,onPaneClick:Io,onPaneMouseEnter:Oo,onPaneMouseMove:Lr,onPaneMouseLeave:Dr,onPaneScroll:ql,onPaneContextMenu:$l,paneClickDistance:Fl,nodeClickDistance:Bl,onSelectionContextMenu:Q,onSelectionStart:F,onSelectionEnd:$,onReconnect:Po,onReconnectStart:Vl,onReconnectEnd:wi,onEdgeContextMenu:Lo,onEdgeDoubleClick:bi,onEdgeMouseEnter:gd,onEdgeMouseMove:_i,onEdgeMouseLeave:as,reconnectRadius:ls,defaultMarkerColor:zt,noDragClassName:vd,noWheelClassName:xd,noPanClassName:Hn,rfId:hs,disableKeyboardA11y:Gl,nodeExtent:Be,viewport:Jt,onViewportChange:Ed}),m.jsx(gF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:S,nodesDraggable:Ee,autoPanOnNodeFocus:et,nodesConnectable:Le,nodesFocusable:gt,edgesFocusable:it,edgesReconnectable:Ue,elementsSelectable:At,elevateNodesOnSelect:Kl,elevateEdgesOnSelect:bd,minZoom:Bt,maxZoom:Me,nodeExtent:Be,onNodesChange:Do,onEdgesChange:yd,snapToGrid:de,snapGrid:_e,connectionMode:P,translateExtent:we,connectOnClick:wd,defaultEdgeOptions:Wl,fitView:qo,fitViewOptions:$o,onNodesDelete:B,onEdgesDelete:I,onDelete:q,onNodeDragStart:A,onNodeDrag:O,onNodeDragStop:L,onSelectionDrag:V,onSelectionDragStart:D,onSelectionDragStop:z,onMove:h,onMoveStart:p,onMoveEnd:g,noPanClassName:Hn,nodeOrigin:yt,rfId:hs,autoPanOnConnect:tt,autoPanOnNodeDrag:_d,autoPanSpeed:Fo,onError:Sd,connectionRadius:Yl,isValidConnection:cs,selectNodesOnDrag:Ne,nodeDragThreshold:un,connectionDragThreshold:kd,onBeforeDelete:Y,debug:fs,ariaLabelConfig:ds,zIndexMode:Ql}),m.jsx(dF,{onSelectionChange:U}),zl,m.jsx(aF,{proOptions:Hl,position:Ul}),m.jsx(oF,{rfId:hs,disableKeyboardA11y:Gl})]})})}var $B=pT(qB);function FB({dimensions:e,lineWidth:t,variant:n,className:r}){return m.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:pt(["react-flow__background-pattern",n,r])})}function BB({radius:e,className:t}){return m.jsx("circle",{cx:e,cy:e,r:e,className:pt(["react-flow__background-pattern","dots",t])})}var Cr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Cr||(Cr={}));const zB={[Cr.Dots]:1,[Cr.Lines]:1,[Cr.Cross]:6},VB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $T({id:e,variant:t=Cr.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:a,bgColor:c,style:u,className:f,patternClassName:h}){const p=j.useRef(null),{transform:g,patternId:v}=De(VB,Xe),b=r||zB[t],x=t===Cr.Dots,w=t===Cr.Cross,S=Array.isArray(n)?n:[n,n],N=[S[0]*g[2]||1,S[1]*g[2]||1],k=b*g[2],E=Array.isArray(o)?o:[o,o],R=w?[k,k]:N,T=[E[0]*g[2]||1+R[0]/2,E[1]*g[2]||1+R[1]/2],A=`${v}${e||""}`;return m.jsxs("svg",{className:pt(["react-flow__background",f]),style:{...u,...Nf,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:p,"data-testid":"rf__background",children:[m.jsx("pattern",{id:A,x:g[0]%N[0],y:g[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:x?m.jsx(BB,{radius:k/2,className:h}):m.jsx(FB,{dimensions:R,lineWidth:i,variant:t,className:h})}),m.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}$T.displayName="Background";const UB=j.memo($T);function HB(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:m.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function WB(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:m.jsx("path",{d:"M0 0h32v4.2H0z"})})}function KB(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:m.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 GB(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.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 YB(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.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 cu({children:e,className:t,...n}){return m.jsx("button",{type:"button",className:pt(["react-flow__controls-button",t]),...n,children:e})}const XB=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function FT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:a,onFitView:c,onInteractiveChange:u,className:f,children:h,position:p="bottom-left",orientation:g="vertical","aria-label":v}){const b=Qe(),{isInteractive:x,minZoomReached:w,maxZoomReached:S,ariaLabelConfig:N}=De(XB,Xe),{zoomIn:k,zoomOut:E,fitView:R}=mo(),T=()=>{k(),o==null||o()},A=()=>{E(),a==null||a()},O=()=>{R(i),c==null||c()},L=()=>{b.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)},B=g==="horizontal"?"horizontal":"vertical";return m.jsxs(Ef,{className:pt(["react-flow__controls",B,f]),position:p,style:e,"data-testid":"rf__controls","aria-label":v??N["controls.ariaLabel"],children:[t&&m.jsxs(m.Fragment,{children:[m.jsx(cu,{onClick:T,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:S,children:m.jsx(HB,{})}),m.jsx(cu,{onClick:A,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:w,children:m.jsx(WB,{})})]}),n&&m.jsx(cu,{className:"react-flow__controls-fitview",onClick:O,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:m.jsx(KB,{})}),r&&m.jsx(cu,{className:"react-flow__controls-interactive",onClick:L,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:x?m.jsx(YB,{}):m.jsx(GB,{})}),h]})}FT.displayName="Controls";const QB=j.memo(FT);function JB({id:e,x:t,y:n,width:r,height:i,style:o,color:a,strokeColor:c,strokeWidth:u,className:f,borderRadius:h,shapeRendering:p,selected:g,onClick:v}){const{background:b,backgroundColor:x}=o||{},w=a||b||x;return m.jsx("rect",{className:pt(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:h,ry:h,width:r,height:i,style:{fill:w,stroke:c,strokeWidth:u},shapeRendering:p,onClick:v?S=>v(S,e):void 0})}const ZB=j.memo(JB),ez=e=>e.nodes.map(t=>t.id),Sp=e=>e instanceof Function?e:()=>e;function tz({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=ZB,onClick:a}){const c=De(ez,Xe),u=Sp(t),f=Sp(e),h=Sp(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return m.jsx(m.Fragment,{children:c.map(g=>m.jsx(rz,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:a,shapeRendering:p},g))})}function nz({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:a,NodeComponent:c,onClick:u}){const{node:f,x:h,y:p,width:g,height:v}=De(b=>{const{internals:x}=b.nodeLookup.get(e),w=x.userNode,{x:S,y:N}=x.positionAbsolute,{width:k,height:E}=Mr(w);return{node:w,x:S,y:N,width:k,height:E}},Xe);return!f||f.hidden||!$A(f)?null:m.jsx(c,{x:h,y:p,width:g,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:i,strokeColor:n(f),strokeWidth:o,shapeRendering:a,onClick:u,id:f.id})}const rz=j.memo(nz);var iz=j.memo(tz);const sz=200,oz=150,az=e=>!e.hidden,lz=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?qA(gl(e.nodeLookup,{filter:az}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},cz="react-flow__minimap-desc";function BT({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:u,maskColor:f,maskStrokeColor:h,maskStrokeWidth:p,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:x=!1,zoomable:w=!1,ariaLabel:S,inversePan:N,zoomStep:k=1,offsetScale:E=5}){const R=Qe(),T=j.useRef(null),{boundingRect:A,viewBB:O,rfId:L,panZoom:B,translateExtent:I,flowWidth:q,flowHeight:U,ariaLabelConfig:D}=De(lz,Xe),V=(e==null?void 0:e.width)??sz,z=(e==null?void 0:e.height)??oz,Q=A.width/V,F=A.height/z,$=Math.max(Q,F),Y=$*V,P=$*z,W=E*$,se=A.x-(Y-A.width)/2-W,K=A.y-(P-A.height)/2-W,J=Y+W*2,G=P+W*2,ee=`${cz}-${L}`,te=j.useRef(0),oe=j.useRef();te.current=$,j.useEffect(()=>{if(T.current&&B)return oe.current=N$({domNode:T.current,panZoom:B,getTransform:()=>R.getState().transform,getViewScale:()=>te.current}),()=>{var de;(de=oe.current)==null||de.destroy()}},[B]),j.useEffect(()=>{var de;(de=oe.current)==null||de.update({translateExtent:I,width:q,height:U,inversePan:N,pannable:x,zoomStep:k,zoomable:w})},[x,w,N,k,I,q,U]);const fe=v?de=>{var Ne;const[_e,ve]=((Ne=oe.current)==null?void 0:Ne.pointer(de))||[0,0];v(de,{x:_e,y:ve})}:void 0,he=b?j.useCallback((de,_e)=>{const ve=R.getState().nodeLookup.get(_e).internals.userNode;b(de,ve)},[]):void 0,me=S??D["minimap.ariaLabel"];return m.jsx(Ef,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*$: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:pt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:m.jsxs("svg",{width:V,height:z,viewBox:`${se} ${K} ${J} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ee,ref:T,onClick:fe,children:[me&&m.jsx("title",{id:ee,children:me}),m.jsx(iz,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:c}),m.jsx("path",{className:"react-flow__minimap-mask",d:`M${se-W},${K-W}h${J+W*2}v${G+W*2}h${-J-W*2}z
62
- M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}BT.displayName="MiniMap";const uz=j.memo(BT),fz=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,dz={[co.Line]:"right",[co.Handle]:"bottom-right"};function hz({nodeId:e,position:t,variant:n=co.Handle,className:r,style:i=void 0,children:o,color:a,minWidth:c=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:x,onResize:w,onResizeEnd:S}){const N=vT(),k=typeof e=="string"?e:N,E=Qe(),R=j.useRef(null),T=n===co.Handle,A=De(j.useCallback(fz(T&&v),[T,v]),Xe),O=j.useRef(null),L=t??dz[n];j.useEffect(()=>{if(!(!R.current||!k))return O.current||(O.current=F$({domNode:R.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:I,transform:q,snapGrid:U,snapToGrid:D,nodeOrigin:V,domNode:z}=E.getState();return{nodeLookup:I,transform:q,snapGrid:U,snapToGrid:D,nodeOrigin:V,paneDomNode:z}},onChange:(I,q)=>{const{triggerNodeChanges:U,nodeLookup:D,parentLookup:V,nodeOrigin:z}=E.getState(),Q=[],F={x:I.x,y:I.y},$=D.get(k);if($&&$.expandParent&&$.parentId){const Y=$.origin??z,P=I.width??$.measured.width??0,W=I.height??$.measured.height??0,se={id:$.id,parentId:$.parentId,rect:{width:P,height:W,...FA({x:I.x??$.position.x,y:I.y??$.position.y},{width:P,height:W},$.parentId,D,Y)}},K=xw([se],D,V,z);Q.push(...K),F.x=I.x?Math.max(Y[0]*P,I.x):void 0,F.y=I.y?Math.max(Y[1]*W,I.y):void 0}if(F.x!==void 0&&F.y!==void 0){const Y={id:k,type:"position",position:{...F}};Q.push(Y)}if(I.width!==void 0&&I.height!==void 0){const P={id:k,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};Q.push(P)}for(const Y of q){const P={...Y,type:"position"};Q.push(P)}U(Q)},onEnd:({width:I,height:q})=>{const U={id:k,type:"dimensions",resizing:!1,dimensions:{width:I,height:q}};E.getState().triggerNodeChanges([U])}})),O.current.update({controlPosition:L,boundaries:{minWidth:c,minHeight:u,maxWidth:f,maxHeight:h},keepAspectRatio:p,resizeDirection:g,onResizeStart:x,onResize:w,onResizeEnd:S,shouldResize:b}),()=>{var I;(I=O.current)==null||I.destroy()}},[L,c,u,f,h,p,x,w,S,b]);const B=L.split("-");return m.jsx("div",{className:pt(["react-flow__resize-control","nodrag",...B,n,r]),ref:R,style:{...i,scale:A,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:o})}j.memo(hz);/**
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 pz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zT=(...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 mz={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 gz=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...c},u)=>j.createElement("svg",{ref:u,...mz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zT("lucide",i),...c},[...a.map(([f,h])=>j.createElement(f,h)),...Array.isArray(o)?o:[o]]));/**
78
- * @license lucide-react v0.468.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const ge=(e,t)=>{const n=j.forwardRef(({className:r,...i},o)=>j.createElement(gz,{ref:o,iconNode:t,className:zT(`lucide-${pz(e)}`,r),...i}));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 yz=ge("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
88
- * @license lucide-react v0.468.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const ef=ge("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
93
- * @license lucide-react v0.468.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
97
- */const vz=ge("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
98
- * @license lucide-react v0.468.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */const kp=ge("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
103
- * @license lucide-react v0.468.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */const Ek=ge("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
108
- * @license lucide-react v0.468.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */const Rx=ge("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
113
- * @license lucide-react v0.468.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const el=ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
118
- * @license lucide-react v0.468.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const tl=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
123
- * @license lucide-react v0.468.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const xz=ge("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
128
- * @license lucide-react v0.468.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const xn=ge("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
133
- * @license lucide-react v0.468.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const wz=ge("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
138
- * @license lucide-react v0.468.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const _w=ge("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
143
- * @license lucide-react v0.468.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const go=ge("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
148
- * @license lucide-react v0.468.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const bz=ge("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
153
- * @license lucide-react v0.468.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const Gi=ge("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
158
- * @license lucide-react v0.468.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const Ax=ge("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
163
- * @license lucide-react v0.468.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const _z=ge("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
168
- * @license lucide-react v0.468.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const jf=ge("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
173
- * @license lucide-react v0.468.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const Sw=ge("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
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 nl=ge("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"}]]);/**
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 Sz=ge("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"}]]);/**
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 kz=ge("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"}]]);/**
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 Ez=ge("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"}]]);/**
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 Nz=ge("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"}]]);/**
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 Tx=ge("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"}]]);/**
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 Cz=ge("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
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 jz=ge("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"}]]);/**
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 tf=ge("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"}]]);/**
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 VT=ge("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
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 Rz=ge("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"}]]);/**
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 Az=ge("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"}]]);/**
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=ge("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"}]]);/**
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 kw=ge("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"}]]);/**
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=ge("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"}]]);/**
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 Iz=ge("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"}]]);/**
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 yo=ge("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 Oz=ge("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"}]]);/**
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 Pz=ge("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"}]]);/**
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 Lz=ge("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"}]]);/**
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 Dz=ge("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
283
- * @license lucide-react v0.468.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const qz=ge("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"}]]);/**
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 $z=ge("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 Fz=ge("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
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 Bz=ge("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"}]]);/**
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 UT=ge("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"}]]);/**
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 xl=ge("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 Rf=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 zz=ge("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"}]]);/**
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 Vz=ge("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"}]]);/**
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 Uz=ge("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"}]]);/**
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 Mx=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 Hz=ge("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"}]]);/**
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 Ew=ge("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"}]]);/**
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 HT=ge("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
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 Wz=ge("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"}]]);/**
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 Kz=ge("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"}]]);/**
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 WT=ge("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 Gz=ge("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"}]]);/**
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 vo=ge("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"}]]);/**
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 Yz=ge("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"}]]);/**
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 Xz=ge("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"}]]);/**
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 Qz=ge("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"}]]);/**
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 Af=ge("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"}]]);/**
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 Jz=ge("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"}]]);/**
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 wl=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 nf=ge("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"}]]);/**
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 Zz=ge("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"}]]);/**
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 e8=ge("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"}]]),Nk=e=>{let t;const n=new Set,r=(f,h)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const g=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(v=>v(t,g))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=t=e(r,i,c);return c},t8=(e=>e?Nk(e):Nk),n8=e=>e;function r8(e,t=n8){const n=dt.useSyncExternalStore(e.subscribe,dt.useCallback(()=>t(e.getState()),[e,t]),dt.useCallback(()=>t(e.getInitialState()),[e,t]));return dt.useDebugValue(n),n}const Ck=e=>{const t=t8(e),n=r=>r8(t,r);return Object.assign(n,t),n},vi=(e=>e?Ck(e):Ck),i8=[{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"}}],s8=[{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"}],uo=vi((e,t)=>({nodes:i8,edges:s8,past:[],future:[],maxHistorySize:50,clipboard:null,onNodesChange:n=>{n.some(i=>i.type!=="position"&&i.type!=="select"&&i.type!=="dimensions")&&t().saveCheckpoint(),e({nodes:dT(n,t().nodes)})},onEdgesChange:n=>{n.some(i=>i.type!=="select")&&t().saveCheckpoint(),e({edges:hT(n,t().edges)})},onConnect:n=>{t().saveCheckpoint(),e({edges:KA({...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(i=>i.id===n?{...i,data:{...i.data,...r}}:i),future:[]})},clearCanvas:()=>{t().saveCheckpoint(),e({nodes:[],edges:[],future:[]})},saveCheckpoint:()=>{const{nodes:n,edges:r,past:i,maxHistorySize:o}=t();if(i.length>0){const u=i[i.length-1];if(JSON.stringify(u.nodes)===JSON.stringify(n)&&JSON.stringify(u.edges)===JSON.stringify(r))return}const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=[...i,a];c.length>o&&c.shift(),e({past:c})},undo:()=>{const{nodes:n,edges:r,past:i,future:o}=t();if(i.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=i[i.length-1],u=i.slice(0,-1);e({nodes:c.nodes,edges:c.edges,past:u,future:[a,...o]})},redo:()=>{const{nodes:n,edges:r,past:i,future:o}=t();if(o.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=o[0],u=o.slice(1);e({nodes:c.nodes,edges:c.edges,past:[...i,a],future:u})},canUndo:()=>t().past.length>0,canRedo:()=>t().future.length>0,copySelected:()=>{const{nodes:n}=t(),r=n.filter(u=>u.selected);if(r.length===0)return;const i=new Set(r.map(u=>u.id)),{edges:o}=t(),a=o.filter(u=>i.has(u.source)&&i.has(u.target)),c={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(a))};e({clipboard:c})},paste:(n={x:50,y:50})=>{const{clipboard:r,nodes:i,edges:o}=t();if(!r||r.nodes.length===0)return;t().saveCheckpoint();const a=new Map,c=Date.now().toString(36),u=r.nodes.map((p,g)=>{const v=`${p.id.split("-copy")[0]}-copy-${c}-${g}`;return a.set(p.id,v),{...p,id:v,position:{x:p.position.x+n.x,y:p.position.y+n.y},selected:!0,data:{...p.data,id:v}}}),f=r.edges.map((p,g)=>({...p,id:`${p.id.split("-copy")[0]}-copy-${c}-${g}`,source:a.get(p.source)||p.source,target:a.get(p.target)||p.target})),h=i.map(p=>({...p,selected:!1}));e({nodes:[...h,...u],edges:[...o,...f],future:[]})},canPaste:()=>{const{clipboard:n}=t();return n!==null&&n.nodes.length>0}})),Ep=[{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"}],jk={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"}]},pi=vi((e,t)=>({workflows:Ep,selectedWorkflow:Ep[0].path,currentWorkflow:jk,isLoading:!1,error:null,loadWorkflows:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/workflows");if(!n.ok)throw new Error("Failed to load workflows");const r=await n.json();e({workflows:r.workflows,isLoading:!1})}catch{e({workflows:Ep,isLoading:!1})}},selectWorkflow:n=>{e({selectedWorkflow:n}),t().loadWorkflow(n)},loadWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch(`/api/workflows/${encodeURIComponent(n)}`);if(!r.ok)throw new Error("Failed to load workflow");const i=await r.json();e({currentWorkflow:i.workflow,isLoading:!1})}catch{e({currentWorkflow:jk,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 i=await r.json(),o=[...t().workflows,i.workflow];e({workflows:o,selectedWorkflow:i.workflow.path,isLoading:!1}),t().loadWorkflow(i.workflow.path)}catch{e({error:"Failed to create workflow",isLoading:!1})}},deleteWorkflow:async n=>{var r;e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(n)}`,{method:"DELETE"})).ok)throw new Error("Failed to delete workflow");const o=t().workflows.filter(a=>a.path!==n);e({workflows:o,selectedWorkflow:((r=o[0])==null?void 0:r.path)||null,isLoading:!1})}catch{e({error:"Failed to delete workflow",isLoading:!1})}}})),o8={slack:qz,github:Rz,jira:_z,gmail:Oz,outlook:Rx,linear:Yz,notion:Tx,discord:Dz,airtable:Sz,confluence:Tx,http:Tz,claude:kp,opencode:kp,ollama:kp,webhook:nf,schedule:Rx,trigger:nf};function Ix(e){const t=e.toLowerCase().split(".")[0];return o8[t]||bz}function a8({data:e,selected:t}){var f,h;const n=((f=e.action)==null?void 0:f.split(".")[0])||"unknown",r=((h=e.action)==null?void 0:h.split(".").slice(1).join("."))||e.action,i=Ix(n),o={pending:{icon:jf,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:xl,color:"text-warning",bgColor:"bg-warning/10",animate:!0},completed:{icon:go,color:"text-success",bgColor:"bg-success/10"},failed:{icon:Gi,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:_w,color:"text-gray-500",bgColor:"bg-gray-500/10"}},a=e.status||"pending",c=o[a],u=c.icon;return m.jsxs("div",{className:`step-node p-0 ${t?"selected":""} ${a==="running"?"running":""} ${a==="completed"?"completed":""} ${a==="failed"?"failed":""}`,children:[m.jsx(or,{type:"target",position:ke.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),m.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border",children:[m.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:m.jsx(i,{className:"w-5 h-5 text-primary"})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),m.jsx("div",{className:"text-xs text-gray-400 truncate",children:n})]}),m.jsx("div",{className:`w-6 h-6 rounded-full ${c.bgColor} flex items-center justify-center`,children:m.jsx(u,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-pulse":""}`})})]}),m.jsxs("div",{className:"p-3",children:[m.jsx("div",{className:"text-xs text-gray-300 font-mono truncate",children:r}),e.retryCount&&e.retryCount>0&&m.jsxs("div",{className:"mt-2 text-xs text-warning",children:["Retry #",e.retryCount]}),e.error&&m.jsx("div",{className:"mt-2 text-xs text-error truncate",children:e.error})]}),m.jsx(or,{type:"source",position:ke.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const l8=j.memo(a8),Nw=vi((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 c8({data:e,selected:t}){const[n,r]=j.useState(!1),{pushWorkflow:i,breadcrumbs:o,setRootWorkflow:a}=Nw(),{loadWorkflow:c,selectedWorkflow:u,currentWorkflow:f}=pi(),h=j.useCallback(()=>{var v;o.length===0&&u&&f&&a({id:u,name:((v=f.metadata)==null?void 0:v.name)||"Main Workflow",path:u}),i({id:e.id,name:e.name||e.id,path:e.workflowPath}),c(e.workflowPath)},[e,i,o,a,u,f,c]),p={pending:"border-node-border",running:"border-warning",completed:"border-success",failed:"border-error"},g=e.status||"pending";return m.jsxs("div",{className:`step-node p-0 min-w-[250px] ${t?"selected":""} ${p[g]}`,children:[m.jsx(or,{type:"target",position:ke.Top,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"}),m.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border bg-info/5",children:[m.jsx("button",{onClick:()=>r(!n),className:"w-6 h-6 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:n?m.jsx(tl,{className:"w-4 h-4 text-info"}):m.jsx(xn,{className:"w-4 h-4 text-info"})}),m.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/10 flex items-center justify-center",children:m.jsx(tf,{className:"w-5 h-5 text-info"})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||e.id}),m.jsx("div",{className:"text-xs text-gray-400",children:"Sub-workflow"})]}),m.jsx("button",{onClick:h,className:"w-6 h-6 rounded flex items-center justify-center hover:bg-info/20 transition-colors",title:"Drill into sub-workflow",children:m.jsx(ef,{className:"w-4 h-4 text-info"})})]}),m.jsxs("div",{className:"p-3",children:[m.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",children:e.workflowPath}),e.stepCount!==void 0&&m.jsx("div",{className:"mt-2 flex items-center gap-2",children:m.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-info/10 text-info",children:[e.stepCount," steps"]})})]}),n&&m.jsx("div",{className:"border-t border-node-border p-3 bg-black/20",children:m.jsxs("button",{onClick:h,className:"w-full flex items-center justify-center gap-2 px-3 py-2 bg-info/10 hover:bg-info/20 rounded text-sm text-info transition-colors",children:[m.jsx(tf,{className:"w-4 h-4"}),"Open Sub-workflow",m.jsx(ef,{className:"w-4 h-4"})]})}),m.jsx(or,{type:"source",position:ke.Bottom,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"})]})}const u8=j.memo(c8),Rk={manual:{icon:xl,color:"text-primary",bgColor:"bg-primary/10",borderColor:"border-primary",label:"Manual Trigger"},schedule:{icon:Rx,color:"text-info",bgColor:"bg-info/10",borderColor:"border-info",label:"Schedule"},webhook:{icon:Jz,color:"text-success",bgColor:"bg-success/10",borderColor:"border-success",label:"Webhook"},file:{icon:tf,color:"text-warning",bgColor:"bg-warning/10",borderColor:"border-warning",label:"File Watcher"},event:{icon:nf,color:"text-purple-400",bgColor:"bg-purple-400/10",borderColor:"border-purple-400",label:"Event"}};function f8({data:e,selected:t}){const n=Rk[e.type]||Rk.manual,r=n.icon,i=()=>{var o;switch(e.type){case"schedule":return e.cron||"No schedule set";case"webhook":return`${e.method||"POST"} ${e.path||"/webhook"}`;case"file":return e.pattern||"**/*";case"event":return((o=e.events)==null?void 0:o.join(", "))||"No events";default:return"Click to run"}};return m.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:[m.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[m.jsx("div",{className:`w-8 h-8 rounded-full ${n.bgColor} flex items-center justify-center`,children:m.jsx(r,{className:`w-4 h-4 ${n.color}`})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:n.label}),m.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Trigger"})]}),e.active!==!1&&m.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-pulse",title:"Active"})]}),m.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[m.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:i(),children:i()}),e.lastTriggered&&m.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Last: ",new Date(e.lastTriggered).toLocaleString()]})]}),m.jsx(or,{type:"source",position:ke.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"})]})}const d8=j.memo(f8);function h8({data:e,selected:t}){const n={pending:{icon:jf,color:"text-gray-400",borderColor:"border-gray-500",bgColor:"bg-gray-500/10"},completed:{icon:go,color:"text-success",borderColor:"border-success",bgColor:"bg-success/10"},failed:{icon:Gi,color:"text-error",borderColor:"border-error",bgColor:"bg-error/10"}},r=e.status||"pending",i=n[r],o=i.icon;return m.jsxs("div",{className:`min-w-[160px] rounded-lg border-2 ${i.borderColor} ${i.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[m.jsx(or,{type:"target",position:ke.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"}),m.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[m.jsx("div",{className:`w-8 h-8 rounded-full ${i.bgColor} flex items-center justify-center`,children:m.jsx(jz,{className:`w-4 h-4 ${i.color}`})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Output"}),m.jsx("div",{className:"text-sm font-medium text-white truncate",children:e.name||"Workflow End"})]}),m.jsx(o,{className:`w-4 h-4 ${i.color}`})]}),e.variables&&e.variables.length>0&&m.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[m.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output Variables"}),m.jsx("div",{className:"flex flex-wrap gap-1",children:e.variables.map(a=>m.jsx("code",{className:"px-1.5 py-0.5 bg-white/5 text-primary text-xs rounded",children:a},a))})]}),e.description&&m.jsx("div",{className:"px-3 py-2 border-t border-white/10",children:m.jsx("div",{className:"text-xs text-gray-400",children:e.description})}),r==="completed"&&e.result!==void 0&&m.jsxs("div",{className:"px-3 py-2 border-t border-white/10",children:[m.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Result"}),m.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 p8=j.memo(h8);function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Ak(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cw(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Ak(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Ak(e[i],null)}}}}function Et(...e){return j.useCallback(Cw(...e),e)}function m8(e,t){const n=j.createContext(t),r=o=>{const{children:a,...c}=o,u=j.useMemo(()=>c,Object.values(c));return m.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=j.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Ji(e,t=[]){let n=[];function r(o,a){const c=j.createContext(a),u=n.length;n=[...n,a];const f=p=>{var S;const{scope:g,children:v,...b}=p,x=((S=g==null?void 0:g[e])==null?void 0:S[u])||c,w=j.useMemo(()=>b,Object.values(b));return m.jsx(x.Provider,{value:w,children:v})};f.displayName=o+"Provider";function h(p,g){var x;const v=((x=g==null?void 0:g[e])==null?void 0:x[u])||c,b=j.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,h]}const i=()=>{const o=n.map(a=>j.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return j.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return i.scopeName=e,[r,g8(i,...t)]}function g8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((c,{useScope:u,scopeName:f})=>{const p=u(o)[`__scope${f}`];return{...c,...p}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var mi=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},y8=JR[" useId ".trim().toString()]||(()=>{}),v8=0;function Fa(e){const[t,n]=j.useState(y8());return mi(()=>{n(r=>r??String(v8++))},[e]),t?`radix-${t}`:""}var x8=JR[" useInsertionEffect ".trim().toString()]||mi;function jw({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=w8({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:i;{const h=j.useRef(e!==void 0);j.useEffect(()=>{const p=h.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,r])}const f=j.useCallback(h=>{var p;if(c){const g=b8(h)?h(e):h;g!==e&&((p=a.current)==null||p.call(a,g))}else o(h)},[c,e,o,a]);return[u,f]}function w8({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),i=j.useRef(n),o=j.useRef(t);return x8(()=>{o.current=t},[t]),j.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function b8(e){return typeof e=="function"}function rl(e){const t=_8(e),n=j.forwardRef((r,i)=>{const{children:o,...a}=r,c=j.Children.toArray(o),u=c.find(k8);if(u){const f=u.props.children,h=c.map(p=>p===u?j.Children.count(f)>1?j.Children.only(null):j.isValidElement(f)?f.props.children:null:p);return m.jsx(t,{...a,ref:i,children:j.isValidElement(f)?j.cloneElement(f,void 0,h):null})}return m.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function _8(e){const t=j.forwardRef((n,r)=>{const{children:i,...o}=n;if(j.isValidElement(i)){const a=N8(i),c=E8(o,i.props);return i.type!==j.Fragment&&(c.ref=r?Cw(r,a):a),j.cloneElement(i,c)}return j.Children.count(i)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S8=Symbol("radix.slottable");function k8(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S8}function E8(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const u=o(...c);return i(...c),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function N8(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var C8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=C8.reduce((e,t)=>{const n=rl(`Primitive.${t}`),r=j.forwardRef((i,o)=>{const{asChild:a,...c}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function KT(e,t){e&&ww.flushSync(()=>e.dispatchEvent(t))}function ar(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function j8(e,t=globalThis==null?void 0:globalThis.document){const n=ar(e);j.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var R8="DismissableLayer",Ox="dismissableLayer.update",A8="dismissableLayer.pointerDownOutside",T8="dismissableLayer.focusOutside",Tk,GT=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rw=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,f=j.useContext(GT),[h,p]=j.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=j.useState({}),b=Et(t,A=>p(A)),x=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(w),N=h?x.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,E=N>=S,R=O8(A=>{const O=A.target,L=[...f.branches].some(B=>B.contains(O));!E||L||(i==null||i(A),a==null||a(A),A.defaultPrevented||c==null||c())},g),T=P8(A=>{const O=A.target;[...f.branches].some(B=>B.contains(O))||(o==null||o(A),a==null||a(A),A.defaultPrevented||c==null||c())},g);return j8(A=>{N===f.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&c&&(A.preventDefault(),c()))},g),j.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Tk=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),Mk(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Tk)}},[h,g,n,f]),j.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),Mk())},[h,f]),j.useEffect(()=>{const A=()=>v({});return document.addEventListener(Ox,A),()=>document.removeEventListener(Ox,A)},[]),m.jsx(Je.div,{...u,ref:b,style:{pointerEvents:k?E?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,R.onPointerDownCapture)})});Rw.displayName=R8;var M8="DismissableLayerBranch",I8=j.forwardRef((e,t)=>{const n=j.useContext(GT),r=j.useRef(null),i=Et(t,r);return j.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),m.jsx(Je.div,{...e,ref:i})});I8.displayName=M8;function O8(e,t=globalThis==null?void 0:globalThis.document){const n=ar(e),r=j.useRef(!1),i=j.useRef(()=>{});return j.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){YT(A8,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function P8(e,t=globalThis==null?void 0:globalThis.document){const n=ar(e),r=j.useRef(!1);return j.useEffect(()=>{const i=o=>{o.target&&!r.current&&YT(T8,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Mk(){const e=new CustomEvent(Ox);document.dispatchEvent(e)}function YT(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?KT(i,o):i.dispatchEvent(o)}var Np="focusScope.autoFocusOnMount",Cp="focusScope.autoFocusOnUnmount",Ik={bubbles:!1,cancelable:!0},L8="FocusScope",Aw=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[c,u]=j.useState(null),f=ar(i),h=ar(o),p=j.useRef(null),g=Et(t,x=>u(x)),v=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let x=function(k){if(v.paused||!c)return;const E=k.target;c.contains(E)?p.current=E:li(p.current,{select:!0})},w=function(k){if(v.paused||!c)return;const E=k.relatedTarget;E!==null&&(c.contains(E)||li(p.current,{select:!0}))},S=function(k){if(document.activeElement===document.body)for(const R of k)R.removedNodes.length>0&&li(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",w);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w),N.disconnect()}}},[r,c,v.paused]),j.useEffect(()=>{if(c){Pk.add(v);const x=document.activeElement;if(!c.contains(x)){const S=new CustomEvent(Np,Ik);c.addEventListener(Np,f),c.dispatchEvent(S),S.defaultPrevented||(D8(z8(XT(c)),{select:!0}),document.activeElement===x&&li(c))}return()=>{c.removeEventListener(Np,f),setTimeout(()=>{const S=new CustomEvent(Cp,Ik);c.addEventListener(Cp,h),c.dispatchEvent(S),S.defaultPrevented||li(x??document.body,{select:!0}),c.removeEventListener(Cp,h),Pk.remove(v)},0)}}},[c,f,h,v]);const b=j.useCallback(x=>{if(!n&&!r||v.paused)return;const w=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,S=document.activeElement;if(w&&S){const N=x.currentTarget,[k,E]=q8(N);k&&E?!x.shiftKey&&S===E?(x.preventDefault(),n&&li(k,{select:!0})):x.shiftKey&&S===k&&(x.preventDefault(),n&&li(E,{select:!0})):S===N&&x.preventDefault()}},[n,r,v.paused]);return m.jsx(Je.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Aw.displayName=L8;function D8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(li(r,{select:t}),document.activeElement!==n)return}function q8(e){const t=XT(e),n=Ok(t,e),r=Ok(t.reverse(),e);return[n,r]}function XT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ok(e,t){for(const n of e)if(!$8(n,{upTo:t}))return n}function $8(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 F8(e){return e instanceof HTMLInputElement&&"select"in e}function li(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&F8(e)&&t&&e.select()}}var Pk=B8();function B8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Lk(e,t),e.unshift(t)},remove(t){var n;e=Lk(e,t),(n=e[0])==null||n.resume()}}}function Lk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function z8(e){return e.filter(t=>t.tagName!=="A")}var V8="Portal",Tw=j.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[i,o]=j.useState(!1);mi(()=>o(!0),[]);const a=n||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Z$.createPortal(m.jsx(Je.div,{...r,ref:t}),a):null});Tw.displayName=V8;function U8(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Ir=e=>{const{present:t,children:n}=e,r=H8(t),i=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),o=Et(r.ref,W8(i));return typeof n=="function"||r.isPresent?j.cloneElement(i,{ref:o}):null};Ir.displayName="Presence";function H8(e){const[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),o=j.useRef("none"),a=e?"mounted":"unmounted",[c,u]=U8(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const f=uu(r.current);o.current=c==="mounted"?f:"none"},[c]),mi(()=>{const f=r.current,h=i.current;if(h!==e){const g=o.current,v=uu(f);e?u("MOUNT"):v==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(h&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),mi(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=v=>{const x=uu(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&x&&(u("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=v=>{v.target===t&&(o.current=uu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:j.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function uu(e){return(e==null?void 0:e.animationName)||"none"}function W8(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jp=0;function QT(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dk()),document.body.insertAdjacentElement("beforeend",e[1]??Dk()),jp++,()=>{jp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jp--}},[])}function Dk(){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 er=function(){return er=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},er.apply(this,arguments)};function JT(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function K8(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Iu="right-scroll-bar-position",Ou="width-before-scroll-bar",G8="with-scroll-bars-hidden",Y8="--removed-body-scroll-bar-size";function Rp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function X8(e,t){var n=j.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Q8=typeof window<"u"?j.useLayoutEffect:j.useEffect,qk=new WeakMap;function J8(e,t){var n=X8(null,function(r){return e.forEach(function(i){return Rp(i,r)})});return Q8(function(){var r=qk.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(c){o.has(c)||Rp(c,null)}),o.forEach(function(c){i.has(c)||Rp(c,a)})}qk.set(n,e)},[e]),n}function Z8(e){return e}function e6(e,t){t===void 0&&(t=Z8);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var u=function(){var h=a;a=[],h.forEach(o)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(h){a.push(h),f()},filter:function(h){return a=a.filter(h),n}}}};return i}function t6(e){e===void 0&&(e={});var t=e6(null);return t.options=er({async:!0,ssr:!1},e),t}var ZT=function(e){var t=e.sideCar,n=JT(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,er({},n))};ZT.isSideCarExport=!0;function n6(e,t){return e.useMedium(t),ZT}var eM=t6(),Ap=function(){},Tf=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Ap,onWheelCapture:Ap,onTouchMoveCapture:Ap}),i=r[0],o=r[1],a=e.forwardProps,c=e.children,u=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,x=e.inert,w=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,k=e.gapMode,E=JT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=g,T=J8([n,t]),A=er(er({},E),i);return j.createElement(j.Fragment,null,h&&j.createElement(R,{sideCar:eM,removeScrollBar:f,shards:p,noRelative:v,noIsolation:b,inert:x,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:k}),a?j.cloneElement(j.Children.only(c),er(er({},A),{ref:T})):j.createElement(N,er({},A,{className:u,ref:T}),c))});Tf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Tf.classNames={fullWidth:Ou,zeroRight:Iu};var r6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function i6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=r6();return t&&e.setAttribute("nonce",t),e}function s6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function o6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var a6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=i6())&&(s6(t,n),o6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},l6=function(){var e=a6();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tM=function(){var e=l6(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},c6={left:0,top:0,right:0,gap:0},Tp=function(e){return parseInt(e||"",10)||0},u6=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Tp(n),Tp(r),Tp(i)]},f6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return c6;var t=u6(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])}},d6=tM(),Js="data-scroll-locked",h6=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
423
- .`.concat(G8,` {
424
- overflow: hidden `).concat(r,`;
425
- padding-right: `).concat(c,"px ").concat(r,`;
426
- }
427
- body[`).concat(Js,`] {
428
- overflow: hidden `).concat(r,`;
429
- overscroll-behavior: contain;
430
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
431
- padding-left: `.concat(i,`px;
432
- padding-top: `).concat(o,`px;
433
- padding-right: `).concat(a,`px;
434
- margin-left:0;
435
- margin-top:0;
436
- margin-right: `).concat(c,"px ").concat(r,`;
437
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
438
- }
439
-
440
- .`).concat(Iu,` {
441
- right: `).concat(c,"px ").concat(r,`;
442
- }
443
-
444
- .`).concat(Ou,` {
445
- margin-right: `).concat(c,"px ").concat(r,`;
446
- }
447
-
448
- .`).concat(Iu," .").concat(Iu,` {
449
- right: 0 `).concat(r,`;
450
- }
451
-
452
- .`).concat(Ou," .").concat(Ou,` {
453
- margin-right: 0 `).concat(r,`;
454
- }
455
-
456
- body[`).concat(Js,`] {
457
- `).concat(Y8,": ").concat(c,`px;
458
- }
459
- `)},$k=function(){var e=parseInt(document.body.getAttribute(Js)||"0",10);return isFinite(e)?e:0},p6=function(){j.useEffect(function(){return document.body.setAttribute(Js,($k()+1).toString()),function(){var e=$k()-1;e<=0?document.body.removeAttribute(Js):document.body.setAttribute(Js,e.toString())}},[])},m6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;p6();var o=j.useMemo(function(){return f6(i)},[i]);return j.createElement(d6,{styles:h6(o,!t,i,n?"":"!important")})},Px=!1;if(typeof window<"u")try{var fu=Object.defineProperty({},"passive",{get:function(){return Px=!0,!0}});window.addEventListener("test",fu,fu),window.removeEventListener("test",fu,fu)}catch{Px=!1}var Ds=Px?{passive:!1}:!1,g6=function(e){return e.tagName==="TEXTAREA"},nM=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!g6(e)&&n[t]==="visible")},y6=function(e){return nM(e,"overflowY")},v6=function(e){return nM(e,"overflowX")},Fk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=rM(e,r);if(i){var o=iM(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},x6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},w6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},rM=function(e,t){return e==="v"?y6(t):v6(t)},iM=function(e,t){return e==="v"?x6(t):w6(t)},b6=function(e,t){return e==="h"&&t==="rtl"?-1:1},_6=function(e,t,n,r,i){var o=b6(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),f=!1,h=a>0,p=0,g=0;do{if(!c)break;var v=iM(e,c),b=v[0],x=v[1],w=v[2],S=x-w-o*b;(b||S)&&rM(e,c)&&(p+=S,g+=b);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},du=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bk=function(e){return[e.deltaX,e.deltaY]},zk=function(e){return e&&"current"in e?e.current:e},S6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},k6=function(e){return`
460
- .block-interactivity-`.concat(e,` {pointer-events: none;}
461
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
462
- `)},E6=0,qs=[];function N6(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),i=j.useState(E6++)[0],o=j.useState(tM)[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=K8([e.lockRef.current],(e.shards||[]).map(zk),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=j.useCallback(function(x,w){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var S=du(x),N=n.current,k="deltaX"in x?x.deltaX:N[0]-S[0],E="deltaY"in x?x.deltaY:N[1]-S[1],R,T=x.target,A=Math.abs(k)>Math.abs(E)?"h":"v";if("touches"in x&&A==="h"&&T.type==="range")return!1;var O=window.getSelection(),L=O&&O.anchorNode,B=L?L===T||L.contains(T):!1;if(B)return!1;var I=Fk(A,T);if(!I)return!0;if(I?R=A:(R=A==="v"?"h":"v",I=Fk(A,T)),!I)return!1;if(!r.current&&"changedTouches"in x&&(k||E)&&(r.current=R),!R)return!0;var q=r.current||R;return _6(q,w,x,q==="h"?k:E)},[]),u=j.useCallback(function(x){var w=x;if(!(!qs.length||qs[qs.length-1]!==o)){var S="deltaY"in w?Bk(w):du(w),N=t.current.filter(function(R){return R.name===w.type&&(R.target===w.target||w.target===R.shadowParent)&&S6(R.delta,S)})[0];if(N&&N.should){w.cancelable&&w.preventDefault();return}if(!N){var k=(a.current.shards||[]).map(zk).filter(Boolean).filter(function(R){return R.contains(w.target)}),E=k.length>0?c(w,k[0]):!a.current.noIsolation;E&&w.cancelable&&w.preventDefault()}}},[]),f=j.useCallback(function(x,w,S,N){var k={name:x,delta:w,target:S,should:N,shadowParent:C6(S)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(E){return E!==k})},1)},[]),h=j.useCallback(function(x){n.current=du(x),r.current=void 0},[]),p=j.useCallback(function(x){f(x.type,Bk(x),x.target,c(x,e.lockRef.current))},[]),g=j.useCallback(function(x){f(x.type,du(x),x.target,c(x,e.lockRef.current))},[]);j.useEffect(function(){return qs.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ds),document.addEventListener("touchmove",u,Ds),document.addEventListener("touchstart",h,Ds),function(){qs=qs.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,Ds),document.removeEventListener("touchmove",u,Ds),document.removeEventListener("touchstart",h,Ds)}},[]);var v=e.removeScrollBar,b=e.inert;return j.createElement(j.Fragment,null,b?j.createElement(o,{styles:k6(i)}):null,v?j.createElement(m6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function C6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const j6=n6(eM,N6);var Mw=j.forwardRef(function(e,t){return j.createElement(Tf,er({},e,{ref:t,sideCar:j6}))});Mw.classNames=Tf.classNames;var R6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$s=new WeakMap,hu=new WeakMap,pu={},Mp=0,sM=function(e){return e&&(e.host||sM(e.parentNode))},A6=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sM(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})},T6=function(e,t,n,r){var i=A6(t,Array.isArray(e)?e:[e]);pu[n]||(pu[n]=new WeakMap);var o=pu[n],a=[],c=new Set,u=new Set(i),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};i.forEach(f);var h=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(c.has(g))h(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",x=($s.get(g)||0)+1,w=(o.get(g)||0)+1;$s.set(g,x),o.set(g,w),a.push(g),x===1&&b&&hu.set(g,!0),w===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return h(t),c.clear(),Mp++,function(){a.forEach(function(p){var g=$s.get(p)-1,v=o.get(p)-1;$s.set(p,g),o.set(p,v),g||(hu.has(p)||p.removeAttribute(r),hu.delete(p)),v||p.removeAttribute(n)}),Mp--,Mp||($s=new WeakMap,$s=new WeakMap,hu=new WeakMap,pu={})}},oM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=R6(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),T6(r,i,n,"aria-hidden")):function(){return null}},Mf="Dialog",[aM]=Ji(Mf),[M6,zn]=aM(Mf),lM=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,c=j.useRef(null),u=j.useRef(null),[f,h]=jw({prop:r,defaultProp:i??!1,onChange:o,caller:Mf});return m.jsx(M6,{scope:t,triggerRef:c,contentRef:u,contentId:Fa(),titleId:Fa(),descriptionId:Fa(),open:f,onOpenChange:h,onOpenToggle:j.useCallback(()=>h(p=>!p),[h]),modal:a,children:n})};lM.displayName=Mf;var cM="DialogTrigger",I6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=zn(cM,n),o=Et(t,i.triggerRef);return m.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Pw(i.open),...r,ref:o,onClick:Te(e.onClick,i.onOpenToggle)})});I6.displayName=cM;var Iw="DialogPortal",[O6,uM]=aM(Iw,{forceMount:void 0}),fM=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=zn(Iw,t);return m.jsx(O6,{scope:t,forceMount:n,children:j.Children.map(r,a=>m.jsx(Ir,{present:n||o.open,children:m.jsx(Tw,{asChild:!0,container:i,children:a})}))})};fM.displayName=Iw;var rf="DialogOverlay",dM=j.forwardRef((e,t)=>{const n=uM(rf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=zn(rf,e.__scopeDialog);return o.modal?m.jsx(Ir,{present:r||o.open,children:m.jsx(L6,{...i,ref:t})}):null});dM.displayName=rf;var P6=rl("DialogOverlay.RemoveScroll"),L6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=zn(rf,n);return m.jsx(Mw,{as:P6,allowPinchZoom:!0,shards:[i.contentRef],children:m.jsx(Je.div,{"data-state":Pw(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Yi="DialogContent",hM=j.forwardRef((e,t)=>{const n=uM(Yi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=zn(Yi,e.__scopeDialog);return m.jsx(Ir,{present:r||o.open,children:o.modal?m.jsx(D6,{...i,ref:t}):m.jsx(q6,{...i,ref:t})})});hM.displayName=Yi;var D6=j.forwardRef((e,t)=>{const n=zn(Yi,e.__scopeDialog),r=j.useRef(null),i=Et(t,n.contentRef,r);return j.useEffect(()=>{const o=r.current;if(o)return oM(o)},[]),m.jsx(pM,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault())})}),q6=j.forwardRef((e,t)=>{const n=zn(Yi,e.__scopeDialog),r=j.useRef(!1),i=j.useRef(!1);return m.jsx(pM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,f;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),pM=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,c=zn(Yi,n),u=j.useRef(null),f=Et(t,u);return QT(),m.jsxs(m.Fragment,{children:[m.jsx(Aw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:m.jsx(Rw,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Pw(c.open),...a,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx($6,{titleId:c.titleId}),m.jsx(B6,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Ow="DialogTitle",mM=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=zn(Ow,n);return m.jsx(Je.h2,{id:i.titleId,...r,ref:t})});mM.displayName=Ow;var gM="DialogDescription",yM=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=zn(gM,n);return m.jsx(Je.p,{id:i.descriptionId,...r,ref:t})});yM.displayName=gM;var vM="DialogClose",xM=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=zn(vM,n);return m.jsx(Je.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>i.onOpenChange(!1))})});xM.displayName=vM;function Pw(e){return e?"open":"closed"}var wM="DialogTitleWarning",[nJ,bM]=m8(wM,{contentName:Yi,titleName:Ow,docsSlug:"dialog"}),$6=({titleId:e})=>{const t=bM(wM),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
463
-
464
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
465
-
466
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},F6="DialogDescriptionWarning",B6=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bM(F6).contentName}}.`;return j.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},z6=lM,V6=fM,U6=dM,H6=hM,W6=mM,K6=yM,G6=xM;function _M(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_M(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Y6(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_M(e))&&(r&&(r+=" "),r+=t);return r}const Lw="-",X6=e=>{const t=J6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(Lw);return c[0]===""&&c.length!==1&&c.shift(),SM(c,t)||Q6(a)},getConflictingClassGroupIds:(a,c)=>{const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}}},SM=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?SM(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Lw);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId},Vk=/^\[(.+)\]$/,Q6=e=>{if(Vk.test(e)){const t=Vk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},J6=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return eV(Object.entries(e.classGroups),n).forEach(([o,a])=>{Lx(a,r,o,t)}),r},Lx=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Uk(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Z6(i)){Lx(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Lx(a,Uk(t,o),n,r)})})},Uk=(e,t)=>{let n=e;return t.split(Lw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Z6=e=>e.isThemeGetter,eV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,i]}):e,tV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},kM="!",nV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=c=>{const u=[];let f=0,h=0,p;for(let w=0;w<c.length;w++){let S=c[w];if(f===0){if(S===i&&(r||c.slice(w,w+o)===t)){u.push(c.slice(h,w)),h=w+o;continue}if(S==="/"){p=w;continue}}S==="["?f++:S==="]"&&f--}const g=u.length===0?c:c.substring(h),v=g.startsWith(kM),b=v?g.substring(1):g,x=p&&p>h?p-h:void 0;return{modifiers:u,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:x}};return n?c=>n({className:c,parseClassName:a}):a},rV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},iV=e=>({cache:tV(e.cacheSize),parseClassName:nV(e),...X6(e)}),sV=/\s+/,oV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(sV);let c="";for(let u=a.length-1;u>=0;u-=1){const f=a[u],{modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}=n(f);let b=!!v,x=r(b?g.substring(0,v):g);if(!x){if(!b){c=f+(c.length>0?" "+c:c);continue}if(x=r(g),!x){c=f+(c.length>0?" "+c:c);continue}b=!1}const w=rV(h).join(":"),S=p?w+kM:w,N=S+x;if(o.includes(N))continue;o.push(N);const k=i(x,b);for(let E=0;E<k.length;++E){const R=k[E];o.push(S+R)}c=f+(c.length>0?" "+c:c)}return c};function aV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=EM(t))&&(r&&(r+=" "),r+=n);return r}const EM=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=EM(e[r]))&&(n&&(n+=" "),n+=t);return n};function lV(e,...t){let n,r,i,o=a;function a(u){const f=t.reduce((h,p)=>p(h),e());return n=iV(f),r=n.cache.get,i=n.cache.set,o=c,c(u)}function c(u){const f=r(u);if(f)return f;const h=oV(u,n);return i(u,h),h}return function(){return o(aV.apply(null,arguments))}}const Ke=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},NM=/^\[(?:([a-z-]+):)?(.+)\]$/i,cV=/^\d+\/\d+$/,uV=new Set(["px","full","screen"]),fV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dV=/\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$/,hV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sr=e=>Zs(e)||uV.has(e)||cV.test(e),si=e=>xo(e,"length",SV),Zs=e=>!!e&&!Number.isNaN(Number(e)),Ip=e=>xo(e,"number",Zs),Sa=e=>!!e&&Number.isInteger(Number(e)),gV=e=>e.endsWith("%")&&Zs(e.slice(0,-1)),Ie=e=>NM.test(e),oi=e=>fV.test(e),yV=new Set(["length","size","percentage"]),vV=e=>xo(e,yV,CM),xV=e=>xo(e,"position",CM),wV=new Set(["image","url"]),bV=e=>xo(e,wV,EV),_V=e=>xo(e,"",kV),ka=()=>!0,xo=(e,t,n)=>{const r=NM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},SV=e=>dV.test(e)&&!hV.test(e),CM=()=>!1,kV=e=>pV.test(e),EV=e=>mV.test(e),NV=()=>{const e=Ke("colors"),t=Ke("spacing"),n=Ke("blur"),r=Ke("brightness"),i=Ke("borderColor"),o=Ke("borderRadius"),a=Ke("borderSpacing"),c=Ke("borderWidth"),u=Ke("contrast"),f=Ke("grayscale"),h=Ke("hueRotate"),p=Ke("invert"),g=Ke("gap"),v=Ke("gradientColorStops"),b=Ke("gradientColorStopPositions"),x=Ke("inset"),w=Ke("margin"),S=Ke("opacity"),N=Ke("padding"),k=Ke("saturate"),E=Ke("scale"),R=Ke("sepia"),T=Ke("skew"),A=Ke("space"),O=Ke("translate"),L=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Ie,t],q=()=>[Ie,t],U=()=>["",Sr,si],D=()=>["auto",Zs,Ie],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Ie],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[Zs,Ie];return{cacheSize:500,separator:":",theme:{colors:[ka],spacing:[Sr,si],blur:["none","",oi,Ie],brightness:P(),borderColor:[e],borderRadius:["none","","full",oi,Ie],borderSpacing:q(),borderWidth:U(),contrast:P(),grayscale:$(),hueRotate:P(),invert:$(),gap:q(),gradientColorStops:[e],gradientColorStopPositions:[gV,si],inset:I(),margin:I(),opacity:P(),padding:q(),saturate:P(),scale:P(),sepia:$(),skew:P(),space:q(),translate:q()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}],container:["container"],columns:[{columns:[oi]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),Ie]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Sa,Ie]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ie]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Sa,Ie]}],"grid-cols":[{"grid-cols":[ka]}],"col-start-end":[{col:["auto",{span:["full",Sa,Ie]},Ie]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[ka]}],"row-start-end":[{row:["auto",{span:[Sa,Ie]},Ie]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,t]}],"min-w":[{"min-w":[Ie,t,"min","max","fit"]}],"max-w":[{"max-w":[Ie,t,"none","full","min","max","fit","prose",{screen:[oi]},oi]}],h:[{h:[Ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oi,si]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ip]}],"font-family":[{font:[ka]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ie]}],"line-clamp":[{"line-clamp":["none",Zs,Ip]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Sr,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Sr,si]}],"underline-offset":[{"underline-offset":["auto",Sr,Ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),xV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:z()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Sr,Ie]}],"outline-w":[{outline:[Sr,si]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Sr,si]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oi,_V]}],"shadow-color":[{shadow:[ka]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",oi,Ie]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[k]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ie]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Sa,Ie]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ie]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-mt":[{"scroll-mt":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-ps":[{"scroll-ps":q()}],"scroll-pe":[{"scroll-pe":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Sr,si,Ip]}],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"]}}},CV=lV(NV);function $t(...e){return CV(Y6(e))}const jV={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]"};function bl({open:e,onOpenChange:t,title:n,description:r,children:i,className:o,size:a="md"}){return m.jsx(z6,{open:e,onOpenChange:t,children:m.jsxs(V6,{children:[m.jsx(U6,{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"}),m.jsxs(H6,{className:$t("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",jV[a],o),children:[(n||r)&&m.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-node-border",children:[m.jsxs("div",{children:[n&&m.jsx(W6,{className:"text-lg font-semibold text-white",children:n}),r&&m.jsx(K6,{className:"mt-1 text-sm text-gray-400",children:r})]}),m.jsx(G6,{className:"rounded-full p-1 hover:bg-white/10 transition-colors",children:m.jsx(wl,{className:"w-5 h-5 text-gray-400"})})]}),m.jsx("div",{className:"max-h-[calc(85vh-8rem)] overflow-y-auto",children:i})]})]})})}function If({children:e,className:t}){return m.jsx("div",{className:$t("flex items-center justify-end gap-3 p-4 border-t border-node-border",t),children:e})}const RV={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"},AV={sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},Ge=j.forwardRef(({className:e,variant:t="primary",size:n="md",loading:r,icon:i,disabled:o,children:a,...c},u)=>m.jsxs("button",{ref:u,disabled:o||r,className:$t("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",RV[t],AV[n],e),...c,children:[r?m.jsx(yo,{className:"w-4 h-4 animate-spin"}):i&&m.jsx("span",{className:"flex-shrink-0",children:i}),a]}));Ge.displayName="Button";function jM(e){const t=e+"CollectionProvider",[n,r]=Ji(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:w,children:S}=x,N=dt.useRef(null),k=dt.useRef(new Map).current;return m.jsx(i,{scope:w,itemMap:k,collectionRef:N,children:S})};a.displayName=t;const c=e+"CollectionSlot",u=rl(c),f=dt.forwardRef((x,w)=>{const{scope:S,children:N}=x,k=o(c,S),E=Et(w,k.collectionRef);return m.jsx(u,{ref:E,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=rl(h),v=dt.forwardRef((x,w)=>{const{scope:S,children:N,...k}=x,E=dt.useRef(null),R=Et(w,E),T=o(h,S);return dt.useEffect(()=>(T.itemMap.set(E,{ref:E,...k}),()=>void T.itemMap.delete(E))),m.jsx(g,{[p]:"",ref:R,children:N})});v.displayName=h;function b(x){const w=o(e+"CollectionConsumer",x);return dt.useCallback(()=>{const N=w.collectionRef.current;if(!N)return[];const k=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((T,A)=>k.indexOf(T.ref.current)-k.indexOf(A.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:f,ItemSlot:v},b,r]}var TV=j.createContext(void 0);function Dw(e){const t=j.useContext(TV);return e||t||"ltr"}var Op="rovingFocusGroup.onEntryFocus",MV={bubbles:!1,cancelable:!0},_l="RovingFocusGroup",[Dx,RM,IV]=jM(_l),[OV,Of]=Ji(_l,[IV]),[PV,LV]=OV(_l),AM=j.forwardRef((e,t)=>m.jsx(Dx.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Dx.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(DV,{...e,ref:t})})}));AM.displayName=_l;var DV=j.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,g=j.useRef(null),v=Et(t,g),b=Dw(o),[x,w]=jw({prop:a,defaultProp:c??null,onChange:u,caller:_l}),[S,N]=j.useState(!1),k=ar(f),E=RM(n),R=j.useRef(!1),[T,A]=j.useState(0);return j.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(Op,k),()=>O.removeEventListener(Op,k)},[k]),m.jsx(PV,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:x,onItemFocus:j.useCallback(O=>w(O),[w]),onItemShiftTab:j.useCallback(()=>N(!0),[]),onFocusableItemAdd:j.useCallback(()=>A(O=>O+1),[]),onFocusableItemRemove:j.useCallback(()=>A(O=>O-1),[]),children:m.jsx(Je.div,{tabIndex:S||T===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{R.current=!0}),onFocus:Te(e.onFocus,O=>{const L=!R.current;if(O.target===O.currentTarget&&L&&!S){const B=new CustomEvent(Op,MV);if(O.currentTarget.dispatchEvent(B),!B.defaultPrevented){const I=E().filter(z=>z.focusable),q=I.find(z=>z.active),U=I.find(z=>z.id===x),V=[q,U,...I].filter(Boolean).map(z=>z.ref.current);IM(V,h)}}R.current=!1}),onBlur:Te(e.onBlur,()=>N(!1))})})}),TM="RovingFocusGroupItem",MM=j.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...c}=e,u=Fa(),f=o||u,h=LV(TM,n),p=h.currentTabStopId===f,g=RM(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:x}=h;return j.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),m.jsx(Dx.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:m.jsx(Je.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Te(e.onMouseDown,w=>{r?h.onItemFocus(f):w.preventDefault()}),onFocus:Te(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Te(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=FV(w,h.orientation,h.dir);if(S!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=g().filter(E=>E.focusable).map(E=>E.ref.current);if(S==="last")k.reverse();else if(S==="prev"||S==="next"){S==="prev"&&k.reverse();const E=k.indexOf(w.currentTarget);k=h.loop?BV(k,E+1):k.slice(E+1)}setTimeout(()=>IM(k))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:x!=null}):a})})});MM.displayName=TM;var qV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $V(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function FV(e,t,n){const r=$V(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qV[r]}function IM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function BV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OM=AM,PM=MM,Pf="Tabs",[zV]=Ji(Pf,[Of]),LM=Of(),[VV,qw]=zV(Pf),DM=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...f}=e,h=Dw(c),[p,g]=jw({prop:r,onChange:i,defaultProp:o??"",caller:Pf});return m.jsx(VV,{scope:n,baseId:Fa(),value:p,onValueChange:g,orientation:a,dir:h,activationMode:u,children:m.jsx(Je.div,{dir:h,"data-orientation":a,...f,ref:t})})});DM.displayName=Pf;var qM="TabsList",$M=j.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=qw(qM,n),a=LM(n);return m.jsx(OM,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:m.jsx(Je.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});$M.displayName=qM;var FM="TabsTrigger",BM=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=qw(FM,n),c=LM(n),u=UM(a.baseId,r),f=HM(a.baseId,r),h=r===a.value;return m.jsx(PM,{asChild:!0,...c,focusable:!i,active:h,children:m.jsx(Je.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Te(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:Te(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const p=a.activationMode!=="manual";!h&&!i&&p&&a.onValueChange(r)})})})});BM.displayName=FM;var zM="TabsContent",VM=j.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,c=qw(zM,n),u=UM(c.baseId,r),f=HM(c.baseId,r),h=r===c.value,p=j.useRef(h);return j.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),m.jsx(Ir,{present:i||h,children:({present:g})=>m.jsx(Je.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});VM.displayName=zM;function UM(e,t){return`${e}-trigger-${t}`}function HM(e,t){return`${e}-content-${t}`}var UV=DM,WM=$M,KM=BM,GM=VM;const YM=UV,$w=j.forwardRef(({className:e,...t},n)=>m.jsx(WM,{ref:n,className:$t("inline-flex items-center gap-1 border-b border-node-border w-full px-2",e),...t}));$w.displayName=WM.displayName;const Jn=j.forwardRef(({className:e,...t},n)=>m.jsx(KM,{ref:n,className:$t("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}));Jn.displayName=KM.displayName;const Zn=j.forwardRef(({className:e,...t},n)=>m.jsx(GM,{ref:n,className:$t("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",e),...t}));Zn.displayName=GM.displayName;function Hk(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 HV(e){if(Array.isArray(e))return e}function WV(e,t,n){return(t=ZV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,c=[],u=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(u=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(h){f=!0,i=h}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw i}}return c}}function GV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
467
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wk(Object(n),!0).forEach(function(r){WV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YV(e,t){if(e==null)return{};var n,r,i=XV(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function XV(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 QV(e,t){return HV(e)||KV(e,t)||eU(e,t)||GV()}function JV(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 ZV(e){var t=JV(e,"string");return typeof t=="symbol"?t:t+""}function eU(e,t){if(e){if(typeof e=="string")return Hk(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)?Hk(e,t):void 0}}function tU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gk(Object(n),!0).forEach(function(r){tU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nU(){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(i,o){return o(i)},r)}}function Ra(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(i,c))}}}function sf(e){return{}.toString.call(e).includes("Object")}function rU(e){return!Object.keys(e).length}function il(e){return typeof e=="function"}function iU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sU(e,t){return sf(t)||fi("changeType"),Object.keys(t).some(function(n){return!iU(e,n)})&&fi("changeField"),t}function oU(e){il(e)||fi("selectorType")}function aU(e){il(e)||sf(e)||fi("handlerType"),sf(e)&&Object.values(e).some(function(t){return!il(t)})&&fi("handlersType")}function lU(e){e||fi("initialIsRequired"),sf(e)||fi("initialType"),rU(e)&&fi("initialContent")}function cU(e,t){throw new Error(e[t]||e.default)}var uU={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"},fi=Ra(cU)(uU),mu={changes:sU,selector:oU,handler:aU,initial:lU};function fU(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};mu.initial(e),mu.handler(t);var n={current:e},r=Ra(pU)(n,t),i=Ra(hU)(n),o=Ra(mu.changes)(e),a=Ra(dU)(n);function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(h){return h};return mu.selector(f),f(n.current)}function u(f){nU(r,i,o,a)(f)}return[c,u]}function dU(e,t){return il(t)?t(e.current):t}function hU(e,t){return e.current=Yk(Yk({},e.current),t),t}function pU(e,t,n){return il(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var mU={create:fU},gU={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function yU(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return t.apply(n,[].concat(i,c))}}}function vU(e){return{}.toString.call(e).includes("Object")}function xU(e){return e||Xk("configIsRequired"),vU(e)||Xk("configType"),e.urls?(wU(),{paths:{vs:e.urls.monacoBase}}):e}function wU(){console.warn(XM.deprecation)}function bU(e,t){throw new Error(e[t]||e.default)}var XM={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!
468
- You are using deprecated way of configuration.
469
-
470
- Instead of using
471
- monaco.config({ urls: { monacoBase: '...' } })
472
- use
473
- monaco.config({ paths: { vs: '...' } })
474
-
475
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
476
- `},Xk=yU(bU)(XM),_U={config:xU},SU=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,a){return a(o)},i)}};function QM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],QM(e[n],t[n]))}),Kk(Kk({},e),t)}var kU={type:"cancelation",msg:"operation is manually canceled"};function Pp(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(kU):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var EU=["monaco"],NU=mU.create({config:gU,isInitialized:!1,resolve:null,reject:null,monaco:null}),JM=QV(NU,2),Sl=JM[0],Lf=JM[1];function CU(e){var t=_U.config(e),n=t.monaco,r=YV(t,EU);Lf(function(i){return{config:QM(i.config,r),monaco:n}})}function jU(){var e=Sl(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(Lf({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Pp(Lp);if(window.monaco&&window.monaco.editor)return ZM(window.monaco),e.resolve(window.monaco),Pp(Lp);SU(RU,TU)(MU)}return Pp(Lp)}function RU(e){return document.body.appendChild(e)}function AU(e){var t=document.createElement("script");return e&&(t.src=e),t}function TU(e){var t=Sl(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=AU("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function MU(){var e=Sl(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;ZM(r),e.resolve(r)},function(n){e.reject(n)})}function ZM(e){Sl().monaco||Lf({monaco:e})}function IU(){return Sl(function(e){var t=e.monaco;return t})}var Lp=new Promise(function(e,t){return Lf({resolve:e,reject:t})}),eI={config:CU,init:jU,__getMonacoInstance:IU},OU={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Dp=OU,PU={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},LU=PU;function DU({children:e}){return dt.createElement("div",{style:LU.container},e)}var qU=DU,$U=qU;function FU({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return dt.createElement("section",{style:{...Dp.wrapper,width:e,height:t},...a},!n&&dt.createElement($U,null,r),dt.createElement("div",{ref:i,style:{...Dp.fullWidth,...!n&&Dp.hide},className:o}))}var BU=FU,tI=j.memo(BU);function zU(e){j.useEffect(e,[])}var nI=zU;function VU(e,t,n=!0){let r=j.useRef(!0);j.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var rn=VU;function Ba(){}function Ws(e,t,n,r){return UU(e,r)||HU(e,t,n,r)}function UU(e,t){return e.editor.getModel(rI(e,t))}function HU(e,t,n,r){return e.editor.createModel(t,n,r?rI(e,r):void 0)}function rI(e,t){return e.Uri.parse(t)}function WU({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:f="light",loading:h="Loading...",options:p={},height:g="100%",width:v="100%",className:b,wrapperProps:x={},beforeMount:w=Ba,onMount:S=Ba}){let[N,k]=j.useState(!1),[E,R]=j.useState(!0),T=j.useRef(null),A=j.useRef(null),O=j.useRef(null),L=j.useRef(S),B=j.useRef(w),I=j.useRef(!1);nI(()=>{let V=eI.init();return V.then(z=>(A.current=z)&&R(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>T.current?D():V.cancel()}),rn(()=>{if(T.current&&A.current){let V=T.current.getOriginalEditor(),z=Ws(A.current,e||"",r||n||"text",o||"");z!==V.getModel()&&V.setModel(z)}},[o],N),rn(()=>{if(T.current&&A.current){let V=T.current.getModifiedEditor(),z=Ws(A.current,t||"",i||n||"text",a||"");z!==V.getModel()&&V.setModel(z)}},[a],N),rn(()=>{let V=T.current.getModifiedEditor();V.getOption(A.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],N),rn(()=>{var V,z;(z=(V=T.current)==null?void 0:V.getModel())==null||z.original.setValue(e||"")},[e],N),rn(()=>{let{original:V,modified:z}=T.current.getModel();A.current.editor.setModelLanguage(V,r||n||"text"),A.current.editor.setModelLanguage(z,i||n||"text")},[n,r,i],N),rn(()=>{var V;(V=A.current)==null||V.editor.setTheme(f)},[f],N),rn(()=>{var V;(V=T.current)==null||V.updateOptions(p)},[p],N);let q=j.useCallback(()=>{var Q;if(!A.current)return;B.current(A.current);let V=Ws(A.current,e||"",r||n||"text",o||""),z=Ws(A.current,t||"",i||n||"text",a||"");(Q=T.current)==null||Q.setModel({original:V,modified:z})},[n,t,i,e,r,o,a]),U=j.useCallback(()=>{var V;!I.current&&O.current&&(T.current=A.current.editor.createDiffEditor(O.current,{automaticLayout:!0,...p}),q(),(V=A.current)==null||V.editor.setTheme(f),k(!0),I.current=!0)},[p,f,q]);j.useEffect(()=>{N&&L.current(T.current,A.current)},[N]),j.useEffect(()=>{!E&&!N&&U()},[E,N,U]);function D(){var z,Q,F,$;let V=(z=T.current)==null?void 0:z.getModel();c||((Q=V==null?void 0:V.original)==null||Q.dispose()),u||((F=V==null?void 0:V.modified)==null||F.dispose()),($=T.current)==null||$.dispose()}return dt.createElement(tI,{width:v,height:g,isEditorReady:N,loading:h,_ref:O,className:b,wrapperProps:x})}var KU=WU;j.memo(KU);function GU(e){let t=j.useRef();return j.useEffect(()=>{t.current=e},[e]),t.current}var YU=GU,gu=new Map;function XU({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:u="Loading...",options:f={},overrideServices:h={},saveViewState:p=!0,keepCurrentModel:g=!1,width:v="100%",height:b="100%",className:x,wrapperProps:w={},beforeMount:S=Ba,onMount:N=Ba,onChange:k,onValidate:E=Ba}){let[R,T]=j.useState(!1),[A,O]=j.useState(!0),L=j.useRef(null),B=j.useRef(null),I=j.useRef(null),q=j.useRef(N),U=j.useRef(S),D=j.useRef(),V=j.useRef(r),z=YU(o),Q=j.useRef(!1),F=j.useRef(!1);nI(()=>{let P=eI.init();return P.then(W=>(L.current=W)&&O(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>B.current?Y():P.cancel()}),rn(()=>{var W,se,K,J;let P=Ws(L.current,e||r||"",t||i||"",o||n||"");P!==((W=B.current)==null?void 0:W.getModel())&&(p&&gu.set(z,(se=B.current)==null?void 0:se.saveViewState()),(K=B.current)==null||K.setModel(P),p&&((J=B.current)==null||J.restoreViewState(gu.get(o))))},[o],R),rn(()=>{var P;(P=B.current)==null||P.updateOptions(f)},[f],R),rn(()=>{!B.current||r===void 0||(B.current.getOption(L.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(F.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),F.current=!1))},[r],R),rn(()=>{var W,se;let P=(W=B.current)==null?void 0:W.getModel();P&&i&&((se=L.current)==null||se.editor.setModelLanguage(P,i))},[i],R),rn(()=>{var P;c!==void 0&&((P=B.current)==null||P.revealLine(c))},[c],R),rn(()=>{var P;(P=L.current)==null||P.editor.setTheme(a)},[a],R);let $=j.useCallback(()=>{var P;if(!(!I.current||!L.current)&&!Q.current){U.current(L.current);let W=o||n,se=Ws(L.current,r||e||"",t||i||"",W||"");B.current=(P=L.current)==null?void 0:P.editor.create(I.current,{model:se,automaticLayout:!0,...f},h),p&&B.current.restoreViewState(gu.get(W)),L.current.editor.setTheme(a),c!==void 0&&B.current.revealLine(c),T(!0),Q.current=!0}},[e,t,n,r,i,o,f,h,p,a,c]);j.useEffect(()=>{R&&q.current(B.current,L.current)},[R]),j.useEffect(()=>{!A&&!R&&$()},[A,R,$]),V.current=r,j.useEffect(()=>{var P,W;R&&k&&((P=D.current)==null||P.dispose(),D.current=(W=B.current)==null?void 0:W.onDidChangeModelContent(se=>{F.current||k(B.current.getValue(),se)}))},[R,k]),j.useEffect(()=>{if(R){let P=L.current.editor.onDidChangeMarkers(W=>{var K;let se=(K=B.current.getModel())==null?void 0:K.uri;if(se&&W.find(J=>J.path===se.path)){let J=L.current.editor.getModelMarkers({resource:se});E==null||E(J)}});return()=>{P==null||P.dispose()}}return()=>{}},[R,E]);function Y(){var P,W;(P=D.current)==null||P.dispose(),g?p&&gu.set(o,B.current.saveViewState()):(W=B.current.getModel())==null||W.dispose(),B.current.dispose()}return dt.createElement(tI,{width:v,height:b,isEditorReady:R,loading:u,_ref:I,className:x,wrapperProps:w})}var QU=XU,JU=j.memo(QU),za=JU;const Fw=Symbol.for("yaml.alias"),qx=Symbol.for("yaml.document"),di=Symbol.for("yaml.map"),iI=Symbol.for("yaml.pair"),lr=Symbol.for("yaml.scalar"),wo=Symbol.for("yaml.seq"),_n=Symbol.for("yaml.node.type"),Zi=e=>!!e&&typeof e=="object"&&e[_n]===Fw,kl=e=>!!e&&typeof e=="object"&&e[_n]===qx,El=e=>!!e&&typeof e=="object"&&e[_n]===di,ut=e=>!!e&&typeof e=="object"&&e[_n]===iI,Ve=e=>!!e&&typeof e=="object"&&e[_n]===lr,Nl=e=>!!e&&typeof e=="object"&&e[_n]===wo;function lt(e){if(e&&typeof e=="object")switch(e[_n]){case di:case wo:return!0}return!1}function ct(e){if(e&&typeof e=="object")switch(e[_n]){case Fw:case di:case lr:case wo:return!0}return!1}const sI=e=>(Ve(e)||lt(e))&&!!e.anchor,qi=Symbol("break visit"),ZU=Symbol("skip children"),Va=Symbol("remove node");function bo(e,t){const n=e9(t);kl(e)?Ks(null,e.contents,n,Object.freeze([e]))===Va&&(e.contents=null):Ks(null,e,n,Object.freeze([]))}bo.BREAK=qi;bo.SKIP=ZU;bo.REMOVE=Va;function Ks(e,t,n,r){const i=t9(e,t,n,r);if(ct(i)||ut(i))return n9(e,r,i),Ks(e,i,n,r);if(typeof i!="symbol"){if(lt(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const a=Ks(o,t.items[o],n,r);if(typeof a=="number")o=a-1;else{if(a===qi)return qi;a===Va&&(t.items.splice(o,1),o-=1)}}}else if(ut(t)){r=Object.freeze(r.concat(t));const o=Ks("key",t.key,n,r);if(o===qi)return qi;o===Va&&(t.key=null);const a=Ks("value",t.value,n,r);if(a===qi)return qi;a===Va&&(t.value=null)}}return i}function e9(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 t9(e,t,n,r){var i,o,a,c,u;if(typeof n=="function")return n(e,t,r);if(El(t))return(i=n.Map)==null?void 0:i.call(n,e,t,r);if(Nl(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,r);if(ut(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,r);if(Ve(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,r);if(Zi(t))return(u=n.Alias)==null?void 0:u.call(n,e,t,r)}function n9(e,t,n){const r=t[t.length-1];if(lt(r))r.items[e]=n;else if(ut(r))e==="key"?r.key=n:r.value=n;else if(kl(r))r.contents=n;else{const i=Zi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const r9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},i9=e=>e.replace(/[!,[\]{}]/g,t=>r9[t]);class Dt{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Dt.defaultYaml,t),this.tags=Object.assign({},Dt.defaultTags,n)}clone(){const t=new Dt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Dt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Dt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Dt.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Dt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Dt.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[o,a]=r;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const a=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,a),!1}}default:return n(0,`Unknown directive ${i}`,!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,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}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+i9(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 i;if(t&&r.length>0&&ct(t.contents)){const o={};bo(t.contents,(a,c)=>{ct(c)&&c.tag&&(o[c.tag]=!0)}),i=Object.keys(o)}else i=[];for(const[o,a]of r)o==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(a)))&&n.push(`%TAG ${o} ${a}`);return n.join(`
477
- `)}}Dt.defaultYaml={explicit:!1,version:"1.2"};Dt.defaultTags={"!!":"tag:yaml.org,2002:"};function oI(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 aI(e){const t=new Set;return bo(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function lI(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function s9(e,t){const n=[],r=new Map;let i=null;return{onAnchor:o=>{n.push(o),i??(i=aI(e));const a=lI(t,i);return i.add(a),a},setAnchors:()=>{for(const o of n){const a=r.get(o);if(typeof a=="object"&&a.anchor&&(Ve(a.node)||lt(a.node)))a.node.anchor=a.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=o,c}}},sourceObjects:r}}function Gs(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){const a=r[i],c=Gs(e,r,String(i),a);c===void 0?delete r[i]:c!==a&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const o=r.get(i),a=Gs(e,r,i,o);a===void 0?r.delete(i):a!==o&&r.set(i,a)}else if(r instanceof Set)for(const i of Array.from(r)){const o=Gs(e,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(const[i,o]of Object.entries(r)){const a=Gs(e,r,i,o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}return e.call(t,n,r)}function wn(e,t,n){if(Array.isArray(e))return e.map((r,i)=>wn(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!sI(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Bw{constructor(t){Object.defineProperty(this,_n,{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:i,reviver:o}={}){if(!kl(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=wn(this,"",a);if(typeof i=="function")for(const{count:u,res:f}of a.anchors.values())i(f,u);return typeof o=="function"?Gs(o,{"":c},"",c):c}}class zw extends Bw{constructor(t){super(Fw),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=[],bo(t,{Node:(o,a)=>{(Zi(a)||sI(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let i;for(const o of r){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:o}=n,a=this.resolve(i,n);if(!a){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let c=r.get(a);if(c||(wn(a,null,n),c=r.get(a)),(c==null?void 0:c.res)===void 0){const u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(o>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Pu(i,a,r)),c.count*c.aliasCount>o)){const u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(oI(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${i} `}return i}}function Pu(e,t,n){if(Zi(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(lt(t)){let r=0;for(const i of t.items){const o=Pu(e,i,n);o>r&&(r=o)}return r}else if(ut(t)){const r=Pu(e,t.key,n),i=Pu(e,t.value,n);return Math.max(r,i)}return 1}const cI=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Bw{constructor(t){super(lr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:wn(this.value,t,n)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const o9="tag:yaml.org,2002:";function a9(e,t,n){if(t){const r=n.filter(o=>o.tag===t),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,e))&&!r.format})}function sl(e,t,n){var p,g,v;if(kl(e)&&(e=e.contents),ct(e))return e;if(ut(e)){const b=(g=(p=n.schema[di]).createNode)==null?void 0:g.call(p,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:a,sourceObjects:c}=n;let u;if(r&&e&&typeof e=="object"){if(u=c.get(e),u)return u.anchor??(u.anchor=i(e)),new zw(u.anchor);u={anchor:null,node:null},c.set(e,u)}t!=null&&t.startsWith("!!")&&(t=o9+t.slice(2));let f=a9(e,t,a.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new Ae(e);return u&&(u.node=b),b}f=e instanceof Map?a[di]:Symbol.iterator in Object(e)?a[wo]:a[di]}o&&(o(f),delete n.onTagObj);const h=f!=null&&f.createNode?f.createNode(n.schema,e,n):typeof((v=f==null?void 0:f.nodeClass)==null?void 0:v.from)=="function"?f.nodeClass.from(n.schema,e,n):new Ae(e);return t?h.tag=t:f.default||(h.tag=f.tag),u&&(u.node=h),h}function of(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const o=t[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const a=[];a[o]=r,r=a}else r=new Map([[o,r]])}return sl(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 Aa=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let uI=class extends Bw{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=>ct(r)||ut(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Aa(t))this.add(n);else{const[r,...i]=t,o=this.get(r,!0);if(lt(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,of(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(lt(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,o=this.get(r,!0);return i.length===0?!n&&Ve(o)?o.value:o:lt(o)?o.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ut(n))return!1;const r=n.value;return r==null||t&&Ve(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 i=this.get(n,!0);return lt(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const o=this.get(r,!0);if(lt(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,of(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};const l9=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Nr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Fi=(e,t,n)=>e.endsWith(`
478
- `)?Nr(n,t):n.includes(`
479
- `)?`
480
- `+Nr(n,t):(e.endsWith(" ")?"":" ")+n,fI="flow",$x="block",Lu="quoted";function Df(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:c}={}){if(!i||i<0)return e;i<o&&(o=0);const u=Math.max(1+o,1+i-t.length);if(e.length<=u)return e;const f=[],h={};let p=i-t.length;typeof r=="number"&&(r>i-Math.max(2,o)?f.push(0):p=i-r);let g,v,b=!1,x=-1,w=-1,S=-1;n===$x&&(x=Qk(e,x,t.length),x!==-1&&(p=x+u));for(let k;k=e[x+=1];){if(n===Lu&&k==="\\"){switch(w=x,e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}S=x}if(k===`
481
- `)n===$x&&(x=Qk(e,x,t.length)),p=x+t.length+u,g=void 0;else{if(k===" "&&v&&v!==" "&&v!==`
482
- `&&v!==" "){const E=e[x+1];E&&E!==" "&&E!==`
483
- `&&E!==" "&&(g=x)}if(x>=p)if(g)f.push(g),p=g+u,g=void 0;else if(n===Lu){for(;v===" "||v===" ";)v=k,k=e[x+=1],b=!0;const E=x>S+1?x-2:w-1;if(h[E])return e;f.push(E),h[E]=!0,p=E+u,g=void 0}else b=!0}v=k}if(b&&c&&c(),f.length===0)return e;a&&a();let N=e.slice(0,f[0]);for(let k=0;k<f.length;++k){const E=f[k],R=f[k+1]||e.length;E===0?N=`
484
- ${t}${e.slice(0,R)}`:(n===Lu&&h[E]&&(N+=`${e[E]}\\`),N+=`
485
- ${t}${e.slice(E+1,R)}`)}return N}function Qk(e,t,n){let r=t,i=t+1,o=e[i];for(;o===" "||o===" ";)if(t<i+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
486
- `);r=t,i=t+1,o=e[i]}return r}const qf=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$f=e=>/^(%|---|\.\.\.)/m.test(e);function c9(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let o=0,a=0;o<i;++o)if(e[o]===`
487
- `){if(o-a>r)return!0;if(a=o+1,i-a<=r)return!1}return!0}function Ua(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||($f(e)?" ":"");let a="",c=0;for(let u=0,f=n[u];f;f=n[++u])if(f===" "&&n[u+1]==="\\"&&n[u+2]==="n"&&(a+=n.slice(c,u)+"\\ ",u+=1,c=u,f="\\"),f==="\\")switch(n[u+1]){case"u":{a+=n.slice(c,u);const h=n.substr(u+2,4);switch(h){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:h.substr(0,2)==="00"?a+="\\x"+h.substr(2):a+=n.substr(u,6)}u+=5,c=u+1}break;case"n":if(r||n[u+2]==='"'||n.length<i)u+=1;else{for(a+=n.slice(c,u)+`
488
-
489
- `;n[u+2]==="\\"&&n[u+3]==="n"&&n[u+4]!=='"';)a+=`
490
- `,u+=2;a+=o,n[u+2]===" "&&(a+="\\"),u+=1,c=u+1}break;default:u+=1}return a=c?a+n.slice(c):n,r?a:Df(a,o,Lu,qf(t,!1))}function Fx(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
491
- `)||/[ \t]\n|\n[ \t]/.test(e))return Ua(e,t);const n=t.indent||($f(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
492
- ${n}`)+"'";return t.implicitKey?r:Df(r,n,fI,qf(t,!1))}function Ys(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Ua;else{const i=e.includes('"'),o=e.includes("'");i&&!o?r=Fx:o&&!i?r=Ua:r=n?Fx:Ua}return r(e,t)}let Bx;try{Bx=new RegExp(`(^|(?<!
493
- ))
494
- +(?!
495
- |$)`,"g")}catch{Bx=/\n+(?!\n|$)/g}function Du({comment:e,type:t,value:n},r,i,o){const{blockQuote:a,commentString:c,lineWidth:u}=r.options;if(!a||/\n[\t ]+$/.test(n))return Ys(n,r);const f=r.indent||(r.forceBlockIndent||$f(n)?" ":""),h=a==="literal"?!0:a==="folded"||t===Ae.BLOCK_FOLDED?!1:t===Ae.BLOCK_LITERAL?!0:!c9(n,u,f.length);if(!n)return h?`|
496
- `:`>
497
- `;let p,g;for(g=n.length;g>0;--g){const R=n[g-1];if(R!==`
498
- `&&R!==" "&&R!==" ")break}let v=n.substring(g);const b=v.indexOf(`
499
- `);b===-1?p="-":n===v||b!==v.length-1?(p="+",o&&o()):p="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
500
- `&&(v=v.slice(0,-1)),v=v.replace(Bx,`$&${f}`));let x=!1,w,S=-1;for(w=0;w<n.length;++w){const R=n[w];if(R===" ")x=!0;else if(R===`
501
- `)S=w;else break}let N=n.substring(0,S<w?S+1:w);N&&(n=n.substring(N.length),N=N.replace(/\n+/g,`$&${f}`));let E=(x?f?"2":"1":"")+p;if(e&&(E+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!h){const R=n.replace(/\n+/g,`
502
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let T=!1;const A=qf(r,!0);a!=="folded"&&t!==Ae.BLOCK_FOLDED&&(A.onOverflow=()=>{T=!0});const O=Df(`${N}${R}${v}`,f,$x,A);if(!T)return`>${E}
503
- ${f}${O}`}return n=n.replace(/\n+/g,`$&${f}`),`|${E}
504
- ${f}${N}${n}${v}`}function u9(e,t,n,r){const{type:i,value:o}=e,{actualString:a,implicitKey:c,indent:u,indentStep:f,inFlow:h}=t;if(c&&o.includes(`
505
- `)||h&&/[[\]{},]/.test(o))return Ys(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||h||!o.includes(`
506
- `)?Ys(o,t):Du(e,t,n,r);if(!c&&!h&&i!==Ae.PLAIN&&o.includes(`
507
- `))return Du(e,t,n,r);if($f(o)){if(u==="")return t.forceBlockIndent=!0,Du(e,t,n,r);if(c&&u===f)return Ys(o,t)}const p=o.replace(/\n+/g,`$&
508
- ${u}`);if(a){const g=x=>{var w;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((w=x.test)==null?void 0:w.test(p))},{compat:v,tags:b}=t.doc.schema;if(b.some(g)||v!=null&&v.some(g))return Ys(o,t)}return c?p:Df(p,u,fI,qf(t,!1))}function Vw(e,t,n,r){const{implicitKey:i,inFlow:o}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=Ae.QUOTE_DOUBLE);const u=h=>{switch(h){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return i||o?Ys(a.value,t):Du(a,t,n,r);case Ae.QUOTE_DOUBLE:return Ua(a.value,t);case Ae.QUOTE_SINGLE:return Fx(a.value,t);case Ae.PLAIN:return u9(a,t,n,r);default:return null}};let f=u(c);if(f===null){const{defaultKeyType:h,defaultStringType:p}=t.options,g=i&&h||p;if(f=u(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function dI(e,t){const n=Object.assign({blockQuote:!0,commentString:l9,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 f9(e,t){var i;if(t.tag){const o=e.filter(a=>a.tag===t.tag);if(o.length>0)return o.find(a=>a.format===t.format)??o[0]}let n,r;if(Ve(t)){r=t.value;let o=e.filter(a=>{var c;return(c=a.identify)==null?void 0:c.call(a,r)});if(o.length>1){const a=o.filter(c=>c.test);a.length>0&&(o=a)}n=o.find(a=>a.format===t.format)??o.find(a=>!a.format)}else r=t,n=e.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!n){const o=((i=r==null?void 0:r.constructor)==null?void 0:i.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return n}function d9(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(Ve(e)||lt(e))&&e.anchor;o&&oI(o)&&(n.add(o),i.push(`&${o}`));const a=e.tag??(t.default?null:t.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}function fo(e,t,n,r){var u;if(ut(e))return e.toString(t,n,r);if(Zi(e)){if(t.doc.directives)return e.toString(t);if((u=t.resolvedAliases)!=null&&u.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const o=ct(e)?e:t.doc.createNode(e,{onTagObj:f=>i=f});i??(i=f9(t.doc.schema.tags,o));const a=d9(o,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const c=typeof i.stringify=="function"?i.stringify(o,t,n,r):Ve(o)?Vw(o,t,n,r):o.toString(t,n,r);return a?Ve(o)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
509
- ${t.indent}${c}`:c}function h9({key:e,value:t},n,r,i){const{allNullValues:o,doc:a,indent:c,indentStep:u,options:{commentString:f,indentSeq:h,simpleKeys:p}}=n;let g=ct(e)&&e.comment||null;if(p){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(lt(e)||!ct(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let v=!p&&(!e||g&&t==null&&!n.inFlow||lt(e)||(Ve(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(p||!o),indent:c+u});let b=!1,x=!1,w=fo(e,n,()=>b=!0,()=>x=!0);if(!v&&!n.inFlow&&w.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(o||t==null)return b&&r&&r(),w===""?"?":v?`? ${w}`:w}else if(o&&!p||t==null&&v)return w=`? ${w}`,g&&!b?w+=Fi(w,n.indent,f(g)):x&&i&&i(),w;b&&(g=null),v?(g&&(w+=Fi(w,n.indent,f(g))),w=`? ${w}
510
- ${c}:`):(w=`${w}:`,g&&(w+=Fi(w,n.indent,f(g))));let S,N,k;ct(t)?(S=!!t.spaceBefore,N=t.commentBefore,k=t.comment):(S=!1,N=null,k=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!v&&!g&&Ve(t)&&(n.indentAtStart=w.length+1),x=!1,!h&&u.length>=2&&!n.inFlow&&!v&&Nl(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let E=!1;const R=fo(t,n,()=>E=!0,()=>x=!0);let T=" ";if(g||S||N){if(T=S?`
511
- `:"",N){const A=f(N);T+=`
512
- ${Nr(A,n.indent)}`}R===""&&!n.inFlow?T===`
513
- `&&k&&(T=`
514
-
515
- `):T+=`
516
- ${n.indent}`}else if(!v&&lt(t)){const A=R[0],O=R.indexOf(`
517
- `),L=O!==-1,B=n.inFlow??t.flow??t.items.length===0;if(L||!B){let I=!1;if(L&&(A==="&"||A==="!")){let q=R.indexOf(" ");A==="&"&&q!==-1&&q<O&&R[q+1]==="!"&&(q=R.indexOf(" ",q+1)),(q===-1||O<q)&&(I=!0)}I||(T=`
518
- ${n.indent}`)}}else(R===""||R[0]===`
519
- `)&&(T="");return w+=T+R,n.inFlow?E&&r&&r():k&&!E?w+=Fi(w,n.indent,f(k)):x&&i&&i(),w}function hI(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const yu="<<",jr={identify:e=>e===yu||typeof e=="symbol"&&e.description===yu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(yu)),{addToJSMap:pI}),stringify:()=>yu},p9=(e,t)=>(jr.identify(t)||Ve(t)&&(!t.type||t.type===Ae.PLAIN)&&jr.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===jr.tag&&n.default));function pI(e,t,n){if(n=e&&Zi(n)?n.resolve(e.doc):n,Nl(n))for(const r of n.items)qp(e,t,r);else if(Array.isArray(n))for(const r of n)qp(e,t,r);else qp(e,t,n)}function qp(e,t,n){const r=e&&Zi(n)?n.resolve(e.doc):n;if(!El(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[o,a]of i)t instanceof Map?t.has(o)||t.set(o,a):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function mI(e,t,{key:n,value:r}){if(ct(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(p9(e,n))pI(e,t,r);else{const i=wn(n,"",e);if(t instanceof Map)t.set(i,wn(r,i,e));else if(t instanceof Set)t.add(i);else{const o=m9(n,i,e),a=wn(r,o,e);o in t?Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[o]=a}}return t}function m9(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ct(e)&&(n!=null&&n.doc)){const r=dI(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),hI(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function Uw(e,t,n){const r=sl(e,void 0,n),i=sl(t,void 0,n);return new qt(r,i)}class qt{constructor(t,n=null){Object.defineProperty(this,_n,{value:iI}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return ct(n)&&(n=n.clone(t)),ct(r)&&(r=r.clone(t)),new qt(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return mI(n,r,this)}toString(t,n,r){return t!=null&&t.doc?h9(this,t,n,r):JSON.stringify(this)}}function gI(e,t,n){return(t.inFlow??e.flow?y9:g9)(e,t,n)}function g9({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:a,onComment:c}){const{indent:u,options:{commentString:f}}=n,h=Object.assign({},n,{indent:o,type:null});let p=!1;const g=[];for(let b=0;b<t.length;++b){const x=t[b];let w=null;if(ct(x))!p&&x.spaceBefore&&g.push(""),af(n,g,x.commentBefore,p),x.comment&&(w=x.comment);else if(ut(x)){const N=ct(x.key)?x.key:null;N&&(!p&&N.spaceBefore&&g.push(""),af(n,g,N.commentBefore,p))}p=!1;let S=fo(x,h,()=>w=null,()=>p=!0);w&&(S+=Fi(S,o,f(w))),p&&w&&(p=!1),g.push(r+S)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let b=1;b<g.length;++b){const x=g[b];v+=x?`
520
- ${u}${x}`:`
521
- `}}return e?(v+=`
522
- `+Nr(f(e),u),c&&c()):p&&a&&a(),v}function y9({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:o,flowCollectionPadding:a,options:{commentString:c}}=t;r+=o;const u=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,h=0;const p=[];for(let b=0;b<e.length;++b){const x=e[b];let w=null;if(ct(x))x.spaceBefore&&p.push(""),af(t,p,x.commentBefore,!1),x.comment&&(w=x.comment);else if(ut(x)){const N=ct(x.key)?x.key:null;N&&(N.spaceBefore&&p.push(""),af(t,p,N.commentBefore,!1),N.comment&&(f=!0));const k=ct(x.value)?x.value:null;k?(k.comment&&(w=k.comment),k.commentBefore&&(f=!0)):x.value==null&&(N!=null&&N.comment)&&(w=N.comment)}w&&(f=!0);let S=fo(x,u,()=>w=null);b<e.length-1&&(S+=","),w&&(S+=Fi(S,r,c(w))),!f&&(p.length>h||S.includes(`
523
- `))&&(f=!0),p.push(S),h=p.length}const{start:g,end:v}=n;if(p.length===0)return g+v;if(!f){const b=p.reduce((x,w)=>x+w.length+2,2);f=t.options.lineWidth>0&&b>t.options.lineWidth}if(f){let b=g;for(const x of p)b+=x?`
524
- ${o}${i}${x}`:`
525
- `;return`${b}
526
- ${i}${v}`}else return`${g}${a}${p.join(" ")}${a}${v}`}function af({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const o=Nr(t(r),e);n.push(o.trimStart())}}function Bi(e,t){const n=Ve(t)?t.value:t;for(const r of e)if(ut(r)&&(r.key===t||r.key===n||Ve(r.key)&&r.key.value===n))return r}class vn extends uI{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(di,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:o}=r,a=new this(t),c=(u,f)=>{if(typeof o=="function")f=o.call(n,u,f);else if(Array.isArray(o)&&!o.includes(u))return;(f!==void 0||i)&&a.items.push(Uw(u,f,r))};if(n instanceof Map)for(const[u,f]of n)c(u,f);else if(n&&typeof n=="object")for(const u of Object.keys(n))c(u,n[u]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;ut(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new qt(t,t==null?void 0:t.value):r=new qt(t.key,t.value);const i=Bi(this.items,r.key),o=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Ve(i.value)&&cI(r.value)?i.value.value=r.value:i.value=r.value}else if(o){const c=this.items.findIndex(u=>o(r,u)<0);c===-1?this.items.push(r):this.items.splice(c,0,r)}else this.items.push(r)}delete(t){const n=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),i=r==null?void 0:r.value;return(!n&&Ve(i)?i.value:i)??void 0}has(t){return!!Bi(this.items,t)}set(t,n){this.add(new qt(t,n),!0)}toJSON(t,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const o of this.items)mI(n,i,o);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!ut(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),gI(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const _o={collection:"map",default:!0,nodeClass:vn,tag:"tag:yaml.org,2002:map",resolve(e,t){return El(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>vn.from(e,t,n)};class Xi extends uI{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(wo,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=vu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=vu(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Ve(i)?i.value:i}has(t){const n=vu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=vu(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Ve(i)&&cI(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let i=0;for(const o of this.items)r.push(wn(o,String(i++),n));return r}toString(t,n,r){return t?gI(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,o=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof i=="function"){const u=n instanceof Set?c:String(a++);c=i.call(n,u,c)}o.items.push(sl(c,void 0,r))}}return o}}function vu(e){let t=Ve(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const So={collection:"seq",default:!0,nodeClass:Xi,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Nl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Xi.from(e,t,n)},Ff={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),Vw(e,t,n,r)}},Bf={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},t)=>typeof e=="string"&&Bf.test.test(e)?e:t.options.nullStr},Hw={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Hw.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 Vn({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let a=o.indexOf(".");a<0&&(a=o.length,o+=".");let c=t-(o.length-a-1);for(;c-- >0;)o+="0"}return o}const yI={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:Vn},vI={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():Vn(e)}},xI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Ae(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Vn},zf=e=>typeof e=="bigint"||Number.isInteger(e),Ww=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function wI(e,t,n){const{value:r}=e;return zf(r)&&r>=0?n+r.toString(t):Vn(e)}const bI={identify:e=>zf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Ww(e,2,8,n),stringify:e=>wI(e,8,"0o")},_I={identify:zf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Ww(e,0,10,n),stringify:Vn},SI={identify:e=>zf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Ww(e,2,16,n),stringify:e=>wI(e,16,"0x")},v9=[_o,So,Ff,Bf,Hw,bI,_I,SI,yI,vI,xI];function Jk(e){return typeof e=="bigint"||Number.isInteger(e)}const xu=({value:e})=>JSON.stringify(e),x9=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:xu},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:xu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:xu},{identify:Jk,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})=>Jk(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:xu}],w9={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},b9=[_o,So].concat(x9,w9),Kw={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 i=0;i<n.length;++i)r[i]=n.charCodeAt(i);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,i,o){if(!n)return"";const a=n;let c;if(typeof btoa=="function"){let u="";for(let f=0;f<a.length;++f)u+=String.fromCharCode(a[f]);c=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Ae.BLOCK_LITERAL),t!==Ae.QUOTE_DOUBLE){const u=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/u),h=new Array(f);for(let p=0,g=0;p<f;++p,g+=u)h[p]=c.substr(g,u);c=h.join(t===Ae.BLOCK_LITERAL?`
527
- `:" ")}return Vw({comment:e,type:t,value:c},r,i,o)}};function kI(e,t){if(Nl(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ut(r)){if(El(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new qt(new Ae(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
528
- ${i.key.commentBefore}`:r.commentBefore),r.comment){const o=i.value??i.key;o.comment=o.comment?`${r.comment}
529
- ${o.comment}`:r.comment}r=i}e.items[n]=ut(r)?r:new qt(r)}}else t("Expected a sequence for this tag");return e}function EI(e,t,n){const{replacer:r}=n,i=new Xi(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(o++),a));let c,u;if(Array.isArray(a))if(a.length===2)c=a[0],u=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const f=Object.keys(a);if(f.length===1)c=f[0],u=a[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=a;i.items.push(Uw(c,u,n))}return i}const Gw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:kI,createNode:EI};class eo extends Xi{constructor(){super(),this.add=vn.prototype.add.bind(this),this.delete=vn.prototype.delete.bind(this),this.get=vn.prototype.get.bind(this),this.has=vn.prototype.has.bind(this),this.set=vn.prototype.set.bind(this),this.tag=eo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let o,a;if(ut(i)?(o=wn(i.key,"",n),a=wn(i.value,o,n)):o=wn(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,a)}return r}static from(t,n,r){const i=EI(t,n,r),o=new this;return o.items=i.items,o}}eo.tag="tag:yaml.org,2002:omap";const Yw={collection:"seq",identify:e=>e instanceof Map,nodeClass:eo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=kI(e,t),r=[];for(const{key:i}of n.items)Ve(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new eo,n)},createNode:(e,t,n)=>eo.from(e,t,n)};function NI({value:e,source:t},n){return t&&(e?CI:jI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const CI={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:NI},jI={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:NI},_9={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:Vn},S9={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():Vn(e)}},k9={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Ae(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Vn},Cl=e=>typeof e=="bigint"||Number.isInteger(e);function Vf(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(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 i==="-"?BigInt(-1)*a:a}const o=parseInt(e,n);return i==="-"?-1*o:o}function Xw(e,t,n){const{value:r}=e;if(Cl(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Vn(e)}const E9={identify:Cl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Vf(e,2,2,n),stringify:e=>Xw(e,2,"0b")},N9={identify:Cl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Vf(e,1,8,n),stringify:e=>Xw(e,8,"0")},C9={identify:Cl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Vf(e,0,10,n),stringify:Vn},j9={identify:Cl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Vf(e,2,16,n),stringify:e=>Xw(e,16,"0x")};class to extends vn{constructor(t){super(t),this.tag=to.tag}add(t){let n;ut(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new qt(t.key,null):n=new qt(t,null),Bi(this.items,n.key)||this.items.push(n)}get(t,n){const r=Bi(this.items,t);return!n&&ut(r)?Ve(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 qt(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:i}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),o.items.push(Uw(a,null,r));return o}}to.tag="tag:yaml.org,2002:set";const Qw={collection:"map",identify:e=>e instanceof Set,nodeClass:to,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>to.from(e,t,n),resolve(e,t){if(El(e)){if(e.hasAllNullValues(!0))return Object.assign(new to,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Jw(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),o=r.replace(/_/g,"").split(":").reduce((a,c)=>a*i(60)+i(c),i(0));return n==="-"?i(-1)*o:o}function RI(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Vn(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),o=[t%i];return t<60?o.unshift(0):(t=(t-o[0])/i,o.unshift(t%i),t>=60&&(t=(t-o[0])/i,o.unshift(t))),r+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const AI={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})=>Jw(e,n),stringify:RI},TI={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=>Jw(e,!1),stringify:RI},Uf={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(Uf.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,a,c]=t.map(Number),u=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,o||0,a||0,c||0,u);const h=t[8];if(h&&h!=="Z"){let p=Jw(h,!1);Math.abs(p)<30&&(p*=60),f-=6e4*p}return new Date(f)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Zk=[_o,So,Ff,Bf,CI,jI,E9,N9,C9,j9,_9,S9,k9,Kw,jr,Yw,Gw,Qw,AI,TI,Uf],eE=new Map([["core",v9],["failsafe",[_o,So,Ff]],["json",b9],["yaml11",Zk],["yaml-1.1",Zk]]),tE={binary:Kw,bool:Hw,float:xI,floatExp:vI,floatNaN:yI,floatTime:TI,int:_I,intHex:SI,intOct:bI,intTime:AI,map:_o,merge:jr,null:Bf,omap:Yw,pairs:Gw,seq:So,set:Qw,timestamp:Uf},R9={"tag:yaml.org,2002:binary":Kw,"tag:yaml.org,2002:merge":jr,"tag:yaml.org,2002:omap":Yw,"tag:yaml.org,2002:pairs":Gw,"tag:yaml.org,2002:set":Qw,"tag:yaml.org,2002:timestamp":Uf};function $p(e,t,n){const r=eE.get(t);if(r&&!e)return n&&!r.includes(jr)?r.concat(jr):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const o=Array.from(eE.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)i=i.concat(o);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(jr)),i.reduce((o,a)=>{const c=typeof a=="string"?tE[a]:a;if(!c){const u=JSON.stringify(a),f=Object.keys(tE).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${f}`)}return o.includes(c)||o.push(c),o},[])}const A9=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Zw{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?$p(t,"compat"):t?$p(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?R9:{},this.tags=$p(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,di,{value:_o}),Object.defineProperty(this,lr,{value:Ff}),Object.defineProperty(this,wo,{value:So}),this.sortMapEntries=typeof a=="function"?a:a===!0?A9:null}clone(){const t=Object.create(Zw.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function T9(e,t){var u;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 i=dI(e,t),{commentString:o}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=o(e.commentBefore);n.unshift(Nr(f,""))}let a=!1,c=null;if(e.contents){if(ct(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=o(e.contents.commentBefore);n.push(Nr(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>a=!0;let h=fo(e.contents,i,()=>c=null,f);c&&(h+=Fi(h,"",o(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(fo(e.contents,i));if((u=e.directives)!=null&&u.docEnd)if(e.comment){const f=o(e.comment);f.includes(`
530
- `)?(n.push("..."),n.push(Nr(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(Nr(o(f),"")))}return n.join(`
531
- `)+`
532
- `}class jl{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_n,{value:qx});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:a}=o;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Dt({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(jl.prototype,{[_n]:{value:qx}});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=ct(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Fs(this.contents)&&this.contents.add(t)}addIn(t,n){Fs(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=aI(this);t.anchor=!n||r.has(n)?lI(n||"a",r):n}return new zw(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const w=N=>typeof N=="number"||N instanceof String||N instanceof Number,S=n.filter(w).map(String);S.length>0&&(n=n.concat(S)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:o,anchorPrefix:a,flow:c,keepUndefined:u,onTagObj:f,tag:h}=r??{},{onAnchor:p,setAnchors:g,sourceObjects:v}=s9(this,a||"a"),b={aliasDuplicateObjects:o??!0,keepUndefined:u??!1,onAnchor:p,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},x=sl(t,h,b);return c&&lt(x)&&(x.flow=!0),g(),x}createPair(t,n,r={}){const i=this.createNode(t,null,r),o=this.createNode(n,null,r);return new qt(i,o)}delete(t){return Fs(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Aa(t)?this.contents==null?!1:(this.contents=null,!0):Fs(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return lt(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Aa(t)?!n&&Ve(this.contents)?this.contents.value:this.contents:lt(this.contents)?this.contents.getIn(t,n):void 0}has(t){return lt(this.contents)?this.contents.has(t):!1}hasIn(t){return Aa(t)?this.contents!==void 0:lt(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=of(this.schema,[t],n):Fs(this.contents)&&this.contents.set(t,n)}setIn(t,n){Aa(t)?this.contents=n:this.contents==null?this.contents=of(this.schema,Array.from(t),n):Fs(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 Dt({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 Dt({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Zw(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:i,onAnchor:o,reviver:a}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},u=wn(this.contents,n??"",c);if(typeof o=="function")for(const{count:f,res:h}of c.anchors.values())o(h,f);return typeof a=="function"?Gs(a,{"":u},"",u):u}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return T9(this,t)}}function Fs(e){if(lt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class MI extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class Ta extends MI{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class M9 extends MI{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const nE=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const c=Math.min(o-39,a.length-79);a="…"+a.substring(c),o-=c-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
533
- `),a=c+a}if(/[^ ]/.test(a)){let c=1;const u=n.linePos[1];(u==null?void 0:u.line)===r&&u.col>i&&(c=Math.max(1,Math.min(u.col-i,80-o)));const f=" ".repeat(o)+"^".repeat(c);n.message+=`:
534
-
535
- ${a}
536
- ${f}
537
- `}};function ho(e,{flow:t,indicator:n,next:r,offset:i,onError:o,parentIndent:a,startOnNewline:c}){let u=!1,f=c,h=c,p="",g="",v=!1,b=!1,x=null,w=null,S=null,N=null,k=null,E=null,R=null;for(const O of e)switch(b&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&o(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),x&&(f&&O.type!=="comment"&&O.type!=="newline"&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),O.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&O.source.includes(" ")&&(x=O),h=!0;break;case"comment":{h||o(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=O.source.substring(1)||" ";p?p+=g+L:p=L,g="",f=!1;break}case"newline":f?p?p+=O.source:(!E||n!=="seq-item-ind")&&(u=!0):g+=O.source,f=!0,v=!0,(w||S)&&(N=O),h=!0;break;case"anchor":w&&o(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&o(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=O,R??(R=O.offset),f=!1,h=!1,b=!0;break;case"tag":{S&&o(O,"MULTIPLE_TAGS","A node can have at most one tag"),S=O,R??(R=O.offset),f=!1,h=!1,b=!0;break}case n:(w||S)&&o(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),E&&o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),E=O,f=n==="seq-item-ind"||n==="explicit-key-ind",h=!1;break;case"comma":if(t){k&&o(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=O,f=!1,h=!1;break}default:o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),f=!1,h=!1}const T=e[e.length-1],A=T?T.offset+T.source.length:i;return b&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(f&&x.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:E,spaceBefore:u,comment:p,hasNewline:v,anchor:w,tag:S,newlineAfterProp:N,end:A,start:R??A}}function ol(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
538
- `))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(ol(t.key)||ol(t.value))return!0}return!1;default:return!0}}function zx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&ol(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function II(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(o,a)=>o===a||Ve(o)&&Ve(a)&&o.value===a.value;return t.some(o=>i(o.key,n))}const rE="All mapping items must start at the same column";function I9({composeNode:e,composeEmptyNode:t},n,r,i,o){var h;const a=(o==null?void 0:o.nodeClass)??vn,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let u=r.offset,f=null;for(const p of r.items){const{start:g,key:v,sep:b,value:x}=p,w=ho(g,{indicator:"explicit-key-ind",next:v??(b==null?void 0:b[0]),offset:u,onError:i,parentIndent:r.indent,startOnNewline:!0}),S=!w.found;if(S){if(v&&(v.type==="block-seq"?i(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==r.indent&&i(u,"BAD_INDENT",rE)),!w.anchor&&!w.tag&&!b){f=w.end,w.comment&&(c.comment?c.comment+=`
539
- `+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||ol(v))&&i(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((h=w.found)==null?void 0:h.indent)!==r.indent&&i(u,"BAD_INDENT",rE);n.atKey=!0;const N=w.end,k=v?e(n,v,w,i):t(n,N,g,null,w,i);n.schema.compat&&zx(r.indent,v,i),n.atKey=!1,II(n,c.items,k)&&i(N,"DUPLICATE_KEY","Map keys must be unique");const E=ho(b??[],{indicator:"map-value-ind",next:x,offset:k.range[2],onError:i,parentIndent:r.indent,startOnNewline:!v||v.type==="block-scalar"});if(u=E.end,E.found){S&&((x==null?void 0:x.type)==="block-map"&&!E.hasNewline&&i(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<E.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const R=x?e(n,x,E,i):t(n,u,b,null,E,i);n.schema.compat&&zx(r.indent,x,i),u=R.range[2];const T=new qt(k,R);n.options.keepSourceTokens&&(T.srcToken=p),c.items.push(T)}else{S&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&(k.comment?k.comment+=`
540
- `+E.comment:k.comment=E.comment);const R=new qt(k);n.options.keepSourceTokens&&(R.srcToken=p),c.items.push(R)}}return f&&f<u&&i(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,u,f??u],c}function O9({composeNode:e,composeEmptyNode:t},n,r,i,o){const a=(o==null?void 0:o.nodeClass)??Xi,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset,f=null;for(const{start:h,value:p}of r.items){const g=ho(h,{indicator:"seq-item-ind",next:p,offset:u,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||p)(p==null?void 0:p.type)==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(u,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(c.comment=g.comment);continue}const v=p?e(n,p,g,i):t(n,g.end,h,null,g,i);n.schema.compat&&zx(r.indent,p,i),u=v.range[2],c.items.push(v)}return c.range=[r.offset,u,f??u],c}function Rl(e,t,n,r){let i="";if(e){let o=!1,a="";for(const c of e){const{source:u,type:f}=c;switch(f){case"space":o=!0;break;case"comment":{n&&!o&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=u.substring(1)||" ";i?i+=a+h:i=h,a="";break}case"newline":i&&(a+=u),o=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=u.length}}return{comment:i,offset:t}}const Fp="Block collections are not allowed within flow collections",Bp=e=>e&&(e.type==="block-map"||e.type==="block-seq");function P9({composeNode:e,composeEmptyNode:t},n,r,i,o){var w;const a=r.start.source==="{",c=a?"flow map":"flow sequence",u=(o==null?void 0:o.nodeClass)??(a?vn:Xi),f=new u(n.schema);f.flow=!0;const h=n.atRoot;h&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){const N=r.items[S],{start:k,key:E,sep:R,value:T}=N,A=ho(k,{flow:c,indicator:"explicit-key-ind",next:E??(R==null?void 0:R[0]),offset:p,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!R&&!T){S===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):S<r.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),A.comment&&(f.comment?f.comment+=`
541
- `+A.comment:f.comment=A.comment),p=A.end;continue}!a&&n.options.strict&&ol(E)&&i(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${c} items`),A.comment){let O="";e:for(const L of k)switch(L.type){case"comma":case"space":break;case"comment":O=L.source.substring(1);break e;default:break e}if(O){let L=f.items[f.items.length-1];ut(L)&&(L=L.value??L.key),L.comment?L.comment+=`
542
- `+O:L.comment=O,A.comment=A.comment.substring(O.length+1)}}if(!a&&!R&&!A.found){const O=T?e(n,T,A,i):t(n,A.end,R,null,A,i);f.items.push(O),p=O.range[2],Bp(T)&&i(O.range,"BLOCK_IN_FLOW",Fp)}else{n.atKey=!0;const O=A.end,L=E?e(n,E,A,i):t(n,O,k,null,A,i);Bp(E)&&i(L.range,"BLOCK_IN_FLOW",Fp),n.atKey=!1;const B=ho(R??[],{flow:c,indicator:"map-value-ind",next:T,offset:L.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(B.found){if(!a&&!A.found&&n.options.strict){if(R)for(const U of R){if(U===B.found)break;if(U.type==="newline"){i(U,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<B.found.offset-1024&&i(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&((w=T.source)==null?void 0:w[0])===":"?i(T,"MISSING_CHAR",`Missing space after : in ${c}`):i(B.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const I=T?e(n,T,B,i):B.found?t(n,B.end,R,null,B,i):null;I?Bp(T)&&i(I.range,"BLOCK_IN_FLOW",Fp):B.comment&&(L.comment?L.comment+=`
543
- `+B.comment:L.comment=B.comment);const q=new qt(L,I);if(n.options.keepSourceTokens&&(q.srcToken=N),a){const U=f;II(n,U.items,L)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),U.items.push(q)}else{const U=new vn(n.schema);U.flow=!0,U.items.push(q);const D=(I??L).range;U.range=[L.range[0],D[1],D[2]],f.items.push(U)}p=I?I.range[2]:B.end}}const g=a?"}":"]",[v,...b]=r.end;let x=p;if((v==null?void 0:v.source)===g)x=v.offset+v.source.length;else{const S=c[0].toUpperCase()+c.substring(1),N=h?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;i(p,h?"MISSING_CHAR":"BAD_INDENT",N),v&&v.source.length!==1&&b.unshift(v)}if(b.length>0){const S=Rl(b,x,n.options.strict,i);S.comment&&(f.comment?f.comment+=`
544
- `+S.comment:f.comment=S.comment),f.range=[r.offset,x,S.offset]}else f.range=[r.offset,x,x];return f}function zp(e,t,n,r,i,o){const a=n.type==="block-map"?I9(e,t,n,r,o):n.type==="block-seq"?O9(e,t,n,r,o):P9(e,t,n,r,o),c=a.constructor;return i==="!"||i===c.tagName?(a.tag=c.tagName,a):(i&&(a.tag=i),a)}function L9(e,t,n,r,i){var g;const o=r.tag,a=o?t.directives.tagName(o.source,v=>i(o,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:b}=r,x=v&&o?v.offset>o.offset?v:o:v??o;x&&(!b||b.offset<x.offset)&&i(x,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!a||a==="!"||a===vn.tagName&&c==="map"||a===Xi.tagName&&c==="seq")return zp(e,t,n,i,a);let u=t.schema.tags.find(v=>v.tag===a&&v.collection===c);if(!u){const v=t.schema.knownTags[a];if((v==null?void 0:v.collection)===c)t.schema.tags.push(Object.assign({},v,{default:!1})),u=v;else return v?i(o,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),zp(e,t,n,i,a)}const f=zp(e,t,n,i,a,u),h=((g=u.resolve)==null?void 0:g.call(u,f,v=>i(o,"TAG_RESOLVE_FAILED",v),t.options))??f,p=ct(h)?h:new Ae(h);return p.range=f.range,p.tag=a,u!=null&&u.format&&(p.format=u.format),p}function D9(e,t,n){const r=t.offset,i=q9(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const o=i.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,a=t.source?$9(t.source):[];let c=a.length;for(let x=a.length-1;x>=0;--x){const w=a[x][1];if(w===""||w==="\r")c=x;else break}if(c===0){const x=i.chomp==="+"&&a.length>0?`
545
- `.repeat(Math.max(1,a.length-1)):"";let w=r+i.length;return t.source&&(w+=t.source.length),{value:x,type:o,comment:i.comment,range:[r,w,w]}}let u=t.indent+i.indent,f=t.offset+i.length,h=0;for(let x=0;x<c;++x){const[w,S]=a[x];if(S===""||S==="\r")i.indent===0&&w.length>u&&(u=w.length);else{w.length<u&&n(f+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(u=w.length),h=x,u===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=w.length+S.length+1}for(let x=a.length-1;x>=c;--x)a[x][0].length>u&&(c=x+1);let p="",g="",v=!1;for(let x=0;x<h;++x)p+=a[x][0].slice(u)+`
546
- `;for(let x=h;x<c;++x){let[w,S]=a[x];f+=w.length+S.length+1;const N=S[S.length-1]==="\r";if(N&&(S=S.slice(0,-1)),S&&w.length<u){const E=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-S.length-(N?2:1),"BAD_INDENT",E),w=""}o===Ae.BLOCK_LITERAL?(p+=g+w.slice(u)+S,g=`
547
- `):w.length>u||S[0]===" "?(g===" "?g=`
548
- `:!v&&g===`
549
- `&&(g=`
550
-
551
- `),p+=g+w.slice(u)+S,g=`
552
- `,v=!0):S===""?g===`
553
- `?p+=`
554
- `:g=`
555
- `:(p+=g+S,g=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let x=c;x<a.length;++x)p+=`
556
- `+a[x][0].slice(u);p[p.length-1]!==`
557
- `&&(p+=`
558
- `);break;default:p+=`
559
- `}const b=r+i.length+t.source.length;return{value:p,type:o,comment:i.comment,range:[r,b,b]}}function q9({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:i}=t[0],o=i[0];let a=0,c="",u=-1;for(let g=1;g<i.length;++g){const v=i[g];if(!c&&(v==="-"||v==="+"))c=v;else{const b=Number(v);!a&&b?a=b:u===-1&&(u=e+g)}}u!==-1&&r(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,h="",p=i.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":f=!0;case"newline":p+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=v.source.length,h=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),p+=v.source.length;break;default:{const b=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",b);const x=v.source;x&&typeof x=="string"&&(p+=x.length)}}}return{mode:o,indent:a,chomp:c,comment:h,length:p}}function $9(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),o=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)o.push([t[a],t[a+1]]);return o}function F9(e,t,n){const{offset:r,type:i,source:o,end:a}=e;let c,u;const f=(g,v,b)=>n(r+g,v,b);switch(i){case"scalar":c=Ae.PLAIN,u=B9(o,f);break;case"single-quoted-scalar":c=Ae.QUOTE_SINGLE,u=z9(o,f);break;case"double-quoted-scalar":c=Ae.QUOTE_DOUBLE,u=V9(o,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const h=r+o.length,p=Rl(a,h,t,n);return{value:u,type:c,comment:p.comment,range:[r,h,p.offset]}}function B9(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}`),OI(e)}function z9(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),OI(e.slice(1,-1)).replace(/''/g,"'")}function OI(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
560
- `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
561
- `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],o=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?o===`
562
- `?i+=o:o=`
563
- `:(i+=o+r[1],o=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),i+o+((r==null?void 0:r[1])??"")}function V9(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
564
- `))if(i===`
565
- `){const{fold:o,offset:a}=U9(e,r);n+=o,r=a}else if(i==="\\"){let o=e[++r];const a=H9[o];if(a)n+=a;else if(o===`
566
- `)for(o=e[r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="\r"&&e[r+1]===`
567
- `)for(o=e[++r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="x"||o==="u"||o==="U"){const c={x:2,u:4,U:8}[o];n+=W9(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(i===" "||i===" "){const o=r;let a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
568
- `&&!(a==="\r"&&e[r+2]===`
569
- `)&&(n+=r>o?e.slice(o,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function U9(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
570
- `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
571
- `);)r===`
572
- `&&(n+=`
573
- `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const H9={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
574
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function W9(e,t,n,r){const i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,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 PI(e,t,n,r){const{value:i,type:o,comment:a,range:c}=t.type==="block-scalar"?D9(e,t,r):F9(t,e.options.strict,r),u=n?e.directives.tagName(n.source,p=>r(n,"TAG_RESOLVE_FAILED",p)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[lr]:u?f=K9(e.schema,i,u,n,r):t.type==="scalar"?f=G9(e,i,t,r):f=e.schema[lr];let h;try{const p=f.resolve(i,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);h=Ve(p)?p:new Ae(p)}catch(p){const g=p instanceof Error?p.message:String(p);r(n??t,"TAG_RESOLVE_FAILED",g),h=new Ae(i)}return h.range=c,h.source=i,o&&(h.type=o),u&&(h.tag=u),f.format&&(h.format=f.format),a&&(h.comment=a),h}function K9(e,t,n,r,i){var c;if(n==="!")return e[lr];const o=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)o.push(u);else return u;for(const u of o)if((c=u.test)!=null&&c.test(t))return u;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[lr])}function G9({atKey:e,directives:t,schema:n},r,i,o){const a=n.tags.find(c=>{var u;return(c.default===!0||e&&c.default==="key")&&((u=c.test)==null?void 0:u.test(r))})||n[lr];if(n.compat){const c=n.compat.find(u=>{var f;return u.default&&((f=u.test)==null?void 0:f.test(r))})??n[lr];if(a.tag!==c.tag){const u=t.tagString(a.tag),f=t.tagString(c.tag),h=`Value may be parsed as either ${u} or ${f}`;o(i,"TAG_RESOLVE_FAILED",h,!0)}}return a}function Y9(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];(i==null?void 0:i.type)==="space";)e+=i.source.length,i=t[++r];break}}return e}const X9={composeNode:LI,composeEmptyNode:eb};function LI(e,t,n,r){const i=e.atKey,{spaceBefore:o,comment:a,anchor:c,tag:u}=n;let f,h=!0;switch(t.type){case"alias":f=Q9(e,t,r),(c||u)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=PI(e,t,u,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=L9(X9,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",p),f=eb(e,t.offset,void 0,null,n,r),h=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Ve(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(f.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?f.comment=a:f.commentBefore=a),e.options.keepSourceTokens&&h&&(f.srcToken=t),f}function eb(e,t,n,r,{spaceBefore:i,comment:o,anchor:a,tag:c,end:u},f){const h={type:"scalar",offset:Y9(t,n,r),indent:-1,source:""},p=PI(e,h,c,f);return a&&(p.anchor=a.source.substring(1),p.anchor===""&&f(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(p.spaceBefore=!0),o&&(p.comment=o,p.range[2]=u),p}function Q9({options:e},{offset:t,source:n,end:r},i){const o=new zw(n.substring(1));o.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,c=Rl(r,a,e.strict,i);return o.range=[t,a,c.offset],c.comment&&(o.comment=c.comment),o}function J9(e,t,{offset:n,start:r,value:i,end:o},a){const c=Object.assign({_directives:t},e),u=new jl(void 0,c),f={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},h=ho(r,{indicator:"doc-start",next:i??(o==null?void 0:o[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});h.found&&(u.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&a(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=i?LI(f,i,h,a):eb(f,h.end,r,null,h,a);const p=u.contents.range[2],g=Rl(o,p,!1,a);return g.comment&&(u.comment=g.comment),u.range=[n,p,g.offset],u}function Ea(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 iE(e){var i;let t="",n=!1,r=!1;for(let o=0;o<e.length;++o){const a=e[o];switch(a[0]){case"#":t+=(t===""?"":r?`
575
-
576
- `:`
577
- `)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((i=e[o+1])==null?void 0:i[0])!=="#"&&(o+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class Z9{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,o)=>{const a=Ea(n);o?this.warnings.push(new M9(a,r,i)):this.errors.push(new Ta(a,r,i))},this.directives=new Dt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=iE(this.prelude);if(r){const o=t.contents;if(n)t.comment=t.comment?`${t.comment}
578
- ${r}`:r;else if(i||t.directives.docStart||!o)t.commentBefore=r;else if(lt(o)&&!o.flow&&o.items.length>0){let a=o.items[0];ut(a)&&(a=a.key);const c=a.commentBefore;a.commentBefore=c?`${r}
579
- ${c}`:r}else{const a=o.commentBefore;o.commentBefore=a?`${r}
580
- ${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:iE(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const o=Ea(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=J9(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 Ta(Ea(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 Ta(Ea(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Rl(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
581
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ta(Ea(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),i=new jl(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const DI="\uFEFF",qI="",$I="",Vx="";function eH(e){switch(e){case DI:return"byte-order-mark";case qI:return"doc-mode";case $I:return"flow-error-end";case Vx:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
582
- `:case`\r
583
- `: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 Tn(e){switch(e){case void 0:case" ":case`
584
- `:case"\r":case" ":return!0;default:return!1}}const sE=new Set("0123456789ABCDEFabcdef"),tH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),wu=new Set(",[]{}"),nH=new Set(` ,[]{}
585
- \r `),Vp=e=>!e||nH.has(e);class rH{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===`
586
- `?!0:n==="\r"?this.buffer[t+1]===`
587
- `:!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 i=this.buffer[r+t+1];if(i===`
588
- `||!i&&!this.atEnd)return t+r+1}return n===`
589
- `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Tn(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(`
590
- `,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]===DI&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const o=t[r-1];if(o===" "||o===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const o=t[n-1];if(o===" "||o===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield qI,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&Tn(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&&!Tn(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===":")&&Tn(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(Vp),"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 i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&Tn(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield $I,yield*this.parseLineStart();let o=0;for(;i[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Vp),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||Tn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
591
- `,this.pos);if(i!==-1){for(;i!==-1;){const o=this.continueScalar(i+1);if(o===-1)break;i=r.indexOf(`
592
- `,o)}i!==-1&&(n=i-(r[i-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=>Tn(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case`
593
- `:t=o,n=0;break;case"\r":{const a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
594
- `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
595
- `,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
596
- `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let o=t-1,a=this.buffer[o];a==="\r"&&(a=this.buffer[--o]);const c=o;for(;a===" ";)a=this.buffer[--o];if(a===`
597
- `&&o>=this.pos&&o+1+n>c)t=o;else break}while(!0);return yield Vx,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const o=this.buffer[r+1];if(Tn(o)||t&&wu.has(o))break;n=r}else if(Tn(i)){let o=this.buffer[r+1];if(i==="\r"&&(o===`
598
- `?(r+=1,i=`
599
- `,o=this.buffer[r+1]):n=r),o==="#"||t&&wu.has(o))break;if(i===`
600
- `){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&wu.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Vx,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(Vp))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Tn(n)||t&&wu.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(;!Tn(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(tH.has(n))n=this.buffer[++t];else if(n==="%"&&sE.has(this.buffer[t+1])&&sE.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===`
601
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
602
- `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class iH{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const o=n+r>>1;this.lineStarts[o]<t?n=o+1:r=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function ci(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function oE(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 FI(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 bu(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 Bs(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 aE(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ci(t.start,"explicit-key-ind")&&!ci(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,FI(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 sH{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 rH,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=eH(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"&&aE(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{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 i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&oE(i.start)===-1&&(n.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.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":{oE(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=bu(this.peek(2)),r=Bs(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
603
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
604
- `,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 i="end"in n.value?n.value.end:void 0,o=Array.isArray(i)?i[i.length-1]:void 0;(o==null?void 0:o.type)==="comment"?i==null||i.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 i=t.items[t.items.length-2],o=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const i=!this.onKeyLine&&this.indent===t.indent,o=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(o&&n.sep&&!n.value){const c=[];for(let u=0;u<n.sep.length;++u){const f=n.sep[u];switch(f.type){case"newline":c.push(u);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":o||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ci(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(FI(n.key)&&!ci(n.sep,"newline")){const c=Bs(n.start),u=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:u,sep:f}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(ci(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Bs(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:a,key:null,sep:[this.sourceToken]}):ci(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);o||n.value?(t.items.push({start:a,key:c,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(c):(Object.assign(n,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(t);if(c){if(c.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ci(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 i&&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 i="end"in n.value?n.value.end:void 0,o=Array.isArray(i)?i[i.length-1]:void 0;(o==null?void 0:o.type)==="comment"?i==null||i.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 i=t.items[t.items.length-2],o=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ci(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const i=this.startBlockValue(t);if(i){this.stack.push(i);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 i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,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 i=bu(r),o=Bs(i);aE(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
605
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
606
- `,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=bu(t),r=Bs(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=bu(t),r=Bs(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 oH(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new iH||null,prettyErrors:t}}function aH(e,t={}){const{lineCounter:n,prettyErrors:r}=oH(t),i=new sH(n==null?void 0:n.addNewLine),o=new Z9(t);let a=null;for(const c of o.compose(i.parse(e),!0,e.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new Ta(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(nE(e,n)),a.warnings.forEach(nE(e,n))),a}function lH(e,t,n){let r;const i=aH(e,n);if(!i)return null;if(i.warnings.forEach(o=>hI(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function lf(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 i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){const{keepUndefined:i}=n??t??{};if(!i)return}return kl(e)&&!r?e.toString(n):new jl(e,r,n).toString(n)}function cH({value:e,onChange:t}){const[n,r]=j.useState(""),[i,o]=j.useState(null),[a,c]=j.useState(!0);j.useEffect(()=>{try{const f=lf(e,{indent:2,lineWidth:0});r(f),o(null),c(!0)}catch(f){o(f instanceof Error?f.message:"Failed to serialize"),c(!1)}},[e]);const u=f=>{if(f){r(f);try{const h=lH(f);if(!h.id)throw new Error("Step ID is required");if(!h.action&&!h.workflow)throw new Error("Either action or workflow is required");o(null),c(!0),t(h)}catch(h){o(h instanceof Error?h.message:"Invalid YAML"),c(!1)}}};return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("div",{className:"flex items-center gap-2",children:a?m.jsxs("span",{className:"flex items-center gap-1 text-xs text-success",children:[m.jsx(el,{className:"w-3 h-3"}),"Valid YAML"]}):m.jsxs("span",{className:"flex items-center gap-1 text-xs text-error",children:[m.jsx(_w,{className:"w-3 h-3"}),i]})}),m.jsxs("span",{className:"text-xs text-gray-500",children:[n.split(`
607
- `).length," lines"]})]}),m.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:m.jsx(za,{height:"400px",language:"yaml",value:n,onChange:u,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})}),m.jsx("div",{className:"text-xs text-gray-500",children:m.jsx("p",{children:"Edit the step configuration directly in YAML format. Changes are applied automatically when valid."})})]})}function uH({value:e,title:t}){const[n,r]=j.useState("");return j.useEffect(()=>{try{const i=lf(e,{indent:2,lineWidth:0});r(i)}catch{r("# Failed to serialize value")}},[e]),m.jsxs("div",{className:"space-y-2",children:[t&&m.jsx("h4",{className:"text-sm font-medium text-gray-300",children:t}),m.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:m.jsx(za,{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 fH({inputs:e,onChange:t,availableVariables:n}){const[r,i]=j.useState(""),o=Object.entries(e),a=(p,g)=>{t({...e,[p]:g})},c=p=>{const g={...e};delete g[p],t(g)},u=()=>{r&&!e.hasOwnProperty(r)&&(t({...e,[r]:""}),i(""))},f=(p,g)=>{if(g&&g!==p&&!e.hasOwnProperty(g)){const v={};for(const[b,x]of Object.entries(e))b===p?v[g]=x:v[b]=x;t(v)}},h=(p,g)=>{const v=String(e[p]||"");a(p,v+`{{ ${g} }}`)};return m.jsxs("div",{className:"space-y-4",children:[o.length===0?m.jsx("div",{className:"text-center py-8",children:m.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No inputs defined"})}):m.jsx("div",{className:"space-y-3",children:o.map(([p,g])=>m.jsx(dH,{inputKey:p,value:g,onChange:v=>a(p,v),onRemove:()=>c(p),onRename:v=>f(p,v),availableVariables:n,onInsertVariable:v=>h(p,v)},p))}),m.jsxs("div",{className:"flex gap-2 pt-2 border-t border-node-border",children:[m.jsx("input",{type:"text",value:r,onChange:p=>i(p.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:p=>{p.key==="Enter"&&u()}}),m.jsx(Ge,{variant:"secondary",size:"sm",onClick:u,disabled:!r||e.hasOwnProperty(r),icon:m.jsx(Rf,{className:"w-4 h-4"}),children:"Add"})]}),n.length>0&&m.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx(Af,{className:"w-4 h-4 text-primary"}),m.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Available Variables"})]}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(p=>m.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded",children:p},p))}),m.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Click on an input field, then use the variable button to insert"})]})]})}function dH({inputKey:e,value:t,onChange:n,onRemove:r,onRename:i,availableVariables:o,onInsertVariable:a}){const[c,u]=j.useState(!1),[f,h]=j.useState(e),[p,g]=j.useState(!1),v=typeof t,b=v==="object"&&t!==null,x=Array.isArray(t),w=()=>{f!==e&&i(f),u(!1)},S=()=>x||b?m.jsx("textarea",{value:JSON.stringify(t,null,2),onChange:N=>{try{n(JSON.parse(N.target.value))}catch{n(N.target.value)}},className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary resize-none",rows:3}):v==="boolean"?m.jsxs("select",{value:String(t),onChange:N=>n(N.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:[m.jsx("option",{value:"true",children:"true"}),m.jsx("option",{value:"false",children:"false"})]}):v==="number"?m.jsx("input",{type:"number",value:String(t),onChange:N=>n(parseFloat(N.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"}):m.jsx(hH,{value:String(t),onChange:N=>n(N),variables:o,placeholder:"Value or {{ variable }}"});return m.jsxs("div",{className:"p-3 bg-node-bg/50 rounded-lg border border-node-border space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[c?m.jsx("input",{type:"text",value:f,onChange:N=>h(N.target.value),onBlur:w,onKeyDown:N=>{N.key==="Enter"&&w(),N.key==="Escape"&&(h(e),u(!1))},className:"flex-1 px-2 py-1 bg-node-bg border border-primary rounded text-white text-sm font-mono focus:outline-none",autoFocus:!0}):m.jsx("button",{onClick:()=>u(!0),className:"flex-1 text-left px-2 py-1 text-sm font-mono text-primary hover:bg-white/5 rounded",children:e}),m.jsx("span",{className:"text-xs text-gray-500",children:v}),m.jsx(Ge,{variant:"ghost",size:"sm",onClick:r,className:"!p-1 text-gray-400 hover:text-error",children:m.jsx(vo,{className:"w-4 h-4"})})]}),m.jsxs("div",{className:"flex gap-2",children:[S(),o.length>0&&!x&&!b&&m.jsxs("div",{className:"relative",children:[m.jsx(Ge,{variant:"ghost",size:"sm",onClick:()=>g(!p),className:"!p-2",children:m.jsx(Af,{className:"w-4 h-4"})}),p&&m.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:[m.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Insert variable"}),m.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:o.map(N=>m.jsx("button",{onClick:()=>{a(N),g(!1)},className:"w-full text-left px-2 py-1 text-xs font-mono text-primary hover:bg-white/10 rounded",children:N},N))})]})]})]})]})}function hH({value:e,onChange:t,variables:n,placeholder:r}){const[i,o]=j.useState(!1),[a,c]=j.useState(0),[u,f]=j.useState(0),h=j.useRef(null),g=(()=>{const k=e.substring(0,a),E=k.lastIndexOf("{{");if(E===-1)return null;const R=k.substring(E);return R.includes("}}")?null:{text:R.substring(2).trim(),start:E,end:a}})(),v=g?n.filter(k=>k.toLowerCase().includes(g.text.toLowerCase())):[],b=i&&g&&v.length>0,x=k=>{t(k.target.value),c(k.target.selectionStart||0),o(!0),f(0)},w=k=>{const E=k.target;c(E.selectionStart||0)},S=k=>{if(b)switch(k.key){case"ArrowDown":k.preventDefault(),f(E=>E<v.length-1?E+1:0);break;case"ArrowUp":k.preventDefault(),f(E=>E>0?E-1:v.length-1);break;case"Enter":case"Tab":k.preventDefault(),N(v[u]);break;case"Escape":o(!1);break}},N=k=>{if(!g)return;const E=e.substring(0,g.start),R=e.substring(g.end),T=`${E}{{ ${k} }}${R}`;t(T),o(!1),setTimeout(()=>{if(h.current){const A=g.start+k.length+6;h.current.setSelectionRange(A,A),h.current.focus()}},0)};return j.useEffect(()=>{const k=()=>o(!1);return document.addEventListener("click",k),()=>document.removeEventListener("click",k)},[]),m.jsxs("div",{className:"relative flex-1",children:[m.jsx("input",{ref:h,type:"text",value:e,onChange:x,onSelect:w,onKeyDown:S,onFocus:()=>o(!0),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:r}),b&&m.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:[m.jsxs("div",{className:"text-xs text-gray-500 px-2 py-1 mb-1",children:['Variables matching "',(g==null?void 0:g.text)||"",'"']}),v.map((k,E)=>m.jsxs("button",{onClick:()=>N(k),className:`w-full text-left px-2 py-1.5 text-xs font-mono rounded flex items-center gap-2 ${E===u?"bg-primary/20 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[m.jsx(Af,{className:"w-3 h-3"}),k]},k)),m.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 lE(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 pH(e,t){const n=e.find(r=>r.field===t);return n==null?void 0:n.message}function mH({open:e,onOpenChange:t,step:n,onSave:r,availableVariables:i}){const[o,a]=j.useState(null),[c,u]=j.useState("properties"),[f,h]=j.useState([]),[p,g]=j.useState(!1);if(j.useEffect(()=>{n&&(a({...n}),u("properties"),h([]),g(!1))},[n]),j.useMemo(()=>o?lE(o):{valid:!0,errors:[]},[o]),!o)return null;const v=()=>{if(!o)return;const w=lE(o);if(h(w.errors),g(!0),w.valid)r(o),t(!1);else{const S=w.errors[0];S&&(S.field==="id"||S.field==="action"||S.field==="workflow"||S.field==="timeout"?u("properties"):S.field==="outputVariable"?u("output"):S.field.startsWith("errorHandling")?u("errors"):S.field.startsWith("conditions")&&u("conditions"))}},b=w=>{a(S=>S?{...S,...w}:null)},x=w=>{if(p)return pH(f,w)};return m.jsxs(bl,{open:e,onOpenChange:t,title:`Edit Step: ${o.name||o.id}`,description:o.action||o.workflow||"Configure step settings",size:"xl",children:[m.jsxs(YM,{value:c,onValueChange:u,children:[m.jsxs($w,{children:[m.jsxs(Jn,{value:"properties",children:[m.jsx(Ew,{className:"w-4 h-4 mr-1.5"}),"Properties"]}),m.jsxs(Jn,{value:"inputs",children:[m.jsx(Ez,{className:"w-4 h-4 mr-1.5"}),"Inputs"]}),m.jsxs(Jn,{value:"output",children:[m.jsx(Nz,{className:"w-4 h-4 mr-1.5"}),"Output"]}),m.jsxs(Jn,{value:"errors",children:[m.jsx(Xz,{className:"w-4 h-4 mr-1.5"}),"Errors"]}),m.jsxs(Jn,{value:"conditions",children:[m.jsx(Cz,{className:"w-4 h-4 mr-1.5"}),"Conditions"]}),m.jsxs(Jn,{value:"yaml",children:[m.jsx(Sw,{className:"w-4 h-4 mr-1.5"}),"YAML"]})]}),m.jsxs("div",{className:"p-4",children:[m.jsx(Zn,{value:"properties",children:m.jsx(gH,{step:o,onChange:b,getError:x})}),m.jsx(Zn,{value:"inputs",children:m.jsx(fH,{inputs:o.inputs,onChange:w=>b({inputs:w}),availableVariables:i})}),m.jsx(Zn,{value:"output",children:m.jsx(yH,{step:o,onChange:b})}),m.jsx(Zn,{value:"errors",children:m.jsx(vH,{step:o,onChange:b})}),m.jsx(Zn,{value:"conditions",children:m.jsx(xH,{step:o,onChange:b,availableVariables:i})}),m.jsx(Zn,{value:"yaml",children:m.jsx(cH,{value:o,onChange:w=>a(w)})})]})]}),m.jsxs(If,{children:[p&&f.length>0&&m.jsxs("div",{className:"flex-1 flex items-center gap-2 text-error text-sm",children:[m.jsx(_w,{className:"w-4 h-4 flex-shrink-0"}),m.jsxs("span",{children:[f.length," validation error",f.length>1?"s":""]})]}),m.jsx(Ge,{variant:"secondary",onClick:()=>t(!1),children:"Cancel"}),m.jsx(Ge,{onClick:v,children:"Save Changes"})]})]})}function gH({step:e,onChange:t,getError:n}){const r=n("id"),i=n("action"),o=n("workflow"),a=n("timeout");return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Step ID ",m.jsx("span",{className:"text-error",children:"*"})]}),m.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?m.jsx("p",{className:"mt-1 text-xs text-error",children:r}):m.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Unique identifier for this step"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name"}),m.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"})]}),m.jsxs("div",{children:[m.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Action ",!e.workflow&&m.jsx("span",{className:"text-error",children:"*"})]}),m.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 ${i?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"service.method (e.g., slack.chat.postMessage)"}),i?m.jsx("p",{className:"mt-1 text-xs text-error",children:i}):m.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Format: service.method or service.namespace.method"})]}),e.workflow&&m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Sub-workflow Path"}),m.jsx("input",{type:"text",value:e.workflow,onChange:c=>t({workflow:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${o?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"./path/to/workflow.md"}),o&&m.jsx("p",{className:"mt-1 text-xs text-error",children:o})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Timeout (seconds)"}),m.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&&m.jsx("p",{className:"mt-1 text-xs text-error",children:a})]})]})}function yH({step:e,onChange:t}){return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Output Variable"}),m.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"}),m.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Store the step output in this variable for use in subsequent steps"})]}),m.jsxs("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:[m.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Usage Example"}),m.jsx("code",{className:"text-xs text-primary font-mono",children:"{{ "+(e.outputVariable||"variable_name")+" }}"}),m.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use this syntax in subsequent steps to reference the output"})]})]})}function vH({step:e,onChange:t}){const n=e.errorHandling||{action:"stop"},r=i=>{t({errorHandling:{...n,...i}})};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Error Action"}),m.jsxs("select",{value:n.action,onChange:i=>r({action:i.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[m.jsx("option",{value:"stop",children:"Stop workflow on error"}),m.jsx("option",{value:"continue",children:"Continue to next step"}),m.jsx("option",{value:"retry",children:"Retry with backoff"})]})]}),n.action==="retry"&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Max Retries"}),m.jsx("input",{type:"number",value:n.maxRetries||3,onChange:i=>r({maxRetries:parseInt(i.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"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Retry Delay (ms)"}),m.jsx("input",{type:"number",value:n.retryDelay||1e3,onChange:i=>r({retryDelay:parseInt(i.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"})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Fallback Step (optional)"}),m.jsx("input",{type:"text",value:n.fallbackStep||"",onChange:i=>r({fallbackStep:i.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"}),m.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Jump to this step if the error action fails"})]})]})}function xH({step:e,onChange:t,availableVariables:n}){const r=e.conditions||[],i=()=>{t({conditions:[...r,""]})},o=(c,u)=>{const f=[...r];f[c]=u,t({conditions:f})},a=c=>{const u=r.filter((f,h)=>h!==c);t({conditions:u.length>0?u:void 0})};return m.jsxs("div",{className:"space-y-4",children:[m.jsx("p",{className:"text-sm text-gray-400",children:"This step will only execute if all conditions evaluate to true."}),r.length===0?m.jsxs("div",{className:"text-center py-8",children:[m.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No conditions defined"}),m.jsx(Ge,{variant:"secondary",size:"sm",onClick:i,children:"Add Condition"})]}):m.jsxs("div",{className:"space-y-3",children:[r.map((c,u)=>m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:c,onChange:f=>o(u,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'"}),m.jsx(Ge,{variant:"ghost",size:"sm",onClick:()=>a(u),children:"×"})]},u)),m.jsx(Ge,{variant:"secondary",size:"sm",onClick:i,children:"Add Condition"})]}),n.length>0&&m.jsxs("div",{className:"mt-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[m.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:"Available Variables"}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(c=>m.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded cursor-pointer hover:bg-primary/20",onClick:()=>{navigator.clipboard.writeText(`{{ ${c} }}`)},children:c},c))})]})]})}const wH=["top","right","bottom","left"],gi=Math.min,sn=Math.max,cf=Math.round,_u=Math.floor,rr=e=>({x:e,y:e}),bH={left:"right",right:"left",bottom:"top",top:"bottom"},_H={start:"end",end:"start"};function Ux(e,t,n){return sn(e,gi(t,n))}function Ar(e,t){return typeof e=="function"?e(t):e}function Tr(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function tb(e){return e==="x"?"y":"x"}function nb(e){return e==="y"?"height":"width"}const SH=new Set(["top","bottom"]);function tr(e){return SH.has(Tr(e))?"y":"x"}function rb(e){return tb(tr(e))}function kH(e,t,n){n===void 0&&(n=!1);const r=ko(e),i=rb(e),o=nb(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=uf(a)),[a,uf(a)]}function EH(e){const t=uf(e);return[Hx(e),t,Hx(t)]}function Hx(e){return e.replace(/start|end/g,t=>_H[t])}const cE=["left","right"],uE=["right","left"],NH=["top","bottom"],CH=["bottom","top"];function jH(e,t,n){switch(e){case"top":case"bottom":return n?t?uE:cE:t?cE:uE;case"left":case"right":return t?NH:CH;default:return[]}}function RH(e,t,n,r){const i=ko(e);let o=jH(Tr(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Hx)))),o}function uf(e){return e.replace(/left|right|bottom|top/g,t=>bH[t])}function AH(e){return{top:0,right:0,bottom:0,left:0,...e}}function BI(e){return typeof e!="number"?AH(e):{top:e,right:e,bottom:e,left:e}}function ff(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fE(e,t,n){let{reference:r,floating:i}=e;const o=tr(t),a=rb(t),c=nb(a),u=Tr(t),f=o==="y",h=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,g=r[c]/2-i[c]/2;let v;switch(u){case"top":v={x:h,y:r.y-i.height};break;case"bottom":v={x:h,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-i.width,y:p};break;default:v={x:r.x,y:r.y}}switch(ko(t)){case"start":v[a]-=g*(n&&f?-1:1);break;case"end":v[a]+=g*(n&&f?-1:1);break}return v}const TH=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:p}=fE(f,r,u),g=r,v={},b=0;for(let x=0;x<c.length;x++){const{name:w,fn:S}=c[x],{x:N,y:k,data:E,reset:R}=await S({x:h,y:p,initialPlacement:r,placement:g,strategy:i,middlewareData:v,rects:f,platform:a,elements:{reference:e,floating:t}});h=N??h,p=k??p,v={...v,[w]:{...v[w],...E}},R&&b<=50&&(b++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(f=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):R.rects),{x:h,y:p}=fE(f,g,u)),x=-1)}return{x:h,y:p,placement:g,strategy:i,middlewareData:v}};async function al(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=Ar(t,e),b=BI(v),w=c[g?p==="floating"?"reference":"floating":p],S=ff(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:u})),N=p==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),E=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},R=ff(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:k,strategy:u}):N);return{top:(S.top-R.top+b.top)/E.y,bottom:(R.bottom-S.bottom+b.bottom)/E.y,left:(S.left-R.left+b.left)/E.x,right:(R.right-S.right+b.right)/E.x}}const MH=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:f,padding:h=0}=Ar(e,t)||{};if(f==null)return{};const p=BI(h),g={x:n,y:r},v=rb(i),b=nb(v),x=await a.getDimensions(f),w=v==="y",S=w?"top":"left",N=w?"bottom":"right",k=w?"clientHeight":"clientWidth",E=o.reference[b]+o.reference[v]-g[v]-o.floating[b],R=g[v]-o.reference[v],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let A=T?T[k]:0;(!A||!await(a.isElement==null?void 0:a.isElement(T)))&&(A=c.floating[k]||o.floating[b]);const O=E/2-R/2,L=A/2-x[b]/2-1,B=gi(p[S],L),I=gi(p[N],L),q=B,U=A-x[b]-I,D=A/2-x[b]/2+O,V=Ux(q,D,U),z=!u.arrow&&ko(i)!=null&&D!==V&&o.reference[b]/2-(D<q?B:I)-x[b]/2<0,Q=z?D<q?D-q:D-U:0;return{[v]:g[v]+Q,data:{[v]:V,centerOffset:D-V-Q,...z&&{alignmentOffset:Q}},reset:z}}}),IH=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:c,platform:u,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=Ar(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Tr(i),N=tr(c),k=Tr(c)===c,E=await(u.isRTL==null?void 0:u.isRTL(f.floating)),R=g||(k||!x?[uf(c)]:EH(c)),T=b!=="none";!g&&T&&R.push(...RH(c,x,b,E));const A=[c,...R],O=await al(t,w),L=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&L.push(O[S]),p){const D=kH(i,a,E);L.push(O[D[0]],O[D[1]])}if(B=[...B,{placement:i,overflows:L}],!L.every(D=>D<=0)){var I,q;const D=(((I=o.flip)==null?void 0:I.index)||0)+1,V=A[D];if(V&&(!(p==="alignment"?N!==tr(V):!1)||B.every(F=>tr(F.placement)===N?F.overflows[0]>0:!0)))return{data:{index:D,overflows:B},reset:{placement:V}};let z=(q=B.filter(Q=>Q.overflows[0]<=0).sort((Q,F)=>Q.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!z)switch(v){case"bestFit":{var U;const Q=(U=B.filter(F=>{if(T){const $=tr(F.placement);return $===N||$==="y"}return!0}).map(F=>[F.placement,F.overflows.filter($=>$>0).reduce(($,Y)=>$+Y,0)]).sort((F,$)=>F[1]-$[1])[0])==null?void 0:U[0];Q&&(z=Q);break}case"initialPlacement":z=c;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function dE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hE(e){return wH.some(t=>e[t]>=0)}const OH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ar(e,t);switch(r){case"referenceHidden":{const o=await al(t,{...i,elementContext:"reference"}),a=dE(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hE(a)}}}case"escaped":{const o=await al(t,{...i,altBoundary:!0}),a=dE(o,n.floating);return{data:{escapedOffsets:a,escaped:hE(a)}}}default:return{}}}}},zI=new Set(["left","top"]);async function PH(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Tr(n),c=ko(n),u=tr(n)==="y",f=zI.has(a)?-1:1,h=o&&u?-1:1,p=Ar(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof b=="number"&&(v=c==="end"?b*-1:b),u?{x:v*h,y:g*f}:{x:g*f,y:v*h}}const LH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:c}=t,u=await PH(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},DH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:w=>{let{x:S,y:N}=w;return{x:S,y:N}}},...u}=Ar(e,t),f={x:n,y:r},h=await al(t,u),p=tr(Tr(i)),g=tb(p);let v=f[g],b=f[p];if(o){const w=g==="y"?"top":"left",S=g==="y"?"bottom":"right",N=v+h[w],k=v-h[S];v=Ux(N,v,k)}if(a){const w=p==="y"?"top":"left",S=p==="y"?"bottom":"right",N=b+h[w],k=b-h[S];b=Ux(N,b,k)}const x=c.fn({...t,[g]:v,[p]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[p]:a}}}}}},qH=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=Ar(e,t),h={x:n,y:r},p=tr(i),g=tb(p);let v=h[g],b=h[p];const x=Ar(c,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const k=g==="y"?"height":"width",E=o.reference[g]-o.floating[k]+w.mainAxis,R=o.reference[g]+o.reference[k]-w.mainAxis;v<E?v=E:v>R&&(v=R)}if(f){var S,N;const k=g==="y"?"width":"height",E=zI.has(Tr(i)),R=o.reference[p]-o.floating[k]+(E&&((S=a.offset)==null?void 0:S[p])||0)+(E?0:w.crossAxis),T=o.reference[p]+o.reference[k]+(E?0:((N=a.offset)==null?void 0:N[p])||0)-(E?w.crossAxis:0);b<R?b=R:b>T&&(b=T)}return{[g]:v,[p]:b}}}},$H=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:c}=t,{apply:u=()=>{},...f}=Ar(e,t),h=await al(t,f),p=Tr(i),g=ko(i),v=tr(i)==="y",{width:b,height:x}=o.floating;let w,S;p==="top"||p==="bottom"?(w=p,S=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,w=g==="end"?"top":"bottom");const N=x-h.top-h.bottom,k=b-h.left-h.right,E=gi(x-h[w],N),R=gi(b-h[S],k),T=!t.middlewareData.shift;let A=E,O=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=N),T&&!g){const B=sn(h.left,0),I=sn(h.right,0),q=sn(h.top,0),U=sn(h.bottom,0);v?O=b-2*(B!==0||I!==0?B+I:sn(h.left,h.right)):A=x-2*(q!==0||U!==0?q+U:sn(h.top,h.bottom))}await u({...t,availableWidth:O,availableHeight:A});const L=await a.getDimensions(c.floating);return b!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function Hf(){return typeof window<"u"}function Eo(e){return VI(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dr(e){var t;return(t=(VI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function VI(e){return Hf()?e instanceof Node||e instanceof an(e).Node:!1}function qn(e){return Hf()?e instanceof Element||e instanceof an(e).Element:!1}function cr(e){return Hf()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function pE(e){return!Hf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}const FH=new Set(["inline","contents"]);function Al(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!FH.has(i)}const BH=new Set(["table","td","th"]);function zH(e){return BH.has(Eo(e))}const VH=[":popover-open",":modal"];function Wf(e){return VH.some(t=>{try{return e.matches(t)}catch{return!1}})}const UH=["transform","translate","scale","rotate","perspective"],HH=["transform","translate","scale","rotate","perspective","filter"],WH=["paint","layout","strict","content"];function ib(e){const t=sb(),n=qn(e)?$n(e):e;return UH.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)||HH.some(r=>(n.willChange||"").includes(r))||WH.some(r=>(n.contain||"").includes(r))}function KH(e){let t=yi(e);for(;cr(t)&&!po(t);){if(ib(t))return t;if(Wf(t))return null;t=yi(t)}return null}function sb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const GH=new Set(["html","body","#document"]);function po(e){return GH.has(Eo(e))}function $n(e){return an(e).getComputedStyle(e)}function Kf(e){return qn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yi(e){if(Eo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pE(e)&&e.host||dr(e);return pE(t)?t.host:t}function UI(e){const t=yi(e);return po(t)?e.ownerDocument?e.ownerDocument.body:e.body:cr(t)&&Al(t)?t:UI(t)}function ll(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=UI(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=an(i);if(o){const c=Wx(a);return t.concat(a,a.visualViewport||[],Al(i)?i:[],c&&n?ll(c):[])}return t.concat(i,ll(i,[],n))}function Wx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HI(e){const t=$n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cr(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=cf(n)!==o||cf(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function ob(e){return qn(e)?e:e.contextElement}function no(e){const t=ob(e);if(!cr(t))return rr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=HI(t);let a=(o?cf(n.width):n.width)/r,c=(o?cf(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const YH=rr(0);function WI(e){const t=an(e);return!sb()||!t.visualViewport?YH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function XH(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==an(e)?!1:t}function Qi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ob(e);let a=rr(1);t&&(r?qn(r)&&(a=no(r)):a=no(e));const c=XH(o,n,r)?WI(o):rr(0);let u=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,h=i.width/a.x,p=i.height/a.y;if(o){const g=an(o),v=r&&qn(r)?an(r):r;let b=g,x=Wx(b);for(;x&&r&&v!==b;){const w=no(x),S=x.getBoundingClientRect(),N=$n(x),k=S.left+(x.clientLeft+parseFloat(N.paddingLeft))*w.x,E=S.top+(x.clientTop+parseFloat(N.paddingTop))*w.y;u*=w.x,f*=w.y,h*=w.x,p*=w.y,u+=k,f+=E,b=an(x),x=Wx(b)}}return ff({width:h,height:p,x:u,y:f})}function Gf(e,t){const n=Kf(e).scrollLeft;return t?t.left+n:Qi(dr(e)).left+n}function KI(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Gf(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function QH(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=dr(r),c=t?Wf(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},f=rr(1);const h=rr(0),p=cr(r);if((p||!p&&!o)&&((Eo(r)!=="body"||Al(a))&&(u=Kf(r)),cr(r))){const v=Qi(r);f=no(r),h.x=v.x+r.clientLeft,h.y=v.y+r.clientTop}const g=a&&!p&&!o?KI(a,u):rr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-u.scrollTop*f.y+h.y+g.y}}function JH(e){return Array.from(e.getClientRects())}function ZH(e){const t=dr(e),n=Kf(e),r=e.ownerDocument.body,i=sn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=sn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Gf(e);const c=-n.scrollTop;return $n(r).direction==="rtl"&&(a+=sn(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const mE=25;function eW(e,t){const n=an(e),r=dr(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(i){o=i.width,a=i.height;const h=sb();(!h||h&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}const f=Gf(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),v=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-p.clientWidth-v);b<=mE&&(o-=b)}else f<=mE&&(o+=f);return{width:o,height:a,x:c,y:u}}const tW=new Set(["absolute","fixed"]);function nW(e,t){const n=Qi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=cr(e)?no(e):rr(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=i*o.x,f=r*o.y;return{width:a,height:c,x:u,y:f}}function gE(e,t,n){let r;if(t==="viewport")r=eW(e,n);else if(t==="document")r=ZH(dr(e));else if(qn(t))r=nW(t,n);else{const i=WI(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ff(r)}function GI(e,t){const n=yi(e);return n===t||!qn(n)||po(n)?!1:$n(n).position==="fixed"||GI(n,t)}function rW(e,t){const n=t.get(e);if(n)return n;let r=ll(e,[],!1).filter(c=>qn(c)&&Eo(c)!=="body"),i=null;const o=$n(e).position==="fixed";let a=o?yi(e):e;for(;qn(a)&&!po(a);){const c=$n(a),u=ib(a);!u&&c.position==="fixed"&&(i=null),(o?!u&&!i:!u&&c.position==="static"&&!!i&&tW.has(i.position)||Al(a)&&!u&&GI(e,a))?r=r.filter(h=>h!==a):i=c,a=yi(a)}return t.set(e,r),r}function iW(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Wf(t)?[]:rW(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((f,h)=>{const p=gE(t,h,i);return f.top=sn(p.top,f.top),f.right=gi(p.right,f.right),f.bottom=gi(p.bottom,f.bottom),f.left=sn(p.left,f.left),f},gE(t,c,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function sW(e){const{width:t,height:n}=HI(e);return{width:t,height:n}}function oW(e,t,n){const r=cr(t),i=dr(t),o=n==="fixed",a=Qi(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=rr(0);function f(){u.x=Gf(i)}if(r||!r&&!o)if((Eo(t)!=="body"||Al(i))&&(c=Kf(t)),r){const v=Qi(t,!0,o,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else i&&f();o&&!r&&i&&f();const h=i&&!r&&!o?KI(i,c):rr(0),p=a.left+c.scrollLeft-u.x-h.x,g=a.top+c.scrollTop-u.y-h.y;return{x:p,y:g,width:a.width,height:a.height}}function Up(e){return $n(e).position==="static"}function yE(e,t){if(!cr(e)||$n(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return dr(e)===n&&(n=n.ownerDocument.body),n}function YI(e,t){const n=an(e);if(Wf(e))return n;if(!cr(e)){let i=yi(e);for(;i&&!po(i);){if(qn(i)&&!Up(i))return i;i=yi(i)}return n}let r=yE(e,t);for(;r&&zH(r)&&Up(r);)r=yE(r,t);return r&&po(r)&&Up(r)&&!ib(r)?n:r||KH(e)||n}const aW=async function(e){const t=this.getOffsetParent||YI,n=this.getDimensions,r=await n(e.floating);return{reference:oW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lW(e){return $n(e).direction==="rtl"}const cW={convertOffsetParentRelativeRectToViewportRelativeRect:QH,getDocumentElement:dr,getClippingRect:iW,getOffsetParent:YI,getElementRects:aW,getClientRects:JH,getDimensions:sW,getScale:no,isElement:qn,isRTL:lW};function XI(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uW(e,t){let n=null,r;const i=dr(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const f=e.getBoundingClientRect(),{left:h,top:p,width:g,height:v}=f;if(c||t(),!g||!v)return;const b=_u(p),x=_u(i.clientWidth-(h+g)),w=_u(i.clientHeight-(p+v)),S=_u(h),k={rootMargin:-b+"px "+-x+"px "+-w+"px "+-S+"px",threshold:sn(0,gi(1,u))||1};let E=!0;function R(T){const A=T[0].intersectionRatio;if(A!==u){if(!E)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!XI(f,e.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(R,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver(R,k)}n.observe(e)}return a(!0),o}function fW(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=ob(e),h=i||o?[...f?ll(f):[],...ll(t)]:[];h.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const p=f&&c?uW(f,n):null;let g=-1,v=null;a&&(v=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var k;(k=v)==null||k.observe(t)})),n()}),f&&!u&&v.observe(f),v.observe(t));let b,x=u?Qi(e):null;u&&w();function w(){const S=Qi(e);x&&!XI(x,S)&&n(),x=S,b=requestAnimationFrame(w)}return n(),()=>{var S;h.forEach(N=>{i&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const dW=LH,hW=DH,pW=IH,mW=$H,gW=OH,vE=MH,yW=qH,vW=(e,t,n)=>{const r=new Map,i={platform:cW,...n},o={...i.platform,_c:r};return TH(e,t,{...i,platform:o})};var xW=typeof document<"u",wW=function(){},qu=xW?j.useLayoutEffect:wW;function df(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,i;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(!df(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!df(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function QI(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xE(e,t){const n=QI(e);return Math.round(t*n)/n}function Hp(e){const t=j.useRef(e);return qu(()=>{t.current=e}),t}function bW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[h,p]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=j.useState(r);df(g,r)||v(r);const[b,x]=j.useState(null),[w,S]=j.useState(null),N=j.useCallback(F=>{F!==T.current&&(T.current=F,x(F))},[]),k=j.useCallback(F=>{F!==A.current&&(A.current=F,S(F))},[]),E=o||b,R=a||w,T=j.useRef(null),A=j.useRef(null),O=j.useRef(h),L=u!=null,B=Hp(u),I=Hp(i),q=Hp(f),U=j.useCallback(()=>{if(!T.current||!A.current)return;const F={placement:t,strategy:n,middleware:g};I.current&&(F.platform=I.current),vW(T.current,A.current,F).then($=>{const Y={...$,isPositioned:q.current!==!1};D.current&&!df(O.current,Y)&&(O.current=Y,ww.flushSync(()=>{p(Y)}))})},[g,t,n,I,q]);qu(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[f]);const D=j.useRef(!1);qu(()=>(D.current=!0,()=>{D.current=!1}),[]),qu(()=>{if(E&&(T.current=E),R&&(A.current=R),E&&R){if(B.current)return B.current(E,R,U);U()}},[E,R,U,B,L]);const V=j.useMemo(()=>({reference:T,floating:A,setReference:N,setFloating:k}),[N,k]),z=j.useMemo(()=>({reference:E,floating:R}),[E,R]),Q=j.useMemo(()=>{const F={position:n,left:0,top:0};if(!z.floating)return F;const $=xE(z.floating,h.x),Y=xE(z.floating,h.y);return c?{...F,transform:"translate("+$+"px, "+Y+"px)",...QI(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:Y}},[n,c,z.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:U,refs:V,elements:z,floatingStyles:Q}),[h,U,V,z,Q])}const _W=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vE({element:r.current,padding:i}).fn(n):{}:r?vE({element:r,padding:i}).fn(n):{}}}},SW=(e,t)=>({...dW(e),options:[e,t]}),kW=(e,t)=>({...hW(e),options:[e,t]}),EW=(e,t)=>({...yW(e),options:[e,t]}),NW=(e,t)=>({...pW(e),options:[e,t]}),CW=(e,t)=>({...mW(e),options:[e,t]}),jW=(e,t)=>({...gW(e),options:[e,t]}),RW=(e,t)=>({..._W(e),options:[e,t]});var AW="Arrow",JI=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return m.jsx(Je.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});JI.displayName=AW;var TW=JI;function MW(e){const[t,n]=j.useState(void 0);return mi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,c;if("borderBoxSize"in o){const u=o.borderBoxSize,f=Array.isArray(u)?u[0]:u;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 ab="Popper",[ZI,eO]=Ji(ab),[IW,tO]=ZI(ab),nO=e=>{const{__scopePopper:t,children:n}=e,[r,i]=j.useState(null);return m.jsx(IW,{scope:t,anchor:r,onAnchorChange:i,children:n})};nO.displayName=ab;var rO="PopperAnchor",iO=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=tO(rO,n),a=j.useRef(null),c=Et(t,a),u=j.useRef(null);return j.useEffect(()=>{const f=u.current;u.current=(r==null?void 0:r.current)||a.current,f!==u.current&&o.onAnchorChange(u.current)}),r?null:m.jsx(Je.div,{...i,ref:c})});iO.displayName=rO;var lb="PopperContent",[OW,PW]=ZI(lb),sO=j.forwardRef((e,t)=>{var ee,te,oe,fe,he,me;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...x}=e,w=tO(lb,n),[S,N]=j.useState(null),k=Et(t,de=>N(de)),[E,R]=j.useState(null),T=MW(E),A=(T==null?void 0:T.width)??0,O=(T==null?void 0:T.height)??0,L=r+(o!=="center"?"-"+o:""),B=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},I=Array.isArray(f)?f:[f],q=I.length>0,U={padding:B,boundary:I.filter(DW),altBoundary:q},{refs:D,floatingStyles:V,placement:z,isPositioned:Q,middlewareData:F}=bW({strategy:"fixed",placement:L,whileElementsMounted:(...de)=>fW(...de,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[SW({mainAxis:i+O,alignmentAxis:a}),u&&kW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?EW():void 0,...U}),u&&NW({...U}),CW({...U,apply:({elements:de,rects:_e,availableWidth:ve,availableHeight:Ne})=>{const{width:Ee,height:et}=_e.reference,Le=de.floating.style;Le.setProperty("--radix-popper-available-width",`${ve}px`),Le.setProperty("--radix-popper-available-height",`${Ne}px`),Le.setProperty("--radix-popper-anchor-width",`${Ee}px`),Le.setProperty("--radix-popper-anchor-height",`${et}px`)}}),E&&RW({element:E,padding:c}),qW({arrowWidth:A,arrowHeight:O}),g&&jW({strategy:"referenceHidden",...U})]}),[$,Y]=lO(z),P=ar(b);mi(()=>{Q&&(P==null||P())},[Q,P]);const W=(ee=F.arrow)==null?void 0:ee.x,se=(te=F.arrow)==null?void 0:te.y,K=((oe=F.arrow)==null?void 0:oe.centerOffset)!==0,[J,G]=j.useState();return mi(()=>{S&&G(window.getComputedStyle(S).zIndex)},[S]),m.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(fe=F.transformOrigin)==null?void 0:fe.x,(he=F.transformOrigin)==null?void 0:he.y].join(" "),...((me=F.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(OW,{scope:n,placedSide:$,onArrowChange:R,arrowX:W,arrowY:se,shouldHideArrow:K,children:m.jsx(Je.div,{"data-side":$,"data-align":Y,...x,ref:k,style:{...x.style,animation:Q?void 0:"none"}})})})});sO.displayName=lb;var oO="PopperArrow",LW={top:"bottom",right:"left",bottom:"top",left:"right"},aO=j.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=PW(oO,r),a=LW[o.placedSide];return m.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:m.jsx(TW,{...i,ref:n,style:{...i.style,display:"block"}})})});aO.displayName=oO;function DW(e){return e!==null}var qW=e=>({name:"transformOrigin",options:e,fn(t){var w,S,N;const{placement:n,rects:r,middlewareData:i}=t,a=((w=i.arrow)==null?void 0:w.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[f,h]=lO(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(((S=i.arrow)==null?void 0:S.x)??0)+c/2,v=(((N=i.arrow)==null?void 0:N.y)??0)+u/2;let b="",x="";return f==="bottom"?(b=a?p:`${g}px`,x=`${-u}px`):f==="top"?(b=a?p:`${g}px`,x=`${r.floating.height+u}px`):f==="right"?(b=`${-u}px`,x=a?p:`${v}px`):f==="left"&&(b=`${r.floating.width+u}px`,x=a?p:`${v}px`),{data:{x:b,y:x}}}});function lO(e){const[t,n="center"]=e.split("-");return[t,n]}var $W=nO,FW=iO,BW=sO,zW=aO,Kx=["Enter"," "],VW=["ArrowDown","PageUp","Home"],cO=["ArrowUp","PageDown","End"],UW=[...VW,...cO],HW={ltr:[...Kx,"ArrowRight"],rtl:[...Kx,"ArrowLeft"]},WW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tl="Menu",[cl,KW,GW]=jM(Tl),[es,uO]=Ji(Tl,[GW,eO,Of]),Yf=eO(),fO=Of(),[YW,ts]=es(Tl),[XW,Ml]=es(Tl),dO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,c=Yf(t),[u,f]=j.useState(null),h=j.useRef(!1),p=ar(o),g=Dw(i);return j.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),m.jsx($W,{...c,children:m.jsx(YW,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:f,children:m.jsx(XW,{scope:t,onClose:j.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:a,children:r})})})};dO.displayName=Tl;var QW="MenuAnchor",cb=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Yf(n);return m.jsx(FW,{...i,...r,ref:t})});cb.displayName=QW;var ub="MenuPortal",[JW,hO]=es(ub,{forceMount:void 0}),pO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=ts(ub,t);return m.jsx(JW,{scope:t,forceMount:n,children:m.jsx(Ir,{present:n||o.open,children:m.jsx(Tw,{asChild:!0,container:i,children:r})})})};pO.displayName=ub;var bn="MenuContent",[ZW,fb]=es(bn),mO=j.forwardRef((e,t)=>{const n=hO(bn,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ts(bn,e.__scopeMenu),a=Ml(bn,e.__scopeMenu);return m.jsx(cl.Provider,{scope:e.__scopeMenu,children:m.jsx(Ir,{present:r||o.open,children:m.jsx(cl.Slot,{scope:e.__scopeMenu,children:a.modal?m.jsx(e7,{...i,ref:t}):m.jsx(t7,{...i,ref:t})})})})}),e7=j.forwardRef((e,t)=>{const n=ts(bn,e.__scopeMenu),r=j.useRef(null),i=Et(t,r);return j.useEffect(()=>{const o=r.current;if(o)return oM(o)},[]),m.jsx(db,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),t7=j.forwardRef((e,t)=>{const n=ts(bn,e.__scopeMenu);return m.jsx(db,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),n7=rl("MenuContent.ScrollLock"),db=j.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...x}=e,w=ts(bn,n),S=Ml(bn,n),N=Yf(n),k=fO(n),E=KW(n),[R,T]=j.useState(null),A=j.useRef(null),O=Et(t,A,w.onContentChange),L=j.useRef(0),B=j.useRef(""),I=j.useRef(0),q=j.useRef(null),U=j.useRef("right"),D=j.useRef(0),V=b?Mw:j.Fragment,z=b?{as:n7,allowPinchZoom:!0}:void 0,Q=$=>{var ee,te;const Y=B.current+$,P=E().filter(oe=>!oe.disabled),W=document.activeElement,se=(ee=P.find(oe=>oe.ref.current===W))==null?void 0:ee.textValue,K=P.map(oe=>oe.textValue),J=p7(K,Y,se),G=(te=P.find(oe=>oe.textValue===J))==null?void 0:te.ref.current;(function oe(fe){B.current=fe,window.clearTimeout(L.current),fe!==""&&(L.current=window.setTimeout(()=>oe(""),1e3))})(Y),G&&setTimeout(()=>G.focus())};j.useEffect(()=>()=>window.clearTimeout(L.current),[]),QT();const F=j.useCallback($=>{var P,W;return U.current===((P=q.current)==null?void 0:P.side)&&g7($,(W=q.current)==null?void 0:W.area)},[]);return m.jsx(ZW,{scope:n,searchRef:B,onItemEnter:j.useCallback($=>{F($)&&$.preventDefault()},[F]),onItemLeave:j.useCallback($=>{var Y;F($)||((Y=A.current)==null||Y.focus(),T(null))},[F]),onTriggerLeave:j.useCallback($=>{F($)&&$.preventDefault()},[F]),pointerGraceTimerRef:I,onPointerGraceIntentChange:j.useCallback($=>{q.current=$},[]),children:m.jsx(V,{...z,children:m.jsx(Aw,{asChild:!0,trapped:i,onMountAutoFocus:Te(o,$=>{var Y;$.preventDefault(),(Y=A.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(Rw,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:v,children:m.jsx(OM,{asChild:!0,...k,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:T,onEntryFocus:Te(u,$=>{S.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(BW,{role:"menu","aria-orientation":"vertical","data-state":TO(w.open),"data-radix-menu-content":"",dir:S.dir,...N,...x,ref:O,style:{outline:"none",...x.style},onKeyDown:Te(x.onKeyDown,$=>{const P=$.target.closest("[data-radix-menu-content]")===$.currentTarget,W=$.ctrlKey||$.altKey||$.metaKey,se=$.key.length===1;P&&($.key==="Tab"&&$.preventDefault(),!W&&se&&Q($.key));const K=A.current;if($.target!==K||!UW.includes($.key))return;$.preventDefault();const G=E().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);cO.includes($.key)&&G.reverse(),d7(G)}),onBlur:Te(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(L.current),B.current="")}),onPointerMove:Te(e.onPointerMove,ul($=>{const Y=$.target,P=D.current!==$.clientX;if($.currentTarget.contains(Y)&&P){const W=$.clientX>D.current?"right":"left";U.current=W,D.current=$.clientX}}))})})})})})})});mO.displayName=bn;var r7="MenuGroup",hb=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Je.div,{role:"group",...r,ref:t})});hb.displayName=r7;var i7="MenuLabel",gO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Je.div,{...r,ref:t})});gO.displayName=i7;var hf="MenuItem",wE="menu.itemSelect",Xf=j.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=j.useRef(null),a=Ml(hf,e.__scopeMenu),c=fb(hf,e.__scopeMenu),u=Et(t,o),f=j.useRef(!1),h=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent(wE,{bubbles:!0,cancelable:!0});p.addEventListener(wE,v=>r==null?void 0:r(v),{once:!0}),KT(p,g),g.defaultPrevented?f.current=!1:a.onClose()}};return m.jsx(yO,{...i,ref:u,disabled:n,onClick:Te(e.onClick,h),onPointerDown:p=>{var g;(g=e.onPointerDown)==null||g.call(e,p),f.current=!0},onPointerUp:Te(e.onPointerUp,p=>{var g;f.current||(g=p.currentTarget)==null||g.click()}),onKeyDown:Te(e.onKeyDown,p=>{const g=c.searchRef.current!=="";n||g&&p.key===" "||Kx.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Xf.displayName=hf;var yO=j.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=fb(hf,n),c=fO(n),u=j.useRef(null),f=Et(t,u),[h,p]=j.useState(!1),[g,v]=j.useState("");return j.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[o.children]),m.jsx(cl.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:m.jsx(PM,{asChild:!0,...c,focusable:!r,children:m.jsx(Je.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Te(e.onPointerMove,ul(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,ul(b=>a.onItemLeave(b))),onFocus:Te(e.onFocus,()=>p(!0)),onBlur:Te(e.onBlur,()=>p(!1))})})})}),s7="MenuCheckboxItem",vO=j.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.jsx(SO,{scope:e.__scopeMenu,checked:n,children:m.jsx(Xf,{role:"menuitemcheckbox","aria-checked":pf(n)?"mixed":n,...i,ref:t,"data-state":mb(n),onSelect:Te(i.onSelect,()=>r==null?void 0:r(pf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});vO.displayName=s7;var xO="MenuRadioGroup",[o7,a7]=es(xO,{value:void 0,onValueChange:()=>{}}),wO=j.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=ar(r);return m.jsx(o7,{scope:e.__scopeMenu,value:n,onValueChange:o,children:m.jsx(hb,{...i,ref:t})})});wO.displayName=xO;var bO="MenuRadioItem",_O=j.forwardRef((e,t)=>{const{value:n,...r}=e,i=a7(bO,e.__scopeMenu),o=n===i.value;return m.jsx(SO,{scope:e.__scopeMenu,checked:o,children:m.jsx(Xf,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":mb(o),onSelect:Te(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});_O.displayName=bO;var pb="MenuItemIndicator",[SO,l7]=es(pb,{checked:!1}),kO=j.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=l7(pb,n);return m.jsx(Ir,{present:r||pf(o.checked)||o.checked===!0,children:m.jsx(Je.span,{...i,ref:t,"data-state":mb(o.checked)})})});kO.displayName=pb;var c7="MenuSeparator",EO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});EO.displayName=c7;var u7="MenuArrow",NO=j.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Yf(n);return m.jsx(zW,{...i,...r,ref:t})});NO.displayName=u7;var f7="MenuSub",[iJ,CO]=es(f7),Ma="MenuSubTrigger",jO=j.forwardRef((e,t)=>{const n=ts(Ma,e.__scopeMenu),r=Ml(Ma,e.__scopeMenu),i=CO(Ma,e.__scopeMenu),o=fb(Ma,e.__scopeMenu),a=j.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,f={__scopeMenu:e.__scopeMenu},h=j.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return j.useEffect(()=>h,[h]),j.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),m.jsx(cb,{asChild:!0,...f,children:m.jsx(yO,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":TO(n.open),...e,ref:Cw(t,i.onTriggerChange),onClick:p=>{var g;(g=e.onClick)==null||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,ul(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Te(e.onPointerLeave,ul(p=>{var v,b;h();const g=(v=n.content)==null?void 0:v.getBoundingClientRect();if(g){const x=(b=n.content)==null?void 0:b.dataset.side,w=x==="right",S=w?-5:5,N=g[w?"left":"right"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+S,y:p.clientY},{x:N,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:N,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,p=>{var v;const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||HW[r.dir].includes(p.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),p.preventDefault())})})})});jO.displayName=Ma;var RO="MenuSubContent",AO=j.forwardRef((e,t)=>{const n=hO(bn,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ts(bn,e.__scopeMenu),a=Ml(bn,e.__scopeMenu),c=CO(RO,e.__scopeMenu),u=j.useRef(null),f=Et(t,u);return m.jsx(cl.Provider,{scope:e.__scopeMenu,children:m.jsx(Ir,{present:r||o.open,children:m.jsx(cl.Slot,{scope:e.__scopeMenu,children:m.jsx(db,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:f,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var p;a.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Te(e.onFocusOutside,h=>{h.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:Te(e.onKeyDown,h=>{var v;const p=h.currentTarget.contains(h.target),g=WW[a.dir].includes(h.key);p&&g&&(o.onOpenChange(!1),(v=c.trigger)==null||v.focus(),h.preventDefault())})})})})})});AO.displayName=RO;function TO(e){return e?"open":"closed"}function pf(e){return e==="indeterminate"}function mb(e){return pf(e)?"indeterminate":e?"checked":"unchecked"}function d7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function h7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function p7(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=h7(e,Math.max(o,0));i.length===1&&(a=a.filter(f=>f!==n));const u=a.find(f=>f.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function m7(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],u=t[a],f=c.x,h=c.y,p=u.x,g=u.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(i=!i)}return i}function g7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return m7(n,t)}function ul(e){return t=>t.pointerType==="mouse"?e(t):void 0}var y7=dO,v7=cb,x7=pO,w7=mO,b7=hb,_7=gO,S7=Xf,k7=vO,E7=wO,N7=_O,C7=kO,j7=EO,R7=NO,A7=jO,T7=AO,gb="ContextMenu",[M7]=Ji(gb,[uO]),Ft=uO(),[I7,MO]=M7(gb),IO=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,c]=j.useState(!1),u=Ft(t),f=ar(r),h=j.useCallback(p=>{c(p),f(p)},[f]);return m.jsx(I7,{scope:t,open:a,onOpenChange:h,modal:o,children:m.jsx(y7,{...u,dir:i,open:a,onOpenChange:h,modal:o,children:n})})};IO.displayName=gb;var OO="ContextMenuTrigger",PO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=e,o=MO(OO,n),a=Ft(n),c=j.useRef({x:0,y:0}),u=j.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),f=j.useRef(0),h=j.useCallback(()=>window.clearTimeout(f.current),[]),p=g=>{c.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return j.useEffect(()=>h,[h]),j.useEffect(()=>void(r&&h()),[r,h]),m.jsxs(m.Fragment,{children:[m.jsx(v7,{...a,virtualRef:u}),m.jsx(Je.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Te(e.onContextMenu,g=>{h(),p(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Te(e.onPointerDown,Su(g=>{h(),f.current=window.setTimeout(()=>p(g),700)})),onPointerMove:r?e.onPointerMove:Te(e.onPointerMove,Su(h)),onPointerCancel:r?e.onPointerCancel:Te(e.onPointerCancel,Su(h)),onPointerUp:r?e.onPointerUp:Te(e.onPointerUp,Su(h))})]})});PO.displayName=OO;var O7="ContextMenuPortal",LO=e=>{const{__scopeContextMenu:t,...n}=e,r=Ft(t);return m.jsx(x7,{...r,...n})};LO.displayName=O7;var DO="ContextMenuContent",qO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=MO(DO,n),o=Ft(n),a=j.useRef(!1);return m.jsx(w7,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qO.displayName=DO;var P7="ContextMenuGroup",L7=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(b7,{...i,...r,ref:t})});L7.displayName=P7;var D7="ContextMenuLabel",$O=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(_7,{...i,...r,ref:t})});$O.displayName=D7;var q7="ContextMenuItem",FO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(S7,{...i,...r,ref:t})});FO.displayName=q7;var $7="ContextMenuCheckboxItem",BO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(k7,{...i,...r,ref:t})});BO.displayName=$7;var F7="ContextMenuRadioGroup",B7=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(E7,{...i,...r,ref:t})});B7.displayName=F7;var z7="ContextMenuRadioItem",zO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(N7,{...i,...r,ref:t})});zO.displayName=z7;var V7="ContextMenuItemIndicator",VO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(C7,{...i,...r,ref:t})});VO.displayName=V7;var U7="ContextMenuSeparator",UO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(j7,{...i,...r,ref:t})});UO.displayName=U7;var H7="ContextMenuArrow",W7=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(R7,{...i,...r,ref:t})});W7.displayName=H7;var K7="ContextMenuSubTrigger",HO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(A7,{...i,...r,ref:t})});HO.displayName=K7;var G7="ContextMenuSubContent",WO=j.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Ft(n);return m.jsx(T7,{...i,...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)"}})});WO.displayName=G7;function Su(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var Y7=IO,X7=PO,Q7=LO,KO=qO,GO=$O,YO=FO,XO=BO,QO=zO,JO=VO,ZO=UO,eP=HO,tP=WO;const J7=Y7,Z7=X7,eK=j.forwardRef(({className:e,inset:t,children:n,...r},i)=>m.jsxs(eP,{ref:i,className:$t("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,m.jsx("span",{className:"ml-auto text-xs",children:"▶"})]}));eK.displayName=eP.displayName;const tK=j.forwardRef(({className:e,...t},n)=>m.jsx(tP,{ref:n,className:$t("z-50 min-w-[8rem] overflow-hidden rounded-md border border-node-border bg-panel-bg p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t}));tK.displayName=tP.displayName;const nP=j.forwardRef(({className:e,...t},n)=>m.jsx(Q7,{children:m.jsx(KO,{ref:n,className:$t("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})}));nP.displayName=KO.displayName;const Vs=j.forwardRef(({className:e,inset:t,destructive:n,...r},i)=>m.jsx(YO,{ref:i,className:$t("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}));Vs.displayName=YO.displayName;const nK=j.forwardRef(({className:e,children:t,checked:n,...r},i)=>m.jsxs(XO,{ref:i,className:$t("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:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(JO,{children:m.jsx("span",{className:"text-primary",children:"✓"})})}),t]}));nK.displayName=XO.displayName;const rK=j.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(QO,{ref:r,className:$t("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:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(JO,{children:m.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));rK.displayName=QO.displayName;const iK=j.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(GO,{ref:r,className:$t("px-2 py-1.5 text-xs font-semibold text-gray-400",t&&"pl-8",e),...n}));iK.displayName=GO.displayName;const Gx=j.forwardRef(({className:e,...t},n)=>m.jsx(ZO,{ref:n,className:$t("-mx-1 my-1 h-px bg-node-border",e),...t}));Gx.displayName=ZO.displayName;const Ia=({className:e,...t})=>m.jsx("span",{className:$t("ml-auto text-xs tracking-widest text-gray-500",e),...t});Ia.displayName="ContextMenuShortcut";function yb(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 Wp,bE;function sK(){if(bE)return Wp;bE=1;function e(){this.__data__=[],this.size=0}return Wp=e,Wp}var Kp,_E;function No(){if(_E)return Kp;_E=1;function e(t,n){return t===n||t!==t&&n!==n}return Kp=e,Kp}var Gp,SE;function Qf(){if(SE)return Gp;SE=1;var e=No();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return Gp=t,Gp}var Yp,kE;function oK(){if(kE)return Yp;kE=1;var e=Qf(),t=Array.prototype,n=t.splice;function r(i){var o=this.__data__,a=e(o,i);if(a<0)return!1;var c=o.length-1;return a==c?o.pop():n.call(o,a,1),--this.size,!0}return Yp=r,Yp}var Xp,EE;function aK(){if(EE)return Xp;EE=1;var e=Qf();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return Xp=t,Xp}var Qp,NE;function lK(){if(NE)return Qp;NE=1;var e=Qf();function t(n){return e(this.__data__,n)>-1}return Qp=t,Qp}var Jp,CE;function cK(){if(CE)return Jp;CE=1;var e=Qf();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return Jp=t,Jp}var Zp,jE;function Jf(){if(jE)return Zp;jE=1;var e=sK(),t=oK(),n=aK(),r=lK(),i=cK();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Zp=o,Zp}var em,RE;function uK(){if(RE)return em;RE=1;var e=Jf();function t(){this.__data__=new e,this.size=0}return em=t,em}var tm,AE;function fK(){if(AE)return tm;AE=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return tm=e,tm}var nm,TE;function dK(){if(TE)return nm;TE=1;function e(t){return this.__data__.get(t)}return nm=e,nm}var rm,ME;function hK(){if(ME)return rm;ME=1;function e(t){return this.__data__.has(t)}return rm=e,rm}var im,IE;function rP(){if(IE)return im;IE=1;var e=typeof Zc=="object"&&Zc&&Zc.Object===Object&&Zc;return im=e,im}var sm,OE;function Un(){if(OE)return sm;OE=1;var e=rP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return sm=n,sm}var om,PE;function Co(){if(PE)return om;PE=1;var e=Un(),t=e.Symbol;return om=t,om}var am,LE;function pK(){if(LE)return am;LE=1;var e=Co(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(a){var c=n.call(a,i),u=a[i];try{a[i]=void 0;var f=!0}catch{}var h=r.call(a);return f&&(c?a[i]=u:delete a[i]),h}return am=o,am}var lm,DE;function mK(){if(DE)return lm;DE=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return lm=n,lm}var cm,qE;function ns(){if(qE)return cm;qE=1;var e=Co(),t=pK(),n=mK(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function a(c){return c==null?c===void 0?i:r:o&&o in Object(c)?t(c):n(c)}return cm=a,cm}var um,$E;function Sn(){if($E)return um;$E=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return um=e,um}var fm,FE;function Il(){if(FE)return fm;FE=1;var e=ns(),t=Sn(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function a(c){if(!t(c))return!1;var u=e(c);return u==r||u==i||u==n||u==o}return fm=a,fm}var dm,BE;function gK(){if(BE)return dm;BE=1;var e=Un(),t=e["__core-js_shared__"];return dm=t,dm}var hm,zE;function yK(){if(zE)return hm;zE=1;var e=gK(),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 hm=n,hm}var pm,VE;function iP(){if(VE)return pm;VE=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 pm=n,pm}var mm,UE;function vK(){if(UE)return mm;UE=1;var e=Il(),t=yK(),n=Sn(),r=iP(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,u=a.toString,f=c.hasOwnProperty,h=RegExp("^"+u.call(f).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var v=e(g)?h:o;return v.test(r(g))}return mm=p,mm}var gm,HE;function xK(){if(HE)return gm;HE=1;function e(t,n){return t==null?void 0:t[n]}return gm=e,gm}var ym,WE;function rs(){if(WE)return ym;WE=1;var e=vK(),t=xK();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return ym=n,ym}var vm,KE;function vb(){if(KE)return vm;KE=1;var e=rs(),t=Un(),n=e(t,"Map");return vm=n,vm}var xm,GE;function Zf(){if(GE)return xm;GE=1;var e=rs(),t=e(Object,"create");return xm=t,xm}var wm,YE;function wK(){if(YE)return wm;YE=1;var e=Zf();function t(){this.__data__=e?e(null):{},this.size=0}return wm=t,wm}var bm,XE;function bK(){if(XE)return bm;XE=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return bm=e,bm}var _m,QE;function _K(){if(QE)return _m;QE=1;var e=Zf(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var a=this.__data__;if(e){var c=a[o];return c===t?void 0:c}return r.call(a,o)?a[o]:void 0}return _m=i,_m}var Sm,JE;function SK(){if(JE)return Sm;JE=1;var e=Zf(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return Sm=r,Sm}var km,ZE;function kK(){if(ZE)return km;ZE=1;var e=Zf(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return km=n,km}var Em,eN;function EK(){if(eN)return Em;eN=1;var e=wK(),t=bK(),n=_K(),r=SK(),i=kK();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Em=o,Em}var Nm,tN;function NK(){if(tN)return Nm;tN=1;var e=EK(),t=Jf(),n=vb();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Nm=r,Nm}var Cm,nN;function CK(){if(nN)return Cm;nN=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Cm=e,Cm}var jm,rN;function ed(){if(rN)return jm;rN=1;var e=CK();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return jm=t,jm}var Rm,iN;function jK(){if(iN)return Rm;iN=1;var e=ed();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Rm=t,Rm}var Am,sN;function RK(){if(sN)return Am;sN=1;var e=ed();function t(n){return e(this,n).get(n)}return Am=t,Am}var Tm,oN;function AK(){if(oN)return Tm;oN=1;var e=ed();function t(n){return e(this,n).has(n)}return Tm=t,Tm}var Mm,aN;function TK(){if(aN)return Mm;aN=1;var e=ed();function t(n,r){var i=e(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Mm=t,Mm}var Im,lN;function xb(){if(lN)return Im;lN=1;var e=NK(),t=jK(),n=RK(),r=AK(),i=TK();function o(a){var c=-1,u=a==null?0:a.length;for(this.clear();++c<u;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Im=o,Im}var Om,cN;function MK(){if(cN)return Om;cN=1;var e=Jf(),t=vb(),n=xb(),r=200;function i(o,a){var c=this.__data__;if(c instanceof e){var u=c.__data__;if(!t||u.length<r-1)return u.push([o,a]),this.size=++c.size,this;c=this.__data__=new n(u)}return c.set(o,a),this.size=c.size,this}return Om=i,Om}var Pm,uN;function td(){if(uN)return Pm;uN=1;var e=Jf(),t=uK(),n=fK(),r=dK(),i=hK(),o=MK();function a(c){var u=this.__data__=new e(c);this.size=u.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,Pm=a,Pm}var Lm,fN;function wb(){if(fN)return Lm;fN=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i&&n(t[r],r,t)!==!1;);return t}return Lm=e,Lm}var Dm,dN;function sP(){if(dN)return Dm;dN=1;var e=rs(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Dm=t,Dm}var qm,hN;function nd(){if(hN)return qm;hN=1;var e=sP();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return qm=t,qm}var $m,pN;function rd(){if(pN)return $m;pN=1;var e=nd(),t=No(),n=Object.prototype,r=n.hasOwnProperty;function i(o,a,c){var u=o[a];(!(r.call(o,a)&&t(u,c))||c===void 0&&!(a in o))&&e(o,a,c)}return $m=i,$m}var Fm,mN;function Ol(){if(mN)return Fm;mN=1;var e=rd(),t=nd();function n(r,i,o,a){var c=!o;o||(o={});for(var u=-1,f=i.length;++u<f;){var h=i[u],p=a?a(o[h],r[h],h,o,r):void 0;p===void 0&&(p=r[h]),c?t(o,h,p):e(o,h,p)}return o}return Fm=n,Fm}var Bm,gN;function IK(){if(gN)return Bm;gN=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return Bm=e,Bm}var zm,yN;function hr(){if(yN)return zm;yN=1;function e(t){return t!=null&&typeof t=="object"}return zm=e,zm}var Vm,vN;function OK(){if(vN)return Vm;vN=1;var e=ns(),t=hr(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return Vm=r,Vm}var Um,xN;function Pl(){if(xN)return Um;xN=1;var e=OK(),t=hr(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!i.call(a,"callee")};return Um=o,Um}var Hm,wN;function mt(){if(wN)return Hm;wN=1;var e=Array.isArray;return Hm=e,Hm}var Oa={exports:{}},Wm,bN;function PK(){if(bN)return Wm;bN=1;function e(){return!1}return Wm=e,Wm}Oa.exports;var _N;function jo(){return _N||(_N=1,(function(e,t){var n=Un(),r=PK(),i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===i,c=a?n.Buffer:void 0,u=c?c.isBuffer:void 0,f=u||r;e.exports=f})(Oa,Oa.exports)),Oa.exports}var Km,SN;function id(){if(SN)return Km;SN=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??e,!!i&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return Km=n,Km}var Gm,kN;function bb(){if(kN)return Gm;kN=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Gm=t,Gm}var Ym,EN;function LK(){if(EN)return Ym;EN=1;var e=ns(),t=bb(),n=hr(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",a="[object Date]",c="[object Error]",u="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",g="[object RegExp]",v="[object Set]",b="[object String]",x="[object WeakMap]",w="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",R="[object Int16Array]",T="[object Int32Array]",A="[object Uint8Array]",O="[object Uint8ClampedArray]",L="[object Uint16Array]",B="[object Uint32Array]",I={};I[N]=I[k]=I[E]=I[R]=I[T]=I[A]=I[O]=I[L]=I[B]=!0,I[r]=I[i]=I[w]=I[o]=I[S]=I[a]=I[c]=I[u]=I[f]=I[h]=I[p]=I[g]=I[v]=I[b]=I[x]=!1;function q(U){return n(U)&&t(U.length)&&!!I[e(U)]}return Ym=q,Ym}var Xm,NN;function sd(){if(NN)return Xm;NN=1;function e(t){return function(n){return t(n)}}return Xm=e,Xm}var Pa={exports:{}};Pa.exports;var CN;function _b(){return CN||(CN=1,(function(e,t){var n=rP(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,c=(function(){try{var u=i&&i.require&&i.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=c})(Pa,Pa.exports)),Pa.exports}var Qm,jN;function Ll(){if(jN)return Qm;jN=1;var e=LK(),t=sd(),n=_b(),r=n&&n.isTypedArray,i=r?t(r):e;return Qm=i,Qm}var Jm,RN;function oP(){if(RN)return Jm;RN=1;var e=IK(),t=Pl(),n=mt(),r=jo(),i=id(),o=Ll(),a=Object.prototype,c=a.hasOwnProperty;function u(f,h){var p=n(f),g=!p&&t(f),v=!p&&!g&&r(f),b=!p&&!g&&!v&&o(f),x=p||g||v||b,w=x?e(f.length,String):[],S=w.length;for(var N in f)(h||c.call(f,N))&&!(x&&(N=="length"||v&&(N=="offset"||N=="parent")||b&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||i(N,S)))&&w.push(N);return w}return Jm=u,Jm}var Zm,AN;function od(){if(AN)return Zm;AN=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return Zm=t,Zm}var eg,TN;function aP(){if(TN)return eg;TN=1;function e(t,n){return function(r){return t(n(r))}}return eg=e,eg}var tg,MN;function DK(){if(MN)return tg;MN=1;var e=aP(),t=e(Object.keys,Object);return tg=t,tg}var ng,IN;function Sb(){if(IN)return ng;IN=1;var e=od(),t=DK(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!e(o))return t(o);var a=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&a.push(c);return a}return ng=i,ng}var rg,ON;function Or(){if(ON)return rg;ON=1;var e=Il(),t=bb();function n(r){return r!=null&&t(r.length)&&!e(r)}return rg=n,rg}var ig,PN;function xi(){if(PN)return ig;PN=1;var e=oP(),t=Sb(),n=Or();function r(i){return n(i)?e(i):t(i)}return ig=r,ig}var sg,LN;function qK(){if(LN)return sg;LN=1;var e=Ol(),t=xi();function n(r,i){return r&&e(i,t(i),r)}return sg=n,sg}var og,DN;function $K(){if(DN)return og;DN=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return og=e,og}var ag,qN;function FK(){if(qN)return ag;qN=1;var e=Sn(),t=od(),n=$K(),r=Object.prototype,i=r.hasOwnProperty;function o(a){if(!e(a))return n(a);var c=t(a),u=[];for(var f in a)f=="constructor"&&(c||!i.call(a,f))||u.push(f);return u}return ag=o,ag}var lg,$N;function is(){if($N)return lg;$N=1;var e=oP(),t=FK(),n=Or();function r(i){return n(i)?e(i,!0):t(i)}return lg=r,lg}var cg,FN;function BK(){if(FN)return cg;FN=1;var e=Ol(),t=is();function n(r,i){return r&&e(i,t(i),r)}return cg=n,cg}var La={exports:{}};La.exports;var BN;function lP(){return BN||(BN=1,(function(e,t){var n=Un(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o?n.Buffer:void 0,c=a?a.allocUnsafe:void 0;function u(f,h){if(h)return f.slice();var p=f.length,g=c?c(p):new f.constructor(p);return f.copy(g),g}e.exports=u})(La,La.exports)),La.exports}var ug,zN;function cP(){if(zN)return ug;zN=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return ug=e,ug}var fg,VN;function uP(){if(VN)return fg;VN=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=0,a=[];++r<i;){var c=t[r];n(c,r,t)&&(a[o++]=c)}return a}return fg=e,fg}var dg,UN;function fP(){if(UN)return dg;UN=1;function e(){return[]}return dg=e,dg}var hg,HN;function kb(){if(HN)return hg;HN=1;var e=uP(),t=fP(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(a){return a==null?[]:(a=Object(a),e(i(a),function(c){return r.call(a,c)}))}:t;return hg=o,hg}var pg,WN;function zK(){if(WN)return pg;WN=1;var e=Ol(),t=kb();function n(r,i){return e(r,t(r),i)}return pg=n,pg}var mg,KN;function Eb(){if(KN)return mg;KN=1;function e(t,n){for(var r=-1,i=n.length,o=t.length;++r<i;)t[o+r]=n[r];return t}return mg=e,mg}var gg,GN;function ad(){if(GN)return gg;GN=1;var e=aP(),t=e(Object.getPrototypeOf,Object);return gg=t,gg}var yg,YN;function dP(){if(YN)return yg;YN=1;var e=Eb(),t=ad(),n=kb(),r=fP(),i=Object.getOwnPropertySymbols,o=i?function(a){for(var c=[];a;)e(c,n(a)),a=t(a);return c}:r;return yg=o,yg}var vg,XN;function VK(){if(XN)return vg;XN=1;var e=Ol(),t=dP();function n(r,i){return e(r,t(r),i)}return vg=n,vg}var xg,QN;function hP(){if(QN)return xg;QN=1;var e=Eb(),t=mt();function n(r,i,o){var a=i(r);return t(r)?a:e(a,o(r))}return xg=n,xg}var wg,JN;function pP(){if(JN)return wg;JN=1;var e=hP(),t=kb(),n=xi();function r(i){return e(i,n,t)}return wg=r,wg}var bg,ZN;function UK(){if(ZN)return bg;ZN=1;var e=hP(),t=dP(),n=is();function r(i){return e(i,n,t)}return bg=r,bg}var _g,eC;function HK(){if(eC)return _g;eC=1;var e=rs(),t=Un(),n=e(t,"DataView");return _g=n,_g}var Sg,tC;function WK(){if(tC)return Sg;tC=1;var e=rs(),t=Un(),n=e(t,"Promise");return Sg=n,Sg}var kg,nC;function mP(){if(nC)return kg;nC=1;var e=rs(),t=Un(),n=e(t,"Set");return kg=n,kg}var Eg,rC;function KK(){if(rC)return Eg;rC=1;var e=rs(),t=Un(),n=e(t,"WeakMap");return Eg=n,Eg}var Ng,iC;function Ro(){if(iC)return Ng;iC=1;var e=HK(),t=vb(),n=WK(),r=mP(),i=KK(),o=ns(),a=iP(),c="[object Map]",u="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",v=a(e),b=a(t),x=a(n),w=a(r),S=a(i),N=o;return(e&&N(new e(new ArrayBuffer(1)))!=g||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||i&&N(new i)!=p)&&(N=function(k){var E=o(k),R=E==u?k.constructor:void 0,T=R?a(R):"";if(T)switch(T){case v:return g;case b:return c;case x:return f;case w:return h;case S:return p}return E}),Ng=N,Ng}var Cg,sC;function GK(){if(sC)return Cg;sC=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&t.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return Cg=n,Cg}var jg,oC;function gP(){if(oC)return jg;oC=1;var e=Un(),t=e.Uint8Array;return jg=t,jg}var Rg,aC;function Nb(){if(aC)return Rg;aC=1;var e=gP();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return Rg=t,Rg}var Ag,lC;function YK(){if(lC)return Ag;lC=1;var e=Nb();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return Ag=t,Ag}var Tg,cC;function XK(){if(cC)return Tg;cC=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return Tg=t,Tg}var Mg,uC;function QK(){if(uC)return Mg;uC=1;var e=Co(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return Mg=r,Mg}var Ig,fC;function yP(){if(fC)return Ig;fC=1;var e=Nb();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return Ig=t,Ig}var Og,dC;function JK(){if(dC)return Og;dC=1;var e=Nb(),t=YK(),n=XK(),r=QK(),i=yP(),o="[object Boolean]",a="[object Date]",c="[object Map]",u="[object Number]",f="[object RegExp]",h="[object Set]",p="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",N="[object Int16Array]",k="[object Int32Array]",E="[object Uint8Array]",R="[object Uint8ClampedArray]",T="[object Uint16Array]",A="[object Uint32Array]";function O(L,B,I){var q=L.constructor;switch(B){case v:return e(L);case o:case a:return new q(+L);case b:return t(L,I);case x:case w:case S:case N:case k:case E:case R:case T:case A:return i(L,I);case c:return new q;case u:case p:return new q(L);case f:return n(L);case h:return new q;case g:return r(L)}}return Og=O,Og}var Pg,hC;function vP(){if(hC)return Pg;hC=1;var e=Sn(),t=Object.create,n=(function(){function r(){}return function(i){if(!e(i))return{};if(t)return t(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}})();return Pg=n,Pg}var Lg,pC;function xP(){if(pC)return Lg;pC=1;var e=vP(),t=ad(),n=od();function r(i){return typeof i.constructor=="function"&&!n(i)?e(t(i)):{}}return Lg=r,Lg}var Dg,mC;function ZK(){if(mC)return Dg;mC=1;var e=Ro(),t=hr(),n="[object Map]";function r(i){return t(i)&&e(i)==n}return Dg=r,Dg}var qg,gC;function eG(){if(gC)return qg;gC=1;var e=ZK(),t=sd(),n=_b(),r=n&&n.isMap,i=r?t(r):e;return qg=i,qg}var $g,yC;function tG(){if(yC)return $g;yC=1;var e=Ro(),t=hr(),n="[object Set]";function r(i){return t(i)&&e(i)==n}return $g=r,$g}var Fg,vC;function nG(){if(vC)return Fg;vC=1;var e=tG(),t=sd(),n=_b(),r=n&&n.isSet,i=r?t(r):e;return Fg=i,Fg}var Bg,xC;function wP(){if(xC)return Bg;xC=1;var e=td(),t=wb(),n=rd(),r=qK(),i=BK(),o=lP(),a=cP(),c=zK(),u=VK(),f=pP(),h=UK(),p=Ro(),g=GK(),v=JK(),b=xP(),x=mt(),w=jo(),S=eG(),N=Sn(),k=nG(),E=xi(),R=is(),T=1,A=2,O=4,L="[object Arguments]",B="[object Array]",I="[object Boolean]",q="[object Date]",U="[object Error]",D="[object Function]",V="[object GeneratorFunction]",z="[object Map]",Q="[object Number]",F="[object Object]",$="[object RegExp]",Y="[object Set]",P="[object String]",W="[object Symbol]",se="[object WeakMap]",K="[object ArrayBuffer]",J="[object DataView]",G="[object Float32Array]",ee="[object Float64Array]",te="[object Int8Array]",oe="[object Int16Array]",fe="[object Int32Array]",he="[object Uint8Array]",me="[object Uint8ClampedArray]",de="[object Uint16Array]",_e="[object Uint32Array]",ve={};ve[L]=ve[B]=ve[K]=ve[J]=ve[I]=ve[q]=ve[G]=ve[ee]=ve[te]=ve[oe]=ve[fe]=ve[z]=ve[Q]=ve[F]=ve[$]=ve[Y]=ve[P]=ve[W]=ve[he]=ve[me]=ve[de]=ve[_e]=!0,ve[U]=ve[D]=ve[se]=!1;function Ne(Ee,et,Le,gt,yt,it){var Ue,At=et&T,Tt=et&A,Bt=et&O;if(Le&&(Ue=yt?Le(Ee,gt,yt,it):Le(Ee)),Ue!==void 0)return Ue;if(!N(Ee))return Ee;var Me=x(Ee);if(Me){if(Ue=g(Ee),!At)return a(Ee,Ue)}else{var we=p(Ee),st=we==D||we==V;if(w(Ee))return o(Ee,At);if(we==F||we==L||st&&!yt){if(Ue=Tt||st?{}:b(Ee),!At)return Tt?u(Ee,i(Ue,Ee)):c(Ee,r(Ue,Ee))}else{if(!ve[we])return yt?Ee:{};Ue=v(Ee,we,At)}}it||(it=new e);var Be=it.get(Ee);if(Be)return Be;it.set(Ee,Ue),k(Ee)?Ee.forEach(function(Mt){Ue.add(Ne(Mt,et,Le,Mt,Ee,it))}):S(Ee)&&Ee.forEach(function(Mt,It){Ue.set(It,Ne(Mt,et,Le,It,Ee,it))});var zt=Bt?Tt?h:f:Tt?R:E,cn=Me?void 0:zt(Ee);return t(cn||Ee,function(Mt,It){cn&&(It=Mt,Mt=Ee[It]),n(Ue,It,Ne(Mt,et,Le,It,Ee,it))}),Ue}return Bg=Ne,Bg}var zg,wC;function rG(){if(wC)return zg;wC=1;var e=wP(),t=4;function n(r){return e(r,t)}return zg=n,zg}var Vg,bC;function Cb(){if(bC)return Vg;bC=1;function e(t){return function(){return t}}return Vg=e,Vg}var Ug,_C;function iG(){if(_C)return Ug;_C=1;function e(t){return function(n,r,i){for(var o=-1,a=Object(n),c=i(n),u=c.length;u--;){var f=c[t?u:++o];if(r(a[f],f,a)===!1)break}return n}}return Ug=e,Ug}var Hg,SC;function jb(){if(SC)return Hg;SC=1;var e=iG(),t=e();return Hg=t,Hg}var Wg,kC;function Rb(){if(kC)return Wg;kC=1;var e=jb(),t=xi();function n(r,i){return r&&e(r,i,t)}return Wg=n,Wg}var Kg,EC;function sG(){if(EC)return Kg;EC=1;var e=Or();function t(n,r){return function(i,o){if(i==null)return i;if(!e(i))return n(i,o);for(var a=i.length,c=r?a:-1,u=Object(i);(r?c--:++c<a)&&o(u[c],c,u)!==!1;);return i}}return Kg=t,Kg}var Gg,NC;function ld(){if(NC)return Gg;NC=1;var e=Rb(),t=sG(),n=t(e);return Gg=n,Gg}var Yg,CC;function ss(){if(CC)return Yg;CC=1;function e(t){return t}return Yg=e,Yg}var Xg,jC;function bP(){if(jC)return Xg;jC=1;var e=ss();function t(n){return typeof n=="function"?n:e}return Xg=t,Xg}var Qg,RC;function _P(){if(RC)return Qg;RC=1;var e=wb(),t=ld(),n=bP(),r=mt();function i(o,a){var c=r(o)?e:t;return c(o,n(a))}return Qg=i,Qg}var Jg,AC;function SP(){return AC||(AC=1,Jg=_P()),Jg}var Zg,TC;function oG(){if(TC)return Zg;TC=1;var e=ld();function t(n,r){var i=[];return e(n,function(o,a,c){r(o,a,c)&&i.push(o)}),i}return Zg=t,Zg}var ey,MC;function aG(){if(MC)return ey;MC=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return ey=t,ey}var ty,IC;function lG(){if(IC)return ty;IC=1;function e(t){return this.__data__.has(t)}return ty=e,ty}var ny,OC;function kP(){if(OC)return ny;OC=1;var e=xb(),t=aG(),n=lG();function r(i){var o=-1,a=i==null?0:i.length;for(this.__data__=new e;++o<a;)this.add(i[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,ny=r,ny}var ry,PC;function cG(){if(PC)return ry;PC=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return ry=e,ry}var iy,LC;function EP(){if(LC)return iy;LC=1;function e(t,n){return t.has(n)}return iy=e,iy}var sy,DC;function NP(){if(DC)return sy;DC=1;var e=kP(),t=cG(),n=EP(),r=1,i=2;function o(a,c,u,f,h,p){var g=u&r,v=a.length,b=c.length;if(v!=b&&!(g&&b>v))return!1;var x=p.get(a),w=p.get(c);if(x&&w)return x==c&&w==a;var S=-1,N=!0,k=u&i?new e:void 0;for(p.set(a,c),p.set(c,a);++S<v;){var E=a[S],R=c[S];if(f)var T=g?f(R,E,S,c,a,p):f(E,R,S,a,c,p);if(T!==void 0){if(T)continue;N=!1;break}if(k){if(!t(c,function(A,O){if(!n(k,O)&&(E===A||h(E,A,u,f,p)))return k.push(O)})){N=!1;break}}else if(!(E===R||h(E,R,u,f,p))){N=!1;break}}return p.delete(a),p.delete(c),N}return sy=o,sy}var oy,qC;function uG(){if(qC)return oy;qC=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,o){r[++n]=[o,i]}),r}return oy=e,oy}var ay,$C;function Ab(){if($C)return ay;$C=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return ay=e,ay}var ly,FC;function fG(){if(FC)return ly;FC=1;var e=Co(),t=gP(),n=No(),r=NP(),i=uG(),o=Ab(),a=1,c=2,u="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",v="[object RegExp]",b="[object Set]",x="[object String]",w="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",k=e?e.prototype:void 0,E=k?k.valueOf:void 0;function R(T,A,O,L,B,I,q){switch(O){case N:if(T.byteLength!=A.byteLength||T.byteOffset!=A.byteOffset)return!1;T=T.buffer,A=A.buffer;case S:return!(T.byteLength!=A.byteLength||!I(new t(T),new t(A)));case u:case f:case g:return n(+T,+A);case h:return T.name==A.name&&T.message==A.message;case v:case x:return T==A+"";case p:var U=i;case b:var D=L&a;if(U||(U=o),T.size!=A.size&&!D)return!1;var V=q.get(T);if(V)return V==A;L|=c,q.set(T,A);var z=r(U(T),U(A),L,B,I,q);return q.delete(T),z;case w:if(E)return E.call(T)==E.call(A)}return!1}return ly=R,ly}var cy,BC;function dG(){if(BC)return cy;BC=1;var e=pP(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,a,c,u,f,h){var p=c&t,g=e(o),v=g.length,b=e(a),x=b.length;if(v!=x&&!p)return!1;for(var w=v;w--;){var S=g[w];if(!(p?S in a:r.call(a,S)))return!1}var N=h.get(o),k=h.get(a);if(N&&k)return N==a&&k==o;var E=!0;h.set(o,a),h.set(a,o);for(var R=p;++w<v;){S=g[w];var T=o[S],A=a[S];if(u)var O=p?u(A,T,S,a,o,h):u(T,A,S,o,a,h);if(!(O===void 0?T===A||f(T,A,c,u,h):O)){E=!1;break}R||(R=S=="constructor")}if(E&&!R){var L=o.constructor,B=a.constructor;L!=B&&"constructor"in o&&"constructor"in a&&!(typeof L=="function"&&L instanceof L&&typeof B=="function"&&B instanceof B)&&(E=!1)}return h.delete(o),h.delete(a),E}return cy=i,cy}var uy,zC;function hG(){if(zC)return uy;zC=1;var e=td(),t=NP(),n=fG(),r=dG(),i=Ro(),o=mt(),a=jo(),c=Ll(),u=1,f="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function b(x,w,S,N,k,E){var R=o(x),T=o(w),A=R?h:i(x),O=T?h:i(w);A=A==f?p:A,O=O==f?p:O;var L=A==p,B=O==p,I=A==O;if(I&&a(x)){if(!a(w))return!1;R=!0,L=!1}if(I&&!L)return E||(E=new e),R||c(x)?t(x,w,S,N,k,E):n(x,w,A,S,N,k,E);if(!(S&u)){var q=L&&v.call(x,"__wrapped__"),U=B&&v.call(w,"__wrapped__");if(q||U){var D=q?x.value():x,V=U?w.value():w;return E||(E=new e),k(D,V,S,N,E)}}return I?(E||(E=new e),r(x,w,S,N,k,E)):!1}return uy=b,uy}var fy,VC;function CP(){if(VC)return fy;VC=1;var e=hG(),t=hr();function n(r,i,o,a,c){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,o,a,n,c)}return fy=n,fy}var dy,UC;function pG(){if(UC)return dy;UC=1;var e=td(),t=CP(),n=1,r=2;function i(o,a,c,u){var f=c.length,h=f,p=!u;if(o==null)return!h;for(o=Object(o);f--;){var g=c[f];if(p&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++f<h;){g=c[f];var v=g[0],b=o[v],x=g[1];if(p&&g[2]){if(b===void 0&&!(v in o))return!1}else{var w=new e;if(u)var S=u(b,x,v,o,a,w);if(!(S===void 0?t(x,b,n|r,u,w):S))return!1}}return!0}return dy=i,dy}var hy,HC;function jP(){if(HC)return hy;HC=1;var e=Sn();function t(n){return n===n&&!e(n)}return hy=t,hy}var py,WC;function mG(){if(WC)return py;WC=1;var e=jP(),t=xi();function n(r){for(var i=t(r),o=i.length;o--;){var a=i[o],c=r[a];i[o]=[a,c,e(c)]}return i}return py=n,py}var my,KC;function RP(){if(KC)return my;KC=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return my=e,my}var gy,GC;function gG(){if(GC)return gy;GC=1;var e=pG(),t=mG(),n=RP();function r(i){var o=t(i);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(a){return a===i||e(a,i,o)}}return gy=r,gy}var yy,YC;function Ao(){if(YC)return yy;YC=1;var e=ns(),t=hr(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return yy=r,yy}var vy,XC;function Tb(){if(XC)return vy;XC=1;var e=mt(),t=Ao(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,a){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||a!=null&&o in Object(a)}return vy=i,vy}var xy,QC;function yG(){if(QC)return xy;QC=1;var e=xb(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var a=arguments,c=i?i.apply(this,a):a[0],u=o.cache;if(u.has(c))return u.get(c);var f=r.apply(this,a);return o.cache=u.set(c,f)||u,f};return o.cache=new(n.Cache||e),o}return n.Cache=e,xy=n,xy}var wy,JC;function vG(){if(JC)return wy;JC=1;var e=yG(),t=500;function n(r){var i=e(r,function(a){return o.size===t&&o.clear(),a}),o=i.cache;return i}return wy=n,wy}var by,ZC;function xG(){if(ZC)return by;ZC=1;var e=vG(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(a,c,u,f){o.push(u?f.replace(n,"$1"):c||a)}),o});return by=r,by}var _y,e2;function cd(){if(e2)return _y;e2=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=Array(i);++r<i;)o[r]=n(t[r],r,t);return o}return _y=e,_y}var Sy,t2;function wG(){if(t2)return Sy;t2=1;var e=Co(),t=cd(),n=mt(),r=Ao(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function a(c){if(typeof c=="string")return c;if(n(c))return t(c,a)+"";if(r(c))return o?o.call(c):"";var u=c+"";return u=="0"&&1/c==-1/0?"-0":u}return Sy=a,Sy}var ky,n2;function AP(){if(n2)return ky;n2=1;var e=wG();function t(n){return n==null?"":e(n)}return ky=t,ky}var Ey,r2;function ud(){if(r2)return Ey;r2=1;var e=mt(),t=Tb(),n=xG(),r=AP();function i(o,a){return e(o)?o:t(o,a)?[o]:n(r(o))}return Ey=i,Ey}var Ny,i2;function Dl(){if(i2)return Ny;i2=1;var e=Ao();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Ny=t,Ny}var Cy,s2;function fd(){if(s2)return Cy;s2=1;var e=ud(),t=Dl();function n(r,i){i=e(i,r);for(var o=0,a=i.length;r!=null&&o<a;)r=r[t(i[o++])];return o&&o==a?r:void 0}return Cy=n,Cy}var jy,o2;function bG(){if(o2)return jy;o2=1;var e=fd();function t(n,r,i){var o=n==null?void 0:e(n,r);return o===void 0?i:o}return jy=t,jy}var Ry,a2;function _G(){if(a2)return Ry;a2=1;function e(t,n){return t!=null&&n in Object(t)}return Ry=e,Ry}var Ay,l2;function TP(){if(l2)return Ay;l2=1;var e=ud(),t=Pl(),n=mt(),r=id(),i=bb(),o=Dl();function a(c,u,f){u=e(u,c);for(var h=-1,p=u.length,g=!1;++h<p;){var v=o(u[h]);if(!(g=c!=null&&f(c,v)))break;c=c[v]}return g||++h!=p?g:(p=c==null?0:c.length,!!p&&i(p)&&r(v,p)&&(n(c)||t(c)))}return Ay=a,Ay}var Ty,c2;function MP(){if(c2)return Ty;c2=1;var e=_G(),t=TP();function n(r,i){return r!=null&&t(r,i,e)}return Ty=n,Ty}var My,u2;function SG(){if(u2)return My;u2=1;var e=CP(),t=bG(),n=MP(),r=Tb(),i=jP(),o=RP(),a=Dl(),c=1,u=2;function f(h,p){return r(h)&&i(p)?o(a(h),p):function(g){var v=t(g,h);return v===void 0&&v===p?n(g,h):e(p,v,c|u)}}return My=f,My}var Iy,f2;function IP(){if(f2)return Iy;f2=1;function e(t){return function(n){return n==null?void 0:n[t]}}return Iy=e,Iy}var Oy,d2;function kG(){if(d2)return Oy;d2=1;var e=fd();function t(n){return function(r){return e(r,n)}}return Oy=t,Oy}var Py,h2;function EG(){if(h2)return Py;h2=1;var e=IP(),t=kG(),n=Tb(),r=Dl();function i(o){return n(o)?e(r(o)):t(o)}return Py=i,Py}var Ly,p2;function Pr(){if(p2)return Ly;p2=1;var e=gG(),t=SG(),n=ss(),r=mt(),i=EG();function o(a){return typeof a=="function"?a:a==null?n:typeof a=="object"?r(a)?t(a[0],a[1]):e(a):i(a)}return Ly=o,Ly}var Dy,m2;function OP(){if(m2)return Dy;m2=1;var e=uP(),t=oG(),n=Pr(),r=mt();function i(o,a){var c=r(o)?e:t;return c(o,n(a,3))}return Dy=i,Dy}var qy,g2;function NG(){if(g2)return qy;g2=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return qy=n,qy}var $y,y2;function PP(){if(y2)return $y;y2=1;var e=NG(),t=TP();function n(r,i){return r!=null&&t(r,i,e)}return $y=n,$y}var Fy,v2;function CG(){if(v2)return Fy;v2=1;var e=Sb(),t=Ro(),n=Pl(),r=mt(),i=Or(),o=jo(),a=od(),c=Ll(),u="[object Map]",f="[object Set]",h=Object.prototype,p=h.hasOwnProperty;function g(v){if(v==null)return!0;if(i(v)&&(r(v)||typeof v=="string"||typeof v.splice=="function"||o(v)||c(v)||n(v)))return!v.length;var b=t(v);if(b==u||b==f)return!v.size;if(a(v))return!e(v).length;for(var x in v)if(p.call(v,x))return!1;return!0}return Fy=g,Fy}var By,x2;function LP(){if(x2)return By;x2=1;function e(t){return t===void 0}return By=e,By}var zy,w2;function DP(){if(w2)return zy;w2=1;var e=ld(),t=Or();function n(r,i){var o=-1,a=t(r)?Array(r.length):[];return e(r,function(c,u,f){a[++o]=i(c,u,f)}),a}return zy=n,zy}var Vy,b2;function qP(){if(b2)return Vy;b2=1;var e=cd(),t=Pr(),n=DP(),r=mt();function i(o,a){var c=r(o)?e:n;return c(o,t(a,3))}return Vy=i,Vy}var Uy,_2;function jG(){if(_2)return Uy;_2=1;function e(t,n,r,i){var o=-1,a=t==null?0:t.length;for(i&&a&&(r=t[++o]);++o<a;)r=n(r,t[o],o,t);return r}return Uy=e,Uy}var Hy,S2;function RG(){if(S2)return Hy;S2=1;function e(t,n,r,i,o){return o(t,function(a,c,u){r=i?(i=!1,a):n(r,a,c,u)}),r}return Hy=e,Hy}var Wy,k2;function $P(){if(k2)return Wy;k2=1;var e=jG(),t=ld(),n=Pr(),r=RG(),i=mt();function o(a,c,u){var f=i(a)?e:r,h=arguments.length<3;return f(a,n(c,4),u,h,t)}return Wy=o,Wy}var Ky,E2;function AG(){if(E2)return Ky;E2=1;var e=ns(),t=mt(),n=hr(),r="[object String]";function i(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Ky=i,Ky}var Gy,N2;function TG(){if(N2)return Gy;N2=1;var e=IP(),t=e("length");return Gy=t,Gy}var Yy,C2;function MG(){if(C2)return Yy;C2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",a="\\u200d",c=RegExp("["+a+e+i+o+"]");function u(f){return c.test(f)}return Yy=u,Yy}var Xy,j2;function IG(){if(j2)return Xy;j2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",a="["+e+"]",c="["+i+"]",u="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+u+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=f+"?",x="["+o+"]?",w="(?:"+v+"(?:"+[h,p,g].join("|")+")"+x+b+")*",S=x+b+w,N="(?:"+[h+c+"?",c,p,g,a].join("|")+")",k=RegExp(u+"(?="+u+")|"+N+S,"g");function E(R){for(var T=k.lastIndex=0;k.test(R);)++T;return T}return Xy=E,Xy}var Qy,R2;function OG(){if(R2)return Qy;R2=1;var e=TG(),t=MG(),n=IG();function r(i){return t(i)?n(i):e(i)}return Qy=r,Qy}var Jy,A2;function PG(){if(A2)return Jy;A2=1;var e=Sb(),t=Ro(),n=Or(),r=AG(),i=OG(),o="[object Map]",a="[object Set]";function c(u){if(u==null)return 0;if(n(u))return r(u)?i(u):u.length;var f=t(u);return f==o||f==a?u.size:e(u).length}return Jy=c,Jy}var Zy,T2;function LG(){if(T2)return Zy;T2=1;var e=wb(),t=vP(),n=Rb(),r=Pr(),i=ad(),o=mt(),a=jo(),c=Il(),u=Sn(),f=Ll();function h(p,g,v){var b=o(p),x=b||a(p)||f(p);if(g=r(g,4),v==null){var w=p&&p.constructor;x?v=b?new w:[]:u(p)?v=c(w)?t(i(p)):{}:v={}}return(x?e:n)(p,function(S,N,k){return g(v,S,N,k)}),v}return Zy=h,Zy}var ev,M2;function DG(){if(M2)return ev;M2=1;var e=Co(),t=Pl(),n=mt(),r=e?e.isConcatSpreadable:void 0;function i(o){return n(o)||t(o)||!!(r&&o&&o[r])}return ev=i,ev}var tv,I2;function Mb(){if(I2)return tv;I2=1;var e=Eb(),t=DG();function n(r,i,o,a,c){var u=-1,f=r.length;for(o||(o=t),c||(c=[]);++u<f;){var h=r[u];i>0&&o(h)?i>1?n(h,i-1,o,a,c):e(c,h):a||(c[c.length]=h)}return c}return tv=n,tv}var nv,O2;function qG(){if(O2)return nv;O2=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 nv=e,nv}var rv,P2;function FP(){if(P2)return rv;P2=1;var e=qG(),t=Math.max;function n(r,i,o){return i=t(i===void 0?r.length-1:i,0),function(){for(var a=arguments,c=-1,u=t(a.length-i,0),f=Array(u);++c<u;)f[c]=a[i+c];c=-1;for(var h=Array(i+1);++c<i;)h[c]=a[c];return h[i]=o(f),e(r,this,h)}}return rv=n,rv}var iv,L2;function $G(){if(L2)return iv;L2=1;var e=Cb(),t=sP(),n=ss(),r=t?function(i,o){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return iv=r,iv}var sv,D2;function FG(){if(D2)return sv;D2=1;var e=800,t=16,n=Date.now;function r(i){var o=0,a=0;return function(){var c=n(),u=t-(c-a);if(a=c,u>0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return sv=r,sv}var ov,q2;function BP(){if(q2)return ov;q2=1;var e=$G(),t=FG(),n=t(e);return ov=n,ov}var av,$2;function dd(){if($2)return av;$2=1;var e=ss(),t=FP(),n=BP();function r(i,o){return n(t(i,o,e),i+"")}return av=r,av}var lv,F2;function zP(){if(F2)return lv;F2=1;function e(t,n,r,i){for(var o=t.length,a=r+(i?1:-1);i?a--:++a<o;)if(n(t[a],a,t))return a;return-1}return lv=e,lv}var cv,B2;function BG(){if(B2)return cv;B2=1;function e(t){return t!==t}return cv=e,cv}var uv,z2;function zG(){if(z2)return uv;z2=1;function e(t,n,r){for(var i=r-1,o=t.length;++i<o;)if(t[i]===n)return i;return-1}return uv=e,uv}var fv,V2;function VG(){if(V2)return fv;V2=1;var e=zP(),t=BG(),n=zG();function r(i,o,a){return o===o?n(i,o,a):e(i,t,a)}return fv=r,fv}var dv,U2;function UG(){if(U2)return dv;U2=1;var e=VG();function t(n,r){var i=n==null?0:n.length;return!!i&&e(n,r,0)>-1}return dv=t,dv}var hv,H2;function HG(){if(H2)return hv;H2=1;function e(t,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;)if(r(n,t[i]))return!0;return!1}return hv=e,hv}var pv,W2;function WG(){if(W2)return pv;W2=1;function e(){}return pv=e,pv}var mv,K2;function KG(){if(K2)return mv;K2=1;var e=mP(),t=WG(),n=Ab(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return mv=i,mv}var gv,G2;function GG(){if(G2)return gv;G2=1;var e=kP(),t=UG(),n=HG(),r=EP(),i=KG(),o=Ab(),a=200;function c(u,f,h){var p=-1,g=t,v=u.length,b=!0,x=[],w=x;if(h)b=!1,g=n;else if(v>=a){var S=f?null:i(u);if(S)return o(S);b=!1,g=r,w=new e}else w=f?[]:x;e:for(;++p<v;){var N=u[p],k=f?f(N):N;if(N=h||N!==0?N:0,b&&k===k){for(var E=w.length;E--;)if(w[E]===k)continue e;f&&w.push(k),x.push(N)}else g(w,k,h)||(w!==x&&w.push(k),x.push(N))}return x}return gv=c,gv}var yv,Y2;function VP(){if(Y2)return yv;Y2=1;var e=Or(),t=hr();function n(r){return t(r)&&e(r)}return yv=n,yv}var vv,X2;function YG(){if(X2)return vv;X2=1;var e=Mb(),t=dd(),n=GG(),r=VP(),i=t(function(o){return n(e(o,1,r,!0))});return vv=i,vv}var xv,Q2;function XG(){if(Q2)return xv;Q2=1;var e=cd();function t(n,r){return e(r,function(i){return n[i]})}return xv=t,xv}var wv,J2;function UP(){if(J2)return wv;J2=1;var e=XG(),t=xi();function n(r){return r==null?[]:e(r,t(r))}return wv=n,wv}var bv,Z2;function kn(){if(Z2)return bv;Z2=1;var e;if(typeof yb=="function")try{e={clone:rG(),constant:Cb(),each:SP(),filter:OP(),has:PP(),isArray:mt(),isEmpty:CG(),isFunction:Il(),isUndefined:LP(),keys:xi(),map:qP(),reduce:$P(),size:PG(),transform:LG(),union:YG(),values:UP()}}catch{}return e||(e=window._),bv=e,bv}var _v,ej;function Ib(){if(ej)return _v;ej=1;var e=kn();_v=i;var t="\0",n="\0",r="";function i(h){this._isDirected=e.has(h,"directed")?h.directed:!0,this._isMultigraph=e.has(h,"multigraph")?h.multigraph:!1,this._isCompound=e.has(h,"compound")?h.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(h){return this._label=h,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(h){return e.isFunction(h)||(h=e.constant(h)),this._defaultNodeLabelFn=h,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return e.keys(this._nodes)},i.prototype.sources=function(){var h=this;return e.filter(this.nodes(),function(p){return e.isEmpty(h._in[p])})},i.prototype.sinks=function(){var h=this;return e.filter(this.nodes(),function(p){return e.isEmpty(h._out[p])})},i.prototype.setNodes=function(h,p){var g=arguments,v=this;return e.each(h,function(b){g.length>1?v.setNode(b,p):v.setNode(b)}),this},i.prototype.setNode=function(h,p){return e.has(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=p),this):(this._nodes[h]=arguments.length>1?p:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=n,this._children[h]={},this._children[n][h]=!0),this._in[h]={},this._preds[h]={},this._out[h]={},this._sucs[h]={},++this._nodeCount,this)},i.prototype.node=function(h){return this._nodes[h]},i.prototype.hasNode=function(h){return e.has(this._nodes,h)},i.prototype.removeNode=function(h){var p=this;if(e.has(this._nodes,h)){var g=function(v){p.removeEdge(p._edgeObjs[v])};delete this._nodes[h],this._isCompound&&(this._removeFromParentsChildList(h),delete this._parent[h],e.each(this.children(h),function(v){p.setParent(v)}),delete this._children[h]),e.each(e.keys(this._in[h]),g),delete this._in[h],delete this._preds[h],e.each(e.keys(this._out[h]),g),delete this._out[h],delete this._sucs[h],--this._nodeCount}return this},i.prototype.setParent=function(h,p){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(p))p=n;else{p+="";for(var g=p;!e.isUndefined(g);g=this.parent(g))if(g===h)throw new Error("Setting "+p+" as parent of "+h+" would create a cycle");this.setNode(p)}return this.setNode(h),this._removeFromParentsChildList(h),this._parent[h]=p,this._children[p][h]=!0,this},i.prototype._removeFromParentsChildList=function(h){delete this._children[this._parent[h]][h]},i.prototype.parent=function(h){if(this._isCompound){var p=this._parent[h];if(p!==n)return p}},i.prototype.children=function(h){if(e.isUndefined(h)&&(h=n),this._isCompound){var p=this._children[h];if(p)return e.keys(p)}else{if(h===n)return this.nodes();if(this.hasNode(h))return[]}},i.prototype.predecessors=function(h){var p=this._preds[h];if(p)return e.keys(p)},i.prototype.successors=function(h){var p=this._sucs[h];if(p)return e.keys(p)},i.prototype.neighbors=function(h){var p=this.predecessors(h);if(p)return e.union(p,this.successors(h))},i.prototype.isLeaf=function(h){var p;return this.isDirected()?p=this.successors(h):p=this.neighbors(h),p.length===0},i.prototype.filterNodes=function(h){var p=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});p.setGraph(this.graph());var g=this;e.each(this._nodes,function(x,w){h(w)&&p.setNode(w,x)}),e.each(this._edgeObjs,function(x){p.hasNode(x.v)&&p.hasNode(x.w)&&p.setEdge(x,g.edge(x))});var v={};function b(x){var w=g.parent(x);return w===void 0||p.hasNode(w)?(v[x]=w,w):w in v?v[w]:b(w)}return this._isCompound&&e.each(p.nodes(),function(x){p.setParent(x,b(x))}),p},i.prototype.setDefaultEdgeLabel=function(h){return e.isFunction(h)||(h=e.constant(h)),this._defaultEdgeLabelFn=h,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return e.values(this._edgeObjs)},i.prototype.setPath=function(h,p){var g=this,v=arguments;return e.reduce(h,function(b,x){return v.length>1?g.setEdge(b,x,p):g.setEdge(b,x),x}),this},i.prototype.setEdge=function(){var h,p,g,v,b=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(h=x.v,p=x.w,g=x.name,arguments.length===2&&(v=arguments[1],b=!0)):(h=x,p=arguments[1],g=arguments[3],arguments.length>2&&(v=arguments[2],b=!0)),h=""+h,p=""+p,e.isUndefined(g)||(g=""+g);var w=c(this._isDirected,h,p,g);if(e.has(this._edgeLabels,w))return b&&(this._edgeLabels[w]=v),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(p),this._edgeLabels[w]=b?v:this._defaultEdgeLabelFn(h,p,g);var S=u(this._isDirected,h,p,g);return h=S.v,p=S.w,Object.freeze(S),this._edgeObjs[w]=S,o(this._preds[p],h),o(this._sucs[h],p),this._in[p][w]=S,this._out[h][w]=S,this._edgeCount++,this},i.prototype.edge=function(h,p,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,h,p,g);return this._edgeLabels[v]},i.prototype.hasEdge=function(h,p,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,h,p,g);return e.has(this._edgeLabels,v)},i.prototype.removeEdge=function(h,p,g){var v=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,h,p,g),b=this._edgeObjs[v];return b&&(h=b.v,p=b.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[p],h),a(this._sucs[h],p),delete this._in[p][v],delete this._out[h][v],this._edgeCount--),this},i.prototype.inEdges=function(h,p){var g=this._in[h];if(g){var v=e.values(g);return p?e.filter(v,function(b){return b.v===p}):v}},i.prototype.outEdges=function(h,p){var g=this._out[h];if(g){var v=e.values(g);return p?e.filter(v,function(b){return b.w===p}):v}},i.prototype.nodeEdges=function(h,p){var g=this.inEdges(h,p);if(g)return g.concat(this.outEdges(h,p))};function o(h,p){h[p]?h[p]++:h[p]=1}function a(h,p){--h[p]||delete h[p]}function c(h,p,g,v){var b=""+p,x=""+g;if(!h&&b>x){var w=b;b=x,x=w}return b+r+x+r+(e.isUndefined(v)?t:v)}function u(h,p,g,v){var b=""+p,x=""+g;if(!h&&b>x){var w=b;b=x,x=w}var S={v:b,w:x};return v&&(S.name=v),S}function f(h,p){return c(h,p.v,p.w,p.name)}return _v}var Sv,tj;function QG(){return tj||(tj=1,Sv="2.1.8"),Sv}var kv,nj;function JG(){return nj||(nj=1,kv={Graph:Ib(),version:QG()}),kv}var Ev,rj;function ZG(){if(rj)return Ev;rj=1;var e=kn(),t=Ib();Ev={write:n,read:o};function n(a){var c={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:i(a)};return e.isUndefined(a.graph())||(c.value=e.clone(a.graph())),c}function r(a){return e.map(a.nodes(),function(c){var u=a.node(c),f=a.parent(c),h={v:c};return e.isUndefined(u)||(h.value=u),e.isUndefined(f)||(h.parent=f),h})}function i(a){return e.map(a.edges(),function(c){var u=a.edge(c),f={v:c.v,w:c.w};return e.isUndefined(c.name)||(f.name=c.name),e.isUndefined(u)||(f.value=u),f})}function o(a){var c=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(u){c.setNode(u.v,u.value),u.parent&&c.setParent(u.v,u.parent)}),e.each(a.edges,function(u){c.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),c}return Ev}var Nv,ij;function eY(){if(ij)return Nv;ij=1;var e=kn();Nv=t;function t(n){var r={},i=[],o;function a(c){e.has(r,c)||(r[c]=!0,o.push(c),e.each(n.successors(c),a),e.each(n.predecessors(c),a))}return e.each(n.nodes(),function(c){o=[],a(c),o.length&&i.push(o)}),i}return Nv}var Cv,sj;function HP(){if(sj)return Cv;sj=1;var e=kn();Cv=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 i=this._keyIndices;if(n=String(n),!e.has(i,n)){var o=this._arr,a=o.length;return i[n]=a,o.push({key:n,priority:r}),this._decrease(a),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)},t.prototype._heapify=function(n){var r=this._arr,i=2*n,o=i+1,a=n;i<r.length&&(a=r[i].priority<r[a].priority?i:a,o<r.length&&(a=r[o].priority<r[a].priority?o:a),a!==n&&(this._swap(n,a),this._heapify(a)))},t.prototype._decrease=function(n){for(var r=this._arr,i=r[n].priority,o;n!==0&&(o=n>>1,!(r[o].priority<i));)this._swap(n,o),n=o},t.prototype._swap=function(n,r){var i=this._arr,o=this._keyIndices,a=i[n],c=i[r];i[n]=c,i[r]=a,o[c.key]=n,o[a.key]=r},Cv}var jv,oj;function WP(){if(oj)return jv;oj=1;var e=kn(),t=HP();jv=r;var n=e.constant(1);function r(o,a,c,u){return i(o,String(a),c||n,u||function(f){return o.outEdges(f)})}function i(o,a,c,u){var f={},h=new t,p,g,v=function(b){var x=b.v!==p?b.v:b.w,w=f[x],S=c(b),N=g.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+S);N<w.distance&&(w.distance=N,w.predecessor=p,h.decrease(x,N))};for(o.nodes().forEach(function(b){var x=b===a?0:Number.POSITIVE_INFINITY;f[b]={distance:x},h.add(b,x)});h.size()>0&&(p=h.removeMin(),g=f[p],g.distance!==Number.POSITIVE_INFINITY);)u(p).forEach(v);return f}return jv}var Rv,aj;function tY(){if(aj)return Rv;aj=1;var e=WP(),t=kn();Rv=n;function n(r,i,o){return t.transform(r.nodes(),function(a,c){a[c]=e(r,c,i,o)},{})}return Rv}var Av,lj;function KP(){if(lj)return Av;lj=1;var e=kn();Av=t;function t(n){var r=0,i=[],o={},a=[];function c(u){var f=o[u]={onStack:!0,lowlink:r,index:r++};if(i.push(u),n.successors(u).forEach(function(g){e.has(o,g)?o[g].onStack&&(f.lowlink=Math.min(f.lowlink,o[g].index)):(c(g),f.lowlink=Math.min(f.lowlink,o[g].lowlink))}),f.lowlink===f.index){var h=[],p;do p=i.pop(),o[p].onStack=!1,h.push(p);while(u!==p);a.push(h)}}return n.nodes().forEach(function(u){e.has(o,u)||c(u)}),a}return Av}var Tv,cj;function nY(){if(cj)return Tv;cj=1;var e=kn(),t=KP();Tv=n;function n(r){return e.filter(t(r),function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return Tv}var Mv,uj;function rY(){if(uj)return Mv;uj=1;var e=kn();Mv=n;var t=e.constant(1);function n(i,o,a){return r(i,o||t,a||function(c){return i.outEdges(c)})}function r(i,o,a){var c={},u=i.nodes();return u.forEach(function(f){c[f]={},c[f][f]={distance:0},u.forEach(function(h){f!==h&&(c[f][h]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(h){var p=h.v===f?h.w:h.v,g=o(h);c[f][p]={distance:g,predecessor:f}})}),u.forEach(function(f){var h=c[f];u.forEach(function(p){var g=c[p];u.forEach(function(v){var b=g[f],x=h[v],w=g[v],S=b.distance+x.distance;S<w.distance&&(w.distance=S,w.predecessor=x.predecessor)})})}),c}return Mv}var Iv,fj;function GP(){if(fj)return Iv;fj=1;var e=kn();Iv=t,t.CycleException=n;function t(r){var i={},o={},a=[];function c(u){if(e.has(o,u))throw new n;e.has(i,u)||(o[u]=!0,i[u]=!0,e.each(r.predecessors(u),c),delete o[u],a.push(u))}if(e.each(r.sinks(),c),e.size(i)!==r.nodeCount())throw new n;return a}function n(){}return n.prototype=new Error,Iv}var Ov,dj;function iY(){if(dj)return Ov;dj=1;var e=GP();Ov=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Ov}var Pv,hj;function YP(){if(hj)return Pv;hj=1;var e=kn();Pv=t;function t(r,i,o){e.isArray(i)||(i=[i]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),c=[],u={};return e.each(i,function(f){if(!r.hasNode(f))throw new Error("Graph does not have node: "+f);n(r,f,o==="post",u,a,c)}),c}function n(r,i,o,a,c,u){e.has(a,i)||(a[i]=!0,o||u.push(i),e.each(c(i),function(f){n(r,f,o,a,c,u)}),o&&u.push(i))}return Pv}var Lv,pj;function sY(){if(pj)return Lv;pj=1;var e=YP();Lv=t;function t(n,r){return e(n,r,"post")}return Lv}var Dv,mj;function oY(){if(mj)return Dv;mj=1;var e=YP();Dv=t;function t(n,r){return e(n,r,"pre")}return Dv}var qv,gj;function aY(){if(gj)return qv;gj=1;var e=kn(),t=Ib(),n=HP();qv=r;function r(i,o){var a=new t,c={},u=new n,f;function h(g){var v=g.v===f?g.w:g.v,b=u.priority(v);if(b!==void 0){var x=o(g);x<b&&(c[v]=f,u.decrease(v,x))}}if(i.nodeCount()===0)return a;e.each(i.nodes(),function(g){u.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),u.decrease(i.nodes()[0],0);for(var p=!1;u.size()>0;){if(f=u.removeMin(),e.has(c,f))a.setEdge(f,c[f]);else{if(p)throw new Error("Input graph is not connected: "+i);p=!0}i.nodeEdges(f).forEach(h)}return a}return qv}var $v,yj;function lY(){return yj||(yj=1,$v={components:eY(),dijkstra:WP(),dijkstraAll:tY(),findCycles:nY(),floydWarshall:rY(),isAcyclic:iY(),postorder:sY(),preorder:oY(),prim:aY(),tarjan:KP(),topsort:GP()}),$v}var Fv,vj;function cY(){if(vj)return Fv;vj=1;var e=JG();return Fv={Graph:e.Graph,json:ZG(),alg:lY(),version:e.version},Fv}var Bv,xj;function Fn(){if(xj)return Bv;xj=1;var e;if(typeof yb=="function")try{e=cY()}catch{}return e||(e=window.graphlib),Bv=e,Bv}var zv,wj;function uY(){if(wj)return zv;wj=1;var e=wP(),t=1,n=4;function r(i){return e(i,t|n)}return zv=r,zv}var Vv,bj;function hd(){if(bj)return Vv;bj=1;var e=No(),t=Or(),n=id(),r=Sn();function i(o,a,c){if(!r(c))return!1;var u=typeof a;return(u=="number"?t(c)&&n(a,c.length):u=="string"&&a in c)?e(c[a],o):!1}return Vv=i,Vv}var Uv,_j;function fY(){if(_j)return Uv;_j=1;var e=dd(),t=No(),n=hd(),r=is(),i=Object.prototype,o=i.hasOwnProperty,a=e(function(c,u){c=Object(c);var f=-1,h=u.length,p=h>2?u[2]:void 0;for(p&&n(u[0],u[1],p)&&(h=1);++f<h;)for(var g=u[f],v=r(g),b=-1,x=v.length;++b<x;){var w=v[b],S=c[w];(S===void 0||t(S,i[w])&&!o.call(c,w))&&(c[w]=g[w])}return c});return Uv=a,Uv}var Hv,Sj;function dY(){if(Sj)return Hv;Sj=1;var e=Pr(),t=Or(),n=xi();function r(i){return function(o,a,c){var u=Object(o);if(!t(o)){var f=e(a,3);o=n(o),a=function(p){return f(u[p],p,u)}}var h=i(o,a,c);return h>-1?u[f?o[h]:h]:void 0}}return Hv=r,Hv}var Wv,kj;function hY(){if(kj)return Wv;kj=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Wv=t,Wv}var Kv,Ej;function pY(){if(Ej)return Kv;Ej=1;var e=hY(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Kv=n,Kv}var Gv,Nj;function mY(){if(Nj)return Gv;Nj=1;var e=pY(),t=Sn(),n=Ao(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;function u(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=o.test(f);return p||a.test(f)?c(f.slice(2),p?2:8):i.test(f)?r:+f}return Gv=u,Gv}var Yv,Cj;function XP(){if(Cj)return Yv;Cj=1;var e=mY(),t=1/0,n=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var o=i<0?-1:1;return o*n}return i===i?i:0}return Yv=r,Yv}var Xv,jj;function gY(){if(jj)return Xv;jj=1;var e=XP();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return Xv=t,Xv}var Qv,Rj;function yY(){if(Rj)return Qv;Rj=1;var e=zP(),t=Pr(),n=gY(),r=Math.max;function i(o,a,c){var u=o==null?0:o.length;if(!u)return-1;var f=c==null?0:n(c);return f<0&&(f=r(u+f,0)),e(o,t(a,3),f)}return Qv=i,Qv}var Jv,Aj;function vY(){if(Aj)return Jv;Aj=1;var e=dY(),t=yY(),n=e(t);return Jv=n,Jv}var Zv,Tj;function QP(){if(Tj)return Zv;Tj=1;var e=Mb();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return Zv=t,Zv}var e0,Mj;function xY(){if(Mj)return e0;Mj=1;var e=jb(),t=bP(),n=is();function r(i,o){return i==null?i:e(i,t(o),n)}return e0=r,e0}var t0,Ij;function wY(){if(Ij)return t0;Ij=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return t0=e,t0}var n0,Oj;function bY(){if(Oj)return n0;Oj=1;var e=nd(),t=Rb(),n=Pr();function r(i,o){var a={};return o=n(o,3),t(i,function(c,u,f){e(a,u,o(c,u,f))}),a}return n0=r,n0}var r0,Pj;function Ob(){if(Pj)return r0;Pj=1;var e=Ao();function t(n,r,i){for(var o=-1,a=n.length;++o<a;){var c=n[o],u=r(c);if(u!=null&&(f===void 0?u===u&&!e(u):i(u,f)))var f=u,h=c}return h}return r0=t,r0}var i0,Lj;function _Y(){if(Lj)return i0;Lj=1;function e(t,n){return t>n}return i0=e,i0}var s0,Dj;function SY(){if(Dj)return s0;Dj=1;var e=Ob(),t=_Y(),n=ss();function r(i){return i&&i.length?e(i,n,t):void 0}return s0=r,s0}var o0,qj;function JP(){if(qj)return o0;qj=1;var e=nd(),t=No();function n(r,i,o){(o!==void 0&&!t(r[i],o)||o===void 0&&!(i in r))&&e(r,i,o)}return o0=n,o0}var a0,$j;function kY(){if($j)return a0;$j=1;var e=ns(),t=ad(),n=hr(),r="[object Object]",i=Function.prototype,o=Object.prototype,a=i.toString,c=o.hasOwnProperty,u=a.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==u}return a0=f,a0}var l0,Fj;function ZP(){if(Fj)return l0;Fj=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return l0=e,l0}var c0,Bj;function EY(){if(Bj)return c0;Bj=1;var e=Ol(),t=is();function n(r){return e(r,t(r))}return c0=n,c0}var u0,zj;function NY(){if(zj)return u0;zj=1;var e=JP(),t=lP(),n=yP(),r=cP(),i=xP(),o=Pl(),a=mt(),c=VP(),u=jo(),f=Il(),h=Sn(),p=kY(),g=Ll(),v=ZP(),b=EY();function x(w,S,N,k,E,R,T){var A=v(w,N),O=v(S,N),L=T.get(O);if(L){e(w,N,L);return}var B=R?R(A,O,N+"",w,S,T):void 0,I=B===void 0;if(I){var q=a(O),U=!q&&u(O),D=!q&&!U&&g(O);B=O,q||U||D?a(A)?B=A:c(A)?B=r(A):U?(I=!1,B=t(O,!0)):D?(I=!1,B=n(O,!0)):B=[]:p(O)||o(O)?(B=A,o(A)?B=b(A):(!h(A)||f(A))&&(B=i(O))):I=!1}I&&(T.set(O,B),E(B,O,k,R,T),T.delete(O)),e(w,N,B)}return u0=x,u0}var f0,Vj;function CY(){if(Vj)return f0;Vj=1;var e=td(),t=JP(),n=jb(),r=NY(),i=Sn(),o=is(),a=ZP();function c(u,f,h,p,g){u!==f&&n(f,function(v,b){if(g||(g=new e),i(v))r(u,f,b,h,c,p,g);else{var x=p?p(a(u,b),v,b+"",u,f,g):void 0;x===void 0&&(x=v),t(u,b,x)}},o)}return f0=c,f0}var d0,Uj;function jY(){if(Uj)return d0;Uj=1;var e=dd(),t=hd();function n(r){return e(function(i,o){var a=-1,c=o.length,u=c>1?o[c-1]:void 0,f=c>2?o[2]:void 0;for(u=r.length>3&&typeof u=="function"?(c--,u):void 0,f&&t(o[0],o[1],f)&&(u=c<3?void 0:u,c=1),i=Object(i);++a<c;){var h=o[a];h&&r(i,h,a,u)}return i})}return d0=n,d0}var h0,Hj;function RY(){if(Hj)return h0;Hj=1;var e=CY(),t=jY(),n=t(function(r,i,o){e(r,i,o)});return h0=n,h0}var p0,Wj;function eL(){if(Wj)return p0;Wj=1;function e(t,n){return t<n}return p0=e,p0}var m0,Kj;function AY(){if(Kj)return m0;Kj=1;var e=Ob(),t=eL(),n=ss();function r(i){return i&&i.length?e(i,n,t):void 0}return m0=r,m0}var g0,Gj;function TY(){if(Gj)return g0;Gj=1;var e=Ob(),t=Pr(),n=eL();function r(i,o){return i&&i.length?e(i,t(o,2),n):void 0}return g0=r,g0}var y0,Yj;function MY(){if(Yj)return y0;Yj=1;var e=Un(),t=function(){return e.Date.now()};return y0=t,y0}var v0,Xj;function IY(){if(Xj)return v0;Xj=1;var e=rd(),t=ud(),n=id(),r=Sn(),i=Dl();function o(a,c,u,f){if(!r(a))return a;c=t(c,a);for(var h=-1,p=c.length,g=p-1,v=a;v!=null&&++h<p;){var b=i(c[h]),x=u;if(b==="__proto__"||b==="constructor"||b==="prototype")return a;if(h!=g){var w=v[b];x=f?f(w,b,v):void 0,x===void 0&&(x=r(w)?w:n(c[h+1])?[]:{})}e(v,b,x),v=v[b]}return a}return v0=o,v0}var x0,Qj;function OY(){if(Qj)return x0;Qj=1;var e=fd(),t=IY(),n=ud();function r(i,o,a){for(var c=-1,u=o.length,f={};++c<u;){var h=o[c],p=e(i,h);a(p,h)&&t(f,n(h,i),p)}return f}return x0=r,x0}var w0,Jj;function PY(){if(Jj)return w0;Jj=1;var e=OY(),t=MP();function n(r,i){return e(r,i,function(o,a){return t(r,a)})}return w0=n,w0}var b0,Zj;function LY(){if(Zj)return b0;Zj=1;var e=QP(),t=FP(),n=BP();function r(i){return n(t(i,void 0,e),i+"")}return b0=r,b0}var _0,eR;function DY(){if(eR)return _0;eR=1;var e=PY(),t=LY(),n=t(function(r,i){return r==null?{}:e(r,i)});return _0=n,_0}var S0,tR;function qY(){if(tR)return S0;tR=1;var e=Math.ceil,t=Math.max;function n(r,i,o,a){for(var c=-1,u=t(e((i-r)/(o||1)),0),f=Array(u);u--;)f[a?u:++c]=r,r+=o;return f}return S0=n,S0}var k0,nR;function $Y(){if(nR)return k0;nR=1;var e=qY(),t=hd(),n=XP();function r(i){return function(o,a,c){return c&&typeof c!="number"&&t(o,a,c)&&(a=c=void 0),o=n(o),a===void 0?(a=o,o=0):a=n(a),c=c===void 0?o<a?1:-1:n(c),e(o,a,c,i)}}return k0=r,k0}var E0,rR;function FY(){if(rR)return E0;rR=1;var e=$Y(),t=e();return E0=t,E0}var N0,iR;function BY(){if(iR)return N0;iR=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return N0=e,N0}var C0,sR;function zY(){if(sR)return C0;sR=1;var e=Ao();function t(n,r){if(n!==r){var i=n!==void 0,o=n===null,a=n===n,c=e(n),u=r!==void 0,f=r===null,h=r===r,p=e(r);if(!f&&!p&&!c&&n>r||c&&u&&h&&!f&&!p||o&&u&&h||!i&&h||!a)return 1;if(!o&&!c&&!p&&n<r||p&&i&&a&&!o&&!c||f&&i&&a||!u&&a||!h)return-1}return 0}return C0=t,C0}var j0,oR;function VY(){if(oR)return j0;oR=1;var e=zY();function t(n,r,i){for(var o=-1,a=n.criteria,c=r.criteria,u=a.length,f=i.length;++o<u;){var h=e(a[o],c[o]);if(h){if(o>=f)return h;var p=i[o];return h*(p=="desc"?-1:1)}}return n.index-r.index}return j0=t,j0}var R0,aR;function UY(){if(aR)return R0;aR=1;var e=cd(),t=fd(),n=Pr(),r=DP(),i=BY(),o=sd(),a=VY(),c=ss(),u=mt();function f(h,p,g){p.length?p=e(p,function(x){return u(x)?function(w){return t(w,x.length===1?x[0]:x)}:x}):p=[c];var v=-1;p=e(p,o(n));var b=r(h,function(x,w,S){var N=e(p,function(k){return k(x)});return{criteria:N,index:++v,value:x}});return i(b,function(x,w){return a(x,w,g)})}return R0=f,R0}var A0,lR;function HY(){if(lR)return A0;lR=1;var e=Mb(),t=UY(),n=dd(),r=hd(),i=n(function(o,a){if(o==null)return[];var c=a.length;return c>1&&r(o,a[0],a[1])?a=[]:c>2&&r(a[0],a[1],a[2])&&(a=[a[0]]),t(o,e(a,1),[])});return A0=i,A0}var T0,cR;function WY(){if(cR)return T0;cR=1;var e=AP(),t=0;function n(r){var i=++t;return e(r)+i}return T0=n,T0}var M0,uR;function KY(){if(uR)return M0;uR=1;function e(t,n,r){for(var i=-1,o=t.length,a=n.length,c={};++i<o;){var u=i<a?n[i]:void 0;r(c,t[i],u)}return c}return M0=e,M0}var I0,fR;function GY(){if(fR)return I0;fR=1;var e=rd(),t=KY();function n(r,i){return t(r||[],i||[],e)}return I0=n,I0}var O0,dR;function Ze(){if(dR)return O0;dR=1;var e;if(typeof yb=="function")try{e={cloneDeep:uY(),constant:Cb(),defaults:fY(),each:SP(),filter:OP(),find:vY(),flatten:QP(),forEach:_P(),forIn:xY(),has:PP(),isUndefined:LP(),last:wY(),map:qP(),mapValues:bY(),max:SY(),merge:RY(),min:AY(),minBy:TY(),now:MY(),pick:DY(),range:FY(),reduce:$P(),sortBy:HY(),uniqueId:WY(),values:UP(),zipObject:GY()}}catch{}return e||(e=window._),O0=e,O0}var P0,hR;function YY(){if(hR)return P0;hR=1,P0=e;function e(){var r={};r._next=r._prev=r,this._sentinel=r}e.prototype.dequeue=function(){var r=this._sentinel,i=r._prev;if(i!==r)return t(i),i},e.prototype.enqueue=function(r){var i=this._sentinel;r._prev&&r._next&&t(r),r._next=i._next,i._next._prev=r,i._next=r,r._prev=i},e.prototype.toString=function(){for(var r=[],i=this._sentinel,o=i._prev;o!==i;)r.push(JSON.stringify(o,n)),o=o._prev;return"["+r.join(", ")+"]"};function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,i){if(r!=="_next"&&r!=="_prev")return i}return P0}var L0,pR;function XY(){if(pR)return L0;pR=1;var e=Ze(),t=Fn().Graph,n=YY();L0=i;var r=e.constant(1);function i(f,h){if(f.nodeCount()<=1)return[];var p=c(f,h||r),g=o(p.graph,p.buckets,p.zeroIdx);return e.flatten(e.map(g,function(v){return f.outEdges(v.v,v.w)}),!0)}function o(f,h,p){for(var g=[],v=h[h.length-1],b=h[0],x;f.nodeCount();){for(;x=b.dequeue();)a(f,h,p,x);for(;x=v.dequeue();)a(f,h,p,x);if(f.nodeCount()){for(var w=h.length-2;w>0;--w)if(x=h[w].dequeue(),x){g=g.concat(a(f,h,p,x,!0));break}}}return g}function a(f,h,p,g,v){var b=v?[]:void 0;return e.forEach(f.inEdges(g.v),function(x){var w=f.edge(x),S=f.node(x.v);v&&b.push({v:x.v,w:x.w}),S.out-=w,u(h,p,S)}),e.forEach(f.outEdges(g.v),function(x){var w=f.edge(x),S=x.w,N=f.node(S);N.in-=w,u(h,p,N)}),f.removeNode(g.v),b}function c(f,h){var p=new t,g=0,v=0;e.forEach(f.nodes(),function(w){p.setNode(w,{v:w,in:0,out:0})}),e.forEach(f.edges(),function(w){var S=p.edge(w.v,w.w)||0,N=h(w),k=S+N;p.setEdge(w.v,w.w,k),v=Math.max(v,p.node(w.v).out+=N),g=Math.max(g,p.node(w.w).in+=N)});var b=e.range(v+g+3).map(function(){return new n}),x=g+1;return e.forEach(p.nodes(),function(w){u(b,x,p.node(w))}),{graph:p,buckets:b,zeroIdx:x}}function u(f,h,p){p.out?p.in?f[p.out-p.in+h].enqueue(p):f[f.length-1].enqueue(p):f[0].enqueue(p)}return L0}var D0,mR;function QY(){if(mR)return D0;mR=1;var e=Ze(),t=XY();D0={run:n,undo:i};function n(o){var a=o.graph().acyclicer==="greedy"?t(o,c(o)):r(o);e.forEach(a,function(u){var f=o.edge(u);o.removeEdge(u),f.forwardName=u.name,f.reversed=!0,o.setEdge(u.w,u.v,f,e.uniqueId("rev"))});function c(u){return function(f){return u.edge(f).weight}}}function r(o){var a=[],c={},u={};function f(h){e.has(u,h)||(u[h]=!0,c[h]=!0,e.forEach(o.outEdges(h),function(p){e.has(c,p.w)?a.push(p):f(p.w)}),delete c[h])}return e.forEach(o.nodes(),f),a}function i(o){e.forEach(o.edges(),function(a){var c=o.edge(a);if(c.reversed){o.removeEdge(a);var u=c.forwardName;delete c.reversed,delete c.forwardName,o.setEdge(a.w,a.v,c,u)}})}return D0}var q0,gR;function Xt(){if(gR)return q0;gR=1;var e=Ze(),t=Fn().Graph;q0={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:o,predecessorWeights:a,intersectRect:c,buildLayerMatrix:u,normalizeRanks:f,removeEmptyRanks:h,addBorderNode:p,maxRank:g,partition:v,time:b,notime:x};function n(w,S,N,k){var E;do E=e.uniqueId(k);while(w.hasNode(E));return N.dummy=S,w.setNode(E,N),E}function r(w){var S=new t().setGraph(w.graph());return e.forEach(w.nodes(),function(N){S.setNode(N,w.node(N))}),e.forEach(w.edges(),function(N){var k=S.edge(N.v,N.w)||{weight:0,minlen:1},E=w.edge(N);S.setEdge(N.v,N.w,{weight:k.weight+E.weight,minlen:Math.max(k.minlen,E.minlen)})}),S}function i(w){var S=new t({multigraph:w.isMultigraph()}).setGraph(w.graph());return e.forEach(w.nodes(),function(N){w.children(N).length||S.setNode(N,w.node(N))}),e.forEach(w.edges(),function(N){S.setEdge(N,w.edge(N))}),S}function o(w){var S=e.map(w.nodes(),function(N){var k={};return e.forEach(w.outEdges(N),function(E){k[E.w]=(k[E.w]||0)+w.edge(E).weight}),k});return e.zipObject(w.nodes(),S)}function a(w){var S=e.map(w.nodes(),function(N){var k={};return e.forEach(w.inEdges(N),function(E){k[E.v]=(k[E.v]||0)+w.edge(E).weight}),k});return e.zipObject(w.nodes(),S)}function c(w,S){var N=w.x,k=w.y,E=S.x-N,R=S.y-k,T=w.width/2,A=w.height/2;if(!E&&!R)throw new Error("Not possible to find intersection inside of the rectangle");var O,L;return Math.abs(R)*T>Math.abs(E)*A?(R<0&&(A=-A),O=A*E/R,L=A):(E<0&&(T=-T),O=T,L=T*R/E),{x:N+O,y:k+L}}function u(w){var S=e.map(e.range(g(w)+1),function(){return[]});return e.forEach(w.nodes(),function(N){var k=w.node(N),E=k.rank;e.isUndefined(E)||(S[E][k.order]=N)}),S}function f(w){var S=e.min(e.map(w.nodes(),function(N){return w.node(N).rank}));e.forEach(w.nodes(),function(N){var k=w.node(N);e.has(k,"rank")&&(k.rank-=S)})}function h(w){var S=e.min(e.map(w.nodes(),function(R){return w.node(R).rank})),N=[];e.forEach(w.nodes(),function(R){var T=w.node(R).rank-S;N[T]||(N[T]=[]),N[T].push(R)});var k=0,E=w.graph().nodeRankFactor;e.forEach(N,function(R,T){e.isUndefined(R)&&T%E!==0?--k:k&&e.forEach(R,function(A){w.node(A).rank+=k})})}function p(w,S,N,k){var E={width:0,height:0};return arguments.length>=4&&(E.rank=N,E.order=k),n(w,"border",E,S)}function g(w){return e.max(e.map(w.nodes(),function(S){var N=w.node(S).rank;if(!e.isUndefined(N))return N}))}function v(w,S){var N={lhs:[],rhs:[]};return e.forEach(w,function(k){S(k)?N.lhs.push(k):N.rhs.push(k)}),N}function b(w,S){var N=e.now();try{return S()}finally{console.log(w+" time: "+(e.now()-N)+"ms")}}function x(w,S){return S()}return q0}var $0,yR;function JY(){if(yR)return $0;yR=1;var e=Ze(),t=Xt();$0={run:n,undo:i};function n(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(a){r(o,a)})}function r(o,a){var c=a.v,u=o.node(c).rank,f=a.w,h=o.node(f).rank,p=a.name,g=o.edge(a),v=g.labelRank;if(h!==u+1){o.removeEdge(a);var b,x,w;for(w=0,++u;u<h;++w,++u)g.points=[],x={width:0,height:0,edgeLabel:g,edgeObj:a,rank:u},b=t.addDummyNode(o,"edge",x,"_d"),u===v&&(x.width=g.width,x.height=g.height,x.dummy="edge-label",x.labelpos=g.labelpos),o.setEdge(c,b,{weight:g.weight},p),w===0&&o.graph().dummyChains.push(b),c=b;o.setEdge(c,f,{weight:g.weight},p)}}function i(o){e.forEach(o.graph().dummyChains,function(a){var c=o.node(a),u=c.edgeLabel,f;for(o.setEdge(c.edgeObj,u);c.dummy;)f=o.successors(a)[0],o.removeNode(a),u.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(u.x=c.x,u.y=c.y,u.width=c.width,u.height=c.height),a=f,c=o.node(a)})}return $0}var F0,vR;function mf(){if(vR)return F0;vR=1;var e=Ze();F0={longestPath:t,slack:n};function t(r){var i={};function o(a){var c=r.node(a);if(e.has(i,a))return c.rank;i[a]=!0;var u=e.min(e.map(r.outEdges(a),function(f){return o(f.w)-r.edge(f).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),c.rank=u}e.forEach(r.sources(),o)}function n(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return F0}var B0,xR;function tL(){if(xR)return B0;xR=1;var e=Ze(),t=Fn().Graph,n=mf().slack;B0=r;function r(c){var u=new t({directed:!1}),f=c.nodes()[0],h=c.nodeCount();u.setNode(f,{});for(var p,g;i(u,c)<h;)p=o(u,c),g=u.hasNode(p.v)?n(c,p):-n(c,p),a(u,c,g);return u}function i(c,u){function f(h){e.forEach(u.nodeEdges(h),function(p){var g=p.v,v=h===g?p.w:g;!c.hasNode(v)&&!n(u,p)&&(c.setNode(v,{}),c.setEdge(h,v,{}),f(v))})}return e.forEach(c.nodes(),f),c.nodeCount()}function o(c,u){return e.minBy(u.edges(),function(f){if(c.hasNode(f.v)!==c.hasNode(f.w))return n(u,f)})}function a(c,u,f){e.forEach(c.nodes(),function(h){u.node(h).rank+=f})}return B0}var z0,wR;function ZY(){if(wR)return z0;wR=1;var e=Ze(),t=tL(),n=mf().slack,r=mf().longestPath,i=Fn().alg.preorder,o=Fn().alg.postorder,a=Xt().simplify;z0=c,c.initLowLimValues=p,c.initCutValues=u,c.calcCutValue=h,c.leaveEdge=v,c.enterEdge=b,c.exchangeEdges=x;function c(k){k=a(k),r(k);var E=t(k);p(E),u(E,k);for(var R,T;R=v(E);)T=b(E,k,R),x(E,k,R,T)}function u(k,E){var R=o(k,k.nodes());R=R.slice(0,R.length-1),e.forEach(R,function(T){f(k,E,T)})}function f(k,E,R){var T=k.node(R),A=T.parent;k.edge(R,A).cutvalue=h(k,E,R)}function h(k,E,R){var T=k.node(R),A=T.parent,O=!0,L=E.edge(R,A),B=0;return L||(O=!1,L=E.edge(A,R)),B=L.weight,e.forEach(E.nodeEdges(R),function(I){var q=I.v===R,U=q?I.w:I.v;if(U!==A){var D=q===O,V=E.edge(I).weight;if(B+=D?V:-V,S(k,R,U)){var z=k.edge(R,U).cutvalue;B+=D?-z:z}}}),B}function p(k,E){arguments.length<2&&(E=k.nodes()[0]),g(k,{},1,E)}function g(k,E,R,T,A){var O=R,L=k.node(T);return E[T]=!0,e.forEach(k.neighbors(T),function(B){e.has(E,B)||(R=g(k,E,R,B,T))}),L.low=O,L.lim=R++,A?L.parent=A:delete L.parent,R}function v(k){return e.find(k.edges(),function(E){return k.edge(E).cutvalue<0})}function b(k,E,R){var T=R.v,A=R.w;E.hasEdge(T,A)||(T=R.w,A=R.v);var O=k.node(T),L=k.node(A),B=O,I=!1;O.lim>L.lim&&(B=L,I=!0);var q=e.filter(E.edges(),function(U){return I===N(k,k.node(U.v),B)&&I!==N(k,k.node(U.w),B)});return e.minBy(q,function(U){return n(E,U)})}function x(k,E,R,T){var A=R.v,O=R.w;k.removeEdge(A,O),k.setEdge(T.v,T.w,{}),p(k),u(k,E),w(k,E)}function w(k,E){var R=e.find(k.nodes(),function(A){return!E.node(A).parent}),T=i(k,R);T=T.slice(1),e.forEach(T,function(A){var O=k.node(A).parent,L=E.edge(A,O),B=!1;L||(L=E.edge(O,A),B=!0),E.node(A).rank=E.node(O).rank+(B?L.minlen:-L.minlen)})}function S(k,E,R){return k.hasEdge(E,R)}function N(k,E,R){return R.low<=E.lim&&E.lim<=R.lim}return z0}var V0,bR;function eX(){if(bR)return V0;bR=1;var e=mf(),t=e.longestPath,n=tL(),r=ZY();V0=i;function i(u){switch(u.graph().ranker){case"network-simplex":c(u);break;case"tight-tree":a(u);break;case"longest-path":o(u);break;default:c(u)}}var o=t;function a(u){t(u),n(u)}function c(u){r(u)}return V0}var U0,_R;function tX(){if(_R)return U0;_R=1;var e=Ze();U0=t;function t(i){var o=r(i);e.forEach(i.graph().dummyChains,function(a){for(var c=i.node(a),u=c.edgeObj,f=n(i,o,u.v,u.w),h=f.path,p=f.lca,g=0,v=h[g],b=!0;a!==u.w;){if(c=i.node(a),b){for(;(v=h[g])!==p&&i.node(v).maxRank<c.rank;)g++;v===p&&(b=!1)}if(!b){for(;g<h.length-1&&i.node(v=h[g+1]).minRank<=c.rank;)g++;v=h[g]}i.setParent(a,v),a=i.successors(a)[0]}})}function n(i,o,a,c){var u=[],f=[],h=Math.min(o[a].low,o[c].low),p=Math.max(o[a].lim,o[c].lim),g,v;g=a;do g=i.parent(g),u.push(g);while(g&&(o[g].low>h||p>o[g].lim));for(v=g,g=c;(g=i.parent(g))!==v;)f.push(g);return{path:u.concat(f.reverse()),lca:v}}function r(i){var o={},a=0;function c(u){var f=a;e.forEach(i.children(u),c),o[u]={low:f,lim:a++}}return e.forEach(i.children(),c),o}return U0}var H0,SR;function nX(){if(SR)return H0;SR=1;var e=Ze(),t=Xt();H0={run:n,cleanup:a};function n(c){var u=t.addDummyNode(c,"root",{},"_root"),f=i(c),h=e.max(e.values(f))-1,p=2*h+1;c.graph().nestingRoot=u,e.forEach(c.edges(),function(v){c.edge(v).minlen*=p});var g=o(c)+1;e.forEach(c.children(),function(v){r(c,u,p,g,h,f,v)}),c.graph().nodeRankFactor=p}function r(c,u,f,h,p,g,v){var b=c.children(v);if(!b.length){v!==u&&c.setEdge(u,v,{weight:0,minlen:f});return}var x=t.addBorderNode(c,"_bt"),w=t.addBorderNode(c,"_bb"),S=c.node(v);c.setParent(x,v),S.borderTop=x,c.setParent(w,v),S.borderBottom=w,e.forEach(b,function(N){r(c,u,f,h,p,g,N);var k=c.node(N),E=k.borderTop?k.borderTop:N,R=k.borderBottom?k.borderBottom:N,T=k.borderTop?h:2*h,A=E!==R?1:p-g[v]+1;c.setEdge(x,E,{weight:T,minlen:A,nestingEdge:!0}),c.setEdge(R,w,{weight:T,minlen:A,nestingEdge:!0})}),c.parent(v)||c.setEdge(u,x,{weight:0,minlen:p+g[v]})}function i(c){var u={};function f(h,p){var g=c.children(h);g&&g.length&&e.forEach(g,function(v){f(v,p+1)}),u[h]=p}return e.forEach(c.children(),function(h){f(h,1)}),u}function o(c){return e.reduce(c.edges(),function(u,f){return u+c.edge(f).weight},0)}function a(c){var u=c.graph();c.removeNode(u.nestingRoot),delete u.nestingRoot,e.forEach(c.edges(),function(f){var h=c.edge(f);h.nestingEdge&&c.removeEdge(f)})}return H0}var W0,kR;function rX(){if(kR)return W0;kR=1;var e=Ze(),t=Xt();W0=n;function n(i){function o(a){var c=i.children(a),u=i.node(a);if(c.length&&e.forEach(c,o),e.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var f=u.minRank,h=u.maxRank+1;f<h;++f)r(i,"borderLeft","_bl",a,u,f),r(i,"borderRight","_br",a,u,f)}}e.forEach(i.children(),o)}function r(i,o,a,c,u,f){var h={width:0,height:0,rank:f,borderType:o},p=u[o][f-1],g=t.addDummyNode(i,"border",h,a);u[o][f]=g,i.setParent(g,c),p&&i.setEdge(p,g,{weight:1})}return W0}var K0,ER;function iX(){if(ER)return K0;ER=1;var e=Ze();K0={adjust:t,undo:n};function t(f){var h=f.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&r(f)}function n(f){var h=f.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&o(f),(h==="lr"||h==="rl")&&(c(f),r(f))}function r(f){e.forEach(f.nodes(),function(h){i(f.node(h))}),e.forEach(f.edges(),function(h){i(f.edge(h))})}function i(f){var h=f.width;f.width=f.height,f.height=h}function o(f){e.forEach(f.nodes(),function(h){a(f.node(h))}),e.forEach(f.edges(),function(h){var p=f.edge(h);e.forEach(p.points,a),e.has(p,"y")&&a(p)})}function a(f){f.y=-f.y}function c(f){e.forEach(f.nodes(),function(h){u(f.node(h))}),e.forEach(f.edges(),function(h){var p=f.edge(h);e.forEach(p.points,u),e.has(p,"x")&&u(p)})}function u(f){var h=f.x;f.x=f.y,f.y=h}return K0}var G0,NR;function sX(){if(NR)return G0;NR=1;var e=Ze();G0=t;function t(n){var r={},i=e.filter(n.nodes(),function(f){return!n.children(f).length}),o=e.max(e.map(i,function(f){return n.node(f).rank})),a=e.map(e.range(o+1),function(){return[]});function c(f){if(!e.has(r,f)){r[f]=!0;var h=n.node(f);a[h.rank].push(f),e.forEach(n.successors(f),c)}}var u=e.sortBy(i,function(f){return n.node(f).rank});return e.forEach(u,c),a}return G0}var Y0,CR;function oX(){if(CR)return Y0;CR=1;var e=Ze();Y0=t;function t(r,i){for(var o=0,a=1;a<i.length;++a)o+=n(r,i[a-1],i[a]);return o}function n(r,i,o){for(var a=e.zipObject(o,e.map(o,function(g,v){return v})),c=e.flatten(e.map(i,function(g){return e.sortBy(e.map(r.outEdges(g),function(v){return{pos:a[v.w],weight:r.edge(v).weight}}),"pos")}),!0),u=1;u<o.length;)u<<=1;var f=2*u-1;u-=1;var h=e.map(new Array(f),function(){return 0}),p=0;return e.forEach(c.forEach(function(g){var v=g.pos+u;h[v]+=g.weight;for(var b=0;v>0;)v%2&&(b+=h[v+1]),v=v-1>>1,h[v]+=g.weight;p+=g.weight*b})),p}return Y0}var X0,jR;function aX(){if(jR)return X0;jR=1;var e=Ze();X0=t;function t(n,r){return e.map(r,function(i){var o=n.inEdges(i);if(o.length){var a=e.reduce(o,function(c,u){var f=n.edge(u),h=n.node(u.v);return{sum:c.sum+f.weight*h.order,weight:c.weight+f.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}return X0}var Q0,RR;function lX(){if(RR)return Q0;RR=1;var e=Ze();Q0=t;function t(i,o){var a={};e.forEach(i,function(u,f){var h=a[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:f};e.isUndefined(u.barycenter)||(h.barycenter=u.barycenter,h.weight=u.weight)}),e.forEach(o.edges(),function(u){var f=a[u.v],h=a[u.w];!e.isUndefined(f)&&!e.isUndefined(h)&&(h.indegree++,f.out.push(a[u.w]))});var c=e.filter(a,function(u){return!u.indegree});return n(c)}function n(i){var o=[];function a(f){return function(h){h.merged||(e.isUndefined(h.barycenter)||e.isUndefined(f.barycenter)||h.barycenter>=f.barycenter)&&r(f,h)}}function c(f){return function(h){h.in.push(f),--h.indegree===0&&i.push(h)}}for(;i.length;){var u=i.pop();o.push(u),e.forEach(u.in.reverse(),a(u)),e.forEach(u.out,c(u))}return e.map(e.filter(o,function(f){return!f.merged}),function(f){return e.pick(f,["vs","i","barycenter","weight"])})}function r(i,o){var a=0,c=0;i.weight&&(a+=i.barycenter*i.weight,c+=i.weight),o.weight&&(a+=o.barycenter*o.weight,c+=o.weight),i.vs=o.vs.concat(i.vs),i.barycenter=a/c,i.weight=c,i.i=Math.min(o.i,i.i),o.merged=!0}return Q0}var J0,AR;function cX(){if(AR)return J0;AR=1;var e=Ze(),t=Xt();J0=n;function n(o,a){var c=t.partition(o,function(x){return e.has(x,"barycenter")}),u=c.lhs,f=e.sortBy(c.rhs,function(x){return-x.i}),h=[],p=0,g=0,v=0;u.sort(i(!!a)),v=r(h,f,v),e.forEach(u,function(x){v+=x.vs.length,h.push(x.vs),p+=x.barycenter*x.weight,g+=x.weight,v=r(h,f,v)});var b={vs:e.flatten(h,!0)};return g&&(b.barycenter=p/g,b.weight=g),b}function r(o,a,c){for(var u;a.length&&(u=e.last(a)).i<=c;)a.pop(),o.push(u.vs),c++;return c}function i(o){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:o?c.i-a.i:a.i-c.i}}return J0}var Z0,TR;function uX(){if(TR)return Z0;TR=1;var e=Ze(),t=aX(),n=lX(),r=cX();Z0=i;function i(c,u,f,h){var p=c.children(u),g=c.node(u),v=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};v&&(p=e.filter(p,function(R){return R!==v&&R!==b}));var w=t(c,p);e.forEach(w,function(R){if(c.children(R.v).length){var T=i(c,R.v,f,h);x[R.v]=T,e.has(T,"barycenter")&&a(R,T)}});var S=n(w,f);o(S,x);var N=r(S,h);if(v&&(N.vs=e.flatten([v,N.vs,b],!0),c.predecessors(v).length)){var k=c.node(c.predecessors(v)[0]),E=c.node(c.predecessors(b)[0]);e.has(N,"barycenter")||(N.barycenter=0,N.weight=0),N.barycenter=(N.barycenter*N.weight+k.order+E.order)/(N.weight+2),N.weight+=2}return N}function o(c,u){e.forEach(c,function(f){f.vs=e.flatten(f.vs.map(function(h){return u[h]?u[h].vs:h}),!0)})}function a(c,u){e.isUndefined(c.barycenter)?(c.barycenter=u.barycenter,c.weight=u.weight):(c.barycenter=(c.barycenter*c.weight+u.barycenter*u.weight)/(c.weight+u.weight),c.weight+=u.weight)}return Z0}var ex,MR;function fX(){if(MR)return ex;MR=1;var e=Ze(),t=Fn().Graph;ex=n;function n(i,o,a){var c=r(i),u=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(f){return i.node(f)});return e.forEach(i.nodes(),function(f){var h=i.node(f),p=i.parent(f);(h.rank===o||h.minRank<=o&&o<=h.maxRank)&&(u.setNode(f),u.setParent(f,p||c),e.forEach(i[a](f),function(g){var v=g.v===f?g.w:g.v,b=u.edge(v,f),x=e.isUndefined(b)?0:b.weight;u.setEdge(v,f,{weight:i.edge(g).weight+x})}),e.has(h,"minRank")&&u.setNode(f,{borderLeft:h.borderLeft[o],borderRight:h.borderRight[o]}))}),u}function r(i){for(var o;i.hasNode(o=e.uniqueId("_root")););return o}return ex}var tx,IR;function dX(){if(IR)return tx;IR=1;var e=Ze();tx=t;function t(n,r,i){var o={},a;e.forEach(i,function(c){for(var u=n.parent(c),f,h;u;){if(f=n.parent(u),f?(h=o[f],o[f]=u):(h=a,a=u),h&&h!==u){r.setEdge(h,u);return}u=f}})}return tx}var nx,OR;function hX(){if(OR)return nx;OR=1;var e=Ze(),t=sX(),n=oX(),r=uX(),i=fX(),o=dX(),a=Fn().Graph,c=Xt();nx=u;function u(g){var v=c.maxRank(g),b=f(g,e.range(1,v+1),"inEdges"),x=f(g,e.range(v-1,-1,-1),"outEdges"),w=t(g);p(g,w);for(var S=Number.POSITIVE_INFINITY,N,k=0,E=0;E<4;++k,++E){h(k%2?b:x,k%4>=2),w=c.buildLayerMatrix(g);var R=n(g,w);R<S&&(E=0,N=e.cloneDeep(w),S=R)}p(g,N)}function f(g,v,b){return e.map(v,function(x){return i(g,x,b)})}function h(g,v){var b=new a;e.forEach(g,function(x){var w=x.graph().root,S=r(x,w,b,v);e.forEach(S.vs,function(N,k){x.node(N).order=k}),o(x,b,S.vs)})}function p(g,v){e.forEach(v,function(b){e.forEach(b,function(x,w){g.node(x).order=w})})}return nx}var rx,PR;function pX(){if(PR)return rx;PR=1;var e=Ze(),t=Fn().Graph,n=Xt();rx={positionX:b,findType1Conflicts:r,findType2Conflicts:i,addConflict:a,hasConflict:c,verticalAlignment:u,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:p,balance:v};function r(S,N){var k={};function E(R,T){var A=0,O=0,L=R.length,B=e.last(T);return e.forEach(T,function(I,q){var U=o(S,I),D=U?S.node(U).order:L;(U||I===B)&&(e.forEach(T.slice(O,q+1),function(V){e.forEach(S.predecessors(V),function(z){var Q=S.node(z),F=Q.order;(F<A||D<F)&&!(Q.dummy&&S.node(V).dummy)&&a(k,z,V)})}),O=q+1,A=D)}),T}return e.reduce(N,E),k}function i(S,N){var k={};function E(T,A,O,L,B){var I;e.forEach(e.range(A,O),function(q){I=T[q],S.node(I).dummy&&e.forEach(S.predecessors(I),function(U){var D=S.node(U);D.dummy&&(D.order<L||D.order>B)&&a(k,U,I)})})}function R(T,A){var O=-1,L,B=0;return e.forEach(A,function(I,q){if(S.node(I).dummy==="border"){var U=S.predecessors(I);U.length&&(L=S.node(U[0]).order,E(A,B,q,O,L),B=q,O=L)}E(A,B,A.length,L,T.length)}),A}return e.reduce(N,R),k}function o(S,N){if(S.node(N).dummy)return e.find(S.predecessors(N),function(k){return S.node(k).dummy})}function a(S,N,k){if(N>k){var E=N;N=k,k=E}var R=S[N];R||(S[N]=R={}),R[k]=!0}function c(S,N,k){if(N>k){var E=N;N=k,k=E}return e.has(S[N],k)}function u(S,N,k,E){var R={},T={},A={};return e.forEach(N,function(O){e.forEach(O,function(L,B){R[L]=L,T[L]=L,A[L]=B})}),e.forEach(N,function(O){var L=-1;e.forEach(O,function(B){var I=E(B);if(I.length){I=e.sortBy(I,function(z){return A[z]});for(var q=(I.length-1)/2,U=Math.floor(q),D=Math.ceil(q);U<=D;++U){var V=I[U];T[B]===B&&L<A[V]&&!c(k,B,V)&&(T[V]=B,T[B]=R[B]=R[V],L=A[V])}}})}),{root:R,align:T}}function f(S,N,k,E,R){var T={},A=h(S,N,k,R),O=R?"borderLeft":"borderRight";function L(q,U){for(var D=A.nodes(),V=D.pop(),z={};V;)z[V]?q(V):(z[V]=!0,D.push(V),D=D.concat(U(V))),V=D.pop()}function B(q){T[q]=A.inEdges(q).reduce(function(U,D){return Math.max(U,T[D.v]+A.edge(D))},0)}function I(q){var U=A.outEdges(q).reduce(function(V,z){return Math.min(V,T[z.w]-A.edge(z))},Number.POSITIVE_INFINITY),D=S.node(q);U!==Number.POSITIVE_INFINITY&&D.borderType!==O&&(T[q]=Math.max(T[q],U))}return L(B,A.predecessors.bind(A)),L(I,A.successors.bind(A)),e.forEach(E,function(q){T[q]=T[k[q]]}),T}function h(S,N,k,E){var R=new t,T=S.graph(),A=x(T.nodesep,T.edgesep,E);return e.forEach(N,function(O){var L;e.forEach(O,function(B){var I=k[B];if(R.setNode(I),L){var q=k[L],U=R.edge(q,I);R.setEdge(q,I,Math.max(A(S,B,L),U||0))}L=B})}),R}function p(S,N){return e.minBy(e.values(N),function(k){var E=Number.NEGATIVE_INFINITY,R=Number.POSITIVE_INFINITY;return e.forIn(k,function(T,A){var O=w(S,A)/2;E=Math.max(T+O,E),R=Math.min(T-O,R)}),E-R})}function g(S,N){var k=e.values(N),E=e.min(k),R=e.max(k);e.forEach(["u","d"],function(T){e.forEach(["l","r"],function(A){var O=T+A,L=S[O],B;if(L!==N){var I=e.values(L);B=A==="l"?E-e.min(I):R-e.max(I),B&&(S[O]=e.mapValues(L,function(q){return q+B}))}})})}function v(S,N){return e.mapValues(S.ul,function(k,E){if(N)return S[N.toLowerCase()][E];var R=e.sortBy(e.map(S,E));return(R[1]+R[2])/2})}function b(S){var N=n.buildLayerMatrix(S),k=e.merge(r(S,N),i(S,N)),E={},R;e.forEach(["u","d"],function(A){R=A==="u"?N:e.values(N).reverse(),e.forEach(["l","r"],function(O){O==="r"&&(R=e.map(R,function(q){return e.values(q).reverse()}));var L=(A==="u"?S.predecessors:S.successors).bind(S),B=u(S,R,k,L),I=f(S,R,B.root,B.align,O==="r");O==="r"&&(I=e.mapValues(I,function(q){return-q})),E[A+O]=I})});var T=p(S,E);return g(E,T),v(E,S.graph().align)}function x(S,N,k){return function(E,R,T){var A=E.node(R),O=E.node(T),L=0,B;if(L+=A.width/2,e.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":B=-A.width/2;break;case"r":B=A.width/2;break}if(B&&(L+=k?B:-B),B=0,L+=(A.dummy?N:S)/2,L+=(O.dummy?N:S)/2,L+=O.width/2,e.has(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":B=O.width/2;break;case"r":B=-O.width/2;break}return B&&(L+=k?B:-B),B=0,L}}function w(S,N){return S.node(N).width}return rx}var ix,LR;function mX(){if(LR)return ix;LR=1;var e=Ze(),t=Xt(),n=pX().positionX;ix=r;function r(o){o=t.asNonCompoundGraph(o),i(o),e.forEach(n(o),function(a,c){o.node(c).x=a})}function i(o){var a=t.buildLayerMatrix(o),c=o.graph().ranksep,u=0;e.forEach(a,function(f){var h=e.max(e.map(f,function(p){return o.node(p).height}));e.forEach(f,function(p){o.node(p).y=u+h/2}),u+=h+c})}return ix}var sx,DR;function gX(){if(DR)return sx;DR=1;var e=Ze(),t=QY(),n=JY(),r=eX(),i=Xt().normalizeRanks,o=tX(),a=Xt().removeEmptyRanks,c=nX(),u=rX(),f=iX(),h=hX(),p=mX(),g=Xt(),v=Fn().Graph;sx=b;function b(K,J){var G=J&&J.debugTiming?g.time:g.notime;G("layout",function(){var ee=G(" buildLayoutGraph",function(){return L(K)});G(" runLayout",function(){x(ee,G)}),G(" updateInputGraph",function(){w(K,ee)})})}function x(K,J){J(" makeSpaceForEdgeLabels",function(){B(K)}),J(" removeSelfEdges",function(){$(K)}),J(" acyclic",function(){t.run(K)}),J(" nestingGraph.run",function(){c.run(K)}),J(" rank",function(){r(g.asNonCompoundGraph(K))}),J(" injectEdgeLabelProxies",function(){I(K)}),J(" removeEmptyRanks",function(){a(K)}),J(" nestingGraph.cleanup",function(){c.cleanup(K)}),J(" normalizeRanks",function(){i(K)}),J(" assignRankMinMax",function(){q(K)}),J(" removeEdgeLabelProxies",function(){U(K)}),J(" normalize.run",function(){n.run(K)}),J(" parentDummyChains",function(){o(K)}),J(" addBorderSegments",function(){u(K)}),J(" order",function(){h(K)}),J(" insertSelfEdges",function(){Y(K)}),J(" adjustCoordinateSystem",function(){f.adjust(K)}),J(" position",function(){p(K)}),J(" positionSelfEdges",function(){P(K)}),J(" removeBorderNodes",function(){F(K)}),J(" normalize.undo",function(){n.undo(K)}),J(" fixupEdgeLabelCoords",function(){z(K)}),J(" undoCoordinateSystem",function(){f.undo(K)}),J(" translateGraph",function(){D(K)}),J(" assignNodeIntersects",function(){V(K)}),J(" reversePoints",function(){Q(K)}),J(" acyclic.undo",function(){t.undo(K)})}function w(K,J){e.forEach(K.nodes(),function(G){var ee=K.node(G),te=J.node(G);ee&&(ee.x=te.x,ee.y=te.y,J.children(G).length&&(ee.width=te.width,ee.height=te.height))}),e.forEach(K.edges(),function(G){var ee=K.edge(G),te=J.edge(G);ee.points=te.points,e.has(te,"x")&&(ee.x=te.x,ee.y=te.y)}),K.graph().width=J.graph().width,K.graph().height=J.graph().height}var S=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},k=["acyclicer","ranker","rankdir","align"],E=["width","height"],R={width:0,height:0},T=["minlen","weight","width","height","labeloffset"],A={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function L(K){var J=new v({multigraph:!0,compound:!0}),G=se(K.graph());return J.setGraph(e.merge({},N,W(G,S),e.pick(G,k))),e.forEach(K.nodes(),function(ee){var te=se(K.node(ee));J.setNode(ee,e.defaults(W(te,E),R)),J.setParent(ee,K.parent(ee))}),e.forEach(K.edges(),function(ee){var te=se(K.edge(ee));J.setEdge(ee,e.merge({},A,W(te,T),e.pick(te,O)))}),J}function B(K){var J=K.graph();J.ranksep/=2,e.forEach(K.edges(),function(G){var ee=K.edge(G);ee.minlen*=2,ee.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?ee.width+=ee.labeloffset:ee.height+=ee.labeloffset)})}function I(K){e.forEach(K.edges(),function(J){var G=K.edge(J);if(G.width&&G.height){var ee=K.node(J.v),te=K.node(J.w),oe={rank:(te.rank-ee.rank)/2+ee.rank,e:J};g.addDummyNode(K,"edge-proxy",oe,"_ep")}})}function q(K){var J=0;e.forEach(K.nodes(),function(G){var ee=K.node(G);ee.borderTop&&(ee.minRank=K.node(ee.borderTop).rank,ee.maxRank=K.node(ee.borderBottom).rank,J=e.max(J,ee.maxRank))}),K.graph().maxRank=J}function U(K){e.forEach(K.nodes(),function(J){var G=K.node(J);G.dummy==="edge-proxy"&&(K.edge(G.e).labelRank=G.rank,K.removeNode(J))})}function D(K){var J=Number.POSITIVE_INFINITY,G=0,ee=Number.POSITIVE_INFINITY,te=0,oe=K.graph(),fe=oe.marginx||0,he=oe.marginy||0;function me(de){var _e=de.x,ve=de.y,Ne=de.width,Ee=de.height;J=Math.min(J,_e-Ne/2),G=Math.max(G,_e+Ne/2),ee=Math.min(ee,ve-Ee/2),te=Math.max(te,ve+Ee/2)}e.forEach(K.nodes(),function(de){me(K.node(de))}),e.forEach(K.edges(),function(de){var _e=K.edge(de);e.has(_e,"x")&&me(_e)}),J-=fe,ee-=he,e.forEach(K.nodes(),function(de){var _e=K.node(de);_e.x-=J,_e.y-=ee}),e.forEach(K.edges(),function(de){var _e=K.edge(de);e.forEach(_e.points,function(ve){ve.x-=J,ve.y-=ee}),e.has(_e,"x")&&(_e.x-=J),e.has(_e,"y")&&(_e.y-=ee)}),oe.width=G-J+fe,oe.height=te-ee+he}function V(K){e.forEach(K.edges(),function(J){var G=K.edge(J),ee=K.node(J.v),te=K.node(J.w),oe,fe;G.points?(oe=G.points[0],fe=G.points[G.points.length-1]):(G.points=[],oe=te,fe=ee),G.points.unshift(g.intersectRect(ee,oe)),G.points.push(g.intersectRect(te,fe))})}function z(K){e.forEach(K.edges(),function(J){var G=K.edge(J);if(e.has(G,"x"))switch((G.labelpos==="l"||G.labelpos==="r")&&(G.width-=G.labeloffset),G.labelpos){case"l":G.x-=G.width/2+G.labeloffset;break;case"r":G.x+=G.width/2+G.labeloffset;break}})}function Q(K){e.forEach(K.edges(),function(J){var G=K.edge(J);G.reversed&&G.points.reverse()})}function F(K){e.forEach(K.nodes(),function(J){if(K.children(J).length){var G=K.node(J),ee=K.node(G.borderTop),te=K.node(G.borderBottom),oe=K.node(e.last(G.borderLeft)),fe=K.node(e.last(G.borderRight));G.width=Math.abs(fe.x-oe.x),G.height=Math.abs(te.y-ee.y),G.x=oe.x+G.width/2,G.y=ee.y+G.height/2}}),e.forEach(K.nodes(),function(J){K.node(J).dummy==="border"&&K.removeNode(J)})}function $(K){e.forEach(K.edges(),function(J){if(J.v===J.w){var G=K.node(J.v);G.selfEdges||(G.selfEdges=[]),G.selfEdges.push({e:J,label:K.edge(J)}),K.removeEdge(J)}})}function Y(K){var J=g.buildLayerMatrix(K);e.forEach(J,function(G){var ee=0;e.forEach(G,function(te,oe){var fe=K.node(te);fe.order=oe+ee,e.forEach(fe.selfEdges,function(he){g.addDummyNode(K,"selfedge",{width:he.label.width,height:he.label.height,rank:fe.rank,order:oe+ ++ee,e:he.e,label:he.label},"_se")}),delete fe.selfEdges})})}function P(K){e.forEach(K.nodes(),function(J){var G=K.node(J);if(G.dummy==="selfedge"){var ee=K.node(G.e.v),te=ee.x+ee.width/2,oe=ee.y,fe=G.x-te,he=ee.height/2;K.setEdge(G.e,G.label),K.removeNode(J),G.label.points=[{x:te+2*fe/3,y:oe-he},{x:te+5*fe/6,y:oe-he},{x:te+fe,y:oe},{x:te+5*fe/6,y:oe+he},{x:te+2*fe/3,y:oe+he}],G.label.x=G.x,G.label.y=G.y}})}function W(K,J){return e.mapValues(e.pick(K,J),Number)}function se(K){var J={};return e.forEach(K,function(G,ee){J[ee.toLowerCase()]=G}),J}return sx}var ox,qR;function yX(){if(qR)return ox;qR=1;var e=Ze(),t=Xt(),n=Fn().Graph;ox={debugOrdering:r};function r(i){var o=t.buildLayerMatrix(i),a=new n({compound:!0,multigraph:!0}).setGraph({});return e.forEach(i.nodes(),function(c){a.setNode(c,{label:c}),a.setParent(c,"layer"+i.node(c).rank)}),e.forEach(i.edges(),function(c){a.setEdge(c.v,c.w,{},c.name)}),e.forEach(o,function(c,u){var f="layer"+u;a.setNode(f,{rank:"same"}),e.reduce(c,function(h,p){return a.setEdge(h,p,{style:"invis"}),p})}),a}return ox}var ax,$R;function vX(){return $R||($R=1,ax="0.8.5"),ax}var lx,FR;function xX(){return FR||(FR=1,lx={graphlib:Fn(),layout:gX(),debug:yX(),util:{time:Xt().time,notime:Xt().notime},version:vX()}),lx}var wX=xX();const BR=fl(wX);function nL(){const{nodes:e,edges:t,setNodes:n,setEdges:r,updateNodeData:i,clearCanvas:o}=uo(),a=mo(),c=j.useMemo(()=>e.filter(I=>I.selected),[e]),u=j.useMemo(()=>t.filter(I=>I.selected),[t]),f=j.useCallback(I=>e.find(q=>q.id===I),[e]),h=j.useCallback(I=>t.find(q=>q.id===I),[t]),p=j.useCallback(I=>{n([...e,I])},[e,n]),g=j.useCallback(I=>{n(e.filter(q=>q.id!==I)),r(t.filter(q=>q.source!==I&&q.target!==I))},[e,t,n,r]),v=j.useCallback(()=>{const I=[],q=new Map;for(const D of c){const V=`${D.id}-copy-${Date.now()}`;q.set(D.id,V),I.push({...D,id:V,position:{x:D.position.x+50,y:D.position.y+50},selected:!1,data:{...D.data,id:V}})}n([...e,...I]);const U=[];for(const D of t)q.has(D.source)&&q.has(D.target)&&U.push({...D,id:`${D.id}-copy-${Date.now()}`,source:q.get(D.source),target:q.get(D.target)});U.length>0&&r([...t,...U])},[c,e,t,n,r]),b=j.useCallback(()=>{const I=new Set(c.map(U=>U.id)),q=new Set(u.map(U=>U.id));n(e.filter(U=>!I.has(U.id))),r(t.filter(U=>!q.has(U.id)&&!I.has(U.source)&&!I.has(U.target)))},[c,u,e,t,n,r]),x=j.useCallback(()=>{const I=new BR.graphlib.Graph;I.setDefaultEdgeLabel(()=>({})),I.setGraph({rankdir:"TB",nodesep:50,ranksep:80});for(const U of e)I.setNode(U.id,{width:200,height:100});for(const U of t)I.setEdge(U.source,U.target);BR.layout(I);const q=e.map(U=>{const D=I.node(U.id);return{...U,position:{x:D.x-100,y:D.y-50}}});n(q),setTimeout(()=>{a.fitView({padding:.2})},50)},[e,t,n,a]),w=j.useCallback(()=>{a.fitView({padding:.2})},[a]),S=j.useCallback(I=>{const q=f(I);q&&a.setCenter(q.position.x+100,q.position.y+50,{zoom:1.5,duration:300})},[f,a]),N=j.useCallback((I,q=!1)=>{n(e.map(U=>({...U,selected:q&&U.selected||U.id===I})))},[e,n]),k=j.useCallback(()=>{n(e.map(I=>({...I,selected:!1}))),r(t.map(I=>({...I,selected:!1})))},[e,t,n,r]),{undo:E,redo:R,canUndo:T,canRedo:A,copySelected:O,paste:L,canPaste:B}=uo();return{nodes:e,edges:t,selectedNodes:c,selectedEdges:u,getNode:f,getEdge:h,addNode:p,removeNode:g,updateNodeData:i,setNodes:n,setEdges:r,clearCanvas:o,selectNode:N,clearSelection:k,duplicateSelected:v,deleteSelected:b,autoLayout:x,fitView:w,zoomToNode:S,undo:E,redo:R,canUndo:T,canRedo:A,copySelected:O,paste:L,canPaste:B}}const bX={step:l8,subworkflow:u8,trigger:d8,output:p8};function _X(){const{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:i,setNodes:o}=uo(),{autoLayout:a,deleteSelected:c,duplicateSelected:u}=nL(),f=pi(G=>G.currentWorkflow),{screenToFlowPosition:h}=mo(),[p,g]=j.useState(null),[v,b]=j.useState(!1),[x,w]=j.useState(null),[S,N]=j.useState(!1),[k,E]=j.useState(null),R=j.useRef(null),T=j.useCallback((G,ee)=>{if(G.preventDefault(),ee.type==="subworkflow"||ee.type==="trigger"||ee.type==="output")return;const te=f==null?void 0:f.steps.find(oe=>oe.id===ee.data.id);te&&(g(te),b(!0))},[f]),A=j.useCallback(()=>{if(!f)return null;const G=e.find(ee=>ee.selected&&ee.type==="step");return G&&f.steps.find(ee=>ee.id===G.data.id)||null},[f,e]),{undo:O,redo:L,canUndo:B,canRedo:I,copySelected:q,paste:U,canPaste:D}=uo(),V=j.useCallback(G=>{const ee=G.metaKey||G.ctrlKey;if((G.key==="Backspace"||G.key==="Delete")&&c(),ee&&G.key==="d"&&(G.preventDefault(),u()),ee&&G.key==="l"&&(G.preventDefault(),a()),ee&&G.key==="z"&&!G.shiftKey&&(G.preventDefault(),B()&&O()),(ee&&G.shiftKey&&G.key==="z"||ee&&G.key==="y")&&(G.preventDefault(),I()&&L()),ee&&G.key==="c"&&(G.preventDefault(),q()),ee&&G.key==="v"&&(G.preventDefault(),D()&&U()),G.key==="e"&&!ee&&!G.shiftKey&&!G.altKey){G.preventDefault();const te=A();te&&(g(te),b(!0))}if(G.key==="y"&&!ee&&!G.shiftKey&&!G.altKey){G.preventDefault();const te=A();te&&(w(te),N(!0))}},[c,u,a,A,O,L,B,I,q,U,D]),z=j.useCallback(G=>{console.log("Saving step:",G),b(!1),g(null)},[]),Q=j.useCallback(()=>{if(!k||!f)return;const G=f.steps.find(ee=>ee.id===k.data.id);G&&(g(G),b(!0)),E(null)},[k,f]),F=j.useCallback(()=>{if(!k||!f)return;const G=f.steps.find(ee=>ee.id===k.data.id);G&&(w(G),N(!0)),E(null)},[k,f]),$=j.useCallback(()=>{k&&u(),E(null)},[k,u]),Y=j.useCallback(()=>{k&&c(),E(null)},[k,c]),P=j.useCallback(()=>{k&&console.log("Execute step:",k.data.id),E(null)},[k]),W=j.useCallback((G,ee)=>{G.preventDefault(),ee.type==="step"&&E(ee)},[]),se=j.useCallback(G=>{G.preventDefault(),G.dataTransfer.dropEffect="copy"},[]),K=j.useCallback(G=>{var te;G.preventDefault();const ee=G.dataTransfer.getData("application/marktoflow-tool");if(ee)try{const oe=JSON.parse(ee),fe=h({x:G.clientX,y:G.clientY}),he=oe.id+"-"+Date.now().toString(36),me={id:he,type:"step",position:fe,data:{id:he,name:oe.name+" Action",action:oe.id+"."+(((te=oe.actions)==null?void 0:te[0])||"action"),status:"pending"}};o([...e,me])}catch(oe){console.error("Failed to parse dropped tool data:",oe)}},[e,o,h]),J=j.useCallback(()=>{if(!f||!p)return[];const G=[];if(f.inputs)for(const te of Object.keys(f.inputs))G.push(`inputs.${te}`);const ee=f.steps.findIndex(te=>te.id===p.id);for(let te=0;te<ee;te++){const oe=f.steps[te];oe.outputVariable&&G.push(oe.outputVariable)}return G},[f,p]);return m.jsxs(J7,{children:[m.jsx(Z7,{asChild:!0,children:m.jsx("div",{ref:R,className:"w-full h-full",onKeyDown:V,onDragOver:se,onDrop:K,tabIndex:0,children:m.jsxs($B,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:i,onNodeDoubleClick:T,onNodeContextMenu:W,nodeTypes:bX,fitView:!0,snapToGrid:!0,snapGrid:[16,16],defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},proOptions:{hideAttribution:!0},children:[m.jsx(UB,{variant:Cr.Dots,gap:24,size:1,color:"#3d3d5c"}),m.jsx(QB,{}),m.jsx(uz,{nodeColor:G=>{var ee;switch((ee=G.data)==null?void 0:ee.status){case"running":return"#f0ad4e";case"completed":return"#5cb85c";case"failed":return"#d9534f";default:return"#2d2d4a"}},maskColor:"rgba(26, 26, 46, 0.8)"})]})})}),m.jsxs(nP,{children:[m.jsxs(Vs,{onClick:Q,children:[m.jsx(Kz,{className:"w-4 h-4 mr-2"}),"Edit Step",m.jsx(Ia,{children:"E"})]}),m.jsxs(Vs,{onClick:F,children:[m.jsx(Sw,{className:"w-4 h-4 mr-2"}),"View YAML",m.jsx(Ia,{children:"Y"})]}),m.jsx(Gx,{}),m.jsxs(Vs,{onClick:P,children:[m.jsx(xl,{className:"w-4 h-4 mr-2"}),"Execute Step"]}),m.jsx(Gx,{}),m.jsxs(Vs,{onClick:$,children:[m.jsx(nl,{className:"w-4 h-4 mr-2"}),"Duplicate",m.jsx(Ia,{children:"⌘D"})]}),m.jsxs(Vs,{onClick:Y,destructive:!0,children:[m.jsx(vo,{className:"w-4 h-4 mr-2"}),"Delete",m.jsx(Ia,{children:"⌫"})]})]}),m.jsx(mH,{open:v,onOpenChange:b,step:p,onSave:z,availableVariables:J()}),m.jsx(bl,{open:S,onOpenChange:N,title:`YAML: ${(x==null?void 0:x.name)||(x==null?void 0:x.id)}`,size:"lg",children:m.jsx("div",{className:"p-4",children:m.jsx(uH,{value:x})})})]})}const rL=vi((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 i=n[n.length-1];return e({undoStack:n.slice(0,-1),redoStack:[...r,i]}),i},redo:()=>{const{undoStack:n,redoStack:r}=t();if(r.length===0)return null;const i=r[r.length-1];return e({redoStack:r.slice(0,-1),undoStack:[...n,i]}),i},clearHistory:()=>e({undoStack:[],redoStack:[]})}));function SX({onAddStep:e,onExecute:t,onSave:n,isExecuting:r=!1}){const{autoLayout:i,fitView:o,selectedNodes:a,deleteSelected:c,duplicateSelected:u}=nL(),{undo:f,redo:h,undoStack:p,redoStack:g}=rL(),{zoomIn:v,zoomOut:b}=mo(),x=p.length>0,w=g.length>0,S=a.length>0;return m.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1 px-2 py-1.5 bg-panel-bg/95 backdrop-blur border border-node-border rounded-lg shadow-lg",children:[m.jsx(Mn,{icon:m.jsx(Rf,{className:"w-4 h-4"}),label:"Add Step",onClick:e,shortcut:"N"}),m.jsx(ku,{}),m.jsx(Mn,{icon:m.jsx(Qz,{className:"w-4 h-4"}),label:"Undo",onClick:()=>f(),disabled:!x,shortcut:"⌘Z"}),m.jsx(Mn,{icon:m.jsx(zz,{className:"w-4 h-4"}),label:"Redo",onClick:()=>h(),disabled:!w,shortcut:"⌘⇧Z"}),m.jsx(ku,{}),m.jsx(Mn,{icon:m.jsx(nl,{className:"w-4 h-4"}),label:"Duplicate",onClick:u,disabled:!S,shortcut:"⌘D"}),m.jsx(Mn,{icon:m.jsx(vo,{className:"w-4 h-4"}),label:"Delete",onClick:c,disabled:!S,shortcut:"⌫"}),m.jsx(ku,{}),m.jsx(Mn,{icon:m.jsx(Bz,{className:"w-4 h-4"}),label:"Auto Layout",onClick:i,shortcut:"⌘L"}),m.jsx(Mn,{icon:m.jsx(Zz,{className:"w-4 h-4"}),label:"Zoom In",onClick:()=>v(),shortcut:"⌘+"}),m.jsx(Mn,{icon:m.jsx(e8,{className:"w-4 h-4"}),label:"Zoom Out",onClick:()=>b(),shortcut:"⌘-"}),m.jsx(Mn,{icon:m.jsx(Pz,{className:"w-4 h-4"}),label:"Fit View",onClick:o,shortcut:"⌘0"}),m.jsx(ku,{}),t&&m.jsx(Mn,{icon:r?m.jsx(UT,{className:"w-4 h-4"}):m.jsx(xl,{className:"w-4 h-4"}),label:r?"Stop":"Execute",onClick:t,variant:r?"destructive":"primary",shortcut:"⌘⏎"}),n&&m.jsx(Mn,{icon:m.jsx(Uz,{className:"w-4 h-4"}),label:"Save",onClick:n,shortcut:"⌘S"})]})}function Mn({icon:e,label:t,onClick:n,disabled:r,shortcut:i,variant:o="default"}){const a={default:"text-gray-300 hover:text-white hover:bg-white/10",primary:"text-primary hover:text-primary-light hover:bg-primary/10",destructive:"text-error hover:text-error hover:bg-error/10"};return m.jsxs("button",{onClick:n,disabled:r,className:`relative group p-2 rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${a[o]}`,title:`${t}${i?` (${i})`:""}`,children:[e,m.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-black/90 rounded text-xs text-white whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:[t,i&&m.jsx("span",{className:"ml-2 text-gray-400",children:i})]})]})}function ku(){return m.jsx("div",{className:"w-px h-6 bg-node-border mx-1"})}function kX({isExecuting:e,isPaused:t,workflowStatus:n,currentStepId:r,steps:i,logs:o,onPause:a,onResume:c,onStop:u,onStepOver:f,onClose:h,debug:p,onToggleDebugMode:g,onToggleBreakpoint:v,onStepInto:b,onStepOut:x,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:N}){const[k,E]=j.useState("steps"),R=(p==null?void 0:p.enabled)??!1,T=i.filter(L=>L.status==="completed").length,A=i.filter(L=>L.status==="failed").length,O=i.length>0?T/i.length*100:0;return!e&&n==="pending"?null:m.jsxs("div",{className:"absolute bottom-20 left-4 right-4 z-20 bg-panel-bg border border-node-border rounded-lg shadow-xl max-h-[400px] flex flex-col",children:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-node-border",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(RX,{status:n}),m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-medium text-white",children:TX(n)}),m.jsxs("div",{className:"text-xs text-gray-400",children:[T,"/",i.length," steps completed",A>0&&` • ${A} failed`]})]})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[g&&m.jsx(Ge,{variant:R?"primary":"ghost",size:"sm",onClick:g,icon:m.jsx(Ek,{className:"w-4 h-4"}),title:R?"Disable debug mode":"Enable debug mode",children:"Debug"}),e&&m.jsxs(m.Fragment,{children:[t?m.jsx(Ge,{variant:"secondary",size:"sm",onClick:c,icon:m.jsx(xl,{className:"w-4 h-4"}),children:"Resume"}):m.jsx(Ge,{variant:"secondary",size:"sm",onClick:a,icon:m.jsx(UT,{className:"w-4 h-4"}),children:"Pause"}),R&&t&&m.jsxs(m.Fragment,{children:[m.jsx(Ge,{variant:"secondary",size:"sm",onClick:f,icon:m.jsx(ef,{className:"w-4 h-4"}),title:"Step Over (F10)",children:"Over"}),b&&m.jsx(Ge,{variant:"secondary",size:"sm",onClick:b,icon:m.jsx(yz,{className:"w-4 h-4"}),title:"Step Into (F11)",children:"Into"}),x&&m.jsx(Ge,{variant:"secondary",size:"sm",onClick:x,icon:m.jsx(vz,{className:"w-4 h-4"}),title:"Step Out (Shift+F11)",children:"Out"})]}),!R&&m.jsx(Ge,{variant:"secondary",size:"sm",onClick:f,icon:m.jsx(HT,{className:"w-4 h-4"}),disabled:!t,children:"Step"}),m.jsx(Ge,{variant:"destructive",size:"sm",onClick:u,icon:m.jsx(WT,{className:"w-4 h-4"}),children:"Stop"})]}),!e&&m.jsx(Ge,{variant:"secondary",size:"sm",onClick:h,children:"Close"})]})]}),m.jsx("div",{className:"h-1 bg-node-bg",children:m.jsx("div",{className:`h-full transition-all duration-300 ${n==="failed"?"bg-error":n==="completed"?"bg-success":"bg-primary"}`,style:{width:`${O}%`}})}),m.jsxs("div",{className:"flex border-b border-node-border",children:[m.jsx("button",{onClick:()=>E("steps"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="steps"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Steps"}),m.jsx("button",{onClick:()=>E("variables"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="variables"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Variables"}),m.jsx("button",{onClick:()=>E("logs"),className:`px-4 py-2 text-sm font-medium transition-colors ${k==="logs"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:"Logs"}),R&&m.jsxs("button",{onClick:()=>E("debug"),className:`px-4 py-2 text-sm font-medium transition-colors flex items-center gap-1 ${k==="debug"?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:[m.jsx(Ek,{className:"w-3 h-3"}),"Debug"]})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[k==="steps"&&m.jsx(EX,{steps:i,currentStepId:r,debugEnabled:R,breakpoints:p==null?void 0:p.breakpoints,onToggleBreakpoint:v}),k==="variables"&&m.jsx(CX,{steps:i}),k==="logs"&&m.jsx(NX,{logs:o}),k==="debug"&&R&&m.jsx(MX,{debug:p,onClearBreakpoints:w,onAddWatchExpression:S,onRemoveWatchExpression:N})]})]})}function EX({steps:e,currentStepId:t,debugEnabled:n,breakpoints:r,onToggleBreakpoint:i}){return m.jsx("div",{className:"space-y-2",children:e.map(o=>{const a=r==null?void 0:r.has(o.stepId);return m.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${o.stepId===t?"bg-primary/10 border-primary":a?"bg-error/10 border-error/50":"bg-node-bg border-node-border"}`,children:[n&&i&&m.jsx("button",{onClick:()=>i(o.stepId),className:`w-4 h-4 rounded-full flex items-center justify-center transition-colors ${a?"bg-error":"bg-transparent border border-gray-500 hover:border-error hover:bg-error/20"}`,title:a?"Remove breakpoint":"Add breakpoint",children:a&&m.jsx(Ax,{className:"w-2 h-2 fill-current text-white"})}),m.jsx(AX,{status:o.status}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-sm font-medium text-white truncate",children:o.stepName||o.stepId}),o.error&&m.jsx("div",{className:"text-xs text-error mt-1 truncate",children:o.error})]}),o.duration!==void 0&&m.jsxs("div",{className:"text-xs text-gray-400",children:[o.duration,"ms"]})]},o.stepId)})})}function NX({logs:e}){return m.jsx("div",{className:"font-mono text-xs space-y-1",children:e.length===0?m.jsx("div",{className:"text-gray-500",children:"No logs yet..."}):e.map((t,n)=>m.jsx("div",{className:"text-gray-300",children:t},n))})}function CX({steps:e}){const[t,n]=j.useState(new Set),[r,i]=j.useState(null),o=e.filter(u=>u.output!==void 0&&u.outputVariable),a=u=>{n(f=>{const h=new Set(f);return h.has(u)?h.delete(u):h.add(u),h})},c=async(u,f)=>{try{const h=typeof f=="string"?f:JSON.stringify(f,null,2);await navigator.clipboard.writeText(h),i(u),setTimeout(()=>i(null),2e3)}catch(h){console.error("Failed to copy:",h)}};return o.length===0?m.jsxs("div",{className:"text-center py-8 text-gray-500 text-sm",children:["No variables available yet.",m.jsx("br",{}),m.jsx("span",{className:"text-xs",children:"Variables will appear as steps complete."})]}):m.jsx("div",{className:"space-y-2",children:o.map(u=>{const f=t.has(u.stepId);return m.jsxs("div",{className:"border border-node-border rounded-lg overflow-hidden",children:[m.jsxs("button",{onClick:()=>a(u.stepId),className:"w-full flex items-center gap-2 px-3 py-2 bg-node-bg hover:bg-white/5 transition-colors",children:[f?m.jsx(tl,{className:"w-4 h-4 text-gray-400"}):m.jsx(xn,{className:"w-4 h-4 text-gray-400"}),m.jsx("code",{className:"text-sm text-primary font-mono",children:u.outputVariable}),m.jsx("span",{className:"text-xs text-gray-500 ml-auto",children:jX(u.output)})]}),f&&m.jsx("div",{className:"p-3 bg-panel-bg border-t border-node-border",children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("div",{className:"flex-1 overflow-x-auto",children:m.jsx(Yx,{value:u.output,onCopy:(h,p)=>c(h,p),copiedKey:r,path:u.outputVariable||""})}),m.jsx("button",{onClick:()=>c(u.outputVariable||"",u.output),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy entire value",children:r===u.outputVariable?m.jsx(el,{className:"w-4 h-4 text-success"}):m.jsx(nl,{className:"w-4 h-4 text-gray-400"})})]})})]},u.stepId)})})}function Yx({value:e,onCopy:t,copiedKey:n,path:r,depth:i=0}){const[o,a]=j.useState(i<2);if(e===null)return m.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"null"});if(e===void 0)return m.jsx("span",{className:"text-gray-500 font-mono text-xs",children:"undefined"});if(typeof e=="boolean")return m.jsx("span",{className:`font-mono text-xs ${e?"text-success":"text-error"}`,children:String(e)});if(typeof e=="number")return m.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 m.jsxs("span",{className:"text-success font-mono text-xs",children:['"',c,'"']})}if(Array.isArray(e))return e.length===0?m.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"[]"}):m.jsxs("div",{className:"space-y-1",children:[m.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?m.jsx(tl,{className:"w-3 h-3"}):m.jsx(xn,{className:"w-3 h-3"}),m.jsxs("span",{className:"text-xs font-mono",children:["Array(",e.length,")"]})]}),o&&m.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[e.slice(0,20).map((c,u)=>m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsxs("span",{className:"text-gray-500 font-mono text-xs",children:["[",u,"]:"]}),m.jsx(Yx,{value:c,onCopy:t,copiedKey:n,path:`${r}[${u}]`,depth:i+1})]},u)),e.length>20&&m.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",e.length-20," more items"]})]})]});if(typeof e=="object"){const c=Object.entries(e);return c.length===0?m.jsx("span",{className:"text-gray-400 font-mono text-xs",children:"{}"}):m.jsxs("div",{className:"space-y-1",children:[m.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-gray-400 hover:text-white transition-colors",children:[o?m.jsx(tl,{className:"w-3 h-3"}):m.jsx(xn,{className:"w-3 h-3"}),m.jsxs("span",{className:"text-xs font-mono",children:["Object(",c.length," keys)"]})]}),o&&m.jsxs("div",{className:"ml-4 pl-2 border-l border-node-border space-y-1",children:[c.slice(0,30).map(([u,f])=>m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsxs("span",{className:"text-primary font-mono text-xs",children:[u,":"]}),m.jsx(Yx,{value:f,onCopy:t,copiedKey:n,path:`${r}.${u}`,depth:i+1})]},u)),c.length>30&&m.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",c.length-30," more keys"]})]})]})}return m.jsx("span",{className:"text-gray-400 font-mono text-xs",children:String(e)})}function jX(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?`array[${e.length}]`:typeof e=="object"?"object":typeof e}function RX({status:e}){switch(e){case"running":return m.jsx(yo,{className:"w-5 h-5 text-primary animate-spin"});case"completed":return m.jsx(go,{className:"w-5 h-5 text-success"});case"failed":return m.jsx(Gi,{className:"w-5 h-5 text-error"});case"cancelled":return m.jsx(WT,{className:"w-5 h-5 text-gray-400"});default:return m.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-500"})}}function AX({status:e}){switch(e){case"running":return m.jsx(yo,{className:"w-4 h-4 text-warning animate-spin"});case"completed":return m.jsx(go,{className:"w-4 h-4 text-success"});case"failed":return m.jsx(Gi,{className:"w-4 h-4 text-error"});case"skipped":return m.jsx(HT,{className:"w-4 h-4 text-gray-400"});default:return m.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-500"})}}function TX(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 MX({debug:e,onClearBreakpoints:t,onAddWatchExpression:n,onRemoveWatchExpression:r}){const[i,o]=j.useState(""),a=()=>{i.trim()&&n&&(n(i.trim()),o(""))};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("h4",{className:"text-sm font-medium text-white flex items-center gap-2",children:[m.jsx(Ax,{className:"w-3 h-3 text-error"}),"Breakpoints (",e.breakpoints.size,")"]}),e.breakpoints.size>0&&t&&m.jsxs("button",{onClick:t,className:"text-xs text-gray-400 hover:text-white flex items-center gap-1",children:[m.jsx(vo,{className:"w-3 h-3"}),"Clear all"]})]}),m.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.breakpoints.size===0?m.jsx("div",{className:"text-xs text-gray-500",children:"No breakpoints set. Click the dot next to a step to add one."}):m.jsx("div",{className:"space-y-1",children:Array.from(e.breakpoints).map(c=>m.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-300",children:[m.jsx(Ax,{className:"w-2 h-2 fill-current text-error"}),m.jsx("span",{className:"font-mono",children:c})]},c))})})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("h4",{className:"text-sm font-medium text-white",children:"Call Stack"}),m.jsx("div",{className:"bg-node-bg rounded-lg p-3",children:e.callStack.length===0?m.jsx("div",{className:"text-xs text-gray-500",children:"No active call stack"}):m.jsx("div",{className:"space-y-1",children:e.callStack.map((c,u)=>m.jsxs("div",{className:`flex items-center gap-2 text-xs ${u===0?"text-primary":"text-gray-400"}`,children:[m.jsx(ef,{className:"w-3 h-3"}),m.jsx("span",{className:"font-mono",children:c})]},u))})})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("h4",{className:"text-sm font-medium text-white",children:"Watch Expressions"}),m.jsxs("div",{className:"bg-node-bg rounded-lg p-3 space-y-2",children:[n&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"text",value:i,onChange:c=>o(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),placeholder:"Add expression...",className:"flex-1 bg-transparent border border-node-border rounded px-2 py-1 text-xs text-white placeholder-gray-500 focus:outline-none focus:border-primary"}),m.jsx("button",{onClick:a,disabled:!i.trim(),className:"p-1 text-gray-400 hover:text-white disabled:opacity-50",children:m.jsx(Rf,{className:"w-4 h-4"})})]}),e.watchExpressions.length===0?m.jsx("div",{className:"text-xs text-gray-500",children:"No watch expressions. Add an expression to monitor its value."}):m.jsx("div",{className:"space-y-1",children:e.watchExpressions.map(c=>m.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs group",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx("span",{className:"text-primary font-mono truncate",children:c}),m.jsx("span",{className:"text-gray-500",children:"="}),m.jsx("span",{className:"text-gray-300 font-mono truncate",children:"(not evaluated)"})]}),r&&m.jsx("button",{onClick:()=>r(c),className:"p-1 text-gray-500 hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",children:m.jsx(wl,{className:"w-3 h-3"})})]},c))})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("h4",{className:"text-sm font-medium text-white",children:"Debug State"}),m.jsxs("div",{className:"bg-node-bg rounded-lg p-3 text-xs space-y-1",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-gray-400",children:"Current Step:"}),m.jsx("span",{className:"text-white font-mono",children:e.currentStepId||"(none)"})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-gray-400",children:"Paused at Breakpoint:"}),m.jsx("span",{className:e.pausedAtBreakpoint?"text-error":"text-gray-500",children:e.pausedAtBreakpoint?"Yes":"No"})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-gray-400",children:"Step Over Pending:"}),m.jsx("span",{className:e.stepOverPending?"text-warning":"text-gray-500",children:e.stepOverPending?"Yes":"No"})]})]})]})]})}function IX(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(i))!=null?o:null;return c instanceof Promise?c.then(a):a(c)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Xx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Xx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Xx(r)(n)}}}},OX=(e,t)=>(n,r,i)=>{let o={storage:IX(()=>localStorage),partialize:w=>w,version:0,merge:(w,S)=>({...S,...w}),...t},a=!1,c=0;const u=new Set,f=new Set;let h=o.storage;if(!h)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...w)},r,i);const p=()=>{const w=o.partialize({...r()});return h.setItem(o.name,{state:w,version:o.version})},g=i.setState;i.setState=(w,S)=>(g(w,S),p());const v=e((...w)=>(n(...w),p()),r,i);i.getInitialState=()=>v;let b;const x=()=>{var w,S;if(!h)return;const N=++c;a=!1,u.forEach(E=>{var R;return E((R=r())!=null?R:v)});const k=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(w=r())!=null?w:v))||void 0;return Xx(h.getItem.bind(h))(o.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==o.version){if(o.migrate){const R=o.migrate(E.state,E.version);return R instanceof Promise?R.then(T=>[!0,T]):[!0,R]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,E.state];return[!1,void 0]}).then(E=>{var R;if(N!==c)return;const[T,A]=E;if(b=o.merge(A,(R=r())!=null?R:v),n(b,!0),T)return p()}).then(()=>{N===c&&(k==null||k(b,void 0),b=r(),a=!0,f.forEach(E=>E(b)))}).catch(E=>{N===c&&(k==null||k(void 0,E))})};return i.persist={setOptions:w=>{o={...o,...w},w.storage&&(h=w.storage)},clearStorage:()=>{h==null||h.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>x(),hasHydrated:()=>a,onHydrate:w=>(u.add(w),()=>{u.delete(w)}),onFinishHydration:w=>(f.add(w),()=>{f.delete(w)})},o.skipHydration||x(),b||v},iL=OX,zR={tablet:768,desktop:1024};function PX(e){return e>=zR.desktop?"desktop":e>=zR.tablet?"tablet":"mobile"}const Pb=vi()(iL((e,t)=>({sidebarOpen:!0,propertiesPanelOpen:!0,mobileMenuOpen:!1,breakpoint:"desktop",toggleSidebar:()=>e(n=>({sidebarOpen:!n.sidebarOpen})),setSidebarOpen:n=>e({sidebarOpen:n}),togglePropertiesPanel:()=>e(n=>({propertiesPanelOpen:!n.propertiesPanelOpen})),setPropertiesPanelOpen:n=>e({propertiesPanelOpen:n}),toggleMobileMenu:()=>e(n=>({mobileMenuOpen:!n.mobileMenuOpen})),setMobileMenuOpen:n=>e({mobileMenuOpen:n}),setBreakpoint:n=>{t(),e(n==="mobile"?{breakpoint:n,sidebarOpen:!1,propertiesPanelOpen:!1}:n==="tablet"?{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!1}:{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!0})},closeAllPanels:()=>e({sidebarOpen:!1,propertiesPanelOpen:!1,mobileMenuOpen:!1})}),{name:"marktoflow-layout",partialize:e=>({sidebarOpen:e.sidebarOpen,propertiesPanelOpen:e.propertiesPanelOpen})}));function LX(){const[e,t]=j.useState("workflows"),{workflows:n,selectedWorkflow:r,selectWorkflow:i}=pi(),{resetNavigation:o}=Nw(),{sidebarOpen:a,setSidebarOpen:c,breakpoint:u}=Pb(),f=j.useCallback(h=>{o(),i(h),u==="mobile"&&c(!1)},[o,i,u,c]);return!a&&u!=="mobile"?m.jsxs("button",{onClick:()=>c(!0),className:"w-12 bg-panel-bg border-r border-node-border flex flex-col items-center py-4 gap-4 hover:bg-white/5 transition-colors","aria-label":"Expand sidebar",children:[m.jsx(xn,{className:"w-4 h-4 text-gray-400"}),m.jsx(VT,{className:"w-5 h-5 text-primary"})]}):u==="mobile"?a?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>c(!1)}),m.jsx("div",{className:"fixed inset-y-0 left-0 w-72 bg-panel-bg border-r border-node-border flex flex-col z-50 md:hidden animate-slide-in-left",children:m.jsx(VR,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:!0})})]}):null:m.jsx("div",{className:"w-64 bg-panel-bg border-r border-node-border flex flex-col",children:m.jsx(VR,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:u==="tablet"})})}function VR({activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:i,onClose:o,showClose:a}){return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"p-4 border-b border-node-border flex items-center justify-between",children:[m.jsxs("h1",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[m.jsx(VT,{className:"w-5 h-5 text-primary"}),"Marktoflow"]}),a&&m.jsx("button",{onClick:o,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Close sidebar",children:m.jsx(wl,{className:"w-4 h-4 text-gray-400"})})]}),m.jsxs("div",{className:"flex border-b border-node-border",children:[m.jsx("button",{onClick:()=>t("workflows"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="workflows"?"text-primary border-b-2 border-primary":"text-gray-400 hover:text-white"}`,children:"Workflows"}),m.jsx("button",{onClick:()=>t("tools"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="tools"?"text-primary border-b-2 border-primary":"text-gray-400 hover:text-white"}`,children:"Tools"})]}),m.jsx("div",{className:"p-3 border-b border-node-border",children:m.jsxs("div",{className:"relative",children:[m.jsx(Mx,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),m.jsx("input",{type:"text",placeholder:`Search ${e}...`,className:"w-full pl-9 pr-3 py-2 bg-node-bg border border-node-border rounded-lg text-sm text-white placeholder-gray-500 focus:outline-none focus:border-primary"})]})}),m.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:e==="workflows"?m.jsx(DX,{workflows:n,selectedWorkflow:r,onSelect:i}):m.jsx($X,{})}),e==="workflows"&&m.jsx("div",{className:"p-3 border-t border-node-border",children:m.jsxs("button",{className:"w-full flex items-center justify-center gap-2 px-4 py-2 bg-primary hover:bg-primary-dark text-white rounded-lg text-sm font-medium transition-colors",children:[m.jsx(Rf,{className:"w-4 h-4"}),"New Workflow"]})})]})}function DX({workflows:e,selectedWorkflow:t,onSelect:n}){return e.length===0?m.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No workflows found"}):m.jsx("div",{className:"space-y-1",children:e.map(r=>m.jsxs("button",{onClick:()=>n(r.path),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors ${t===r.path?"bg-primary/10 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[m.jsx(Tx,{className:"w-4 h-4 flex-shrink-0"}),m.jsx("span",{className:"text-sm truncate",children:r.name}),m.jsx(xn,{className:"w-4 h-4 ml-auto flex-shrink-0 opacity-50"})]},r.path))})}const qX=[{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 $X(){const[e,t]=j.useState(qX),[n,r]=j.useState(!0),[i,o]=j.useState("");j.useEffect(()=>{async function f(){try{const h=await fetch("/api/tools");if(h.ok){const p=await h.json();t(p.tools)}}catch(h){console.error("Failed to fetch tools:",h)}finally{r(!1)}}f()},[]);const a=i?e.filter(f=>{var h;return f.name.toLowerCase().includes(i.toLowerCase())||f.category.toLowerCase().includes(i.toLowerCase())||((h=f.description)==null?void 0:h.toLowerCase().includes(i.toLowerCase()))}):e,c=[...new Set(a.map(f=>f.category))],u=(f,h)=>{f.dataTransfer.setData("application/marktoflow-tool",JSON.stringify(h)),f.dataTransfer.effectAllowed="copy"};return n?m.jsx("div",{className:"flex items-center justify-center py-8",children:m.jsx(yo,{className:"w-5 h-5 text-gray-500 animate-spin"})}):m.jsxs("div",{className:"space-y-4",children:[c.map(f=>m.jsxs("div",{children:[m.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider px-2 mb-2",children:f}),m.jsx("div",{className:"space-y-1",children:a.filter(h=>h.category===f).map(h=>m.jsxs("div",{draggable:!0,onDragStart:p=>u(p,h),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-gray-300 hover:bg-white/5 cursor-grab active:cursor-grabbing transition-colors group",title:h.description||(h.sdk?"SDK: "+h.sdk:void 0),children:[m.jsx("span",{className:"text-lg",children:h.icon}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("span",{className:"text-sm block truncate",children:h.name}),h.actionCount!==void 0&&m.jsxs("span",{className:"text-xs text-gray-500",children:[h.actionCount," actions"]})]})]},h.id))})]},f)),a.length===0&&m.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No tools found"})]})}const UR={enabled:!1,breakpoints:new Set,currentStepId:null,pausedAtBreakpoint:!1,stepOverPending:!1,watchExpressions:[],callStack:[]},sL=vi((e,t)=>({runs:[],currentRunId:null,isExecuting:!1,isPaused:!1,debug:UR,startExecution:(n,r,i)=>{const o="run-"+Date.now()+"-"+Math.random().toString(36).slice(2,8),a={id:o,workflowId:n,workflowName:r,status:"running",startTime:new Date().toISOString(),steps:[],logs:["Starting workflow execution: "+r],inputs:i};return e({runs:[a,...t().runs].slice(0,50),currentRunId:o,isExecuting:!0,isPaused:!1}),o},updateStepStatus:(n,r,i,o,a,c)=>{const{debug:u}=t(),f=u.enabled&&i==="running"&&u.breakpoints.has(r);e({runs:t().runs.map(h=>{if(h.id!==n)return h;const p=h.steps.find(v=>v.stepId===r),g=new Date().toISOString();return p?{...h,steps:h.steps.map(v=>{if(v.stepId!==r)return v;const b=i!=="running"?g:void 0,x=b&&v.startTime?new Date(b).getTime()-new Date(v.startTime).getTime():void 0;return{...v,status:i,endTime:b,duration:x,output:o??v.output,outputVariable:c??v.outputVariable,error:a??v.error}})}:{...h,steps:[...h.steps,{stepId:r,stepName:r,status:i,startTime:g,output:o,outputVariable:c,error:a}]}}),...f?{isPaused:!0,debug:{...t().debug,currentStepId:r,pausedAtBreakpoint:!0,stepOverPending:!1}}:{debug:{...t().debug,currentStepId:i==="running"?r:t().debug.currentStepId}}}),f&&t().addLog(n,`⏸️ Paused at breakpoint: ${r}`)},completeExecution:(n,r,i)=>{const o=new Date().toISOString();e({runs:t().runs.map(a=>{if(a.id!==n)return a;const c=new Date(o).getTime()-new Date(a.startTime).getTime();return{...a,status:r,endTime:o,duration:c,outputs:i,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(i=>i.id===n?{...i,logs:[...i.logs,"["+new Date().toLocaleTimeString()+"] "+r]}:i)})},pauseExecution:()=>{e({isPaused:!0});const{currentRunId:n,runs:r}=t();n&&r.find(o=>o.id===n)&&t().addLog(n,"Execution paused")},resumeExecution:()=>{e({isPaused:!1});const{currentRunId:n}=t();n&&t().addLog(n,"Execution resumed")},cancelExecution:n=>{t().addLog(n,"Execution cancelled by user"),t().completeExecution(n,"cancelled")},clearHistory:()=>{e({runs:[]})},getRun:n=>t().runs.find(r=>r.id===n),enableDebugMode:()=>{e({debug:{...t().debug,enabled:!0}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode enabled")},disableDebugMode:()=>{e({debug:{...UR,breakpoints:t().debug.breakpoints}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode disabled")},toggleBreakpoint:n=>{const{debug:r}=t(),i=new Set(r.breakpoints);i.has(n)?i.delete(n):i.add(n),e({debug:{...r,breakpoints:i}})},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:i}=t();!i||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"➡️ Step over"))},stepInto:()=>{const{debug:n,currentRunId:r,isPaused:i}=t();!i||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬇️ Step into"))},stepOut:()=>{const{debug:n,currentRunId:r,isPaused:i}=t();!i||!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(i=>i!==n)}})},updateCallStack:n=>{e({debug:{...t().debug,callStack:n}})}}));function Qx(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 FX(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),i=Math.floor(r/1e3),o=Math.floor(i/60),a=Math.floor(o/60),c=Math.floor(a/24);return i<60?"just now":o<60?o+" min ago":a<24?a+" hour"+(a>1?"s":"")+" ago":c<7?c+" day"+(c>1?"s":"")+" ago":n.toLocaleDateString()}function BX(){const[e,t]=j.useState("properties"),n=uo(u=>u.nodes),r=j.useMemo(()=>n.filter(u=>u.selected),[n]),i=pi(u=>u.currentWorkflow),{propertiesPanelOpen:o,setPropertiesPanelOpen:a,breakpoint:c}=Pb();return c==="mobile"?o?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:()=>a(!1)}),m.jsx("div",{className:"fixed inset-y-0 right-0 w-80 max-w-[85vw] bg-panel-bg border-l border-node-border flex flex-col z-50 animate-slide-in-right",children:m.jsx(HR,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:i,onClose:()=>a(!1),showClose:!0})})]}):null:o?m.jsx("div",{className:"w-80 bg-panel-bg border-l border-node-border flex flex-col",children:m.jsx(HR,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:i,onClose:()=>a(!1),showClose:c==="tablet"})}):m.jsxs("button",{onClick:()=>a(!0),className:"w-10 bg-panel-bg border-l border-node-border flex flex-col items-center py-4 gap-4 hover:bg-white/5 transition-colors","aria-label":"Expand properties panel",children:[m.jsx(xz,{className:"w-4 h-4 text-gray-400"}),m.jsx(Ew,{className:"w-5 h-5 text-gray-400"})]})}function HR({activeTab:e,setActiveTab:t,selectedNodes:n,workflow:r,onClose:i,showClose:o}){return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-node-border",children:[m.jsx("h2",{className:"text-sm font-medium text-white",children:"Properties"}),o&&m.jsx("button",{onClick:i,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Close properties panel",children:m.jsx(wl,{className:"w-4 h-4 text-gray-400"})})]}),m.jsxs("div",{className:"flex border-b border-node-border",children:[m.jsx(cx,{active:e==="properties",onClick:()=>t("properties"),icon:m.jsx(Ew,{className:"w-4 h-4"}),label:"Properties"}),m.jsx(cx,{active:e==="variables",onClick:()=>t("variables"),icon:m.jsx(Af,{className:"w-4 h-4"}),label:"Variables"}),m.jsx(cx,{active:e==="history",onClick:()=>t("history"),icon:m.jsx(kw,{className:"w-4 h-4"}),label:"History"})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="properties"&&m.jsx(zX,{selectedNodes:n,workflow:r}),e==="variables"&&m.jsx(VX,{}),e==="history"&&m.jsx(UX,{})]})]})}function cx({active:e,onClick:t,icon:n,label:r}){return m.jsxs("button",{onClick:t,className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors ${e?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:[n,r]})}function zX({selectedNodes:e,workflow:t}){var n,r,i,o,a,c,u,f,h,p,g,v,b,x,w;if(e.length===0)return m.jsxs("div",{className:"p-4 space-y-4",children:[m.jsx(zs,{title:"Workflow",children:t?m.jsxs("div",{className:"space-y-3",children:[m.jsx(ai,{label:"Name",value:((n=t.metadata)==null?void 0:n.name)||"Untitled"}),m.jsx(ai,{label:"Version",value:((r=t.metadata)==null?void 0:r.version)||"1.0.0"}),m.jsx(ai,{label:"Author",value:((i=t.metadata)==null?void 0:i.author)||"Unknown"}),m.jsx(ai,{label:"Steps",value:`${((o=t.steps)==null?void 0:o.length)||0} steps`})]}):m.jsx("div",{className:"text-sm text-gray-500",children:"No workflow loaded"})}),((a=t==null?void 0:t.metadata)==null?void 0:a.description)&&m.jsx(zs,{title:"Description",children:m.jsx("p",{className:"text-sm text-gray-300",children:t.metadata.description})}),((c=t==null?void 0:t.metadata)==null?void 0:c.tags)&&t.metadata.tags.length>0&&m.jsx(zs,{title:"Tags",children:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.metadata.tags.map(S=>m.jsx("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-full",children:S},S))})})]});if(e.length===1){const S=e[0];return m.jsxs("div",{className:"p-4 space-y-4",children:[m.jsx(zs,{title:"Step",children:m.jsxs("div",{className:"space-y-3",children:[m.jsx(ai,{label:"ID",value:((u=S.data)==null?void 0:u.id)||S.id}),m.jsx(ai,{label:"Name",value:((f=S.data)==null?void 0:f.name)||"(unnamed)"}),m.jsx(ai,{label:"Action",value:((h=S.data)==null?void 0:h.action)||((p=S.data)==null?void 0:p.workflowPath)||"-"}),m.jsx(ai,{label:"Status",value:((g=S.data)==null?void 0:g.status)||"pending",badge:!0,badgeColor:((v=S.data)==null?void 0:v.status)==="completed"?"success":((b=S.data)==null?void 0:b.status)==="failed"?"error":((x=S.data)==null?void 0:x.status)==="running"?"warning":"default"})]})}),((w=S.data)==null?void 0:w.error)&&m.jsx(zs,{title:"Error",children:m.jsx("div",{className:"p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono",children:S.data.error})}),m.jsx(zs,{title:"Actions",children:m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{className:"flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors",children:"Edit"}),m.jsx("button",{className:"flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors",children:"View YAML"})]})})]})}return m.jsx("div",{className:"p-4",children:m.jsxs("div",{className:"text-sm text-gray-400",children:[e.length," nodes selected"]})})}function VX(){const e=[{name:"inputs.repo",value:"owner/repo",type:"string"},{name:"inputs.pr_number",value:"123",type:"number"},{name:"pr_details.title",value:"Fix bug",type:"string"},{name:"pr_details.state",value:"open",type:"string"}];return m.jsx("div",{className:"p-4 space-y-2",children:e.map(t=>m.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[m.jsxs("div",{className:"flex items-center justify-between mb-1",children:[m.jsx("span",{className:"text-xs font-mono text-primary",children:t.name}),m.jsx("span",{className:"text-xs text-gray-500",children:t.type})]}),m.jsx("div",{className:"text-sm text-gray-300 font-mono truncate",children:t.value})]},t.name))})}function UX(){const{runs:e,clearHistory:t}=sL(),[n,r]=j.useState(null);return n?m.jsx(HX,{run:n,onBack:()=>r(null)}):e.length===0?m.jsxs("div",{className:"p-4 text-center",children:[m.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-node-bg flex items-center justify-center",children:m.jsx(kw,{className:"w-6 h-6 text-gray-500"})}),m.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"No execution history"}),m.jsx("p",{className:"text-xs text-gray-500",children:"Run a workflow to see execution history here"})]}):m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map(i=>m.jsxs("button",{onClick:()=>r(i),className:"w-full p-3 bg-node-bg rounded-lg border border-node-border cursor-pointer hover:border-primary transition-colors text-left",children:[m.jsxs("div",{className:"flex items-center justify-between mb-1",children:[m.jsx("span",{className:"text-xs font-medium text-white truncate max-w-[140px]",children:i.workflowName}),m.jsx(oL,{status:i.status})]}),m.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[m.jsx("span",{children:i.duration?Qx(i.duration):"-"}),m.jsx("span",{children:FX(i.startTime)})]}),i.steps.length>0&&m.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[i.steps.slice(0,5).map(o=>m.jsx(KX,{status:o.status},o.stepId)),i.steps.length>5&&m.jsxs("span",{className:"text-xs text-gray-500",children:["+",i.steps.length-5]})]})]},i.id))}),e.length>0&&m.jsx("div",{className:"p-3 border-t border-node-border",children:m.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-xs text-gray-400 hover:text-error transition-colors",children:[m.jsx(vo,{className:"w-3.5 h-3.5"}),"Clear History"]})})]})}function HX({run:e,onBack:t}){const[n,r]=j.useState(!1);return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs("div",{className:"p-3 border-b border-node-border",children:[m.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-gray-400 hover:text-white mb-2",children:[m.jsx(xn,{className:"w-3 h-3 rotate-180"}),"Back to history"]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium text-white truncate max-w-[180px]",children:e.workflowName}),m.jsx(oL,{status:e.status})]}),m.jsxs("div",{className:"flex items-center justify-between mt-1 text-xs text-gray-400",children:[m.jsx("span",{children:e.duration?Qx(e.duration):"Running..."}),m.jsx("span",{children:new Date(e.startTime).toLocaleString()})]})]}),m.jsxs("div",{className:"flex border-b border-node-border",children:[m.jsxs("button",{onClick:()=>r(!1),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-gray-400 hover:text-white":"text-primary border-b-2 border-primary -mb-px"}`,children:["Steps (",e.steps.length,")"]}),m.jsxs("button",{onClick:()=>r(!0),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-primary border-b-2 border-primary -mb-px":"text-gray-400 hover:text-white"}`,children:["Logs (",e.logs.length,")"]})]}),m.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?m.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.logs.map((i,o)=>m.jsx("div",{className:"text-gray-300 break-words",children:i},o))}):m.jsx("div",{className:"space-y-2",children:e.steps.map(i=>m.jsxs("div",{className:"p-2 bg-node-bg rounded border border-node-border",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-xs font-medium text-white truncate",children:i.stepName}),m.jsx(WX,{status:i.status})]}),i.duration&&m.jsx("div",{className:"text-xs text-gray-500 mt-1",children:Qx(i.duration)}),i.error&&m.jsx("div",{className:"mt-2 p-2 bg-error/10 border border-error/20 rounded text-xs text-error",children:i.error})]},i.stepId))})})]})}function oL({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning",icon:yo},completed:{bg:"bg-success/10",text:"text-success",icon:go},failed:{bg:"bg-error/10",text:"text-error",icon:Gi},cancelled:{bg:"bg-gray-500/10",text:"text-gray-400",icon:Gi},pending:{bg:"bg-gray-500/10",text:"text-gray-400",icon:jf}},{bg:n,text:r,icon:i}=t[e]||t.pending;return m.jsxs("span",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${n} ${r}`,children:[m.jsx(i,{className:`w-3 h-3 ${e==="running"?"animate-spin":""}`}),e]})}function WX({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning"},completed:{bg:"bg-success/10",text:"text-success"},failed:{bg:"bg-error/10",text:"text-error"},pending:{bg:"bg-gray-500/10",text:"text-gray-400"}},{bg:n,text:r}=t[e]||t.pending;return m.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n} ${r}`,children:e})}function KX({status:e}){const t={running:"bg-warning",completed:"bg-success",failed:"bg-error",pending:"bg-gray-500"};return m.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]||t.pending} ${e==="running"?"animate-pulse":""}`,title:e})}function zs({title:e,children:t}){return m.jsxs("div",{children:[m.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-2",children:e}),t]})}function ai({label:e,value:t,badge:n,badgeColor:r="default"}){const i={default:"bg-gray-500/10 text-gray-400",success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning"};return m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-xs text-gray-400",children:e}),n?m.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${i[r]}`,children:t}):m.jsx("span",{className:"text-sm text-gray-200 font-mono truncate max-w-[180px]",children:t})]})}const Lb=vi((e,t)=>({isProcessing:!1,history:[],lastError:null,pendingChanges:null,sendPrompt:async n=>{e({isProcessing:!0,lastError:null});const r=pi.getState().currentWorkflow;try{const i=await fetch("/api/ai/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n,workflow:r})});if(!i.ok)throw new Error("Failed to process prompt");const o=await i.json(),a={prompt:n,response:o.explanation,timestamp:new Date,success:!0};e({history:[a,...t().history].slice(0,20),pendingChanges:o.workflow,isProcessing:!1}),o.workflow&&t().acceptChanges()}catch(i){const o=i instanceof Error?i.message:"Unknown error";e({history:[{prompt:n,response:o,timestamp:new Date,success:!1},...t().history].slice(0,20),lastError:o,isProcessing:!1}),console.log("AI Prompt (demo mode):",n),console.log("Current workflow:",r)}},acceptChanges:()=>{const n=t().pendingChanges;n&&(pi.getState().saveWorkflow(n),e({pendingChanges:null}))},rejectChanges:()=>{e({pendingChanges:null})},clearHistory:()=>{e({history:[]})}}));function GX({onSelectPrompt:e}){const[t,n]=j.useState(!1),[r,i]=j.useState(null),[o,a]=j.useState(null),{history:c,clearHistory:u,sendPrompt:f,isProcessing:h}=Lb(),p=async b=>{h||await f(b)},g=async(b,x)=>{try{await navigator.clipboard.writeText(b),a(x),setTimeout(()=>a(null),2e3)}catch(w){console.error("Failed to copy:",w)}},v=b=>{const w=new Date().getTime()-new Date(b).getTime();return w<6e4?"Just now":w<36e5?`${Math.floor(w/6e4)}m ago`:w<864e5?`${Math.floor(w/36e5)}h ago`:new Date(b).toLocaleDateString()};return c.length===0?null:m.jsxs("div",{className:"border-t border-node-border",children:[m.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:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(kw,{className:"w-4 h-4 text-gray-400"}),m.jsx("span",{className:"text-sm text-gray-300",children:"Prompt History"}),m.jsxs("span",{className:"text-xs text-gray-500",children:["(",c.length,")"]})]}),t?m.jsx(tl,{className:"w-4 h-4 text-gray-400"}):m.jsx(wz,{className:"w-4 h-4 text-gray-400"})]}),t&&m.jsxs("div",{className:"bg-panel-bg",children:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-node-border",children:[m.jsxs("span",{className:"text-xs text-gray-500",children:[c.filter(b=>b.success).length," successful,"," ",c.filter(b=>!b.success).length," failed"]}),m.jsx(Ge,{variant:"ghost",size:"sm",onClick:u,icon:m.jsx(vo,{className:"w-3 h-3"}),children:"Clear"})]}),m.jsx("div",{className:"max-h-64 overflow-y-auto",children:c.map((b,x)=>{const w=`${x}-${b.timestamp}`,S=r===b;return m.jsxs("div",{className:"border-b border-node-border last:border-b-0",children:[m.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 cursor-pointer transition-colors ${S?"bg-primary/10":"hover:bg-white/5"}`,onClick:()=>i(S?null:b),children:[b.success?m.jsx(go,{className:"w-4 h-4 text-success flex-shrink-0 mt-0.5"}):m.jsx(Gi,{className:"w-4 h-4 text-error flex-shrink-0 mt-0.5"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-sm text-gray-300 line-clamp-2",children:b.prompt}),m.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[m.jsx(jf,{className:"w-3 h-3 text-gray-500"}),m.jsx("span",{className:"text-xs text-gray-500",children:v(b.timestamp)})]})]}),m.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[m.jsx("button",{onClick:N=>{N.stopPropagation(),g(b.prompt,w)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy prompt",children:o===w?m.jsx(el,{className:"w-3.5 h-3.5 text-success"}):m.jsx(nl,{className:"w-3.5 h-3.5 text-gray-400"})}),m.jsx("button",{onClick:N=>{N.stopPropagation(),p(b.prompt)},disabled:h,className:"p-1.5 hover:bg-white/10 rounded transition-colors disabled:opacity-50",title:"Re-run prompt",children:m.jsx(Vz,{className:`w-3.5 h-3.5 text-gray-400 ${h?"animate-spin":""}`})}),e&&m.jsx("button",{onClick:N=>{N.stopPropagation(),e(b.prompt)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Edit prompt",children:m.jsx("span",{className:"text-xs text-gray-400",children:"Edit"})})]})]}),S&&m.jsx("div",{className:"px-4 pb-3 pl-11",children:m.jsxs("div",{className:"bg-node-bg rounded-lg p-3",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase",children:"Response"}),m.jsx("button",{onClick:()=>g(b.response,`${w}-response`),className:"p-1 hover:bg-white/10 rounded transition-colors",children:o===`${w}-response`?m.jsx(el,{className:"w-3 h-3 text-success"}):m.jsx(nl,{className:"w-3 h-3 text-gray-400"})})]}),m.jsx("div",{className:`text-xs font-mono ${b.success?"text-gray-300":"text-error"}`,children:b.response||"No response"})]})})]},w)})})]})]})}function YX(){const[e,t]=j.useState(""),n=j.useRef(null),{isProcessing:r,history:i,sendPrompt:o}=Lb();j.useEffect(()=>{n.current&&(n.current.style.height="auto",n.current.style.height=`${Math.min(n.current.scrollHeight,200)}px`)},[e]);const a=async()=>{!e.trim()||r||(await o(e),t(""))},c=f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),a()),f.key==="ArrowUp"&&!e&&i.length>0&&t(i[0].prompt)},u=["Add a Slack notification step","Add error handling with 3 retries","Convert to a sub-workflow","Add a condition to skip if draft"];return m.jsxs("div",{className:"bg-panel-bg",children:[m.jsx(GX,{onSelectPrompt:t}),!e&&!r&&m.jsx("div",{className:"px-4 py-2 border-t border-node-border/50",children:m.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",children:[m.jsx(Wz,{className:"w-4 h-4 text-primary flex-shrink-0"}),u.map(f=>m.jsx("button",{onClick:()=>t(f),className:"px-3 py-1 bg-node-bg border border-node-border rounded-full text-xs text-gray-300 hover:border-primary hover:text-primary transition-colors whitespace-nowrap",children:f},f))]})}),m.jsxs("div",{className:"p-4 flex items-end gap-3 border-t border-node-border",children:[m.jsxs("div",{className:"flex-1 relative",children:[m.jsx("textarea",{ref:n,value:e,onChange:f=>t(f.target.value),onKeyDown:c,placeholder:"Describe the changes you want to make to the workflow...",disabled:r,rows:1,className:"w-full px-4 py-3 bg-node-bg border border-node-border rounded-lg text-sm text-white placeholder-gray-500 focus:outline-none focus:border-primary resize-none disabled:opacity-50"}),r&&m.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:m.jsx(yo,{className:"w-5 h-5 text-primary animate-spin"})})]}),m.jsx("button",{onClick:a,disabled:!e.trim()||r,className:"w-10 h-10 rounded-lg bg-primary hover:bg-primary-dark disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-colors",children:m.jsx(Hz,{className:"w-5 h-5 text-white"})})]}),m.jsxs("div",{className:"px-4 pb-2 text-xs text-gray-500",children:["Press ",m.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"⌘"})," +"," ",m.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"Enter"})," to send",i.length>0&&m.jsxs("span",{className:"ml-4",children:[m.jsx("kbd",{className:"px-1.5 py-0.5 bg-node-bg rounded text-gray-400",children:"↑"})," for last prompt"]})]})]})}function XX({open:e,onOpenChange:t,originalWorkflow:n,modifiedWorkflow:r,explanation:i,onAccept:o,onReject:a}){const[c,u]=j.useState("explanation"),f=n?lf(n,{indent:2}):"",h=r?lf(r,{indent:2}):"",p=()=>{o(),t(!1)},g=()=>{a(),t(!1)};return m.jsxs(bl,{open:e,onOpenChange:t,title:"Review Changes",description:"The AI has suggested the following changes to your workflow",size:"xl",children:[m.jsxs(YM,{value:c,onValueChange:u,children:[m.jsxs($w,{children:[m.jsxs(Jn,{value:"explanation",children:[m.jsx(kz,{className:"w-4 h-4 mr-1.5"}),"Explanation"]}),m.jsxs(Jn,{value:"diff",children:[m.jsx(Az,{className:"w-4 h-4 mr-1.5"}),"Side by Side"]}),m.jsxs(Jn,{value:"modified",children:[m.jsx(Sw,{className:"w-4 h-4 mr-1.5"}),"Modified YAML"]})]}),m.jsxs("div",{className:"p-4",children:[m.jsx(Zn,{value:"explanation",children:m.jsxs("div",{className:"prose prose-invert max-w-none",children:[m.jsx("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:m.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:i})}),r&&m.jsxs("div",{className:"mt-4",children:[m.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Changes Summary"}),m.jsx("ul",{className:"space-y-2",children:QX(n,r).map((v,b)=>m.jsxs("li",{className:`flex items-start gap-2 text-sm ${v.type==="added"?"text-success":v.type==="removed"?"text-error":"text-warning"}`,children:[m.jsx("span",{className:"flex-shrink-0",children:v.type==="added"?"+":v.type==="removed"?"-":"~"}),m.jsx("span",{children:v.description})]},b))})]})]})}),m.jsx(Zn,{value:"diff",children:m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{children:[m.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Original"}),m.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:m.jsx(za,{height:"400px",language:"yaml",value:f,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]}),m.jsxs("div",{children:[m.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Modified"}),m.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:m.jsx(za,{height:"400px",language:"yaml",value:h,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]})]})}),m.jsx(Zn,{value:"modified",children:m.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:m.jsx(za,{height:"500px",language:"yaml",value:h,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1}})})})]})]}),m.jsxs(If,{children:[m.jsx(Ge,{variant:"secondary",onClick:g,icon:m.jsx(wl,{className:"w-4 h-4"}),children:"Reject"}),m.jsx(Ge,{onClick:p,icon:m.jsx(el,{className:"w-4 h-4"}),children:"Accept Changes"})]})]})}function QX(e,t){const n=[];if(!e||!t)return n;const r=new Set(e.steps.map(o=>o.id)),i=new Set(t.steps.map(o=>o.id));for(const o of t.steps)r.has(o.id)||n.push({type:"added",description:`Added step "${o.name||o.id}"`});for(const o of e.steps)i.has(o.id)||n.push({type:"removed",description:`Removed step "${o.name||o.id}"`});for(const o of t.steps)if(r.has(o.id)){const a=e.steps.find(c=>c.id===o.id);if(a&&JSON.stringify(a)!==JSON.stringify(o)){const c=[];a.action!==o.action&&c.push("action"),JSON.stringify(a.inputs)!==JSON.stringify(o.inputs)&&c.push("inputs"),JSON.stringify(a.errorHandling)!==JSON.stringify(o.errorHandling)&&c.push("error handling"),JSON.stringify(a.conditions)!==JSON.stringify(o.conditions)&&c.push("conditions"),c.length>0&&n.push({type:"modified",description:`Modified "${o.name||o.id}": ${c.join(", ")}`})}}return e.metadata.name!==t.metadata.name&&n.push({type:"modified",description:`Renamed workflow to "${t.metadata.name}"`}),n}const kr={WORKFLOW_UPDATED:"workflow:updated",EXECUTION_STEP:"execution:step",EXECUTION_COMPLETED:"execution:completed",AI_PROCESSING:"ai:processing",AI_RESPONSE:"ai:response",WORKFLOW_SUBSCRIBE:"workflow:subscribe",WORKFLOW_UNSUBSCRIBE:"workflow:unsubscribe",EXECUTION_SUBSCRIBE:"execution:subscribe",EXECUTION_UNSUBSCRIBE:"execution:unsubscribe"},Eu={slack:{name:"Slack",icon:"slack",methods:["chat.postMessage","chat.update","chat.delete","conversations.list","conversations.create","files.upload","users.info"]},github:{name:"GitHub",icon:"github",methods:["pulls.get","pulls.list","pulls.create","pulls.createReview","pulls.listFiles","issues.get","issues.create","issues.createComment","repos.getContent","search.code"]},jira:{name:"Jira",icon:"jira",methods:["issues.getIssue","issues.createIssue","issues.editIssue","issues.search","issues.addComment","issues.transition"]},gmail:{name:"Gmail",icon:"gmail",methods:["messages.list","messages.get","messages.send","drafts.create","labels.list"]},outlook:{name:"Outlook",icon:"outlook",methods:["messages.list","messages.get","messages.send","calendar.events.list","calendar.events.create"]},linear:{name:"Linear",icon:"linear",methods:["issues.get","issues.create","issues.update","issues.search","projects.list"]},notion:{name:"Notion",icon:"notion",methods:["pages.get","pages.create","pages.update","databases.query","search"]},discord:{name:"Discord",icon:"discord",methods:["messages.send","messages.edit","messages.delete","channels.get","webhooks.execute"]},airtable:{name:"Airtable",icon:"airtable",methods:["records.list","records.get","records.create","records.update","records.delete"]},confluence:{name:"Confluence",icon:"confluence",methods:["pages.list","pages.get","pages.create","pages.update","search"]},http:{name:"HTTP",icon:"http",methods:["request","get","post","put","patch","delete"]},claude:{name:"Claude",icon:"claude",methods:["analyze","generate","summarize","chat"]},opencode:{name:"OpenCode",icon:"opencode",methods:["chat","complete","analyze"]},ollama:{name:"Ollama",icon:"ollama",methods:["generate","chat","embeddings"]}};function JX({open:e,onOpenChange:t,onCreateStep:n,position:r}){var L,B;const[i,o]=j.useState("select-type"),[a,c]=j.useState(""),[u,f]=j.useState("action"),[h,p]=j.useState(null),[g,v]=j.useState(null),[b,x]=j.useState({id:"",name:""}),w=()=>{o("select-type"),c(""),f("action"),p(null),v(null),x({id:"",name:""})},S=()=>{w(),t(!1)},N=I=>{f(I),o(I==="action"?"select-service":"configure")},k=I=>{p(I),o("select-method")},E=I=>{v(I);const q=Eu[h];x({id:`${h}-${Date.now()}`,name:`${(q==null?void 0:q.name)||h} - ${I}`}),o("configure")},R=()=>{const I={id:b.id||`step-${Date.now()}`,name:b.name||void 0,inputs:{}};u==="action"&&h&&g&&(I.action=`${h}.${g}`),n(I),S()},T=Object.entries(Eu).filter(([I,q])=>q.name.toLowerCase().includes(a.toLowerCase())||I.toLowerCase().includes(a.toLowerCase())),O=(h?((L=Eu[h])==null?void 0:L.methods)||[]:[]).filter(I=>I.toLowerCase().includes(a.toLowerCase()));return m.jsxs(bl,{open:e,onOpenChange:S,title:"Add New Step",description:ZX(i),size:"lg",children:[m.jsxs("div",{className:"p-4",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[m.jsx("button",{onClick:()=>o("select-type"),className:`${i==="select-type"?"text-primary":"text-gray-400 hover:text-white"}`,children:"Type"}),u==="action"&&m.jsxs(m.Fragment,{children:[m.jsx(xn,{className:"w-4 h-4 text-gray-600"}),m.jsx("button",{onClick:()=>h&&o("select-service"),className:`${i==="select-service"?"text-primary":h?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!h,children:"Service"}),m.jsx(xn,{className:"w-4 h-4 text-gray-600"}),m.jsx("button",{onClick:()=>g&&o("select-method"),className:`${i==="select-method"?"text-primary":g?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!g,children:"Method"})]}),m.jsx(xn,{className:"w-4 h-4 text-gray-600"}),m.jsx("span",{className:`${i==="configure"?"text-primary":"text-gray-600"}`,children:"Configure"})]}),i==="select-type"&&m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("button",{onClick:()=>N("action"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[m.jsx(nf,{className:"w-8 h-8 text-primary mb-3"}),m.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Action Step"}),m.jsx("p",{className:"text-sm text-gray-400",children:"Execute an action using a service SDK (Slack, GitHub, etc.)"})]}),m.jsxs("button",{onClick:()=>N("subworkflow"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-info transition-colors text-left",children:[m.jsx(tf,{className:"w-8 h-8 text-info mb-3"}),m.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Sub-workflow"}),m.jsx("p",{className:"text-sm text-gray-400",children:"Reference another workflow file for modular composition"})]})]}),i==="select-service"&&m.jsxs("div",{children:[m.jsxs("div",{className:"relative mb-4",children:[m.jsx(Mx,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),m.jsx("input",{type:"text",value:a,onChange:I=>c(I.target.value),placeholder:"Search services...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),m.jsx("div",{className:"grid grid-cols-3 gap-3 max-h-[400px] overflow-y-auto",children:T.map(([I,q])=>{const U=Ix(I);return m.jsxs("button",{onClick:()=>k(I),className:"flex flex-col items-center gap-2 p-4 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors",children:[m.jsx(U,{className:"w-8 h-8 text-primary"}),m.jsx("span",{className:"text-sm text-white",children:q.name})]},I)})})]}),i==="select-method"&&h&&m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[(()=>{const I=Ix(h);return m.jsx(I,{className:"w-6 h-6 text-primary"})})(),m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-medium text-white",children:(B=Eu[h])==null?void 0:B.name}),m.jsx("div",{className:"text-xs text-gray-400",children:"Select a method"})]})]}),m.jsxs("div",{className:"relative mb-4",children:[m.jsx(Mx,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),m.jsx("input",{type:"text",value:a,onChange:I=>c(I.target.value),placeholder:"Search methods...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),m.jsx("div",{className:"space-y-2 max-h-[350px] overflow-y-auto",children:O.map(I=>m.jsxs("button",{onClick:()=>E(I),className:"w-full flex items-center justify-between px-4 py-3 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[m.jsx("span",{className:"text-sm font-mono text-white",children:I}),m.jsx(xn,{className:"w-4 h-4 text-gray-500"})]},I))})]}),i==="configure"&&m.jsxs("div",{className:"space-y-4",children:[u==="action"&&h&&g&&m.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[m.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Action"}),m.jsxs("div",{className:"text-sm font-mono text-primary",children:[h,".",g]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step ID"}),m.jsx("input",{type:"text",value:b.id,onChange:I=>x(q=>({...q,id:I.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"unique-step-id"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name (optional)"}),m.jsx("input",{type:"text",value:b.name,onChange:I=>x(q=>({...q,name:I.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),r&&m.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"})]})]}),m.jsxs(If,{children:[i!=="select-type"&&m.jsx(Ge,{variant:"ghost",onClick:()=>{i==="select-service"?o("select-type"):i==="select-method"?o("select-service"):i==="configure"&&o(u==="action"?"select-method":"select-type"),c("")},children:"Back"}),m.jsx(Ge,{variant:"secondary",onClick:S,children:"Cancel"}),i==="configure"&&m.jsx(Ge,{onClick:R,disabled:!b.id,children:"Create Step"})]})]})}function ZX(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 WR=[{keys:["⌘","S"],description:"Save workflow",category:"General"},{keys:["⌘","Z"],description:"Undo",category:"General"},{keys:["⌘","⇧","Z"],description:"Redo",category:"General"},{keys:["⌘","?"],description:"Show keyboard shortcuts",category:"General"},{keys:["N"],description:"Add new step",category:"Canvas"},{keys:["⌘","L"],description:"Auto-layout canvas",category:"Canvas"},{keys:["⌘","0"],description:"Fit view",category:"Canvas"},{keys:["⌘","+"],description:"Zoom in",category:"Canvas"},{keys:["⌘","-"],description:"Zoom out",category:"Canvas"},{keys:["⌫"],description:"Delete selected",category:"Canvas"},{keys:["⌘","D"],description:"Duplicate selected",category:"Canvas"},{keys:["Double-click"],description:"Edit step",category:"Editing"},{keys:["E"],description:"Edit selected step",category:"Editing"},{keys:["Y"],description:"View YAML",category:"Editing"},{keys:["Escape"],description:"Close modal / deselect",category:"Editing"},{keys:["⌘","←"],description:"Back to parent workflow",category:"Navigation"},{keys:["⌘","↑"],description:"Go to root workflow",category:"Navigation"},{keys:["⌘","↵"],description:"Execute workflow",category:"Execution"},{keys:["F9"],description:"Toggle debug mode",category:"Debugging"},{keys:["F5"],description:"Continue execution",category:"Debugging"},{keys:["F10"],description:"Step over",category:"Debugging"},{keys:["F11"],description:"Step into",category:"Debugging"},{keys:["⇧","F11"],description:"Step out",category:"Debugging"}];function eQ({open:e,onOpenChange:t}){const n=[...new Set(WR.map(r=>r.category))];return m.jsxs(bl,{open:e,onOpenChange:t,title:"Keyboard Shortcuts",description:"Quick reference for all keyboard shortcuts",size:"md",children:[m.jsx("div",{className:"p-4 space-y-6 max-h-[60vh] overflow-y-auto",children:n.map(r=>m.jsxs("div",{children:[m.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider mb-3",children:r}),m.jsx("div",{className:"space-y-2",children:WR.filter(i=>i.category===r).map((i,o)=>m.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-node-border last:border-0",children:[m.jsx("span",{className:"text-sm text-gray-300",children:i.description}),m.jsx("div",{className:"flex items-center gap-1",children:i.keys.map((a,c)=>m.jsx("kbd",{className:"px-2 py-1 bg-node-bg border border-node-border rounded text-xs font-mono text-gray-300",children:a},c))})]},o))})]},r))}),m.jsx(If,{children:m.jsx(Ge,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function tQ(){const[e,t]=j.useState(!1);return j.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="/"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),{isOpen:e,setIsOpen:t,openShortcuts:()=>t(!0)}}function nQ({onClick:e}){return m.jsxs("button",{onClick:e,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-gray-500 hover:text-gray-300 transition-colors",title:"Keyboard shortcuts (⌘/)",children:[m.jsx(Iz,{className:"w-3.5 h-3.5"}),m.jsx("span",{className:"hidden sm:inline",children:"Shortcuts"})]})}function ux(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function fx(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?(t.classList.add("dark"),t.classList.remove("light")):(t.classList.add("light"),t.classList.remove("dark"))}const aL=vi()(iL((e,t)=>({theme:"dark",resolvedTheme:"dark",setTheme:n=>{const r=n==="system"?ux():n;fx(r),e({theme:n,resolvedTheme:r})},toggleTheme:()=>{const{theme:n}=t(),r=n==="dark"?"light":"dark",i=r==="system"?ux():r;fx(i),e({theme:r,resolvedTheme:i})}}),{name:"marktoflow-theme",onRehydrateStorage:()=>e=>{if(e){const t=e.theme==="system"?ux():e.theme;fx(t),e.resolvedTheme=t}}}));typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{const{theme:t,setTheme:n}=aL.getState();t==="system"&&n("system")});function rQ({showLabel:e=!1}){const{theme:t,toggleTheme:n}=aL();return m.jsxs("button",{onClick:n,className:"flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-white/10 dark:hover:bg-white/10 light:hover:bg-black/5 transition-colors",title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[t==="dark"?m.jsx($z,{className:"w-4 h-4 text-gray-400"}):m.jsx(Gz,{className:"w-4 h-4 text-yellow-500"}),e&&m.jsx("span",{className:"text-xs text-gray-400",children:t==="dark"?"Dark":"Light"})]})}function iQ({items:e,onNavigate:t}){return e.length<=1?null:m.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)=>m.jsxs("div",{className:"flex items-center",children:[r>0&&m.jsx(xn,{className:"w-4 h-4 text-gray-600 mx-1"}),m.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&&m.jsx(Mz,{className:"w-3.5 h-3.5"}),m.jsx("span",{className:"max-w-[150px] truncate",children:n.name})]})]},n.id))})}const ur=Object.create(null);ur.open="0";ur.close="1";ur.ping="2";ur.pong="3";ur.message="4";ur.upgrade="5";ur.noop="6";const $u=Object.create(null);Object.keys(ur).forEach(e=>{$u[ur[e]]=e});const Jx={type:"error",data:"parser error"},lL=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",cL=typeof ArrayBuffer=="function",uL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Db=({type:e,data:t},n,r)=>lL&&t instanceof Blob?n?r(t):KR(t,r):cL&&(t instanceof ArrayBuffer||uL(t))?n?r(t):KR(new Blob([t]),r):r(ur[e]+(t||"")),KR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function GR(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let dx;function sQ(e,t){if(lL&&e.data instanceof Blob)return e.data.arrayBuffer().then(GR).then(t);if(cL&&(e.data instanceof ArrayBuffer||uL(e.data)))return t(GR(e.data));Db(e,!1,n=>{dx||(dx=new TextEncoder),t(dx.encode(n))})}const YR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Da=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<YR.length;e++)Da[YR.charCodeAt(e)]=e;const oQ=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,c,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),h=new Uint8Array(f);for(r=0;r<n;r+=4)o=Da[e.charCodeAt(r)],a=Da[e.charCodeAt(r+1)],c=Da[e.charCodeAt(r+2)],u=Da[e.charCodeAt(r+3)],h[i++]=o<<2|a>>4,h[i++]=(a&15)<<4|c>>2,h[i++]=(c&3)<<6|u&63;return f},aQ=typeof ArrayBuffer=="function",qb=(e,t)=>{if(typeof e!="string")return{type:"message",data:fL(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:lQ(e.substring(1),t)}:$u[n]?e.length>1?{type:$u[n],data:e.substring(1)}:{type:$u[n]}:Jx},lQ=(e,t)=>{if(aQ){const n=oQ(e);return fL(n,t)}else return{base64:!0,data:e}},fL=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},dL="",cQ=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{Db(o,!1,c=>{r[a]=c,++i===n&&t(r.join(dL))})})},uQ=(e,t)=>{const n=e.split(dL),r=[];for(let i=0;i<n.length;i++){const o=qb(n[i],t);if(r.push(o),o.type==="error")break}return r};function fQ(){return new TransformStream({transform(e,t){sQ(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let hx;function Nu(e){return e.reduce((t,n)=>t+n.length,0)}function Cu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=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 dQ(e,t){hx||(hx=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(Nu(n)<1)break;const u=Cu(n,1);o=(u[0]&128)===128,i=u[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Nu(n)<2)break;const u=Cu(n,2);i=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Nu(n)<8)break;const u=Cu(n,8),f=new DataView(u.buffer,u.byteOffset,u.length),h=f.getUint32(0);if(h>Math.pow(2,21)-1){c.enqueue(Jx);break}i=h*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Nu(n)<i)break;const u=Cu(n,i);c.enqueue(qb(o?u:hx.decode(u),t)),r=0}if(i===0||i>e){c.enqueue(Jx);break}}}})}const hL=4;function ht(e){if(e)return hQ(e)}function hQ(e){for(var t in ht.prototype)e[t]=ht.prototype[t];return e}ht.prototype.on=ht.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ht.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ht.prototype.off=ht.prototype.removeListener=ht.prototype.removeAllListeners=ht.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,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};ht.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,i=n.length;r<i;++r)n[r].apply(this,t)}return this};ht.prototype.emitReserved=ht.prototype.emit;ht.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ht.prototype.hasListeners=function(e){return!!this.listeners(e).length};const pd=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),yn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),pQ="arraybuffer";function pL(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const mQ=yn.setTimeout,gQ=yn.clearTimeout;function md(e,t){t.useNativeTimers?(e.setTimeoutFn=mQ.bind(yn),e.clearTimeoutFn=gQ.bind(yn)):(e.setTimeoutFn=yn.setTimeout.bind(yn),e.clearTimeoutFn=yn.clearTimeout.bind(yn))}const yQ=1.33;function vQ(e){return typeof e=="string"?xQ(e):Math.ceil((e.byteLength||e.size)*yQ)}function xQ(e){let t=0,n=0;for(let r=0,i=e.length;r<i;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 mL(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function wQ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function bQ(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class _Q extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class $b extends ht{constructor(t){super(),this.writable=!1,md(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 _Q(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=qb(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=wQ(t);return n.length?"?"+n:""}}class SQ extends $b{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)};uQ(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,cQ(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]=mL()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let gL=!1;try{gL=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const kQ=gL;function EQ(){}class NQ extends SQ{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",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ir extends ht{constructor(t,n,r){super(),this.createRequest=t,md(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=pL(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 i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}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 i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.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(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ir.requestsCount++,ir.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=EQ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ir.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()}}ir.requestsCount=0;ir.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",XR);else if(typeof addEventListener=="function"){const e="onpagehide"in yn?"pagehide":"unload";addEventListener(e,XR,!1)}}function XR(){for(let e in ir.requests)ir.requests.hasOwnProperty(e)&&ir.requests[e].abort()}const CQ=(function(){const e=yL({xdomain:!1});return e&&e.responseType!==null})();class jQ extends NQ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=CQ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ir(yL,this.uri(),t)}}function yL(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||kQ))return new XMLHttpRequest}catch{}if(!t)try{return new yn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const vL=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class RQ extends $b{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=vL?{}:pL(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(i){return this.emitReserved("error",i)}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],i=n===t.length-1;Db(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&pd(()=>{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]=mL()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const px=yn.WebSocket||yn.MozWebSocket;class AQ extends RQ{createSocket(t,n,r){return vL?new px(t,n,r):n?new px(t,n):new px(t)}doWrite(t,n){this.ws.send(n)}}class TQ extends $b{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=dQ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=fQ();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:c,value:u})=>{c||(this.onPacket(u),o())}).catch(c=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&pd(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const MQ={websocket:AQ,webtransport:TQ,polling:jQ},IQ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,OQ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Zx(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 i=IQ.exec(e||""),o={},a=14;for(;a--;)o[OQ[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=PQ(o,o.path),o.queryKey=LQ(o,o.query),o}function PQ(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 LQ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const ew=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fu=[];ew&&addEventListener("offline",()=>{Fu.forEach(e=>e())},!1);class hi extends ht{constructor(t,n){if(super(),this.binaryType=pQ,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=Zx(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=Zx(n.host).host);md(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 i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=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=bQ(this.opts.query)),ew&&(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"})},Fu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=hL,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&&hi.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",hi.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 i=this.writeBuffer[r].data;if(i&&(n+=vQ(i)),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,pd(()=>{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,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),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(hi.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(),ew&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Fu.indexOf(this._offlineEventListener);r!==-1&&Fu.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}hi.protocol=hL;class DQ extends hi{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;hi.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;hi.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,h(),n.close(),n=null)}const a=p=>{const g=new Error("probe error: "+p);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function c(){a("transport closed")}function u(){a("socket closed")}function f(p){n&&p.name!==n.name&&o()}const h=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",c),this.off("close",u),this.off("upgrading",f)};n.once("open",i),n.once("error",a),n.once("close",c),this.once("close",u),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 qQ=class extends DQ{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(i=>MQ[i]).filter(i=>!!i)),super(t,r)}};function $Q(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=Zx(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const FQ=typeof ArrayBuffer=="function",BQ=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,xL=Object.prototype.toString,zQ=typeof Blob=="function"||typeof Blob<"u"&&xL.call(Blob)==="[object BlobConstructor]",VQ=typeof File=="function"||typeof File<"u"&&xL.call(File)==="[object FileConstructor]";function Fb(e){return FQ&&(e instanceof ArrayBuffer||BQ(e))||zQ&&e instanceof Blob||VQ&&e instanceof File}function Bu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Bu(e[n]))return!0;return!1}if(Fb(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Bu(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Bu(e[n]))return!0;return!1}function UQ(e){const t=[],n=e.data,r=e;return r.data=tw(n,t),r.attachments=t.length,{packet:r,buffers:t}}function tw(e,t){if(!e)return e;if(Fb(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]=tw(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]=tw(e[r],t));return n}return e}function HQ(e,t){return e.data=nw(e.data,t),delete e.attachments,e}function nw(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]=nw(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=nw(e[n],t));return e}const WQ=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Pe;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Pe||(Pe={}));class KQ{constructor(t){this.replacer=t}encode(t){return(t.type===Pe.EVENT||t.type===Pe.ACK)&&Bu(t)?this.encodeAsBinary({type:t.type===Pe.EVENT?Pe.BINARY_EVENT:Pe.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Pe.BINARY_EVENT||t.type===Pe.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=UQ(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Bb extends ht{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Pe.BINARY_EVENT;r||n.type===Pe.BINARY_ACK?(n.type=r?Pe.EVENT:Pe.ACK,this.reconstructor=new GQ(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Fb(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Pe[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Pe.BINARY_EVENT||r.type===Pe.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Bb.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Pe.CONNECT:return QR(n);case Pe.DISCONNECT:return n===void 0;case Pe.CONNECT_ERROR:return typeof n=="string"||QR(n);case Pe.EVENT:case Pe.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&WQ.indexOf(n[0])===-1);case Pe.ACK:case Pe.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class GQ{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=HQ(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function QR(e){return Object.prototype.toString.call(e)==="[object Object]"}const YQ=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Bb,Encoder:KQ,get PacketType(){return Pe}},Symbol.toStringTag,{value:"Module"}));function On(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const XQ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wL extends ht{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=[On(t,"open",this.onopen.bind(this)),On(t,"packet",this.onpacket.bind(this)),On(t,"error",this.onerror.bind(this)),On(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,i,o;if(XQ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Pe.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,p=n.pop();this._registerAckCallback(h,p),a.id=h}const c=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,u=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!c||(u?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},i),a=(...c)=>{this.io.clearTimeoutFn(o),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(a,c)=>a?i(a):r(c);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Pe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Pe.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Pe.EVENT:case Pe.BINARY_EVENT:this.onevent(t);break;case Pe.ACK:case Pe.BINARY_ACK:this.onack(t);break;case Pe.DISCONNECT:this.ondisconnect();break;case Pe.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Pe.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Pe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function To(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}To.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};To.prototype.reset=function(){this.attempts=0};To.prototype.setMin=function(e){this.ms=e};To.prototype.setMax=function(e){this.max=e};To.prototype.setJitter=function(e){this.jitter=e};class rw extends ht{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,md(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 To({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||YQ;this.encoder=new i.Encoder,this.decoder=new i.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 qQ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=On(n,"open",function(){r.onopen(),t&&t()}),o=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=On(n,"error",o);if(this._timeout!==!1){const c=this._timeout,u=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},c);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(i),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(On(t,"ping",this.onping.bind(this)),On(t,"data",this.ondata.bind(this)),On(t,"error",this.onerror.bind(this)),On(t,"close",this.onclose.bind(this)),On(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){pd(()=>{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 wL(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(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):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 Na={};function zu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=$Q(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Na[i]&&o in Na[i].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let u;return c?u=new rw(r,t):(Na[i]||(Na[i]=new rw(r,t)),u=Na[i]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(zu,{Manager:rw,Socket:wL,io:zu,connect:zu});function bL(e={}){const{autoConnect:t=!0,onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:i,onAIProcessing:o,onAIResponse:a}=e,c=j.useRef(null),[u,f]=j.useState(!1),h=j.useRef({onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:i,onAIProcessing:o,onAIResponse:a});j.useEffect(()=>{h.current={onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:i,onAIProcessing:o,onAIResponse:a}},[n,r,i,o,a]);const p=j.useCallback(()=>{var N;if((N=c.current)!=null&&N.connected)return;const S=zu({transports:["websocket"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});S.on("connect",()=>{console.log("WebSocket connected"),f(!0)}),S.on("disconnect",()=>{console.log("WebSocket disconnected"),f(!1)}),S.on("connect_error",k=>{console.error("WebSocket connection error:",k),f(!1)}),S.on(kr.WORKFLOW_UPDATED,k=>{var E,R;(R=(E=h.current).onWorkflowUpdated)==null||R.call(E,k)}),S.on(kr.EXECUTION_STEP,k=>{var E,R;(R=(E=h.current).onExecutionStep)==null||R.call(E,k)}),S.on(kr.EXECUTION_COMPLETED,k=>{var E,R;(R=(E=h.current).onExecutionCompleted)==null||R.call(E,k)}),S.on(kr.AI_PROCESSING,({processing:k})=>{var E,R;(R=(E=h.current).onAIProcessing)==null||R.call(E,k)}),S.on(kr.AI_RESPONSE,k=>{var E,R;(R=(E=h.current).onAIResponse)==null||R.call(E,k)}),c.current=S},[]),g=j.useCallback(()=>{c.current&&(c.current.disconnect(),c.current=null,f(!1))},[]),v=j.useCallback(S=>{var N;(N=c.current)==null||N.emit(kr.WORKFLOW_SUBSCRIBE,S)},[]),b=j.useCallback(S=>{var N;(N=c.current)==null||N.emit(kr.WORKFLOW_UNSUBSCRIBE,S)},[]),x=j.useCallback(S=>{var N;(N=c.current)==null||N.emit(kr.EXECUTION_SUBSCRIBE,S)},[]),w=j.useCallback(S=>{var N;(N=c.current)==null||N.emit(kr.EXECUTION_UNSUBSCRIBE,S)},[]);return j.useEffect(()=>(t&&p(),()=>{g()}),[t,p,g]),{connected:u,socket:c.current,subscribeToWorkflow:v,unsubscribeFromWorkflow:b,subscribeToExecution:x,unsubscribeFromExecution:w,connect:p,disconnect:g}}function QQ(e){const t=[],n=[];let o=0;if(e.triggers&&e.triggers.length>0){const c=e.triggers[0],u=`trigger-${e.metadata.id}`;t.push({id:u,type:"trigger",position:{x:250,y:o},data:{id:u,name:e.metadata.name,type:c.type||"manual",cron:c.cron,path:c.path,events:c.events,active:!0}}),o+=120,e.steps.length>0&&n.push({id:`e-${u}-${e.steps[0].id}`,source:u,target:e.steps[0].id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}})}if(e.steps.forEach((c,u)=>{const f=!!c.workflow,h={id:c.id,type:f?"subworkflow":"step",position:{x:250,y:o+u*120},data:{id:c.id,name:c.name,action:c.action,workflowPath:c.workflow,status:"pending"}};if(t.push(h),u<e.steps.length-1){const p=e.steps[u+1],g={id:`e-${c.id}-${p.id}`,source:c.id,target:p.id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}};p.conditions&&p.conditions.length>0&&(g.label="conditional",g.labelStyle={fill:"#a0a0c0",fontSize:10},g.labelBgStyle={fill:"#232340"}),n.push(g)}}),e.steps.length>0){const c=`output-${e.metadata.id}`,u=e.steps[e.steps.length-1],f=o+e.steps.length*120,h=e.steps.filter(p=>p.outputVariable).map(p=>p.outputVariable);t.push({id:c,type:"output",position:{x:250,y:f},data:{id:c,name:"Workflow Output",variables:h,status:"pending"}}),n.push({id:`e-${u.id}-${c}`,source:u.id,target:c,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}})}const a=JQ(e.steps);return n.push(...a),{nodes:t,edges:n}}function JQ(e){const t=[],n=new Map;return e.forEach(r=>{r.outputVariable&&n.set(r.outputVariable,r.id)}),e.forEach(r=>{ZQ(r.inputs).forEach(o=>{const a=o.split(".")[0],c=n.get(a);if(c&&c!==r.id){const u=`data-${c}-${r.id}-${a}`;t.find(f=>f.id===u)||t.push({id:u,source:c,target:r.id,type:"smoothstep",animated:!0,style:{stroke:"#5bc0de",strokeWidth:1,strokeDasharray:"5,5"},label:a,labelStyle:{fill:"#5bc0de",fontSize:9},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}})}})}),t}function ZQ(e){const t=[],n=/\{\{\s*([^}]+)\s*\}\}/g;function r(i){if(typeof i=="string"){let o;for(;(o=n.exec(i))!==null;){const c=o[1].trim().split(".")[0].replace(/\[.*\]/,"");c!=="inputs"&&!t.includes(c)&&t.push(c)}}else Array.isArray(i)?i.forEach(r):i&&typeof i=="object"&&Object.values(i).forEach(r)}return Object.values(e).forEach(r),t}function eJ(){const{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:i,loadWorkflows:o,selectWorkflow:a,loadWorkflow:c,saveWorkflow:u,createWorkflow:f,deleteWorkflow:h}=pi(),{setNodes:p,setEdges:g}=uo(),{subscribeToWorkflow:v,unsubscribeFromWorkflow:b,connected:x}=bL({onWorkflowUpdated:R=>{R.path===t&&c(R.path),(R.event==="add"||R.event==="remove")&&o()}});j.useEffect(()=>{o()},[o]),j.useEffect(()=>{if(x&&t)return v(t),()=>{b(t)}},[x,t,v,b]),j.useEffect(()=>{if(n){const{nodes:R,edges:T}=QQ(n);p(R),g(T)}},[n,p,g]);const w=j.useCallback(R=>{a(R)},[a]),S=j.useCallback(async R=>{R&&await u(R)},[u]),N=j.useCallback(async R=>{await f(R)},[f]),k=j.useCallback(async R=>{await h(R)},[h]),E=j.useCallback(R=>{if(!n)return[];const T=[];if(n.inputs)for(const A of Object.keys(n.inputs))T.push(`inputs.${A}`);for(let A=0;A<R&&A<n.steps.length;A++){const O=n.steps[A];O.outputVariable&&T.push(O.outputVariable)}return T},[n]);return{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:i,selectWorkflow:w,saveWorkflow:S,createWorkflow:N,deleteWorkflow:k,refreshWorkflows:o,getAvailableVariables:E}}function tJ(){const{currentWorkflow:e,selectedWorkflow:t,saveWorkflow:n,refreshWorkflows:r}=eJ(),{isNewStepOpen:i,newStepPosition:o,openNewStepWizard:a,closeNewStepWizard:c}=rL(),{pendingChanges:u,acceptChanges:f,rejectChanges:h}=Lb(),{isOpen:p,setIsOpen:g,openShortcuts:v}=tQ(),{breadcrumbs:b,popToIndex:x,resetNavigation:w}=Nw(),{loadWorkflow:S}=pi(),N=j.useCallback((Me,we)=>{x(we),S(Me.path||"")},[x,S]),{connected:k}=bL({onWorkflowUpdated:()=>{r()}}),{isExecuting:E,isPaused:R,currentRunId:T,runs:A,startExecution:O,updateStepStatus:L,completeExecution:B,addLog:I,pauseExecution:q,resumeExecution:U,cancelExecution:D,debug:V,enableDebugMode:z,disableDebugMode:Q,toggleBreakpoint:F,clearAllBreakpoints:$,stepOver:Y,stepInto:P,stepOut:W,addWatchExpression:se,removeWatchExpression:K}=sL(),{breakpoint:J,setBreakpoint:G,sidebarOpen:ee,setSidebarOpen:te,propertiesPanelOpen:oe,setPropertiesPanelOpen:fe}=Pb();j.useEffect(()=>{const Me=()=>{const we=PX(window.innerWidth);we!==J&&G(we)};return Me(),window.addEventListener("resize",Me),()=>window.removeEventListener("resize",Me)},[J,G]);const[he,me]=j.useState("pending"),[de,_e]=j.useState([]),[ve,Ne]=j.useState([]),[Ee,et]=j.useState(null),Le=j.useRef(null),gt=j.useCallback(()=>{a()},[a]),yt=j.useCallback(Me=>{if(!e)return;const we={...e,steps:[...e.steps,Me]};n(we),console.log("Created step:",Me)},[e,n]),it=j.useCallback(()=>{var st;if(E){Le.current&&D(Le.current),me("cancelled"),Ne(Be=>[...Be,"Execution cancelled by user"]);return}if(!e)return;const Me=((st=e.metadata)==null?void 0:st.name)||"Untitled Workflow",we=O(t||"unknown",Me);Le.current=we,me("running"),et(null),Ne(["Starting workflow execution..."]),_e(e.steps.map(Be=>({stepId:Be.id,stepName:Be.name||Be.id,status:"pending"}))),Ue(e.steps,we)},[E,e,t,O,D]),Ue=j.useCallback(async(Me,we)=>{for(let st=0;st<Me.length;st++){const Be=Me[st],zt=Be.name||Be.id;et(Be.id),_e(Ot=>Ot.map(Qt=>Qt.stepId===Be.id?{...Qt,status:"running"}:Qt)),Ne(Ot=>[...Ot,"Executing step: "+zt]),L(we,Be.id,"running"),I(we,"Executing step: "+zt),await new Promise(Ot=>setTimeout(Ot,1e3+Math.random()*1e3));const cn=Math.random()>.1,Mt=Math.floor(1e3+Math.random()*1e3),It=cn?void 0:"Simulated error";_e(Ot=>Ot.map(Qt=>Qt.stepId===Be.id?{...Qt,status:cn?"completed":"failed",duration:Mt,error:It}:Qt));const os=cn?'Step "'+zt+'" completed':'Step "'+zt+'" failed';if(Ne(Ot=>[...Ot,os]),L(we,Be.id,cn?"completed":"failed",void 0,It),I(we,os),!cn){me("failed"),B(we,"failed"),Le.current=null;return}}me("completed"),Ne(st=>[...st,"Workflow completed successfully!"]),B(we,"completed"),Le.current=null},[L,I,B]),At=j.useCallback(()=>{e&&n(e)},[e,n]),Tt=j.useCallback(()=>{if(b.length>1){const Me=b.length-2,we=b[Me];x(Me),S(we.path)}},[b,x,S]),Bt=j.useCallback(()=>{if(b.length>1){const Me=b[0];x(0),S(Me.path)}},[b,x,S]);return j.useEffect(()=>{const Me=we=>{if(we.target instanceof HTMLInputElement||we.target instanceof HTMLTextAreaElement)return;const st=we.metaKey||we.ctrlKey;st&&we.key==="s"&&(we.preventDefault(),At()),st&&we.key==="Enter"&&(we.preventDefault(),it()),we.key==="n"&&!st&&!we.shiftKey&&!we.altKey&&(we.preventDefault(),gt()),st&&we.key==="ArrowLeft"&&(we.preventDefault(),Tt()),st&&we.key==="ArrowUp"&&(we.preventDefault(),Bt()),we.key==="F9"&&(we.preventDefault(),V.enabled?Q():z()),we.key==="F10"&&V.enabled&&R&&(we.preventDefault(),Y()),we.key==="F11"&&!we.shiftKey&&V.enabled&&R&&(we.preventDefault(),P()),we.key==="F11"&&we.shiftKey&&V.enabled&&R&&(we.preventDefault(),W()),we.key==="F5"&&R&&(we.preventDefault(),U())};return window.addEventListener("keydown",Me),()=>window.removeEventListener("keydown",Me)},[At,it,gt,Tt,Bt,V.enabled,R,z,Q,Y,P,W,U]),m.jsx(qT,{children:m.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-canvas-bg",children:[m.jsx(LX,{}),m.jsxs("div",{className:"flex flex-1 flex-col relative",children:[J==="mobile"&&m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-node-border bg-panel-bg",children:[m.jsx("button",{onClick:()=>te(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open menu",children:m.jsx(Lz,{className:"w-5 h-5 text-gray-400"})}),m.jsx("h1",{className:"text-sm font-medium text-white",children:"Marktoflow"}),m.jsx("button",{onClick:()=>fe(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors","aria-label":"Open properties",children:m.jsx(Fz,{className:"w-5 h-5 text-gray-400"})})]}),J!=="mobile"&&m.jsxs("div",{className:"absolute top-4 right-4 z-10 flex items-center gap-2",children:[m.jsx(rQ,{showLabel:!0}),m.jsx(nQ,{onClick:v}),m.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:[m.jsx("div",{className:`w-2 h-2 rounded-full ${k?"bg-success":"bg-error"}`}),k?"Connected":"Disconnected"]})]}),m.jsx(SX,{onAddStep:gt,onExecute:it,onSave:At,isExecuting:E}),m.jsx(iQ,{items:b,onNavigate:N}),m.jsxs("div",{className:"flex-1 relative",children:[m.jsx(_X,{}),m.jsx(kX,{isExecuting:E,isPaused:R,workflowStatus:he,currentStepId:Ee,steps:de,logs:ve,onPause:()=>q(),onResume:()=>U(),onStop:()=>{Le.current&&(D(Le.current),Le.current=null),me("cancelled")},onStepOver:()=>Y(),onClose:()=>{me("pending"),_e([]),Ne([])},debug:V,onToggleDebugMode:()=>{V.enabled?Q():z()},onToggleBreakpoint:Me=>F(Me),onStepInto:()=>P(),onStepOut:()=>W(),onClearBreakpoints:()=>$(),onAddWatchExpression:Me=>se(Me),onRemoveWatchExpression:Me=>K(Me)})]}),m.jsx(YX,{})]}),m.jsx(BX,{}),m.jsx(JX,{open:i,onOpenChange:Me=>{Me||c()},onCreateStep:yt,position:o||void 0}),u&&m.jsx(XX,{open:!!u,onOpenChange:()=>h(),originalWorkflow:e,modifiedWorkflow:u,explanation:"AI has suggested the following changes to your workflow.",onAccept:f,onReject:h}),m.jsx(eQ,{open:p,onOpenChange:g})]})})}c3.createRoot(document.getElementById("root")).render(m.jsx(dt.StrictMode,{children:m.jsx(tJ,{})}));
608
- //# sourceMappingURL=index-DwTI8opO.js.map