@marktoflow/gui 2.0.3 → 2.0.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/client/assets/index-DqVkoerZ.js +838 -0
- package/dist/client/assets/index-DqVkoerZ.js.map +1 -0
- package/dist/client/assets/{index-DipWdkNl.css → index-eEWndJyn.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/routes/execute.js +43 -8
- package/dist/server/routes/execute.js.map +1 -1
- package/dist/server/routes/tools.js +30 -884
- package/dist/server/routes/tools.js.map +1 -1
- package/dist/server/routes/workflows.js +24 -5
- package/dist/server/routes/workflows.js.map +1 -1
- package/dist/server/services/WorkflowService.js +15 -6
- package/dist/server/services/WorkflowService.js.map +1 -1
- package/dist/server/services/agents/openai-provider.js +31 -1
- package/dist/server/services/agents/openai-provider.js.map +1 -1
- package/dist/shared/constants.js +42 -0
- package/dist/shared/constants.js.map +1 -1
- package/package.json +21 -6
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/client/App.tsx.html +0 -2230
- package/coverage/client/components/Accessibility/LiveRegion.tsx.html +0 -166
- package/coverage/client/components/Accessibility/SkipNav.tsx.html +0 -106
- package/coverage/client/components/Accessibility/index.html +0 -131
- package/coverage/client/components/Admin/AuditViewer.tsx.html +0 -214
- package/coverage/client/components/Admin/EnvironmentSwitcher.tsx.html +0 -187
- package/coverage/client/components/Admin/RoleManager.tsx.html +0 -250
- package/coverage/client/components/Admin/SecretsVault.tsx.html +0 -241
- package/coverage/client/components/Admin/index.html +0 -161
- package/coverage/client/components/Canvas/AlignmentTools.tsx.html +0 -694
- package/coverage/client/components/Canvas/Canvas.tsx.html +0 -1513
- package/coverage/client/components/Canvas/DataPreviewBadge.tsx.html +0 -307
- package/coverage/client/components/Canvas/ExecutionInputDialog.tsx.html +0 -769
- package/coverage/client/components/Canvas/ExecutionOverlay.tsx.html +0 -2938
- package/coverage/client/components/Canvas/ForEachNode.tsx.html +0 -568
- package/coverage/client/components/Canvas/GroupNode.tsx.html +0 -421
- package/coverage/client/components/Canvas/IfElseNode.tsx.html +0 -508
- package/coverage/client/components/Canvas/InlineEditor.tsx.html +0 -472
- package/coverage/client/components/Canvas/NodeContextMenu.tsx.html +0 -661
- package/coverage/client/components/Canvas/NodeTooltip.tsx.html +0 -316
- package/coverage/client/components/Canvas/OutputNode.tsx.html +0 -418
- package/coverage/client/components/Canvas/ParallelNode.tsx.html +0 -556
- package/coverage/client/components/Canvas/StepNode.tsx.html +0 -463
- package/coverage/client/components/Canvas/StickyNoteNode.tsx.html +0 -442
- package/coverage/client/components/Canvas/SubWorkflowNode.tsx.html +0 -508
- package/coverage/client/components/Canvas/SwitchNode.tsx.html +0 -640
- package/coverage/client/components/Canvas/Toolbar.tsx.html +0 -1030
- package/coverage/client/components/Canvas/TransformNode.tsx.html +0 -667
- package/coverage/client/components/Canvas/TriggerNode.tsx.html +0 -469
- package/coverage/client/components/Canvas/TryCatchNode.tsx.html +0 -577
- package/coverage/client/components/Canvas/WhileNode.tsx.html +0 -595
- package/coverage/client/components/Canvas/index.html +0 -446
- package/coverage/client/components/Canvas/index.ts.html +0 -157
- package/coverage/client/components/Collaboration/ActivityFeed.tsx.html +0 -253
- package/coverage/client/components/Collaboration/CommentThread.tsx.html +0 -397
- package/coverage/client/components/Collaboration/LockIndicator.tsx.html +0 -172
- package/coverage/client/components/Collaboration/PresenceIndicator.tsx.html +0 -214
- package/coverage/client/components/Collaboration/index.html +0 -161
- package/coverage/client/components/CommandPalette/CommandItem.tsx.html +0 -313
- package/coverage/client/components/CommandPalette/CommandPalette.tsx.html +0 -685
- package/coverage/client/components/CommandPalette/index.html +0 -131
- package/coverage/client/components/Debug/VariableInspector.tsx.html +0 -529
- package/coverage/client/components/Debug/index.html +0 -116
- package/coverage/client/components/Editor/InputsEditor.tsx.html +0 -1459
- package/coverage/client/components/Editor/NewStepWizard.tsx.html +0 -1117
- package/coverage/client/components/Editor/StepEditor.tsx.html +0 -1681
- package/coverage/client/components/Editor/YamlEditor.tsx.html +0 -565
- package/coverage/client/components/Editor/index.html +0 -161
- package/coverage/client/components/Execution/TimelineView.tsx.html +0 -397
- package/coverage/client/components/Execution/index.html +0 -116
- package/coverage/client/components/Onboarding/OnboardingTour.tsx.html +0 -265
- package/coverage/client/components/Onboarding/index.html +0 -116
- package/coverage/client/components/Panels/PropertiesPanel.tsx.html +0 -2035
- package/coverage/client/components/Panels/ValidationPanel.tsx.html +0 -856
- package/coverage/client/components/Panels/index.html +0 -131
- package/coverage/client/components/Prompt/ChangePreview.tsx.html +0 -928
- package/coverage/client/components/Prompt/PromptHistoryPanel.tsx.html +0 -712
- package/coverage/client/components/Prompt/PromptInput.tsx.html +0 -415
- package/coverage/client/components/Prompt/index.html +0 -146
- package/coverage/client/components/Settings/ProviderSwitcher.tsx.html +0 -1306
- package/coverage/client/components/Settings/SettingsPanel.tsx.html +0 -355
- package/coverage/client/components/Settings/controls/SettingNumber.tsx.html +0 -211
- package/coverage/client/components/Settings/controls/SettingSelect.tsx.html +0 -196
- package/coverage/client/components/Settings/controls/SettingToggle.tsx.html +0 -199
- package/coverage/client/components/Settings/controls/index.html +0 -146
- package/coverage/client/components/Settings/index.html +0 -131
- package/coverage/client/components/Settings/sections/AISettings.tsx.html +0 -154
- package/coverage/client/components/Settings/sections/CanvasSettings.tsx.html +0 -220
- package/coverage/client/components/Settings/sections/EditorSettings.tsx.html +0 -208
- package/coverage/client/components/Settings/sections/ExecutionSettings.tsx.html +0 -172
- package/coverage/client/components/Settings/sections/GeneralSettings.tsx.html +0 -151
- package/coverage/client/components/Settings/sections/NotificationSettings.tsx.html +0 -190
- package/coverage/client/components/Settings/sections/index.html +0 -191
- package/coverage/client/components/Sidebar/ImportDialog.tsx.html +0 -856
- package/coverage/client/components/Sidebar/NewWorkflowDialog.tsx.html +0 -694
- package/coverage/client/components/Sidebar/Sidebar.tsx.html +0 -1456
- package/coverage/client/components/Sidebar/index.html +0 -146
- package/coverage/client/components/Templates/TemplateCard.tsx.html +0 -181
- package/coverage/client/components/Templates/TemplateGallery.tsx.html +0 -307
- package/coverage/client/components/Templates/index.html +0 -131
- package/coverage/client/components/Versions/DiffViewer.tsx.html +0 -220
- package/coverage/client/components/Versions/VersionHistory.tsx.html +0 -352
- package/coverage/client/components/Versions/index.html +0 -131
- package/coverage/client/components/common/Breadcrumb.tsx.html +0 -205
- package/coverage/client/components/common/Button.tsx.html +0 -289
- package/coverage/client/components/common/ContextMenu.tsx.html +0 -691
- package/coverage/client/components/common/KeyboardShortcuts.tsx.html +0 -541
- package/coverage/client/components/common/Modal.tsx.html +0 -364
- package/coverage/client/components/common/Tabs.tsx.html +0 -256
- package/coverage/client/components/common/ThemeToggle.tsx.html +0 -301
- package/coverage/client/components/common/index.html +0 -206
- package/coverage/client/components/index.html +0 -116
- package/coverage/client/components/index.ts.html +0 -181
- package/coverage/client/hooks/index.html +0 -176
- package/coverage/client/hooks/index.ts.html +0 -97
- package/coverage/client/hooks/useAIPrompt.ts.html +0 -409
- package/coverage/client/hooks/useCanvas.ts.html +0 -739
- package/coverage/client/hooks/useWebSocket.ts.html +0 -580
- package/coverage/client/hooks/useWorkflow.ts.html +0 -502
- package/coverage/client/index.html +0 -131
- package/coverage/client/main.tsx.html +0 -115
- package/coverage/client/stores/agentStore.ts.html +0 -421
- package/coverage/client/stores/canvasStore.ts.html +0 -1129
- package/coverage/client/stores/collaborationStore.ts.html +0 -544
- package/coverage/client/stores/commandStore.ts.html +0 -610
- package/coverage/client/stores/editorStore.ts.html +0 -484
- package/coverage/client/stores/executionStore.ts.html +0 -1594
- package/coverage/client/stores/governanceStore.ts.html +0 -493
- package/coverage/client/stores/index.html +0 -341
- package/coverage/client/stores/index.ts.html +0 -112
- package/coverage/client/stores/layoutStore.ts.html +0 -439
- package/coverage/client/stores/navigationStore.ts.html +0 -232
- package/coverage/client/stores/onboardingStore.ts.html +0 -247
- package/coverage/client/stores/promptStore.ts.html +0 -430
- package/coverage/client/stores/settingsStore.ts.html +0 -472
- package/coverage/client/stores/themeStore.ts.html +0 -271
- package/coverage/client/stores/versionStore.ts.html +0 -340
- package/coverage/client/stores/workflowStore.ts.html +0 -739
- package/coverage/client/utils/applyDagreLayout.ts.html +0 -286
- package/coverage/client/utils/cn.ts.html +0 -112
- package/coverage/client/utils/index.html +0 -206
- package/coverage/client/utils/index.ts.html +0 -97
- package/coverage/client/utils/platform.ts.html +0 -223
- package/coverage/client/utils/serviceIcons.tsx.html +0 -376
- package/coverage/client/utils/stepValidation.ts.html +0 -550
- package/coverage/client/utils/workflowToGraph.ts.html +0 -1624
- package/coverage/coverage-final.json +0 -107
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -461
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/shared/constants.ts.html +0 -655
- package/coverage/shared/index.html +0 -146
- package/coverage/shared/settings.ts.html +0 -406
- package/coverage/shared/types.ts.html +0 -622
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/dist/client/assets/index-DtX_BPDj.js +0 -833
- package/dist/client/assets/index-DtX_BPDj.js.map +0 -1
|
@@ -0,0 +1,838 @@
|
|
|
1
|
+
function sD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var Mu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wp={exports:{}},rl={},Kp={exports:{}},Be={};/**
|
|
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 nS;function oD(){if(nS)return Be;nS=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator;function g(F){return F===null||typeof F!="object"?null:(F=h&&F[h]||F["@@iterator"],typeof F=="function"?F:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function v(F,K,ee){this.props=F,this.context=K,this.refs=w,this.updater=ee||y}v.prototype.isReactComponent={},v.prototype.setState=function(F,K){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,K,"setState")},v.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function k(){}k.prototype=v.prototype;function _(F,K,ee){this.props=F,this.context=K,this.refs=w,this.updater=ee||y}var N=_.prototype=new k;N.constructor=_,b(N,v.prototype),N.isPureReactComponent=!0;var S=Array.isArray,A=Object.prototype.hasOwnProperty,I={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function O(F,K,ee){var W,X={},Z=null,ne=null;if(K!=null)for(W in K.ref!==void 0&&(ne=K.ref),K.key!==void 0&&(Z=""+K.key),K)A.call(K,W)&&!T.hasOwnProperty(W)&&(X[W]=K[W]);var te=arguments.length-2;if(te===1)X.children=ee;else if(1<te){for(var ie=Array(te),he=0;he<te;he++)ie[he]=arguments[he+2];X.children=ie}if(F&&F.defaultProps)for(W in te=F.defaultProps,te)X[W]===void 0&&(X[W]=te[W]);return{$$typeof:e,type:F,key:Z,ref:ne,props:X,_owner:I.current}}function L(F,K){return{$$typeof:e,type:F.type,key:K,ref:F.ref,props:F.props,_owner:F._owner}}function z(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function M(F){var K={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(ee){return K[ee]})}var P=/\/+/g;function H(F,K){return typeof F=="object"&&F!==null&&F.key!=null?M(""+F.key):K.toString(36)}function D(F,K,ee,W,X){var Z=typeof F;(Z==="undefined"||Z==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(Z){case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case t:ne=!0}}if(ne)return ne=F,X=X(ne),F=W===""?"."+H(ne,0):W,S(X)?(ee="",F!=null&&(ee=F.replace(P,"$&/")+"/"),D(X,K,ee,"",function(he){return he})):X!=null&&(z(X)&&(X=L(X,ee+(!X.key||ne&&ne.key===X.key?"":(""+X.key).replace(P,"$&/")+"/")+F)),K.push(X)),1;if(ne=0,W=W===""?".":W+":",S(F))for(var te=0;te<F.length;te++){Z=F[te];var ie=W+H(Z,te);ne+=D(Z,K,ee,ie,X)}else if(ie=g(F),typeof ie=="function")for(F=ie.call(F),te=0;!(Z=F.next()).done;)Z=Z.value,ie=W+H(Z,te++),ne+=D(Z,K,ee,ie,X);else if(Z==="object")throw K=String(F),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return ne}function V(F,K,ee){if(F==null)return F;var W=[],X=0;return D(F,W,"","",function(Z){return K.call(ee,Z,X++)}),W}function $(F){if(F._status===-1){var K=F._result;K=K(),K.then(function(ee){(F._status===0||F._status===-1)&&(F._status=1,F._result=ee)},function(ee){(F._status===0||F._status===-1)&&(F._status=2,F._result=ee)}),F._status===-1&&(F._status=0,F._result=K)}if(F._status===1)return F._result.default;throw F._result}var U={current:null},B={transition:null},q={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:B,ReactCurrentOwner:I};function Y(){throw Error("act(...) is not supported in production builds of React.")}return Be.Children={map:V,forEach:function(F,K,ee){V(F,function(){K.apply(this,arguments)},ee)},count:function(F){var K=0;return V(F,function(){K++}),K},toArray:function(F){return V(F,function(K){return K})||[]},only:function(F){if(!z(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},Be.Component=v,Be.Fragment=n,Be.Profiler=s,Be.PureComponent=_,Be.StrictMode=r,Be.Suspense=d,Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Be.act=Y,Be.cloneElement=function(F,K,ee){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var W=b({},F.props),X=F.key,Z=F.ref,ne=F._owner;if(K!=null){if(K.ref!==void 0&&(Z=K.ref,ne=I.current),K.key!==void 0&&(X=""+K.key),F.type&&F.type.defaultProps)var te=F.type.defaultProps;for(ie in K)A.call(K,ie)&&!T.hasOwnProperty(ie)&&(W[ie]=K[ie]===void 0&&te!==void 0?te[ie]:K[ie])}var ie=arguments.length-2;if(ie===1)W.children=ee;else if(1<ie){te=Array(ie);for(var he=0;he<ie;he++)te[he]=arguments[he+2];W.children=te}return{$$typeof:e,type:F.type,key:X,ref:Z,props:W,_owner:ne}},Be.createContext=function(F){return F={$$typeof:a,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:o,_context:F},F.Consumer=F},Be.createElement=O,Be.createFactory=function(F){var K=O.bind(null,F);return K.type=F,K},Be.createRef=function(){return{current:null}},Be.forwardRef=function(F){return{$$typeof:c,render:F}},Be.isValidElement=z,Be.lazy=function(F){return{$$typeof:p,_payload:{_status:-1,_result:F},_init:$}},Be.memo=function(F,K){return{$$typeof:f,type:F,compare:K===void 0?null:K}},Be.startTransition=function(F){var K=B.transition;B.transition={};try{F()}finally{B.transition=K}},Be.unstable_act=Y,Be.useCallback=function(F,K){return U.current.useCallback(F,K)},Be.useContext=function(F){return U.current.useContext(F)},Be.useDebugValue=function(){},Be.useDeferredValue=function(F){return U.current.useDeferredValue(F)},Be.useEffect=function(F,K){return U.current.useEffect(F,K)},Be.useId=function(){return U.current.useId()},Be.useImperativeHandle=function(F,K,ee){return U.current.useImperativeHandle(F,K,ee)},Be.useInsertionEffect=function(F,K){return U.current.useInsertionEffect(F,K)},Be.useLayoutEffect=function(F,K){return U.current.useLayoutEffect(F,K)},Be.useMemo=function(F,K){return U.current.useMemo(F,K)},Be.useReducer=function(F,K,ee){return U.current.useReducer(F,K,ee)},Be.useRef=function(F){return U.current.useRef(F)},Be.useState=function(F){return U.current.useState(F)},Be.useSyncExternalStore=function(F,K,ee){return U.current.useSyncExternalStore(F,K,ee)},Be.useTransition=function(){return U.current.useTransition()},Be.version="18.3.1",Be}var rS;function Xl(){return rS||(rS=1,Kp.exports=oD()),Kp.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 sS;function iD(){if(sS)return rl;sS=1;var e=Xl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(c,d,f){var p,h={},g=null,y=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(y=d.ref);for(p in d)r.call(d,p)&&!o.hasOwnProperty(p)&&(h[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)h[p]===void 0&&(h[p]=d[p]);return{$$typeof:t,type:c,key:g,ref:y,props:h,_owner:s.current}}return rl.Fragment=n,rl.jsx=a,rl.jsxs=a,rl}var oS;function aD(){return oS||(oS=1,Wp.exports=iD()),Wp.exports}var u=aD(),E=Xl();const ue=Yl(E),mI=sD({__proto__:null,default:ue},[E]);var Ru={},Gp={exports:{}},gn={},Yp={exports:{}},Xp={};/**
|
|
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 iS;function lD(){return iS||(iS=1,(function(e){function t(B,q){var Y=B.length;B.push(q);e:for(;0<Y;){var F=Y-1>>>1,K=B[F];if(0<s(K,q))B[F]=q,B[Y]=K,Y=F;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var q=B[0],Y=B.pop();if(Y!==q){B[0]=Y;e:for(var F=0,K=B.length,ee=K>>>1;F<ee;){var W=2*(F+1)-1,X=B[W],Z=W+1,ne=B[Z];if(0>s(X,Y))Z<K&&0>s(ne,X)?(B[F]=ne,B[Z]=Y,F=Z):(B[F]=X,B[W]=Y,F=W);else if(Z<K&&0>s(ne,Y))B[F]=ne,B[Z]=Y,F=Z;else break e}}return q}function s(B,q){var Y=B.sortIndex-q.sortIndex;return Y!==0?Y:B.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,h=null,g=3,y=!1,b=!1,w=!1,v=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(B){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=B)r(f),q.sortIndex=q.expirationTime,t(d,q);else break;q=n(f)}}function S(B){if(w=!1,N(B),!b)if(n(d)!==null)b=!0,$(A);else{var q=n(f);q!==null&&U(S,q.startTime-B)}}function A(B,q){b=!1,w&&(w=!1,k(O),O=-1),y=!0;var Y=g;try{for(N(q),h=n(d);h!==null&&(!(h.expirationTime>q)||B&&!M());){var F=h.callback;if(typeof F=="function"){h.callback=null,g=h.priorityLevel;var K=F(h.expirationTime<=q);q=e.unstable_now(),typeof K=="function"?h.callback=K:h===n(d)&&r(d),N(q)}else r(d);h=n(d)}if(h!==null)var ee=!0;else{var W=n(f);W!==null&&U(S,W.startTime-q),ee=!1}return ee}finally{h=null,g=Y,y=!1}}var I=!1,T=null,O=-1,L=5,z=-1;function M(){return!(e.unstable_now()-z<L)}function P(){if(T!==null){var B=e.unstable_now();z=B;var q=!0;try{q=T(!0,B)}finally{q?H():(I=!1,T=null)}}else I=!1}var H;if(typeof _=="function")H=function(){_(P)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,V=D.port2;D.port1.onmessage=P,H=function(){V.postMessage(null)}}else H=function(){v(P,0)};function $(B){T=B,I||(I=!0,H())}function U(B,q){O=v(function(){B(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){b||y||(b=!0,$(A))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var Y=g;g=q;try{return B()}finally{g=Y}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Y=g;g=B;try{return q()}finally{g=Y}},e.unstable_scheduleCallback=function(B,q,Y){var F=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?F+Y:F):Y=F,B){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=Y+K,B={id:p++,callback:q,priorityLevel:B,startTime:Y,expirationTime:K,sortIndex:-1},Y>F?(B.sortIndex=Y,t(f,B),n(d)===null&&B===n(f)&&(w?(k(O),O=-1):w=!0,U(S,Y-F))):(B.sortIndex=K,t(d,B),b||y||(b=!0,$(A))),B},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(B){var q=g;return function(){var Y=g;g=q;try{return B.apply(this,arguments)}finally{g=Y}}}})(Xp)),Xp}var aS;function cD(){return aS||(aS=1,Yp.exports=lD()),Yp.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 lS;function uD(){if(lS)return gn;lS=1;var e=Xl(),t=cD();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,m=1;m<arguments.length;m++)l+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function o(i,l){a(i,l),a(i+"Capture",l)}function a(i,l){for(s[i]=l,i=0;i<l.length;i++)r.add(l[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},h={};function g(i){return d.call(h,i)?!0:d.call(p,i)?!1:f.test(i)?h[i]=!0:(p[i]=!0,!1)}function y(i,l,m,x){if(m!==null&&m.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return x?!1:m!==null?!m.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,l,m,x){if(l===null||typeof l>"u"||y(i,l,m,x))return!0;if(x)return!1;if(m!==null)switch(m.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(i,l,m,x,C,j,R){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=x,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=i,this.type=l,this.sanitizeURL=j,this.removeEmptyString=R}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){v[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];v[l]=new w(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){v[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){v[i]=new w(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){v[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){v[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){v[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){v[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){v[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function _(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var l=i.replace(k,_);v[l]=new w(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(k,_);v[l]=new w(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(k,_);v[l]=new w(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){v[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),v.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){v[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function N(i,l,m,x){var C=v.hasOwnProperty(l)?v[l]:null;(C!==null?C.type!==0:x||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(b(l,m,C,x)&&(m=null),x||C===null?g(l)&&(m===null?i.removeAttribute(l):i.setAttribute(l,""+m)):C.mustUseProperty?i[C.propertyName]=m===null?C.type===3?!1:"":m:(l=C.attributeName,x=C.attributeNamespace,m===null?i.removeAttribute(l):(C=C.type,m=C===3||C===4&&m===!0?"":""+m,x?i.setAttributeNS(x,l,m):i.setAttribute(l,m))))}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),I=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),M=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),B=Symbol.iterator;function q(i){return i===null||typeof i!="object"?null:(i=B&&i[B]||i["@@iterator"],typeof i=="function"?i:null)}var Y=Object.assign,F;function K(i){if(F===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);F=l&&l[1]||""}return`
|
|
34
|
+
`+F+i}var ee=!1;function W(i,l){if(!i||ee)return"";ee=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(oe){var x=oe}Reflect.construct(i,[],l)}else{try{l.call()}catch(oe){x=oe}i.call(l.prototype)}else{try{throw Error()}catch(oe){x=oe}i()}}catch(oe){if(oe&&x&&typeof oe.stack=="string"){for(var C=oe.stack.split(`
|
|
35
|
+
`),j=x.stack.split(`
|
|
36
|
+
`),R=C.length-1,G=j.length-1;1<=R&&0<=G&&C[R]!==j[G];)G--;for(;1<=R&&0<=G;R--,G--)if(C[R]!==j[G]){if(R!==1||G!==1)do if(R--,G--,0>G||C[R]!==j[G]){var Q=`
|
|
37
|
+
`+C[R].replace(" at new "," at ");return i.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",i.displayName)),Q}while(1<=R&&0<=G);break}}}finally{ee=!1,Error.prepareStackTrace=m}return(i=i?i.displayName||i.name:"")?K(i):""}function X(i){switch(i.tag){case 5:return K(i.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return i=W(i.type,!1),i;case 11:return i=W(i.type.render,!1),i;case 1:return i=W(i.type,!0),i;default:return""}}function Z(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case T:return"Fragment";case I:return"Portal";case L:return"Profiler";case O:return"StrictMode";case H:return"Suspense";case D:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case M:return(i.displayName||"Context")+".Consumer";case z:return(i._context.displayName||"Context")+".Provider";case P:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return l=i.displayName||null,l!==null?l:Z(i.type)||"Memo";case $:l=i._payload,i=i._init;try{return Z(i(l))}catch{}}return null}function ne(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(l);case 8:return l===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function te(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ie(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function he(i){var l=ie(i)?"checked":"value",m=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),x=""+i[l];if(!i.hasOwnProperty(l)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,j=m.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return C.call(this)},set:function(R){x=""+R,j.call(this,R)}}),Object.defineProperty(i,l,{enumerable:m.enumerable}),{getValue:function(){return x},setValue:function(R){x=""+R},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function xe(i){i._valueTracker||(i._valueTracker=he(i))}function ve(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var m=l.getValue(),x="";return i&&(x=ie(i)?i.checked?"true":"false":i.value),i=x,i!==m?(l.setValue(i),!0):!1}function ye(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function _e(i,l){var m=l.checked;return Y({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??i._wrapperState.initialChecked})}function we(i,l){var m=l.defaultValue==null?"":l.defaultValue,x=l.checked!=null?l.checked:l.defaultChecked;m=te(l.value!=null?l.value:m),i._wrapperState={initialChecked:x,initialValue:m,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Te(i,l){l=l.checked,l!=null&&N(i,"checked",l,!1)}function Ne(i,l){Te(i,l);var m=te(l.value),x=l.type;if(m!=null)x==="number"?(m===0&&i.value===""||i.value!=m)&&(i.value=""+m):i.value!==""+m&&(i.value=""+m);else if(x==="submit"||x==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?Fe(i,l.type,m):l.hasOwnProperty("defaultValue")&&Fe(i,l.type,te(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function Je(i,l,m){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var x=l.type;if(!(x!=="submit"&&x!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,m||l===i.value||(i.value=l),i.defaultValue=l}m=i.name,m!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,m!==""&&(i.name=m)}function Fe(i,l,m){(l!=="number"||ye(i.ownerDocument)!==i)&&(m==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+m&&(i.defaultValue=""+m))}var _t=Array.isArray;function bt(i,l,m,x){if(i=i.options,l){l={};for(var C=0;C<m.length;C++)l["$"+m[C]]=!0;for(m=0;m<i.length;m++)C=l.hasOwnProperty("$"+i[m].value),i[m].selected!==C&&(i[m].selected=C),C&&x&&(i[m].defaultSelected=!0)}else{for(m=""+te(m),l=null,C=0;C<i.length;C++){if(i[C].value===m){i[C].selected=!0,x&&(i[C].defaultSelected=!0);return}l!==null||i[C].disabled||(l=i[C])}l!==null&&(l.selected=!0)}}function He(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return Y({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function qe(i,l){var m=l.value;if(m==null){if(m=l.children,l=l.defaultValue,m!=null){if(l!=null)throw Error(n(92));if(_t(m)){if(1<m.length)throw Error(n(93));m=m[0]}l=m}l==null&&(l=""),m=l}i._wrapperState={initialValue:te(m)}}function Xt(i,l){var m=te(l.value),x=te(l.defaultValue);m!=null&&(m=""+m,m!==i.value&&(i.value=m),l.defaultValue==null&&i.defaultValue!==m&&(i.defaultValue=m)),x!=null&&(i.defaultValue=""+x)}function Mt(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Rt(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ot(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Rt(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Et,Qt=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,m,x,C){MSApp.execUnsafeLocalFunction(function(){return i(l,m,x,C)})}:i})(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(Et=Et||document.createElement("div"),Et.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Et.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function $e(i,l){if(l){var m=i.firstChild;if(m&&m===i.lastChild&&m.nodeType===3){m.nodeValue=l;return}}i.textContent=l}var cn={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},Vt=["Webkit","ms","Moz","O"];Object.keys(cn).forEach(function(i){Vt.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),cn[l]=cn[i]})});function Ht(i,l,m){return l==null||typeof l=="boolean"||l===""?"":m||typeof l!="number"||l===0||cn.hasOwnProperty(i)&&cn[i]?(""+l).trim():l+"px"}function Jt(i,l){i=i.style;for(var m in l)if(l.hasOwnProperty(m)){var x=m.indexOf("--")===0,C=Ht(m,l[m],x);m==="float"&&(m="cssFloat"),x?i.setProperty(m,C):i[m]=C}}var xs=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 Yn(i,l){if(l){if(xs[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Rn(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xn=null;function wt(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var On=null,bn=null,Zt=null;function Qn(i){if(i=za(i)){if(typeof On!="function")throw Error(n(280));var l=i.stateNode;l&&(l=Kc(l),On(i.stateNode,i.type,l))}}function Ie(i){bn?Zt?Zt.push(i):Zt=[i]:bn=i}function pe(){if(bn){var i=bn,l=Zt;if(Zt=bn=null,Qn(i),l)for(i=0;i<l.length;i++)Qn(l[i])}}function me(i,l){return i(l)}function Pe(){}var Ot=!1;function Xe(i,l,m){if(Ot)return i(l,m);Ot=!0;try{return me(i,l,m)}finally{Ot=!1,(bn!==null||Zt!==null)&&(Pe(),pe())}}function pt(i,l){var m=i.stateNode;if(m===null)return null;var x=Kc(m);if(x===null)return null;m=x[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(i=i.type,x=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!x;break e;default:i=!1}if(i)return null;if(m&&typeof m!="function")throw Error(n(231,l,typeof m));return m}var Pt=!1;if(c)try{var jt={};Object.defineProperty(jt,"passive",{get:function(){Pt=!0}}),window.addEventListener("test",jt,jt),window.removeEventListener("test",jt,jt)}catch{Pt=!1}function en(i,l,m,x,C,j,R,G,Q){var oe=Array.prototype.slice.call(arguments,3);try{l.apply(m,oe)}catch(ce){this.onError(ce)}}var wr=!1,un=null,oo=!1,ba=null,rh={onError:function(i){wr=!0,un=i}};function sh(i,l,m,x,C,j,R,G,Q){wr=!1,un=null,en.apply(rh,arguments)}function oh(i,l,m,x,C,j,R,G,Q){if(sh.apply(this,arguments),wr){if(wr){var oe=un;wr=!1,un=null}else throw Error(n(198));oo||(oo=!0,ba=oe)}}function kr(i){var l=i,m=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(m=l.return),i=l.return;while(i)}return l.tag===3?m:null}function wa(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function ka(i){if(kr(i)!==i)throw Error(n(188))}function ih(i){var l=i.alternate;if(!l){if(l=kr(i),l===null)throw Error(n(188));return l!==i?null:i}for(var m=i,x=l;;){var C=m.return;if(C===null)break;var j=C.alternate;if(j===null){if(x=C.return,x!==null){m=x;continue}break}if(C.child===j.child){for(j=C.child;j;){if(j===m)return ka(C),i;if(j===x)return ka(C),l;j=j.sibling}throw Error(n(188))}if(m.return!==x.return)m=C,x=j;else{for(var R=!1,G=C.child;G;){if(G===m){R=!0,m=C,x=j;break}if(G===x){R=!0,x=C,m=j;break}G=G.sibling}if(!R){for(G=j.child;G;){if(G===m){R=!0,m=j,x=C;break}if(G===x){R=!0,x=j,m=C;break}G=G.sibling}if(!R)throw Error(n(189))}}if(m.alternate!==x)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?i:l}function Nc(i){return i=ih(i),i!==null?Sc(i):null}function Sc(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Sc(i);if(l!==null)return l;i=i.sibling}return null}var Cc=t.unstable_scheduleCallback,_c=t.unstable_cancelCallback,ah=t.unstable_shouldYield,Ec=t.unstable_requestPaint,dt=t.unstable_now,lh=t.unstable_getCurrentPriorityLevel,Na=t.unstable_ImmediatePriority,jc=t.unstable_UserBlockingPriority,Qo=t.unstable_NormalPriority,ch=t.unstable_LowPriority,Ac=t.unstable_IdlePriority,io=null,Pn=null;function uh(i){if(Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(io,i,void 0,(i.current.flags&128)===128)}catch{}}var wn=Math.clz32?Math.clz32:hh,dh=Math.log,fh=Math.LN2;function hh(i){return i>>>=0,i===0?32:31-(dh(i)/fh|0)|0}var Jo=64,Zo=4194304;function Nr(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ei(i,l){var m=i.pendingLanes;if(m===0)return 0;var x=0,C=i.suspendedLanes,j=i.pingedLanes,R=m&268435455;if(R!==0){var G=R&~C;G!==0?x=Nr(G):(j&=R,j!==0&&(x=Nr(j)))}else R=m&~C,R!==0?x=Nr(R):j!==0&&(x=Nr(j));if(x===0)return 0;if(l!==0&&l!==x&&(l&C)===0&&(C=x&-x,j=l&-l,C>=j||C===16&&(j&4194240)!==0))return l;if((x&4)!==0&&(x|=m&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=x;0<l;)m=31-wn(l),C=1<<m,x|=i[m],l&=~C;return x}function Tc(i,l){switch(i){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ph(i,l){for(var m=i.suspendedLanes,x=i.pingedLanes,C=i.expirationTimes,j=i.pendingLanes;0<j;){var R=31-wn(j),G=1<<R,Q=C[R];Q===-1?((G&m)===0||(G&x)!==0)&&(C[R]=Tc(G,l)):Q<=l&&(i.expiredLanes|=G),j&=~G}}function Sa(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function ti(){var i=Jo;return Jo<<=1,(Jo&4194240)===0&&(Jo=64),i}function Ca(i){for(var l=[],m=0;31>m;m++)l.push(i);return l}function ao(i,l,m){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-wn(l),i[l]=m}function Ic(i,l){var m=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var x=i.eventTimes;for(i=i.expirationTimes;0<m;){var C=31-wn(m),j=1<<C;l[C]=0,x[C]=-1,i[C]=-1,m&=~j}}function mh(i,l){var m=i.entangledLanes|=l;for(i=i.entanglements;m;){var x=31-wn(m),C=1<<x;C&l|i[x]&l&&(i[x]|=l),m&=~C}}var Qe=0;function O1(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var P1,gh,L1,D1,$1,yh=!1,Mc=[],vs=null,bs=null,ws=null,_a=new Map,Ea=new Map,ks=[],_5="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 F1(i,l){switch(i){case"focusin":case"focusout":vs=null;break;case"dragenter":case"dragleave":bs=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":_a.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ea.delete(l.pointerId)}}function ja(i,l,m,x,C,j){return i===null||i.nativeEvent!==j?(i={blockedOn:l,domEventName:m,eventSystemFlags:x,nativeEvent:j,targetContainers:[C]},l!==null&&(l=za(l),l!==null&&gh(l)),i):(i.eventSystemFlags|=x,l=i.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),i)}function E5(i,l,m,x,C){switch(l){case"focusin":return vs=ja(vs,i,l,m,x,C),!0;case"dragenter":return bs=ja(bs,i,l,m,x,C),!0;case"mouseover":return ws=ja(ws,i,l,m,x,C),!0;case"pointerover":var j=C.pointerId;return _a.set(j,ja(_a.get(j)||null,i,l,m,x,C)),!0;case"gotpointercapture":return j=C.pointerId,Ea.set(j,ja(Ea.get(j)||null,i,l,m,x,C)),!0}return!1}function B1(i){var l=lo(i.target);if(l!==null){var m=kr(l);if(m!==null){if(l=m.tag,l===13){if(l=wa(m),l!==null){i.blockedOn=l,$1(i.priority,function(){L1(m)});return}}else if(l===3&&m.stateNode.current.memoizedState.isDehydrated){i.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Rc(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var m=vh(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(m===null){m=i.nativeEvent;var x=new m.constructor(m.type,m);Xn=x,m.target.dispatchEvent(x),Xn=null}else return l=za(m),l!==null&&gh(l),i.blockedOn=m,!1;l.shift()}return!0}function q1(i,l,m){Rc(i)&&m.delete(l)}function j5(){yh=!1,vs!==null&&Rc(vs)&&(vs=null),bs!==null&&Rc(bs)&&(bs=null),ws!==null&&Rc(ws)&&(ws=null),_a.forEach(q1),Ea.forEach(q1)}function Aa(i,l){i.blockedOn===l&&(i.blockedOn=null,yh||(yh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,j5)))}function Ta(i){function l(C){return Aa(C,i)}if(0<Mc.length){Aa(Mc[0],i);for(var m=1;m<Mc.length;m++){var x=Mc[m];x.blockedOn===i&&(x.blockedOn=null)}}for(vs!==null&&Aa(vs,i),bs!==null&&Aa(bs,i),ws!==null&&Aa(ws,i),_a.forEach(l),Ea.forEach(l),m=0;m<ks.length;m++)x=ks[m],x.blockedOn===i&&(x.blockedOn=null);for(;0<ks.length&&(m=ks[0],m.blockedOn===null);)B1(m),m.blockedOn===null&&ks.shift()}var ni=S.ReactCurrentBatchConfig,Oc=!0;function A5(i,l,m,x){var C=Qe,j=ni.transition;ni.transition=null;try{Qe=1,xh(i,l,m,x)}finally{Qe=C,ni.transition=j}}function T5(i,l,m,x){var C=Qe,j=ni.transition;ni.transition=null;try{Qe=4,xh(i,l,m,x)}finally{Qe=C,ni.transition=j}}function xh(i,l,m,x){if(Oc){var C=vh(i,l,m,x);if(C===null)Lh(i,l,x,Pc,m),F1(i,x);else if(E5(C,i,l,m,x))x.stopPropagation();else if(F1(i,x),l&4&&-1<_5.indexOf(i)){for(;C!==null;){var j=za(C);if(j!==null&&P1(j),j=vh(i,l,m,x),j===null&&Lh(i,l,x,Pc,m),j===C)break;C=j}C!==null&&x.stopPropagation()}else Lh(i,l,x,null,m)}}var Pc=null;function vh(i,l,m,x){if(Pc=null,i=wt(x),i=lo(i),i!==null)if(l=kr(i),l===null)i=null;else if(m=l.tag,m===13){if(i=wa(l),i!==null)return i;i=null}else if(m===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return Pc=i,null}function z1(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(lh()){case Na:return 1;case jc:return 4;case Qo:case ch:return 16;case Ac:return 536870912;default:return 16}default:return 16}}var Ns=null,bh=null,Lc=null;function V1(){if(Lc)return Lc;var i,l=bh,m=l.length,x,C="value"in Ns?Ns.value:Ns.textContent,j=C.length;for(i=0;i<m&&l[i]===C[i];i++);var R=m-i;for(x=1;x<=R&&l[m-x]===C[j-x];x++);return Lc=C.slice(i,1<x?1-x:void 0)}function Dc(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function $c(){return!0}function H1(){return!1}function kn(i){function l(m,x,C,j,R){this._reactName=m,this._targetInst=C,this.type=x,this.nativeEvent=j,this.target=R,this.currentTarget=null;for(var G in i)i.hasOwnProperty(G)&&(m=i[G],this[G]=m?m(j):j[G]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?$c:H1,this.isPropagationStopped=H1,this}return Y(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=$c)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=$c)},persist:function(){},isPersistent:$c}),l}var ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wh=kn(ri),Ia=Y({},ri,{view:0,detail:0}),I5=kn(Ia),kh,Nh,Ma,Fc=Y({},Ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ch,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ma&&(Ma&&i.type==="mousemove"?(kh=i.screenX-Ma.screenX,Nh=i.screenY-Ma.screenY):Nh=kh=0,Ma=i),kh)},movementY:function(i){return"movementY"in i?i.movementY:Nh}}),U1=kn(Fc),M5=Y({},Fc,{dataTransfer:0}),R5=kn(M5),O5=Y({},Ia,{relatedTarget:0}),Sh=kn(O5),P5=Y({},ri,{animationName:0,elapsedTime:0,pseudoElement:0}),L5=kn(P5),D5=Y({},ri,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),$5=kn(D5),F5=Y({},ri,{data:0}),W1=kn(F5),B5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q5={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"},z5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function V5(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=z5[i])?!!l[i]:!1}function Ch(){return V5}var H5=Y({},Ia,{key:function(i){if(i.key){var l=B5[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Dc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?q5[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ch,charCode:function(i){return i.type==="keypress"?Dc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Dc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),U5=kn(H5),W5=Y({},Fc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),K1=kn(W5),K5=Y({},Ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ch}),G5=kn(K5),Y5=Y({},ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),X5=kn(Y5),Q5=Y({},Fc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),J5=kn(Q5),Z5=[9,13,27,32],_h=c&&"CompositionEvent"in window,Ra=null;c&&"documentMode"in document&&(Ra=document.documentMode);var eL=c&&"TextEvent"in window&&!Ra,G1=c&&(!_h||Ra&&8<Ra&&11>=Ra),Y1=" ",X1=!1;function Q1(i,l){switch(i){case"keyup":return Z5.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var si=!1;function tL(i,l){switch(i){case"compositionend":return J1(l);case"keypress":return l.which!==32?null:(X1=!0,Y1);case"textInput":return i=l.data,i===Y1&&X1?null:i;default:return null}}function nL(i,l){if(si)return i==="compositionend"||!_h&&Q1(i,l)?(i=V1(),Lc=bh=Ns=null,si=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return G1&&l.locale!=="ko"?null:l.data;default:return null}}var rL={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 Z1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!rL[i.type]:l==="textarea"}function ek(i,l,m,x){Ie(x),l=Hc(l,"onChange"),0<l.length&&(m=new wh("onChange","change",null,m,x),i.push({event:m,listeners:l}))}var Oa=null,Pa=null;function sL(i){xk(i,0)}function Bc(i){var l=ci(i);if(ve(l))return i}function oL(i,l){if(i==="change")return l}var tk=!1;if(c){var Eh;if(c){var jh="oninput"in document;if(!jh){var nk=document.createElement("div");nk.setAttribute("oninput","return;"),jh=typeof nk.oninput=="function"}Eh=jh}else Eh=!1;tk=Eh&&(!document.documentMode||9<document.documentMode)}function rk(){Oa&&(Oa.detachEvent("onpropertychange",sk),Pa=Oa=null)}function sk(i){if(i.propertyName==="value"&&Bc(Pa)){var l=[];ek(l,Pa,i,wt(i)),Xe(sL,l)}}function iL(i,l,m){i==="focusin"?(rk(),Oa=l,Pa=m,Oa.attachEvent("onpropertychange",sk)):i==="focusout"&&rk()}function aL(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Bc(Pa)}function lL(i,l){if(i==="click")return Bc(l)}function cL(i,l){if(i==="input"||i==="change")return Bc(l)}function uL(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Jn=typeof Object.is=="function"?Object.is:uL;function La(i,l){if(Jn(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var m=Object.keys(i),x=Object.keys(l);if(m.length!==x.length)return!1;for(x=0;x<m.length;x++){var C=m[x];if(!d.call(l,C)||!Jn(i[C],l[C]))return!1}return!0}function ok(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ik(i,l){var m=ok(i);i=0;for(var x;m;){if(m.nodeType===3){if(x=i+m.textContent.length,i<=l&&x>=l)return{node:m,offset:l-i};i=x}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=ok(m)}}function ak(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?ak(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function lk(){for(var i=window,l=ye();l instanceof i.HTMLIFrameElement;){try{var m=typeof l.contentWindow.location.href=="string"}catch{m=!1}if(m)i=l.contentWindow;else break;l=ye(i.document)}return l}function Ah(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function dL(i){var l=lk(),m=i.focusedElem,x=i.selectionRange;if(l!==m&&m&&m.ownerDocument&&ak(m.ownerDocument.documentElement,m)){if(x!==null&&Ah(m)){if(l=x.start,i=x.end,i===void 0&&(i=l),"selectionStart"in m)m.selectionStart=l,m.selectionEnd=Math.min(i,m.value.length);else if(i=(l=m.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var C=m.textContent.length,j=Math.min(x.start,C);x=x.end===void 0?j:Math.min(x.end,C),!i.extend&&j>x&&(C=x,x=j,j=C),C=ik(m,j);var R=ik(m,x);C&&R&&(i.rangeCount!==1||i.anchorNode!==C.node||i.anchorOffset!==C.offset||i.focusNode!==R.node||i.focusOffset!==R.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),i.removeAllRanges(),j>x?(i.addRange(l),i.extend(R.node,R.offset)):(l.setEnd(R.node,R.offset),i.addRange(l)))}}for(l=[],i=m;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<l.length;m++)i=l[m],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var fL=c&&"documentMode"in document&&11>=document.documentMode,oi=null,Th=null,Da=null,Ih=!1;function ck(i,l,m){var x=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Ih||oi==null||oi!==ye(x)||(x=oi,"selectionStart"in x&&Ah(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Da&&La(Da,x)||(Da=x,x=Hc(Th,"onSelect"),0<x.length&&(l=new wh("onSelect","select",null,l,m),i.push({event:l,listeners:x}),l.target=oi)))}function qc(i,l){var m={};return m[i.toLowerCase()]=l.toLowerCase(),m["Webkit"+i]="webkit"+l,m["Moz"+i]="moz"+l,m}var ii={animationend:qc("Animation","AnimationEnd"),animationiteration:qc("Animation","AnimationIteration"),animationstart:qc("Animation","AnimationStart"),transitionend:qc("Transition","TransitionEnd")},Mh={},uk={};c&&(uk=document.createElement("div").style,"AnimationEvent"in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),"TransitionEvent"in window||delete ii.transitionend.transition);function zc(i){if(Mh[i])return Mh[i];if(!ii[i])return i;var l=ii[i],m;for(m in l)if(l.hasOwnProperty(m)&&m in uk)return Mh[i]=l[m];return i}var dk=zc("animationend"),fk=zc("animationiteration"),hk=zc("animationstart"),pk=zc("transitionend"),mk=new Map,gk="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 Ss(i,l){mk.set(i,l),o(l,[i])}for(var Rh=0;Rh<gk.length;Rh++){var Oh=gk[Rh],hL=Oh.toLowerCase(),pL=Oh[0].toUpperCase()+Oh.slice(1);Ss(hL,"on"+pL)}Ss(dk,"onAnimationEnd"),Ss(fk,"onAnimationIteration"),Ss(hk,"onAnimationStart"),Ss("dblclick","onDoubleClick"),Ss("focusin","onFocus"),Ss("focusout","onBlur"),Ss(pk,"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 $a="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(" "),mL=new Set("cancel close invalid load scroll toggle".split(" ").concat($a));function yk(i,l,m){var x=i.type||"unknown-event";i.currentTarget=m,oh(x,l,void 0,i),i.currentTarget=null}function xk(i,l){l=(l&4)!==0;for(var m=0;m<i.length;m++){var x=i[m],C=x.event;x=x.listeners;e:{var j=void 0;if(l)for(var R=x.length-1;0<=R;R--){var G=x[R],Q=G.instance,oe=G.currentTarget;if(G=G.listener,Q!==j&&C.isPropagationStopped())break e;yk(C,G,oe),j=Q}else for(R=0;R<x.length;R++){if(G=x[R],Q=G.instance,oe=G.currentTarget,G=G.listener,Q!==j&&C.isPropagationStopped())break e;yk(C,G,oe),j=Q}}}if(oo)throw i=ba,oo=!1,ba=null,i}function nt(i,l){var m=l[zh];m===void 0&&(m=l[zh]=new Set);var x=i+"__bubble";m.has(x)||(vk(l,i,2,!1),m.add(x))}function Ph(i,l,m){var x=0;l&&(x|=4),vk(m,i,x,l)}var Vc="_reactListening"+Math.random().toString(36).slice(2);function Fa(i){if(!i[Vc]){i[Vc]=!0,r.forEach(function(m){m!=="selectionchange"&&(mL.has(m)||Ph(m,!1,i),Ph(m,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Vc]||(l[Vc]=!0,Ph("selectionchange",!1,l))}}function vk(i,l,m,x){switch(z1(l)){case 1:var C=A5;break;case 4:C=T5;break;default:C=xh}m=C.bind(null,l,m,i),C=void 0,!Pt||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),x?C!==void 0?i.addEventListener(l,m,{capture:!0,passive:C}):i.addEventListener(l,m,!0):C!==void 0?i.addEventListener(l,m,{passive:C}):i.addEventListener(l,m,!1)}function Lh(i,l,m,x,C){var j=x;if((l&1)===0&&(l&2)===0&&x!==null)e:for(;;){if(x===null)return;var R=x.tag;if(R===3||R===4){var G=x.stateNode.containerInfo;if(G===C||G.nodeType===8&&G.parentNode===C)break;if(R===4)for(R=x.return;R!==null;){var Q=R.tag;if((Q===3||Q===4)&&(Q=R.stateNode.containerInfo,Q===C||Q.nodeType===8&&Q.parentNode===C))return;R=R.return}for(;G!==null;){if(R=lo(G),R===null)return;if(Q=R.tag,Q===5||Q===6){x=j=R;continue e}G=G.parentNode}}x=x.return}Xe(function(){var oe=j,ce=wt(m),de=[];e:{var le=mk.get(i);if(le!==void 0){var be=wh,Se=i;switch(i){case"keypress":if(Dc(m)===0)break e;case"keydown":case"keyup":be=U5;break;case"focusin":Se="focus",be=Sh;break;case"focusout":Se="blur",be=Sh;break;case"beforeblur":case"afterblur":be=Sh;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=U1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=R5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=G5;break;case dk:case fk:case hk:be=L5;break;case pk:be=X5;break;case"scroll":be=I5;break;case"wheel":be=J5;break;case"copy":case"cut":case"paste":be=$5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=K1}var Ce=(l&4)!==0,gt=!Ce&&i==="scroll",re=Ce?le!==null?le+"Capture":null:le;Ce=[];for(var J=oe,se;J!==null;){se=J;var fe=se.stateNode;if(se.tag===5&&fe!==null&&(se=fe,re!==null&&(fe=pt(J,re),fe!=null&&Ce.push(Ba(J,fe,se)))),gt)break;J=J.return}0<Ce.length&&(le=new be(le,Se,null,m,ce),de.push({event:le,listeners:Ce}))}}if((l&7)===0){e:{if(le=i==="mouseover"||i==="pointerover",be=i==="mouseout"||i==="pointerout",le&&m!==Xn&&(Se=m.relatedTarget||m.fromElement)&&(lo(Se)||Se[Yr]))break e;if((be||le)&&(le=ce.window===ce?ce:(le=ce.ownerDocument)?le.defaultView||le.parentWindow:window,be?(Se=m.relatedTarget||m.toElement,be=oe,Se=Se?lo(Se):null,Se!==null&&(gt=kr(Se),Se!==gt||Se.tag!==5&&Se.tag!==6)&&(Se=null)):(be=null,Se=oe),be!==Se)){if(Ce=U1,fe="onMouseLeave",re="onMouseEnter",J="mouse",(i==="pointerout"||i==="pointerover")&&(Ce=K1,fe="onPointerLeave",re="onPointerEnter",J="pointer"),gt=be==null?le:ci(be),se=Se==null?le:ci(Se),le=new Ce(fe,J+"leave",be,m,ce),le.target=gt,le.relatedTarget=se,fe=null,lo(ce)===oe&&(Ce=new Ce(re,J+"enter",Se,m,ce),Ce.target=se,Ce.relatedTarget=gt,fe=Ce),gt=fe,be&&Se)t:{for(Ce=be,re=Se,J=0,se=Ce;se;se=ai(se))J++;for(se=0,fe=re;fe;fe=ai(fe))se++;for(;0<J-se;)Ce=ai(Ce),J--;for(;0<se-J;)re=ai(re),se--;for(;J--;){if(Ce===re||re!==null&&Ce===re.alternate)break t;Ce=ai(Ce),re=ai(re)}Ce=null}else Ce=null;be!==null&&bk(de,le,be,Ce,!1),Se!==null&>!==null&&bk(de,gt,Se,Ce,!0)}}e:{if(le=oe?ci(oe):window,be=le.nodeName&&le.nodeName.toLowerCase(),be==="select"||be==="input"&&le.type==="file")var Ee=oL;else if(Z1(le))if(tk)Ee=cL;else{Ee=aL;var je=iL}else(be=le.nodeName)&&be.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(Ee=lL);if(Ee&&(Ee=Ee(i,oe))){ek(de,Ee,m,ce);break e}je&&je(i,le,oe),i==="focusout"&&(je=le._wrapperState)&&je.controlled&&le.type==="number"&&Fe(le,"number",le.value)}switch(je=oe?ci(oe):window,i){case"focusin":(Z1(je)||je.contentEditable==="true")&&(oi=je,Th=oe,Da=null);break;case"focusout":Da=Th=oi=null;break;case"mousedown":Ih=!0;break;case"contextmenu":case"mouseup":case"dragend":Ih=!1,ck(de,m,ce);break;case"selectionchange":if(fL)break;case"keydown":case"keyup":ck(de,m,ce)}var Ae;if(_h)e:{switch(i){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else si?Q1(i,m)&&(Oe="onCompositionEnd"):i==="keydown"&&m.keyCode===229&&(Oe="onCompositionStart");Oe&&(G1&&m.locale!=="ko"&&(si||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&si&&(Ae=V1()):(Ns=ce,bh="value"in Ns?Ns.value:Ns.textContent,si=!0)),je=Hc(oe,Oe),0<je.length&&(Oe=new W1(Oe,i,null,m,ce),de.push({event:Oe,listeners:je}),Ae?Oe.data=Ae:(Ae=J1(m),Ae!==null&&(Oe.data=Ae)))),(Ae=eL?tL(i,m):nL(i,m))&&(oe=Hc(oe,"onBeforeInput"),0<oe.length&&(ce=new W1("onBeforeInput","beforeinput",null,m,ce),de.push({event:ce,listeners:oe}),ce.data=Ae))}xk(de,l)})}function Ba(i,l,m){return{instance:i,listener:l,currentTarget:m}}function Hc(i,l){for(var m=l+"Capture",x=[];i!==null;){var C=i,j=C.stateNode;C.tag===5&&j!==null&&(C=j,j=pt(i,m),j!=null&&x.unshift(Ba(i,j,C)),j=pt(i,l),j!=null&&x.push(Ba(i,j,C))),i=i.return}return x}function ai(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function bk(i,l,m,x,C){for(var j=l._reactName,R=[];m!==null&&m!==x;){var G=m,Q=G.alternate,oe=G.stateNode;if(Q!==null&&Q===x)break;G.tag===5&&oe!==null&&(G=oe,C?(Q=pt(m,j),Q!=null&&R.unshift(Ba(m,Q,G))):C||(Q=pt(m,j),Q!=null&&R.push(Ba(m,Q,G)))),m=m.return}R.length!==0&&i.push({event:l,listeners:R})}var gL=/\r\n?/g,yL=/\u0000|\uFFFD/g;function wk(i){return(typeof i=="string"?i:""+i).replace(gL,`
|
|
38
|
+
`).replace(yL,"")}function Uc(i,l,m){if(l=wk(l),wk(i)!==l&&m)throw Error(n(425))}function Wc(){}var Dh=null,$h=null;function Fh(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Bh=typeof setTimeout=="function"?setTimeout:void 0,xL=typeof clearTimeout=="function"?clearTimeout:void 0,kk=typeof Promise=="function"?Promise:void 0,vL=typeof queueMicrotask=="function"?queueMicrotask:typeof kk<"u"?function(i){return kk.resolve(null).then(i).catch(bL)}:Bh;function bL(i){setTimeout(function(){throw i})}function qh(i,l){var m=l,x=0;do{var C=m.nextSibling;if(i.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(x===0){i.removeChild(C),Ta(l);return}x--}else m!=="$"&&m!=="$?"&&m!=="$!"||x++;m=C}while(m);Ta(l)}function Cs(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function Nk(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var m=i.data;if(m==="$"||m==="$!"||m==="$?"){if(l===0)return i;l--}else m==="/$"&&l++}i=i.previousSibling}return null}var li=Math.random().toString(36).slice(2),Sr="__reactFiber$"+li,qa="__reactProps$"+li,Yr="__reactContainer$"+li,zh="__reactEvents$"+li,wL="__reactListeners$"+li,kL="__reactHandles$"+li;function lo(i){var l=i[Sr];if(l)return l;for(var m=i.parentNode;m;){if(l=m[Yr]||m[Sr]){if(m=l.alternate,l.child!==null||m!==null&&m.child!==null)for(i=Nk(i);i!==null;){if(m=i[Sr])return m;i=Nk(i)}return l}i=m,m=i.parentNode}return null}function za(i){return i=i[Sr]||i[Yr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function ci(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Kc(i){return i[qa]||null}var Vh=[],ui=-1;function _s(i){return{current:i}}function rt(i){0>ui||(i.current=Vh[ui],Vh[ui]=null,ui--)}function Ze(i,l){ui++,Vh[ui]=i.current,i.current=l}var Es={},Ut=_s(Es),dn=_s(!1),co=Es;function di(i,l){var m=i.type.contextTypes;if(!m)return Es;var x=i.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===l)return x.__reactInternalMemoizedMaskedChildContext;var C={},j;for(j in m)C[j]=l[j];return x&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=C),C}function fn(i){return i=i.childContextTypes,i!=null}function Gc(){rt(dn),rt(Ut)}function Sk(i,l,m){if(Ut.current!==Es)throw Error(n(168));Ze(Ut,l),Ze(dn,m)}function Ck(i,l,m){var x=i.stateNode;if(l=l.childContextTypes,typeof x.getChildContext!="function")return m;x=x.getChildContext();for(var C in x)if(!(C in l))throw Error(n(108,ne(i)||"Unknown",C));return Y({},m,x)}function Yc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Es,co=Ut.current,Ze(Ut,i),Ze(dn,dn.current),!0}function _k(i,l,m){var x=i.stateNode;if(!x)throw Error(n(169));m?(i=Ck(i,l,co),x.__reactInternalMemoizedMergedChildContext=i,rt(dn),rt(Ut),Ze(Ut,i)):rt(dn),Ze(dn,m)}var Xr=null,Xc=!1,Hh=!1;function Ek(i){Xr===null?Xr=[i]:Xr.push(i)}function NL(i){Xc=!0,Ek(i)}function js(){if(!Hh&&Xr!==null){Hh=!0;var i=0,l=Qe;try{var m=Xr;for(Qe=1;i<m.length;i++){var x=m[i];do x=x(!0);while(x!==null)}Xr=null,Xc=!1}catch(C){throw Xr!==null&&(Xr=Xr.slice(i+1)),Cc(Na,js),C}finally{Qe=l,Hh=!1}}return null}var fi=[],hi=0,Qc=null,Jc=0,Ln=[],Dn=0,uo=null,Qr=1,Jr="";function fo(i,l){fi[hi++]=Jc,fi[hi++]=Qc,Qc=i,Jc=l}function jk(i,l,m){Ln[Dn++]=Qr,Ln[Dn++]=Jr,Ln[Dn++]=uo,uo=i;var x=Qr;i=Jr;var C=32-wn(x)-1;x&=~(1<<C),m+=1;var j=32-wn(l)+C;if(30<j){var R=C-C%5;j=(x&(1<<R)-1).toString(32),x>>=R,C-=R,Qr=1<<32-wn(l)+C|m<<C|x,Jr=j+i}else Qr=1<<j|m<<C|x,Jr=i}function Uh(i){i.return!==null&&(fo(i,1),jk(i,1,0))}function Wh(i){for(;i===Qc;)Qc=fi[--hi],fi[hi]=null,Jc=fi[--hi],fi[hi]=null;for(;i===uo;)uo=Ln[--Dn],Ln[Dn]=null,Jr=Ln[--Dn],Ln[Dn]=null,Qr=Ln[--Dn],Ln[Dn]=null}var Nn=null,Sn=null,it=!1,Zn=null;function Ak(i,l){var m=qn(5,null,null,0);m.elementType="DELETED",m.stateNode=l,m.return=i,l=i.deletions,l===null?(i.deletions=[m],i.flags|=16):l.push(m)}function Tk(i,l){switch(i.tag){case 5:var m=i.type;return l=l.nodeType!==1||m.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,Nn=i,Sn=Cs(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,Nn=i,Sn=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(m=uo!==null?{id:Qr,overflow:Jr}:null,i.memoizedState={dehydrated:l,treeContext:m,retryLane:1073741824},m=qn(18,null,null,0),m.stateNode=l,m.return=i,i.child=m,Nn=i,Sn=null,!0):!1;default:return!1}}function Kh(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Gh(i){if(it){var l=Sn;if(l){var m=l;if(!Tk(i,l)){if(Kh(i))throw Error(n(418));l=Cs(m.nextSibling);var x=Nn;l&&Tk(i,l)?Ak(x,m):(i.flags=i.flags&-4097|2,it=!1,Nn=i)}}else{if(Kh(i))throw Error(n(418));i.flags=i.flags&-4097|2,it=!1,Nn=i}}}function Ik(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Nn=i}function Zc(i){if(i!==Nn)return!1;if(!it)return Ik(i),it=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!Fh(i.type,i.memoizedProps)),l&&(l=Sn)){if(Kh(i))throw Mk(),Error(n(418));for(;l;)Ak(i,l),l=Cs(l.nextSibling)}if(Ik(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var m=i.data;if(m==="/$"){if(l===0){Sn=Cs(i.nextSibling);break e}l--}else m!=="$"&&m!=="$!"&&m!=="$?"||l++}i=i.nextSibling}Sn=null}}else Sn=Nn?Cs(i.stateNode.nextSibling):null;return!0}function Mk(){for(var i=Sn;i;)i=Cs(i.nextSibling)}function pi(){Sn=Nn=null,it=!1}function Yh(i){Zn===null?Zn=[i]:Zn.push(i)}var SL=S.ReactCurrentBatchConfig;function Va(i,l,m){if(i=m.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var x=m.stateNode}if(!x)throw Error(n(147,i));var C=x,j=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===j?l.ref:(l=function(R){var G=C.refs;R===null?delete G[j]:G[j]=R},l._stringRef=j,l)}if(typeof i!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,i))}return i}function eu(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function Rk(i){var l=i._init;return l(i._payload)}function Ok(i){function l(re,J){if(i){var se=re.deletions;se===null?(re.deletions=[J],re.flags|=16):se.push(J)}}function m(re,J){if(!i)return null;for(;J!==null;)l(re,J),J=J.sibling;return null}function x(re,J){for(re=new Map;J!==null;)J.key!==null?re.set(J.key,J):re.set(J.index,J),J=J.sibling;return re}function C(re,J){return re=Ls(re,J),re.index=0,re.sibling=null,re}function j(re,J,se){return re.index=se,i?(se=re.alternate,se!==null?(se=se.index,se<J?(re.flags|=2,J):se):(re.flags|=2,J)):(re.flags|=1048576,J)}function R(re){return i&&re.alternate===null&&(re.flags|=2),re}function G(re,J,se,fe){return J===null||J.tag!==6?(J=Bp(se,re.mode,fe),J.return=re,J):(J=C(J,se),J.return=re,J)}function Q(re,J,se,fe){var Ee=se.type;return Ee===T?ce(re,J,se.props.children,fe,se.key):J!==null&&(J.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===$&&Rk(Ee)===J.type)?(fe=C(J,se.props),fe.ref=Va(re,J,se),fe.return=re,fe):(fe=Su(se.type,se.key,se.props,null,re.mode,fe),fe.ref=Va(re,J,se),fe.return=re,fe)}function oe(re,J,se,fe){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=qp(se,re.mode,fe),J.return=re,J):(J=C(J,se.children||[]),J.return=re,J)}function ce(re,J,se,fe,Ee){return J===null||J.tag!==7?(J=bo(se,re.mode,fe,Ee),J.return=re,J):(J=C(J,se),J.return=re,J)}function de(re,J,se){if(typeof J=="string"&&J!==""||typeof J=="number")return J=Bp(""+J,re.mode,se),J.return=re,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return se=Su(J.type,J.key,J.props,null,re.mode,se),se.ref=Va(re,null,J),se.return=re,se;case I:return J=qp(J,re.mode,se),J.return=re,J;case $:var fe=J._init;return de(re,fe(J._payload),se)}if(_t(J)||q(J))return J=bo(J,re.mode,se,null),J.return=re,J;eu(re,J)}return null}function le(re,J,se,fe){var Ee=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Ee!==null?null:G(re,J,""+se,fe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case A:return se.key===Ee?Q(re,J,se,fe):null;case I:return se.key===Ee?oe(re,J,se,fe):null;case $:return Ee=se._init,le(re,J,Ee(se._payload),fe)}if(_t(se)||q(se))return Ee!==null?null:ce(re,J,se,fe,null);eu(re,se)}return null}function be(re,J,se,fe,Ee){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return re=re.get(se)||null,G(J,re,""+fe,Ee);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case A:return re=re.get(fe.key===null?se:fe.key)||null,Q(J,re,fe,Ee);case I:return re=re.get(fe.key===null?se:fe.key)||null,oe(J,re,fe,Ee);case $:var je=fe._init;return be(re,J,se,je(fe._payload),Ee)}if(_t(fe)||q(fe))return re=re.get(se)||null,ce(J,re,fe,Ee,null);eu(J,fe)}return null}function Se(re,J,se,fe){for(var Ee=null,je=null,Ae=J,Oe=J=0,$t=null;Ae!==null&&Oe<se.length;Oe++){Ae.index>Oe?($t=Ae,Ae=null):$t=Ae.sibling;var Ge=le(re,Ae,se[Oe],fe);if(Ge===null){Ae===null&&(Ae=$t);break}i&&Ae&&Ge.alternate===null&&l(re,Ae),J=j(Ge,J,Oe),je===null?Ee=Ge:je.sibling=Ge,je=Ge,Ae=$t}if(Oe===se.length)return m(re,Ae),it&&fo(re,Oe),Ee;if(Ae===null){for(;Oe<se.length;Oe++)Ae=de(re,se[Oe],fe),Ae!==null&&(J=j(Ae,J,Oe),je===null?Ee=Ae:je.sibling=Ae,je=Ae);return it&&fo(re,Oe),Ee}for(Ae=x(re,Ae);Oe<se.length;Oe++)$t=be(Ae,re,Oe,se[Oe],fe),$t!==null&&(i&&$t.alternate!==null&&Ae.delete($t.key===null?Oe:$t.key),J=j($t,J,Oe),je===null?Ee=$t:je.sibling=$t,je=$t);return i&&Ae.forEach(function(Ds){return l(re,Ds)}),it&&fo(re,Oe),Ee}function Ce(re,J,se,fe){var Ee=q(se);if(typeof Ee!="function")throw Error(n(150));if(se=Ee.call(se),se==null)throw Error(n(151));for(var je=Ee=null,Ae=J,Oe=J=0,$t=null,Ge=se.next();Ae!==null&&!Ge.done;Oe++,Ge=se.next()){Ae.index>Oe?($t=Ae,Ae=null):$t=Ae.sibling;var Ds=le(re,Ae,Ge.value,fe);if(Ds===null){Ae===null&&(Ae=$t);break}i&&Ae&&Ds.alternate===null&&l(re,Ae),J=j(Ds,J,Oe),je===null?Ee=Ds:je.sibling=Ds,je=Ds,Ae=$t}if(Ge.done)return m(re,Ae),it&&fo(re,Oe),Ee;if(Ae===null){for(;!Ge.done;Oe++,Ge=se.next())Ge=de(re,Ge.value,fe),Ge!==null&&(J=j(Ge,J,Oe),je===null?Ee=Ge:je.sibling=Ge,je=Ge);return it&&fo(re,Oe),Ee}for(Ae=x(re,Ae);!Ge.done;Oe++,Ge=se.next())Ge=be(Ae,re,Oe,Ge.value,fe),Ge!==null&&(i&&Ge.alternate!==null&&Ae.delete(Ge.key===null?Oe:Ge.key),J=j(Ge,J,Oe),je===null?Ee=Ge:je.sibling=Ge,je=Ge);return i&&Ae.forEach(function(rD){return l(re,rD)}),it&&fo(re,Oe),Ee}function gt(re,J,se,fe){if(typeof se=="object"&&se!==null&&se.type===T&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case A:e:{for(var Ee=se.key,je=J;je!==null;){if(je.key===Ee){if(Ee=se.type,Ee===T){if(je.tag===7){m(re,je.sibling),J=C(je,se.props.children),J.return=re,re=J;break e}}else if(je.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===$&&Rk(Ee)===je.type){m(re,je.sibling),J=C(je,se.props),J.ref=Va(re,je,se),J.return=re,re=J;break e}m(re,je);break}else l(re,je);je=je.sibling}se.type===T?(J=bo(se.props.children,re.mode,fe,se.key),J.return=re,re=J):(fe=Su(se.type,se.key,se.props,null,re.mode,fe),fe.ref=Va(re,J,se),fe.return=re,re=fe)}return R(re);case I:e:{for(je=se.key;J!==null;){if(J.key===je)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){m(re,J.sibling),J=C(J,se.children||[]),J.return=re,re=J;break e}else{m(re,J);break}else l(re,J);J=J.sibling}J=qp(se,re.mode,fe),J.return=re,re=J}return R(re);case $:return je=se._init,gt(re,J,je(se._payload),fe)}if(_t(se))return Se(re,J,se,fe);if(q(se))return Ce(re,J,se,fe);eu(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,J!==null&&J.tag===6?(m(re,J.sibling),J=C(J,se),J.return=re,re=J):(m(re,J),J=Bp(se,re.mode,fe),J.return=re,re=J),R(re)):m(re,J)}return gt}var mi=Ok(!0),Pk=Ok(!1),tu=_s(null),nu=null,gi=null,Xh=null;function Qh(){Xh=gi=nu=null}function Jh(i){var l=tu.current;rt(tu),i._currentValue=l}function Zh(i,l,m){for(;i!==null;){var x=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,x!==null&&(x.childLanes|=l)):x!==null&&(x.childLanes&l)!==l&&(x.childLanes|=l),i===m)break;i=i.return}}function yi(i,l){nu=i,Xh=gi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(hn=!0),i.firstContext=null)}function $n(i){var l=i._currentValue;if(Xh!==i)if(i={context:i,memoizedValue:l,next:null},gi===null){if(nu===null)throw Error(n(308));gi=i,nu.dependencies={lanes:0,firstContext:i}}else gi=gi.next=i;return l}var ho=null;function ep(i){ho===null?ho=[i]:ho.push(i)}function Lk(i,l,m,x){var C=l.interleaved;return C===null?(m.next=m,ep(l)):(m.next=C.next,C.next=m),l.interleaved=m,Zr(i,x)}function Zr(i,l){i.lanes|=l;var m=i.alternate;for(m!==null&&(m.lanes|=l),m=i,i=i.return;i!==null;)i.childLanes|=l,m=i.alternate,m!==null&&(m.childLanes|=l),m=i,i=i.return;return m.tag===3?m.stateNode:null}var As=!1;function tp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Dk(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function es(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function Ts(i,l,m){var x=i.updateQueue;if(x===null)return null;if(x=x.shared,(We&2)!==0){var C=x.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),x.pending=l,Zr(i,m)}return C=x.interleaved,C===null?(l.next=l,ep(x)):(l.next=C.next,C.next=l),x.interleaved=l,Zr(i,m)}function ru(i,l,m){if(l=l.updateQueue,l!==null&&(l=l.shared,(m&4194240)!==0)){var x=l.lanes;x&=i.pendingLanes,m|=x,l.lanes=m,mh(i,m)}}function $k(i,l){var m=i.updateQueue,x=i.alternate;if(x!==null&&(x=x.updateQueue,m===x)){var C=null,j=null;if(m=m.firstBaseUpdate,m!==null){do{var R={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};j===null?C=j=R:j=j.next=R,m=m.next}while(m!==null);j===null?C=j=l:j=j.next=l}else C=j=l;m={baseState:x.baseState,firstBaseUpdate:C,lastBaseUpdate:j,shared:x.shared,effects:x.effects},i.updateQueue=m;return}i=m.lastBaseUpdate,i===null?m.firstBaseUpdate=l:i.next=l,m.lastBaseUpdate=l}function su(i,l,m,x){var C=i.updateQueue;As=!1;var j=C.firstBaseUpdate,R=C.lastBaseUpdate,G=C.shared.pending;if(G!==null){C.shared.pending=null;var Q=G,oe=Q.next;Q.next=null,R===null?j=oe:R.next=oe,R=Q;var ce=i.alternate;ce!==null&&(ce=ce.updateQueue,G=ce.lastBaseUpdate,G!==R&&(G===null?ce.firstBaseUpdate=oe:G.next=oe,ce.lastBaseUpdate=Q))}if(j!==null){var de=C.baseState;R=0,ce=oe=Q=null,G=j;do{var le=G.lane,be=G.eventTime;if((x&le)===le){ce!==null&&(ce=ce.next={eventTime:be,lane:0,tag:G.tag,payload:G.payload,callback:G.callback,next:null});e:{var Se=i,Ce=G;switch(le=l,be=m,Ce.tag){case 1:if(Se=Ce.payload,typeof Se=="function"){de=Se.call(be,de,le);break e}de=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ce.payload,le=typeof Se=="function"?Se.call(be,de,le):Se,le==null)break e;de=Y({},de,le);break e;case 2:As=!0}}G.callback!==null&&G.lane!==0&&(i.flags|=64,le=C.effects,le===null?C.effects=[G]:le.push(G))}else be={eventTime:be,lane:le,tag:G.tag,payload:G.payload,callback:G.callback,next:null},ce===null?(oe=ce=be,Q=de):ce=ce.next=be,R|=le;if(G=G.next,G===null){if(G=C.shared.pending,G===null)break;le=G,G=le.next,le.next=null,C.lastBaseUpdate=le,C.shared.pending=null}}while(!0);if(ce===null&&(Q=de),C.baseState=Q,C.firstBaseUpdate=oe,C.lastBaseUpdate=ce,l=C.shared.interleaved,l!==null){C=l;do R|=C.lane,C=C.next;while(C!==l)}else j===null&&(C.shared.lanes=0);go|=R,i.lanes=R,i.memoizedState=de}}function Fk(i,l,m){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var x=i[l],C=x.callback;if(C!==null){if(x.callback=null,x=m,typeof C!="function")throw Error(n(191,C));C.call(x)}}}var Ha={},Cr=_s(Ha),Ua=_s(Ha),Wa=_s(Ha);function po(i){if(i===Ha)throw Error(n(174));return i}function np(i,l){switch(Ze(Wa,l),Ze(Ua,i),Ze(Cr,Ha),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:ot(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=ot(l,i)}rt(Cr),Ze(Cr,l)}function xi(){rt(Cr),rt(Ua),rt(Wa)}function Bk(i){po(Wa.current);var l=po(Cr.current),m=ot(l,i.type);l!==m&&(Ze(Ua,i),Ze(Cr,m))}function rp(i){Ua.current===i&&(rt(Cr),rt(Ua))}var ft=_s(0);function ou(i){for(var l=i;l!==null;){if(l.tag===13){var m=l.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var sp=[];function op(){for(var i=0;i<sp.length;i++)sp[i]._workInProgressVersionPrimary=null;sp.length=0}var iu=S.ReactCurrentDispatcher,ip=S.ReactCurrentBatchConfig,mo=0,ht=null,At=null,Lt=null,au=!1,Ka=!1,Ga=0,CL=0;function Wt(){throw Error(n(321))}function ap(i,l){if(l===null)return!1;for(var m=0;m<l.length&&m<i.length;m++)if(!Jn(i[m],l[m]))return!1;return!0}function lp(i,l,m,x,C,j){if(mo=j,ht=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,iu.current=i===null||i.memoizedState===null?AL:TL,i=m(x,C),Ka){j=0;do{if(Ka=!1,Ga=0,25<=j)throw Error(n(301));j+=1,Lt=At=null,l.updateQueue=null,iu.current=IL,i=m(x,C)}while(Ka)}if(iu.current=uu,l=At!==null&&At.next!==null,mo=0,Lt=At=ht=null,au=!1,l)throw Error(n(300));return i}function cp(){var i=Ga!==0;return Ga=0,i}function _r(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ht.memoizedState=Lt=i:Lt=Lt.next=i,Lt}function Fn(){if(At===null){var i=ht.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var l=Lt===null?ht.memoizedState:Lt.next;if(l!==null)Lt=l,At=i;else{if(i===null)throw Error(n(310));At=i,i={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Lt===null?ht.memoizedState=Lt=i:Lt=Lt.next=i}return Lt}function Ya(i,l){return typeof l=="function"?l(i):l}function up(i){var l=Fn(),m=l.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=i;var x=At,C=x.baseQueue,j=m.pending;if(j!==null){if(C!==null){var R=C.next;C.next=j.next,j.next=R}x.baseQueue=C=j,m.pending=null}if(C!==null){j=C.next,x=x.baseState;var G=R=null,Q=null,oe=j;do{var ce=oe.lane;if((mo&ce)===ce)Q!==null&&(Q=Q.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),x=oe.hasEagerState?oe.eagerState:i(x,oe.action);else{var de={lane:ce,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};Q===null?(G=Q=de,R=x):Q=Q.next=de,ht.lanes|=ce,go|=ce}oe=oe.next}while(oe!==null&&oe!==j);Q===null?R=x:Q.next=G,Jn(x,l.memoizedState)||(hn=!0),l.memoizedState=x,l.baseState=R,l.baseQueue=Q,m.lastRenderedState=x}if(i=m.interleaved,i!==null){C=i;do j=C.lane,ht.lanes|=j,go|=j,C=C.next;while(C!==i)}else C===null&&(m.lanes=0);return[l.memoizedState,m.dispatch]}function dp(i){var l=Fn(),m=l.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=i;var x=m.dispatch,C=m.pending,j=l.memoizedState;if(C!==null){m.pending=null;var R=C=C.next;do j=i(j,R.action),R=R.next;while(R!==C);Jn(j,l.memoizedState)||(hn=!0),l.memoizedState=j,l.baseQueue===null&&(l.baseState=j),m.lastRenderedState=j}return[j,x]}function qk(){}function zk(i,l){var m=ht,x=Fn(),C=l(),j=!Jn(x.memoizedState,C);if(j&&(x.memoizedState=C,hn=!0),x=x.queue,fp(Uk.bind(null,m,x,i),[i]),x.getSnapshot!==l||j||Lt!==null&&Lt.memoizedState.tag&1){if(m.flags|=2048,Xa(9,Hk.bind(null,m,x,C,l),void 0,null),Dt===null)throw Error(n(349));(mo&30)!==0||Vk(m,l,C)}return C}function Vk(i,l,m){i.flags|=16384,i={getSnapshot:l,value:m},l=ht.updateQueue,l===null?(l={lastEffect:null,stores:null},ht.updateQueue=l,l.stores=[i]):(m=l.stores,m===null?l.stores=[i]:m.push(i))}function Hk(i,l,m,x){l.value=m,l.getSnapshot=x,Wk(l)&&Kk(i)}function Uk(i,l,m){return m(function(){Wk(l)&&Kk(i)})}function Wk(i){var l=i.getSnapshot;i=i.value;try{var m=l();return!Jn(i,m)}catch{return!0}}function Kk(i){var l=Zr(i,1);l!==null&&rr(l,i,1,-1)}function Gk(i){var l=_r();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ya,lastRenderedState:i},l.queue=i,i=i.dispatch=jL.bind(null,ht,i),[l.memoizedState,i]}function Xa(i,l,m,x){return i={tag:i,create:l,destroy:m,deps:x,next:null},l=ht.updateQueue,l===null?(l={lastEffect:null,stores:null},ht.updateQueue=l,l.lastEffect=i.next=i):(m=l.lastEffect,m===null?l.lastEffect=i.next=i:(x=m.next,m.next=i,i.next=x,l.lastEffect=i)),i}function Yk(){return Fn().memoizedState}function lu(i,l,m,x){var C=_r();ht.flags|=i,C.memoizedState=Xa(1|l,m,void 0,x===void 0?null:x)}function cu(i,l,m,x){var C=Fn();x=x===void 0?null:x;var j=void 0;if(At!==null){var R=At.memoizedState;if(j=R.destroy,x!==null&&ap(x,R.deps)){C.memoizedState=Xa(l,m,j,x);return}}ht.flags|=i,C.memoizedState=Xa(1|l,m,j,x)}function Xk(i,l){return lu(8390656,8,i,l)}function fp(i,l){return cu(2048,8,i,l)}function Qk(i,l){return cu(4,2,i,l)}function Jk(i,l){return cu(4,4,i,l)}function Zk(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function eN(i,l,m){return m=m!=null?m.concat([i]):null,cu(4,4,Zk.bind(null,l,i),m)}function hp(){}function tN(i,l){var m=Fn();l=l===void 0?null:l;var x=m.memoizedState;return x!==null&&l!==null&&ap(l,x[1])?x[0]:(m.memoizedState=[i,l],i)}function nN(i,l){var m=Fn();l=l===void 0?null:l;var x=m.memoizedState;return x!==null&&l!==null&&ap(l,x[1])?x[0]:(i=i(),m.memoizedState=[i,l],i)}function rN(i,l,m){return(mo&21)===0?(i.baseState&&(i.baseState=!1,hn=!0),i.memoizedState=m):(Jn(m,l)||(m=ti(),ht.lanes|=m,go|=m,i.baseState=!0),l)}function _L(i,l){var m=Qe;Qe=m!==0&&4>m?m:4,i(!0);var x=ip.transition;ip.transition={};try{i(!1),l()}finally{Qe=m,ip.transition=x}}function sN(){return Fn().memoizedState}function EL(i,l,m){var x=Os(i);if(m={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null},oN(i))iN(l,m);else if(m=Lk(i,l,m,x),m!==null){var C=nn();rr(m,i,x,C),aN(m,l,x)}}function jL(i,l,m){var x=Os(i),C={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null};if(oN(i))iN(l,C);else{var j=i.alternate;if(i.lanes===0&&(j===null||j.lanes===0)&&(j=l.lastRenderedReducer,j!==null))try{var R=l.lastRenderedState,G=j(R,m);if(C.hasEagerState=!0,C.eagerState=G,Jn(G,R)){var Q=l.interleaved;Q===null?(C.next=C,ep(l)):(C.next=Q.next,Q.next=C),l.interleaved=C;return}}catch{}finally{}m=Lk(i,l,C,x),m!==null&&(C=nn(),rr(m,i,x,C),aN(m,l,x))}}function oN(i){var l=i.alternate;return i===ht||l!==null&&l===ht}function iN(i,l){Ka=au=!0;var m=i.pending;m===null?l.next=l:(l.next=m.next,m.next=l),i.pending=l}function aN(i,l,m){if((m&4194240)!==0){var x=l.lanes;x&=i.pendingLanes,m|=x,l.lanes=m,mh(i,m)}}var uu={readContext:$n,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},AL={readContext:$n,useCallback:function(i,l){return _r().memoizedState=[i,l===void 0?null:l],i},useContext:$n,useEffect:Xk,useImperativeHandle:function(i,l,m){return m=m!=null?m.concat([i]):null,lu(4194308,4,Zk.bind(null,l,i),m)},useLayoutEffect:function(i,l){return lu(4194308,4,i,l)},useInsertionEffect:function(i,l){return lu(4,2,i,l)},useMemo:function(i,l){var m=_r();return l=l===void 0?null:l,i=i(),m.memoizedState=[i,l],i},useReducer:function(i,l,m){var x=_r();return l=m!==void 0?m(l):l,x.memoizedState=x.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},x.queue=i,i=i.dispatch=EL.bind(null,ht,i),[x.memoizedState,i]},useRef:function(i){var l=_r();return i={current:i},l.memoizedState=i},useState:Gk,useDebugValue:hp,useDeferredValue:function(i){return _r().memoizedState=i},useTransition:function(){var i=Gk(!1),l=i[0];return i=_L.bind(null,i[1]),_r().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,m){var x=ht,C=_r();if(it){if(m===void 0)throw Error(n(407));m=m()}else{if(m=l(),Dt===null)throw Error(n(349));(mo&30)!==0||Vk(x,l,m)}C.memoizedState=m;var j={value:m,getSnapshot:l};return C.queue=j,Xk(Uk.bind(null,x,j,i),[i]),x.flags|=2048,Xa(9,Hk.bind(null,x,j,m,l),void 0,null),m},useId:function(){var i=_r(),l=Dt.identifierPrefix;if(it){var m=Jr,x=Qr;m=(x&~(1<<32-wn(x)-1)).toString(32)+m,l=":"+l+"R"+m,m=Ga++,0<m&&(l+="H"+m.toString(32)),l+=":"}else m=CL++,l=":"+l+"r"+m.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},TL={readContext:$n,useCallback:tN,useContext:$n,useEffect:fp,useImperativeHandle:eN,useInsertionEffect:Qk,useLayoutEffect:Jk,useMemo:nN,useReducer:up,useRef:Yk,useState:function(){return up(Ya)},useDebugValue:hp,useDeferredValue:function(i){var l=Fn();return rN(l,At.memoizedState,i)},useTransition:function(){var i=up(Ya)[0],l=Fn().memoizedState;return[i,l]},useMutableSource:qk,useSyncExternalStore:zk,useId:sN,unstable_isNewReconciler:!1},IL={readContext:$n,useCallback:tN,useContext:$n,useEffect:fp,useImperativeHandle:eN,useInsertionEffect:Qk,useLayoutEffect:Jk,useMemo:nN,useReducer:dp,useRef:Yk,useState:function(){return dp(Ya)},useDebugValue:hp,useDeferredValue:function(i){var l=Fn();return At===null?l.memoizedState=i:rN(l,At.memoizedState,i)},useTransition:function(){var i=dp(Ya)[0],l=Fn().memoizedState;return[i,l]},useMutableSource:qk,useSyncExternalStore:zk,useId:sN,unstable_isNewReconciler:!1};function er(i,l){if(i&&i.defaultProps){l=Y({},l),i=i.defaultProps;for(var m in i)l[m]===void 0&&(l[m]=i[m]);return l}return l}function pp(i,l,m,x){l=i.memoizedState,m=m(x,l),m=m==null?l:Y({},l,m),i.memoizedState=m,i.lanes===0&&(i.updateQueue.baseState=m)}var du={isMounted:function(i){return(i=i._reactInternals)?kr(i)===i:!1},enqueueSetState:function(i,l,m){i=i._reactInternals;var x=nn(),C=Os(i),j=es(x,C);j.payload=l,m!=null&&(j.callback=m),l=Ts(i,j,C),l!==null&&(rr(l,i,C,x),ru(l,i,C))},enqueueReplaceState:function(i,l,m){i=i._reactInternals;var x=nn(),C=Os(i),j=es(x,C);j.tag=1,j.payload=l,m!=null&&(j.callback=m),l=Ts(i,j,C),l!==null&&(rr(l,i,C,x),ru(l,i,C))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var m=nn(),x=Os(i),C=es(m,x);C.tag=2,l!=null&&(C.callback=l),l=Ts(i,C,x),l!==null&&(rr(l,i,x,m),ru(l,i,x))}};function lN(i,l,m,x,C,j,R){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(x,j,R):l.prototype&&l.prototype.isPureReactComponent?!La(m,x)||!La(C,j):!0}function cN(i,l,m){var x=!1,C=Es,j=l.contextType;return typeof j=="object"&&j!==null?j=$n(j):(C=fn(l)?co:Ut.current,x=l.contextTypes,j=(x=x!=null)?di(i,C):Es),l=new l(m,j),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=du,i.stateNode=l,l._reactInternals=i,x&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=C,i.__reactInternalMemoizedMaskedChildContext=j),l}function uN(i,l,m,x){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(m,x),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(m,x),l.state!==i&&du.enqueueReplaceState(l,l.state,null)}function mp(i,l,m,x){var C=i.stateNode;C.props=m,C.state=i.memoizedState,C.refs={},tp(i);var j=l.contextType;typeof j=="object"&&j!==null?C.context=$n(j):(j=fn(l)?co:Ut.current,C.context=di(i,j)),C.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(pp(i,l,j,m),C.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(l=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),l!==C.state&&du.enqueueReplaceState(C,C.state,null),su(i,m,C,x),C.state=i.memoizedState),typeof C.componentDidMount=="function"&&(i.flags|=4194308)}function vi(i,l){try{var m="",x=l;do m+=X(x),x=x.return;while(x);var C=m}catch(j){C=`
|
|
39
|
+
Error generating stack: `+j.message+`
|
|
40
|
+
`+j.stack}return{value:i,source:l,stack:C,digest:null}}function gp(i,l,m){return{value:i,source:null,stack:m??null,digest:l??null}}function yp(i,l){try{console.error(l.value)}catch(m){setTimeout(function(){throw m})}}var ML=typeof WeakMap=="function"?WeakMap:Map;function dN(i,l,m){m=es(-1,m),m.tag=3,m.payload={element:null};var x=l.value;return m.callback=function(){xu||(xu=!0,Mp=x),yp(i,l)},m}function fN(i,l,m){m=es(-1,m),m.tag=3;var x=i.type.getDerivedStateFromError;if(typeof x=="function"){var C=l.value;m.payload=function(){return x(C)},m.callback=function(){yp(i,l)}}var j=i.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(m.callback=function(){yp(i,l),typeof x!="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var R=l.stack;this.componentDidCatch(l.value,{componentStack:R!==null?R:""})}),m}function hN(i,l,m){var x=i.pingCache;if(x===null){x=i.pingCache=new ML;var C=new Set;x.set(l,C)}else C=x.get(l),C===void 0&&(C=new Set,x.set(l,C));C.has(m)||(C.add(m),i=WL.bind(null,i,l,m),l.then(i,i))}function pN(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function mN(i,l,m,x,C){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(l=es(-1,1),l.tag=2,Ts(m,l,1))),m.lanes|=1),i):(i.flags|=65536,i.lanes=C,i)}var RL=S.ReactCurrentOwner,hn=!1;function tn(i,l,m,x){l.child=i===null?Pk(l,null,m,x):mi(l,i.child,m,x)}function gN(i,l,m,x,C){m=m.render;var j=l.ref;return yi(l,C),x=lp(i,l,m,x,j,C),m=cp(),i!==null&&!hn?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~C,ts(i,l,C)):(it&&m&&Uh(l),l.flags|=1,tn(i,l,x,C),l.child)}function yN(i,l,m,x,C){if(i===null){var j=m.type;return typeof j=="function"&&!Fp(j)&&j.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(l.tag=15,l.type=j,xN(i,l,j,x,C)):(i=Su(m.type,null,x,l,l.mode,C),i.ref=l.ref,i.return=l,l.child=i)}if(j=i.child,(i.lanes&C)===0){var R=j.memoizedProps;if(m=m.compare,m=m!==null?m:La,m(R,x)&&i.ref===l.ref)return ts(i,l,C)}return l.flags|=1,i=Ls(j,x),i.ref=l.ref,i.return=l,l.child=i}function xN(i,l,m,x,C){if(i!==null){var j=i.memoizedProps;if(La(j,x)&&i.ref===l.ref)if(hn=!1,l.pendingProps=x=j,(i.lanes&C)!==0)(i.flags&131072)!==0&&(hn=!0);else return l.lanes=i.lanes,ts(i,l,C)}return xp(i,l,m,x,C)}function vN(i,l,m){var x=l.pendingProps,C=x.children,j=i!==null?i.memoizedState:null;if(x.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(wi,Cn),Cn|=m;else{if((m&1073741824)===0)return i=j!==null?j.baseLanes|m:m,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,Ze(wi,Cn),Cn|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=j!==null?j.baseLanes:m,Ze(wi,Cn),Cn|=x}else j!==null?(x=j.baseLanes|m,l.memoizedState=null):x=m,Ze(wi,Cn),Cn|=x;return tn(i,l,C,m),l.child}function bN(i,l){var m=l.ref;(i===null&&m!==null||i!==null&&i.ref!==m)&&(l.flags|=512,l.flags|=2097152)}function xp(i,l,m,x,C){var j=fn(m)?co:Ut.current;return j=di(l,j),yi(l,C),m=lp(i,l,m,x,j,C),x=cp(),i!==null&&!hn?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~C,ts(i,l,C)):(it&&x&&Uh(l),l.flags|=1,tn(i,l,m,C),l.child)}function wN(i,l,m,x,C){if(fn(m)){var j=!0;Yc(l)}else j=!1;if(yi(l,C),l.stateNode===null)hu(i,l),cN(l,m,x),mp(l,m,x,C),x=!0;else if(i===null){var R=l.stateNode,G=l.memoizedProps;R.props=G;var Q=R.context,oe=m.contextType;typeof oe=="object"&&oe!==null?oe=$n(oe):(oe=fn(m)?co:Ut.current,oe=di(l,oe));var ce=m.getDerivedStateFromProps,de=typeof ce=="function"||typeof R.getSnapshotBeforeUpdate=="function";de||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(G!==x||Q!==oe)&&uN(l,R,x,oe),As=!1;var le=l.memoizedState;R.state=le,su(l,x,R,C),Q=l.memoizedState,G!==x||le!==Q||dn.current||As?(typeof ce=="function"&&(pp(l,m,ce,x),Q=l.memoizedState),(G=As||lN(l,m,G,x,le,Q,oe))?(de||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(l.flags|=4194308)):(typeof R.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=x,l.memoizedState=Q),R.props=x,R.state=Q,R.context=oe,x=G):(typeof R.componentDidMount=="function"&&(l.flags|=4194308),x=!1)}else{R=l.stateNode,Dk(i,l),G=l.memoizedProps,oe=l.type===l.elementType?G:er(l.type,G),R.props=oe,de=l.pendingProps,le=R.context,Q=m.contextType,typeof Q=="object"&&Q!==null?Q=$n(Q):(Q=fn(m)?co:Ut.current,Q=di(l,Q));var be=m.getDerivedStateFromProps;(ce=typeof be=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(G!==de||le!==Q)&&uN(l,R,x,Q),As=!1,le=l.memoizedState,R.state=le,su(l,x,R,C);var Se=l.memoizedState;G!==de||le!==Se||dn.current||As?(typeof be=="function"&&(pp(l,m,be,x),Se=l.memoizedState),(oe=As||lN(l,m,oe,x,le,Se,Q)||!1)?(ce||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(x,Se,Q),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(x,Se,Q)),typeof R.componentDidUpdate=="function"&&(l.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof R.componentDidUpdate!="function"||G===i.memoizedProps&&le===i.memoizedState||(l.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||G===i.memoizedProps&&le===i.memoizedState||(l.flags|=1024),l.memoizedProps=x,l.memoizedState=Se),R.props=x,R.state=Se,R.context=Q,x=oe):(typeof R.componentDidUpdate!="function"||G===i.memoizedProps&&le===i.memoizedState||(l.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||G===i.memoizedProps&&le===i.memoizedState||(l.flags|=1024),x=!1)}return vp(i,l,m,x,j,C)}function vp(i,l,m,x,C,j){bN(i,l);var R=(l.flags&128)!==0;if(!x&&!R)return C&&_k(l,m,!1),ts(i,l,j);x=l.stateNode,RL.current=l;var G=R&&typeof m.getDerivedStateFromError!="function"?null:x.render();return l.flags|=1,i!==null&&R?(l.child=mi(l,i.child,null,j),l.child=mi(l,null,G,j)):tn(i,l,G,j),l.memoizedState=x.state,C&&_k(l,m,!0),l.child}function kN(i){var l=i.stateNode;l.pendingContext?Sk(i,l.pendingContext,l.pendingContext!==l.context):l.context&&Sk(i,l.context,!1),np(i,l.containerInfo)}function NN(i,l,m,x,C){return pi(),Yh(C),l.flags|=256,tn(i,l,m,x),l.child}var bp={dehydrated:null,treeContext:null,retryLane:0};function wp(i){return{baseLanes:i,cachePool:null,transitions:null}}function SN(i,l,m){var x=l.pendingProps,C=ft.current,j=!1,R=(l.flags&128)!==0,G;if((G=R)||(G=i!==null&&i.memoizedState===null?!1:(C&2)!==0),G?(j=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(C|=1),Ze(ft,C&1),i===null)return Gh(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(R=x.children,i=x.fallback,j?(x=l.mode,j=l.child,R={mode:"hidden",children:R},(x&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=R):j=Cu(R,x,0,null),i=bo(i,x,m,null),j.return=l,i.return=l,j.sibling=i,l.child=j,l.child.memoizedState=wp(m),l.memoizedState=bp,i):kp(l,R));if(C=i.memoizedState,C!==null&&(G=C.dehydrated,G!==null))return OL(i,l,R,x,G,C,m);if(j){j=x.fallback,R=l.mode,C=i.child,G=C.sibling;var Q={mode:"hidden",children:x.children};return(R&1)===0&&l.child!==C?(x=l.child,x.childLanes=0,x.pendingProps=Q,l.deletions=null):(x=Ls(C,Q),x.subtreeFlags=C.subtreeFlags&14680064),G!==null?j=Ls(G,j):(j=bo(j,R,m,null),j.flags|=2),j.return=l,x.return=l,x.sibling=j,l.child=x,x=j,j=l.child,R=i.child.memoizedState,R=R===null?wp(m):{baseLanes:R.baseLanes|m,cachePool:null,transitions:R.transitions},j.memoizedState=R,j.childLanes=i.childLanes&~m,l.memoizedState=bp,x}return j=i.child,i=j.sibling,x=Ls(j,{mode:"visible",children:x.children}),(l.mode&1)===0&&(x.lanes=m),x.return=l,x.sibling=null,i!==null&&(m=l.deletions,m===null?(l.deletions=[i],l.flags|=16):m.push(i)),l.child=x,l.memoizedState=null,x}function kp(i,l){return l=Cu({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function fu(i,l,m,x){return x!==null&&Yh(x),mi(l,i.child,null,m),i=kp(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function OL(i,l,m,x,C,j,R){if(m)return l.flags&256?(l.flags&=-257,x=gp(Error(n(422))),fu(i,l,R,x)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(j=x.fallback,C=l.mode,x=Cu({mode:"visible",children:x.children},C,0,null),j=bo(j,C,R,null),j.flags|=2,x.return=l,j.return=l,x.sibling=j,l.child=x,(l.mode&1)!==0&&mi(l,i.child,null,R),l.child.memoizedState=wp(R),l.memoizedState=bp,j);if((l.mode&1)===0)return fu(i,l,R,null);if(C.data==="$!"){if(x=C.nextSibling&&C.nextSibling.dataset,x)var G=x.dgst;return x=G,j=Error(n(419)),x=gp(j,x,void 0),fu(i,l,R,x)}if(G=(R&i.childLanes)!==0,hn||G){if(x=Dt,x!==null){switch(R&-R){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(x.suspendedLanes|R))!==0?0:C,C!==0&&C!==j.retryLane&&(j.retryLane=C,Zr(i,C),rr(x,i,C,-1))}return $p(),x=gp(Error(n(421))),fu(i,l,R,x)}return C.data==="$?"?(l.flags|=128,l.child=i.child,l=KL.bind(null,i),C._reactRetry=l,null):(i=j.treeContext,Sn=Cs(C.nextSibling),Nn=l,it=!0,Zn=null,i!==null&&(Ln[Dn++]=Qr,Ln[Dn++]=Jr,Ln[Dn++]=uo,Qr=i.id,Jr=i.overflow,uo=l),l=kp(l,x.children),l.flags|=4096,l)}function CN(i,l,m){i.lanes|=l;var x=i.alternate;x!==null&&(x.lanes|=l),Zh(i.return,l,m)}function Np(i,l,m,x,C){var j=i.memoizedState;j===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:x,tail:m,tailMode:C}:(j.isBackwards=l,j.rendering=null,j.renderingStartTime=0,j.last=x,j.tail=m,j.tailMode=C)}function _N(i,l,m){var x=l.pendingProps,C=x.revealOrder,j=x.tail;if(tn(i,l,x.children,m),x=ft.current,(x&2)!==0)x=x&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&CN(i,m,l);else if(i.tag===19)CN(i,m,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}x&=1}if(Ze(ft,x),(l.mode&1)===0)l.memoizedState=null;else switch(C){case"forwards":for(m=l.child,C=null;m!==null;)i=m.alternate,i!==null&&ou(i)===null&&(C=m),m=m.sibling;m=C,m===null?(C=l.child,l.child=null):(C=m.sibling,m.sibling=null),Np(l,!1,C,m,j);break;case"backwards":for(m=null,C=l.child,l.child=null;C!==null;){if(i=C.alternate,i!==null&&ou(i)===null){l.child=C;break}i=C.sibling,C.sibling=m,m=C,C=i}Np(l,!0,m,null,j);break;case"together":Np(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function hu(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function ts(i,l,m){if(i!==null&&(l.dependencies=i.dependencies),go|=l.lanes,(m&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,m=Ls(i,i.pendingProps),l.child=m,m.return=l;i.sibling!==null;)i=i.sibling,m=m.sibling=Ls(i,i.pendingProps),m.return=l;m.sibling=null}return l.child}function PL(i,l,m){switch(l.tag){case 3:kN(l),pi();break;case 5:Bk(l);break;case 1:fn(l.type)&&Yc(l);break;case 4:np(l,l.stateNode.containerInfo);break;case 10:var x=l.type._context,C=l.memoizedProps.value;Ze(tu,x._currentValue),x._currentValue=C;break;case 13:if(x=l.memoizedState,x!==null)return x.dehydrated!==null?(Ze(ft,ft.current&1),l.flags|=128,null):(m&l.child.childLanes)!==0?SN(i,l,m):(Ze(ft,ft.current&1),i=ts(i,l,m),i!==null?i.sibling:null);Ze(ft,ft.current&1);break;case 19:if(x=(m&l.childLanes)!==0,(i.flags&128)!==0){if(x)return _N(i,l,m);l.flags|=128}if(C=l.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Ze(ft,ft.current),x)break;return null;case 22:case 23:return l.lanes=0,vN(i,l,m)}return ts(i,l,m)}var EN,Sp,jN,AN;EN=function(i,l){for(var m=l.child;m!==null;){if(m.tag===5||m.tag===6)i.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===l)break;for(;m.sibling===null;){if(m.return===null||m.return===l)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},Sp=function(){},jN=function(i,l,m,x){var C=i.memoizedProps;if(C!==x){i=l.stateNode,po(Cr.current);var j=null;switch(m){case"input":C=_e(i,C),x=_e(i,x),j=[];break;case"select":C=Y({},C,{value:void 0}),x=Y({},x,{value:void 0}),j=[];break;case"textarea":C=He(i,C),x=He(i,x),j=[];break;default:typeof C.onClick!="function"&&typeof x.onClick=="function"&&(i.onclick=Wc)}Yn(m,x);var R;m=null;for(oe in C)if(!x.hasOwnProperty(oe)&&C.hasOwnProperty(oe)&&C[oe]!=null)if(oe==="style"){var G=C[oe];for(R in G)G.hasOwnProperty(R)&&(m||(m={}),m[R]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(s.hasOwnProperty(oe)?j||(j=[]):(j=j||[]).push(oe,null));for(oe in x){var Q=x[oe];if(G=C!=null?C[oe]:void 0,x.hasOwnProperty(oe)&&Q!==G&&(Q!=null||G!=null))if(oe==="style")if(G){for(R in G)!G.hasOwnProperty(R)||Q&&Q.hasOwnProperty(R)||(m||(m={}),m[R]="");for(R in Q)Q.hasOwnProperty(R)&&G[R]!==Q[R]&&(m||(m={}),m[R]=Q[R])}else m||(j||(j=[]),j.push(oe,m)),m=Q;else oe==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,G=G?G.__html:void 0,Q!=null&&G!==Q&&(j=j||[]).push(oe,Q)):oe==="children"?typeof Q!="string"&&typeof Q!="number"||(j=j||[]).push(oe,""+Q):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(s.hasOwnProperty(oe)?(Q!=null&&oe==="onScroll"&&nt("scroll",i),j||G===Q||(j=[])):(j=j||[]).push(oe,Q))}m&&(j=j||[]).push("style",m);var oe=j;(l.updateQueue=oe)&&(l.flags|=4)}},AN=function(i,l,m,x){m!==x&&(l.flags|=4)};function Qa(i,l){if(!it)switch(i.tailMode){case"hidden":l=i.tail;for(var m=null;l!==null;)l.alternate!==null&&(m=l),l=l.sibling;m===null?i.tail=null:m.sibling=null;break;case"collapsed":m=i.tail;for(var x=null;m!==null;)m.alternate!==null&&(x=m),m=m.sibling;x===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:x.sibling=null}}function Kt(i){var l=i.alternate!==null&&i.alternate.child===i.child,m=0,x=0;if(l)for(var C=i.child;C!==null;)m|=C.lanes|C.childLanes,x|=C.subtreeFlags&14680064,x|=C.flags&14680064,C.return=i,C=C.sibling;else for(C=i.child;C!==null;)m|=C.lanes|C.childLanes,x|=C.subtreeFlags,x|=C.flags,C.return=i,C=C.sibling;return i.subtreeFlags|=x,i.childLanes=m,l}function LL(i,l,m){var x=l.pendingProps;switch(Wh(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(l),null;case 1:return fn(l.type)&&Gc(),Kt(l),null;case 3:return x=l.stateNode,xi(),rt(dn),rt(Ut),op(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(i===null||i.child===null)&&(Zc(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Zn!==null&&(Pp(Zn),Zn=null))),Sp(i,l),Kt(l),null;case 5:rp(l);var C=po(Wa.current);if(m=l.type,i!==null&&l.stateNode!=null)jN(i,l,m,x,C),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!x){if(l.stateNode===null)throw Error(n(166));return Kt(l),null}if(i=po(Cr.current),Zc(l)){x=l.stateNode,m=l.type;var j=l.memoizedProps;switch(x[Sr]=l,x[qa]=j,i=(l.mode&1)!==0,m){case"dialog":nt("cancel",x),nt("close",x);break;case"iframe":case"object":case"embed":nt("load",x);break;case"video":case"audio":for(C=0;C<$a.length;C++)nt($a[C],x);break;case"source":nt("error",x);break;case"img":case"image":case"link":nt("error",x),nt("load",x);break;case"details":nt("toggle",x);break;case"input":we(x,j),nt("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!j.multiple},nt("invalid",x);break;case"textarea":qe(x,j),nt("invalid",x)}Yn(m,j),C=null;for(var R in j)if(j.hasOwnProperty(R)){var G=j[R];R==="children"?typeof G=="string"?x.textContent!==G&&(j.suppressHydrationWarning!==!0&&Uc(x.textContent,G,i),C=["children",G]):typeof G=="number"&&x.textContent!==""+G&&(j.suppressHydrationWarning!==!0&&Uc(x.textContent,G,i),C=["children",""+G]):s.hasOwnProperty(R)&&G!=null&&R==="onScroll"&&nt("scroll",x)}switch(m){case"input":xe(x),Je(x,j,!0);break;case"textarea":xe(x),Mt(x);break;case"select":case"option":break;default:typeof j.onClick=="function"&&(x.onclick=Wc)}x=C,l.updateQueue=x,x!==null&&(l.flags|=4)}else{R=C.nodeType===9?C:C.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Rt(m)),i==="http://www.w3.org/1999/xhtml"?m==="script"?(i=R.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof x.is=="string"?i=R.createElement(m,{is:x.is}):(i=R.createElement(m),m==="select"&&(R=i,x.multiple?R.multiple=!0:x.size&&(R.size=x.size))):i=R.createElementNS(i,m),i[Sr]=l,i[qa]=x,EN(i,l,!1,!1),l.stateNode=i;e:{switch(R=Rn(m,x),m){case"dialog":nt("cancel",i),nt("close",i),C=x;break;case"iframe":case"object":case"embed":nt("load",i),C=x;break;case"video":case"audio":for(C=0;C<$a.length;C++)nt($a[C],i);C=x;break;case"source":nt("error",i),C=x;break;case"img":case"image":case"link":nt("error",i),nt("load",i),C=x;break;case"details":nt("toggle",i),C=x;break;case"input":we(i,x),C=_e(i,x),nt("invalid",i);break;case"option":C=x;break;case"select":i._wrapperState={wasMultiple:!!x.multiple},C=Y({},x,{value:void 0}),nt("invalid",i);break;case"textarea":qe(i,x),C=He(i,x),nt("invalid",i);break;default:C=x}Yn(m,C),G=C;for(j in G)if(G.hasOwnProperty(j)){var Q=G[j];j==="style"?Jt(i,Q):j==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&Qt(i,Q)):j==="children"?typeof Q=="string"?(m!=="textarea"||Q!=="")&&$e(i,Q):typeof Q=="number"&&$e(i,""+Q):j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&j!=="autoFocus"&&(s.hasOwnProperty(j)?Q!=null&&j==="onScroll"&&nt("scroll",i):Q!=null&&N(i,j,Q,R))}switch(m){case"input":xe(i),Je(i,x,!1);break;case"textarea":xe(i),Mt(i);break;case"option":x.value!=null&&i.setAttribute("value",""+te(x.value));break;case"select":i.multiple=!!x.multiple,j=x.value,j!=null?bt(i,!!x.multiple,j,!1):x.defaultValue!=null&&bt(i,!!x.multiple,x.defaultValue,!0);break;default:typeof C.onClick=="function"&&(i.onclick=Wc)}switch(m){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Kt(l),null;case 6:if(i&&l.stateNode!=null)AN(i,l,i.memoizedProps,x);else{if(typeof x!="string"&&l.stateNode===null)throw Error(n(166));if(m=po(Wa.current),po(Cr.current),Zc(l)){if(x=l.stateNode,m=l.memoizedProps,x[Sr]=l,(j=x.nodeValue!==m)&&(i=Nn,i!==null))switch(i.tag){case 3:Uc(x.nodeValue,m,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Uc(x.nodeValue,m,(i.mode&1)!==0)}j&&(l.flags|=4)}else x=(m.nodeType===9?m:m.ownerDocument).createTextNode(x),x[Sr]=l,l.stateNode=x}return Kt(l),null;case 13:if(rt(ft),x=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(it&&Sn!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Mk(),pi(),l.flags|=98560,j=!1;else if(j=Zc(l),x!==null&&x.dehydrated!==null){if(i===null){if(!j)throw Error(n(318));if(j=l.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(n(317));j[Sr]=l}else pi(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Kt(l),j=!1}else Zn!==null&&(Pp(Zn),Zn=null),j=!0;if(!j)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=m,l):(x=x!==null,x!==(i!==null&&i.memoizedState!==null)&&x&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(ft.current&1)!==0?Tt===0&&(Tt=3):$p())),l.updateQueue!==null&&(l.flags|=4),Kt(l),null);case 4:return xi(),Sp(i,l),i===null&&Fa(l.stateNode.containerInfo),Kt(l),null;case 10:return Jh(l.type._context),Kt(l),null;case 17:return fn(l.type)&&Gc(),Kt(l),null;case 19:if(rt(ft),j=l.memoizedState,j===null)return Kt(l),null;if(x=(l.flags&128)!==0,R=j.rendering,R===null)if(x)Qa(j,!1);else{if(Tt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(R=ou(i),R!==null){for(l.flags|=128,Qa(j,!1),x=R.updateQueue,x!==null&&(l.updateQueue=x,l.flags|=4),l.subtreeFlags=0,x=m,m=l.child;m!==null;)j=m,i=x,j.flags&=14680066,R=j.alternate,R===null?(j.childLanes=0,j.lanes=i,j.child=null,j.subtreeFlags=0,j.memoizedProps=null,j.memoizedState=null,j.updateQueue=null,j.dependencies=null,j.stateNode=null):(j.childLanes=R.childLanes,j.lanes=R.lanes,j.child=R.child,j.subtreeFlags=0,j.deletions=null,j.memoizedProps=R.memoizedProps,j.memoizedState=R.memoizedState,j.updateQueue=R.updateQueue,j.type=R.type,i=R.dependencies,j.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),m=m.sibling;return Ze(ft,ft.current&1|2),l.child}i=i.sibling}j.tail!==null&&dt()>ki&&(l.flags|=128,x=!0,Qa(j,!1),l.lanes=4194304)}else{if(!x)if(i=ou(R),i!==null){if(l.flags|=128,x=!0,m=i.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),Qa(j,!0),j.tail===null&&j.tailMode==="hidden"&&!R.alternate&&!it)return Kt(l),null}else 2*dt()-j.renderingStartTime>ki&&m!==1073741824&&(l.flags|=128,x=!0,Qa(j,!1),l.lanes=4194304);j.isBackwards?(R.sibling=l.child,l.child=R):(m=j.last,m!==null?m.sibling=R:l.child=R,j.last=R)}return j.tail!==null?(l=j.tail,j.rendering=l,j.tail=l.sibling,j.renderingStartTime=dt(),l.sibling=null,m=ft.current,Ze(ft,x?m&1|2:m&1),l):(Kt(l),null);case 22:case 23:return Dp(),x=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==x&&(l.flags|=8192),x&&(l.mode&1)!==0?(Cn&1073741824)!==0&&(Kt(l),l.subtreeFlags&6&&(l.flags|=8192)):Kt(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function DL(i,l){switch(Wh(l),l.tag){case 1:return fn(l.type)&&Gc(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return xi(),rt(dn),rt(Ut),op(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return rp(l),null;case 13:if(rt(ft),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));pi()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return rt(ft),null;case 4:return xi(),null;case 10:return Jh(l.type._context),null;case 22:case 23:return Dp(),null;case 24:return null;default:return null}}var pu=!1,Gt=!1,$L=typeof WeakSet=="function"?WeakSet:Set,ke=null;function bi(i,l){var m=i.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(x){mt(i,l,x)}else m.current=null}function Cp(i,l,m){try{m()}catch(x){mt(i,l,x)}}var TN=!1;function FL(i,l){if(Dh=Oc,i=lk(),Ah(i)){if("selectionStart"in i)var m={start:i.selectionStart,end:i.selectionEnd};else e:{m=(m=i.ownerDocument)&&m.defaultView||window;var x=m.getSelection&&m.getSelection();if(x&&x.rangeCount!==0){m=x.anchorNode;var C=x.anchorOffset,j=x.focusNode;x=x.focusOffset;try{m.nodeType,j.nodeType}catch{m=null;break e}var R=0,G=-1,Q=-1,oe=0,ce=0,de=i,le=null;t:for(;;){for(var be;de!==m||C!==0&&de.nodeType!==3||(G=R+C),de!==j||x!==0&&de.nodeType!==3||(Q=R+x),de.nodeType===3&&(R+=de.nodeValue.length),(be=de.firstChild)!==null;)le=de,de=be;for(;;){if(de===i)break t;if(le===m&&++oe===C&&(G=R),le===j&&++ce===x&&(Q=R),(be=de.nextSibling)!==null)break;de=le,le=de.parentNode}de=be}m=G===-1||Q===-1?null:{start:G,end:Q}}else m=null}m=m||{start:0,end:0}}else m=null;for($h={focusedElem:i,selectionRange:m},Oc=!1,ke=l;ke!==null;)if(l=ke,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ke=i;else for(;ke!==null;){l=ke;try{var Se=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ce=Se.memoizedProps,gt=Se.memoizedState,re=l.stateNode,J=re.getSnapshotBeforeUpdate(l.elementType===l.type?Ce:er(l.type,Ce),gt);re.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var se=l.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(fe){mt(l,l.return,fe)}if(i=l.sibling,i!==null){i.return=l.return,ke=i;break}ke=l.return}return Se=TN,TN=!1,Se}function Ja(i,l,m){var x=l.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var C=x=x.next;do{if((C.tag&i)===i){var j=C.destroy;C.destroy=void 0,j!==void 0&&Cp(l,m,j)}C=C.next}while(C!==x)}}function mu(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var m=l=l.next;do{if((m.tag&i)===i){var x=m.create;m.destroy=x()}m=m.next}while(m!==l)}}function _p(i){var l=i.ref;if(l!==null){var m=i.stateNode;switch(i.tag){case 5:i=m;break;default:i=m}typeof l=="function"?l(i):l.current=i}}function IN(i){var l=i.alternate;l!==null&&(i.alternate=null,IN(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[Sr],delete l[qa],delete l[zh],delete l[wL],delete l[kL])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function MN(i){return i.tag===5||i.tag===3||i.tag===4}function RN(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||MN(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Ep(i,l,m){var x=i.tag;if(x===5||x===6)i=i.stateNode,l?m.nodeType===8?m.parentNode.insertBefore(i,l):m.insertBefore(i,l):(m.nodeType===8?(l=m.parentNode,l.insertBefore(i,m)):(l=m,l.appendChild(i)),m=m._reactRootContainer,m!=null||l.onclick!==null||(l.onclick=Wc));else if(x!==4&&(i=i.child,i!==null))for(Ep(i,l,m),i=i.sibling;i!==null;)Ep(i,l,m),i=i.sibling}function jp(i,l,m){var x=i.tag;if(x===5||x===6)i=i.stateNode,l?m.insertBefore(i,l):m.appendChild(i);else if(x!==4&&(i=i.child,i!==null))for(jp(i,l,m),i=i.sibling;i!==null;)jp(i,l,m),i=i.sibling}var Ft=null,tr=!1;function Is(i,l,m){for(m=m.child;m!==null;)ON(i,l,m),m=m.sibling}function ON(i,l,m){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(io,m)}catch{}switch(m.tag){case 5:Gt||bi(m,l);case 6:var x=Ft,C=tr;Ft=null,Is(i,l,m),Ft=x,tr=C,Ft!==null&&(tr?(i=Ft,m=m.stateNode,i.nodeType===8?i.parentNode.removeChild(m):i.removeChild(m)):Ft.removeChild(m.stateNode));break;case 18:Ft!==null&&(tr?(i=Ft,m=m.stateNode,i.nodeType===8?qh(i.parentNode,m):i.nodeType===1&&qh(i,m),Ta(i)):qh(Ft,m.stateNode));break;case 4:x=Ft,C=tr,Ft=m.stateNode.containerInfo,tr=!0,Is(i,l,m),Ft=x,tr=C;break;case 0:case 11:case 14:case 15:if(!Gt&&(x=m.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){C=x=x.next;do{var j=C,R=j.destroy;j=j.tag,R!==void 0&&((j&2)!==0||(j&4)!==0)&&Cp(m,l,R),C=C.next}while(C!==x)}Is(i,l,m);break;case 1:if(!Gt&&(bi(m,l),x=m.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=m.memoizedProps,x.state=m.memoizedState,x.componentWillUnmount()}catch(G){mt(m,l,G)}Is(i,l,m);break;case 21:Is(i,l,m);break;case 22:m.mode&1?(Gt=(x=Gt)||m.memoizedState!==null,Is(i,l,m),Gt=x):Is(i,l,m);break;default:Is(i,l,m)}}function PN(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var m=i.stateNode;m===null&&(m=i.stateNode=new $L),l.forEach(function(x){var C=GL.bind(null,i,x);m.has(x)||(m.add(x),x.then(C,C))})}}function nr(i,l){var m=l.deletions;if(m!==null)for(var x=0;x<m.length;x++){var C=m[x];try{var j=i,R=l,G=R;e:for(;G!==null;){switch(G.tag){case 5:Ft=G.stateNode,tr=!1;break e;case 3:Ft=G.stateNode.containerInfo,tr=!0;break e;case 4:Ft=G.stateNode.containerInfo,tr=!0;break e}G=G.return}if(Ft===null)throw Error(n(160));ON(j,R,C),Ft=null,tr=!1;var Q=C.alternate;Q!==null&&(Q.return=null),C.return=null}catch(oe){mt(C,l,oe)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)LN(l,i),l=l.sibling}function LN(i,l){var m=i.alternate,x=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(nr(l,i),Er(i),x&4){try{Ja(3,i,i.return),mu(3,i)}catch(Ce){mt(i,i.return,Ce)}try{Ja(5,i,i.return)}catch(Ce){mt(i,i.return,Ce)}}break;case 1:nr(l,i),Er(i),x&512&&m!==null&&bi(m,m.return);break;case 5:if(nr(l,i),Er(i),x&512&&m!==null&&bi(m,m.return),i.flags&32){var C=i.stateNode;try{$e(C,"")}catch(Ce){mt(i,i.return,Ce)}}if(x&4&&(C=i.stateNode,C!=null)){var j=i.memoizedProps,R=m!==null?m.memoizedProps:j,G=i.type,Q=i.updateQueue;if(i.updateQueue=null,Q!==null)try{G==="input"&&j.type==="radio"&&j.name!=null&&Te(C,j),Rn(G,R);var oe=Rn(G,j);for(R=0;R<Q.length;R+=2){var ce=Q[R],de=Q[R+1];ce==="style"?Jt(C,de):ce==="dangerouslySetInnerHTML"?Qt(C,de):ce==="children"?$e(C,de):N(C,ce,de,oe)}switch(G){case"input":Ne(C,j);break;case"textarea":Xt(C,j);break;case"select":var le=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!j.multiple;var be=j.value;be!=null?bt(C,!!j.multiple,be,!1):le!==!!j.multiple&&(j.defaultValue!=null?bt(C,!!j.multiple,j.defaultValue,!0):bt(C,!!j.multiple,j.multiple?[]:"",!1))}C[qa]=j}catch(Ce){mt(i,i.return,Ce)}}break;case 6:if(nr(l,i),Er(i),x&4){if(i.stateNode===null)throw Error(n(162));C=i.stateNode,j=i.memoizedProps;try{C.nodeValue=j}catch(Ce){mt(i,i.return,Ce)}}break;case 3:if(nr(l,i),Er(i),x&4&&m!==null&&m.memoizedState.isDehydrated)try{Ta(l.containerInfo)}catch(Ce){mt(i,i.return,Ce)}break;case 4:nr(l,i),Er(i);break;case 13:nr(l,i),Er(i),C=i.child,C.flags&8192&&(j=C.memoizedState!==null,C.stateNode.isHidden=j,!j||C.alternate!==null&&C.alternate.memoizedState!==null||(Ip=dt())),x&4&&PN(i);break;case 22:if(ce=m!==null&&m.memoizedState!==null,i.mode&1?(Gt=(oe=Gt)||ce,nr(l,i),Gt=oe):nr(l,i),Er(i),x&8192){if(oe=i.memoizedState!==null,(i.stateNode.isHidden=oe)&&!ce&&(i.mode&1)!==0)for(ke=i,ce=i.child;ce!==null;){for(de=ke=ce;ke!==null;){switch(le=ke,be=le.child,le.tag){case 0:case 11:case 14:case 15:Ja(4,le,le.return);break;case 1:bi(le,le.return);var Se=le.stateNode;if(typeof Se.componentWillUnmount=="function"){x=le,m=le.return;try{l=x,Se.props=l.memoizedProps,Se.state=l.memoizedState,Se.componentWillUnmount()}catch(Ce){mt(x,m,Ce)}}break;case 5:bi(le,le.return);break;case 22:if(le.memoizedState!==null){FN(de);continue}}be!==null?(be.return=le,ke=be):FN(de)}ce=ce.sibling}e:for(ce=null,de=i;;){if(de.tag===5){if(ce===null){ce=de;try{C=de.stateNode,oe?(j=C.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none"):(G=de.stateNode,Q=de.memoizedProps.style,R=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,G.style.display=Ht("display",R))}catch(Ce){mt(i,i.return,Ce)}}}else if(de.tag===6){if(ce===null)try{de.stateNode.nodeValue=oe?"":de.memoizedProps}catch(Ce){mt(i,i.return,Ce)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===i)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===i)break e;for(;de.sibling===null;){if(de.return===null||de.return===i)break e;ce===de&&(ce=null),de=de.return}ce===de&&(ce=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:nr(l,i),Er(i),x&4&&PN(i);break;case 21:break;default:nr(l,i),Er(i)}}function Er(i){var l=i.flags;if(l&2){try{e:{for(var m=i.return;m!==null;){if(MN(m)){var x=m;break e}m=m.return}throw Error(n(160))}switch(x.tag){case 5:var C=x.stateNode;x.flags&32&&($e(C,""),x.flags&=-33);var j=RN(i);jp(i,j,C);break;case 3:case 4:var R=x.stateNode.containerInfo,G=RN(i);Ep(i,G,R);break;default:throw Error(n(161))}}catch(Q){mt(i,i.return,Q)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function BL(i,l,m){ke=i,DN(i)}function DN(i,l,m){for(var x=(i.mode&1)!==0;ke!==null;){var C=ke,j=C.child;if(C.tag===22&&x){var R=C.memoizedState!==null||pu;if(!R){var G=C.alternate,Q=G!==null&&G.memoizedState!==null||Gt;G=pu;var oe=Gt;if(pu=R,(Gt=Q)&&!oe)for(ke=C;ke!==null;)R=ke,Q=R.child,R.tag===22&&R.memoizedState!==null?BN(C):Q!==null?(Q.return=R,ke=Q):BN(C);for(;j!==null;)ke=j,DN(j),j=j.sibling;ke=C,pu=G,Gt=oe}$N(i)}else(C.subtreeFlags&8772)!==0&&j!==null?(j.return=C,ke=j):$N(i)}}function $N(i){for(;ke!==null;){var l=ke;if((l.flags&8772)!==0){var m=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Gt||mu(5,l);break;case 1:var x=l.stateNode;if(l.flags&4&&!Gt)if(m===null)x.componentDidMount();else{var C=l.elementType===l.type?m.memoizedProps:er(l.type,m.memoizedProps);x.componentDidUpdate(C,m.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var j=l.updateQueue;j!==null&&Fk(l,j,x);break;case 3:var R=l.updateQueue;if(R!==null){if(m=null,l.child!==null)switch(l.child.tag){case 5:m=l.child.stateNode;break;case 1:m=l.child.stateNode}Fk(l,R,m)}break;case 5:var G=l.stateNode;if(m===null&&l.flags&4){m=G;var Q=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&m.focus();break;case"img":Q.src&&(m.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var oe=l.alternate;if(oe!==null){var ce=oe.memoizedState;if(ce!==null){var de=ce.dehydrated;de!==null&&Ta(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gt||l.flags&512&&_p(l)}catch(le){mt(l,l.return,le)}}if(l===i){ke=null;break}if(m=l.sibling,m!==null){m.return=l.return,ke=m;break}ke=l.return}}function FN(i){for(;ke!==null;){var l=ke;if(l===i){ke=null;break}var m=l.sibling;if(m!==null){m.return=l.return,ke=m;break}ke=l.return}}function BN(i){for(;ke!==null;){var l=ke;try{switch(l.tag){case 0:case 11:case 15:var m=l.return;try{mu(4,l)}catch(Q){mt(l,m,Q)}break;case 1:var x=l.stateNode;if(typeof x.componentDidMount=="function"){var C=l.return;try{x.componentDidMount()}catch(Q){mt(l,C,Q)}}var j=l.return;try{_p(l)}catch(Q){mt(l,j,Q)}break;case 5:var R=l.return;try{_p(l)}catch(Q){mt(l,R,Q)}}}catch(Q){mt(l,l.return,Q)}if(l===i){ke=null;break}var G=l.sibling;if(G!==null){G.return=l.return,ke=G;break}ke=l.return}}var qL=Math.ceil,gu=S.ReactCurrentDispatcher,Ap=S.ReactCurrentOwner,Bn=S.ReactCurrentBatchConfig,We=0,Dt=null,kt=null,Bt=0,Cn=0,wi=_s(0),Tt=0,Za=null,go=0,yu=0,Tp=0,el=null,pn=null,Ip=0,ki=1/0,ns=null,xu=!1,Mp=null,Ms=null,vu=!1,Rs=null,bu=0,tl=0,Rp=null,wu=-1,ku=0;function nn(){return(We&6)!==0?dt():wu!==-1?wu:wu=dt()}function Os(i){return(i.mode&1)===0?1:(We&2)!==0&&Bt!==0?Bt&-Bt:SL.transition!==null?(ku===0&&(ku=ti()),ku):(i=Qe,i!==0||(i=window.event,i=i===void 0?16:z1(i.type)),i)}function rr(i,l,m,x){if(50<tl)throw tl=0,Rp=null,Error(n(185));ao(i,m,x),((We&2)===0||i!==Dt)&&(i===Dt&&((We&2)===0&&(yu|=m),Tt===4&&Ps(i,Bt)),mn(i,x),m===1&&We===0&&(l.mode&1)===0&&(ki=dt()+500,Xc&&js()))}function mn(i,l){var m=i.callbackNode;ph(i,l);var x=ei(i,i===Dt?Bt:0);if(x===0)m!==null&&_c(m),i.callbackNode=null,i.callbackPriority=0;else if(l=x&-x,i.callbackPriority!==l){if(m!=null&&_c(m),l===1)i.tag===0?NL(zN.bind(null,i)):Ek(zN.bind(null,i)),vL(function(){(We&6)===0&&js()}),m=null;else{switch(O1(x)){case 1:m=Na;break;case 4:m=jc;break;case 16:m=Qo;break;case 536870912:m=Ac;break;default:m=Qo}m=XN(m,qN.bind(null,i))}i.callbackPriority=l,i.callbackNode=m}}function qN(i,l){if(wu=-1,ku=0,(We&6)!==0)throw Error(n(327));var m=i.callbackNode;if(Ni()&&i.callbackNode!==m)return null;var x=ei(i,i===Dt?Bt:0);if(x===0)return null;if((x&30)!==0||(x&i.expiredLanes)!==0||l)l=Nu(i,x);else{l=x;var C=We;We|=2;var j=HN();(Dt!==i||Bt!==l)&&(ns=null,ki=dt()+500,xo(i,l));do try{HL();break}catch(G){VN(i,G)}while(!0);Qh(),gu.current=j,We=C,kt!==null?l=0:(Dt=null,Bt=0,l=Tt)}if(l!==0){if(l===2&&(C=Sa(i),C!==0&&(x=C,l=Op(i,C))),l===1)throw m=Za,xo(i,0),Ps(i,x),mn(i,dt()),m;if(l===6)Ps(i,x);else{if(C=i.current.alternate,(x&30)===0&&!zL(C)&&(l=Nu(i,x),l===2&&(j=Sa(i),j!==0&&(x=j,l=Op(i,j))),l===1))throw m=Za,xo(i,0),Ps(i,x),mn(i,dt()),m;switch(i.finishedWork=C,i.finishedLanes=x,l){case 0:case 1:throw Error(n(345));case 2:vo(i,pn,ns);break;case 3:if(Ps(i,x),(x&130023424)===x&&(l=Ip+500-dt(),10<l)){if(ei(i,0)!==0)break;if(C=i.suspendedLanes,(C&x)!==x){nn(),i.pingedLanes|=i.suspendedLanes&C;break}i.timeoutHandle=Bh(vo.bind(null,i,pn,ns),l);break}vo(i,pn,ns);break;case 4:if(Ps(i,x),(x&4194240)===x)break;for(l=i.eventTimes,C=-1;0<x;){var R=31-wn(x);j=1<<R,R=l[R],R>C&&(C=R),x&=~j}if(x=C,x=dt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*qL(x/1960))-x,10<x){i.timeoutHandle=Bh(vo.bind(null,i,pn,ns),x);break}vo(i,pn,ns);break;case 5:vo(i,pn,ns);break;default:throw Error(n(329))}}}return mn(i,dt()),i.callbackNode===m?qN.bind(null,i):null}function Op(i,l){var m=el;return i.current.memoizedState.isDehydrated&&(xo(i,l).flags|=256),i=Nu(i,l),i!==2&&(l=pn,pn=m,l!==null&&Pp(l)),i}function Pp(i){pn===null?pn=i:pn.push.apply(pn,i)}function zL(i){for(var l=i;;){if(l.flags&16384){var m=l.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var x=0;x<m.length;x++){var C=m[x],j=C.getSnapshot;C=C.value;try{if(!Jn(j(),C))return!1}catch{return!1}}}if(m=l.child,l.subtreeFlags&16384&&m!==null)m.return=l,l=m;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ps(i,l){for(l&=~Tp,l&=~yu,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var m=31-wn(l),x=1<<m;i[m]=-1,l&=~x}}function zN(i){if((We&6)!==0)throw Error(n(327));Ni();var l=ei(i,0);if((l&1)===0)return mn(i,dt()),null;var m=Nu(i,l);if(i.tag!==0&&m===2){var x=Sa(i);x!==0&&(l=x,m=Op(i,x))}if(m===1)throw m=Za,xo(i,0),Ps(i,l),mn(i,dt()),m;if(m===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,vo(i,pn,ns),mn(i,dt()),null}function Lp(i,l){var m=We;We|=1;try{return i(l)}finally{We=m,We===0&&(ki=dt()+500,Xc&&js())}}function yo(i){Rs!==null&&Rs.tag===0&&(We&6)===0&&Ni();var l=We;We|=1;var m=Bn.transition,x=Qe;try{if(Bn.transition=null,Qe=1,i)return i()}finally{Qe=x,Bn.transition=m,We=l,(We&6)===0&&js()}}function Dp(){Cn=wi.current,rt(wi)}function xo(i,l){i.finishedWork=null,i.finishedLanes=0;var m=i.timeoutHandle;if(m!==-1&&(i.timeoutHandle=-1,xL(m)),kt!==null)for(m=kt.return;m!==null;){var x=m;switch(Wh(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Gc();break;case 3:xi(),rt(dn),rt(Ut),op();break;case 5:rp(x);break;case 4:xi();break;case 13:rt(ft);break;case 19:rt(ft);break;case 10:Jh(x.type._context);break;case 22:case 23:Dp()}m=m.return}if(Dt=i,kt=i=Ls(i.current,null),Bt=Cn=l,Tt=0,Za=null,Tp=yu=go=0,pn=el=null,ho!==null){for(l=0;l<ho.length;l++)if(m=ho[l],x=m.interleaved,x!==null){m.interleaved=null;var C=x.next,j=m.pending;if(j!==null){var R=j.next;j.next=C,x.next=R}m.pending=x}ho=null}return i}function VN(i,l){do{var m=kt;try{if(Qh(),iu.current=uu,au){for(var x=ht.memoizedState;x!==null;){var C=x.queue;C!==null&&(C.pending=null),x=x.next}au=!1}if(mo=0,Lt=At=ht=null,Ka=!1,Ga=0,Ap.current=null,m===null||m.return===null){Tt=1,Za=l,kt=null;break}e:{var j=i,R=m.return,G=m,Q=l;if(l=Bt,G.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var oe=Q,ce=G,de=ce.tag;if((ce.mode&1)===0&&(de===0||de===11||de===15)){var le=ce.alternate;le?(ce.updateQueue=le.updateQueue,ce.memoizedState=le.memoizedState,ce.lanes=le.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var be=pN(R);if(be!==null){be.flags&=-257,mN(be,R,G,j,l),be.mode&1&&hN(j,oe,l),l=be,Q=oe;var Se=l.updateQueue;if(Se===null){var Ce=new Set;Ce.add(Q),l.updateQueue=Ce}else Se.add(Q);break e}else{if((l&1)===0){hN(j,oe,l),$p();break e}Q=Error(n(426))}}else if(it&&G.mode&1){var gt=pN(R);if(gt!==null){(gt.flags&65536)===0&&(gt.flags|=256),mN(gt,R,G,j,l),Yh(vi(Q,G));break e}}j=Q=vi(Q,G),Tt!==4&&(Tt=2),el===null?el=[j]:el.push(j),j=R;do{switch(j.tag){case 3:j.flags|=65536,l&=-l,j.lanes|=l;var re=dN(j,Q,l);$k(j,re);break e;case 1:G=Q;var J=j.type,se=j.stateNode;if((j.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Ms===null||!Ms.has(se)))){j.flags|=65536,l&=-l,j.lanes|=l;var fe=fN(j,G,l);$k(j,fe);break e}}j=j.return}while(j!==null)}WN(m)}catch(Ee){l=Ee,kt===m&&m!==null&&(kt=m=m.return);continue}break}while(!0)}function HN(){var i=gu.current;return gu.current=uu,i===null?uu:i}function $p(){(Tt===0||Tt===3||Tt===2)&&(Tt=4),Dt===null||(go&268435455)===0&&(yu&268435455)===0||Ps(Dt,Bt)}function Nu(i,l){var m=We;We|=2;var x=HN();(Dt!==i||Bt!==l)&&(ns=null,xo(i,l));do try{VL();break}catch(C){VN(i,C)}while(!0);if(Qh(),We=m,gu.current=x,kt!==null)throw Error(n(261));return Dt=null,Bt=0,Tt}function VL(){for(;kt!==null;)UN(kt)}function HL(){for(;kt!==null&&!ah();)UN(kt)}function UN(i){var l=YN(i.alternate,i,Cn);i.memoizedProps=i.pendingProps,l===null?WN(i):kt=l,Ap.current=null}function WN(i){var l=i;do{var m=l.alternate;if(i=l.return,(l.flags&32768)===0){if(m=LL(m,l,Cn),m!==null){kt=m;return}}else{if(m=DL(m,l),m!==null){m.flags&=32767,kt=m;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Tt=6,kt=null;return}}if(l=l.sibling,l!==null){kt=l;return}kt=l=i}while(l!==null);Tt===0&&(Tt=5)}function vo(i,l,m){var x=Qe,C=Bn.transition;try{Bn.transition=null,Qe=1,UL(i,l,m,x)}finally{Bn.transition=C,Qe=x}return null}function UL(i,l,m,x){do Ni();while(Rs!==null);if((We&6)!==0)throw Error(n(327));m=i.finishedWork;var C=i.finishedLanes;if(m===null)return null;if(i.finishedWork=null,i.finishedLanes=0,m===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var j=m.lanes|m.childLanes;if(Ic(i,j),i===Dt&&(kt=Dt=null,Bt=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||vu||(vu=!0,XN(Qo,function(){return Ni(),null})),j=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||j){j=Bn.transition,Bn.transition=null;var R=Qe;Qe=1;var G=We;We|=4,Ap.current=null,FL(i,m),LN(m,i),dL($h),Oc=!!Dh,$h=Dh=null,i.current=m,BL(m),Ec(),We=G,Qe=R,Bn.transition=j}else i.current=m;if(vu&&(vu=!1,Rs=i,bu=C),j=i.pendingLanes,j===0&&(Ms=null),uh(m.stateNode),mn(i,dt()),l!==null)for(x=i.onRecoverableError,m=0;m<l.length;m++)C=l[m],x(C.value,{componentStack:C.stack,digest:C.digest});if(xu)throw xu=!1,i=Mp,Mp=null,i;return(bu&1)!==0&&i.tag!==0&&Ni(),j=i.pendingLanes,(j&1)!==0?i===Rp?tl++:(tl=0,Rp=i):tl=0,js(),null}function Ni(){if(Rs!==null){var i=O1(bu),l=Bn.transition,m=Qe;try{if(Bn.transition=null,Qe=16>i?16:i,Rs===null)var x=!1;else{if(i=Rs,Rs=null,bu=0,(We&6)!==0)throw Error(n(331));var C=We;for(We|=4,ke=i.current;ke!==null;){var j=ke,R=j.child;if((ke.flags&16)!==0){var G=j.deletions;if(G!==null){for(var Q=0;Q<G.length;Q++){var oe=G[Q];for(ke=oe;ke!==null;){var ce=ke;switch(ce.tag){case 0:case 11:case 15:Ja(8,ce,j)}var de=ce.child;if(de!==null)de.return=ce,ke=de;else for(;ke!==null;){ce=ke;var le=ce.sibling,be=ce.return;if(IN(ce),ce===oe){ke=null;break}if(le!==null){le.return=be,ke=le;break}ke=be}}}var Se=j.alternate;if(Se!==null){var Ce=Se.child;if(Ce!==null){Se.child=null;do{var gt=Ce.sibling;Ce.sibling=null,Ce=gt}while(Ce!==null)}}ke=j}}if((j.subtreeFlags&2064)!==0&&R!==null)R.return=j,ke=R;else e:for(;ke!==null;){if(j=ke,(j.flags&2048)!==0)switch(j.tag){case 0:case 11:case 15:Ja(9,j,j.return)}var re=j.sibling;if(re!==null){re.return=j.return,ke=re;break e}ke=j.return}}var J=i.current;for(ke=J;ke!==null;){R=ke;var se=R.child;if((R.subtreeFlags&2064)!==0&&se!==null)se.return=R,ke=se;else e:for(R=J;ke!==null;){if(G=ke,(G.flags&2048)!==0)try{switch(G.tag){case 0:case 11:case 15:mu(9,G)}}catch(Ee){mt(G,G.return,Ee)}if(G===R){ke=null;break e}var fe=G.sibling;if(fe!==null){fe.return=G.return,ke=fe;break e}ke=G.return}}if(We=C,js(),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(io,i)}catch{}x=!0}return x}finally{Qe=m,Bn.transition=l}}return!1}function KN(i,l,m){l=vi(m,l),l=dN(i,l,1),i=Ts(i,l,1),l=nn(),i!==null&&(ao(i,1,l),mn(i,l))}function mt(i,l,m){if(i.tag===3)KN(i,i,m);else for(;l!==null;){if(l.tag===3){KN(l,i,m);break}else if(l.tag===1){var x=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Ms===null||!Ms.has(x))){i=vi(m,i),i=fN(l,i,1),l=Ts(l,i,1),i=nn(),l!==null&&(ao(l,1,i),mn(l,i));break}}l=l.return}}function WL(i,l,m){var x=i.pingCache;x!==null&&x.delete(l),l=nn(),i.pingedLanes|=i.suspendedLanes&m,Dt===i&&(Bt&m)===m&&(Tt===4||Tt===3&&(Bt&130023424)===Bt&&500>dt()-Ip?xo(i,0):Tp|=m),mn(i,l)}function GN(i,l){l===0&&((i.mode&1)===0?l=1:(l=Zo,Zo<<=1,(Zo&130023424)===0&&(Zo=4194304)));var m=nn();i=Zr(i,l),i!==null&&(ao(i,l,m),mn(i,m))}function KL(i){var l=i.memoizedState,m=0;l!==null&&(m=l.retryLane),GN(i,m)}function GL(i,l){var m=0;switch(i.tag){case 13:var x=i.stateNode,C=i.memoizedState;C!==null&&(m=C.retryLane);break;case 19:x=i.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(l),GN(i,m)}var YN;YN=function(i,l,m){if(i!==null)if(i.memoizedProps!==l.pendingProps||dn.current)hn=!0;else{if((i.lanes&m)===0&&(l.flags&128)===0)return hn=!1,PL(i,l,m);hn=(i.flags&131072)!==0}else hn=!1,it&&(l.flags&1048576)!==0&&jk(l,Jc,l.index);switch(l.lanes=0,l.tag){case 2:var x=l.type;hu(i,l),i=l.pendingProps;var C=di(l,Ut.current);yi(l,m),C=lp(null,l,x,i,C,m);var j=cp();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,fn(x)?(j=!0,Yc(l)):j=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,tp(l),C.updater=du,l.stateNode=C,C._reactInternals=l,mp(l,x,i,m),l=vp(null,l,x,!0,j,m)):(l.tag=0,it&&j&&Uh(l),tn(null,l,C,m),l=l.child),l;case 16:x=l.elementType;e:{switch(hu(i,l),i=l.pendingProps,C=x._init,x=C(x._payload),l.type=x,C=l.tag=XL(x),i=er(x,i),C){case 0:l=xp(null,l,x,i,m);break e;case 1:l=wN(null,l,x,i,m);break e;case 11:l=gN(null,l,x,i,m);break e;case 14:l=yN(null,l,x,er(x.type,i),m);break e}throw Error(n(306,x,""))}return l;case 0:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:er(x,C),xp(i,l,x,C,m);case 1:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:er(x,C),wN(i,l,x,C,m);case 3:e:{if(kN(l),i===null)throw Error(n(387));x=l.pendingProps,j=l.memoizedState,C=j.element,Dk(i,l),su(l,x,null,m);var R=l.memoizedState;if(x=R.element,j.isDehydrated)if(j={element:x,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},l.updateQueue.baseState=j,l.memoizedState=j,l.flags&256){C=vi(Error(n(423)),l),l=NN(i,l,x,m,C);break e}else if(x!==C){C=vi(Error(n(424)),l),l=NN(i,l,x,m,C);break e}else for(Sn=Cs(l.stateNode.containerInfo.firstChild),Nn=l,it=!0,Zn=null,m=Pk(l,null,x,m),l.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(pi(),x===C){l=ts(i,l,m);break e}tn(i,l,x,m)}l=l.child}return l;case 5:return Bk(l),i===null&&Gh(l),x=l.type,C=l.pendingProps,j=i!==null?i.memoizedProps:null,R=C.children,Fh(x,C)?R=null:j!==null&&Fh(x,j)&&(l.flags|=32),bN(i,l),tn(i,l,R,m),l.child;case 6:return i===null&&Gh(l),null;case 13:return SN(i,l,m);case 4:return np(l,l.stateNode.containerInfo),x=l.pendingProps,i===null?l.child=mi(l,null,x,m):tn(i,l,x,m),l.child;case 11:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:er(x,C),gN(i,l,x,C,m);case 7:return tn(i,l,l.pendingProps,m),l.child;case 8:return tn(i,l,l.pendingProps.children,m),l.child;case 12:return tn(i,l,l.pendingProps.children,m),l.child;case 10:e:{if(x=l.type._context,C=l.pendingProps,j=l.memoizedProps,R=C.value,Ze(tu,x._currentValue),x._currentValue=R,j!==null)if(Jn(j.value,R)){if(j.children===C.children&&!dn.current){l=ts(i,l,m);break e}}else for(j=l.child,j!==null&&(j.return=l);j!==null;){var G=j.dependencies;if(G!==null){R=j.child;for(var Q=G.firstContext;Q!==null;){if(Q.context===x){if(j.tag===1){Q=es(-1,m&-m),Q.tag=2;var oe=j.updateQueue;if(oe!==null){oe=oe.shared;var ce=oe.pending;ce===null?Q.next=Q:(Q.next=ce.next,ce.next=Q),oe.pending=Q}}j.lanes|=m,Q=j.alternate,Q!==null&&(Q.lanes|=m),Zh(j.return,m,l),G.lanes|=m;break}Q=Q.next}}else if(j.tag===10)R=j.type===l.type?null:j.child;else if(j.tag===18){if(R=j.return,R===null)throw Error(n(341));R.lanes|=m,G=R.alternate,G!==null&&(G.lanes|=m),Zh(R,m,l),R=j.sibling}else R=j.child;if(R!==null)R.return=j;else for(R=j;R!==null;){if(R===l){R=null;break}if(j=R.sibling,j!==null){j.return=R.return,R=j;break}R=R.return}j=R}tn(i,l,C.children,m),l=l.child}return l;case 9:return C=l.type,x=l.pendingProps.children,yi(l,m),C=$n(C),x=x(C),l.flags|=1,tn(i,l,x,m),l.child;case 14:return x=l.type,C=er(x,l.pendingProps),C=er(x.type,C),yN(i,l,x,C,m);case 15:return xN(i,l,l.type,l.pendingProps,m);case 17:return x=l.type,C=l.pendingProps,C=l.elementType===x?C:er(x,C),hu(i,l),l.tag=1,fn(x)?(i=!0,Yc(l)):i=!1,yi(l,m),cN(l,x,C),mp(l,x,C,m),vp(null,l,x,!0,i,m);case 19:return _N(i,l,m);case 22:return vN(i,l,m)}throw Error(n(156,l.tag))};function XN(i,l){return Cc(i,l)}function YL(i,l,m,x){this.tag=i,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(i,l,m,x){return new YL(i,l,m,x)}function Fp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function XL(i){if(typeof i=="function")return Fp(i)?1:0;if(i!=null){if(i=i.$$typeof,i===P)return 11;if(i===V)return 14}return 2}function Ls(i,l){var m=i.alternate;return m===null?(m=qn(i.tag,l,i.key,i.mode),m.elementType=i.elementType,m.type=i.type,m.stateNode=i.stateNode,m.alternate=i,i.alternate=m):(m.pendingProps=l,m.type=i.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=i.flags&14680064,m.childLanes=i.childLanes,m.lanes=i.lanes,m.child=i.child,m.memoizedProps=i.memoizedProps,m.memoizedState=i.memoizedState,m.updateQueue=i.updateQueue,l=i.dependencies,m.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},m.sibling=i.sibling,m.index=i.index,m.ref=i.ref,m}function Su(i,l,m,x,C,j){var R=2;if(x=i,typeof i=="function")Fp(i)&&(R=1);else if(typeof i=="string")R=5;else e:switch(i){case T:return bo(m.children,C,j,l);case O:R=8,C|=8;break;case L:return i=qn(12,m,l,C|2),i.elementType=L,i.lanes=j,i;case H:return i=qn(13,m,l,C),i.elementType=H,i.lanes=j,i;case D:return i=qn(19,m,l,C),i.elementType=D,i.lanes=j,i;case U:return Cu(m,C,j,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case z:R=10;break e;case M:R=9;break e;case P:R=11;break e;case V:R=14;break e;case $:R=16,x=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=qn(R,m,l,C),l.elementType=i,l.type=x,l.lanes=j,l}function bo(i,l,m,x){return i=qn(7,i,x,l),i.lanes=m,i}function Cu(i,l,m,x){return i=qn(22,i,x,l),i.elementType=U,i.lanes=m,i.stateNode={isHidden:!1},i}function Bp(i,l,m){return i=qn(6,i,null,l),i.lanes=m,i}function qp(i,l,m){return l=qn(4,i.children!==null?i.children:[],i.key,l),l.lanes=m,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function QL(i,l,m,x,C){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ca(0),this.expirationTimes=Ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ca(0),this.identifierPrefix=x,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function zp(i,l,m,x,C,j,R,G,Q){return i=new QL(i,l,m,G,Q),l===1?(l=1,j===!0&&(l|=8)):l=0,j=qn(3,null,null,l),i.current=j,j.stateNode=i,j.memoizedState={element:x,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},tp(j),i}function JL(i,l,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:x==null?null:""+x,children:i,containerInfo:l,implementation:m}}function QN(i){if(!i)return Es;i=i._reactInternals;e:{if(kr(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(fn(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var m=i.type;if(fn(m))return Ck(i,m,l)}return l}function JN(i,l,m,x,C,j,R,G,Q){return i=zp(m,x,!0,i,C,j,R,G,Q),i.context=QN(null),m=i.current,x=nn(),C=Os(m),j=es(x,C),j.callback=l??null,Ts(m,j,C),i.current.lanes=C,ao(i,C,x),mn(i,x),i}function _u(i,l,m,x){var C=l.current,j=nn(),R=Os(C);return m=QN(m),l.context===null?l.context=m:l.pendingContext=m,l=es(j,R),l.payload={element:i},x=x===void 0?null:x,x!==null&&(l.callback=x),i=Ts(C,l,R),i!==null&&(rr(i,C,R,j),ru(i,C,R)),R}function Eu(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function ZN(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var m=i.retryLane;i.retryLane=m!==0&&m<l?m:l}}function Vp(i,l){ZN(i,l),(i=i.alternate)&&ZN(i,l)}function ZL(){return null}var eS=typeof reportError=="function"?reportError:function(i){console.error(i)};function Hp(i){this._internalRoot=i}ju.prototype.render=Hp.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));_u(i,l,null,null)},ju.prototype.unmount=Hp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;yo(function(){_u(null,i,null,null)}),l[Yr]=null}};function ju(i){this._internalRoot=i}ju.prototype.unstable_scheduleHydration=function(i){if(i){var l=D1();i={blockedOn:null,target:i,priority:l};for(var m=0;m<ks.length&&l!==0&&l<ks[m].priority;m++);ks.splice(m,0,i),m===0&&B1(i)}};function Up(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Au(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function tS(){}function eD(i,l,m,x,C){if(C){if(typeof x=="function"){var j=x;x=function(){var oe=Eu(R);j.call(oe)}}var R=JN(l,x,i,0,null,!1,!1,"",tS);return i._reactRootContainer=R,i[Yr]=R.current,Fa(i.nodeType===8?i.parentNode:i),yo(),R}for(;C=i.lastChild;)i.removeChild(C);if(typeof x=="function"){var G=x;x=function(){var oe=Eu(Q);G.call(oe)}}var Q=zp(i,0,!1,null,null,!1,!1,"",tS);return i._reactRootContainer=Q,i[Yr]=Q.current,Fa(i.nodeType===8?i.parentNode:i),yo(function(){_u(l,Q,m,x)}),Q}function Tu(i,l,m,x,C){var j=m._reactRootContainer;if(j){var R=j;if(typeof C=="function"){var G=C;C=function(){var Q=Eu(R);G.call(Q)}}_u(l,R,i,C)}else R=eD(m,l,i,C,x);return Eu(R)}P1=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var m=Nr(l.pendingLanes);m!==0&&(mh(l,m|1),mn(l,dt()),(We&6)===0&&(ki=dt()+500,js()))}break;case 13:yo(function(){var x=Zr(i,1);if(x!==null){var C=nn();rr(x,i,1,C)}}),Vp(i,1)}},gh=function(i){if(i.tag===13){var l=Zr(i,134217728);if(l!==null){var m=nn();rr(l,i,134217728,m)}Vp(i,134217728)}},L1=function(i){if(i.tag===13){var l=Os(i),m=Zr(i,l);if(m!==null){var x=nn();rr(m,i,l,x)}Vp(i,l)}},D1=function(){return Qe},$1=function(i,l){var m=Qe;try{return Qe=i,l()}finally{Qe=m}},On=function(i,l,m){switch(l){case"input":if(Ne(i,m),l=m.name,m.type==="radio"&&l!=null){for(m=i;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<m.length;l++){var x=m[l];if(x!==i&&x.form===i.form){var C=Kc(x);if(!C)throw Error(n(90));ve(x),Ne(x,C)}}}break;case"textarea":Xt(i,m);break;case"select":l=m.value,l!=null&&bt(i,!!m.multiple,l,!1)}},me=Lp,Pe=yo;var tD={usingClientEntryPoint:!1,Events:[za,ci,Kc,Ie,pe,Lp]},nl={findFiberByHostInstance:lo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nD={bundleType:nl.bundleType,version:nl.version,rendererPackageName:nl.rendererPackageName,rendererConfig:nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Nc(i),i===null?null:i.stateNode},findFiberByHostInstance:nl.findFiberByHostInstance||ZL,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 Iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Iu.isDisabled&&Iu.supportsFiber)try{io=Iu.inject(nD),Pn=Iu}catch{}}return gn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tD,gn.createPortal=function(i,l){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Up(l))throw Error(n(200));return JL(i,l,null,m)},gn.createRoot=function(i,l){if(!Up(i))throw Error(n(299));var m=!1,x="",C=eS;return l!=null&&(l.unstable_strictMode===!0&&(m=!0),l.identifierPrefix!==void 0&&(x=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=zp(i,1,!1,null,null,m,!1,x,C),i[Yr]=l.current,Fa(i.nodeType===8?i.parentNode:i),new Hp(l)},gn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Nc(l),i=i===null?null:i.stateNode,i},gn.flushSync=function(i){return yo(i)},gn.hydrate=function(i,l,m){if(!Au(l))throw Error(n(200));return Tu(null,i,l,!0,m)},gn.hydrateRoot=function(i,l,m){if(!Up(i))throw Error(n(405));var x=m!=null&&m.hydratedSources||null,C=!1,j="",R=eS;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(j=m.identifierPrefix),m.onRecoverableError!==void 0&&(R=m.onRecoverableError)),l=JN(l,null,i,1,m??null,C,!1,j,R),i[Yr]=l.current,Fa(i),x)for(i=0;i<x.length;i++)m=x[i],C=m._getVersion,C=C(m._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[m,C]:l.mutableSourceEagerHydrationData.push(m,C);return new ju(l)},gn.render=function(i,l,m){if(!Au(l))throw Error(n(200));return Tu(null,i,l,!1,m)},gn.unmountComponentAtNode=function(i){if(!Au(i))throw Error(n(40));return i._reactRootContainer?(yo(function(){Tu(null,null,i,!1,function(){i._reactRootContainer=null,i[Yr]=null})}),!0):!1},gn.unstable_batchedUpdates=Lp,gn.unstable_renderSubtreeIntoContainer=function(i,l,m,x){if(!Au(m))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return Tu(i,l,m,!1,x)},gn.version="18.3.1-next-f1338f8080-20240426",gn}var cS;function gI(){if(cS)return Gp.exports;cS=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(),Gp.exports=uD(),Gp.exports}var uS;function dD(){if(uS)return Ru;uS=1;var e=gI();return Ru.createRoot=e.createRoot,Ru.hydrateRoot=e.hydrateRoot,Ru}var fD=dD();const hD=Yl(fD);function St(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=St(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var pD={value:()=>{}};function Qd(){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 cd(n)}function cd(e){this._=e}function mD(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}cd.prototype=Qd.prototype={constructor:cd,on:function(e,t){var n=this._,r=mD(e+"",n),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=gD(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=r[o]).type)n[s]=dS(n[s],e.name,t);else if(t==null)for(s in n)n[s]=dS(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new cd(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function gD(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function dS(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=pD,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Zv="http://www.w3.org/1999/xhtml";const fS={svg:"http://www.w3.org/2000/svg",xhtml:Zv,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),fS.hasOwnProperty(t)?{space:fS[t],local:e}:e}function yD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Zv&&t.documentElement.namespaceURI===Zv?t.createElement(e):t.createElementNS(n,e)}}function xD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yI(e){var t=Jd(e);return(t.local?xD:yD)(t)}function vD(){}function Qb(e){return e==null?vD:function(){return this.querySelector(e)}}function bD(e){typeof e!="function"&&(e=Qb(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=new Array(a),d,f,p=0;p<a;++p)(d=o[p])&&(f=e.call(d,d.__data__,p,o))&&("__data__"in d&&(f.__data__=d.__data__),c[p]=f);return new In(r,this._parents)}function wD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function kD(){return[]}function xI(e){return e==null?kD:function(){return this.querySelectorAll(e)}}function ND(e){return function(){return wD(e.apply(this,arguments))}}function SD(e){typeof e=="function"?e=ND(e):e=xI(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var a=t[o],c=a.length,d,f=0;f<c;++f)(d=a[f])&&(r.push(e.call(d,d.__data__,f,a)),s.push(d));return new In(r,s)}function vI(e){return function(){return this.matches(e)}}function bI(e){return function(t){return t.matches(e)}}var CD=Array.prototype.find;function _D(e){return function(){return CD.call(this.children,e)}}function ED(){return this.firstElementChild}function jD(e){return this.select(e==null?ED:_D(typeof e=="function"?e:bI(e)))}var AD=Array.prototype.filter;function TD(){return Array.from(this.children)}function ID(e){return function(){return AD.call(this.children,e)}}function MD(e){return this.selectAll(e==null?TD:ID(typeof e=="function"?e:bI(e)))}function RD(e){typeof e!="function"&&(e=vI(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],d,f=0;f<a;++f)(d=o[f])&&e.call(d,d.__data__,f,o)&&c.push(d);return new In(r,this._parents)}function wI(e){return new Array(e.length)}function OD(){return new In(this._enter||this._groups.map(wI),this._parents)}function Sd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sd.prototype={constructor:Sd,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 PD(e){return function(){return e}}function LD(e,t,n,r,s,o){for(var a=0,c,d=t.length,f=o.length;a<f;++a)(c=t[a])?(c.__data__=o[a],r[a]=c):n[a]=new Sd(e,o[a]);for(;a<d;++a)(c=t[a])&&(s[a]=c)}function DD(e,t,n,r,s,o,a){var c,d,f=new Map,p=t.length,h=o.length,g=new Array(p),y;for(c=0;c<p;++c)(d=t[c])&&(g[c]=y=a.call(d,d.__data__,c,t)+"",f.has(y)?s[c]=d:f.set(y,d));for(c=0;c<h;++c)y=a.call(e,o[c],c,o)+"",(d=f.get(y))?(r[c]=d,d.__data__=o[c],f.delete(y)):n[c]=new Sd(e,o[c]);for(c=0;c<p;++c)(d=t[c])&&f.get(g[c])===d&&(s[c]=d)}function $D(e){return e.__data__}function FD(e,t){if(!arguments.length)return Array.from(this,$D);var n=t?DD:LD,r=this._parents,s=this._groups;typeof e!="function"&&(e=PD(e));for(var o=s.length,a=new Array(o),c=new Array(o),d=new Array(o),f=0;f<o;++f){var p=r[f],h=s[f],g=h.length,y=BD(e.call(p,p&&p.__data__,f,r)),b=y.length,w=c[f]=new Array(b),v=a[f]=new Array(b),k=d[f]=new Array(g);n(p,h,w,v,k,y,t);for(var _=0,N=0,S,A;_<b;++_)if(S=w[_]){for(_>=N&&(N=_+1);!(A=v[N])&&++N<b;);S._next=A||null}}return a=new In(a,r),a._enter=c,a._exit=d,a}function BD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qD(){return new In(this._exit||this._groups.map(wI),this._parents)}function zD(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function VD(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,a=Math.min(s,o),c=new Array(s),d=0;d<a;++d)for(var f=n[d],p=r[d],h=f.length,g=c[d]=new Array(h),y,b=0;b<h;++b)(y=f[b]||p[b])&&(g[b]=y);for(;d<s;++d)c[d]=n[d];return new In(c,this._parents)}function HD(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],a;--s>=0;)(a=r[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function UD(e){e||(e=WD);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var a=n[o],c=a.length,d=s[o]=new Array(c),f,p=0;p<c;++p)(f=a[p])&&(d[p]=f);d.sort(t)}return new In(s,this._parents).order()}function WD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function KD(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function GD(){return Array.from(this)}function YD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var a=r[s];if(a)return a}return null}function XD(){let e=0;for(const t of this)++e;return e}function QD(){return!this.node()}function JD(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,a=s.length,c;o<a;++o)(c=s[o])&&e.call(c,c.__data__,o,s);return this}function ZD(e){return function(){this.removeAttribute(e)}}function e$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t$(e,t){return function(){this.setAttribute(e,t)}}function n$(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function r$(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function s$(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 o$(e,t){var n=Jd(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?e$:ZD:typeof t=="function"?n.local?s$:r$:n.local?n$:t$)(n,t))}function kI(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function i$(e){return function(){this.style.removeProperty(e)}}function a$(e,t,n){return function(){this.style.setProperty(e,t,n)}}function l$(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function c$(e,t,n){return arguments.length>1?this.each((t==null?i$:typeof t=="function"?l$:a$)(e,t,n??"")):Wi(this.node(),e)}function Wi(e,t){return e.style.getPropertyValue(t)||kI(e).getComputedStyle(e,null).getPropertyValue(t)}function u$(e){return function(){delete this[e]}}function d$(e,t){return function(){this[e]=t}}function f$(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function h$(e,t){return arguments.length>1?this.each((t==null?u$:typeof t=="function"?f$:d$)(e,t)):this.node()[e]}function NI(e){return e.trim().split(/^|\s+/)}function Jb(e){return e.classList||new SI(e)}function SI(e){this._node=e,this._names=NI(e.getAttribute("class")||"")}SI.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 CI(e,t){for(var n=Jb(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function _I(e,t){for(var n=Jb(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function p$(e){return function(){CI(this,e)}}function m$(e){return function(){_I(this,e)}}function g$(e,t){return function(){(t.apply(this,arguments)?CI:_I)(this,e)}}function y$(e,t){var n=NI(e+"");if(arguments.length<2){for(var r=Jb(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?g$:t?p$:m$)(n,t))}function x$(){this.textContent=""}function v$(e){return function(){this.textContent=e}}function b$(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function w$(e){return arguments.length?this.each(e==null?x$:(typeof e=="function"?b$:v$)(e)):this.node().textContent}function k$(){this.innerHTML=""}function N$(e){return function(){this.innerHTML=e}}function S$(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function C$(e){return arguments.length?this.each(e==null?k$:(typeof e=="function"?S$:N$)(e)):this.node().innerHTML}function _$(){this.nextSibling&&this.parentNode.appendChild(this)}function E$(){return this.each(_$)}function j$(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function A$(){return this.each(j$)}function T$(e){var t=typeof e=="function"?e:yI(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function I$(){return null}function M$(e,t){var n=typeof e=="function"?e:yI(e),r=t==null?I$:typeof t=="function"?t:Qb(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function R$(){var e=this.parentNode;e&&e.removeChild(this)}function O$(){return this.each(R$)}function P$(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function L$(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function D$(e){return this.select(e?L$:P$)}function $$(e){return arguments.length?this.property("__data__",e):this.node().__data__}function F$(e){return function(t){e.call(this,t,this.__data__)}}function B$(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 q$(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function z$(e,t,n){return function(){var r=this.__on,s,o=F$(t);if(r){for(var a=0,c=r.length;a<c;++a)if((s=r[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function V$(e,t,n){var r=B$(e+""),s,o=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,f=c.length,p;d<f;++d)for(s=0,p=c[d];s<o;++s)if((a=r[s]).type===p.type&&a.name===p.name)return p.value}return}for(c=t?z$:q$,s=0;s<o;++s)this.each(c(r[s],t,n));return this}function EI(e,t,n){var r=kI(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function H$(e,t){return function(){return EI(this,e,t)}}function U$(e,t){return function(){return EI(this,e,t.apply(this,arguments))}}function W$(e,t){return this.each((typeof t=="function"?U$:H$)(e,t))}function*K$(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,a;s<o;++s)(a=r[s])&&(yield a)}var jI=[null];function In(e,t){this._groups=e,this._parents=t}function Ql(){return new In([[document.documentElement]],jI)}function G$(){return this}In.prototype=Ql.prototype={constructor:In,select:bD,selectAll:SD,selectChild:jD,selectChildren:MD,filter:RD,data:FD,enter:OD,exit:qD,join:zD,merge:VD,selection:G$,order:HD,sort:UD,call:KD,nodes:GD,node:YD,size:XD,empty:QD,each:JD,attr:o$,style:c$,property:h$,classed:y$,text:w$,html:C$,raise:E$,lower:A$,append:T$,insert:M$,remove:O$,clone:D$,datum:$$,on:V$,dispatch:W$,[Symbol.iterator]:K$};function An(e){return typeof e=="string"?new In([[document.querySelector(e)]],[document.documentElement]):new In([[e]],jI)}function Y$(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ir(e,t){if(e=Y$(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const X$={passive:!1},jl={capture:!0,passive:!1};function Qp(e){e.stopImmediatePropagation()}function $i(e){e.preventDefault(),e.stopImmediatePropagation()}function AI(e){var t=e.document.documentElement,n=An(e).on("dragstart.drag",$i,jl);"onselectstart"in t?n.on("selectstart.drag",$i,jl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function TI(e,t){var n=e.document.documentElement,r=An(e).on("dragstart.drag",null);t&&(r.on("click.drag",$i,jl),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 Ou=e=>()=>e;function eb(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:a,y:c,dx:d,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}eb.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Q$(e){return!e.ctrlKey&&!e.button}function J$(){return this.parentNode}function Z$(e,t){return t??{x:e.x,y:e.y}}function eF(){return navigator.maxTouchPoints||"ontouchstart"in this}function II(){var e=Q$,t=J$,n=Z$,r=eF,s={},o=Qd("start","drag","end"),a=0,c,d,f,p,h=0;function g(S){S.on("mousedown.drag",y).filter(r).on("touchstart.drag",v).on("touchmove.drag",k,X$).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(S,A){if(!(p||!e.call(this,S,A))){var I=N(this,t.call(this,S,A),S,A,"mouse");I&&(An(S.view).on("mousemove.drag",b,jl).on("mouseup.drag",w,jl),AI(S.view),Qp(S),f=!1,c=S.clientX,d=S.clientY,I("start",S))}}function b(S){if($i(S),!f){var A=S.clientX-c,I=S.clientY-d;f=A*A+I*I>h}s.mouse("drag",S)}function w(S){An(S.view).on("mousemove.drag mouseup.drag",null),TI(S.view,f),$i(S),s.mouse("end",S)}function v(S,A){if(e.call(this,S,A)){var I=S.changedTouches,T=t.call(this,S,A),O=I.length,L,z;for(L=0;L<O;++L)(z=N(this,T,S,A,I[L].identifier,I[L]))&&(Qp(S),z("start",S,I[L]))}}function k(S){var A=S.changedTouches,I=A.length,T,O;for(T=0;T<I;++T)(O=s[A[T].identifier])&&($i(S),O("drag",S,A[T]))}function _(S){var A=S.changedTouches,I=A.length,T,O;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),T=0;T<I;++T)(O=s[A[T].identifier])&&(Qp(S),O("end",S,A[T]))}function N(S,A,I,T,O,L){var z=o.copy(),M=ir(L||I,A),P,H,D;if((D=n.call(S,new eb("beforestart",{sourceEvent:I,target:g,identifier:O,active:a,x:M[0],y:M[1],dx:0,dy:0,dispatch:z}),T))!=null)return P=D.x-M[0]||0,H=D.y-M[1]||0,function V($,U,B){var q=M,Y;switch($){case"start":s[O]=V,Y=a++;break;case"end":delete s[O],--a;case"drag":M=ir(B||U,A),Y=a;break}z.call($,S,new eb($,{sourceEvent:U,subject:D,target:g,identifier:O,active:Y,x:M[0]+P,y:M[1]+H,dx:M[0]-q[0],dy:M[1]-q[1],dispatch:z}),T)}}return g.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Ou(!!S),g):e},g.container=function(S){return arguments.length?(t=typeof S=="function"?S:Ou(S),g):t},g.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Ou(S),g):n},g.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:Ou(!!S),g):r},g.on=function(){var S=o.on.apply(o,arguments);return S===o?g:S},g.clickDistance=function(S){return arguments.length?(h=(S=+S)*S,g):Math.sqrt(h)},g}function Zb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function MI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jl(){}var Al=.7,Cd=1/Al,Fi="\\s*([+-]?\\d+)\\s*",Tl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tF=/^#([0-9a-f]{3,8})$/,nF=new RegExp(`^rgb\\(${Fi},${Fi},${Fi}\\)$`),rF=new RegExp(`^rgb\\(${Pr},${Pr},${Pr}\\)$`),sF=new RegExp(`^rgba\\(${Fi},${Fi},${Fi},${Tl}\\)$`),oF=new RegExp(`^rgba\\(${Pr},${Pr},${Pr},${Tl}\\)$`),iF=new RegExp(`^hsl\\(${Tl},${Pr},${Pr}\\)$`),aF=new RegExp(`^hsla\\(${Tl},${Pr},${Pr},${Tl}\\)$`),hS={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};Zb(Jl,Io,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pS,formatHex:pS,formatHex8:lF,formatHsl:cF,formatRgb:mS,toString:mS});function pS(){return this.rgb().formatHex()}function lF(){return this.rgb().formatHex8()}function cF(){return RI(this).formatHsl()}function mS(){return this.rgb().formatRgb()}function Io(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tF.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gS(t):n===3?new xn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pu(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=nF.exec(e))?new xn(t[1],t[2],t[3],1):(t=rF.exec(e))?new xn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sF.exec(e))?Pu(t[1],t[2],t[3],t[4]):(t=oF.exec(e))?Pu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iF.exec(e))?vS(t[1],t[2]/100,t[3]/100,1):(t=aF.exec(e))?vS(t[1],t[2]/100,t[3]/100,t[4]):hS.hasOwnProperty(e)?gS(hS[e]):e==="transparent"?new xn(NaN,NaN,NaN,0):null}function gS(e){return new xn(e>>16&255,e>>8&255,e&255,1)}function Pu(e,t,n,r){return r<=0&&(e=t=n=NaN),new xn(e,t,n,r)}function uF(e){return e instanceof Jl||(e=Io(e)),e?(e=e.rgb(),new xn(e.r,e.g,e.b,e.opacity)):new xn}function tb(e,t,n,r){return arguments.length===1?uF(e):new xn(e,t,n,r??1)}function xn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Zb(xn,tb,MI(Jl,{brighter(e){return e=e==null?Cd:Math.pow(Cd,e),new xn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Al:Math.pow(Al,e),new xn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xn(Ao(this.r),Ao(this.g),Ao(this.b),_d(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:yS,formatHex:yS,formatHex8:dF,formatRgb:xS,toString:xS}));function yS(){return`#${Co(this.r)}${Co(this.g)}${Co(this.b)}`}function dF(){return`#${Co(this.r)}${Co(this.g)}${Co(this.b)}${Co((isNaN(this.opacity)?1:this.opacity)*255)}`}function xS(){const e=_d(this.opacity);return`${e===1?"rgb(":"rgba("}${Ao(this.r)}, ${Ao(this.g)}, ${Ao(this.b)}${e===1?")":`, ${e})`}`}function _d(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ao(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Co(e){return e=Ao(e),(e<16?"0":"")+e.toString(16)}function vS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new lr(e,t,n,r)}function RI(e){if(e instanceof lr)return new lr(e.h,e.s,e.l,e.opacity);if(e instanceof Jl||(e=Io(e)),!e)return new lr;if(e instanceof lr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,c=o-s,d=(o+s)/2;return c?(t===o?a=(n-r)/c+(n<r)*6:n===o?a=(r-t)/c+2:a=(t-n)/c+4,c/=d<.5?o+s:2-o-s,a*=60):c=d>0&&d<1?0:a,new lr(a,c,d,e.opacity)}function fF(e,t,n,r){return arguments.length===1?RI(e):new lr(e,t,n,r??1)}function lr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zb(lr,fF,MI(Jl,{brighter(e){return e=e==null?Cd:Math.pow(Cd,e),new lr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Al:Math.pow(Al,e),new lr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new xn(Jp(e>=240?e-240:e+120,s,r),Jp(e,s,r),Jp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new lr(bS(this.h),Lu(this.s),Lu(this.l),_d(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=_d(this.opacity);return`${e===1?"hsl(":"hsla("}${bS(this.h)}, ${Lu(this.s)*100}%, ${Lu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function bS(e){return e=(e||0)%360,e<0?e+360:e}function Lu(e){return Math.max(0,Math.min(1,e||0))}function Jp(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 ew=e=>()=>e;function hF(e,t){return function(n){return e+n*t}}function pF(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 mF(e){return(e=+e)==1?OI:function(t,n){return n-t?pF(t,n,e):ew(isNaN(t)?n:t)}}function OI(e,t){var n=t-e;return n?hF(e,n):ew(isNaN(e)?t:e)}const Ed=(function e(t){var n=mF(t);function r(s,o){var a=n((s=tb(s)).r,(o=tb(o)).r),c=n(s.g,o.g),d=n(s.b,o.b),f=OI(s.opacity,o.opacity);return function(p){return s.r=a(p),s.g=c(p),s.b=d(p),s.opacity=f(p),s+""}}return r.gamma=e,r})(1);function gF(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function yF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xF(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)s[a]=wl(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(c){for(a=0;a<r;++a)o[a]=s[a](c);return o}}function vF(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ar(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bF(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=wl(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var nb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zp=new RegExp(nb.source,"g");function wF(e){return function(){return e}}function kF(e){return function(t){return e(t)+""}}function PI(e,t){var n=nb.lastIndex=Zp.lastIndex=0,r,s,o,a=-1,c=[],d=[];for(e=e+"",t=t+"";(r=nb.exec(e))&&(s=Zp.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),c[a]?c[a]+=o:c[++a]=o),(r=r[0])===(s=s[0])?c[a]?c[a]+=s:c[++a]=s:(c[++a]=null,d.push({i:a,x:Ar(r,s)})),n=Zp.lastIndex;return n<t.length&&(o=t.slice(n),c[a]?c[a]+=o:c[++a]=o),c.length<2?d[0]?kF(d[0].x):wF(t):(t=d.length,function(f){for(var p=0,h;p<t;++p)c[(h=d[p]).i]=h.x(f);return c.join("")})}function wl(e,t){var n=typeof t,r;return t==null||n==="boolean"?ew(t):(n==="number"?Ar:n==="string"?(r=Io(t))?(t=r,Ed):PI:t instanceof Io?Ed:t instanceof Date?vF:yF(t)?gF:Array.isArray(t)?xF:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bF:Ar)(e,t)}var wS=180/Math.PI,rb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function LI(e,t,n,r,s,o){var a,c,d;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,d/=c),e*r<t*n&&(e=-e,t=-t,d=-d,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*wS,skewX:Math.atan(d)*wS,scaleX:a,scaleY:c}}var Du;function NF(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rb:LI(t.a,t.b,t.c,t.d,t.e,t.f)}function SF(e){return e==null||(Du||(Du=document.createElementNS("http://www.w3.org/2000/svg","g")),Du.setAttribute("transform",e),!(e=Du.transform.baseVal.consolidate()))?rb:(e=e.matrix,LI(e.a,e.b,e.c,e.d,e.e,e.f))}function DI(e,t,n,r){function s(f){return f.length?f.pop()+" ":""}function o(f,p,h,g,y,b){if(f!==h||p!==g){var w=y.push("translate(",null,t,null,n);b.push({i:w-4,x:Ar(f,h)},{i:w-2,x:Ar(p,g)})}else(h||g)&&y.push("translate("+h+t+g+n)}function a(f,p,h,g){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),g.push({i:h.push(s(h)+"rotate(",null,r)-2,x:Ar(f,p)})):p&&h.push(s(h)+"rotate("+p+r)}function c(f,p,h,g){f!==p?g.push({i:h.push(s(h)+"skewX(",null,r)-2,x:Ar(f,p)}):p&&h.push(s(h)+"skewX("+p+r)}function d(f,p,h,g,y,b){if(f!==h||p!==g){var w=y.push(s(y)+"scale(",null,",",null,")");b.push({i:w-4,x:Ar(f,h)},{i:w-2,x:Ar(p,g)})}else(h!==1||g!==1)&&y.push(s(y)+"scale("+h+","+g+")")}return function(f,p){var h=[],g=[];return f=e(f),p=e(p),o(f.translateX,f.translateY,p.translateX,p.translateY,h,g),a(f.rotate,p.rotate,h,g),c(f.skewX,p.skewX,h,g),d(f.scaleX,f.scaleY,p.scaleX,p.scaleY,h,g),f=p=null,function(y){for(var b=-1,w=g.length,v;++b<w;)h[(v=g[b]).i]=v.x(y);return h.join("")}}}var CF=DI(NF,"px, ","px)","deg)"),_F=DI(SF,", ",")",")"),EF=1e-12;function kS(e){return((e=Math.exp(e))+1/e)/2}function jF(e){return((e=Math.exp(e))-1/e)/2}function AF(e){return((e=Math.exp(2*e))-1)/(e+1)}const ud=(function e(t,n,r){function s(o,a){var c=o[0],d=o[1],f=o[2],p=a[0],h=a[1],g=a[2],y=p-c,b=h-d,w=y*y+b*b,v,k;if(w<EF)k=Math.log(g/f)/t,v=function(T){return[c+T*y,d+T*b,f*Math.exp(t*T*k)]};else{var _=Math.sqrt(w),N=(g*g-f*f+r*w)/(2*f*n*_),S=(g*g-f*f-r*w)/(2*g*n*_),A=Math.log(Math.sqrt(N*N+1)-N),I=Math.log(Math.sqrt(S*S+1)-S);k=(I-A)/t,v=function(T){var O=T*k,L=kS(A),z=f/(n*_)*(L*AF(t*O+A)-jF(A));return[c+z*y,d+z*b,f*L/kS(t*O+A)]}}return v.duration=k*1e3*t/Math.SQRT2,v}return s.rho=function(o){var a=Math.max(.001,+o),c=a*a,d=c*c;return e(a,c,d)},s})(Math.SQRT2,2,4);var Ki=0,ul=0,sl=0,$I=1e3,jd,dl,Ad=0,Mo=0,Zd=0,Il=typeof performance=="object"&&performance.now?performance:Date,FI=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function tw(){return Mo||(FI(TF),Mo=Il.now()+Zd)}function TF(){Mo=0}function Td(){this._call=this._time=this._next=null}Td.prototype=BI.prototype={constructor:Td,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?tw():+n)+(t==null?0:+t),!this._next&&dl!==this&&(dl?dl._next=this:jd=this,dl=this),this._call=e,this._time=n,sb()},stop:function(){this._call&&(this._call=null,this._time=1/0,sb())}};function BI(e,t,n){var r=new Td;return r.restart(e,t,n),r}function IF(){tw(),++Ki;for(var e=jd,t;e;)(t=Mo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ki}function NS(){Mo=(Ad=Il.now())+Zd,Ki=ul=0;try{IF()}finally{Ki=0,RF(),Mo=0}}function MF(){var e=Il.now(),t=e-Ad;t>$I&&(Zd-=t,Ad=e)}function RF(){for(var e,t=jd,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:jd=n);dl=e,sb(r)}function sb(e){if(!Ki){ul&&(ul=clearTimeout(ul));var t=e-Mo;t>24?(e<1/0&&(ul=setTimeout(NS,e-Il.now()-Zd)),sl&&(sl=clearInterval(sl))):(sl||(Ad=Il.now(),sl=setInterval(MF,$I)),Ki=1,FI(NS))}}function SS(e,t,n){var r=new Td;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var OF=Qd("start","end","cancel","interrupt"),PF=[],qI=0,CS=1,ob=2,dd=3,_S=4,ib=5,fd=6;function ef(e,t,n,r,s,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;LF(e,n,{name:t,index:r,group:s,on:OF,tween:PF,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:qI})}function nw(e,t){var n=gr(e,t);if(n.state>qI)throw new Error("too late; already scheduled");return n}function Wr(e,t){var n=gr(e,t);if(n.state>dd)throw new Error("too late; already running");return n}function gr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function LF(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=BI(o,0,n.time);function o(f){n.state=CS,n.timer.restart(a,n.delay,n.time),n.delay<=f&&a(f-n.delay)}function a(f){var p,h,g,y;if(n.state!==CS)return d();for(p in r)if(y=r[p],y.name===n.name){if(y.state===dd)return SS(a);y.state===_S?(y.state=fd,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[p]):+p<t&&(y.state=fd,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[p])}if(SS(function(){n.state===dd&&(n.state=_S,n.timer.restart(c,n.delay,n.time),c(f))}),n.state=ob,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ob){for(n.state=dd,s=new Array(g=n.tween.length),p=0,h=-1;p<g;++p)(y=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(s[++h]=y);s.length=h+1}}function c(f){for(var p=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(d),n.state=ib,1),h=-1,g=s.length;++h<g;)s[h].call(e,p);n.state===ib&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=fd,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function hd(e,t){var n=e.__transition,r,s,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}s=r.state>ob&&r.state<ib,r.state=fd,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function DF(e){return this.each(function(){hd(this,e)})}function $F(e,t){var n,r;return function(){var s=Wr(this,e),o=s.tween;if(o!==n){r=n=o;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function FF(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=Wr(this,e),a=o.tween;if(a!==r){s=(r=a).slice();for(var c={name:t,value:n},d=0,f=s.length;d<f;++d)if(s[d].name===t){s[d]=c;break}d===f&&s.push(c)}o.tween=s}}function BF(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=gr(this.node(),n).tween,s=0,o=r.length,a;s<o;++s)if((a=r[s]).name===e)return a.value;return null}return this.each((t==null?$F:FF)(n,e,t))}function rw(e,t,n){var r=e._id;return e.each(function(){var s=Wr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return gr(s,r).value[t]}}function zI(e,t){var n;return(typeof t=="number"?Ar:t instanceof Io?Ed:(n=Io(t))?(t=n,Ed):PI)(e,t)}function qF(e){return function(){this.removeAttribute(e)}}function zF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function VF(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===r?o:o=t(r=a,n)}}function HF(e,t,n){var r,s=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===r?o:o=t(r=a,n)}}function UF(e,t,n){var r,s,o;return function(){var a,c=n(this),d;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),d=c+"",a===d?null:a===r&&d===s?o:(s=d,o=t(r=a,c)))}}function WF(e,t,n){var r,s,o;return function(){var a,c=n(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),d=c+"",a===d?null:a===r&&d===s?o:(s=d,o=t(r=a,c)))}}function KF(e,t){var n=Jd(e),r=n==="transform"?_F:zI;return this.attrTween(e,typeof t=="function"?(n.local?WF:UF)(n,r,rw(this,"attr."+e,t)):t==null?(n.local?zF:qF)(n):(n.local?HF:VF)(n,r,t))}function GF(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function YF(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function XF(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&YF(e,o)),n}return s._value=t,s}function QF(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&GF(e,o)),n}return s._value=t,s}function JF(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=Jd(e);return this.tween(n,(r.local?XF:QF)(r,t))}function ZF(e,t){return function(){nw(this,e).delay=+t.apply(this,arguments)}}function e6(e,t){return t=+t,function(){nw(this,e).delay=t}}function t6(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ZF:e6)(t,e)):gr(this.node(),t).delay}function n6(e,t){return function(){Wr(this,e).duration=+t.apply(this,arguments)}}function r6(e,t){return t=+t,function(){Wr(this,e).duration=t}}function s6(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?n6:r6)(t,e)):gr(this.node(),t).duration}function o6(e,t){if(typeof t!="function")throw new Error;return function(){Wr(this,e).ease=t}}function i6(e){var t=this._id;return arguments.length?this.each(o6(t,e)):gr(this.node(),t).ease}function a6(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Wr(this,e).ease=n}}function l6(e){if(typeof e!="function")throw new Error;return this.each(a6(this._id,e))}function c6(e){typeof e!="function"&&(e=vI(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],a=o.length,c=r[s]=[],d,f=0;f<a;++f)(d=o[f])&&e.call(d,d.__data__,f,o)&&c.push(d);return new us(r,this._parents,this._name,this._id)}function u6(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),a=new Array(r),c=0;c<o;++c)for(var d=t[c],f=n[c],p=d.length,h=a[c]=new Array(p),g,y=0;y<p;++y)(g=d[y]||f[y])&&(h[y]=g);for(;c<r;++c)a[c]=t[c];return new us(a,this._parents,this._name,this._id)}function d6(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 f6(e,t,n){var r,s,o=d6(t)?nw:Wr;return function(){var a=o(this,e),c=a.on;c!==r&&(s=(r=c).copy()).on(t,n),a.on=s}}function h6(e,t){var n=this._id;return arguments.length<2?gr(this.node(),n).on.on(e):this.each(f6(n,e,t))}function p6(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function m6(){return this.on("end.remove",p6(this._id))}function g6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qb(e));for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a)for(var c=r[a],d=c.length,f=o[a]=new Array(d),p,h,g=0;g<d;++g)(p=c[g])&&(h=e.call(p,p.__data__,g,c))&&("__data__"in p&&(h.__data__=p.__data__),f[g]=h,ef(f[g],t,n,g,f,gr(p,n)));return new us(o,this._parents,t,n)}function y6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xI(e));for(var r=this._groups,s=r.length,o=[],a=[],c=0;c<s;++c)for(var d=r[c],f=d.length,p,h=0;h<f;++h)if(p=d[h]){for(var g=e.call(p,p.__data__,h,d),y,b=gr(p,n),w=0,v=g.length;w<v;++w)(y=g[w])&&ef(y,t,n,w,g,b);o.push(g),a.push(p)}return new us(o,a,t,n)}var x6=Ql.prototype.constructor;function v6(){return new x6(this._groups,this._parents)}function b6(e,t){var n,r,s;return function(){var o=Wi(this,e),a=(this.style.removeProperty(e),Wi(this,e));return o===a?null:o===n&&a===r?s:s=t(n=o,r=a)}}function VI(e){return function(){this.style.removeProperty(e)}}function w6(e,t,n){var r,s=n+"",o;return function(){var a=Wi(this,e);return a===s?null:a===r?o:o=t(r=a,n)}}function k6(e,t,n){var r,s,o;return function(){var a=Wi(this,e),c=n(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),Wi(this,e))),a===d?null:a===r&&d===s?o:(s=d,o=t(r=a,c))}}function N6(e,t){var n,r,s,o="style."+t,a="end."+o,c;return function(){var d=Wr(this,e),f=d.on,p=d.value[o]==null?c||(c=VI(t)):void 0;(f!==n||s!==p)&&(r=(n=f).copy()).on(a,s=p),d.on=r}}function S6(e,t,n){var r=(e+="")=="transform"?CF:zI;return t==null?this.styleTween(e,b6(e,r)).on("end.style."+e,VI(e)):typeof t=="function"?this.styleTween(e,k6(e,r,rw(this,"style."+e,t))).each(N6(this._id,e)):this.styleTween(e,w6(e,r,t),n).on("end.style."+e,null)}function C6(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _6(e,t,n){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&C6(e,a,n)),r}return o._value=t,o}function E6(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,_6(e,t,n??""))}function j6(e){return function(){this.textContent=e}}function A6(e){return function(){var t=e(this);this.textContent=t??""}}function T6(e){return this.tween("text",typeof e=="function"?A6(rw(this,"text",e)):j6(e==null?"":e+""))}function I6(e){return function(t){this.textContent=e.call(this,t)}}function M6(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&I6(s)),t}return r._value=e,r}function R6(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,M6(e))}function O6(){for(var e=this._name,t=this._id,n=HI(),r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,d,f=0;f<c;++f)if(d=a[f]){var p=gr(d,t);ef(d,e,n,f,a,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new us(r,this._parents,e,n)}function P6(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,a){var c={value:a},d={value:function(){--s===0&&o()}};n.each(function(){var f=Wr(this,r),p=f.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(d)),f.on=t}),s===0&&o()})}var L6=0;function us(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function HI(){return++L6}var rs=Ql.prototype;us.prototype={constructor:us,select:g6,selectAll:y6,selectChild:rs.selectChild,selectChildren:rs.selectChildren,filter:c6,merge:u6,selection:v6,transition:O6,call:rs.call,nodes:rs.nodes,node:rs.node,size:rs.size,empty:rs.empty,each:rs.each,on:h6,attr:KF,attrTween:JF,style:S6,styleTween:E6,text:T6,textTween:R6,remove:m6,tween:BF,delay:t6,duration:s6,ease:i6,easeVarying:l6,end:P6,[Symbol.iterator]:rs[Symbol.iterator]};function D6(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $6={time:null,delay:0,duration:250,ease:D6};function F6(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 B6(e){var t,n;e instanceof us?(t=e._id,e=e._name):(t=HI(),(n=$6).time=tw(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],c=a.length,d,f=0;f<c;++f)(d=a[f])&&ef(d,e,t,f,a,n||F6(d,t));return new us(r,this._parents,e,t)}Ql.prototype.interrupt=DF;Ql.prototype.transition=B6;const $u=e=>()=>e;function q6(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function is(e,t,n){this.k=e,this.x=t,this.y=n}is.prototype={constructor:is,scale:function(e){return e===1?this:new is(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new is(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 tf=new is(1,0,0);UI.prototype=is.prototype;function UI(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tf;return e.__zoom}function em(e){e.stopImmediatePropagation()}function ol(e){e.preventDefault(),e.stopImmediatePropagation()}function z6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function V6(){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 ES(){return this.__zoom||tf}function H6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function U6(){return navigator.maxTouchPoints||"ontouchstart"in this}function W6(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function WI(){var e=z6,t=V6,n=W6,r=H6,s=U6,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,d=ud,f=Qd("start","zoom","end"),p,h,g,y=500,b=150,w=0,v=10;function k(D){D.property("__zoom",ES).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",z).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(D,V,$,U){var B=D.selection?D.selection():D;B.property("__zoom",ES),D!==B?A(D,V,$,U):B.interrupt().each(function(){I(this,arguments).event(U).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},k.scaleBy=function(D,V,$,U){k.scaleTo(D,function(){var B=this.__zoom.k,q=typeof V=="function"?V.apply(this,arguments):V;return B*q},$,U)},k.scaleTo=function(D,V,$,U){k.transform(D,function(){var B=t.apply(this,arguments),q=this.__zoom,Y=$==null?S(B):typeof $=="function"?$.apply(this,arguments):$,F=q.invert(Y),K=typeof V=="function"?V.apply(this,arguments):V;return n(N(_(q,K),Y,F),B,a)},$,U)},k.translateBy=function(D,V,$,U){k.transform(D,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),a)},null,U)},k.translateTo=function(D,V,$,U,B){k.transform(D,function(){var q=t.apply(this,arguments),Y=this.__zoom,F=U==null?S(q):typeof U=="function"?U.apply(this,arguments):U;return n(tf.translate(F[0],F[1]).scale(Y.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof $=="function"?-$.apply(this,arguments):-$),q,a)},U,B)};function _(D,V){return V=Math.max(o[0],Math.min(o[1],V)),V===D.k?D:new is(V,D.x,D.y)}function N(D,V,$){var U=V[0]-$[0]*D.k,B=V[1]-$[1]*D.k;return U===D.x&&B===D.y?D:new is(D.k,U,B)}function S(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function A(D,V,$,U){D.on("start.zoom",function(){I(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(U).end()}).tween("zoom",function(){var B=this,q=arguments,Y=I(B,q).event(U),F=t.apply(B,q),K=$==null?S(F):typeof $=="function"?$.apply(B,q):$,ee=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),W=B.__zoom,X=typeof V=="function"?V.apply(B,q):V,Z=d(W.invert(K).concat(ee/W.k),X.invert(K).concat(ee/X.k));return function(ne){if(ne===1)ne=X;else{var te=Z(ne),ie=ee/te[2];ne=new is(ie,K[0]-te[0]*ie,K[1]-te[1]*ie)}Y.zoom(null,ne)}})}function I(D,V,$){return!$&&D.__zooming||new T(D,V)}function T(D,V){this.that=D,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,V),this.taps=0}T.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,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=An(this.that).datum();f.call(D,this.that,new q6(D,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:f}),V)}};function O(D,...V){if(!e.apply(this,arguments))return;var $=I(this,V).event(D),U=this.__zoom,B=Math.max(o[0],Math.min(o[1],U.k*Math.pow(2,r.apply(this,arguments)))),q=ir(D);if($.wheel)($.mouse[0][0]!==q[0]||$.mouse[0][1]!==q[1])&&($.mouse[1]=U.invert($.mouse[0]=q)),clearTimeout($.wheel);else{if(U.k===B)return;$.mouse=[q,U.invert(q)],hd(this),$.start()}ol(D),$.wheel=setTimeout(Y,b),$.zoom("mouse",n(N(_(U,B),$.mouse[0],$.mouse[1]),$.extent,a));function Y(){$.wheel=null,$.end()}}function L(D,...V){if(g||!e.apply(this,arguments))return;var $=D.currentTarget,U=I(this,V,!0).event(D),B=An(D.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",ee,!0),q=ir(D,$),Y=D.clientX,F=D.clientY;AI(D.view),em(D),U.mouse=[q,this.__zoom.invert(q)],hd(this),U.start();function K(W){if(ol(W),!U.moved){var X=W.clientX-Y,Z=W.clientY-F;U.moved=X*X+Z*Z>w}U.event(W).zoom("mouse",n(N(U.that.__zoom,U.mouse[0]=ir(W,$),U.mouse[1]),U.extent,a))}function ee(W){B.on("mousemove.zoom mouseup.zoom",null),TI(W.view,U.moved),ol(W),U.event(W).end()}}function z(D,...V){if(e.apply(this,arguments)){var $=this.__zoom,U=ir(D.changedTouches?D.changedTouches[0]:D,this),B=$.invert(U),q=$.k*(D.shiftKey?.5:2),Y=n(N(_($,q),U,B),t.apply(this,V),a);ol(D),c>0?An(this).transition().duration(c).call(A,Y,U,D):An(this).call(k.transform,Y,U,D)}}function M(D,...V){if(e.apply(this,arguments)){var $=D.touches,U=$.length,B=I(this,V,D.changedTouches.length===U).event(D),q,Y,F,K;for(em(D),Y=0;Y<U;++Y)F=$[Y],K=ir(F,this),K=[K,this.__zoom.invert(K),F.identifier],B.touch0?!B.touch1&&B.touch0[2]!==K[2]&&(B.touch1=K,B.taps=0):(B.touch0=K,q=!0,B.taps=1+!!p);p&&(p=clearTimeout(p)),q&&(B.taps<2&&(h=K[0],p=setTimeout(function(){p=null},y)),hd(this),B.start())}}function P(D,...V){if(this.__zooming){var $=I(this,V).event(D),U=D.changedTouches,B=U.length,q,Y,F,K;for(ol(D),q=0;q<B;++q)Y=U[q],F=ir(Y,this),$.touch0&&$.touch0[2]===Y.identifier?$.touch0[0]=F:$.touch1&&$.touch1[2]===Y.identifier&&($.touch1[0]=F);if(Y=$.that.__zoom,$.touch1){var ee=$.touch0[0],W=$.touch0[1],X=$.touch1[0],Z=$.touch1[1],ne=(ne=X[0]-ee[0])*ne+(ne=X[1]-ee[1])*ne,te=(te=Z[0]-W[0])*te+(te=Z[1]-W[1])*te;Y=_(Y,Math.sqrt(ne/te)),F=[(ee[0]+X[0])/2,(ee[1]+X[1])/2],K=[(W[0]+Z[0])/2,(W[1]+Z[1])/2]}else if($.touch0)F=$.touch0[0],K=$.touch0[1];else return;$.zoom("touch",n(N(Y,F,K),$.extent,a))}}function H(D,...V){if(this.__zooming){var $=I(this,V).event(D),U=D.changedTouches,B=U.length,q,Y;for(em(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},y),q=0;q<B;++q)Y=U[q],$.touch0&&$.touch0[2]===Y.identifier?delete $.touch0:$.touch1&&$.touch1[2]===Y.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(Y=ir(Y,this),Math.hypot(h[0]-Y[0],h[1]-Y[1])<v)){var F=An(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return k.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:$u(+D),k):r},k.filter=function(D){return arguments.length?(e=typeof D=="function"?D:$u(!!D),k):e},k.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:$u(!!D),k):s},k.extent=function(D){return arguments.length?(t=typeof D=="function"?D:$u([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),k):t},k.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],k):[o[0],o[1]]},k.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],k):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},k.constrain=function(D){return arguments.length?(n=D,k):n},k.duration=function(D){return arguments.length?(c=+D,k):c},k.interpolate=function(D){return arguments.length?(d=D,k):d},k.on=function(){var D=f.on.apply(f,arguments);return D===f?k:D},k.clickDistance=function(D){return arguments.length?(w=(D=+D)*D,k):Math.sqrt(w)},k.tapDistance=function(D){return arguments.length?(v=+D,k):v},k}const Br={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."},Ml=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],KI=["Enter"," ","Escape"],GI={"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 Gi;(function(e){e.Strict="strict",e.Loose="loose"})(Gi||(Gi={}));var To;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(To||(To={}));var Rl;(function(e){e.Partial="partial",e.Full="full"})(Rl||(Rl={}));const YI={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ks;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ks||(Ks={}));var Id;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Id||(Id={}));var ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ge||(ge={}));const jS={[ge.Left]:ge.Right,[ge.Right]:ge.Left,[ge.Top]:ge.Bottom,[ge.Bottom]:ge.Top};function XI(e){return e===null?null:e?"valid":"invalid"}const QI=e=>"id"in e&&"source"in e&&"target"in e,K6=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),sw=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Zl=(e,t=[0,0])=>{const{width:n,height:r}=ms(e),s=e.origin??t,o=n*s[0],a=r*s[1];return{x:e.position.x-o,y:e.position.y-a}},G6=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let a=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(a=o?t.nodeLookup.get(s):sw(s)?s:t.nodeLookup.get(s.id));const c=a?Md(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return nf(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return rf(n)},ec=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=nf(n,Md(s)),r=!0)}),r?rf(n):{x:0,y:0,width:0,height:0}},ow=(e,t,[n,r,s]=[0,0,1],o=!1,a=!1)=>{const c={...nc(t,[n,r,s]),width:t.width/s,height:t.height/s},d=[];for(const f of e.values()){const{measured:p,selectable:h=!0,hidden:g=!1}=f;if(a&&!h||g)continue;const y=p.width??f.width??f.initialWidth??null,b=p.height??f.height??f.initialHeight??null,w=Ol(c,Xi(f)),v=(y??0)*(b??0),k=o&&w>0;(!f.internals.handleBounds||k||w>=v||f.dragging)&&d.push(f)}return d},Y6=(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 X6(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Q6({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},a){if(e.size===0)return Promise.resolve(!0);const c=X6(e,a),d=ec(c),f=iw(d,t,n,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??o,(a==null?void 0:a.padding)??.1);return await r.setViewport(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 JI({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:d,y:f}=c?c.internals.positionAbsolute:{x:0,y:0},p=a.origin??r;let h=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!c)o==null||o("005",Br.error005());else{const y=c.measured.width,b=c.measured.height;y&&b&&(h=[[d,f],[d+y,f+b]])}else c&&Qi(a.extent)&&(h=[[a.extent[0][0]+d,a.extent[0][1]+f],[a.extent[1][0]+d,a.extent[1][1]+f]]);const g=Qi(h)?Ro(t,h,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(o==null||o("015",Br.error015())),{position:{x:g.x-d+(a.measured.width??0)*p[0],y:g.y-f+(a.measured.height??0)*p[1]},positionAbsolute:g}}async function J6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(g=>g.id)),a=[];for(const g of n){if(g.deletable===!1)continue;const y=o.has(g.id),b=!y&&g.parentId&&a.find(w=>w.id===g.parentId);(y||b)&&a.push(g)}const c=new Set(t.map(g=>g.id)),d=r.filter(g=>g.deletable!==!1),p=Y6(a,d);for(const g of d)c.has(g.id)&&!p.find(b=>b.id===g.id)&&p.push(g);if(!s)return{edges:p,nodes:a};const h=await s({nodes:a,edges:p});return typeof h=="boolean"?h?{edges:p,nodes:a}:{edges:[],nodes:[]}:h}const Yi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ro=(e={x:0,y:0},t,n)=>({x:Yi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Yi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ZI(e,t,n){const{width:r,height:s}=ms(n),{x:o,y:a}=n.internals.positionAbsolute;return Ro(e,[[o,a],[o+r,a+s]],t)}const AS=(e,t,n)=>e<t?Yi(Math.abs(e-t),1,t)/t:e>n?-Yi(Math.abs(e-n),1,t)/t:0,eM=(e,t,n=15,r=40)=>{const s=AS(e.x,r,t.width-r)*n,o=AS(e.y,r,t.height-r)*n;return[s,o]},nf=(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)}),ab=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),rf=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Xi=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=sw(e)?e.internals.positionAbsolute:Zl(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Md=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=sw(e)?e.internals.positionAbsolute:Zl(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},tM=(e,t)=>rf(nf(ab(e),ab(t))),Ol=(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)},TS=e=>cr(e.width)&&cr(e.height)&&cr(e.x)&&cr(e.y),cr=e=>!isNaN(e)&&isFinite(e),Z6=(e,t)=>{},tc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nc=({x:e,y:t},[n,r,s],o=!1,a=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return o?tc(c,a):c},Rd=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Si(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 e8(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Si(e,n),s=Si(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Si(e.top??e.y??0,n),s=Si(e.bottom??e.y??0,n),o=Si(e.left??e.x??0,t),a=Si(e.right??e.x??0,t);return{top:r,right:a,bottom:s,left:o,x:o+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function t8(e,t,n,r,s,o){const{x:a,y:c}=Rd(e,[t,n,r]),{x:d,y:f}=Rd({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=s-d,h=o-f;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(p),bottom:Math.floor(h)}}const iw=(e,t,n,r,s,o)=>{const a=e8(o,t,n),c=(t-a.x)/e.width,d=(n-a.y)/e.height,f=Math.min(c,d),p=Yi(f,r,s),h=e.x+e.width/2,g=e.y+e.height/2,y=t/2-h*p,b=n/2-g*p,w=t8(e,y,b,p,t,n),v={left:Math.min(w.left-a.left,0),top:Math.min(w.top-a.top,0),right:Math.min(w.right-a.right,0),bottom:Math.min(w.bottom-a.bottom,0)};return{x:y-v.left+v.right,y:b-v.top+v.bottom,zoom:p}},Pl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Qi(e){return e!=null&&e!=="parent"}function ms(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 nM(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 rM(e,t={width:0,height:0},n,r,s){const o={...e},a=r.get(n);if(a){const c=a.origin||s;o.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],o.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return o}function IS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function n8(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function r8(e){return{...GI,...e||{}}}function kl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:a}=ur(e),c=nc({x:o-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:d,y:f}=n?tc(c,t):c;return{xSnapped:d,ySnapped:f,...c}}const aw=e=>({width:e.offsetWidth,height:e.offsetHeight}),sM=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},s8=["INPUT","SELECT","TEXTAREA"];function oM(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:s8.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const iM=e=>"clientX"in e,ur=(e,t)=>{var o,a;const n=iM(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},MS=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...aw(a)}})};function aM({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:a,targetControlY:c}){const d=e*.125+s*.375+a*.375+n*.125,f=t*.125+o*.375+c*.375+r*.125,p=Math.abs(d-e),h=Math.abs(f-t);return[d,f,p,h]}function Fu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function RS({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case ge.Left:return[t-Fu(t-r,o),n];case ge.Right:return[t+Fu(r-t,o),n];case ge.Top:return[t,n-Fu(n-s,o)];case ge.Bottom:return[t,n+Fu(s-n,o)]}}function lM({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:r,targetY:s,targetPosition:o=ge.Top,curvature:a=.25}){const[c,d]=RS({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[f,p]=RS({pos:o,x1:r,y1:s,x2:e,y2:t,c:a}),[h,g,y,b]=aM({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:d,targetControlX:f,targetControlY:p});return[`M${e},${t} C${c},${d} ${f},${p} ${r},${s}`,h,g,y,b]}function cM({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[o,c,s,a]}function o8({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const a=s&&n?r+1e3:r,c=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return a+c}function i8({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=nf(Md(e),Md(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const a={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return Ol(a,rf(o))>0}const a8=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,l8=(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)),uM=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||a8;let s;return QI(e)?s={...e}:s={...e,id:r(e)},l8(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function dM({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,a,c]=cM({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,a,c]}const OS={[ge.Left]:{x:-1,y:0},[ge.Right]:{x:1,y:0},[ge.Top]:{x:0,y:-1},[ge.Bottom]:{x:0,y:1}},c8=({source:e,sourcePosition:t=ge.Bottom,target:n})=>t===ge.Left||t===ge.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},PS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function u8({source:e,sourcePosition:t=ge.Bottom,target:n,targetPosition:r=ge.Top,center:s,offset:o,stepPosition:a}){const c=OS[t],d=OS[r],f={x:e.x+c.x*o,y:e.y+c.y*o},p={x:n.x+d.x*o,y:n.y+d.y*o},h=c8({source:f,sourcePosition:t,target:p}),g=h.x!==0?"x":"y",y=h[g];let b=[],w,v;const k={x:0,y:0},_={x:0,y:0},[,,N,S]=cM({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*d[g]===-1){g==="x"?(w=s.x??f.x+(p.x-f.x)*a,v=s.y??(f.y+p.y)/2):(w=s.x??(f.x+p.x)/2,v=s.y??f.y+(p.y-f.y)*a);const I=[{x:w,y:f.y},{x:w,y:p.y}],T=[{x:f.x,y:v},{x:p.x,y:v}];c[g]===y?b=g==="x"?I:T:b=g==="x"?T:I}else{const I=[{x:f.x,y:p.y}],T=[{x:p.x,y:f.y}];if(g==="x"?b=c.x===y?T:I:b=c.y===y?I:T,t===r){const P=Math.abs(e[g]-n[g]);if(P<=o){const H=Math.min(o-1,o-P);c[g]===y?k[g]=(f[g]>e[g]?-1:1)*H:_[g]=(p[g]>n[g]?-1:1)*H}}if(t!==r){const P=g==="x"?"y":"x",H=c[g]===d[P],D=f[P]>p[P],V=f[P]<p[P];(c[g]===1&&(!H&&D||H&&V)||c[g]!==1&&(!H&&V||H&&D))&&(b=g==="x"?I:T)}const O={x:f.x+k.x,y:f.y+k.y},L={x:p.x+_.x,y:p.y+_.y},z=Math.max(Math.abs(O.x-b[0].x),Math.abs(L.x-b[0].x)),M=Math.max(Math.abs(O.y-b[0].y),Math.abs(L.y-b[0].y));z>=M?(w=(O.x+L.x)/2,v=b[0].y):(w=b[0].x,v=(O.y+L.y)/2)}return[[e,{x:f.x+k.x,y:f.y+k.y},...b,{x:p.x+_.x,y:p.y+_.y},n],w,v,N,S]}function d8(e,t,n,r){const s=Math.min(PS(e,t)/2,PS(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,p=e.y<n.y?1:-1;return`L ${o+s*f},${a}Q ${o},${a} ${o},${a+s*p}`}const c=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${o},${a+s*d}Q ${o},${a} ${o+s*c},${a}`}function lb({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:r,targetY:s,targetPosition:o=ge.Top,borderRadius:a=5,centerX:c,centerY:d,offset:f=20,stepPosition:p=.5}){const[h,g,y,b,w]=u8({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:c,y:d},offset:f,stepPosition:p});return[h.reduce((k,_,N)=>{let S="";return N>0&&N<h.length-1?S=d8(h[N-1],_,h[N+1],a):S=`${N===0?"M":"L"}${_.x} ${_.y}`,k+=S,k},""),g,y,b,w]}function LS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function f8(e){var h;const{sourceNode:t,targetNode:n}=e;if(!LS(t)||!LS(n))return null;const r=t.internals.handleBounds||DS(t.handles),s=n.internals.handleBounds||DS(n.handles),o=$S((r==null?void 0:r.source)??[],e.sourceHandle),a=$S(e.connectionMode===Gi.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!a)return(h=e.onError)==null||h.call(e,"008",Br.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(o==null?void 0:o.position)||ge.Bottom,d=(a==null?void 0:a.position)||ge.Top,f=Oo(t,o,c),p=Oo(n,a,d);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:c,targetPosition:d}}function DS(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 Oo(e,t,n=ge.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??ms(e);if(r)return{x:s+a/2,y:o+c/2};switch((t==null?void 0:t.position)??n){case ge.Top:return{x:s+a/2,y:o};case ge.Right:return{x:s+a,y:o+c/2};case ge.Bottom:return{x:s+a/2,y:o+c};case ge.Left:return{x:s,y:o+c/2}}}function $S(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function cb(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function h8(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||s].forEach(d=>{if(d&&typeof d=="object"){const f=cb(d,t);o.has(f)||(a.push({id:f,color:d.color||n,...d}),o.add(f))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const fM=1e3,p8=10,lw={nodeOrigin:[0,0],nodeExtent:Ml,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},m8={...lw,checkEquality:!0};function cw(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function g8(e,t,n){const r=cw(lw,n);for(const s of e.values())if(s.parentId)dw(s,e,t,r);else{const o=Zl(s,r.nodeOrigin),a=Qi(s.extent)?s.extent:r.nodeExtent,c=Ro(o,a,ms(s));s.internals.positionAbsolute=c}}function y8(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function uw(e){return e==="manual"}function ub(e,t,n,r={}){var f,p;const s=cw(m8,r),o={i:0},a=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!uw(s.zIndexMode)?fM:0;let d=e.length>0;t.clear(),n.clear();for(const h of e){let g=a.get(h.id);if(s.checkEquality&&h===(g==null?void 0:g.internals.userNode))t.set(h.id,g);else{const y=Zl(h,s.nodeOrigin),b=Qi(h.extent)?h.extent:s.nodeExtent,w=Ro(y,b,ms(h));g={...s.defaults,...h,measured:{width:(f=h.measured)==null?void 0:f.width,height:(p=h.measured)==null?void 0:p.height},internals:{positionAbsolute:w,handleBounds:y8(h,g),z:hM(h,c,s.zIndexMode),userNode:h}},t.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(d=!1),h.parentId&&dw(g,t,n,r,o)}return d}function x8(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 dw(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:a,nodeExtent:c,zIndexMode:d}=cw(lw,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}x8(e,n),s&&!p.parentId&&p.internals.rootParentIndex===void 0&&d==="auto"&&(p.internals.rootParentIndex=++s.i,p.internals.z=p.internals.z+s.i*p8),s&&p.internals.rootParentIndex!==void 0&&(s.i=p.internals.rootParentIndex);const h=o&&!uw(d)?fM:0,{x:g,y,z:b}=v8(e,p,a,c,h,d),{positionAbsolute:w}=e.internals,v=g!==w.x||y!==w.y;(v||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:g,y}:w,z:b}})}function hM(e,t,n){const r=cr(e.zIndex)?e.zIndex:0;return uw(n)?r:r+(e.selected?t:0)}function v8(e,t,n,r,s,o){const{x:a,y:c}=t.internals.positionAbsolute,d=ms(e),f=Zl(e,n),p=Qi(e.extent)?Ro(f,e.extent,d):f;let h=Ro({x:a+p.x,y:c+p.y},r,d);e.extent==="parent"&&(h=ZI(h,d,t));const g=hM(e,s,o),y=t.internals.z??0;return{x:h.x,y:h.y,z:y>=g?y+1:g}}function fw(e,t,n,r=[0,0]){var a;const s=[],o=new Map;for(const c of e){const d=t.get(c.parentId);if(!d)continue;const f=((a=o.get(c.parentId))==null?void 0:a.expandedRect)??Xi(d),p=tM(f,c.rect);o.set(c.parentId,{expandedRect:p,parent:d})}return o.size>0&&o.forEach(({expandedRect:c,parent:d},f)=>{var N;const p=d.internals.positionAbsolute,h=ms(d),g=d.origin??r,y=c.x<p.x?Math.round(Math.abs(p.x-c.x)):0,b=c.y<p.y?Math.round(Math.abs(p.y-c.y)):0,w=Math.max(h.width,Math.round(c.width)),v=Math.max(h.height,Math.round(c.height)),k=(w-h.width)*g[0],_=(v-h.height)*g[1];(y>0||b>0||k||_)&&(s.push({id:f,type:"position",position:{x:d.position.x-y+k,y:d.position.y-b+_}}),(N=n.get(f))==null||N.forEach(S=>{e.some(A=>A.id===S.id)||s.push({id:S.id,type:"position",position:{x:S.position.x+y,y:S.position.y+b}})})),(h.width<c.width||h.height<c.height||y||b)&&s.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?g[0]*y-k:0),height:v+(b?g[1]*b-_:0)}})}),s}function b8(e,t,n,r,s,o,a){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let d=!1;if(!c)return{changes:[],updatedInternals:d};const f=[],p=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(p.transform),g=[];for(const y of e.values()){const b=t.get(y.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),d=!0;continue}const w=aw(y.nodeElement),v=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(v||!b.internals.handleBounds||y.force))){const _=y.nodeElement.getBoundingClientRect(),N=Qi(b.extent)?b.extent:o;let{positionAbsolute:S}=b.internals;b.parentId&&b.extent==="parent"?S=ZI(S,w,t.get(b.parentId)):N&&(S=Ro(S,N,w));const A={...b,measured:w,internals:{...b.internals,positionAbsolute:S,handleBounds:{source:MS("source",y.nodeElement,_,h,b.id),target:MS("target",y.nodeElement,_,h,b.id)}}};t.set(b.id,A),b.parentId&&dw(A,t,n,{nodeOrigin:s,zIndexMode:a}),d=!0,v&&(f.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:Xi(A,s)}))}}if(g.length>0){const y=fw(g,t,n,s);f.push(...y)}return{changes:f,updatedInternals:d}}async function w8({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),c=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(c)}function FS(e,t,n,r,s,o){let a=s;const c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${s}-${e}`;const d=r.get(a)||new Map;if(r.set(a,d.set(n,t)),o){a=`${s}-${e}-${o}`;const f=r.get(a)||new Map;r.set(a,f.set(n,t))}}function pM(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:a=null,targetHandle:c=null}=r,d={edgeId:r.id,source:s,target:o,sourceHandle:a,targetHandle:c},f=`${s}-${a}--${o}-${c}`,p=`${o}-${c}--${s}-${a}`;FS("source",d,p,e,s,a),FS("target",d,f,e,o,c),t.set(r.id,r)}}function mM(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:mM(n,t):!1}function BS(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function k8(e,t,n,r){const s=new Map;for(const[o,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!mM(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const c=e.get(o);c&&s.set(o,{id:o,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function tm({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,c,d;const s=[];for(const[f,p]of t){const h=(a=n.get(f))==null?void 0:a.internals.userNode;h&&s.push({...h,position:p.position,dragging:r})}if(!e)return[s[0],s];const o=(c=n.get(e))==null?void 0:c.internals.userNode;return[o?{...o,position:((d=t.get(e))==null?void 0:d.position)||o.position,dragging:r}:s[0],s]}function N8({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},a=tc(o,t);return{x:a.x-o.x,y:a.y-o.y}}function S8({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},a=0,c=new Map,d=!1,f={x:0,y:0},p=null,h=!1,g=null,y=!1,b=!1,w=null;function v({noDragClassName:_,handleSelector:N,domNode:S,isSelectable:A,nodeId:I,nodeClickDistance:T=0}){g=An(S);function O({x:P,y:H}){const{nodeLookup:D,nodeExtent:V,snapGrid:$,snapToGrid:U,nodeOrigin:B,onNodeDrag:q,onSelectionDrag:Y,onError:F,updateNodePositions:K}=t();o={x:P,y:H};let ee=!1;const W=c.size>1,X=W&&V?ab(ec(c)):null,Z=W&&U?N8({dragItems:c,snapGrid:$,x:P,y:H}):null;for(const[ne,te]of c){if(!D.has(ne))continue;let ie={x:P-te.distance.x,y:H-te.distance.y};U&&(ie=Z?{x:Math.round(ie.x+Z.x),y:Math.round(ie.y+Z.y)}:tc(ie,$));let he=null;if(W&&V&&!te.extent&&X){const{positionAbsolute:ye}=te.internals,_e=ye.x-X.x+V[0][0],we=ye.x+te.measured.width-X.x2+V[1][0],Te=ye.y-X.y+V[0][1],Ne=ye.y+te.measured.height-X.y2+V[1][1];he=[[_e,Te],[we,Ne]]}const{position:xe,positionAbsolute:ve}=JI({nodeId:ne,nextPosition:ie,nodeLookup:D,nodeExtent:he||V,nodeOrigin:B,onError:F});ee=ee||te.position.x!==xe.x||te.position.y!==xe.y,te.position=xe,te.internals.positionAbsolute=ve}if(b=b||ee,!!ee&&(K(c,!0),w&&(r||q||!I&&Y))){const[ne,te]=tm({nodeId:I,dragItems:c,nodeLookup:D});r==null||r(w,c,ne,te),q==null||q(w,ne,te),I||Y==null||Y(w,te)}}async function L(){if(!p)return;const{transform:P,panBy:H,autoPanSpeed:D,autoPanOnNodeDrag:V}=t();if(!V){d=!1,cancelAnimationFrame(a);return}const[$,U]=eM(f,p,D);($!==0||U!==0)&&(o.x=(o.x??0)-$/P[2],o.y=(o.y??0)-U/P[2],await H({x:$,y:U})&&O(o)),a=requestAnimationFrame(L)}function z(P){var W;const{nodeLookup:H,multiSelectionActive:D,nodesDraggable:V,transform:$,snapGrid:U,snapToGrid:B,selectNodesOnDrag:q,onNodeDragStart:Y,onSelectionDragStart:F,unselectNodesAndEdges:K}=t();h=!0,(!q||!A)&&!D&&I&&((W=H.get(I))!=null&&W.selected||K()),A&&q&&I&&(e==null||e(I));const ee=kl(P.sourceEvent,{transform:$,snapGrid:U,snapToGrid:B,containerBounds:p});if(o=ee,c=k8(H,V,ee,I),c.size>0&&(n||Y||!I&&F)){const[X,Z]=tm({nodeId:I,dragItems:c,nodeLookup:H});n==null||n(P.sourceEvent,c,X,Z),Y==null||Y(P.sourceEvent,X,Z),I||F==null||F(P.sourceEvent,Z)}}const M=II().clickDistance(T).on("start",P=>{const{domNode:H,nodeDragThreshold:D,transform:V,snapGrid:$,snapToGrid:U}=t();p=(H==null?void 0:H.getBoundingClientRect())||null,y=!1,b=!1,w=P.sourceEvent,D===0&&z(P),o=kl(P.sourceEvent,{transform:V,snapGrid:$,snapToGrid:U,containerBounds:p}),f=ur(P.sourceEvent,p)}).on("drag",P=>{const{autoPanOnNodeDrag:H,transform:D,snapGrid:V,snapToGrid:$,nodeDragThreshold:U,nodeLookup:B}=t(),q=kl(P.sourceEvent,{transform:D,snapGrid:V,snapToGrid:$,containerBounds:p});if(w=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||I&&!B.has(I))&&(y=!0),!y){if(!d&&H&&h&&(d=!0,L()),!h){const Y=ur(P.sourceEvent,p),F=Y.x-f.x,K=Y.y-f.y;Math.sqrt(F*F+K*K)>U&&z(P)}(o.x!==q.xSnapped||o.y!==q.ySnapped)&&c&&h&&(f=ur(P.sourceEvent,p),O(q))}}).on("end",P=>{if(!(!h||y)&&(d=!1,h=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:H,updateNodePositions:D,onNodeDragStop:V,onSelectionDragStop:$}=t();if(b&&(D(c,!1),b=!1),s||V||!I&&$){const[U,B]=tm({nodeId:I,dragItems:c,nodeLookup:H,dragging:!1});s==null||s(P.sourceEvent,c,U,B),V==null||V(P.sourceEvent,U,B),I||$==null||$(P.sourceEvent,B)}}}).filter(P=>{const H=P.target;return!P.button&&(!_||!BS(H,`.${_}`,S))&&(!N||BS(H,N,S))});g.call(M)}function k(){g==null||g.on(".drag",null)}return{update:v,destroy:k}}function C8(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Ol(s,Xi(o))>0&&r.push(o);return r}const _8=250;function E8(e,t,n,r){var c,d;let s=[],o=1/0;const a=C8(e,n,t+_8);for(const f of a){const p=[...((c=f.internals.handleBounds)==null?void 0:c.source)??[],...((d=f.internals.handleBounds)==null?void 0:d.target)??[]];for(const h of p){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:g,y}=Oo(f,h,h.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));b>t||(b<o?(s=[{...h,x:g,y}],o=b):b===o&&s.push({...h,x:g,y}))}}if(!s.length)return null;if(s.length>1){const f=r.type==="source"?"target":"source";return s.find(p=>p.type===f)??s[0]}return s[0]}function gM(e,t,n,r,s,o=!1){var f,p,h;const a=r.get(e);if(!a)return null;const c=s==="strict"?(f=a.internals.handleBounds)==null?void 0:f[t]:[...((p=a.internals.handleBounds)==null?void 0:p.source)??[],...((h=a.internals.handleBounds)==null?void 0:h.target)??[]],d=(n?c==null?void 0:c.find(g=>g.id===n):c==null?void 0:c[0])??null;return d&&o?{...d,...Oo(a,d,d.position,!0)}:d}function yM(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function j8(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const xM=()=>!0;function A8(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:a,domNode:c,nodeLookup:d,lib:f,autoPanOnConnect:p,flowId:h,panBy:g,cancelConnection:y,onConnectStart:b,onConnect:w,onConnectEnd:v,isValidConnection:k=xM,onReconnectEnd:_,updateConnection:N,getTransform:S,getFromHandle:A,autoPanSpeed:I,dragThreshold:T=1,handleDomNode:O}){const L=sM(e.target);let z=0,M;const{x:P,y:H}=ur(e),D=yM(o,O),V=c==null?void 0:c.getBoundingClientRect();let $=!1;if(!V||!D)return;const U=gM(s,D,r,d,t);if(!U)return;let B=ur(e,V),q=!1,Y=null,F=!1,K=null;function ee(){if(!p||!V)return;const[xe,ve]=eM(B,V,I);g({x:xe,y:ve}),z=requestAnimationFrame(ee)}const W={...U,nodeId:s,type:D,position:U.position},X=d.get(s);let ne={inProgress:!0,isValid:null,from:Oo(X,W,ge.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:X,to:B,toHandle:null,toPosition:jS[W.position],toNode:null,pointer:B};function te(){$=!0,N(ne),b==null||b(e,{nodeId:s,handleId:r,handleType:D})}T===0&&te();function ie(xe){if(!$){const{x:Ne,y:Je}=ur(xe),Fe=Ne-P,_t=Je-H;if(!(Fe*Fe+_t*_t>T*T))return;te()}if(!A()||!W){he(xe);return}const ve=S();B=ur(xe,V),M=E8(nc(B,ve,!1,[1,1]),n,d,W),q||(ee(),q=!0);const ye=vM(xe,{handle:M,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:k,doc:L,lib:f,flowId:h,nodeLookup:d});K=ye.handleDomNode,Y=ye.connection,F=j8(!!M,ye.isValid);const _e=d.get(s),we=_e?Oo(_e,W,ge.Left,!0):ne.from,Te={...ne,from:we,isValid:F,to:ye.toHandle&&F?Rd({x:ye.toHandle.x,y:ye.toHandle.y},ve):B,toHandle:ye.toHandle,toPosition:F&&ye.toHandle?ye.toHandle.position:jS[W.position],toNode:ye.toHandle?d.get(ye.toHandle.nodeId):null,pointer:B};N(Te),ne=Te}function he(xe){if(!("touches"in xe&&xe.touches.length>0)){if($){(M||K)&&Y&&F&&(w==null||w(Y));const{inProgress:ve,...ye}=ne,_e={...ye,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(xe,_e),o&&(_==null||_(xe,_e))}y(),cancelAnimationFrame(z),q=!1,F=!1,Y=null,K=null,L.removeEventListener("mousemove",ie),L.removeEventListener("mouseup",he),L.removeEventListener("touchmove",ie),L.removeEventListener("touchend",he)}}L.addEventListener("mousemove",ie),L.addEventListener("mouseup",he),L.addEventListener("touchmove",ie),L.addEventListener("touchend",he)}function vM(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:a,lib:c,flowId:d,isValidConnection:f=xM,nodeLookup:p}){const h=o==="target",g=t?a.querySelector(`.${c}-flow__handle[data-id="${d}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:b}=ur(e),w=a.elementFromPoint(y,b),v=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:g,k={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const _=yM(void 0,v),N=v.getAttribute("data-nodeid"),S=v.getAttribute("data-handleid"),A=v.classList.contains("connectable"),I=v.classList.contains("connectableend");if(!N||!_)return k;const T={source:h?N:r,sourceHandle:h?S:s,target:h?r:N,targetHandle:h?s:S};k.connection=T;const L=A&&I&&(n===Gi.Strict?h&&_==="source"||!h&&_==="target":N!==r||S!==s);k.isValid=L&&f(T),k.toHandle=gM(N,_,S,p,n,!0)}return k}const db={onPointerDown:A8,isValid:vM};function T8({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=An(e);function o({translateExtent:c,width:d,height:f,zoomStep:p=1,pannable:h=!0,zoomable:g=!0,inversePan:y=!1}){const b=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const S=n(),A=N.sourceEvent.ctrlKey&&Pl()?10:1,I=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*p,T=S[2]*Math.pow(2,I*A);t.scaleTo(T)};let w=[0,0];const v=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(w=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},k=N=>{const S=n();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;const A=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],I=[A[0]-w[0],A[1]-w[1]];w=A;const T=r()*Math.max(S[2],Math.log(S[2]))*(y?-1:1),O={x:S[0]-I[0]*T,y:S[1]-I[1]*T},L=[[0,0],[d,f]];t.setViewportConstrained({x:O.x,y:O.y,zoom:S[2]},L,c)},_=WI().on("start",v).on("zoom",h?k:null).on("zoom.wheel",g?b:null);s.call(_,{})}function a(){s.on("zoom",null)}return{update:o,destroy:a,pointer:ir}}const sf=e=>({x:e.x,y:e.y,zoom:e.k}),nm=({x:e,y:t,zoom:n})=>tf.translate(e,t).scale(n),Mi=(e,t)=>e.target.closest(`.${t}`),bM=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),I8=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rm=(e,t=0,n=I8,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},wM=e=>{const t=e.ctrlKey&&Pl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function M8({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:d,onPanZoomEnd:f}){return p=>{if(Mi(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(p.ctrlKey&&a){const v=ir(p),k=wM(p),_=h*Math.pow(2,k);r.scaleTo(n,_,v,p);return}const g=p.deltaMode===1?20:1;let y=s===To.Vertical?0:p.deltaX*g,b=s===To.Horizontal?0:p.deltaY*g;!Pl()&&p.shiftKey&&s!==To.Vertical&&(y=p.deltaY*g,b=0),r.translateBy(n,-(y/h)*o,-(b/h)*o,{internal:!0});const w=sf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d==null||d(p,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(p,w))}}function R8({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",a=!t&&o&&!r.ctrlKey,c=Mi(r,e);if(r.ctrlKey&&o&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,s)}}function O8({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,a,c;if((o=r.sourceEvent)!=null&&o.internal)return;const s=sf(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function P8({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var a,c;e.usedRightMouseButton=!!(n&&bM(t,e.mouseButton??0)),(a=o.sourceEvent)!=null&&a.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((c=o.sourceEvent)!=null&&c.internal)&&(s==null||s(o.sourceEvent,sf(o.transform)))}}function L8({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,o&&bM(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&o(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const d=sf(a.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,d)},n?150:0)}}}function D8({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:a,noWheelClassName:c,noPanClassName:d,lib:f,connectionInProgress:p}){return h=>{var v;const g=e||t,y=n&&h.ctrlKey,b=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Mi(h,`${f}-flow__node`)||Mi(h,`${f}-flow__edge`)))return!0;if(!r&&!g&&!s&&!o&&!n||a||p&&!b||Mi(h,c)&&b||Mi(h,d)&&(!b||s&&b&&!e)||!n&&h.ctrlKey&&b)return!1;if(!n&&h.type==="touchstart"&&((v=h.touches)==null?void 0:v.length)>1)return h.preventDefault(),!1;if(!g&&!s&&!y&&b||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||b)&&w}}function $8({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),h=WI().scaleExtent([t,n]).translateExtent(r),g=An(e).call(h);_({x:s.x,y:s.y,zoom:Yi(s.zoom,t,n)},[[0,0],[p.width,p.height]],r);const y=g.on("wheel.zoom"),b=g.on("dblclick.zoom");h.wheelDelta(wM);function w(M,P){return g?new Promise(H=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?wl:ud).transform(rm(g,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>H(!0)),M)}):Promise.resolve(!1)}function v({noWheelClassName:M,noPanClassName:P,onPaneContextMenu:H,userSelectionActive:D,panOnScroll:V,panOnDrag:$,panOnScrollMode:U,panOnScrollSpeed:B,preventScrolling:q,zoomOnPinch:Y,zoomOnScroll:F,zoomOnDoubleClick:K,zoomActivationKeyPressed:ee,lib:W,onTransformChange:X,connectionInProgress:Z,paneClickDistance:ne,selectionOnDrag:te}){D&&!f.isZoomingOrPanning&&k();const ie=V&&!ee&&!D;h.clickDistance(te?1/0:!cr(ne)||ne<0?0:ne);const he=ie?M8({zoomPanValues:f,noWheelClassName:M,d3Selection:g,d3Zoom:h,panOnScrollMode:U,panOnScrollSpeed:B,zoomOnPinch:Y,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:c}):R8({noWheelClassName:M,preventScrolling:q,d3ZoomHandler:y});if(g.on("wheel.zoom",he,{passive:!1}),!D){const ve=O8({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:a});h.on("start",ve);const ye=P8({zoomPanValues:f,panOnDrag:$,onPaneContextMenu:!!H,onPanZoom:o,onTransformChange:X});h.on("zoom",ye);const _e=L8({zoomPanValues:f,panOnDrag:$,panOnScroll:V,onPaneContextMenu:H,onPanZoomEnd:c,onDraggingChange:d});h.on("end",_e)}const xe=D8({zoomActivationKeyPressed:ee,panOnDrag:$,zoomOnScroll:F,panOnScroll:V,zoomOnDoubleClick:K,zoomOnPinch:Y,userSelectionActive:D,noPanClassName:P,noWheelClassName:M,lib:W,connectionInProgress:Z});h.filter(xe),K?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function k(){h.on("zoom",null)}async function _(M,P,H){const D=nm(M),V=h==null?void 0:h.constrain()(D,P,H);return V&&await w(V),new Promise($=>$(V))}async function N(M,P){const H=nm(M);return await w(H,P),new Promise(D=>D(H))}function S(M){if(g){const P=nm(M),H=g.property("__zoom");(H.k!==M.zoom||H.x!==M.x||H.y!==M.y)&&(h==null||h.transform(g,P,null,{sync:!0}))}}function A(){const M=g?UI(g.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function I(M,P){return g?new Promise(H=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?wl:ud).scaleTo(rm(g,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>H(!0)),M)}):Promise.resolve(!1)}function T(M,P){return g?new Promise(H=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?wl:ud).scaleBy(rm(g,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>H(!0)),M)}):Promise.resolve(!1)}function O(M){h==null||h.scaleExtent(M)}function L(M){h==null||h.translateExtent(M)}function z(M){const P=!cr(M)||M<0?0:M;h==null||h.clickDistance(P)}return{update:v,destroy:k,setViewport:N,setViewportConstrained:_,getViewport:A,scaleTo:I,scaleBy:T,setScaleExtent:O,setTranslateExtent:L,syncViewport:S,setClickDistance:z}}var Po;(function(e){e.Line="line",e.Handle="handle"})(Po||(Po={}));const F8=["top-left","top-right","bottom-left","bottom-right"],B8=["top","right","bottom","left"];function q8({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const a=e-t,c=n-r,d=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&s&&(d[0]=d[0]*-1),c&&o&&(d[1]=d[1]*-1),d}function qS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function $s(e,t){return Math.max(0,t-e)}function Fs(e,t){return Math.max(0,e-t)}function Bu(e,t,n){return Math.max(0,t-e,e-n)}function zS(e,t){return e?!t:t}function z8(e,t,n,r,s,o,a,c){let{affectsX:d,affectsY:f}=t;const{isHorizontal:p,isVertical:h}=t,g=p&&h,{xSnapped:y,ySnapped:b}=n,{minWidth:w,maxWidth:v,minHeight:k,maxHeight:_}=r,{x:N,y:S,width:A,height:I,aspectRatio:T}=e;let O=Math.floor(p?y-e.pointerX:0),L=Math.floor(h?b-e.pointerY:0);const z=A+(d?-O:O),M=I+(f?-L:L),P=-o[0]*A,H=-o[1]*I;let D=Bu(z,w,v),V=Bu(M,k,_);if(a){let B=0,q=0;d&&O<0?B=$s(N+O+P,a[0][0]):!d&&O>0&&(B=Fs(N+z+P,a[1][0])),f&&L<0?q=$s(S+L+H,a[0][1]):!f&&L>0&&(q=Fs(S+M+H,a[1][1])),D=Math.max(D,B),V=Math.max(V,q)}if(c){let B=0,q=0;d&&O>0?B=Fs(N+O,c[0][0]):!d&&O<0&&(B=$s(N+z,c[1][0])),f&&L>0?q=Fs(S+L,c[0][1]):!f&&L<0&&(q=$s(S+M,c[1][1])),D=Math.max(D,B),V=Math.max(V,q)}if(s){if(p){const B=Bu(z/T,k,_)*T;if(D=Math.max(D,B),a){let q=0;!d&&!f||d&&!f&&g?q=Fs(S+H+z/T,a[1][1])*T:q=$s(S+H+(d?O:-O)/T,a[0][1])*T,D=Math.max(D,q)}if(c){let q=0;!d&&!f||d&&!f&&g?q=$s(S+z/T,c[1][1])*T:q=Fs(S+(d?O:-O)/T,c[0][1])*T,D=Math.max(D,q)}}if(h){const B=Bu(M*T,w,v)/T;if(V=Math.max(V,B),a){let q=0;!d&&!f||f&&!d&&g?q=Fs(N+M*T+P,a[1][0])/T:q=$s(N+(f?L:-L)*T+P,a[0][0])/T,V=Math.max(V,q)}if(c){let q=0;!d&&!f||f&&!d&&g?q=$s(N+M*T,c[1][0])/T:q=Fs(N+(f?L:-L)*T,c[0][0])/T,V=Math.max(V,q)}}}L=L+(L<0?V:-V),O=O+(O<0?D:-D),s&&(g?z>M*T?L=(zS(d,f)?-O:O)/T:O=(zS(d,f)?-L:L)*T:p?(L=O/T,f=d):(O=L*T,d=f));const $=d?N+O:N,U=f?S+L:S;return{width:A+(d?-O:O),height:I+(f?-L:L),x:o[0]*O*(d?-1:1)+$,y:o[1]*L*(f?-1:1)+U}}const kM={width:0,height:0,x:0,y:0},V8={...kM,pointerX:0,pointerY:0,aspectRatio:1};function H8(e){return[[0,0],[e.measured.width,e.measured.height]]}function U8(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,a=e.measured.height??0,c=n[0]*o,d=n[1]*a;return[[r-c,s-d],[r+o-c,s+a-d]]}function W8({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=An(e);let a={controlDirection:qS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:f,boundaries:p,keepAspectRatio:h,resizeDirection:g,onResizeStart:y,onResize:b,onResizeEnd:w,shouldResize:v}){let k={...kM},_={...V8};a={boundaries:p,resizeDirection:g,keepAspectRatio:h,controlDirection:qS(f)};let N,S=null,A=[],I,T,O,L=!1;const z=II().on("start",M=>{const{nodeLookup:P,transform:H,snapGrid:D,snapToGrid:V,nodeOrigin:$,paneDomNode:U}=n();if(N=P.get(t),!N)return;S=(U==null?void 0:U.getBoundingClientRect())??null;const{xSnapped:B,ySnapped:q}=kl(M.sourceEvent,{transform:H,snapGrid:D,snapToGrid:V,containerBounds:S});k={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},_={...k,pointerX:B,pointerY:q,aspectRatio:k.width/k.height},I=void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(I=P.get(N.parentId),T=I&&N.extent==="parent"?H8(I):void 0),A=[],O=void 0;for(const[Y,F]of P)if(F.parentId===t&&(A.push({id:Y,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const K=U8(F,N,F.origin??$);O?O=[[Math.min(K[0][0],O[0][0]),Math.min(K[0][1],O[0][1])],[Math.max(K[1][0],O[1][0]),Math.max(K[1][1],O[1][1])]]:O=K}y==null||y(M,{...k})}).on("drag",M=>{const{transform:P,snapGrid:H,snapToGrid:D,nodeOrigin:V}=n(),$=kl(M.sourceEvent,{transform:P,snapGrid:H,snapToGrid:D,containerBounds:S}),U=[];if(!N)return;const{x:B,y:q,width:Y,height:F}=k,K={},ee=N.origin??V,{width:W,height:X,x:Z,y:ne}=z8(_,a.controlDirection,$,a.boundaries,a.keepAspectRatio,ee,T,O),te=W!==Y,ie=X!==F,he=Z!==B&&te,xe=ne!==q&&ie;if(!he&&!xe&&!te&&!ie)return;if((he||xe||ee[0]===1||ee[1]===1)&&(K.x=he?Z:k.x,K.y=xe?ne:k.y,k.x=K.x,k.y=K.y,A.length>0)){const we=Z-B,Te=ne-q;for(const Ne of A)Ne.position={x:Ne.position.x-we+ee[0]*(W-Y),y:Ne.position.y-Te+ee[1]*(X-F)},U.push(Ne)}if((te||ie)&&(K.width=te&&(!a.resizeDirection||a.resizeDirection==="horizontal")?W:k.width,K.height=ie&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:k.height,k.width=K.width,k.height=K.height),I&&N.expandParent){const we=ee[0]*(K.width??0);K.x&&K.x<we&&(k.x=we,_.x=_.x-(K.x-we));const Te=ee[1]*(K.height??0);K.y&&K.y<Te&&(k.y=Te,_.y=_.y-(K.y-Te))}const ve=q8({width:k.width,prevWidth:Y,height:k.height,prevHeight:F,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),ye={...k,direction:ve};(v==null?void 0:v(M,ye))!==!1&&(L=!0,b==null||b(M,ye),r(K,U))}).on("end",M=>{L&&(w==null||w(M,{...k}),s==null||s({...k}),L=!1)});o.call(z)}function d(){o.on(".drag",null)}return{update:c,destroy:d}}var sm={exports:{}},om={},im={exports:{}},am={};/**
|
|
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 VS;function K8(){if(VS)return am;VS=1;var e=Xl();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(h,g){var y=g(),b=r({inst:{value:y,getSnapshot:g}}),w=b[0].inst,v=b[1];return o(function(){w.value=y,w.getSnapshot=g,d(w)&&v({inst:w})},[h,y,g]),s(function(){return d(w)&&v({inst:w}),h(function(){d(w)&&v({inst:w})})},[h]),a(y),y}function d(h){var g=h.getSnapshot;h=h.value;try{var y=g();return!n(h,y)}catch{return!0}}function f(h,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return am.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,am}var HS;function G8(){return HS||(HS=1,im.exports=K8()),im.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 US;function Y8(){if(US)return om;US=1;var e=Xl(),t=G8();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,d=e.useDebugValue;return om.useSyncExternalStoreWithSelector=function(f,p,h,g,y){var b=o(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=c(function(){function k(I){if(!_){if(_=!0,N=I,I=g(I),y!==void 0&&w.hasValue){var T=w.value;if(y(T,I))return S=T}return S=I}if(T=S,r(N,I))return T;var O=g(I);return y!==void 0&&y(T,O)?(N=I,T):(N=I,S=O)}var _=!1,N,S,A=h===void 0?null:h;return[function(){return k(p())},A===null?void 0:function(){return k(A())}]},[p,h,g,y]);var v=s(f,b[0],b[1]);return a(function(){w.hasValue=!0,w.value=v},[v]),d(v),v},om}var WS;function X8(){return WS||(WS=1,sm.exports=Y8()),sm.exports}var Q8=X8();const J8=Yl(Q8),Z8={},KS=e=>{let t;const n=new Set,r=(p,h)=>{const g=typeof p=="function"?p(t):p;if(!Object.is(g,t)){const y=t;t=h??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},s=()=>t,d={setState:r,getState:s,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(Z8?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,s,d);return d},eB=e=>e?KS(e):KS,{useDebugValue:tB}=ue,{useSyncExternalStoreWithSelector:nB}=J8,rB=e=>e;function NM(e,t=rB,n){const r=nB(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return tB(r),r}const GS=(e,t)=>{const n=eB(e),r=(s,o=t)=>NM(n,s,o);return Object.assign(r,n),r},sB=(e,t)=>e?GS(e,t):GS;function at(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var hw=gI();const SM=Yl(hw),of=E.createContext(null),oB=of.Provider,CM=Br.error001();function Ue(e,t){const n=E.useContext(of);if(n===null)throw new Error(CM);return NM(n,e,t)}function ct(){const e=E.useContext(of);if(e===null)throw new Error(CM);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const YS={display:"none"},iB={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_M="react-flow__node-desc",EM="react-flow__edge-desc",aB="react-flow__aria-live",lB=e=>e.ariaLiveMessage,cB=e=>e.ariaLabelConfig;function uB({rfId:e}){const t=Ue(lB);return u.jsx("div",{id:`${aB}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:iB,children:t})}function dB({rfId:e,disableKeyboardA11y:t}){const n=Ue(cB);return u.jsxs(u.Fragment,{children:[u.jsx("div",{id:`${_M}-${e}`,style:YS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),u.jsx("div",{id:`${EM}-${e}`,style:YS,children:n["edge.a11yDescription.default"]}),!t&&u.jsx(uB,{rfId:e})]})}const af=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const a=`${e}`.split("-");return u.jsx("div",{className:St(["react-flow__panel",n,...a]),style:r,ref:o,...s,children:t})});af.displayName="Panel";function fB({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(af,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const hB=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}},qu=e=>e.id;function pB(e,t){return at(e.selectedNodes.map(qu),t.selectedNodes.map(qu))&&at(e.selectedEdges.map(qu),t.selectedEdges.map(qu))}function mB({onSelectionChange:e}){const t=ct(),{selectedNodes:n,selectedEdges:r}=Ue(hB,pB);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const gB=e=>!!e.onSelectionChangeHandlers;function yB({onSelectionChange:e}){const t=Ue(gB);return e||t?u.jsx(mB,{onSelectionChange:e}):null}const jM=[0,0],xB={x:0,y:0,zoom:1},vB=["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"],XS=[...vB,"rfId"],bB=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}),QS={translateExtent:Ml,nodeOrigin:jM,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wB(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:d}=Ue(bB,at),f=ct();E.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{p.current=QS,c()}),[]);const p=E.useRef(QS);return E.useEffect(()=>{for(const h of XS){const g=e[h],y=p.current[h];g!==y&&(typeof e[h]>"u"||(h==="nodes"?t(g):h==="edges"?n(g):h==="minZoom"?r(g):h==="maxZoom"?s(g):h==="translateExtent"?o(g):h==="nodeExtent"?a(g):h==="ariaLabelConfig"?f.setState({ariaLabelConfig:r8(g)}):h==="fitView"?f.setState({fitViewQueued:g}):h==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[h]:g})))}p.current=e},XS.map(h=>e[h])),null}function JS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function kB(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=JS(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=JS())!=null&&r.matches?"dark":"light"}const ZS=typeof document<"u"?document:null;function Ll(e=null,t={target:ZS,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),o=E.useRef(new Set([])),[a,c]=E.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),p=f.reduce((h,g)=>h.concat(...g),[]);return[f,p]}return[[],[]]},[e]);return E.useEffect(()=>{const d=(t==null?void 0:t.target)??ZS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=y=>{var v,k;if(s.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!s.current||s.current&&!f)&&oM(y))return!1;const w=t2(y.code,c);if(o.current.add(y[w]),e2(a,o.current,!1)){const _=((k=(v=y.composedPath)==null?void 0:v.call(y))==null?void 0:k[0])||y.target,N=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";t.preventDefault!==!1&&(s.current||!N)&&y.preventDefault(),r(!0)}},h=y=>{const b=t2(y.code,c);e2(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(y[b]),y.key==="Meta"&&o.current.clear(),s.current=!1},g=()=>{o.current.clear(),r(!1)};return d==null||d.addEventListener("keydown",p),d==null||d.addEventListener("keyup",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{d==null||d.removeEventListener("keydown",p),d==null||d.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function e2(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function t2(e,t){return t.includes(e)?"code":"key"}const NB=()=>{const e=ct();return E.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:a,panZoom:c}=e.getState(),d=iw(t,r,s,o,a,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(d,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:c,y:d}=a.getBoundingClientRect(),f={x:t.x-c,y:t.y-d},p=n.snapGrid??s,h=n.snapToGrid??o;return nc(f,r,h,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),a=Rd(t,n);return{x:a.x+s,y:a.y+o}}}),[])};function AM(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const a=r.get(o.id);a?a.push(o):r.set(o.id,[o])}for(const o of t){const a=r.get(o.id);if(!a){n.push(o);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...o};for(const d of a)SB(d,c);n.push(c)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function SB(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 TM(e,t){return AM(e,t)}function IM(e,t){return AM(e,t)}function ko(e,t){return{id:e,type:"select",selected:t}}function Ri(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const a=t.has(s);!(o.selected===void 0&&!a)&&o.selected!==a&&(n&&(o.selected=a),r.push(ko(o.id,a)))}return r}function n2({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,a]of e.entries()){const c=t.get(a.id),d=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;d!==void 0&&d!==a&&n.push({id:a.id,item:a,type:"replace"}),d===void 0&&n.push({item:a,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function r2(e){return{id:e.id,type:"remove"}}const s2=e=>K6(e),CB=e=>QI(e);function MM(e){return E.forwardRef(e)}const _B=typeof window<"u"?E.useLayoutEffect:E.useEffect;function o2(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>EB(()=>n(s=>s+BigInt(1))));return _B(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function EB(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const RM=E.createContext(null);function jB({children:e}){const t=ct(),n=E.useCallback(c=>{const{nodes:d=[],setNodes:f,hasDefaultNodes:p,onNodesChange:h,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:b}=t.getState();let w=d;for(const k of c)w=typeof k=="function"?k(w):k;let v=n2({items:w,lookup:g});for(const k of b.values())v=k(v);p&&f(w),v.length>0?h==null||h(v):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:_,setNodes:N}=t.getState();k&&N(_)})},[]),r=o2(n),s=E.useCallback(c=>{const{edges:d=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:h,edgeLookup:g}=t.getState();let y=d;for(const b of c)y=typeof b=="function"?b(y):b;p?f(y):h&&h(n2({items:y,lookup:g}))},[]),o=o2(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return u.jsx(RM.Provider,{value:a,children:e})}function AB(){const e=E.useContext(RM);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const TB=e=>!!e.panZoom;function sa(){const e=NB(),t=ct(),n=AB(),r=Ue(TB),s=E.useMemo(()=>{const o=h=>t.getState().nodeLookup.get(h),a=h=>{n.nodeQueue.push(h)},c=h=>{n.edgeQueue.push(h)},d=h=>{var k,_;const{nodeLookup:g,nodeOrigin:y}=t.getState(),b=s2(h)?h:g.get(h.id),w=b.parentId?rM(b.position,b.measured,b.parentId,g,y):b.position,v={...b,position:w,width:((k=b.measured)==null?void 0:k.width)??b.width,height:((_=b.measured)==null?void 0:_.height)??b.height};return Xi(v)},f=(h,g,y={replace:!1})=>{a(b=>b.map(w=>{if(w.id===h){const v=typeof g=="function"?g(w):g;return y.replace&&s2(v)?v:{...w,...v}}return w}))},p=(h,g,y={replace:!1})=>{c(b=>b.map(w=>{if(w.id===h){const v=typeof g=="function"?g(w):g;return y.replace&&CB(v)?v:{...w,...v}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var g;return(g=o(h))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(g=>({...g}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:a,setEdges:c,addNodes:h=>{const g=Array.isArray(h)?h:[h];n.nodeQueue.push(y=>[...y,...g])},addEdges:h=>{const g=Array.isArray(h)?h:[h];n.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:h=[],edges:g=[],transform:y}=t.getState(),[b,w,v]=y;return{nodes:h.map(k=>({...k})),edges:g.map(k=>({...k})),viewport:{x:b,y:w,zoom:v}}},deleteElements:async({nodes:h=[],edges:g=[]})=>{const{nodes:y,edges:b,onNodesDelete:w,onEdgesDelete:v,triggerNodeChanges:k,triggerEdgeChanges:_,onDelete:N,onBeforeDelete:S}=t.getState(),{nodes:A,edges:I}=await J6({nodesToRemove:h,edgesToRemove:g,nodes:y,edges:b,onBeforeDelete:S}),T=I.length>0,O=A.length>0;if(T){const L=I.map(r2);v==null||v(I),_(L)}if(O){const L=A.map(r2);w==null||w(A),k(L)}return(O||T)&&(N==null||N({nodes:A,edges:I})),{deletedNodes:A,deletedEdges:I}},getIntersectingNodes:(h,g=!0,y)=>{const b=TS(h),w=b?h:d(h),v=y!==void 0;return w?(y||t.getState().nodes).filter(k=>{const _=t.getState().nodeLookup.get(k.id);if(_&&!b&&(k.id===h.id||!_.internals.positionAbsolute))return!1;const N=Xi(v?k:_),S=Ol(N,w);return g&&S>0||S>=N.width*N.height||S>=w.width*w.height}):[]},isNodeIntersecting:(h,g,y=!0)=>{const w=TS(h)?h:d(h);if(!w)return!1;const v=Ol(w,g);return y&&v>0||v>=g.width*g.height||v>=w.width*w.height},updateNode:f,updateNodeData:(h,g,y={replace:!1})=>{f(h,b=>{const w=typeof g=="function"?g(b):g;return y.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},y)},updateEdge:p,updateEdgeData:(h,g,y={replace:!1})=>{p(h,b=>{const w=typeof g=="function"?g(b):g;return y.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},y)},getNodesBounds:h=>{const{nodeLookup:g,nodeOrigin:y}=t.getState();return G6(h,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:h,id:g,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}-${h}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:h,handleId:g,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}${h?g?`-${h}-${g}`:`-${h}`:""}`))==null?void 0:b.values())??[])},fitView:async h=>{const g=t.getState().fitViewResolver??n8();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:g}),n.nodeQueue.push(y=>[...y]),g.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const i2=e=>e.selected,IB=typeof window<"u"?window:void 0;function MB({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ct(),{deleteElements:r}=sa(),s=Ll(e,{actInsideInputWithModifier:!1}),o=Ll(t,{target:IB});E.useEffect(()=>{if(s){const{edges:a,nodes:c}=n.getState();r({nodes:c.filter(i2),edges:a.filter(i2)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function RB(e){const t=ct();E.useEffect(()=>{const n=()=>{var s,o,a,c;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=aw(e.current);(r.height===0||r.width===0)&&((c=(a=t.getState()).onError)==null||c.call(a,"004",Br.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 lf={position:"absolute",width:"100%",height:"100%",top:0,left:0},OB=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function PB({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=To.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:d,translateExtent:f,minZoom:p,maxZoom:h,zoomActivationKeyCode:g,preventScrolling:y=!0,children:b,noWheelClassName:w,noPanClassName:v,onViewportChange:k,isControlledViewport:_,paneClickDistance:N,selectionOnDrag:S}){const A=ct(),I=E.useRef(null),{userSelectionActive:T,lib:O,connectionInProgress:L}=Ue(OB,at),z=Ll(g),M=E.useRef();RB(I);const P=E.useCallback(H=>{k==null||k({x:H[0],y:H[1],zoom:H[2]}),_||A.setState({transform:H})},[k,_]);return E.useEffect(()=>{if(I.current){M.current=$8({domNode:I.current,minZoom:p,maxZoom:h,translateExtent:f,viewport:d,onDraggingChange:$=>A.setState({paneDragging:$}),onPanZoomStart:($,U)=>{const{onViewportChangeStart:B,onMoveStart:q}=A.getState();q==null||q($,U),B==null||B(U)},onPanZoom:($,U)=>{const{onViewportChange:B,onMove:q}=A.getState();q==null||q($,U),B==null||B(U)},onPanZoomEnd:($,U)=>{const{onViewportChangeEnd:B,onMoveEnd:q}=A.getState();q==null||q($,U),B==null||B(U)}});const{x:H,y:D,zoom:V}=M.current.getViewport();return A.setState({panZoom:M.current,transform:[H,D,V],domNode:I.current.closest(".react-flow")}),()=>{var $;($=M.current)==null||$.destroy()}}},[]),E.useEffect(()=>{var H;(H=M.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:z,preventScrolling:y,noPanClassName:v,userSelectionActive:T,noWheelClassName:w,lib:O,onTransformChange:P,connectionInProgress:L,selectionOnDrag:S,paneClickDistance:N})},[e,t,n,r,s,o,a,c,z,y,v,T,w,O,P,L,S,N]),u.jsx("div",{className:"react-flow__renderer",ref:I,style:lf,children:b})}const LB=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function DB(){const{userSelectionActive:e,userSelectionRect:t}=Ue(LB,at);return e&&t?u.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const lm=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$B=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function FB({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Rl.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:a,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:p,onPaneMouseEnter:h,onPaneMouseMove:g,onPaneMouseLeave:y,children:b}){const w=ct(),{userSelectionActive:v,elementsSelectable:k,dragging:_,connectionInProgress:N}=Ue($B,at),S=k&&(e||v),A=E.useRef(null),I=E.useRef(),T=E.useRef(new Set),O=E.useRef(new Set),L=E.useRef(!1),z=B=>{if(L.current||N){L.current=!1;return}d==null||d(B),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},M=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}f==null||f(B)},P=p?B=>p(B):void 0,H=B=>{L.current&&(B.stopPropagation(),L.current=!1)},D=B=>{var X,Z;const{domNode:q}=w.getState();if(I.current=q==null?void 0:q.getBoundingClientRect(),!I.current)return;const Y=B.target===A.current;if(!Y&&!!B.target.closest(".nokey")||!e||!(o&&Y||t)||B.button!==0||!B.isPrimary)return;(Z=(X=B.target)==null?void 0:X.setPointerCapture)==null||Z.call(X,B.pointerId),L.current=!1;const{x:ee,y:W}=ur(B.nativeEvent,I.current);w.setState({userSelectionRect:{width:0,height:0,startX:ee,startY:W,x:ee,y:W}}),Y||(B.stopPropagation(),B.preventDefault())},V=B=>{const{userSelectionRect:q,transform:Y,nodeLookup:F,edgeLookup:K,connectionLookup:ee,triggerNodeChanges:W,triggerEdgeChanges:X,defaultEdgeOptions:Z,resetSelectedElements:ne}=w.getState();if(!I.current||!q)return;const{x:te,y:ie}=ur(B.nativeEvent,I.current),{startX:he,startY:xe}=q;if(!L.current){const Te=t?0:s;if(Math.hypot(te-he,ie-xe)<=Te)return;ne(),a==null||a(B)}L.current=!0;const ve={startX:he,startY:xe,x:te<he?te:he,y:ie<xe?ie:xe,width:Math.abs(te-he),height:Math.abs(ie-xe)},ye=T.current,_e=O.current;T.current=new Set(ow(F,ve,Y,n===Rl.Partial,!0).map(Te=>Te.id)),O.current=new Set;const we=(Z==null?void 0:Z.selectable)??!0;for(const Te of T.current){const Ne=ee.get(Te);if(Ne)for(const{edgeId:Je}of Ne.values()){const Fe=K.get(Je);Fe&&(Fe.selectable??we)&&O.current.add(Je)}}if(!IS(ye,T.current)){const Te=Ri(F,T.current,!0);W(Te)}if(!IS(_e,O.current)){const Te=Ri(K,O.current);X(Te)}w.setState({userSelectionRect:ve,userSelectionActive:!0,nodesSelectionActive:!1})},$=B=>{var q,Y;B.button===0&&((Y=(q=B.target)==null?void 0:q.releasePointerCapture)==null||Y.call(q,B.pointerId),!v&&B.target===A.current&&w.getState().userSelectionRect&&(z==null||z(B)),w.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(c==null||c(B),w.setState({nodesSelectionActive:T.current.size>0})))},U=r===!0||Array.isArray(r)&&r.includes(0);return u.jsxs("div",{className:St(["react-flow__pane",{draggable:U,dragging:_,selection:e}]),onClick:S?void 0:lm(z,A),onContextMenu:lm(M,A),onWheel:lm(P,A),onPointerEnter:S?void 0:h,onPointerMove:S?V:g,onPointerUp:S?$:void 0,onPointerDownCapture:S?D:void 0,onClickCapture:S?H:void 0,onPointerLeave:y,ref:A,style:lf,children:[b,u.jsx(DB,{})]})}function fb({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:a,nodeLookup:c,onError:d}=t.getState(),f=c.get(e);if(!f){d==null||d("012",Br.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&a)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([e])}function OM({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:a}){const c=ct(),[d,f]=E.useState(!1),p=E.useRef();return E.useEffect(()=>{p.current=S8({getStoreItems:()=>c.getState(),onNodeMouseDown:h=>{fb({id:h,store:c,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),E.useEffect(()=>{var h,g;if(t)(h=p.current)==null||h.destroy();else if(e.current)return(g=p.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:a}),()=>{var y;(y=p.current)==null||y.destroy()}},[n,r,t,o,e,s]),d}const BB=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function PM(){const e=ct();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:a,onError:c,updateNodePositions:d,nodeLookup:f,nodeOrigin:p}=e.getState(),h=new Map,g=BB(a),y=s?o[0]:5,b=s?o[1]:5,w=n.direction.x*y*n.factor,v=n.direction.y*b*n.factor;for(const[,k]of f){if(!g(k))continue;let _={x:k.internals.positionAbsolute.x+w,y:k.internals.positionAbsolute.y+v};s&&(_=tc(_,o));const{position:N,positionAbsolute:S}=JI({nodeId:k.id,nextPosition:_,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:c});k.position=N,k.internals.positionAbsolute=S,h.set(k.id,k)}d(h)},[])}const pw=E.createContext(null),qB=pw.Provider;pw.Consumer;const LM=()=>E.useContext(pw),zB=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),VB=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:a}=r,{fromHandle:c,toHandle:d,isValid:f}=a,p=(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:p,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===Gi.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:p&&f}};function HB({type:e="source",position:t=ge.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:a,onConnect:c,children:d,className:f,onMouseDown:p,onTouchStart:h,...g},y){var V,$;const b=a||null,w=e==="target",v=ct(),k=LM(),{connectOnClick:_,noPanClassName:N,rfId:S}=Ue(zB,at),{connectingFrom:A,connectingTo:I,clickConnecting:T,isPossibleEndHandle:O,connectionInProcess:L,clickConnectionInProcess:z,valid:M}=Ue(VB(k,b,e),at);k||($=(V=v.getState()).onError)==null||$.call(V,"010",Br.error010());const P=U=>{const{defaultEdgeOptions:B,onConnect:q,hasDefaultEdges:Y}=v.getState(),F={...B,...U};if(Y){const{edges:K,setEdges:ee}=v.getState();ee(uM(F,K))}q==null||q(F),c==null||c(F)},H=U=>{if(!k)return;const B=iM(U.nativeEvent);if(s&&(B&&U.button===0||!B)){const q=v.getState();db.onPointerDown(U.nativeEvent,{handleDomNode:U.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:w,handleId:b,nodeId:k,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:q.onConnectEnd,updateConnection:q.updateConnection,onConnect:P,isValidConnection:n||q.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}B?p==null||p(U):h==null||h(U)},D=U=>{const{onClickConnectStart:B,onClickConnectEnd:q,connectionClickStartHandle:Y,connectionMode:F,isValidConnection:K,lib:ee,rfId:W,nodeLookup:X,connection:Z}=v.getState();if(!k||!Y&&!s)return;if(!Y){B==null||B(U.nativeEvent,{nodeId:k,handleId:b,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:k,type:e,id:b}});return}const ne=sM(U.target),te=n||K,{connection:ie,isValid:he}=db.isValid(U.nativeEvent,{handle:{nodeId:k,id:b,type:e},connectionMode:F,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:te,flowId:W,doc:ne,lib:ee,nodeLookup:X});he&&ie&&P(ie);const xe=structuredClone(Z);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,q==null||q(U,xe),v.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":b,"data-nodeid":k,"data-handlepos":t,"data-id":`${S}-${k}-${b}-${e}`,className:St(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,f,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:T,connectingfrom:A,connectingto:I,valid:M,connectionindicator:r&&(!L||O)&&(L||z?o:s)}]),onMouseDown:H,onTouchStart:H,onClick:_?D:void 0,ref:y,...g,children:d})}const Ke=E.memo(MM(HB));function UB({data:e,isConnectable:t,sourcePosition:n=ge.Bottom}){return u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(Ke,{type:"source",position:n,isConnectable:t})]})}function WB({data:e,isConnectable:t,targetPosition:n=ge.Top,sourcePosition:r=ge.Bottom}){return u.jsxs(u.Fragment,{children:[u.jsx(Ke,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(Ke,{type:"source",position:r,isConnectable:t})]})}function KB(){return null}function GB({data:e,isConnectable:t,targetPosition:n=ge.Top}){return u.jsxs(u.Fragment,{children:[u.jsx(Ke,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Od={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},a2={input:UB,default:WB,output:GB,group:KB};function YB(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const XB=e=>{const{width:t,height:n,x:r,y:s}=ec(e.nodeLookup,{filter:o=>!!o.selected});return{width:cr(t)?t:null,height:cr(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function QB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ct(),{width:s,height:o,transformString:a,userSelectionActive:c}=Ue(XB,at),d=PM(),f=E.useRef(null);if(E.useEffect(()=>{var g;n||(g=f.current)==null||g.focus({preventScroll:!0})},[n]),OM({nodeRef:f}),c||!s||!o)return null;const p=e?g=>{const y=r.getState().nodes.filter(b=>b.selected);e(g,y)}:void 0,h=g=>{Object.prototype.hasOwnProperty.call(Od,g.key)&&(g.preventDefault(),d({direction:Od[g.key],factor:g.shiftKey?4:1}))};return u.jsx("div",{className:St(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:u.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:s,height:o}})})}const l2=typeof window<"u"?window:void 0,JB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function DM({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:v,elementsSelectable:k,zoomOnScroll:_,zoomOnPinch:N,panOnScroll:S,panOnScrollSpeed:A,panOnScrollMode:I,zoomOnDoubleClick:T,panOnDrag:O,defaultViewport:L,translateExtent:z,minZoom:M,maxZoom:P,preventScrolling:H,onSelectionContextMenu:D,noWheelClassName:V,noPanClassName:$,disableKeyboardA11y:U,onViewportChange:B,isControlledViewport:q}){const{nodesSelectionActive:Y,userSelectionActive:F}=Ue(JB,at),K=Ll(f,{target:l2}),ee=Ll(w,{target:l2}),W=ee||O,X=ee||S,Z=p&&W!==!0,ne=K||F||Z;return MB({deleteKeyCode:d,multiSelectionKeyCode:b}),u.jsx(PB,{onPaneContextMenu:o,elementsSelectable:k,zoomOnScroll:_,zoomOnPinch:N,panOnScroll:X,panOnScrollSpeed:A,panOnScrollMode:I,zoomOnDoubleClick:T,panOnDrag:!K&&W,defaultViewport:L,translateExtent:z,minZoom:M,maxZoom:P,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:$,onViewportChange:B,isControlledViewport:q,paneClickDistance:c,selectionOnDrag:Z,children:u.jsxs(FB,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:W,isSelecting:!!ne,selectionMode:h,selectionKeyPressed:K,paneClickDistance:c,selectionOnDrag:Z,children:[e,Y&&u.jsx(QB,{onSelectionContextMenu:D,noPanClassName:$,disableKeyboardA11y:U})]})})}DM.displayName="FlowRenderer";const ZB=E.memo(DM),eq=e=>t=>e?ow(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 tq(e){return Ue(E.useCallback(eq(e),[e]),at)}const nq=e=>e.updateNodeInternals;function rq(){const e=Ue(nq),[t]=E.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function sq({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=ct(),o=E.useRef(null),a=E.useRef(null),c=E.useRef(e.sourcePosition),d=E.useRef(e.targetPosition),f=E.useRef(t),p=n&&!!e.internals.handleBounds;return E.useEffect(()=>{o.current&&!e.hidden&&(!p||a.current!==o.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(o.current),a.current=o.current)},[p,e.hidden]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(o.current){const h=f.current!==t,g=c.current!==e.sourcePosition,y=d.current!==e.targetPosition;(h||g||y)&&(f.current=t,c.current=e.sourcePosition,d.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function oq({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:a,nodesDraggable:c,elementsSelectable:d,nodesConnectable:f,nodesFocusable:p,resizeObserver:h,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:b,rfId:w,nodeTypes:v,nodeClickDistance:k,onError:_}){const{node:N,internals:S,isParent:A}=Ue(te=>{const ie=te.nodeLookup.get(e),he=te.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:he}},at);let I=N.type||"default",T=(v==null?void 0:v[I])||a2[I];T===void 0&&(_==null||_("003",Br.error003(I)),I="default",T=(v==null?void 0:v.default)||a2.default);const O=!!(N.draggable||c&&typeof N.draggable>"u"),L=!!(N.selectable||d&&typeof N.selectable>"u"),z=!!(N.connectable||f&&typeof N.connectable>"u"),M=!!(N.focusable||p&&typeof N.focusable>"u"),P=ct(),H=nM(N),D=sq({node:N,nodeType:I,hasDimensions:H,resizeObserver:h}),V=OM({nodeRef:D,disabled:N.hidden||!O,noDragClassName:g,handleSelector:N.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:k}),$=PM();if(N.hidden)return null;const U=ms(N),B=YB(N),q=L||O||t||n||r||s,Y=n?te=>n(te,{...S.userNode}):void 0,F=r?te=>r(te,{...S.userNode}):void 0,K=s?te=>s(te,{...S.userNode}):void 0,ee=o?te=>o(te,{...S.userNode}):void 0,W=a?te=>a(te,{...S.userNode}):void 0,X=te=>{const{selectNodesOnDrag:ie,nodeDragThreshold:he}=P.getState();L&&(!ie||!O||he>0)&&fb({id:e,store:P,nodeRef:D}),t&&t(te,{...S.userNode})},Z=te=>{if(!(oM(te.nativeEvent)||b)){if(KI.includes(te.key)&&L){const ie=te.key==="Escape";fb({id:e,store:P,unselect:ie,nodeRef:D})}else if(O&&N.selected&&Object.prototype.hasOwnProperty.call(Od,te.key)){te.preventDefault();const{ariaLabelConfig:ie}=P.getState();P.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),$({direction:Od[te.key],factor:te.shiftKey?4:1})}}},ne=()=>{var _e;if(b||!((_e=D.current)!=null&&_e.matches(":focus-visible")))return;const{transform:te,width:ie,height:he,autoPanOnNodeFocus:xe,setCenter:ve}=P.getState();if(!xe)return;ow(new Map([[e,N]]),{x:0,y:0,width:ie,height:he},te,!0).length>0||ve(N.position.x+U.width/2,N.position.y+U.height/2,{zoom:te[2]})};return u.jsx("div",{className:St(["react-flow__node",`react-flow__node-${I}`,{[y]:O},N.className,{selected:N.selected,selectable:L,parent:A,draggable:O,dragging:V}]),ref:D,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:H?"visible":"hidden",...N.style,...B},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Y,onMouseMove:F,onMouseLeave:K,onContextMenu:ee,onClick:X,onDoubleClick:W,onKeyDown:M?Z:void 0,tabIndex:M?0:void 0,onFocus:M?ne:void 0,role:N.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${_M}-${w}`,"aria-label":N.ariaLabel,...N.domAttributes,children:u.jsx(qB,{value:e,children:u.jsx(T,{id:e,data:N.data,type:I,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:N.selected??!1,selectable:L,draggable:O,deletable:N.deletable??!0,isConnectable:z,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:V,dragHandle:N.dragHandle,zIndex:S.z,parentId:N.parentId,...U})})})}var iq=E.memo(oq);const aq=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function $M(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=Ue(aq,at),a=tq(e.onlyRenderVisibleElements),c=rq();return u.jsx("div",{className:"react-flow__nodes",style:lf,children:a.map(d=>u.jsx(iq,{id:d,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},d))})}$M.displayName="NodeRenderer";const lq=E.memo($M);function cq(e){return Ue(E.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),a=n.nodeLookup.get(s.target);o&&a&&i8({sourceNode:o,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),at)}const uq=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return u.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},dq=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return u.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},c2={[Id.Arrow]:uq,[Id.ArrowClosed]:dq};function fq(e){const t=ct();return E.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(c2,e)?c2[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Br.error009(e)),null)},[e])}const hq=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{const d=fq(t);return d?u.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0",children:u.jsx(d,{color:n,strokeWidth:a})}):null},FM=({defaultColor:e,rfId:t})=>{const n=Ue(o=>o.edges),r=Ue(o=>o.defaultEdgeOptions),s=E.useMemo(()=>h8(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?u.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:u.jsx("defs",{children:s.map(o=>u.jsx(hq,{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};FM.displayName="MarkerDefinitions";var pq=E.memo(FM);function BM({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:d,className:f,...p}){const[h,g]=E.useState({x:1,y:0,width:0,height:0}),y=St(["react-flow__edge-textwrapper",f]),b=E.useRef(null);return E.useEffect(()=>{if(b.current){const w=b.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?u.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:y,visibility:h.width?"visible":"hidden",...p,children:[s&&u.jsx("rect",{width:h.width+2*a[0],x:-a[0],y:-a[1],height:h.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),u.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:b,style:r,children:n}),d]}):null}BM.displayName="EdgeText";const mq=E.memo(BM);function cf({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d,interactionWidth:f=20,...p}){return u.jsxs(u.Fragment,{children:[u.jsx("path",{...p,d:e,fill:"none",className:St(["react-flow__edge-path",p.className])}),f?u.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&cr(t)&&cr(n)?u.jsx(mq,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:d}):null]})}function u2({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===ge.Left||e===ge.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function qM({sourceX:e,sourceY:t,sourcePosition:n=ge.Bottom,targetX:r,targetY:s,targetPosition:o=ge.Top}){const[a,c]=u2({pos:n,x1:e,y1:t,x2:r,y2:s}),[d,f]=u2({pos:o,x1:r,y1:s,x2:e,y2:t}),[p,h,g,y]=aM({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:f});return[`M${e},${t} C${a},${c} ${d},${f} ${r},${s}`,p,h,g,y]}function zM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a,targetPosition:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:v,interactionWidth:k})=>{const[_,N,S]=qM({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c}),A=e.isInternal?void 0:t;return u.jsx(cf,{id:A,path:_,labelX:N,labelY:S,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:v,interactionWidth:k})})}const gq=zM({isInternal:!1}),VM=zM({isInternal:!0});gq.displayName="SimpleBezierEdge";VM.displayName="SimpleBezierEdgeInternal";function HM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,sourcePosition:y=ge.Bottom,targetPosition:b=ge.Top,markerEnd:w,markerStart:v,pathOptions:k,interactionWidth:_})=>{const[N,S,A]=lb({sourceX:n,sourceY:r,sourcePosition:y,targetX:s,targetY:o,targetPosition:b,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset,stepPosition:k==null?void 0:k.stepPosition}),I=e.isInternal?void 0:t;return u.jsx(cf,{id:I,path:N,labelX:S,labelY:A,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:v,interactionWidth:_})})}const UM=HM({isInternal:!1}),WM=HM({isInternal:!0});UM.displayName="SmoothStepEdge";WM.displayName="SmoothStepEdgeInternal";function KM(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return u.jsx(UM,{...n,id:r,pathOptions:E.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const yq=KM({isInternal:!1}),GM=KM({isInternal:!0});yq.displayName="StepEdge";GM.displayName="StepEdgeInternal";function YM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:y,markerStart:b,interactionWidth:w})=>{const[v,k,_]=dM({sourceX:n,sourceY:r,targetX:s,targetY:o}),N=e.isInternal?void 0:t;return u.jsx(cf,{id:N,path:v,labelX:k,labelY:_,label:a,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:y,markerStart:b,interactionWidth:w})})}const xq=YM({isInternal:!1}),XM=YM({isInternal:!0});xq.displayName="StraightEdge";XM.displayName="StraightEdgeInternal";function QM(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:a=ge.Bottom,targetPosition:c=ge.Top,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:v,pathOptions:k,interactionWidth:_})=>{const[N,S,A]=lM({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:o,targetPosition:c,curvature:k==null?void 0:k.curvature}),I=e.isInternal?void 0:t;return u.jsx(cf,{id:I,path:N,labelX:S,labelY:A,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:v,interactionWidth:_})})}const vq=QM({isInternal:!1}),JM=QM({isInternal:!0});vq.displayName="BezierEdge";JM.displayName="BezierEdgeInternal";const d2={default:JM,straight:XM,step:GM,smoothstep:WM,simplebezier:VM},f2={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},bq=(e,t,n)=>n===ge.Left?e-t:n===ge.Right?e+t:e,wq=(e,t,n)=>n===ge.Top?e-t:n===ge.Bottom?e+t:e,h2="react-flow__edgeupdater";function p2({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:a,type:c}){return u.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:a,className:St([h2,`${h2}-${c}`]),cx:bq(t,r,e),cy:wq(n,r,e),r,stroke:"transparent",fill:"transparent"})}function kq({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:c,targetPosition:d,onReconnect:f,onReconnectStart:p,onReconnectEnd:h,setReconnecting:g,setUpdateHover:y}){const b=ct(),w=(S,A)=>{if(S.button!==0)return;const{autoPanOnConnect:I,domNode:T,isValidConnection:O,connectionMode:L,connectionRadius:z,lib:M,onConnectStart:P,onConnectEnd:H,cancelConnection:D,nodeLookup:V,rfId:$,panBy:U,updateConnection:B}=b.getState(),q=A.type==="target",Y=(ee,W)=>{g(!1),h==null||h(ee,n,A.type,W)},F=ee=>f==null?void 0:f(n,ee),K=(ee,W)=>{g(!0),p==null||p(S,n,A.type),P==null||P(ee,W)};db.onPointerDown(S.nativeEvent,{autoPanOnConnect:I,connectionMode:L,connectionRadius:z,domNode:T,handleId:A.id,nodeId:A.nodeId,nodeLookup:V,isTarget:q,edgeUpdaterType:A.type,lib:M,flowId:$,cancelConnection:D,panBy:U,isValidConnection:O,onConnect:F,onConnectStart:K,onConnectEnd:H,onReconnectEnd:Y,updateConnection:B,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},v=S=>w(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=S=>w(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>y(!0),N=()=>y(!1);return u.jsxs(u.Fragment,{children:[(e===!0||e==="source")&&u.jsx(p2,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:v,onMouseEnter:_,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&u.jsx(p2,{position:d,centerX:o,centerY:a,radius:t,onMouseDown:k,onMouseEnter:_,onMouseOut:N,type:"target"})]})}function Nq({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:a,onMouseEnter:c,onMouseMove:d,onMouseLeave:f,reconnectRadius:p,onReconnect:h,onReconnectStart:g,onReconnectEnd:y,rfId:b,edgeTypes:w,noPanClassName:v,onError:k,disableKeyboardA11y:_}){let N=Ue(ve=>ve.edgeLookup.get(e));const S=Ue(ve=>ve.defaultEdgeOptions);N=S?{...S,...N}:N;let A=N.type||"default",I=(w==null?void 0:w[A])||d2[A];I===void 0&&(k==null||k("011",Br.error011(A)),A="default",I=(w==null?void 0:w.default)||d2.default);const T=!!(N.focusable||t&&typeof N.focusable>"u"),O=typeof h<"u"&&(N.reconnectable||n&&typeof N.reconnectable>"u"),L=!!(N.selectable||r&&typeof N.selectable>"u"),z=E.useRef(null),[M,P]=E.useState(!1),[H,D]=E.useState(!1),V=ct(),{zIndex:$,sourceX:U,sourceY:B,targetX:q,targetY:Y,sourcePosition:F,targetPosition:K}=Ue(E.useCallback(ve=>{const ye=ve.nodeLookup.get(N.source),_e=ve.nodeLookup.get(N.target);if(!ye||!_e)return{zIndex:N.zIndex,...f2};const we=f8({id:e,sourceNode:ye,targetNode:_e,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:ve.connectionMode,onError:k});return{zIndex:o8({selected:N.selected,zIndex:N.zIndex,sourceNode:ye,targetNode:_e,elevateOnSelect:ve.elevateEdgesOnSelect,zIndexMode:ve.zIndexMode}),...we||f2}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),at),ee=E.useMemo(()=>N.markerStart?`url('#${cb(N.markerStart,b)}')`:void 0,[N.markerStart,b]),W=E.useMemo(()=>N.markerEnd?`url('#${cb(N.markerEnd,b)}')`:void 0,[N.markerEnd,b]);if(N.hidden||U===null||B===null||q===null||Y===null)return null;const X=ve=>{var Te;const{addSelectedEdges:ye,unselectNodesAndEdges:_e,multiSelectionActive:we}=V.getState();L&&(V.setState({nodesSelectionActive:!1}),N.selected&&we?(_e({nodes:[],edges:[N]}),(Te=z.current)==null||Te.blur()):ye([e])),s&&s(ve,N)},Z=o?ve=>{o(ve,{...N})}:void 0,ne=a?ve=>{a(ve,{...N})}:void 0,te=c?ve=>{c(ve,{...N})}:void 0,ie=d?ve=>{d(ve,{...N})}:void 0,he=f?ve=>{f(ve,{...N})}:void 0,xe=ve=>{var ye;if(!_&&KI.includes(ve.key)&&L){const{unselectNodesAndEdges:_e,addSelectedEdges:we}=V.getState();ve.key==="Escape"?((ye=z.current)==null||ye.blur(),_e({edges:[N]})):we([e])}};return u.jsx("svg",{style:{zIndex:$},children:u.jsxs("g",{className:St(["react-flow__edge",`react-flow__edge-${A}`,N.className,v,{selected:N.selected,animated:N.animated,inactive:!L&&!s,updating:M,selectable:L}]),onClick:X,onDoubleClick:Z,onContextMenu:ne,onMouseEnter:te,onMouseMove:ie,onMouseLeave:he,onKeyDown:T?xe:void 0,tabIndex:T?0:void 0,role:N.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":T?`${EM}-${b}`:void 0,ref:z,...N.domAttributes,children:[!H&&u.jsx(I,{id:e,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:L,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:U,sourceY:B,targetX:q,targetY:Y,sourcePosition:F,targetPosition:K,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:ee,markerEnd:W,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),O&&u.jsx(kq,{edge:N,isReconnectable:O,reconnectRadius:p,onReconnect:h,onReconnectStart:g,onReconnectEnd:y,sourceX:U,sourceY:B,targetX:q,targetY:Y,sourcePosition:F,targetPosition:K,setUpdateHover:P,setReconnecting:D})]})})}var Sq=E.memo(Nq);const Cq=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZM({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:h,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:v,edgesReconnectable:k,elementsSelectable:_,onError:N}=Ue(Cq,at),S=cq(t);return u.jsxs("div",{className:"react-flow__edges",children:[u.jsx(pq,{defaultColor:e,rfId:n}),S.map(A=>u.jsx(Sq,{id:A,edgesFocusable:v,edgesReconnectable:k,elementsSelectable:_,noPanClassName:s,onReconnect:o,onContextMenu:a,onMouseEnter:c,onMouseMove:d,onMouseLeave:f,onClick:p,reconnectRadius:h,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:b,rfId:n,onError:N,edgeTypes:r,disableKeyboardA11y:w},A))]})}ZM.displayName="EdgeRenderer";const _q=E.memo(ZM),Eq=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jq({children:e}){const t=Ue(Eq);return u.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Aq(e){const t=sa(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Tq=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Iq(e){const t=Ue(Tq),n=ct();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Mq(e){return e.connection.inProgress?{...e.connection,to:nc(e.connection.to,e.transform)}:{...e.connection}}function Rq(e){return Mq}function Oq(e){const t=Rq();return Ue(t,at)}const Pq=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Lq({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:a,isValid:c,inProgress:d}=Ue(Pq,at);return!(o&&s&&d)?null:u.jsx("svg",{style:e,width:o,height:a,className:"react-flow__connectionline react-flow__container",children:u.jsx("g",{className:St(["react-flow__connection",XI(c)]),children:u.jsx(eR,{style:t,type:n,CustomComponent:r,isValid:c})})})}const eR=({style:e,type:t=Ks.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:a,fromHandle:c,fromPosition:d,to:f,toNode:p,toHandle:h,toPosition:g,pointer:y}=Oq();if(!s)return;if(n)return u.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:o.x,fromY:o.y,toX:f.x,toY:f.y,fromPosition:d,toPosition:g,connectionStatus:XI(r),toNode:p,toHandle:h,pointer:y});let b="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case Ks.Bezier:[b]=lM(w);break;case Ks.SimpleBezier:[b]=qM(w);break;case Ks.Step:[b]=lb({...w,borderRadius:0});break;case Ks.SmoothStep:[b]=lb(w);break;default:[b]=dM(w)}return u.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};eR.displayName="ConnectionLine";const Dq={};function m2(e=Dq){E.useRef(e),ct(),E.useEffect(()=>{},[e])}function $q(){ct(),E.useRef(!1),E.useEffect(()=>{},[])}function tR({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:h,onSelectionStart:g,onSelectionEnd:y,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:v,connectionLineContainerStyle:k,selectionKeyCode:_,selectionOnDrag:N,selectionMode:S,multiSelectionKeyCode:A,panActivationKeyCode:I,zoomActivationKeyCode:T,deleteKeyCode:O,onlyRenderVisibleElements:L,elementsSelectable:z,defaultViewport:M,translateExtent:P,minZoom:H,maxZoom:D,preventScrolling:V,defaultMarkerColor:$,zoomOnScroll:U,zoomOnPinch:B,panOnScroll:q,panOnScrollSpeed:Y,panOnScrollMode:F,zoomOnDoubleClick:K,panOnDrag:ee,onPaneClick:W,onPaneMouseEnter:X,onPaneMouseMove:Z,onPaneMouseLeave:ne,onPaneScroll:te,onPaneContextMenu:ie,paneClickDistance:he,nodeClickDistance:xe,onEdgeContextMenu:ve,onEdgeMouseEnter:ye,onEdgeMouseMove:_e,onEdgeMouseLeave:we,reconnectRadius:Te,onReconnect:Ne,onReconnectStart:Je,onReconnectEnd:Fe,noDragClassName:_t,noWheelClassName:bt,noPanClassName:He,disableKeyboardA11y:qe,nodeExtent:Xt,rfId:Mt,viewport:Rt,onViewportChange:ot}){return m2(e),m2(t),$q(),Aq(n),Iq(Rt),u.jsx(ZB,{onPaneClick:W,onPaneMouseEnter:X,onPaneMouseMove:Z,onPaneMouseLeave:ne,onPaneContextMenu:ie,onPaneScroll:te,paneClickDistance:he,deleteKeyCode:O,selectionKeyCode:_,selectionOnDrag:N,selectionMode:S,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:A,panActivationKeyCode:I,zoomActivationKeyCode:T,elementsSelectable:z,zoomOnScroll:U,zoomOnPinch:B,zoomOnDoubleClick:K,panOnScroll:q,panOnScrollSpeed:Y,panOnScrollMode:F,panOnDrag:ee,defaultViewport:M,translateExtent:P,minZoom:H,maxZoom:D,onSelectionContextMenu:h,preventScrolling:V,noDragClassName:_t,noWheelClassName:bt,noPanClassName:He,disableKeyboardA11y:qe,onViewportChange:ot,isControlledViewport:!!Rt,children:u.jsxs(jq,{children:[u.jsx(_q,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Ne,onReconnectStart:Je,onReconnectEnd:Fe,onlyRenderVisibleElements:L,onEdgeContextMenu:ve,onEdgeMouseEnter:ye,onEdgeMouseMove:_e,onEdgeMouseLeave:we,reconnectRadius:Te,defaultMarkerColor:$,noPanClassName:He,disableKeyboardA11y:qe,rfId:Mt}),u.jsx(Lq,{style:w,type:b,component:v,containerStyle:k}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(lq,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:xe,onlyRenderVisibleElements:L,noPanClassName:He,noDragClassName:_t,disableKeyboardA11y:qe,nodeExtent:Xt,rfId:Mt}),u.jsx("div",{className:"react-flow__viewport-portal"})]})})}tR.displayName="GraphView";const Fq=E.memo(tR),g2=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:d=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:h,zIndexMode:g="basic"}={})=>{const y=new Map,b=new Map,w=new Map,v=new Map,k=r??t??[],_=n??e??[],N=p??[0,0],S=h??Ml;pM(w,v,k);const A=ub(_,y,b,{nodeOrigin:N,nodeExtent:S,zIndexMode:g});let I=[0,0,1];if(a&&s&&o){const T=ec(y,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:O,y:L,zoom:z}=iw(T,s,o,d,f,(c==null?void 0:c.padding)??.1);I=[O,L,z]}return{rfId:"1",width:s??0,height:o??0,transform:I,nodes:_,nodesInitialized:A,nodeLookup:y,parentLookup:b,edges:k,edgeLookup:v,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:d,maxZoom:f,translateExtent:Ml,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Gi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,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:{...YI},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Z6,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:GI,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Bq=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:f,nodeOrigin:p,nodeExtent:h,zIndexMode:g})=>sB((y,b)=>{async function w(){const{nodeLookup:v,panZoom:k,fitViewOptions:_,fitViewResolver:N,width:S,height:A,minZoom:I,maxZoom:T}=b();k&&(await Q6({nodes:v,width:S,height:A,panZoom:k,minZoom:I,maxZoom:T},_),N==null||N.resolve(!0),y({fitViewResolver:null}))}return{...g2({nodes:e,edges:t,width:s,height:o,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:f,nodeOrigin:p,nodeExtent:h,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:v=>{const{nodeLookup:k,parentLookup:_,nodeOrigin:N,elevateNodesOnSelect:S,fitViewQueued:A,zIndexMode:I}=b(),T=ub(v,k,_,{nodeOrigin:N,nodeExtent:h,elevateNodesOnSelect:S,checkEquality:!0,zIndexMode:I});A&&T?(w(),y({nodes:v,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:v,nodesInitialized:T})},setEdges:v=>{const{connectionLookup:k,edgeLookup:_}=b();pM(k,_,v),y({edges:v})},setDefaultNodesAndEdges:(v,k)=>{if(v){const{setNodes:_}=b();_(v),y({hasDefaultNodes:!0})}if(k){const{setEdges:_}=b();_(k),y({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:k,nodeLookup:_,parentLookup:N,domNode:S,nodeOrigin:A,nodeExtent:I,debug:T,fitViewQueued:O,zIndexMode:L}=b(),{changes:z,updatedInternals:M}=b8(v,_,N,S,A,I,L);M&&(g8(_,N,{nodeOrigin:A,nodeExtent:I,zIndexMode:L}),O?(w(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(z==null?void 0:z.length)>0&&(T&&console.log("React Flow: trigger node changes",z),k==null||k(z)))},updateNodePositions:(v,k=!1)=>{const _=[];let N=[];const{nodeLookup:S,triggerNodeChanges:A,connection:I,updateConnection:T,onNodesChangeMiddlewareMap:O}=b();for(const[L,z]of v){const M=S.get(L),P=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(z!=null&&z.position)),H={id:L,type:"position",position:P?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:k};if(M&&I.inProgress&&I.fromNode.id===M.id){const D=Oo(M,I.fromHandle,ge.Left,!0);T({...I,from:D})}P&&M.parentId&&_.push({id:L,parentId:M.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),N.push(H)}if(_.length>0){const{parentLookup:L,nodeOrigin:z}=b(),M=fw(_,S,L,z);N.push(...M)}for(const L of O.values())N=L(N);A(N)},triggerNodeChanges:v=>{const{onNodesChange:k,setNodes:_,nodes:N,hasDefaultNodes:S,debug:A}=b();if(v!=null&&v.length){if(S){const I=TM(v,N);_(I)}A&&console.log("React Flow: trigger node changes",v),k==null||k(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:k,setEdges:_,edges:N,hasDefaultEdges:S,debug:A}=b();if(v!=null&&v.length){if(S){const I=IM(v,N);_(I)}A&&console.log("React Flow: trigger edge changes",v),k==null||k(v)}},addSelectedNodes:v=>{const{multiSelectionActive:k,edgeLookup:_,nodeLookup:N,triggerNodeChanges:S,triggerEdgeChanges:A}=b();if(k){const I=v.map(T=>ko(T,!0));S(I);return}S(Ri(N,new Set([...v]),!0)),A(Ri(_))},addSelectedEdges:v=>{const{multiSelectionActive:k,edgeLookup:_,nodeLookup:N,triggerNodeChanges:S,triggerEdgeChanges:A}=b();if(k){const I=v.map(T=>ko(T,!0));A(I);return}A(Ri(_,new Set([...v]))),S(Ri(N,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:k}={})=>{const{edges:_,nodes:N,nodeLookup:S,triggerNodeChanges:A,triggerEdgeChanges:I}=b(),T=v||N,O=k||_,L=T.map(M=>{const P=S.get(M.id);return P&&(P.selected=!1),ko(M.id,!1)}),z=O.map(M=>ko(M.id,!1));A(L),I(z)},setMinZoom:v=>{const{panZoom:k,maxZoom:_}=b();k==null||k.setScaleExtent([v,_]),y({minZoom:v})},setMaxZoom:v=>{const{panZoom:k,minZoom:_}=b();k==null||k.setScaleExtent([_,v]),y({maxZoom:v})},setTranslateExtent:v=>{var k;(k=b().panZoom)==null||k.setTranslateExtent(v),y({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:k,triggerNodeChanges:_,triggerEdgeChanges:N,elementsSelectable:S}=b();if(!S)return;const A=k.reduce((T,O)=>O.selected?[...T,ko(O.id,!1)]:T,[]),I=v.reduce((T,O)=>O.selected?[...T,ko(O.id,!1)]:T,[]);_(A),N(I)},setNodeExtent:v=>{const{nodes:k,nodeLookup:_,parentLookup:N,nodeOrigin:S,elevateNodesOnSelect:A,nodeExtent:I,zIndexMode:T}=b();v[0][0]===I[0][0]&&v[0][1]===I[0][1]&&v[1][0]===I[1][0]&&v[1][1]===I[1][1]||(ub(k,_,N,{nodeOrigin:S,nodeExtent:v,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:T}),y({nodeExtent:v}))},panBy:v=>{const{transform:k,width:_,height:N,panZoom:S,translateExtent:A}=b();return w8({delta:v,panZoom:S,transform:k,translateExtent:A,width:_,height:N})},setCenter:async(v,k,_)=>{const{width:N,height:S,maxZoom:A,panZoom:I}=b();if(!I)return Promise.resolve(!1);const T=typeof(_==null?void 0:_.zoom)<"u"?_.zoom:A;return await I.setViewport({x:N/2-v*T,y:S/2-k*T,zoom:T},{duration:_==null?void 0:_.duration,ease:_==null?void 0:_.ease,interpolate:_==null?void 0:_.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...YI}})},updateConnection:v=>{y({connection:v})},reset:()=>y({...g2()})}},Object.is);function nR({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:d,fitView:f,nodeOrigin:p,nodeExtent:h,zIndexMode:g,children:y}){const[b]=E.useState(()=>Bq({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:f,minZoom:a,maxZoom:c,fitViewOptions:d,nodeOrigin:p,nodeExtent:h,zIndexMode:g}));return u.jsx(oB,{value:b,children:u.jsx(jB,{children:y})})}function qq({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:c,fitViewOptions:d,minZoom:f,maxZoom:p,nodeOrigin:h,nodeExtent:g,zIndexMode:y}){return E.useContext(of)?u.jsx(u.Fragment,{children:e}):u.jsx(nR,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:a,fitView:c,initialFitViewOptions:d,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:h,nodeExtent:g,zIndexMode:y,children:e})}const zq={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Vq({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:a,onNodeClick:c,onEdgeClick:d,onInit:f,onMove:p,onMoveStart:h,onMoveEnd:g,onConnect:y,onConnectStart:b,onConnectEnd:w,onClickConnectStart:v,onClickConnectEnd:k,onNodeMouseEnter:_,onNodeMouseMove:N,onNodeMouseLeave:S,onNodeContextMenu:A,onNodeDoubleClick:I,onNodeDragStart:T,onNodeDrag:O,onNodeDragStop:L,onNodesDelete:z,onEdgesDelete:M,onDelete:P,onSelectionChange:H,onSelectionDragStart:D,onSelectionDrag:V,onSelectionDragStop:$,onSelectionContextMenu:U,onSelectionStart:B,onSelectionEnd:q,onBeforeDelete:Y,connectionMode:F,connectionLineType:K=Ks.Bezier,connectionLineStyle:ee,connectionLineComponent:W,connectionLineContainerStyle:X,deleteKeyCode:Z="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:te=!1,selectionMode:ie=Rl.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:xe=Pl()?"Meta":"Control",zoomActivationKeyCode:ve=Pl()?"Meta":"Control",snapToGrid:ye,snapGrid:_e,onlyRenderVisibleElements:we=!1,selectNodesOnDrag:Te,nodesDraggable:Ne,autoPanOnNodeFocus:Je,nodesConnectable:Fe,nodesFocusable:_t,nodeOrigin:bt=jM,edgesFocusable:He,edgesReconnectable:qe,elementsSelectable:Xt=!0,defaultViewport:Mt=xB,minZoom:Rt=.5,maxZoom:ot=2,translateExtent:Et=Ml,preventScrolling:Qt=!0,nodeExtent:$e,defaultMarkerColor:cn="#b1b1b7",zoomOnScroll:Vt=!0,zoomOnPinch:Ht=!0,panOnScroll:Jt=!1,panOnScrollSpeed:xs=.5,panOnScrollMode:Yn=To.Free,zoomOnDoubleClick:Rn=!0,panOnDrag:Xn=!0,onPaneClick:wt,onPaneMouseEnter:On,onPaneMouseMove:bn,onPaneMouseLeave:Zt,onPaneScroll:Qn,onPaneContextMenu:Ie,paneClickDistance:pe=1,nodeClickDistance:me=0,children:Pe,onReconnect:Ot,onReconnectStart:Xe,onReconnectEnd:pt,onEdgeContextMenu:Pt,onEdgeDoubleClick:jt,onEdgeMouseEnter:en,onEdgeMouseMove:wr,onEdgeMouseLeave:un,reconnectRadius:oo=10,onNodesChange:ba,onEdgesChange:rh,noDragClassName:sh="nodrag",noWheelClassName:oh="nowheel",noPanClassName:kr="nopan",fitView:wa,fitViewOptions:ka,connectOnClick:ih,attributionPosition:Nc,proOptions:Sc,defaultEdgeOptions:Cc,elevateNodesOnSelect:_c=!0,elevateEdgesOnSelect:ah=!1,disableKeyboardA11y:Ec=!1,autoPanOnConnect:dt,autoPanOnNodeDrag:lh,autoPanSpeed:Na,connectionRadius:jc,isValidConnection:Qo,onError:ch,style:Ac,id:io,nodeDragThreshold:Pn,connectionDragThreshold:uh,viewport:wn,onViewportChange:dh,width:fh,height:hh,colorMode:Jo="light",debug:Zo,onScroll:Nr,ariaLabelConfig:ei,zIndexMode:Tc="basic",...ph},Sa){const ti=io||"1",Ca=kB(Jo),ao=E.useCallback(Ic=>{Ic.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Nr==null||Nr(Ic)},[Nr]);return u.jsx("div",{"data-testid":"rf__wrapper",...ph,onScroll:ao,style:{...Ac,...zq},ref:Sa,className:St(["react-flow",s,Ca]),id:io,role:"application",children:u.jsxs(qq,{nodes:e,edges:t,width:fh,height:hh,fitView:wa,fitViewOptions:ka,minZoom:Rt,maxZoom:ot,nodeOrigin:bt,nodeExtent:$e,zIndexMode:Tc,children:[u.jsx(Fq,{onInit:f,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:_,onNodeMouseMove:N,onNodeMouseLeave:S,onNodeContextMenu:A,onNodeDoubleClick:I,nodeTypes:o,edgeTypes:a,connectionLineType:K,connectionLineStyle:ee,connectionLineComponent:W,connectionLineContainerStyle:X,selectionKeyCode:ne,selectionOnDrag:te,selectionMode:ie,deleteKeyCode:Z,multiSelectionKeyCode:xe,panActivationKeyCode:he,zoomActivationKeyCode:ve,onlyRenderVisibleElements:we,defaultViewport:Mt,translateExtent:Et,minZoom:Rt,maxZoom:ot,preventScrolling:Qt,zoomOnScroll:Vt,zoomOnPinch:Ht,zoomOnDoubleClick:Rn,panOnScroll:Jt,panOnScrollSpeed:xs,panOnScrollMode:Yn,panOnDrag:Xn,onPaneClick:wt,onPaneMouseEnter:On,onPaneMouseMove:bn,onPaneMouseLeave:Zt,onPaneScroll:Qn,onPaneContextMenu:Ie,paneClickDistance:pe,nodeClickDistance:me,onSelectionContextMenu:U,onSelectionStart:B,onSelectionEnd:q,onReconnect:Ot,onReconnectStart:Xe,onReconnectEnd:pt,onEdgeContextMenu:Pt,onEdgeDoubleClick:jt,onEdgeMouseEnter:en,onEdgeMouseMove:wr,onEdgeMouseLeave:un,reconnectRadius:oo,defaultMarkerColor:cn,noDragClassName:sh,noWheelClassName:oh,noPanClassName:kr,rfId:ti,disableKeyboardA11y:Ec,nodeExtent:$e,viewport:wn,onViewportChange:dh}),u.jsx(wB,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:b,onConnectEnd:w,onClickConnectStart:v,onClickConnectEnd:k,nodesDraggable:Ne,autoPanOnNodeFocus:Je,nodesConnectable:Fe,nodesFocusable:_t,edgesFocusable:He,edgesReconnectable:qe,elementsSelectable:Xt,elevateNodesOnSelect:_c,elevateEdgesOnSelect:ah,minZoom:Rt,maxZoom:ot,nodeExtent:$e,onNodesChange:ba,onEdgesChange:rh,snapToGrid:ye,snapGrid:_e,connectionMode:F,translateExtent:Et,connectOnClick:ih,defaultEdgeOptions:Cc,fitView:wa,fitViewOptions:ka,onNodesDelete:z,onEdgesDelete:M,onDelete:P,onNodeDragStart:T,onNodeDrag:O,onNodeDragStop:L,onSelectionDrag:V,onSelectionDragStart:D,onSelectionDragStop:$,onMove:p,onMoveStart:h,onMoveEnd:g,noPanClassName:kr,nodeOrigin:bt,rfId:ti,autoPanOnConnect:dt,autoPanOnNodeDrag:lh,autoPanSpeed:Na,onError:ch,connectionRadius:jc,isValidConnection:Qo,selectNodesOnDrag:Te,nodeDragThreshold:Pn,connectionDragThreshold:uh,onBeforeDelete:Y,debug:Zo,ariaLabelConfig:ei,zIndexMode:Tc}),u.jsx(yB,{onSelectionChange:H}),Pe,u.jsx(fB,{proOptions:Sc,position:Nc}),u.jsx(dB,{rfId:ti,disableKeyboardA11y:Ec})]})})}var Hq=MM(Vq);function Uq({dimensions:e,lineWidth:t,variant:n,className:r}){return u.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:St(["react-flow__background-pattern",n,r])})}function Wq({radius:e,className:t}){return u.jsx("circle",{cx:e,cy:e,r:e,className:St(["react-flow__background-pattern","dots",t])})}var ls;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ls||(ls={}));const Kq={[ls.Dots]:1,[ls.Lines]:1,[ls.Cross]:6},Gq=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function rR({id:e,variant:t=ls.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:a,bgColor:c,style:d,className:f,patternClassName:p}){const h=E.useRef(null),{transform:g,patternId:y}=Ue(Gq,at),b=r||Kq[t],w=t===ls.Dots,v=t===ls.Cross,k=Array.isArray(n)?n:[n,n],_=[k[0]*g[2]||1,k[1]*g[2]||1],N=b*g[2],S=Array.isArray(o)?o:[o,o],A=v?[N,N]:_,I=[S[0]*g[2]||1+A[0]/2,S[1]*g[2]||1+A[1]/2],T=`${y}${e||""}`;return u.jsxs("svg",{className:St(["react-flow__background",f]),style:{...d,...lf,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:h,"data-testid":"rf__background",children:[u.jsx("pattern",{id:T,x:g[0]%_[0],y:g[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:w?u.jsx(Wq,{radius:N/2,className:p}):u.jsx(Uq,{dimensions:A,lineWidth:s,variant:t,className:p})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}rR.displayName="Background";const Yq=E.memo(rR);function Xq(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Qq(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Jq(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Zq(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function ez(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function zu({children:e,className:t,...n}){return u.jsx("button",{type:"button",className:St(["react-flow__controls-button",t]),...n,children:e})}const tz=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function sR({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:a,onFitView:c,onInteractiveChange:d,className:f,children:p,position:h="bottom-left",orientation:g="vertical","aria-label":y}){const b=ct(),{isInteractive:w,minZoomReached:v,maxZoomReached:k,ariaLabelConfig:_}=Ue(tz,at),{zoomIn:N,zoomOut:S,fitView:A}=sa(),I=()=>{N(),o==null||o()},T=()=>{S(),a==null||a()},O=()=>{A(s),c==null||c()},L=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),d==null||d(!w)},z=g==="horizontal"?"horizontal":"vertical";return u.jsxs(af,{className:St(["react-flow__controls",z,f]),position:h,style:e,"data-testid":"rf__controls","aria-label":y??_["controls.ariaLabel"],children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(zu,{onClick:I,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:k,children:u.jsx(Xq,{})}),u.jsx(zu,{onClick:T,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:v,children:u.jsx(Qq,{})})]}),n&&u.jsx(zu,{className:"react-flow__controls-fitview",onClick:O,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:u.jsx(Jq,{})}),r&&u.jsx(zu,{className:"react-flow__controls-interactive",onClick:L,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:w?u.jsx(ez,{}):u.jsx(Zq,{})}),p]})}sR.displayName="Controls";const nz=E.memo(sR);function rz({id:e,x:t,y:n,width:r,height:s,style:o,color:a,strokeColor:c,strokeWidth:d,className:f,borderRadius:p,shapeRendering:h,selected:g,onClick:y}){const{background:b,backgroundColor:w}=o||{},v=a||b||w;return u.jsx("rect",{className:St(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:p,ry:p,width:r,height:s,style:{fill:v,stroke:c,strokeWidth:d},shapeRendering:h,onClick:y?k=>y(k,e):void 0})}const sz=E.memo(rz),oz=e=>e.nodes.map(t=>t.id),cm=e=>e instanceof Function?e:()=>e;function iz({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=sz,onClick:a}){const c=Ue(oz,at),d=cm(t),f=cm(e),p=cm(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return u.jsx(u.Fragment,{children:c.map(g=>u.jsx(lz,{id:g,nodeColorFunc:d,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:a,shapeRendering:h},g))})}function az({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:a,NodeComponent:c,onClick:d}){const{node:f,x:p,y:h,width:g,height:y}=Ue(b=>{const{internals:w}=b.nodeLookup.get(e),v=w.userNode,{x:k,y:_}=w.positionAbsolute,{width:N,height:S}=ms(v);return{node:v,x:k,y:_,width:N,height:S}},at);return!f||f.hidden||!nM(f)?null:u.jsx(c,{x:p,y:h,width:g,height:y,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:s,strokeColor:n(f),strokeWidth:o,shapeRendering:a,onClick:d,id:f.id})}const lz=E.memo(az);var cz=E.memo(iz);const uz=200,dz=150,fz=e=>!e.hidden,hz=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?tM(ec(e.nodeLookup,{filter:fz}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},pz="react-flow__minimap-desc";function oR({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:d,maskColor:f,maskStrokeColor:p,maskStrokeWidth:h,position:g="bottom-right",onClick:y,onNodeClick:b,pannable:w=!1,zoomable:v=!1,ariaLabel:k,inversePan:_,zoomStep:N=1,offsetScale:S=5}){const A=ct(),I=E.useRef(null),{boundingRect:T,viewBB:O,rfId:L,panZoom:z,translateExtent:M,flowWidth:P,flowHeight:H,ariaLabelConfig:D}=Ue(hz,at),V=(e==null?void 0:e.width)??uz,$=(e==null?void 0:e.height)??dz,U=T.width/V,B=T.height/$,q=Math.max(U,B),Y=q*V,F=q*$,K=S*q,ee=T.x-(Y-T.width)/2-K,W=T.y-(F-T.height)/2-K,X=Y+K*2,Z=F+K*2,ne=`${pz}-${L}`,te=E.useRef(0),ie=E.useRef();te.current=q,E.useEffect(()=>{if(I.current&&z)return ie.current=T8({domNode:I.current,panZoom:z,getTransform:()=>A.getState().transform,getViewScale:()=>te.current}),()=>{var ye;(ye=ie.current)==null||ye.destroy()}},[z]),E.useEffect(()=>{var ye;(ye=ie.current)==null||ye.update({translateExtent:M,width:P,height:H,inversePan:_,pannable:w,zoomStep:N,zoomable:v})},[w,v,_,N,M,P,H]);const he=y?ye=>{var Te;const[_e,we]=((Te=ie.current)==null?void 0:Te.pointer(ye))||[0,0];y(ye,{x:_e,y:we})}:void 0,xe=b?E.useCallback((ye,_e)=>{const we=A.getState().nodeLookup.get(_e).internals.userNode;b(ye,we)},[]):void 0,ve=k??D["minimap.ariaLabel"];return u.jsx(af,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*q:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:St(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:u.jsxs("svg",{width:V,height:$,viewBox:`${ee} ${W} ${X} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:I,onClick:he,children:[ve&&u.jsx("title",{id:ne,children:ve}),u.jsx(cz,{onClick:xe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:c}),u.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-K},${W-K}h${X+K*2}v${Z+K*2}h${-X-K*2}z
|
|
62
|
+
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}oR.displayName="MiniMap";const mz=E.memo(oR),gz=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,yz={[Po.Line]:"right",[Po.Handle]:"bottom-right"};function xz({nodeId:e,position:t,variant:n=Po.Handle,className:r,style:s=void 0,children:o,color:a,minWidth:c=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:y=!0,shouldResize:b,onResizeStart:w,onResize:v,onResizeEnd:k}){const _=LM(),N=typeof e=="string"?e:_,S=ct(),A=E.useRef(null),I=n===Po.Handle,T=Ue(E.useCallback(gz(I&&y),[I,y]),at),O=E.useRef(null),L=t??yz[n];E.useEffect(()=>{if(!(!A.current||!N))return O.current||(O.current=W8({domNode:A.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:M,transform:P,snapGrid:H,snapToGrid:D,nodeOrigin:V,domNode:$}=S.getState();return{nodeLookup:M,transform:P,snapGrid:H,snapToGrid:D,nodeOrigin:V,paneDomNode:$}},onChange:(M,P)=>{const{triggerNodeChanges:H,nodeLookup:D,parentLookup:V,nodeOrigin:$}=S.getState(),U=[],B={x:M.x,y:M.y},q=D.get(N);if(q&&q.expandParent&&q.parentId){const Y=q.origin??$,F=M.width??q.measured.width??0,K=M.height??q.measured.height??0,ee={id:q.id,parentId:q.parentId,rect:{width:F,height:K,...rM({x:M.x??q.position.x,y:M.y??q.position.y},{width:F,height:K},q.parentId,D,Y)}},W=fw([ee],D,V,$);U.push(...W),B.x=M.x?Math.max(Y[0]*F,M.x):void 0,B.y=M.y?Math.max(Y[1]*K,M.y):void 0}if(B.x!==void 0&&B.y!==void 0){const Y={id:N,type:"position",position:{...B}};U.push(Y)}if(M.width!==void 0&&M.height!==void 0){const F={id:N,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};U.push(F)}for(const Y of P){const F={...Y,type:"position"};U.push(F)}H(U)},onEnd:({width:M,height:P})=>{const H={id:N,type:"dimensions",resizing:!1,dimensions:{width:M,height:P}};S.getState().triggerNodeChanges([H])}})),O.current.update({controlPosition:L,boundaries:{minWidth:c,minHeight:d,maxWidth:f,maxHeight:p},keepAspectRatio:h,resizeDirection:g,onResizeStart:w,onResize:v,onResizeEnd:k,shouldResize:b}),()=>{var M;(M=O.current)==null||M.destroy()}},[L,c,d,f,p,h,w,v,k,b]);const z=L.split("-");return u.jsx("div",{className:St(["react-flow__resize-control","nodrag",...z,n,r]),ref:A,style:{...s,scale:T,...a&&{[I?"backgroundColor":"borderColor"]:a}},children:o})}const y2=E.memo(xz);function iR({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:s,lineStyle:o,color:a,minWidth:c=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:h=!1,autoScale:g=!0,shouldResize:y,onResizeStart:b,onResize:w,onResizeEnd:v}){return t?u.jsxs(u.Fragment,{children:[B8.map(k=>u.jsx(y2,{className:s,style:o,nodeId:e,position:k,variant:Po.Line,color:a,minWidth:c,minHeight:d,maxWidth:f,maxHeight:p,onResizeStart:b,keepAspectRatio:h,autoScale:g,shouldResize:y,onResize:w,onResizeEnd:v},k)),F8.map(k=>u.jsx(y2,{className:n,style:r,nodeId:e,position:k,color:a,minWidth:c,minHeight:d,maxWidth:f,maxHeight:p,onResizeStart:b,keepAspectRatio:h,autoScale:g,shouldResize:y,onResize:w,onResizeEnd:v},k))]}):null}function vz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const bz=e=>{switch(e){case"success":return Nz;case"info":return Cz;case"warning":return Sz;case"error":return _z;default:return null}},wz=Array(12).fill(0),kz=({visible:e,className:t})=>ue.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ue.createElement("div",{className:"sonner-spinner"},wz.map((n,r)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Nz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Sz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Cz=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_z=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ez=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jz=()=>{const[e,t]=ue.useState(document.hidden);return ue.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let hb=1;class Az{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:hb++,a=this.toasts.find(d=>d.id===o),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:c,title:r}):d):this.addToast({title:r,...s,dismissible:c,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,a;const c=s.then(async f=>{if(a=["resolve",f],ue.isValidElement(f))o=!1,this.create({id:r,type:"default",message:f});else if(Iz(f)&&!f.ok){o=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,b=typeof h=="object"&&!ue.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...b})}else if(f instanceof Error){o=!1;const h=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,b=typeof h=="object"&&!ue.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...b})}else if(n.success!==void 0){o=!1;const h=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,b=typeof h=="object"&&!ue.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,...b})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){o=!1;const p=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,y=typeof p=="object"&&!ue.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:h,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,p)=>c.then(()=>a[0]==="reject"?p(a[1]):f(a[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||hb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const yn=new Az,Tz=(e,t)=>{const n=(t==null?void 0:t.id)||hb++;return yn.addToast({title:e,...t,id:n}),n},Iz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mz=Tz,Rz=()=>yn.toasts,Oz=()=>yn.getActiveToasts(),_o=Object.assign(Mz,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:Rz,getToasts:Oz});vz("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Vu(e){return e.label!==void 0}const Pz=3,Lz="24px",Dz="16px",x2=4e3,$z=356,Fz=14,Bz=45,qz=200;function jr(...e){return e.filter(Boolean).join(" ")}function zz(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Vz=e=>{var t,n,r,s,o,a,c,d,f;const{invert:p,toast:h,unstyled:g,interacting:y,setHeights:b,visibleToasts:w,heights:v,index:k,toasts:_,expanded:N,removeToast:S,defaultRichColors:A,closeButton:I,style:T,cancelButtonStyle:O,actionButtonStyle:L,className:z="",descriptionClassName:M="",duration:P,position:H,gap:D,expandByDefault:V,classNames:$,icons:U,closeButtonAriaLabel:B="Close toast"}=e,[q,Y]=ue.useState(null),[F,K]=ue.useState(null),[ee,W]=ue.useState(!1),[X,Z]=ue.useState(!1),[ne,te]=ue.useState(!1),[ie,he]=ue.useState(!1),[xe,ve]=ue.useState(!1),[ye,_e]=ue.useState(0),[we,Te]=ue.useState(0),Ne=ue.useRef(h.duration||P||x2),Je=ue.useRef(null),Fe=ue.useRef(null),_t=k===0,bt=k+1<=w,He=h.type,qe=h.dismissible!==!1,Xt=h.className||"",Mt=h.descriptionClassName||"",Rt=ue.useMemo(()=>v.findIndex(Ie=>Ie.toastId===h.id)||0,[v,h.id]),ot=ue.useMemo(()=>{var Ie;return(Ie=h.closeButton)!=null?Ie:I},[h.closeButton,I]),Et=ue.useMemo(()=>h.duration||P||x2,[h.duration,P]),Qt=ue.useRef(0),$e=ue.useRef(0),cn=ue.useRef(0),Vt=ue.useRef(null),[Ht,Jt]=H.split("-"),xs=ue.useMemo(()=>v.reduce((Ie,pe,me)=>me>=Rt?Ie:Ie+pe.height,0),[v,Rt]),Yn=jz(),Rn=h.invert||p,Xn=He==="loading";$e.current=ue.useMemo(()=>Rt*D+xs,[Rt,xs]),ue.useEffect(()=>{Ne.current=Et},[Et]),ue.useEffect(()=>{W(!0)},[]),ue.useEffect(()=>{const Ie=Fe.current;if(Ie){const pe=Ie.getBoundingClientRect().height;return Te(pe),b(me=>[{toastId:h.id,height:pe,position:h.position},...me]),()=>b(me=>me.filter(Pe=>Pe.toastId!==h.id))}},[b,h.id]),ue.useLayoutEffect(()=>{if(!ee)return;const Ie=Fe.current,pe=Ie.style.height;Ie.style.height="auto";const me=Ie.getBoundingClientRect().height;Ie.style.height=pe,Te(me),b(Pe=>Pe.find(Xe=>Xe.toastId===h.id)?Pe.map(Xe=>Xe.toastId===h.id?{...Xe,height:me}:Xe):[{toastId:h.id,height:me,position:h.position},...Pe])},[ee,h.title,h.description,b,h.id,h.jsx,h.action,h.cancel]);const wt=ue.useCallback(()=>{Z(!0),_e($e.current),b(Ie=>Ie.filter(pe=>pe.toastId!==h.id)),setTimeout(()=>{S(h)},qz)},[h,S,b,$e]);ue.useEffect(()=>{if(h.promise&&He==="loading"||h.duration===1/0||h.type==="loading")return;let Ie;return N||y||Yn?(()=>{if(cn.current<Qt.current){const Pe=new Date().getTime()-Qt.current;Ne.current=Ne.current-Pe}cn.current=new Date().getTime()})():(()=>{Ne.current!==1/0&&(Qt.current=new Date().getTime(),Ie=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),wt()},Ne.current))})(),()=>clearTimeout(Ie)},[N,y,h,He,Yn,wt]),ue.useEffect(()=>{h.delete&&(wt(),h.onDismiss==null||h.onDismiss.call(h,h))},[wt,h.delete]);function On(){var Ie;if(U!=null&&U.loading){var pe;return ue.createElement("div",{className:jr($==null?void 0:$.loader,h==null||(pe=h.classNames)==null?void 0:pe.loader,"sonner-loader"),"data-visible":He==="loading"},U.loading)}return ue.createElement(kz,{className:jr($==null?void 0:$.loader,h==null||(Ie=h.classNames)==null?void 0:Ie.loader),visible:He==="loading"})}const bn=h.icon||(U==null?void 0:U[He])||bz(He);var Zt,Qn;return ue.createElement("li",{tabIndex:0,ref:Fe,className:jr(z,Xt,$==null?void 0:$.toast,h==null||(t=h.classNames)==null?void 0:t.toast,$==null?void 0:$.default,$==null?void 0:$[He],h==null||(n=h.classNames)==null?void 0:n[He]),"data-sonner-toast":"","data-rich-colors":(Zt=h.richColors)!=null?Zt:A,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":ee,"data-promise":!!h.promise,"data-swiped":xe,"data-removed":X,"data-visible":bt,"data-y-position":Ht,"data-x-position":Jt,"data-index":k,"data-front":_t,"data-swiping":ne,"data-dismissible":qe,"data-type":He,"data-invert":Rn,"data-swipe-out":ie,"data-swipe-direction":F,"data-expanded":!!(N||V&&ee),"data-testid":h.testId,style:{"--index":k,"--toasts-before":k,"--z-index":_.length-k,"--offset":`${X?ye:$e.current}px`,"--initial-height":V?"auto":`${we}px`,...T,...h.style},onDragEnd:()=>{te(!1),Y(null),Vt.current=null},onPointerDown:Ie=>{Ie.button!==2&&(Xn||!qe||(Je.current=new Date,_e($e.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(te(!0),Vt.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,pe,me;if(ie||!qe)return;Vt.current=null;const Pe=Number(((Ie=Fe.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ot=Number(((pe=Fe.current)==null?void 0:pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xe=new Date().getTime()-((me=Je.current)==null?void 0:me.getTime()),pt=q==="x"?Pe:Ot,Pt=Math.abs(pt)/Xe;if(Math.abs(pt)>=Bz||Pt>.11){_e($e.current),h.onDismiss==null||h.onDismiss.call(h,h),K(q==="x"?Pe>0?"right":"left":Ot>0?"down":"up"),wt(),he(!0);return}else{var jt,en;(jt=Fe.current)==null||jt.style.setProperty("--swipe-amount-x","0px"),(en=Fe.current)==null||en.style.setProperty("--swipe-amount-y","0px")}ve(!1),te(!1),Y(null)},onPointerMove:Ie=>{var pe,me,Pe;if(!Vt.current||!qe||((pe=window.getSelection())==null?void 0:pe.toString().length)>0)return;const Xe=Ie.clientY-Vt.current.y,pt=Ie.clientX-Vt.current.x;var Pt;const jt=(Pt=e.swipeDirections)!=null?Pt:zz(H);!q&&(Math.abs(pt)>1||Math.abs(Xe)>1)&&Y(Math.abs(pt)>Math.abs(Xe)?"x":"y");let en={x:0,y:0};const wr=un=>1/(1.5+Math.abs(un)/20);if(q==="y"){if(jt.includes("top")||jt.includes("bottom"))if(jt.includes("top")&&Xe<0||jt.includes("bottom")&&Xe>0)en.y=Xe;else{const un=Xe*wr(Xe);en.y=Math.abs(un)<Math.abs(Xe)?un:Xe}}else if(q==="x"&&(jt.includes("left")||jt.includes("right")))if(jt.includes("left")&&pt<0||jt.includes("right")&&pt>0)en.x=pt;else{const un=pt*wr(pt);en.x=Math.abs(un)<Math.abs(pt)?un:pt}(Math.abs(en.x)>0||Math.abs(en.y)>0)&&ve(!0),(me=Fe.current)==null||me.style.setProperty("--swipe-amount-x",`${en.x}px`),(Pe=Fe.current)==null||Pe.style.setProperty("--swipe-amount-y",`${en.y}px`)}},ot&&!h.jsx&&He!=="loading"?ue.createElement("button",{"aria-label":B,"data-disabled":Xn,"data-close-button":!0,onClick:Xn||!qe?()=>{}:()=>{wt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:jr($==null?void 0:$.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Qn=U==null?void 0:U.close)!=null?Qn:Ez):null,(He||h.icon||h.promise)&&h.icon!==null&&((U==null?void 0:U[He])!==null||h.icon)?ue.createElement("div",{"data-icon":"",className:jr($==null?void 0:$.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||On():null,h.type!=="loading"?bn:null):null,ue.createElement("div",{"data-content":"",className:jr($==null?void 0:$.content,h==null||(o=h.classNames)==null?void 0:o.content)},ue.createElement("div",{"data-title":"",className:jr($==null?void 0:$.title,h==null||(a=h.classNames)==null?void 0:a.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ue.createElement("div",{"data-description":"",className:jr(M,Mt,$==null?void 0:$.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),ue.isValidElement(h.cancel)?h.cancel:h.cancel&&Vu(h.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||O,onClick:Ie=>{Vu(h.cancel)&&qe&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ie),wt())},className:jr($==null?void 0:$.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,ue.isValidElement(h.action)?h.action:h.action&&Vu(h.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Ie=>{Vu(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ie),!Ie.defaultPrevented&&wt())},className:jr($==null?void 0:$.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function v2(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Hz(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,a=o?"--mobile-offset":"--offset",c=o?Dz:Lz;function d(f){["top","right","bottom","left"].forEach(p=>{n[`${a}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=c:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const Uz=ue.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:p,mobileOffset:h,theme:g="light",richColors:y,duration:b,style:w,visibleToasts:v=Pz,toastOptions:k,dir:_=v2(),gap:N=Fz,icons:S,containerAriaLabel:A="Notifications"}=t,[I,T]=ue.useState([]),O=ue.useMemo(()=>r?I.filter(ee=>ee.toasterId===r):I.filter(ee=>!ee.toasterId),[I,r]),L=ue.useMemo(()=>Array.from(new Set([o].concat(O.filter(ee=>ee.position).map(ee=>ee.position)))),[O,o]),[z,M]=ue.useState([]),[P,H]=ue.useState(!1),[D,V]=ue.useState(!1),[$,U]=ue.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=ue.useRef(null),q=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),Y=ue.useRef(null),F=ue.useRef(!1),K=ue.useCallback(ee=>{T(W=>{var X;return(X=W.find(Z=>Z.id===ee.id))!=null&&X.delete||yn.dismiss(ee.id),W.filter(({id:Z})=>Z!==ee.id)})},[]);return ue.useEffect(()=>yn.subscribe(ee=>{if(ee.dismiss){requestAnimationFrame(()=>{T(W=>W.map(X=>X.id===ee.id?{...X,delete:!0}:X))});return}setTimeout(()=>{SM.flushSync(()=>{T(W=>{const X=W.findIndex(Z=>Z.id===ee.id);return X!==-1?[...W.slice(0,X),{...W[X],...ee},...W.slice(X+1)]:[ee,...W]})})})}),[I]),ue.useEffect(()=>{if(g!=="system"){U(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:W})=>{U(W?"dark":"light")})}catch{ee.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(Z){console.error(Z)}})}},[g]),ue.useEffect(()=>{I.length<=1&&H(!1)},[I]),ue.useEffect(()=>{const ee=W=>{var X;if(a.every(te=>W[te]||W.code===te)){var ne;H(!0),(ne=B.current)==null||ne.focus()}W.code==="Escape"&&(document.activeElement===B.current||(X=B.current)!=null&&X.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[a]),ue.useEffect(()=>{if(B.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,F.current=!1)}},[B.current]),ue.createElement("section",{ref:n,"aria-label":`${A} ${q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((ee,W)=>{var X;const[Z,ne]=ee.split("-");return O.length?ue.createElement("ol",{key:ee,dir:_==="auto"?v2():_,tabIndex:-1,ref:B,className:f,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":Z,"data-x-position":ne,style:{"--front-toast-height":`${((X=z[0])==null?void 0:X.height)||0}px`,"--width":`${$z}px`,"--gap":`${N}px`,...w,...Hz(p,h)},onBlur:te=>{F.current&&!te.currentTarget.contains(te.relatedTarget)&&(F.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||F.current||(F.current=!0,Y.current=te.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{D||H(!1)},onDragEnd:()=>H(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},O.filter(te=>!te.position&&W===0||te.position===ee).map((te,ie)=>{var he,xe;return ue.createElement(Vz,{key:te.id,icons:S,index:ie,toast:te,defaultRichColors:y,duration:(he=k==null?void 0:k.duration)!=null?he:b,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:s,visibleToasts:v,closeButton:(xe=k==null?void 0:k.closeButton)!=null?xe:d,interacting:D,position:ee,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:K,toasts:O.filter(ve=>ve.position==te.position),heights:z.filter(ve=>ve.position==te.position),setHeights:M,expandByDefault:c,gap:N,expanded:P,swipeDirections:t.swipeDirections})})):null}))});/**
|
|
63
|
+
* @license lucide-react v0.468.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const Wz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),aR=(...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 Kz={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=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},d)=>E.createElement("svg",{ref:d,...Kz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:aR("lucide",s),...c},[...a.map(([f,p])=>E.createElement(f,p)),...Array.isArray(o)?o:[o]]));/**
|
|
78
|
+
* @license lucide-react v0.468.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const ae=(e,t)=>{const n=E.forwardRef(({className:r,...s},o)=>E.createElement(Gz,{ref:o,iconNode:t,className:aR(`lucide-${Wz(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
83
|
+
* @license lucide-react v0.468.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const Yz=ae("AlignCenterHorizontal",[["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4",key:"11f1s0"}],["path",{d:"M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4",key:"t14dx9"}],["path",{d:"M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1",key:"1w07xs"}],["path",{d:"M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1",key:"1apec2"}]]);/**
|
|
88
|
+
* @license lucide-react v0.468.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const Xz=ae("AlignCenterVertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",key:"14d6g8"}],["path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",key:"1e2lrw"}],["path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",key:"1fkdwx"}],["path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",key:"1euafb"}]]);/**
|
|
93
|
+
* @license lucide-react v0.468.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const Qz=ae("AlignEndHorizontal",[["rect",{width:"6",height:"16",x:"4",y:"2",rx:"2",key:"z5wdxg"}],["rect",{width:"6",height:"9",x:"14",y:"9",rx:"2",key:"um7a8w"}],["path",{d:"M22 22H2",key:"19qnx5"}]]);/**
|
|
98
|
+
* @license lucide-react v0.468.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const Jz=ae("AlignEndVertical",[["rect",{width:"16",height:"6",x:"2",y:"4",rx:"2",key:"10wcwx"}],["rect",{width:"9",height:"6",x:"9",y:"14",rx:"2",key:"4p5bwg"}],["path",{d:"M22 22V2",key:"12ipfv"}]]);/**
|
|
103
|
+
* @license lucide-react v0.468.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const Zz=ae("AlignStartHorizontal",[["rect",{width:"6",height:"16",x:"4",y:"6",rx:"2",key:"1n4dg1"}],["rect",{width:"6",height:"9",x:"14",y:"6",rx:"2",key:"17khns"}],["path",{d:"M22 2H2",key:"fhrpnj"}]]);/**
|
|
108
|
+
* @license lucide-react v0.468.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const e9=ae("AlignStartVertical",[["rect",{width:"9",height:"6",x:"6",y:"14",rx:"2",key:"lpm2y7"}],["rect",{width:"16",height:"6",x:"6",y:"4",rx:"2",key:"rdj6ps"}],["path",{d:"M2 2v20",key:"1ivd8o"}]]);/**
|
|
113
|
+
* @license lucide-react v0.468.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const t9=ae("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
118
|
+
* @license lucide-react v0.468.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const n9=ae("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
123
|
+
* @license lucide-react v0.468.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const Dl=ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
128
|
+
* @license lucide-react v0.468.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const r9=ae("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
133
|
+
* @license lucide-react v0.468.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const s9=ae("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
138
|
+
* @license lucide-react v0.468.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const Nl=ae("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
143
|
+
* @license lucide-react v0.468.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const b2=ae("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
148
|
+
* @license lucide-react v0.468.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const pb=ae("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
153
|
+
* @license lucide-react v0.468.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const Js=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
158
|
+
* @license lucide-react v0.468.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const Lr=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
163
|
+
* @license lucide-react v0.468.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const lR=ae("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
168
|
+
* @license lucide-react v0.468.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const qt=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
173
|
+
* @license lucide-react v0.468.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const o9=ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
178
|
+
* @license lucide-react v0.468.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const zo=ae("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
183
|
+
* @license lucide-react v0.468.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const zt=ae("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
188
|
+
* @license lucide-react v0.468.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const i9=ae("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
193
|
+
* @license lucide-react v0.468.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const lt=ae("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
198
|
+
* @license lucide-react v0.468.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const mb=ae("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
203
|
+
* @license lucide-react v0.468.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const a9=ae("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
208
|
+
* @license lucide-react v0.468.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const an=ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
213
|
+
* @license lucide-react v0.468.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const l9=ae("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
218
|
+
* @license lucide-react v0.468.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const c9=ae("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
223
|
+
* @license lucide-react v0.468.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const mw=ae("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
228
|
+
* @license lucide-react v0.468.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const u9=ae("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
233
|
+
* @license lucide-react v0.468.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const Lo=ae("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
238
|
+
* @license lucide-react v0.468.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const d9=ae("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
|
|
243
|
+
* @license lucide-react v0.468.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const f9=ae("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
248
|
+
* @license lucide-react v0.468.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const h9=ae("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
253
|
+
* @license lucide-react v0.468.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const p9=ae("FileInput",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
|
|
258
|
+
* @license lucide-react v0.468.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const m9=ae("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);/**
|
|
263
|
+
* @license lucide-react v0.468.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const Do=ae("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
268
|
+
* @license lucide-react v0.468.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const cR=ae("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
273
|
+
* @license lucide-react v0.468.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const g9=ae("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
|
|
278
|
+
* @license lucide-react v0.468.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const $l=ae("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
283
|
+
* @license lucide-react v0.468.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const y9=ae("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
288
|
+
* @license lucide-react v0.468.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const Pd=ae("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
293
|
+
* @license lucide-react v0.468.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const uR=ae("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
298
|
+
* @license lucide-react v0.468.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const w2=ae("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
303
|
+
* @license lucide-react v0.468.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const x9=ae("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
|
|
308
|
+
* @license lucide-react v0.468.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const dR=ae("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
313
|
+
* @license lucide-react v0.468.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const v9=ae("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
|
|
318
|
+
* @license lucide-react v0.468.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const fR=ae("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
323
|
+
* @license lucide-react v0.468.0 - ISC
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the ISC license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/const k2=ae("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
328
|
+
* @license lucide-react v0.468.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const b9=ae("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/**
|
|
333
|
+
* @license lucide-react v0.468.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/const uf=ae("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
338
|
+
* @license lucide-react v0.468.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const w9=ae("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
343
|
+
* @license lucide-react v0.468.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const hR=ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
348
|
+
* @license lucide-react v0.468.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const k9=ae("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
353
|
+
* @license lucide-react v0.468.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/const gb=ae("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
358
|
+
* @license lucide-react v0.468.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/const gw=ae("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
363
|
+
* @license lucide-react v0.468.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the ISC license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/const Dr=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
368
|
+
* @license lucide-react v0.468.0 - ISC
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the ISC license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/const N9=ae("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
373
|
+
* @license lucide-react v0.468.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const pR=ae("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
378
|
+
* @license lucide-react v0.468.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const N2=ae("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
383
|
+
* @license lucide-react v0.468.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const S9=ae("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
|
|
388
|
+
* @license lucide-react v0.468.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const C9=ae("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
393
|
+
* @license lucide-react v0.468.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const _9=ae("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
398
|
+
* @license lucide-react v0.468.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const mR=ae("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
403
|
+
* @license lucide-react v0.468.0 - ISC
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the ISC license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/const E9=ae("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
408
|
+
* @license lucide-react v0.468.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/const j9=ae("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
413
|
+
* @license lucide-react v0.468.0 - ISC
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the ISC license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/const A9=ae("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
418
|
+
* @license lucide-react v0.468.0 - ISC
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the ISC license.
|
|
421
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
+
*/const T9=ae("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
|
|
423
|
+
* @license lucide-react v0.468.0 - ISC
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the ISC license.
|
|
426
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/const I9=ae("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
428
|
+
* @license lucide-react v0.468.0 - ISC
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the ISC license.
|
|
431
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/const S2=ae("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
433
|
+
* @license lucide-react v0.468.0 - ISC
|
|
434
|
+
*
|
|
435
|
+
* This source code is licensed under the ISC license.
|
|
436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
+
*/const M9=ae("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/**
|
|
438
|
+
* @license lucide-react v0.468.0 - ISC
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the ISC license.
|
|
441
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
+
*/const gR=ae("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
443
|
+
* @license lucide-react v0.468.0 - ISC
|
|
444
|
+
*
|
|
445
|
+
* This source code is licensed under the ISC license.
|
|
446
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
+
*/const R9=ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
448
|
+
* @license lucide-react v0.468.0 - ISC
|
|
449
|
+
*
|
|
450
|
+
* This source code is licensed under the ISC license.
|
|
451
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
+
*/const O9=ae("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
|
|
453
|
+
* @license lucide-react v0.468.0 - ISC
|
|
454
|
+
*
|
|
455
|
+
* This source code is licensed under the ISC license.
|
|
456
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
+
*/const Vo=ae("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
458
|
+
* @license lucide-react v0.468.0 - ISC
|
|
459
|
+
*
|
|
460
|
+
* This source code is licensed under the ISC license.
|
|
461
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
462
|
+
*/const df=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
463
|
+
* @license lucide-react v0.468.0 - ISC
|
|
464
|
+
*
|
|
465
|
+
* This source code is licensed under the ISC license.
|
|
466
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
467
|
+
*/const P9=ae("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
|
|
468
|
+
* @license lucide-react v0.468.0 - ISC
|
|
469
|
+
*
|
|
470
|
+
* This source code is licensed under the ISC license.
|
|
471
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
472
|
+
*/const L9=ae("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
473
|
+
* @license lucide-react v0.468.0 - ISC
|
|
474
|
+
*
|
|
475
|
+
* This source code is licensed under the ISC license.
|
|
476
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
477
|
+
*/const C2=ae("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
|
|
478
|
+
* @license lucide-react v0.468.0 - ISC
|
|
479
|
+
*
|
|
480
|
+
* This source code is licensed under the ISC license.
|
|
481
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
482
|
+
*/const yR=ae("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
483
|
+
* @license lucide-react v0.468.0 - ISC
|
|
484
|
+
*
|
|
485
|
+
* This source code is licensed under the ISC license.
|
|
486
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
487
|
+
*/const _2=ae("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
488
|
+
* @license lucide-react v0.468.0 - ISC
|
|
489
|
+
*
|
|
490
|
+
* This source code is licensed under the ISC license.
|
|
491
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
492
|
+
*/const yw=ae("Rss",[["path",{d:"M4 11a9 9 0 0 1 9 9",key:"pv89mb"}],["path",{d:"M4 4a16 16 0 0 1 16 16",key:"k0647b"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]]);/**
|
|
493
|
+
* @license lucide-react v0.468.0 - ISC
|
|
494
|
+
*
|
|
495
|
+
* This source code is licensed under the ISC license.
|
|
496
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
497
|
+
*/const D9=ae("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"}]]);/**
|
|
498
|
+
* @license lucide-react v0.468.0 - ISC
|
|
499
|
+
*
|
|
500
|
+
* This source code is licensed under the ISC license.
|
|
501
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
502
|
+
*/const Fl=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
503
|
+
* @license lucide-react v0.468.0 - ISC
|
|
504
|
+
*
|
|
505
|
+
* This source code is licensed under the ISC license.
|
|
506
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
507
|
+
*/const xR=ae("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"}]]);/**
|
|
508
|
+
* @license lucide-react v0.468.0 - ISC
|
|
509
|
+
*
|
|
510
|
+
* This source code is licensed under the ISC license.
|
|
511
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
512
|
+
*/const vR=ae("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
513
|
+
* @license lucide-react v0.468.0 - ISC
|
|
514
|
+
*
|
|
515
|
+
* This source code is licensed under the ISC license.
|
|
516
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
517
|
+
*/const Ji=ae("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"}]]);/**
|
|
518
|
+
* @license lucide-react v0.468.0 - ISC
|
|
519
|
+
*
|
|
520
|
+
* This source code is licensed under the ISC license.
|
|
521
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
522
|
+
*/const E2=ae("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
523
|
+
* @license lucide-react v0.468.0 - ISC
|
|
524
|
+
*
|
|
525
|
+
* This source code is licensed under the ISC license.
|
|
526
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
527
|
+
*/const $9=ae("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
|
|
528
|
+
* @license lucide-react v0.468.0 - ISC
|
|
529
|
+
*
|
|
530
|
+
* This source code is licensed under the ISC license.
|
|
531
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
532
|
+
*/const bR=ae("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
533
|
+
* @license lucide-react v0.468.0 - ISC
|
|
534
|
+
*
|
|
535
|
+
* This source code is licensed under the ISC license.
|
|
536
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
537
|
+
*/const wR=ae("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"}]]);/**
|
|
538
|
+
* @license lucide-react v0.468.0 - ISC
|
|
539
|
+
*
|
|
540
|
+
* This source code is licensed under the ISC license.
|
|
541
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
542
|
+
*/const F9=ae("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
543
|
+
* @license lucide-react v0.468.0 - ISC
|
|
544
|
+
*
|
|
545
|
+
* This source code is licensed under the ISC license.
|
|
546
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
547
|
+
*/const B9=ae("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"}]]);/**
|
|
548
|
+
* @license lucide-react v0.468.0 - ISC
|
|
549
|
+
*
|
|
550
|
+
* This source code is licensed under the ISC license.
|
|
551
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
552
|
+
*/const kR=ae("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
553
|
+
* @license lucide-react v0.468.0 - ISC
|
|
554
|
+
*
|
|
555
|
+
* This source code is licensed under the ISC license.
|
|
556
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
557
|
+
*/const q9=ae("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
|
|
558
|
+
* @license lucide-react v0.468.0 - ISC
|
|
559
|
+
*
|
|
560
|
+
* This source code is licensed under the ISC license.
|
|
561
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
562
|
+
*/const z9=ae("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"}]]);/**
|
|
563
|
+
* @license lucide-react v0.468.0 - ISC
|
|
564
|
+
*
|
|
565
|
+
* This source code is licensed under the ISC license.
|
|
566
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
567
|
+
*/const V9=ae("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
568
|
+
* @license lucide-react v0.468.0 - ISC
|
|
569
|
+
*
|
|
570
|
+
* This source code is licensed under the ISC license.
|
|
571
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
572
|
+
*/const oa=ae("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"}]]);/**
|
|
573
|
+
* @license lucide-react v0.468.0 - ISC
|
|
574
|
+
*
|
|
575
|
+
* This source code is licensed under the ISC license.
|
|
576
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
577
|
+
*/const j2=ae("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"}]]);/**
|
|
578
|
+
* @license lucide-react v0.468.0 - ISC
|
|
579
|
+
*
|
|
580
|
+
* This source code is licensed under the ISC license.
|
|
581
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
582
|
+
*/const rc=ae("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"}]]);/**
|
|
583
|
+
* @license lucide-react v0.468.0 - ISC
|
|
584
|
+
*
|
|
585
|
+
* This source code is licensed under the ISC license.
|
|
586
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
587
|
+
*/const H9=ae("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"}]]);/**
|
|
588
|
+
* @license lucide-react v0.468.0 - ISC
|
|
589
|
+
*
|
|
590
|
+
* This source code is licensed under the ISC license.
|
|
591
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
592
|
+
*/const NR=ae("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
593
|
+
* @license lucide-react v0.468.0 - ISC
|
|
594
|
+
*
|
|
595
|
+
* This source code is licensed under the ISC license.
|
|
596
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
597
|
+
*/const U9=ae("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
598
|
+
* @license lucide-react v0.468.0 - ISC
|
|
599
|
+
*
|
|
600
|
+
* This source code is licensed under the ISC license.
|
|
601
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
602
|
+
*/const W9=ae("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
603
|
+
* @license lucide-react v0.468.0 - ISC
|
|
604
|
+
*
|
|
605
|
+
* This source code is licensed under the ISC license.
|
|
606
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
607
|
+
*/const sc=ae("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"}]]);/**
|
|
608
|
+
* @license lucide-react v0.468.0 - ISC
|
|
609
|
+
*
|
|
610
|
+
* This source code is licensed under the ISC license.
|
|
611
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
612
|
+
*/const K9=ae("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"}]]);/**
|
|
613
|
+
* @license lucide-react v0.468.0 - ISC
|
|
614
|
+
*
|
|
615
|
+
* This source code is licensed under the ISC license.
|
|
616
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
617
|
+
*/const G9=ae("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
|
|
618
|
+
* @license lucide-react v0.468.0 - ISC
|
|
619
|
+
*
|
|
620
|
+
* This source code is licensed under the ISC license.
|
|
621
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
622
|
+
*/const Y9=ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
623
|
+
* @license lucide-react v0.468.0 - ISC
|
|
624
|
+
*
|
|
625
|
+
* This source code is licensed under the ISC license.
|
|
626
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
627
|
+
*/const dr=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
628
|
+
* @license lucide-react v0.468.0 - ISC
|
|
629
|
+
*
|
|
630
|
+
* This source code is licensed under the ISC license.
|
|
631
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
632
|
+
*/const Zi=ae("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"}]]);/**
|
|
633
|
+
* @license lucide-react v0.468.0 - ISC
|
|
634
|
+
*
|
|
635
|
+
* This source code is licensed under the ISC license.
|
|
636
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
637
|
+
*/const X9=ae("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"}]]);/**
|
|
638
|
+
* @license lucide-react v0.468.0 - ISC
|
|
639
|
+
*
|
|
640
|
+
* This source code is licensed under the ISC license.
|
|
641
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
642
|
+
*/const Q9=ae("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"}]]),A2=e=>{let t;const n=new Set,r=(f,p)=>{const h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){const g=t;t=p??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(y=>y(t,g))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f))},d=t=e(r,s,c);return c},J9=(e=>e?A2(e):A2),Z9=e=>e;function eV(e,t=Z9){const n=ue.useSyncExternalStore(e.subscribe,ue.useCallback(()=>t(e.getState()),[e,t]),ue.useCallback(()=>t(e.getInitialState()),[e,t]));return ue.useDebugValue(n),n}const T2=e=>{const t=J9(e),n=r=>eV(t,r);return Object.assign(n,t),n},Mn=(e=>e?T2(e):T2),tV=[{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"}}],nV=[{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"}],qr=Mn((e,t)=>({nodes:tV,edges:nV,past:[],future:[],maxHistorySize:50,clipboard:null,onNodesChange:n=>{n.some(s=>s.type!=="position"&&s.type!=="select"&&s.type!=="dimensions")&&t().saveCheckpoint(),e({nodes:TM(n,t().nodes)})},onEdgesChange:n=>{n.some(s=>s.type!=="select")&&t().saveCheckpoint(),e({edges:IM(n,t().edges)})},onConnect:n=>{t().saveCheckpoint(),e({edges:uM({...n,animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},t().edges)})},setNodes:n=>{t().saveCheckpoint(),e({nodes:n,future:[]})},setEdges:n=>{t().saveCheckpoint(),e({edges:n,future:[]})},updateNodeData:(n,r)=>{t().saveCheckpoint(),e({nodes:t().nodes.map(s=>s.id===n?{...s,data:{...s.data,...r}}:s),future:[]})},clearCanvas:()=>{t().saveCheckpoint(),e({nodes:[],edges:[],future:[]})},saveCheckpoint:()=>{const{nodes:n,edges:r,past:s,maxHistorySize:o}=t();if(s.length>0){const d=s[s.length-1];if(JSON.stringify(d.nodes)===JSON.stringify(n)&&JSON.stringify(d.edges)===JSON.stringify(r))return}const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=[...s,a];c.length>o&&c.shift(),e({past:c})},undo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(s.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=s[s.length-1],d=s.slice(0,-1);e({nodes:c.nodes,edges:c.edges,past:d,future:[a,...o]})},redo:()=>{const{nodes:n,edges:r,past:s,future:o}=t();if(o.length===0)return;const a={nodes:JSON.parse(JSON.stringify(n)),edges:JSON.parse(JSON.stringify(r))},c=o[0],d=o.slice(1);e({nodes:c.nodes,edges:c.edges,past:[...s,a],future:d})},canUndo:()=>t().past.length>0,canRedo:()=>t().future.length>0,copySelected:()=>{const{nodes:n}=t(),r=n.filter(d=>d.selected);if(r.length===0)return;const s=new Set(r.map(d=>d.id)),{edges:o}=t(),a=o.filter(d=>s.has(d.source)&&s.has(d.target)),c={nodes:JSON.parse(JSON.stringify(r)),edges:JSON.parse(JSON.stringify(a))};e({clipboard:c})},paste:(n={x:50,y:50})=>{const{clipboard:r,nodes:s,edges:o}=t();if(!r||r.nodes.length===0)return;t().saveCheckpoint();const a=new Map,c=Date.now().toString(36),d=r.nodes.map((h,g)=>{const y=`${h.id.split("-copy")[0]}-copy-${c}-${g}`;return a.set(h.id,y),{...h,id:y,position:{x:h.position.x+n.x,y:h.position.y+n.y},selected:!0,data:{...h.data,id:y}}}),f=r.edges.map((h,g)=>({...h,id:`${h.id.split("-copy")[0]}-copy-${c}-${g}`,source:a.get(h.source)||h.source,target:a.get(h.target)||h.target})),p=s.map(h=>({...h,selected:!1}));e({nodes:[...p,...d],edges:[...o,...f],future:[]})},canPaste:()=>{const{clipboard:n}=t();return n!==null&&n.nodes.length>0}})),rV=()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.platform.toUpperCase().includes("MAC"),oc=()=>rV()?"⌘":"Ctrl",sV={slack:mR,github:Pd,jira:a9,gmail:N2,outlook:pb,linear:j2,notion:Do,discord:_9,airtable:f9,confluence:Do,http:dR,claude:Nl,opencode:Nl,ollama:Nl,webhook:Zi,schedule:pb,trigger:Zi,stripe:d9,teams:W9,twilio:O9,sendgrid:xR,shopify:$9,zendesk:b9,mailchimp:N2,asana:F9,trello:j2,dropbox:l9,s3:k2,"aws-s3":k2,parallel:gb,rss:yw};function yb(e){const t=e.toLowerCase().split(".")[0];return sV[t]||i9}function SR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=SR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function oV(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=SR(e))&&(r&&(r+=" "),r+=t);return r}const xw="-",iV=e=>{const t=lV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(xw);return c[0]===""&&c.length!==1&&c.shift(),CR(c,t)||aV(a)},getConflictingClassGroupIds:(a,c)=>{const d=n[a]||[];return c&&r[a]?[...d,...r[a]]:d}}},CR=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?CR(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(xw);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId},I2=/^\[(.+)\]$/,aV=e=>{if(I2.test(e)){const t=I2.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},lV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return uV(Object.entries(e.classGroups),n).forEach(([o,a])=>{xb(a,r,o,t)}),r},xb=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:M2(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(cV(s)){xb(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{xb(a,M2(t,o),n,r)})})},M2=(e,t)=>{let n=e;return t.split(xw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},cV=e=>e.isThemeGetter,uV=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,s]}):e,dV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},_R="!",fV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=c=>{const d=[];let f=0,p=0,h;for(let v=0;v<c.length;v++){let k=c[v];if(f===0){if(k===s&&(r||c.slice(v,v+o)===t)){d.push(c.slice(p,v)),p=v+o;continue}if(k==="/"){h=v;continue}}k==="["?f++:k==="]"&&f--}const g=d.length===0?c:c.substring(p),y=g.startsWith(_R),b=y?g.substring(1):g,w=h&&h>p?h-p:void 0;return{modifiers:d,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}};return n?c=>n({className:c,parseClassName:a}):a},hV=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},pV=e=>({cache:dV(e.cacheSize),parseClassName:fV(e),...iV(e)}),mV=/\s+/,gV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(mV);let c="";for(let d=a.length-1;d>=0;d-=1){const f=a[d],{modifiers:p,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:y}=n(f);let b=!!y,w=r(b?g.substring(0,y):g);if(!w){if(!b){c=f+(c.length>0?" "+c:c);continue}if(w=r(g),!w){c=f+(c.length>0?" "+c:c);continue}b=!1}const v=hV(p).join(":"),k=h?v+_R:v,_=k+w;if(o.includes(_))continue;o.push(_);const N=s(w,b);for(let S=0;S<N.length;++S){const A=N[S];o.push(k+A)}c=f+(c.length>0?" "+c:c)}return c};function yV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ER(t))&&(r&&(r+=" "),r+=n);return r}const ER=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ER(e[r]))&&(n&&(n+=" "),n+=t);return n};function xV(e,...t){let n,r,s,o=a;function a(d){const f=t.reduce((p,h)=>h(p),e());return n=pV(f),r=n.cache.get,s=n.cache.set,o=c,c(d)}function c(d){const f=r(d);if(f)return f;const p=gV(d,n);return s(d,p),p}return function(){return o(yV.apply(null,arguments))}}const st=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},jR=/^\[(?:([a-z-]+):)?(.+)\]$/i,vV=/^\d+\/\d+$/,bV=new Set(["px","full","screen"]),wV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kV=/\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$/,NV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ss=e=>Bi(e)||bV.has(e)||vV.test(e),Bs=e=>ia(e,"length",RV),Bi=e=>!!e&&!Number.isNaN(Number(e)),um=e=>ia(e,"number",Bi),il=e=>!!e&&Number.isInteger(Number(e)),_V=e=>e.endsWith("%")&&Bi(e.slice(0,-1)),De=e=>jR.test(e),qs=e=>wV.test(e),EV=new Set(["length","size","percentage"]),jV=e=>ia(e,EV,AR),AV=e=>ia(e,"position",AR),TV=new Set(["image","url"]),IV=e=>ia(e,TV,PV),MV=e=>ia(e,"",OV),al=()=>!0,ia=(e,t,n)=>{const r=jR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},RV=e=>kV.test(e)&&!NV.test(e),AR=()=>!1,OV=e=>SV.test(e),PV=e=>CV.test(e),LV=()=>{const e=st("colors"),t=st("spacing"),n=st("blur"),r=st("brightness"),s=st("borderColor"),o=st("borderRadius"),a=st("borderSpacing"),c=st("borderWidth"),d=st("contrast"),f=st("grayscale"),p=st("hueRotate"),h=st("invert"),g=st("gap"),y=st("gradientColorStops"),b=st("gradientColorStopPositions"),w=st("inset"),v=st("margin"),k=st("opacity"),_=st("padding"),N=st("saturate"),S=st("scale"),A=st("sepia"),I=st("skew"),T=st("space"),O=st("translate"),L=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",De,t],P=()=>[De,t],H=()=>["",ss,Bs],D=()=>["auto",Bi,De],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",De],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Bi,De];return{cacheSize:500,separator:":",theme:{colors:[al],spacing:[ss,Bs],blur:["none","",qs,De],brightness:F(),borderColor:[e],borderRadius:["none","","full",qs,De],borderSpacing:P(),borderWidth:H(),contrast:F(),grayscale:q(),hueRotate:F(),invert:q(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[_V,Bs],inset:M(),margin:M(),opacity:F(),padding:P(),saturate:F(),scale:F(),sepia:q(),skew:F(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",De]}],container:["container"],columns:[{columns:[qs]}],"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(),De]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",il,De]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",De]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",il,De]}],"grid-cols":[{"grid-cols":[al]}],"col-start-end":[{col:["auto",{span:["full",il,De]},De]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[al]}],"row-start-end":[{row:["auto",{span:[il,De]},De]}],"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",De]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",De]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",De,t]}],"min-w":[{"min-w":[De,t,"min","max","fit"]}],"max-w":[{"max-w":[De,t,"none","full","min","max","fit","prose",{screen:[qs]},qs]}],h:[{h:[De,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[De,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[De,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[De,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qs,Bs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",um]}],"font-family":[{font:[al]}],"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",De]}],"line-clamp":[{"line-clamp":["none",Bi,um]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ss,De]}],"list-image":[{"list-image":["none",De]}],"list-style-type":[{list:["none","disc","decimal",De]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ss,Bs]}],"underline-offset":[{"underline-offset":["auto",ss,De]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De]}],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",De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),AV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},IV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],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":[k]}],"border-style":[{border:[...$(),"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":[k]}],"divide-style":[{divide:$()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[ss,De]}],"outline-w":[{outline:[ss,Bs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ss,Bs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qs,MV]}],"shadow-color":[{shadow:[al]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",qs,De]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[h]}],saturate:[{saturate:[N]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",De]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",De]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",De]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[il,De]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",De]}],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",De]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",De]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ss,Bs,um]}],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"]}}},DV=xV(LV);function Ye(...e){return DV(oV(e))}function $V({label:e,data:t,variant:n="output",className:r}){const[s,o]=E.useState(!1),[a,c]=E.useState(!1);if(t==null)return null;const d=FV(t),f=typeof t=="object",p=async h=>{h.stopPropagation();try{await navigator.clipboard.writeText(typeof t=="string"?t:JSON.stringify(t,null,2)),c(!0),setTimeout(()=>c(!1),2e3)}catch{}};return u.jsxs("div",{className:Ye("mt-1",r),children:[u.jsxs("button",{onClick:h=>{h.stopPropagation(),f&&o(!s)},className:Ye("flex items-center gap-1.5 px-2 py-1 rounded text-xs w-full text-left transition-colors",n==="input"?"bg-blue-500/10 text-blue-400":"bg-success/10 text-success"),children:[f&&(s?u.jsx(Lr,{className:"w-3 h-3 flex-shrink-0"}):u.jsx(qt,{className:"w-3 h-3 flex-shrink-0"})),u.jsxs("span",{className:"font-medium flex-shrink-0",children:[e,":"]}),u.jsx("span",{className:"truncate font-mono opacity-75",children:d}),u.jsx("button",{onClick:p,className:"ml-auto flex-shrink-0 p-0.5 rounded hover:bg-white/10",title:"Copy value",children:a?u.jsx(Js,{className:"w-3 h-3"}):u.jsx(Lo,{className:"w-3 h-3 opacity-50"})})]}),s&&f&&u.jsx("pre",{className:"mt-1 px-2 py-1.5 bg-bg-surface rounded text-xs font-mono text-text-secondary overflow-x-auto max-h-[120px] overflow-y-auto",children:JSON.stringify(t,null,2)})]})}function FV(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e.length>40?e.slice(0,40)+"...":e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[${e.length} items]`;if(typeof e=="object"){const t=Object.keys(e);return`{${t.slice(0,3).join(", ")}${t.length>3?", ...":""}}`}return String(e)}const R2=E.memo($V);function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function O2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vw(...e){return t=>{let n=!1;const r=e.map(s=>{const o=O2(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():O2(e[s],null)}}}}function It(...e){return E.useCallback(vw(...e),e)}function BV(e,t){const n=E.createContext(t),r=o=>{const{children:a,...c}=o,d=E.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function s(o){const a=E.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function no(e,t=[]){let n=[];function r(o,a){const c=E.createContext(a),d=n.length;n=[...n,a];const f=h=>{var k;const{scope:g,children:y,...b}=h,w=((k=g==null?void 0:g[e])==null?void 0:k[d])||c,v=E.useMemo(()=>b,Object.values(b));return u.jsx(w.Provider,{value:v,children:y})};f.displayName=o+"Provider";function p(h,g){var w;const y=((w=g==null?void 0:g[e])==null?void 0:w[d])||c,b=E.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,p]}const s=()=>{const o=n.map(a=>E.createContext(a));return function(c){const d=(c==null?void 0:c[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,qV(s,...t)]}function qV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...c,...h}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Bl(e){const t=zV(e),n=E.forwardRef((r,s)=>{const{children:o,...a}=r,c=E.Children.toArray(o),d=c.find(HV);if(d){const f=d.props.children,p=c.map(h=>h===d?E.Children.count(f)>1?E.Children.only(null):E.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:s,children:E.isValidElement(f)?E.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function zV(e){const t=E.forwardRef((n,r)=>{const{children:s,...o}=n;if(E.isValidElement(s)){const a=WV(s),c=UV(o,s.props);return s.type!==E.Fragment&&(c.ref=r?vw(r,a):a),E.cloneElement(s,c)}return E.Children.count(s)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TR=Symbol("radix.slottable");function VV(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=TR,t}function HV(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TR}function UV(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function WV(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var KV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=KV.reduce((e,t)=>{const n=Bl(`Primitive.${t}`),r=E.forwardRef((s,o)=>{const{asChild:a,...c}=s,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function IR(e,t){e&&hw.flushSync(()=>e.dispatchEvent(t))}function zr(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function GV(e,t=globalThis==null?void 0:globalThis.document){const n=zr(e);E.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var YV="DismissableLayer",vb="dismissableLayer.update",XV="dismissableLayer.pointerDownOutside",QV="dismissableLayer.focusOutside",P2,MR=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ff=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=E.useContext(MR),[p,h]=E.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=E.useState({}),b=It(t,T=>h(T)),w=Array.from(f.layers),[v]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(v),_=p?w.indexOf(p):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,S=_>=k,A=e7(T=>{const O=T.target,L=[...f.branches].some(z=>z.contains(O));!S||L||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},g),I=t7(T=>{const O=T.target;[...f.branches].some(z=>z.contains(O))||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},g);return GV(T=>{_===f.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),E.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(P2=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),L2(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=P2)}},[p,g,n,f]),E.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),L2())},[p,f]),E.useEffect(()=>{const T=()=>y({});return document.addEventListener(vb,T),()=>document.removeEventListener(vb,T)},[]),u.jsx(tt.div,{...d,ref:b,style:{pointerEvents:N?S?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,A.onPointerDownCapture)})});ff.displayName=YV;var JV="DismissableLayerBranch",ZV=E.forwardRef((e,t)=>{const n=E.useContext(MR),r=E.useRef(null),s=It(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(tt.div,{...e,ref:s})});ZV.displayName=JV;function e7(e,t=globalThis==null?void 0:globalThis.document){const n=zr(e),r=E.useRef(!1),s=E.useRef(()=>{});return E.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){RR(XV,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function t7(e,t=globalThis==null?void 0:globalThis.document){const n=zr(e),r=E.useRef(!1);return E.useEffect(()=>{const s=o=>{o.target&&!r.current&&RR(QV,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function L2(){const e=new CustomEvent(vb);document.dispatchEvent(e)}function RR(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?IR(s,o):s.dispatchEvent(o)}var Zs=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},n7=mI[" useId ".trim().toString()]||(()=>{}),r7=0;function qi(e){const[t,n]=E.useState(n7());return Zs(()=>{n(r=>r??String(r7++))},[e]),t?`radix-${t}`:""}const s7=["top","right","bottom","left"],eo=Math.min,En=Math.max,Ld=Math.round,Hu=Math.floor,$r=e=>({x:e,y:e}),o7={left:"right",right:"left",bottom:"top",top:"bottom"},i7={start:"end",end:"start"};function bb(e,t,n){return En(e,eo(t,n))}function ds(e,t){return typeof e=="function"?e(t):e}function fs(e){return e.split("-")[0]}function aa(e){return e.split("-")[1]}function bw(e){return e==="x"?"y":"x"}function ww(e){return e==="y"?"height":"width"}const a7=new Set(["top","bottom"]);function Rr(e){return a7.has(fs(e))?"y":"x"}function kw(e){return bw(Rr(e))}function l7(e,t,n){n===void 0&&(n=!1);const r=aa(e),s=kw(e),o=ww(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Dd(a)),[a,Dd(a)]}function c7(e){const t=Dd(e);return[wb(e),t,wb(t)]}function wb(e){return e.replace(/start|end/g,t=>i7[t])}const D2=["left","right"],$2=["right","left"],u7=["top","bottom"],d7=["bottom","top"];function f7(e,t,n){switch(e){case"top":case"bottom":return n?t?$2:D2:t?D2:$2;case"left":case"right":return t?u7:d7;default:return[]}}function h7(e,t,n,r){const s=aa(e);let o=f7(fs(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(wb)))),o}function Dd(e){return e.replace(/left|right|bottom|top/g,t=>o7[t])}function p7(e){return{top:0,right:0,bottom:0,left:0,...e}}function OR(e){return typeof e!="number"?p7(e):{top:e,right:e,bottom:e,left:e}}function $d(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function F2(e,t,n){let{reference:r,floating:s}=e;const o=Rr(t),a=kw(t),c=ww(a),d=fs(t),f=o==="y",p=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-s.width,y:h};break;default:y={x:r.x,y:r.y}}switch(aa(t)){case"start":y[a]-=g*(n&&f?-1:1);break;case"end":y[a]+=g*(n&&f?-1:1);break}return y}const m7=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:h}=F2(f,r,d),g=r,y={},b=0;for(let w=0;w<c.length;w++){const{name:v,fn:k}=c[w],{x:_,y:N,data:S,reset:A}=await k({x:p,y:h,initialPlacement:r,placement:g,strategy:s,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=_??p,h=N??h,y={...y,[v]:{...y[v],...S}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:p,y:h}=F2(f,g,d)),w=-1)}return{x:p,y:h,placement:g,strategy:s,middlewareData:y}};async function ql(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:g=!1,padding:y=0}=ds(t,e),b=OR(y),v=c[g?h==="floating"?"reference":"floating":h],k=$d(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),_=h==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),S=await(o.isElement==null?void 0:o.isElement(N))?await(o.getScale==null?void 0:o.getScale(N))||{x:1,y:1}:{x:1,y:1},A=$d(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:N,strategy:d}):_);return{top:(k.top-A.top+b.top)/S.y,bottom:(A.bottom-k.bottom+b.bottom)/S.y,left:(k.left-A.left+b.left)/S.x,right:(A.right-k.right+b.right)/S.x}}const g7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=ds(e,t)||{};if(f==null)return{};const h=OR(p),g={x:n,y:r},y=kw(s),b=ww(y),w=await a.getDimensions(f),v=y==="y",k=v?"top":"left",_=v?"bottom":"right",N=v?"clientHeight":"clientWidth",S=o.reference[b]+o.reference[y]-g[y]-o.floating[b],A=g[y]-o.reference[y],I=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let T=I?I[N]:0;(!T||!await(a.isElement==null?void 0:a.isElement(I)))&&(T=c.floating[N]||o.floating[b]);const O=S/2-A/2,L=T/2-w[b]/2-1,z=eo(h[k],L),M=eo(h[_],L),P=z,H=T-w[b]-M,D=T/2-w[b]/2+O,V=bb(P,D,H),$=!d.arrow&&aa(s)!=null&&D!==V&&o.reference[b]/2-(D<P?z:M)-w[b]/2<0,U=$?D<P?D-P:D-H:0;return{[y]:g[y]+U,data:{[y]:V,centerOffset:D-V-U,...$&&{alignmentOffset:U}},reset:$}}}),y7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...v}=ds(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=fs(s),_=Rr(c),N=fs(c)===c,S=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=g||(N||!w?[Dd(c)]:c7(c)),I=b!=="none";!g&&I&&A.push(...h7(c,w,b,S));const T=[c,...A],O=await ql(t,v),L=[];let z=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&L.push(O[k]),h){const D=l7(s,a,S);L.push(O[D[0]],O[D[1]])}if(z=[...z,{placement:s,overflows:L}],!L.every(D=>D<=0)){var M,P;const D=(((M=o.flip)==null?void 0:M.index)||0)+1,V=T[D];if(V&&(!(h==="alignment"?_!==Rr(V):!1)||z.every(B=>Rr(B.placement)===_?B.overflows[0]>0:!0)))return{data:{index:D,overflows:z},reset:{placement:V}};let $=(P=z.filter(U=>U.overflows[0]<=0).sort((U,B)=>U.overflows[1]-B.overflows[1])[0])==null?void 0:P.placement;if(!$)switch(y){case"bestFit":{var H;const U=(H=z.filter(B=>{if(I){const q=Rr(B.placement);return q===_||q==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(q=>q>0).reduce((q,Y)=>q+Y,0)]).sort((B,q)=>B[1]-q[1])[0])==null?void 0:H[0];U&&($=U);break}case"initialPlacement":$=c;break}if(s!==$)return{reset:{placement:$}}}return{}}}};function B2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function q2(e){return s7.some(t=>e[t]>=0)}const x7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=ds(e,t);switch(r){case"referenceHidden":{const o=await ql(t,{...s,elementContext:"reference"}),a=B2(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:q2(a)}}}case"escaped":{const o=await ql(t,{...s,altBoundary:!0}),a=B2(o,n.floating);return{data:{escapedOffsets:a,escaped:q2(a)}}}default:return{}}}}},PR=new Set(["left","top"]);async function v7(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=fs(n),c=aa(n),d=Rr(n)==="y",f=PR.has(a)?-1:1,p=o&&d?-1:1,h=ds(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),d?{x:y*p,y:g*f}:{x:g*f,y:y*p}}const b7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,d=await v7(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:o+d.y,data:{...d,placement:a}}}}},w7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:k,y:_}=v;return{x:k,y:_}}},...d}=ds(e,t),f={x:n,y:r},p=await ql(t,d),h=Rr(fs(s)),g=bw(h);let y=f[g],b=f[h];if(o){const v=g==="y"?"top":"left",k=g==="y"?"bottom":"right",_=y+p[v],N=y-p[k];y=bb(_,y,N)}if(a){const v=h==="y"?"top":"left",k=h==="y"?"bottom":"right",_=b+p[v],N=b-p[k];b=bb(_,b,N)}const w=c.fn({...t,[g]:y,[h]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[g]:o,[h]:a}}}}}},k7=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=ds(e,t),p={x:n,y:r},h=Rr(s),g=bw(h);let y=p[g],b=p[h];const w=ds(c,t),v=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const N=g==="y"?"height":"width",S=o.reference[g]-o.floating[N]+v.mainAxis,A=o.reference[g]+o.reference[N]-v.mainAxis;y<S?y=S:y>A&&(y=A)}if(f){var k,_;const N=g==="y"?"width":"height",S=PR.has(fs(s)),A=o.reference[h]-o.floating[N]+(S&&((k=a.offset)==null?void 0:k[h])||0)+(S?0:v.crossAxis),I=o.reference[h]+o.reference[N]+(S?0:((_=a.offset)==null?void 0:_[h])||0)-(S?v.crossAxis:0);b<A?b=A:b>I&&(b=I)}return{[g]:y,[h]:b}}}},N7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:c}=t,{apply:d=()=>{},...f}=ds(e,t),p=await ql(t,f),h=fs(s),g=aa(s),y=Rr(s)==="y",{width:b,height:w}=o.floating;let v,k;h==="top"||h==="bottom"?(v=h,k=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(k=h,v=g==="end"?"top":"bottom");const _=w-p.top-p.bottom,N=b-p.left-p.right,S=eo(w-p[v],_),A=eo(b-p[k],N),I=!t.middlewareData.shift;let T=S,O=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=_),I&&!g){const z=En(p.left,0),M=En(p.right,0),P=En(p.top,0),H=En(p.bottom,0);y?O=b-2*(z!==0||M!==0?z+M:En(p.left,p.right)):T=w-2*(P!==0||H!==0?P+H:En(p.top,p.bottom))}await d({...t,availableWidth:O,availableHeight:T});const L=await a.getDimensions(c.floating);return b!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function hf(){return typeof window<"u"}function la(e){return LR(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kr(e){var t;return(t=(LR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function LR(e){return hf()?e instanceof Node||e instanceof Tn(e).Node:!1}function fr(e){return hf()?e instanceof Element||e instanceof Tn(e).Element:!1}function Vr(e){return hf()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function z2(e){return!hf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}const S7=new Set(["inline","contents"]);function ic(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=hr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!S7.has(s)}const C7=new Set(["table","td","th"]);function _7(e){return C7.has(la(e))}const E7=[":popover-open",":modal"];function pf(e){return E7.some(t=>{try{return e.matches(t)}catch{return!1}})}const j7=["transform","translate","scale","rotate","perspective"],A7=["transform","translate","scale","rotate","perspective","filter"],T7=["paint","layout","strict","content"];function Nw(e){const t=Sw(),n=fr(e)?hr(e):e;return j7.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)||A7.some(r=>(n.willChange||"").includes(r))||T7.some(r=>(n.contain||"").includes(r))}function I7(e){let t=to(e);for(;Vr(t)&&!ea(t);){if(Nw(t))return t;if(pf(t))return null;t=to(t)}return null}function Sw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const M7=new Set(["html","body","#document"]);function ea(e){return M7.has(la(e))}function hr(e){return Tn(e).getComputedStyle(e)}function mf(e){return fr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function to(e){if(la(e)==="html")return e;const t=e.assignedSlot||e.parentNode||z2(e)&&e.host||Kr(e);return z2(t)?t.host:t}function DR(e){const t=to(e);return ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(t)&&ic(t)?t:DR(t)}function zl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=DR(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=Tn(s);if(o){const c=kb(a);return t.concat(a,a.visualViewport||[],ic(s)?s:[],c&&n?zl(c):[])}return t.concat(s,zl(s,[],n))}function kb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $R(e){const t=hr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Vr(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=Ld(n)!==o||Ld(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function Cw(e){return fr(e)?e:e.contextElement}function zi(e){const t=Cw(e);if(!Vr(t))return $r(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=$R(t);let a=(o?Ld(n.width):n.width)/r,c=(o?Ld(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const R7=$r(0);function FR(e){const t=Tn(e);return!Sw()||!t.visualViewport?R7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function O7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tn(e)?!1:t}function $o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Cw(e);let a=$r(1);t&&(r?fr(r)&&(a=zi(r)):a=zi(e));const c=O7(o,n,r)?FR(o):$r(0);let d=(s.left+c.x)/a.x,f=(s.top+c.y)/a.y,p=s.width/a.x,h=s.height/a.y;if(o){const g=Tn(o),y=r&&fr(r)?Tn(r):r;let b=g,w=kb(b);for(;w&&r&&y!==b;){const v=zi(w),k=w.getBoundingClientRect(),_=hr(w),N=k.left+(w.clientLeft+parseFloat(_.paddingLeft))*v.x,S=k.top+(w.clientTop+parseFloat(_.paddingTop))*v.y;d*=v.x,f*=v.y,p*=v.x,h*=v.y,d+=N,f+=S,b=Tn(w),w=kb(b)}}return $d({width:p,height:h,x:d,y:f})}function gf(e,t){const n=mf(e).scrollLeft;return t?t.left+n:$o(Kr(e)).left+n}function BR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gf(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function P7(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=Kr(r),c=t?pf(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=$r(1);const p=$r(0),h=Vr(r);if((h||!h&&!o)&&((la(r)!=="body"||ic(a))&&(d=mf(r)),Vr(r))){const y=$o(r);f=zi(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const g=a&&!h&&!o?BR(a,d):$r(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+g.x,y:n.y*f.y-d.scrollTop*f.y+p.y+g.y}}function L7(e){return Array.from(e.getClientRects())}function D7(e){const t=Kr(e),n=mf(e),r=e.ownerDocument.body,s=En(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=En(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+gf(e);const c=-n.scrollTop;return hr(r).direction==="rtl"&&(a+=En(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}const V2=25;function $7(e,t){const n=Tn(e),r=Kr(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(s){o=s.width,a=s.height;const p=Sw();(!p||p&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=gf(r);if(f<=0){const p=r.ownerDocument,h=p.body,g=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-y);b<=V2&&(o-=b)}else f<=V2&&(o+=f);return{width:o,height:a,x:c,y:d}}const F7=new Set(["absolute","fixed"]);function B7(e,t){const n=$o(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Vr(e)?zi(e):$r(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,d=s*o.x,f=r*o.y;return{width:a,height:c,x:d,y:f}}function H2(e,t,n){let r;if(t==="viewport")r=$7(e,n);else if(t==="document")r=D7(Kr(e));else if(fr(t))r=B7(t,n);else{const s=FR(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return $d(r)}function qR(e,t){const n=to(e);return n===t||!fr(n)||ea(n)?!1:hr(n).position==="fixed"||qR(n,t)}function q7(e,t){const n=t.get(e);if(n)return n;let r=zl(e,[],!1).filter(c=>fr(c)&&la(c)!=="body"),s=null;const o=hr(e).position==="fixed";let a=o?to(e):e;for(;fr(a)&&!ea(a);){const c=hr(a),d=Nw(a);!d&&c.position==="fixed"&&(s=null),(o?!d&&!s:!d&&c.position==="static"&&!!s&&F7.has(s.position)||ic(a)&&!d&&qR(e,a))?r=r.filter(p=>p!==a):s=c,a=to(a)}return t.set(e,r),r}function z7(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?pf(t)?[]:q7(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,p)=>{const h=H2(t,p,s);return f.top=En(h.top,f.top),f.right=eo(h.right,f.right),f.bottom=eo(h.bottom,f.bottom),f.left=En(h.left,f.left),f},H2(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function V7(e){const{width:t,height:n}=$R(e);return{width:t,height:n}}function H7(e,t,n){const r=Vr(t),s=Kr(t),o=n==="fixed",a=$o(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=$r(0);function f(){d.x=gf(s)}if(r||!r&&!o)if((la(t)!=="body"||ic(s))&&(c=mf(t)),r){const y=$o(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else s&&f();o&&!r&&s&&f();const p=s&&!r&&!o?BR(s,c):$r(0),h=a.left+c.scrollLeft-d.x-p.x,g=a.top+c.scrollTop-d.y-p.y;return{x:h,y:g,width:a.width,height:a.height}}function dm(e){return hr(e).position==="static"}function U2(e,t){if(!Vr(e)||hr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Kr(e)===n&&(n=n.ownerDocument.body),n}function zR(e,t){const n=Tn(e);if(pf(e))return n;if(!Vr(e)){let s=to(e);for(;s&&!ea(s);){if(fr(s)&&!dm(s))return s;s=to(s)}return n}let r=U2(e,t);for(;r&&_7(r)&&dm(r);)r=U2(r,t);return r&&ea(r)&&dm(r)&&!Nw(r)?n:r||I7(e)||n}const U7=async function(e){const t=this.getOffsetParent||zR,n=this.getDimensions,r=await n(e.floating);return{reference:H7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function W7(e){return hr(e).direction==="rtl"}const K7={convertOffsetParentRelativeRectToViewportRelativeRect:P7,getDocumentElement:Kr,getClippingRect:z7,getOffsetParent:zR,getElementRects:U7,getClientRects:L7,getDimensions:V7,getScale:zi,isElement:fr,isRTL:W7};function VR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function G7(e,t){let n=null,r;const s=Kr(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:p,top:h,width:g,height:y}=f;if(c||t(),!g||!y)return;const b=Hu(h),w=Hu(s.clientWidth-(p+g)),v=Hu(s.clientHeight-(h+y)),k=Hu(p),N={rootMargin:-b+"px "+-w+"px "+-v+"px "+-k+"px",threshold:En(0,eo(1,d))||1};let S=!0;function A(I){const T=I[0].intersectionRatio;if(T!==d){if(!S)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!VR(f,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(A,{...N,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,N)}n.observe(e)}return a(!0),o}function Y7(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Cw(e),p=s||o?[...f?zl(f):[],...zl(t)]:[];p.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&c?G7(f,n):null;let g=-1,y=null;a&&(y=new ResizeObserver(k=>{let[_]=k;_&&_.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let b,w=d?$o(e):null;d&&v();function v(){const k=$o(e);w&&!VR(w,k)&&n(),w=k,b=requestAnimationFrame(v)}return n(),()=>{var k;p.forEach(_=>{s&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),h==null||h(),(k=y)==null||k.disconnect(),y=null,d&&cancelAnimationFrame(b)}}const X7=b7,Q7=w7,J7=y7,Z7=N7,eH=x7,W2=g7,tH=k7,nH=(e,t,n)=>{const r=new Map,s={platform:K7,...n},o={...s.platform,_c:r};return m7(e,t,{...s,platform:o})};var rH=typeof document<"u",sH=function(){},pd=rH?E.useLayoutEffect:sH;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Fd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function HR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function K2(e,t){const n=HR(e);return Math.round(t*n)/n}function fm(e){const t=E.useRef(e);return pd(()=>{t.current=e}),t}function oH(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,h]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=E.useState(r);Fd(g,r)||y(r);const[b,w]=E.useState(null),[v,k]=E.useState(null),_=E.useCallback(B=>{B!==I.current&&(I.current=B,w(B))},[]),N=E.useCallback(B=>{B!==T.current&&(T.current=B,k(B))},[]),S=o||b,A=a||v,I=E.useRef(null),T=E.useRef(null),O=E.useRef(p),L=d!=null,z=fm(d),M=fm(s),P=fm(f),H=E.useCallback(()=>{if(!I.current||!T.current)return;const B={placement:t,strategy:n,middleware:g};M.current&&(B.platform=M.current),nH(I.current,T.current,B).then(q=>{const Y={...q,isPositioned:P.current!==!1};D.current&&!Fd(O.current,Y)&&(O.current=Y,hw.flushSync(()=>{h(Y)}))})},[g,t,n,M,P]);pd(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[f]);const D=E.useRef(!1);pd(()=>(D.current=!0,()=>{D.current=!1}),[]),pd(()=>{if(S&&(I.current=S),A&&(T.current=A),S&&A){if(z.current)return z.current(S,A,H);H()}},[S,A,H,z,L]);const V=E.useMemo(()=>({reference:I,floating:T,setReference:_,setFloating:N}),[_,N]),$=E.useMemo(()=>({reference:S,floating:A}),[S,A]),U=E.useMemo(()=>{const B={position:n,left:0,top:0};if(!$.floating)return B;const q=K2($.floating,p.x),Y=K2($.floating,p.y);return c?{...B,transform:"translate("+q+"px, "+Y+"px)",...HR($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:Y}},[n,c,$.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:H,refs:V,elements:$,floatingStyles:U}),[p,H,V,$,U])}const iH=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?W2({element:r.current,padding:s}).fn(n):{}:r?W2({element:r,padding:s}).fn(n):{}}}},aH=(e,t)=>({...X7(e),options:[e,t]}),lH=(e,t)=>({...Q7(e),options:[e,t]}),cH=(e,t)=>({...tH(e),options:[e,t]}),uH=(e,t)=>({...J7(e),options:[e,t]}),dH=(e,t)=>({...Z7(e),options:[e,t]}),fH=(e,t)=>({...eH(e),options:[e,t]}),hH=(e,t)=>({...iH(e),options:[e,t]});var pH="Arrow",UR=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return u.jsx(tt.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});UR.displayName=pH;var mH=UR;function gH(e){const[t,n]=E.useState(void 0);return Zs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _w="Popper",[WR,yf]=no(_w),[yH,KR]=WR(_w),GR=e=>{const{__scopePopper:t,children:n}=e,[r,s]=E.useState(null);return u.jsx(yH,{scope:t,anchor:r,onAnchorChange:s,children:n})};GR.displayName=_w;var YR="PopperAnchor",XR=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=KR(YR,n),a=E.useRef(null),c=It(t,a),d=E.useRef(null);return E.useEffect(()=>{const f=d.current;d.current=(r==null?void 0:r.current)||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(tt.div,{...s,ref:c})});XR.displayName=YR;var Ew="PopperContent",[xH,vH]=WR(Ew),QR=E.forwardRef((e,t)=>{var ne,te,ie,he,xe,ve;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:b,...w}=e,v=KR(Ew,n),[k,_]=E.useState(null),N=It(t,ye=>_(ye)),[S,A]=E.useState(null),I=gH(S),T=(I==null?void 0:I.width)??0,O=(I==null?void 0:I.height)??0,L=r+(o!=="center"?"-"+o:""),z=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},M=Array.isArray(f)?f:[f],P=M.length>0,H={padding:z,boundary:M.filter(wH),altBoundary:P},{refs:D,floatingStyles:V,placement:$,isPositioned:U,middlewareData:B}=oH({strategy:"fixed",placement:L,whileElementsMounted:(...ye)=>Y7(...ye,{animationFrame:y==="always"}),elements:{reference:v.anchor},middleware:[aH({mainAxis:s+O,alignmentAxis:a}),d&&lH({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?cH():void 0,...H}),d&&uH({...H}),dH({...H,apply:({elements:ye,rects:_e,availableWidth:we,availableHeight:Te})=>{const{width:Ne,height:Je}=_e.reference,Fe=ye.floating.style;Fe.setProperty("--radix-popper-available-width",`${we}px`),Fe.setProperty("--radix-popper-available-height",`${Te}px`),Fe.setProperty("--radix-popper-anchor-width",`${Ne}px`),Fe.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),S&&hH({element:S,padding:c}),kH({arrowWidth:T,arrowHeight:O}),g&&fH({strategy:"referenceHidden",...H})]}),[q,Y]=eO($),F=zr(b);Zs(()=>{U&&(F==null||F())},[U,F]);const K=(ne=B.arrow)==null?void 0:ne.x,ee=(te=B.arrow)==null?void 0:te.y,W=((ie=B.arrow)==null?void 0:ie.centerOffset)!==0,[X,Z]=E.useState();return Zs(()=>{k&&Z(window.getComputedStyle(k).zIndex)},[k]),u.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(he=B.transformOrigin)==null?void 0:he.x,(xe=B.transformOrigin)==null?void 0:xe.y].join(" "),...((ve=B.hide)==null?void 0:ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(xH,{scope:n,placedSide:q,onArrowChange:A,arrowX:K,arrowY:ee,shouldHideArrow:W,children:u.jsx(tt.div,{"data-side":q,"data-align":Y,...w,ref:N,style:{...w.style,animation:U?void 0:"none"}})})})});QR.displayName=Ew;var JR="PopperArrow",bH={top:"bottom",right:"left",bottom:"top",left:"right"},ZR=E.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=vH(JR,r),a=bH[o.placedSide];return u.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:u.jsx(mH,{...s,ref:n,style:{...s.style,display:"block"}})})});ZR.displayName=JR;function wH(e){return e!==null}var kH=e=>({name:"transformOrigin",options:e,fn(t){var v,k,_;const{placement:n,rects:r,middlewareData:s}=t,a=((v=s.arrow)==null?void 0:v.centerOffset)!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,p]=eO(n),h={start:"0%",center:"50%",end:"100%"}[p],g=(((k=s.arrow)==null?void 0:k.x)??0)+c/2,y=(((_=s.arrow)==null?void 0:_.y)??0)+d/2;let b="",w="";return f==="bottom"?(b=a?h:`${g}px`,w=`${-d}px`):f==="top"?(b=a?h:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,w=a?h:`${y}px`):f==="left"&&(b=`${r.floating.width+d}px`,w=a?h:`${y}px`),{data:{x:b,y:w}}}});function eO(e){const[t,n="center"]=e.split("-");return[t,n]}var tO=GR,nO=XR,rO=QR,sO=ZR,NH="Portal",xf=E.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=E.useState(!1);Zs(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?SM.createPortal(u.jsx(tt.div,{...r,ref:t}),a):null});xf.displayName=NH;function SH(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var yr=e=>{const{present:t,children:n}=e,r=CH(t),s=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=It(r.ref,_H(s));return typeof n=="function"||r.isPresent?E.cloneElement(s,{ref:o}):null};yr.displayName="Presence";function CH(e){const[t,n]=E.useState(),r=E.useRef(null),s=E.useRef(e),o=E.useRef("none"),a=e?"mounted":"unmounted",[c,d]=SH(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const f=Uu(r.current);o.current=c==="mounted"?f:"none"},[c]),Zs(()=>{const f=r.current,p=s.current;if(p!==e){const g=o.current,y=Uu(f);e?d("MOUNT"):y==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&g!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Zs(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=y=>{const w=Uu(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(d("ANIMATION_END"),!s.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},g=y=>{y.target===t&&(o.current=Uu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:E.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Uu(e){return(e==null?void 0:e.animationName)||"none"}function _H(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var EH=mI[" useInsertionEffect ".trim().toString()]||Zs;function vf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=jH({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s;{const p=E.useRef(e!==void 0);E.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=E.useCallback(p=>{var h;if(c){const g=AH(p)?p(e):p;g!==e&&((h=a.current)==null||h.call(a,g))}else o(p)},[c,e,o,a]);return[d,f]}function jH({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),s=E.useRef(n),o=E.useRef(t);return EH(()=>{o.current=t},[t]),E.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function AH(e){return typeof e=="function"}var TH=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),IH="VisuallyHidden",oO=E.forwardRef((e,t)=>u.jsx(tt.span,{...e,ref:t,style:{...TH,...e.style}}));oO.displayName=IH;var MH=oO,[bf]=no("Tooltip",[yf]),wf=yf(),iO="TooltipProvider",RH=700,Nb="tooltip.open",[OH,jw]=bf(iO),aO=e=>{const{__scopeTooltip:t,delayDuration:n=RH,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,a=E.useRef(!0),c=E.useRef(!1),d=E.useRef(0);return E.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(OH,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:E.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:o})};aO.displayName=iO;var Vl="Tooltip",[PH,ac]=bf(Vl),lO=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=jw(Vl,e.__scopeTooltip),f=wf(t),[p,h]=E.useState(null),g=qi(),y=E.useRef(0),b=a??d.disableHoverableContent,w=c??d.delayDuration,v=E.useRef(!1),[k,_]=vf({prop:r,defaultProp:s??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(Nb))):d.onClose(),o==null||o(T)},caller:Vl}),N=E.useMemo(()=>k?v.current?"delayed-open":"instant-open":"closed",[k]),S=E.useCallback(()=>{window.clearTimeout(y.current),y.current=0,v.current=!1,_(!0)},[_]),A=E.useCallback(()=>{window.clearTimeout(y.current),y.current=0,_(!1)},[_]),I=E.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{v.current=!0,_(!0),y.current=0},w)},[w,_]);return E.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(tO,{...f,children:u.jsx(PH,{scope:t,contentId:g,open:k,stateAttribute:N,trigger:p,onTriggerChange:h,onTriggerEnter:E.useCallback(()=>{d.isOpenDelayedRef.current?I():S()},[d.isOpenDelayedRef,I,S]),onTriggerLeave:E.useCallback(()=>{b?A():(window.clearTimeout(y.current),y.current=0)},[A,b]),onOpen:S,onClose:A,disableHoverableContent:b,children:n})})};lO.displayName=Vl;var Sb="TooltipTrigger",cO=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ac(Sb,n),o=jw(Sb,n),a=wf(n),c=E.useRef(null),d=It(t,c,s.onTriggerChange),f=E.useRef(!1),p=E.useRef(!1),h=E.useCallback(()=>f.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(nO,{asChild:!0,...a,children:u.jsx(tt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:Me(e.onPointerMove,g=>{g.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Me(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:Me(e.onBlur,s.onClose),onClick:Me(e.onClick,s.onClose)})})});cO.displayName=Sb;var Aw="TooltipPortal",[LH,DH]=bf(Aw,{forceMount:void 0}),uO=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,o=ac(Aw,t);return u.jsx(LH,{scope:t,forceMount:n,children:u.jsx(yr,{present:n||o.open,children:u.jsx(xf,{asChild:!0,container:s,children:r})})})};uO.displayName=Aw;var ta="TooltipContent",dO=E.forwardRef((e,t)=>{const n=DH(ta,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,a=ac(ta,e.__scopeTooltip);return u.jsx(yr,{present:r||a.open,children:a.disableHoverableContent?u.jsx(fO,{side:s,...o,ref:t}):u.jsx($H,{side:s,...o,ref:t})})}),$H=E.forwardRef((e,t)=>{const n=ac(ta,e.__scopeTooltip),r=jw(ta,e.__scopeTooltip),s=E.useRef(null),o=It(t,s),[a,c]=E.useState(null),{trigger:d,onClose:f}=n,p=s.current,{onPointerInTransitChange:h}=r,g=E.useCallback(()=>{c(null),h(!1)},[h]),y=E.useCallback((b,w)=>{const v=b.currentTarget,k={x:b.clientX,y:b.clientY},_=zH(k,v.getBoundingClientRect()),N=VH(k,_),S=HH(w.getBoundingClientRect()),A=WH([...N,...S]);c(A),h(!0)},[h]);return E.useEffect(()=>()=>g(),[g]),E.useEffect(()=>{if(d&&p){const b=v=>y(v,p),w=v=>y(v,d);return d.addEventListener("pointerleave",b),p.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",w)}}},[d,p,y,g]),E.useEffect(()=>{if(a){const b=w=>{const v=w.target,k={x:w.clientX,y:w.clientY},_=(d==null?void 0:d.contains(v))||(p==null?void 0:p.contains(v)),N=!UH(k,a);_?g():N&&(g(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,p,a,f,g]),u.jsx(fO,{...e,ref:o})}),[FH,BH]=bf(Vl,{isInside:!1}),qH=VV("TooltipContent"),fO=E.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=ac(ta,n),f=wf(n),{onClose:p}=d;return E.useEffect(()=>(document.addEventListener(Nb,p),()=>document.removeEventListener(Nb,p)),[p]),E.useEffect(()=>{if(d.trigger){const h=g=>{const y=g.target;y!=null&&y.contains(d.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,p]),u.jsx(ff,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:u.jsxs(rO,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(qH,{children:r}),u.jsx(FH,{scope:n,isInside:!0,children:u.jsx(MH,{id:d.contentId,role:"tooltip",children:s||r})})]})})});dO.displayName=ta;var hO="TooltipArrow",pO=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=wf(n);return BH(hO,n).isInside?null:u.jsx(sO,{...s,...r,ref:t})});pO.displayName=hO;function zH(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function VH(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function HH(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function UH(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,g=d.y;p>r!=g>r&&n<(h-f)*(r-p)/(g-p)+f&&(s=!s)}return s}function WH(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),KH(t)}function KH(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var GH=aO,YH=lO,XH=cO,QH=uO,JH=dO,ZH=pO;function eU({children:e,name:t,action:n,status:r="pending",duration:s,error:o,disabled:a=!1}){if(a)return u.jsx(u.Fragment,{children:e});const d={pending:{icon:an,color:"text-gray-400",label:"Pending"},running:{icon:an,color:"text-warning",label:"Running"},completed:{icon:zt,color:"text-success",label:"Completed"},failed:{icon:lt,color:"text-error",label:"Failed"},skipped:{icon:zo,color:"text-gray-500",label:"Skipped"}}[r],f=d.icon;return u.jsx(GH,{delayDuration:400,children:u.jsxs(YH,{children:[u.jsx(XH,{asChild:!0,children:e}),u.jsx(QH,{children:u.jsxs(JH,{side:"top",sideOffset:8,className:"z-50 bg-bg-elevated border border-border-default rounded-lg shadow-xl px-3 py-2 max-w-[280px] animate-in fade-in-0 zoom-in-95",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:t}),n&&u.jsx("div",{className:"text-xs font-mono text-text-secondary",children:n}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(f,{className:Ye("w-3.5 h-3.5",d.color)}),u.jsx("span",{className:Ye("text-xs",d.color),children:d.label}),s!==void 0&&u.jsx("span",{className:"text-xs text-text-muted ml-auto",children:s<1e3?`${s}ms`:`${(s/1e3).toFixed(1)}s`})]}),o&&u.jsx("div",{className:"text-xs text-error bg-error/10 rounded px-2 py-1 truncate",children:o})]}),u.jsx(ZH,{className:"fill-bg-elevated"})]})})]})})}const tU=E.memo(eU);function nU({data:e,selected:t}){var f,p;const n=((f=e.action)==null?void 0:f.split(".")[0])||"unknown",r=((p=e.action)==null?void 0:p.split(".").slice(1).join("."))||e.action,s=yb(n),o={pending:{icon:an,color:"text-text-muted",bgColor:"bg-gray-400/10"},running:{icon:Vo,color:"text-warning",bgColor:"bg-warning/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:zo,color:"text-text-muted",bgColor:"bg-gray-500/10"}},a=e.status||"pending",c=o[a],d=c.icon;return u.jsx(tU,{name:e.name||e.id,action:e.action,status:a,duration:e.duration,error:e.error,children:u.jsxs("div",{className:`step-node p-0 ${t?"selected":""} ${a==="running"?"running":""} ${a==="completed"?"completed":""} ${a==="failed"?"failed":""}`,children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:u.jsx(s,{className:"w-5 h-5 text-primary"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||e.id}),u.jsx("div",{className:"text-xs text-text-secondary truncate",children:n})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${c.bgColor} flex items-center justify-center`,children:u.jsx(d,{className:`w-4 h-4 ${c.color} ${c.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3",children:[u.jsx("div",{className:"text-xs text-text-secondary font-mono truncate",children:r}),e.retryCount&&e.retryCount>0&&u.jsxs("div",{className:"mt-2 text-xs text-warning",children:["Retry #",e.retryCount]}),e.error&&u.jsx("div",{className:"mt-2 text-xs text-error truncate",children:e.error}),e.lastInput!==void 0&&u.jsx(R2,{label:"In",data:e.lastInput,variant:"input"}),e.lastOutput!==void 0&&u.jsx(R2,{label:"Out",data:e.lastOutput,variant:"output"})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})})}const rU=E.memo(nU),Tw=Mn((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]})}})),G2=[{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"}],sU={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"}]},Cb="marktoflow:selectedWorkflow",oU=()=>{try{return localStorage.getItem(Cb)}catch{return null}},Y2=e=>{try{e?localStorage.setItem(Cb,e):localStorage.removeItem(Cb)}catch{}},sn=Mn((e,t)=>({workflows:G2,selectedWorkflow:oU(),currentWorkflow:null,isLoading:!1,error:null,loadWorkflows:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/workflows");if(!n.ok)throw new Error("Failed to load workflows");const r=await n.json();console.log("Loaded workflows:",r.workflows.length),e({workflows:r.workflows,isLoading:!1});const s=t().selectedWorkflow;s&&t().loadWorkflow(s)}catch(n){console.error("Failed to load workflows, using demo data:",n),e({workflows:G2,isLoading:!1})}},fetchWorkflows:async()=>{await t().loadWorkflows()},selectWorkflow:n=>{e({selectedWorkflow:n}),Y2(n),t().loadWorkflow(n)},loadWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch(`/api/workflows/${encodeURIComponent(n)}`);if(!r.ok)throw new Error("Failed to load workflow");const s=await r.json();e({currentWorkflow:s.workflow,isLoading:!1})}catch{e({currentWorkflow:sU,isLoading:!1})}},saveWorkflow:async n=>{const r=t().selectedWorkflow;if(r){e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(r)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow:n})})).ok)throw new Error("Failed to save workflow");e({currentWorkflow:n,isLoading:!1})}catch{e({error:"Failed to save workflow",isLoading:!1})}}},createWorkflow:async n=>{e({isLoading:!0,error:null});try{const r=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!r.ok)throw new Error("Failed to create workflow");const s=await r.json(),o=[...t().workflows,s.workflow];e({workflows:o,selectedWorkflow:s.workflow.path,isLoading:!1}),t().loadWorkflow(s.workflow.path)}catch{e({error:"Failed to create workflow",isLoading:!1})}},deleteWorkflow:async n=>{var r;e({isLoading:!0,error:null});try{if(!(await fetch(`/api/workflows/${encodeURIComponent(n)}`,{method:"DELETE"})).ok)throw new Error("Failed to delete workflow");const o=t().workflows.filter(c=>c.path!==n),a=((r=o[0])==null?void 0:r.path)||null;e({workflows:o,selectedWorkflow:a,isLoading:!1}),Y2(a)}catch{e({error:"Failed to delete workflow",isLoading:!1})}}}));function iU({data:e,selected:t}){const[n,r]=E.useState(!1),{pushWorkflow:s,breadcrumbs:o,setRootWorkflow:a}=Tw(),{loadWorkflow:c,selectedWorkflow:d,currentWorkflow:f}=sn(),p=E.useCallback(()=>{var y;o.length===0&&d&&f&&a({id:d,name:((y=f.metadata)==null?void 0:y.name)||"Main Workflow",path:d}),s({id:e.id,name:e.name||e.id,path:e.workflowPath}),c(e.workflowPath)},[e,s,o,a,d,f,c]),h={pending:"border-node-border",running:"border-warning",completed:"border-success",failed:"border-error"},g=e.status||"pending";return u.jsxs("div",{className:`step-node p-0 min-w-[250px] ${t?"selected":""} ${h[g]}`,children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-node-border bg-info/5",children:[u.jsx("button",{onClick:()=>r(!n),className:"w-6 h-6 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:n?u.jsx(Lr,{className:"w-4 h-4 text-info"}):u.jsx(qt,{className:"w-4 h-4 text-info"})}),u.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/10 flex items-center justify-center",children:u.jsx($l,{className:"w-5 h-5 text-info"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||e.id}),u.jsx("div",{className:"text-xs text-text-secondary",children:"Sub-workflow"})]}),u.jsx("button",{onClick:p,className:"w-6 h-6 rounded flex items-center justify-center hover:bg-info/20 transition-colors",title:"Drill into sub-workflow",children:u.jsx(Dl,{className:"w-4 h-4 text-info"})})]}),u.jsxs("div",{className:"p-3",children:[u.jsx("div",{className:"text-xs text-text-secondary font-mono truncate",children:e.workflowPath}),e.stepCount!==void 0&&u.jsx("div",{className:"mt-2 flex items-center gap-2",children:u.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-info/10 text-info",children:[e.stepCount," steps"]})})]}),n&&u.jsx("div",{className:"border-t border-node-border p-3 bg-black/20",children:u.jsxs("button",{onClick:p,className:"w-full flex items-center justify-center gap-2 px-3 py-2 bg-info/10 hover:bg-info/20 rounded text-sm text-info transition-colors",children:[u.jsx($l,{className:"w-4 h-4"}),"Open Sub-workflow",u.jsx(Dl,{className:"w-4 h-4"})]})}),u.jsx(Ke,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-info !border-2 !border-node-bg"})]})}const aU=E.memo(iU),X2={manual:{icon:Vo,color:"text-primary",bgColor:"bg-primary/10",borderColor:"border-primary",label:"Manual Trigger"},schedule:{icon:pb,color:"text-info",bgColor:"bg-info/10",borderColor:"border-info",label:"Schedule"},webhook:{icon:K9,color:"text-success",bgColor:"bg-success/10",borderColor:"border-success",label:"Webhook"},file:{icon:$l,color:"text-warning",bgColor:"bg-warning/10",borderColor:"border-warning",label:"File Watcher"},event:{icon:Zi,color:"text-purple-400",bgColor:"bg-purple-400/10",borderColor:"border-purple-400",label:"Event"},rss:{icon:yw,color:"text-orange-400",bgColor:"bg-orange-400/10",borderColor:"border-orange-400",label:"RSS Feed"}};function lU({data:e,selected:t}){const n=X2[e.type]||X2.manual,r=n.icon,s=()=>{var o;switch(e.type){case"schedule":return e.cron||"No schedule set";case"webhook":return`${e.method||"POST"} ${e.path||"/webhook"}`;case"file":return e.pattern||"**/*";case"event":return((o=e.events)==null?void 0:o.join(", "))||"No events";case"rss":return e.url||"No feed URL";default:return"Click to run"}};return u.jsxs("div",{className:`min-w-[180px] rounded-lg border-2 ${n.borderColor} ${n.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[u.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[u.jsx("div",{className:`w-8 h-8 rounded-full ${n.bgColor} flex items-center justify-center`,children:u.jsx(r,{className:`w-4 h-4 ${n.color}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:n.label}),u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||"Trigger"})]}),e.active!==!1&&u.jsx("div",{className:"w-2 h-2 rounded-full bg-success animate-pulse",title:"Active"})]}),u.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-secondary font-mono truncate",title:s(),children:s()}),e.lastTriggered&&u.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["Last: ",new Date(e.lastTriggered).toLocaleString()]})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"})]})}const cU=E.memo(lU);function uU({data:e,selected:t}){const n={pending:{icon:an,color:"text-text-muted",borderColor:"border-gray-500",bgColor:"bg-gray-500/10"},completed:{icon:zt,color:"text-success",borderColor:"border-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",borderColor:"border-error",bgColor:"bg-error/10"}},r=e.status||"pending",s=n[r],o=s.icon;return u.jsxs("div",{className:`min-w-[160px] rounded-lg border-2 ${s.borderColor} ${s.bgColor} ${t?"ring-2 ring-primary ring-offset-2 ring-offset-canvas-bg":""} transition-all duration-200`,children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-canvas-bg"}),u.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",children:[u.jsx("div",{className:`w-8 h-8 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(g9,{className:`w-4 h-4 ${s.color}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:"Output"}),u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:e.name||"Workflow End"})]}),u.jsx(o,{className:`w-4 h-4 ${s.color}`})]}),e.variables&&e.variables.length>0&&u.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-muted mb-1",children:"Output Variables"}),u.jsx("div",{className:"flex flex-wrap gap-1",children:e.variables.map(a=>u.jsx("code",{className:"px-1.5 py-0.5 bg-white/5 text-primary text-xs rounded",children:a},a))})]}),e.description&&u.jsx("div",{className:"px-3 py-2 border-t border-border-subtle",children:u.jsx("div",{className:"text-xs text-text-secondary",children:e.description})}),r==="completed"&&e.result!==void 0&&u.jsxs("div",{className:"px-3 py-2 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-muted mb-1",children:"Result"}),u.jsxs("pre",{className:"text-xs text-success font-mono bg-black/20 rounded p-1.5 overflow-x-auto max-h-20",children:[typeof e.result=="string"?e.result.slice(0,100):JSON.stringify(e.result,null,2).slice(0,100),(typeof e.result=="string"?e.result:JSON.stringify(e.result)).length>100&&"..."]})]})]})}const dU=E.memo(uU);function fU({data:e,selected:t}){const n={pending:{icon:an,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:Pd,color:"text-blue-400",bgColor:"bg-blue-400/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return u.jsxs("div",{className:`control-flow-node if-else-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(Pd,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"If/Else"}),u.jsx("div",{className:"text-xs text-white/70",children:"Conditional"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsx("div",{className:"text-xs text-white/90 font-mono mb-3",children:e.condition||"No condition set"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="then"?"bg-green-500/30 text-green-200 ring-1 ring-green-400/50":e.skippedBranch==="then"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✓ Then",e.skippedBranch==="then"&&u.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]}),u.jsxs("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors relative ${e.activeBranch==="else"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":e.skippedBranch==="else"?"bg-gray-500/20 text-gray-400":"bg-white/5 text-white/60"}`,children:["✗ Else",e.skippedBranch==="else"&&u.jsx("span",{className:"absolute -top-1 -right-1 text-[8px] px-1 py-0.5 rounded bg-gray-500/50 text-gray-300",children:"SKIP"})]})]})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,id:"then",style:{left:"33%"},className:"!w-3 !h-3 !bg-green-500 !border-2 !border-node-bg"}),u.jsx(Ke,{type:"source",position:ge.Bottom,id:"else",style:{left:"67%"},className:"!w-3 !h-3 !bg-red-500 !border-2 !border-node-bg"})]})}const hU=E.memo(fU);function pU({data:e,selected:t}){const n={pending:{icon:an,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:C2,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return u.jsxs("div",{className:`control-flow-node for-each-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(C2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"For Each"}),u.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[u.jsx("span",{className:"text-white/60",children:"Items:"})," ",u.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Variable:"})," ",u.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),e.earlyExit&&u.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[u.jsx(pR,{className:"w-4 h-4 text-orange-200"}),u.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":"Loop stopped on error"})]}),e.totalIterations!==void 0&&u.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs text-white/70",children:"Progress"}),u.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration||0," / ",e.totalIterations,e.earlyExit&&u.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),u.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:u.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-pink-400"}`,style:{width:`${(e.currentIteration||0)/e.totalIterations*100}%`}})})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsx("span",{children:"Access: loop.index, loop.first, loop.last"})]})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsx(Ke,{id:"body",type:"source",position:ge.Right,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),u.jsx(Ke,{id:"loop-back",type:"target",position:ge.Left,className:"!w-3 !h-3 !bg-purple-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const mU=E.memo(pU);function gU({data:e,selected:t}){const n={pending:{icon:an,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:_2,color:"text-orange-400",bgColor:"bg-orange-400/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return u.jsxs("div",{className:`control-flow-node while-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #fb923c 0%, #f97316 100%)"},children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(_2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"While"}),u.jsx("div",{className:"text-xs text-white/70",children:"Loop"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Condition:"})," ",u.jsx("span",{className:"font-mono",children:e.condition||"Not set"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Max Iterations:"})," ",u.jsx("span",{className:"font-medium",children:e.maxIterations||100})]}),e.earlyExit&&u.jsxs("div",{className:"mb-3 p-2 bg-orange-500/20 border border-orange-500/30 rounded flex items-center gap-2",children:[e.exitReason==="max_iterations"?u.jsx(rc,{className:"w-4 h-4 text-orange-200"}):u.jsx(pR,{className:"w-4 h-4 text-orange-200"}),u.jsx("span",{className:"text-xs text-orange-200 font-medium",children:e.exitReason==="break"?"Loop exited early (break)":e.exitReason==="max_iterations"?"Max iterations reached":"Loop stopped on error"})]}),e.currentIteration!==void 0&&u.jsxs("div",{className:"mt-2 p-2 bg-white/5 rounded",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs text-white/70",children:"Iterations"}),u.jsxs("span",{className:"text-xs text-white font-medium",children:[e.currentIteration," / ",e.maxIterations||100,e.earlyExit&&u.jsx("span",{className:"ml-1 text-orange-300 text-[10px]",children:"(stopped)"})]})]}),u.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5",children:u.jsx("div",{className:`h-1.5 rounded-full transition-all ${e.earlyExit?"bg-orange-400":"bg-orange-500"}`,style:{width:`${e.currentIteration/(e.maxIterations||100)*100}%`}})})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"⚠️"}),u.jsx("span",{children:"Exits when condition becomes false"})]})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsx(Ke,{id:"body",type:"source",position:ge.Right,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",right:"-6px"}}),u.jsx(Ke,{id:"loop-back",type:"target",position:ge.Left,className:"!w-3 !h-3 !bg-orange-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const yU=E.memo(gU);function xU({data:e,selected:t}){const n={pending:{icon:an,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:w2,color:"text-purple-400",bgColor:"bg-purple-400/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon,a=Object.keys(e.cases||{}),c=a.slice(0,4),d=a.length>4,f=Math.min(a.length,4)+(e.hasDefault?1:0),p=h=>f===1?50:(h+1)/(f+1)*100;return u.jsxs("div",{className:`control-flow-node switch-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #a855f7 0%, #ec4899 100%)"},children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(w2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Switch"}),u.jsx("div",{className:"text-xs text-white/70",children:"Multi-Branch Router"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Expression:"})," ",u.jsx("span",{className:"font-mono",children:e.expression||"Not set"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"text-xs text-white/70 font-medium mb-1",children:"Cases:"}),c.map((h,g)=>{var w;const y=e.activeCase===h,b=(w=e.skippedBranches)==null?void 0:w.includes(h);return u.jsx("div",{className:"relative",children:u.jsxs("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors relative ${y?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":b?"bg-gray-500/20 text-gray-400 line-through":"bg-white/5 text-white/70"}`,children:[h,b&&u.jsx("span",{className:"ml-2 text-[8px] px-1 py-0.5 rounded bg-gray-500/30",children:"SKIPPED"})]})},h)}),d&&u.jsxs("div",{className:"text-xs px-2 py-1 rounded bg-white/5 text-white/60 text-center",children:["+",a.length-4," more cases"]}),e.hasDefault&&u.jsx("div",{className:"relative",children:u.jsx("div",{className:`text-xs px-2 py-1.5 rounded font-medium transition-colors ${e.activeCase==="default"?"bg-gray-500/30 text-gray-200 ring-1 ring-gray-400/50":"bg-white/5 text-white/70"}`,children:"default"})})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsxs("span",{children:[a.length," case",a.length!==1?"s":"",e.hasDefault?" + default":""]})]})]}),c.map((h,g)=>u.jsx(Ke,{type:"source",position:ge.Bottom,id:`case-${h}`,style:{left:`${p(g)}%`},className:"!w-2.5 !h-2.5 !bg-purple-400 !border-2 !border-node-bg"},`handle-${h}`)),e.hasDefault&&u.jsx(Ke,{type:"source",position:ge.Bottom,id:"case-default",style:{left:`${p(c.length)}%`},className:"!w-2.5 !h-2.5 !bg-gray-400 !border-2 !border-node-bg"})]})}const vU=E.memo(xU);function bU({data:e,selected:t}){var a,c;const n={pending:{icon:an,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:gb,color:"text-green-400",bgColor:"bg-green-400/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return u.jsxs("div",{className:`control-flow-node parallel-node p-0 ${t?"selected":""} ${r==="running"?"running":""} ${r==="completed"?"completed":""} ${r==="failed"?"failed":""}`,style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)"},children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(gb,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Parallel"}),u.jsx("div",{className:"text-xs text-white/70",children:"Concurrent Execution"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[e.maxConcurrentExceeded&&u.jsxs("div",{className:"mb-3 p-2 bg-yellow-500/20 border border-yellow-500/30 rounded flex items-center gap-2",children:[u.jsx(rc,{className:"w-4 h-4 text-yellow-200"}),u.jsx("span",{className:"text-xs text-yellow-200 font-medium",children:"Rate limiting active"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Branches:"})," ",u.jsx("span",{className:"font-medium",children:((a=e.branches)==null?void 0:a.length)||0}),e.maxConcurrent&&u.jsxs(u.Fragment,{children:[" ",u.jsx("span",{className:"text-white/60",children:"• Max Concurrent:"})," ",u.jsx("span",{className:`font-medium ${e.maxConcurrentExceeded?"text-yellow-300":""}`,children:e.maxConcurrent})]})]}),u.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(c=e.branches)==null?void 0:c.slice(0,6).map(d=>{var g,y,b;const f=(g=e.activeBranches)==null?void 0:g.includes(d.id),p=(y=e.completedBranches)==null?void 0:y.includes(d.id),h=(b=e.failedBranches)==null?void 0:b.includes(d.id);return u.jsx("div",{className:`px-2 py-1 rounded text-xs font-medium transition-colors ${h?"bg-red-500/30 text-red-200":p?"bg-green-500/30 text-green-200":f?"bg-blue-500/30 text-blue-200 animate-pulse":"bg-white/10 text-white/60"}`,title:d.name||d.id,children:d.name||`B${d.id.slice(-2)}`},d.id)}),e.branches&&e.branches.length>6&&u.jsxs("div",{className:"px-2 py-1 rounded text-xs font-medium bg-white/10 text-white/60",children:["+",e.branches.length-6]})]}),u.jsxs("div",{className:"text-xs text-white/50 flex items-center gap-1",children:[u.jsx("span",{children:"On Error:"}),u.jsx("span",{className:"font-medium",children:e.onError||"stop"})]})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"})]})}const wU=E.memo(bU);function kU({data:e,selected:t}){const n={pending:{icon:an,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:E2,color:"text-yellow-400",bgColor:"bg-yellow-400/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},r=e.status||"pending",s=n[r],o=s.icon;return u.jsxs("div",{className:`control-flow-node try-catch-node p-0 ${t?"selected":""} ${r==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%)"},children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(E2,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||"Try/Catch"}),u.jsx("div",{className:"text-xs text-white/70",children:"Error Handling"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${s.bgColor} flex items-center justify-center`,children:u.jsx(o,{className:`w-4 h-4 ${s.color} ${s.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[e.errorOccurred&&u.jsxs("div",{className:"mb-3 p-2 bg-red-500/20 border border-red-500/30 rounded flex items-center gap-2",children:[u.jsx(rc,{className:"w-4 h-4 text-red-200"}),u.jsx("span",{className:"text-xs text-red-200 font-medium",children:"Error occurred"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="try"?"bg-blue-500/30 text-blue-200 ring-1 ring-blue-400/50":"bg-white/5 text-white/60"}`,children:"✓ Try"}),e.hasCatch&&u.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="catch"?"bg-red-500/30 text-red-200 ring-1 ring-red-400/50":"bg-white/5 text-white/60"}`,children:"⚠ Catch"}),e.hasFinally&&u.jsx("div",{className:`text-center p-2 rounded text-xs font-medium transition-colors ${e.activeBranch==="finally"?"bg-purple-500/30 text-purple-200 ring-1 ring-purple-400/50":"bg-white/5 text-white/60"}`,children:"⟳ Finally"})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsx("span",{children:"Finally always executes"})]})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,id:"try",style:{left:"25%"},className:"!w-2.5 !h-2.5 !bg-blue-500 !border-2 !border-node-bg"}),e.hasCatch&&u.jsx(Ke,{type:"source",position:ge.Bottom,id:"catch",style:{left:"50%"},className:"!w-2.5 !h-2.5 !bg-red-500 !border-2 !border-node-bg"}),e.hasFinally&&u.jsx(Ke,{type:"source",position:ge.Bottom,id:"finally",style:{left:"75%"},className:"!w-2.5 !h-2.5 !bg-purple-500 !border-2 !border-node-bg"})]})}const NU=E.memo(kU);function SU({data:e,selected:t}){const n={map:{icon:Dl,label:"Map",color:"#14b8a6"},filter:{icon:cR,label:"Filter",color:"#10b981"},reduce:{icon:E9,label:"Reduce",color:"#06b6d4"}},r={pending:{icon:an,color:"text-gray-400",bgColor:"bg-gray-400/10"},running:{icon:n[e.transformType].icon,color:"text-teal-400",bgColor:"bg-teal-400/10",animate:!0},completed:{icon:zt,color:"text-success",bgColor:"bg-success/10"},failed:{icon:lt,color:"text-error",bgColor:"bg-error/10"},skipped:{icon:lt,color:"text-gray-500",bgColor:"bg-gray-500/10"}},s=e.status||"pending",o=r[s],a=o.icon,c=n[e.transformType],d=c.icon,f=e.transformType==="filter"?e.condition:e.transformType==="reduce"?`${e.accumulatorVariable||"acc"}: ${e.expression||"Not set"}`:e.expression;return u.jsxs("div",{className:`control-flow-node transform-node p-0 ${t?"selected":""} ${s==="running"?"running":""}`,style:{background:"linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%)"},children:[u.jsx(Ke,{type:"target",position:ge.Top,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsxs("div",{className:"flex items-center gap-3 p-3 border-b border-white/20",children:[u.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/20 flex items-center justify-center",children:u.jsx(d,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-white",children:e.name||c.label}),u.jsx("div",{className:"text-xs text-white/70",children:"Transform"})]}),u.jsx("div",{className:`w-6 h-6 rounded-full ${o.bgColor} flex items-center justify-center`,children:u.jsx(a,{className:`w-4 h-4 ${o.color} ${o.animate?"animate-pulse":""}`})})]}),u.jsxs("div",{className:"p-3 bg-white/10",children:[u.jsxs("div",{className:"text-xs text-white/90 mb-2",children:[u.jsx("span",{className:"text-white/60",children:"Items:"})," ",u.jsx("span",{className:"font-mono",children:e.items||"Not set"})]}),u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Variable:"})," ",u.jsx("span",{className:"font-mono",children:e.itemVariable||"item"})]}),u.jsxs("div",{className:"mb-3 p-2 bg-white/5 rounded",children:[u.jsx("div",{className:"text-xs text-white/60 mb-1",children:e.transformType==="filter"?"Condition":e.transformType==="reduce"?"Reducer":"Expression"}),u.jsx("div",{className:"text-xs text-white font-mono break-all",children:f||"Not set"})]}),e.transformType==="reduce"&&e.initialValue!==void 0&&u.jsxs("div",{className:"text-xs text-white/90 mb-3",children:[u.jsx("span",{className:"text-white/60",children:"Initial:"})," ",u.jsx("span",{className:"font-mono",children:JSON.stringify(e.initialValue)})]}),(e.inputCount!==void 0||e.outputCount!==void 0)&&u.jsxs("div",{className:"mt-3 p-2 bg-white/5 rounded flex items-center justify-between",children:[u.jsxs("div",{className:"text-xs",children:[u.jsx("span",{className:"text-white/60",children:"In:"})," ",u.jsx("span",{className:"text-white font-medium",children:e.inputCount??"?"})]}),u.jsx("div",{className:"text-white/40",children:"→"}),u.jsxs("div",{className:"text-xs",children:[u.jsx("span",{className:"text-white/60",children:"Out:"})," ",u.jsx("span",{className:"text-white font-medium",children:e.outputCount??"?"})]})]}),u.jsxs("div",{className:"mt-3 text-xs text-white/50 flex items-center gap-2",children:[u.jsx("span",{children:"ℹ️"}),u.jsx("span",{children:e.transformType==="map"?"Transforms each item":e.transformType==="filter"?"Selects matching items":"Aggregates to single value"})]})]}),u.jsx(Ke,{type:"source",position:ge.Bottom,className:"!w-3 !h-3 !bg-primary !border-2 !border-node-bg"}),u.jsx(Ke,{id:"loop-back",type:"source",position:ge.Left,className:"!w-3 !h-3 !bg-teal-500 !border-2 !border-node-bg",style:{top:"50%",left:"-6px"}})]})}const hm=E.memo(SU),Q2={yellow:{bg:"bg-yellow-500/20",border:"border-yellow-500/40",text:"text-yellow-200"},blue:{bg:"bg-blue-500/20",border:"border-blue-500/40",text:"text-blue-200"},green:{bg:"bg-green-500/20",border:"border-green-500/40",text:"text-green-200"},pink:{bg:"bg-pink-500/20",border:"border-pink-500/40",text:"text-pink-200"},purple:{bg:"bg-purple-500/20",border:"border-purple-500/40",text:"text-purple-200"},orange:{bg:"bg-orange-500/20",border:"border-orange-500/40",text:"text-orange-200"}},CU=["yellow","blue","green","pink","purple","orange"];function _U({data:e,selected:t}){const[n,r]=E.useState(!1),[s,o]=E.useState(!1),a=e.color||"yellow",c=Q2[a],d=E.useCallback(f=>{},[]);return u.jsxs(u.Fragment,{children:[u.jsx(iR,{isVisible:t,minWidth:150,minHeight:100,lineClassName:"!border-primary",handleClassName:"!bg-primary !border-primary !w-2 !h-2"}),u.jsxs("div",{className:Ye("rounded-lg border-2 p-3 min-w-[150px] min-h-[100px] transition-shadow",c.bg,c.border,t&&"shadow-lg ring-2 ring-primary/30"),children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(q9,{className:Ye("w-3.5 h-3.5",c.text)}),u.jsx("span",{className:Ye("text-xs font-medium",c.text),children:"Note"})]}),u.jsx("button",{onClick:f=>{f.stopPropagation(),o(!s)},className:"p-1 rounded hover:bg-white/10 transition-colors",title:"Change color",children:u.jsx(T9,{className:"w-3 h-3 text-text-muted"})})]}),s&&u.jsx("div",{className:"flex gap-1 mb-2 p-1 bg-bg-panel rounded border border-border-default",children:CU.map(f=>u.jsx("button",{onClick:p=>{p.stopPropagation(),o(!1)},className:Ye("w-5 h-5 rounded-full border-2 transition-transform",Q2[f].bg,f===a?"border-white scale-110":"border-transparent hover:scale-110"),title:f},f))}),n?u.jsx("textarea",{defaultValue:e.text||"",onChange:d,onBlur:()=>r(!1),autoFocus:!0,className:"w-full bg-transparent text-sm text-text-primary resize-none focus:outline-none min-h-[60px]",placeholder:"Type a note...",onClick:f=>f.stopPropagation()}):u.jsx("div",{onDoubleClick:f=>{f.stopPropagation(),r(!0)},className:"text-sm text-text-primary whitespace-pre-wrap min-h-[60px] cursor-text",children:e.text||"Double-click to edit..."}),e.author&&u.jsx("div",{className:"mt-2 text-xs text-text-muted",children:e.author})]})]})}const EU=E.memo(_U),jU={default:{bg:"bg-gray-500/5",border:"border-gray-500/30",header:"bg-gray-500/10"},blue:{bg:"bg-blue-500/5",border:"border-blue-500/30",header:"bg-blue-500/10"},green:{bg:"bg-green-500/5",border:"border-green-500/30",header:"bg-green-500/10"},red:{bg:"bg-red-500/5",border:"border-red-500/30",header:"bg-red-500/10"},purple:{bg:"bg-purple-500/5",border:"border-purple-500/30",header:"bg-purple-500/10"}};function AU({data:e,selected:t}){const[n,r]=E.useState(!1),s=e.color||"default",o=jU[s],a=e.collapsed??!1,c=e.locked??!1;return u.jsxs(u.Fragment,{children:[u.jsx(iR,{isVisible:t&&!c,minWidth:200,minHeight:150,lineClassName:"!border-primary",handleClassName:"!bg-primary !border-primary !w-2 !h-2"}),u.jsxs("div",{className:Ye("rounded-xl border-2 border-dashed transition-all",o.bg,o.border,t&&"ring-2 ring-primary/30",a?"min-w-[200px] min-h-[48px]":"min-w-[300px] min-h-[200px]"),children:[u.jsxs("div",{className:Ye("flex items-center gap-2 px-3 py-2 rounded-t-xl cursor-pointer",o.header),children:[u.jsx("button",{onClick:d=>{d.stopPropagation()},className:"p-0.5 rounded hover:bg-white/10 transition-colors",children:a?u.jsx(qt,{className:"w-4 h-4 text-text-secondary"}):u.jsx(Lr,{className:"w-4 h-4 text-text-secondary"})}),a?u.jsx(y9,{className:"w-4 h-4 text-text-secondary"}):u.jsx($l,{className:"w-4 h-4 text-text-secondary"}),n?u.jsx("input",{defaultValue:e.label||"Group",autoFocus:!0,onBlur:()=>r(!1),onKeyDown:d=>{d.key==="Enter"&&r(!1)},className:"flex-1 bg-transparent text-sm font-medium text-text-primary focus:outline-none border-b border-primary",onClick:d=>d.stopPropagation()}):u.jsx("span",{onDoubleClick:d=>{d.stopPropagation(),c||r(!0)},className:"flex-1 text-sm font-medium text-text-primary truncate",children:e.label||"Group"}),c&&u.jsx(N9,{className:"w-3.5 h-3.5 text-warning"}),e.childNodeIds&&e.childNodeIds.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[e.childNodeIds.length," nodes"]})]}),!a&&u.jsx("div",{className:"p-4 min-h-[150px]",children:(!e.childNodeIds||e.childNodeIds.length===0)&&u.jsx("div",{className:"flex items-center justify-center h-full text-xs text-text-muted",children:"Drag nodes here to group them"})})]})]})}const TU=E.memo(AU);var pm="focusScope.autoFocusOnMount",mm="focusScope.autoFocusOnUnmount",J2={bubbles:!1,cancelable:!0},IU="FocusScope",Iw=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,d]=E.useState(null),f=zr(s),p=zr(o),h=E.useRef(null),g=It(t,w=>d(w)),y=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let w=function(N){if(y.paused||!c)return;const S=N.target;c.contains(S)?h.current=S:Us(h.current,{select:!0})},v=function(N){if(y.paused||!c)return;const S=N.relatedTarget;S!==null&&(c.contains(S)||Us(h.current,{select:!0}))},k=function(N){if(document.activeElement===document.body)for(const A of N)A.removedNodes.length>0&&Us(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",v);const _=new MutationObserver(k);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",v),_.disconnect()}}},[r,c,y.paused]),E.useEffect(()=>{if(c){eC.add(y);const w=document.activeElement;if(!c.contains(w)){const k=new CustomEvent(pm,J2);c.addEventListener(pm,f),c.dispatchEvent(k),k.defaultPrevented||(MU(DU(mO(c)),{select:!0}),document.activeElement===w&&Us(c))}return()=>{c.removeEventListener(pm,f),setTimeout(()=>{const k=new CustomEvent(mm,J2);c.addEventListener(mm,p),c.dispatchEvent(k),k.defaultPrevented||Us(w??document.body,{select:!0}),c.removeEventListener(mm,p),eC.remove(y)},0)}}},[c,f,p,y]);const b=E.useCallback(w=>{if(!n&&!r||y.paused)return;const v=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(v&&k){const _=w.currentTarget,[N,S]=RU(_);N&&S?!w.shiftKey&&k===S?(w.preventDefault(),n&&Us(N,{select:!0})):w.shiftKey&&k===N&&(w.preventDefault(),n&&Us(S,{select:!0})):k===_&&w.preventDefault()}},[n,r,y.paused]);return u.jsx(tt.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Iw.displayName=IU;function MU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Us(r,{select:t}),document.activeElement!==n)return}function RU(e){const t=mO(e),n=Z2(t,e),r=Z2(t.reverse(),e);return[n,r]}function mO(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Z2(e,t){for(const n of e)if(!OU(n,{upTo:t}))return n}function OU(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 PU(e){return e instanceof HTMLInputElement&&"select"in e}function Us(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&PU(e)&&t&&e.select()}}var eC=LU();function LU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=tC(e,t),e.unshift(t)},remove(t){var n;e=tC(e,t),(n=e[0])==null||n.resume()}}}function tC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function DU(e){return e.filter(t=>t.tagName!=="A")}var gm=0;function gO(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nC()),document.body.insertAdjacentElement("beforeend",e[1]??nC()),gm++,()=>{gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gm--}},[])}function nC(){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 Mr=function(){return Mr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Mr.apply(this,arguments)};function yO(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function $U(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var md="right-scroll-bar-position",gd="width-before-scroll-bar",FU="with-scroll-bars-hidden",BU="--removed-body-scroll-bar-size";function ym(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qU(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var zU=typeof window<"u"?E.useLayoutEffect:E.useEffect,rC=new WeakMap;function VU(e,t){var n=qU(null,function(r){return e.forEach(function(s){return ym(s,r)})});return zU(function(){var r=rC.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(c){o.has(c)||ym(c,null)}),o.forEach(function(c){s.has(c)||ym(c,a)})}rC.set(n,e)},[e]),n}function HU(e){return e}function UU(e,t){t===void 0&&(t=HU);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var d=function(){var p=a;a=[],p.forEach(o)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){a.push(p),f()},filter:function(p){return a=a.filter(p),n}}}};return s}function WU(e){e===void 0&&(e={});var t=UU(null);return t.options=Mr({async:!0,ssr:!1},e),t}var xO=function(e){var t=e.sideCar,n=yO(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,Mr({},n))};xO.isSideCarExport=!0;function KU(e,t){return e.useMedium(t),xO}var vO=WU(),xm=function(){},kf=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:xm,onWheelCapture:xm,onTouchMoveCapture:xm}),s=r[0],o=r[1],a=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,g=e.sideCar,y=e.noRelative,b=e.noIsolation,w=e.inert,v=e.allowPinchZoom,k=e.as,_=k===void 0?"div":k,N=e.gapMode,S=yO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,I=VU([n,t]),T=Mr(Mr({},S),s);return E.createElement(E.Fragment,null,p&&E.createElement(A,{sideCar:vO,removeScrollBar:f,shards:h,noRelative:y,noIsolation:b,inert:w,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:N}),a?E.cloneElement(E.Children.only(c),Mr(Mr({},T),{ref:I})):E.createElement(_,Mr({},T,{className:d,ref:I}),c))});kf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kf.classNames={fullWidth:gd,zeroRight:md};var GU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=GU();return t&&e.setAttribute("nonce",t),e}function XU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function QU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var JU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=YU())&&(XU(t,n),QU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZU=function(){var e=JU();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bO=function(){var e=ZU(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},eW={left:0,top:0,right:0,gap:0},vm=function(e){return parseInt(e||"",10)||0},tW=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[vm(n),vm(r),vm(s)]},nW=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eW;var t=tW(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])}},rW=bO(),Vi="data-scroll-locked",sW=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
643
|
+
.`.concat(FU,` {
|
|
644
|
+
overflow: hidden `).concat(r,`;
|
|
645
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
646
|
+
}
|
|
647
|
+
body[`).concat(Vi,`] {
|
|
648
|
+
overflow: hidden `).concat(r,`;
|
|
649
|
+
overscroll-behavior: contain;
|
|
650
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
651
|
+
padding-left: `.concat(s,`px;
|
|
652
|
+
padding-top: `).concat(o,`px;
|
|
653
|
+
padding-right: `).concat(a,`px;
|
|
654
|
+
margin-left:0;
|
|
655
|
+
margin-top:0;
|
|
656
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
657
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.`).concat(md,` {
|
|
661
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.`).concat(gd,` {
|
|
665
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.`).concat(md," .").concat(md,` {
|
|
669
|
+
right: 0 `).concat(r,`;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.`).concat(gd," .").concat(gd,` {
|
|
673
|
+
margin-right: 0 `).concat(r,`;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
body[`).concat(Vi,`] {
|
|
677
|
+
`).concat(BU,": ").concat(c,`px;
|
|
678
|
+
}
|
|
679
|
+
`)},sC=function(){var e=parseInt(document.body.getAttribute(Vi)||"0",10);return isFinite(e)?e:0},oW=function(){E.useEffect(function(){return document.body.setAttribute(Vi,(sC()+1).toString()),function(){var e=sC()-1;e<=0?document.body.removeAttribute(Vi):document.body.setAttribute(Vi,e.toString())}},[])},iW=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;oW();var o=E.useMemo(function(){return nW(s)},[s]);return E.createElement(rW,{styles:sW(o,!t,s,n?"":"!important")})},_b=!1;if(typeof window<"u")try{var Wu=Object.defineProperty({},"passive",{get:function(){return _b=!0,!0}});window.addEventListener("test",Wu,Wu),window.removeEventListener("test",Wu,Wu)}catch{_b=!1}var Ci=_b?{passive:!1}:!1,aW=function(e){return e.tagName==="TEXTAREA"},wO=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!aW(e)&&n[t]==="visible")},lW=function(e){return wO(e,"overflowY")},cW=function(e){return wO(e,"overflowX")},oC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=kO(e,r);if(s){var o=NO(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uW=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dW=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kO=function(e,t){return e==="v"?lW(t):cW(t)},NO=function(e,t){return e==="v"?uW(t):dW(t)},fW=function(e,t){return e==="h"&&t==="rtl"?-1:1},hW=function(e,t,n,r,s){var o=fW(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,d=t.contains(c),f=!1,p=a>0,h=0,g=0;do{if(!c)break;var y=NO(e,c),b=y[0],w=y[1],v=y[2],k=w-v-o*b;(b||k)&&kO(e,c)&&(h+=k,g+=b);var _=c.parentNode;c=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(h)<1||!p&&Math.abs(g)<1)&&(f=!0),f},Ku=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iC=function(e){return[e.deltaX,e.deltaY]},aC=function(e){return e&&"current"in e?e.current:e},pW=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mW=function(e){return`
|
|
680
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
681
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
682
|
+
`)},gW=0,_i=[];function yW(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),s=E.useState(gW++)[0],o=E.useState(bO)[0],a=E.useRef(e);E.useEffect(function(){a.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=$U([e.lockRef.current],(e.shards||[]).map(aC),!0).filter(Boolean);return w.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=E.useCallback(function(w,v){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var k=Ku(w),_=n.current,N="deltaX"in w?w.deltaX:_[0]-k[0],S="deltaY"in w?w.deltaY:_[1]-k[1],A,I=w.target,T=Math.abs(N)>Math.abs(S)?"h":"v";if("touches"in w&&T==="h"&&I.type==="range")return!1;var O=window.getSelection(),L=O&&O.anchorNode,z=L?L===I||L.contains(I):!1;if(z)return!1;var M=oC(T,I);if(!M)return!0;if(M?A=T:(A=T==="v"?"h":"v",M=oC(T,I)),!M)return!1;if(!r.current&&"changedTouches"in w&&(N||S)&&(r.current=A),!A)return!0;var P=r.current||A;return hW(P,v,w,P==="h"?N:S)},[]),d=E.useCallback(function(w){var v=w;if(!(!_i.length||_i[_i.length-1]!==o)){var k="deltaY"in v?iC(v):Ku(v),_=t.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&pW(A.delta,k)})[0];if(_&&_.should){v.cancelable&&v.preventDefault();return}if(!_){var N=(a.current.shards||[]).map(aC).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=N.length>0?c(v,N[0]):!a.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),f=E.useCallback(function(w,v,k,_){var N={name:w,delta:v,target:k,should:_,shadowParent:xW(k)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(S){return S!==N})},1)},[]),p=E.useCallback(function(w){n.current=Ku(w),r.current=void 0},[]),h=E.useCallback(function(w){f(w.type,iC(w),w.target,c(w,e.lockRef.current))},[]),g=E.useCallback(function(w){f(w.type,Ku(w),w.target,c(w,e.lockRef.current))},[]);E.useEffect(function(){return _i.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Ci),document.addEventListener("touchmove",d,Ci),document.addEventListener("touchstart",p,Ci),function(){_i=_i.filter(function(w){return w!==o}),document.removeEventListener("wheel",d,Ci),document.removeEventListener("touchmove",d,Ci),document.removeEventListener("touchstart",p,Ci)}},[]);var y=e.removeScrollBar,b=e.inert;return E.createElement(E.Fragment,null,b?E.createElement(o,{styles:mW(s)}):null,y?E.createElement(iW,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xW(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vW=KU(vO,yW);var Mw=E.forwardRef(function(e,t){return E.createElement(kf,Mr({},e,{ref:t,sideCar:vW}))});Mw.classNames=kf.classNames;var bW=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ei=new WeakMap,Gu=new WeakMap,Yu={},bm=0,SO=function(e){return e&&(e.host||SO(e.parentNode))},wW=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=SO(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})},kW=function(e,t,n,r){var s=wW(t,Array.isArray(e)?e:[e]);Yu[n]||(Yu[n]=new WeakMap);var o=Yu[n],a=[],c=new Set,d=new Set(s),f=function(h){!h||c.has(h)||(c.add(h),f(h.parentNode))};s.forEach(f);var p=function(h){!h||d.has(h)||Array.prototype.forEach.call(h.children,function(g){if(c.has(g))p(g);else try{var y=g.getAttribute(r),b=y!==null&&y!=="false",w=(Ei.get(g)||0)+1,v=(o.get(g)||0)+1;Ei.set(g,w),o.set(g,v),a.push(g),w===1&&b&&Gu.set(g,!0),v===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return p(t),c.clear(),bm++,function(){a.forEach(function(h){var g=Ei.get(h)-1,y=o.get(h)-1;Ei.set(h,g),o.set(h,y),g||(Gu.has(h)||h.removeAttribute(r),Gu.delete(h)),y||h.removeAttribute(n)}),bm--,bm||(Ei=new WeakMap,Ei=new WeakMap,Gu=new WeakMap,Yu={})}},CO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=bW(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),kW(r,s,n,"aria-hidden")):function(){return null}},Nf="Dialog",[_O]=no(Nf),[NW,xr]=_O(Nf),EO=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=E.useRef(null),d=E.useRef(null),[f,p]=vf({prop:r,defaultProp:s??!1,onChange:o,caller:Nf});return u.jsx(NW,{scope:t,triggerRef:c,contentRef:d,contentId:qi(),titleId:qi(),descriptionId:qi(),open:f,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(h=>!h),[p]),modal:a,children:n})};EO.displayName=Nf;var jO="DialogTrigger",SW=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xr(jO,n),o=It(t,s.triggerRef);return u.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Pw(s.open),...r,ref:o,onClick:Me(e.onClick,s.onOpenToggle)})});SW.displayName=jO;var Rw="DialogPortal",[CW,AO]=_O(Rw,{forceMount:void 0}),TO=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=xr(Rw,t);return u.jsx(CW,{scope:t,forceMount:n,children:E.Children.map(r,a=>u.jsx(yr,{present:n||o.open,children:u.jsx(xf,{asChild:!0,container:s,children:a})}))})};TO.displayName=Rw;var Bd="DialogOverlay",IO=E.forwardRef((e,t)=>{const n=AO(Bd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=xr(Bd,e.__scopeDialog);return o.modal?u.jsx(yr,{present:r||o.open,children:u.jsx(EW,{...s,ref:t})}):null});IO.displayName=Bd;var _W=Bl("DialogOverlay.RemoveScroll"),EW=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xr(Bd,n);return u.jsx(Mw,{as:_W,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(tt.div,{"data-state":Pw(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fo="DialogContent",MO=E.forwardRef((e,t)=>{const n=AO(Fo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=xr(Fo,e.__scopeDialog);return u.jsx(yr,{present:r||o.open,children:o.modal?u.jsx(jW,{...s,ref:t}):u.jsx(AW,{...s,ref:t})})});MO.displayName=Fo;var jW=E.forwardRef((e,t)=>{const n=xr(Fo,e.__scopeDialog),r=E.useRef(null),s=It(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return CO(o)},[]),u.jsx(RO,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Me(e.onFocusOutside,o=>o.preventDefault())})}),AW=E.forwardRef((e,t)=>{const n=xr(Fo,e.__scopeDialog),r=E.useRef(!1),s=E.useRef(!1);return u.jsx(RO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),RO=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=xr(Fo,n),d=E.useRef(null),f=It(t,d);return gO(),u.jsxs(u.Fragment,{children:[u.jsx(Iw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:u.jsx(ff,{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)})}),u.jsxs(u.Fragment,{children:[u.jsx(TW,{titleId:c.titleId}),u.jsx(MW,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Ow="DialogTitle",OO=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xr(Ow,n);return u.jsx(tt.h2,{id:s.titleId,...r,ref:t})});OO.displayName=Ow;var PO="DialogDescription",LO=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xr(PO,n);return u.jsx(tt.p,{id:s.descriptionId,...r,ref:t})});LO.displayName=PO;var DO="DialogClose",$O=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xr(DO,n);return u.jsx(tt.button,{type:"button",...r,ref:t,onClick:Me(e.onClick,()=>s.onOpenChange(!1))})});$O.displayName=DO;function Pw(e){return e?"open":"closed"}var FO="DialogTitleWarning",[mre,BO]=BV(FO,{contentName:Fo,titleName:Ow,docsSlug:"dialog"}),TW=({titleId:e})=>{const t=BO(FO),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
683
|
+
|
|
684
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
685
|
+
|
|
686
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},IW="DialogDescriptionWarning",MW=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${BO(IW).contentName}}.`;return E.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},RW=EO,OW=TO,PW=IO,LW=MO,DW=OO,$W=LO,FW=$O;const BW={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]"};function hs({open:e,onOpenChange:t,title:n,description:r,children:s,className:o,size:a="md"}){return u.jsx(RW,{open:e,onOpenChange:t,children:u.jsxs(OW,{children:[u.jsx(PW,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),u.jsxs(LW,{className:Ye("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",BW[a],o),children:[(n||r)&&u.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-node-border",children:[u.jsxs("div",{children:[n&&u.jsx(DW,{className:"text-lg font-semibold text-white",children:n}),r&&u.jsx($W,{className:"mt-1 text-sm text-gray-400",children:r})]}),u.jsx(FW,{className:"rounded-full p-1 hover:bg-white/10 transition-colors",children:u.jsx(dr,{className:"w-5 h-5 text-gray-400"})})]}),u.jsx("div",{className:"max-h-[calc(85vh-8rem)] overflow-y-auto",children:s})]})]})})}function Bo({children:e,className:t}){return u.jsx("div",{className:Ye("flex items-center justify-end gap-3 p-4 border-t border-node-border",t),children:e})}const qW={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"},zW={sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},Ve=E.forwardRef(({className:e,variant:t="primary",size:n="md",loading:r,icon:s,disabled:o,children:a,...c},d)=>u.jsxs("button",{ref:d,disabled:o||r,className:Ye("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",qW[t],zW[n],e),...c,children:[r?u.jsx(Dr,{className:"w-4 h-4 animate-spin"}):s&&u.jsx("span",{className:"flex-shrink-0",children:s}),a]}));Ve.displayName="Button";function qO(e){const t=e+"CollectionProvider",[n,r]=no(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=w=>{const{scope:v,children:k}=w,_=ue.useRef(null),N=ue.useRef(new Map).current;return u.jsx(s,{scope:v,itemMap:N,collectionRef:_,children:k})};a.displayName=t;const c=e+"CollectionSlot",d=Bl(c),f=ue.forwardRef((w,v)=>{const{scope:k,children:_}=w,N=o(c,k),S=It(v,N.collectionRef);return u.jsx(d,{ref:S,children:_})});f.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",g=Bl(p),y=ue.forwardRef((w,v)=>{const{scope:k,children:_,...N}=w,S=ue.useRef(null),A=It(v,S),I=o(p,k);return ue.useEffect(()=>(I.itemMap.set(S,{ref:S,...N}),()=>void I.itemMap.delete(S))),u.jsx(g,{[h]:"",ref:A,children:_})});y.displayName=p;function b(w){const v=o(e+"CollectionConsumer",w);return ue.useCallback(()=>{const _=v.collectionRef.current;if(!_)return[];const N=Array.from(_.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((I,T)=>N.indexOf(I.ref.current)-N.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},b,r]}var VW=E.createContext(void 0);function Lw(e){const t=E.useContext(VW);return e||t||"ltr"}var wm="rovingFocusGroup.onEntryFocus",HW={bubbles:!1,cancelable:!0},lc="RovingFocusGroup",[Eb,zO,UW]=qO(lc),[WW,Sf]=no(lc,[UW]),[KW,GW]=WW(lc),VO=E.forwardRef((e,t)=>u.jsx(Eb.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Eb.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(YW,{...e,ref:t})})}));VO.displayName=lc;var YW=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...h}=e,g=E.useRef(null),y=It(t,g),b=Lw(o),[w,v]=vf({prop:a,defaultProp:c??null,onChange:d,caller:lc}),[k,_]=E.useState(!1),N=zr(f),S=zO(n),A=E.useRef(!1),[I,T]=E.useState(0);return E.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(wm,N),()=>O.removeEventListener(wm,N)},[N]),u.jsx(KW,{scope:n,orientation:r,dir:b,loop:s,currentTabStopId:w,onItemFocus:E.useCallback(O=>v(O),[v]),onItemShiftTab:E.useCallback(()=>_(!0),[]),onFocusableItemAdd:E.useCallback(()=>T(O=>O+1),[]),onFocusableItemRemove:E.useCallback(()=>T(O=>O-1),[]),children:u.jsx(tt.div,{tabIndex:k||I===0?-1:0,"data-orientation":r,...h,ref:y,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{A.current=!0}),onFocus:Me(e.onFocus,O=>{const L=!A.current;if(O.target===O.currentTarget&&L&&!k){const z=new CustomEvent(wm,HW);if(O.currentTarget.dispatchEvent(z),!z.defaultPrevented){const M=S().filter($=>$.focusable),P=M.find($=>$.active),H=M.find($=>$.id===w),V=[P,H,...M].filter(Boolean).map($=>$.ref.current);WO(V,p)}}A.current=!1}),onBlur:Me(e.onBlur,()=>_(!1))})})}),HO="RovingFocusGroupItem",UO=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...c}=e,d=qi(),f=o||d,p=GW(HO,n),h=p.currentTabStopId===f,g=zO(n),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:w}=p;return E.useEffect(()=>{if(r)return y(),()=>b()},[r,y,b]),u.jsx(Eb.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:u.jsx(tt.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?p.onItemFocus(f):v.preventDefault()}),onFocus:Me(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){p.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const k=JW(v,p.orientation,p.dir);if(k!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let N=g().filter(S=>S.focusable).map(S=>S.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const S=N.indexOf(v.currentTarget);N=p.loop?ZW(N,S+1):N.slice(S+1)}setTimeout(()=>WO(N))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:w!=null}):a})})});UO.displayName=HO;var XW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function QW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function JW(e,t,n){const r=QW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return XW[r]}function WO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ZW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KO=VO,GO=UO,Cf="Tabs",[eK]=no(Cf,[Sf]),YO=Sf(),[tK,Dw]=eK(Cf),XO=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:d="automatic",...f}=e,p=Lw(c),[h,g]=vf({prop:r,onChange:s,defaultProp:o??"",caller:Cf});return u.jsx(tK,{scope:n,baseId:qi(),value:h,onValueChange:g,orientation:a,dir:p,activationMode:d,children:u.jsx(tt.div,{dir:p,"data-orientation":a,...f,ref:t})})});XO.displayName=Cf;var QO="TabsList",JO=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Dw(QO,n),a=YO(n);return u.jsx(KO,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(tt.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});JO.displayName=QO;var ZO="TabsTrigger",eP=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=Dw(ZO,n),c=YO(n),d=rP(a.baseId,r),f=sP(a.baseId,r),p=r===a.value;return u.jsx(GO,{asChild:!0,...c,focusable:!s,active:p,children:u.jsx(tt.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...o,ref:t,onMouseDown:Me(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:Me(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const h=a.activationMode!=="manual";!p&&!s&&h&&a.onValueChange(r)})})})});eP.displayName=ZO;var tP="TabsContent",nP=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=Dw(tP,n),d=rP(c.baseId,r),f=sP(c.baseId,r),p=r===c.value,h=E.useRef(p);return E.useEffect(()=>{const g=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(g)},[]),u.jsx(yr,{present:s||p,children:({present:g})=>u.jsx(tt.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:g&&o})})});nP.displayName=tP;function rP(e,t){return`${e}-trigger-${t}`}function sP(e,t){return`${e}-content-${t}`}var nK=XO,oP=JO,iP=eP,aP=nP;const lP=nK,$w=E.forwardRef(({className:e,...t},n)=>u.jsx(oP,{ref:n,className:Ye("inline-flex items-center gap-1 border-b border-node-border w-full px-2",e),...t}));$w.displayName=oP.displayName;const Tr=E.forwardRef(({className:e,...t},n)=>u.jsx(iP,{ref:n,className:Ye("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}));Tr.displayName=iP.displayName;const Ir=E.forwardRef(({className:e,...t},n)=>u.jsx(aP,{ref:n,className:Ye("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",e),...t}));Ir.displayName=aP.displayName;function lC(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 rK(e){if(Array.isArray(e))return e}function sK(e,t,n){return(t=dK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,a,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(p){f=!0,s=p}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw s}}return c}}function iK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
687
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function uC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cC(Object(n),!0).forEach(function(r){sK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aK(e,t){if(e==null)return{};var n,r,s=lK(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function lK(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 cK(e,t){return rK(e)||oK(e,t)||fK(e,t)||iK()}function uK(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 dK(e){var t=uK(e,"string");return typeof t=="symbol"?t:t+""}function fK(e,t){if(e){if(typeof e=="string")return lC(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)?lC(e,t):void 0}}function hK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function fC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dC(Object(n),!0).forEach(function(r){hK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pK(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,o){return o(s)},r)}}function fl(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(s,c))}}}function qd(e){return{}.toString.call(e).includes("Object")}function mK(e){return!Object.keys(e).length}function Hl(e){return typeof e=="function"}function gK(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function yK(e,t){return qd(t)||Ys("changeType"),Object.keys(t).some(function(n){return!gK(e,n)})&&Ys("changeField"),t}function xK(e){Hl(e)||Ys("selectorType")}function vK(e){Hl(e)||qd(e)||Ys("handlerType"),qd(e)&&Object.values(e).some(function(t){return!Hl(t)})&&Ys("handlersType")}function bK(e){e||Ys("initialIsRequired"),qd(e)||Ys("initialType"),mK(e)&&Ys("initialContent")}function wK(e,t){throw new Error(e[t]||e.default)}var kK={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Ys=fl(wK)(kK),Xu={changes:yK,selector:xK,handler:vK,initial:bK};function NK(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Xu.initial(e),Xu.handler(t);var n={current:e},r=fl(_K)(n,t),s=fl(CK)(n),o=fl(Xu.changes)(e),a=fl(SK)(n);function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Xu.selector(f),f(n.current)}function d(f){pK(r,s,o,a)(f)}return[c,d]}function SK(e,t){return Hl(t)?t(e.current):t}function CK(e,t){return e.current=fC(fC({},e.current),t),t}function _K(e,t,n){return Hl(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var EK={create:NK},jK={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function AK(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var a=arguments.length,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(s,c))}}}function TK(e){return{}.toString.call(e).includes("Object")}function IK(e){return e||hC("configIsRequired"),TK(e)||hC("configType"),e.urls?(MK(),{paths:{vs:e.urls.monacoBase}}):e}function MK(){console.warn(cP.deprecation)}function RK(e,t){throw new Error(e[t]||e.default)}var cP={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!
|
|
688
|
+
You are using deprecated way of configuration.
|
|
689
|
+
|
|
690
|
+
Instead of using
|
|
691
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
692
|
+
use
|
|
693
|
+
monaco.config({ paths: { vs: '...' } })
|
|
694
|
+
|
|
695
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
696
|
+
`},hC=AK(RK)(cP),OK={config:IK},PK=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,a){return a(o)},s)}};function uP(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],uP(e[n],t[n]))}),uC(uC({},e),t)}var LK={type:"cancelation",msg:"operation is manually canceled"};function km(e){var t=!1,n=new Promise(function(r,s){e.then(function(o){return t?s(LK):r(o)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var DK=["monaco"],$K=EK.create({config:jK,isInitialized:!1,resolve:null,reject:null,monaco:null}),dP=cK($K,2),cc=dP[0],_f=dP[1];function FK(e){var t=OK.config(e),n=t.monaco,r=aK(t,DK);_f(function(s){return{config:uP(s.config,r),monaco:n}})}function BK(){var e=cc(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(_f({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),km(Nm);if(window.monaco&&window.monaco.editor)return fP(window.monaco),e.resolve(window.monaco),km(Nm);PK(qK,VK)(HK)}return km(Nm)}function qK(e){return document.body.appendChild(e)}function zK(e){var t=document.createElement("script");return e&&(t.src=e),t}function VK(e){var t=cc(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=zK("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function HK(){var e=cc(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;fP(r),e.resolve(r)},function(n){e.reject(n)})}function fP(e){cc().monaco||_f({monaco:e})}function UK(){return cc(function(e){var t=e.monaco;return t})}var Nm=new Promise(function(e,t){return _f({resolve:e,reject:t})}),hP={config:FK,init:BK,__getMonacoInstance:UK},WK={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Sm=WK,KK={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},GK=KK;function YK({children:e}){return ue.createElement("div",{style:GK.container},e)}var XK=YK,QK=XK;function JK({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:a}){return ue.createElement("section",{style:{...Sm.wrapper,width:e,height:t},...a},!n&&ue.createElement(QK,null,r),ue.createElement("div",{ref:s,style:{...Sm.fullWidth,...!n&&Sm.hide},className:o}))}var ZK=JK,pP=E.memo(ZK);function eG(e){E.useEffect(e,[])}var mP=eG;function tG(e,t,n=!0){let r=E.useRef(!0);E.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var _n=tG;function Sl(){}function Oi(e,t,n,r){return nG(e,r)||rG(e,t,n,r)}function nG(e,t){return e.editor.getModel(gP(e,t))}function rG(e,t,n,r){return e.editor.createModel(t,n,r?gP(e,r):void 0)}function gP(e,t){return e.Uri.parse(t)}function sG({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:h={},height:g="100%",width:y="100%",className:b,wrapperProps:w={},beforeMount:v=Sl,onMount:k=Sl}){let[_,N]=E.useState(!1),[S,A]=E.useState(!0),I=E.useRef(null),T=E.useRef(null),O=E.useRef(null),L=E.useRef(k),z=E.useRef(v),M=E.useRef(!1);mP(()=>{let V=hP.init();return V.then($=>(T.current=$)&&A(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>I.current?D():V.cancel()}),_n(()=>{if(I.current&&T.current){let V=I.current.getOriginalEditor(),$=Oi(T.current,e||"",r||n||"text",o||"");$!==V.getModel()&&V.setModel($)}},[o],_),_n(()=>{if(I.current&&T.current){let V=I.current.getModifiedEditor(),$=Oi(T.current,t||"",s||n||"text",a||"");$!==V.getModel()&&V.setModel($)}},[a],_),_n(()=>{let V=I.current.getModifiedEditor();V.getOption(T.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],_),_n(()=>{var V,$;($=(V=I.current)==null?void 0:V.getModel())==null||$.original.setValue(e||"")},[e],_),_n(()=>{let{original:V,modified:$}=I.current.getModel();T.current.editor.setModelLanguage(V,r||n||"text"),T.current.editor.setModelLanguage($,s||n||"text")},[n,r,s],_),_n(()=>{var V;(V=T.current)==null||V.editor.setTheme(f)},[f],_),_n(()=>{var V;(V=I.current)==null||V.updateOptions(h)},[h],_);let P=E.useCallback(()=>{var U;if(!T.current)return;z.current(T.current);let V=Oi(T.current,e||"",r||n||"text",o||""),$=Oi(T.current,t||"",s||n||"text",a||"");(U=I.current)==null||U.setModel({original:V,modified:$})},[n,t,s,e,r,o,a]),H=E.useCallback(()=>{var V;!M.current&&O.current&&(I.current=T.current.editor.createDiffEditor(O.current,{automaticLayout:!0,...h}),P(),(V=T.current)==null||V.editor.setTheme(f),N(!0),M.current=!0)},[h,f,P]);E.useEffect(()=>{_&&L.current(I.current,T.current)},[_]),E.useEffect(()=>{!S&&!_&&H()},[S,_,H]);function D(){var $,U,B,q;let V=($=I.current)==null?void 0:$.getModel();c||((U=V==null?void 0:V.original)==null||U.dispose()),d||((B=V==null?void 0:V.modified)==null||B.dispose()),(q=I.current)==null||q.dispose()}return ue.createElement(pP,{width:y,height:g,isEditorReady:_,loading:p,_ref:O,className:b,wrapperProps:w})}var oG=sG;E.memo(oG);function iG(e){let t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}var aG=iG,Qu=new Map;function lG({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:h=!0,keepCurrentModel:g=!1,width:y="100%",height:b="100%",className:w,wrapperProps:v={},beforeMount:k=Sl,onMount:_=Sl,onChange:N,onValidate:S=Sl}){let[A,I]=E.useState(!1),[T,O]=E.useState(!0),L=E.useRef(null),z=E.useRef(null),M=E.useRef(null),P=E.useRef(_),H=E.useRef(k),D=E.useRef(),V=E.useRef(r),$=aG(o),U=E.useRef(!1),B=E.useRef(!1);mP(()=>{let F=hP.init();return F.then(K=>(L.current=K)&&O(!1)).catch(K=>(K==null?void 0:K.type)!=="cancelation"&&console.error("Monaco initialization: error:",K)),()=>z.current?Y():F.cancel()}),_n(()=>{var K,ee,W,X;let F=Oi(L.current,e||r||"",t||s||"",o||n||"");F!==((K=z.current)==null?void 0:K.getModel())&&(h&&Qu.set($,(ee=z.current)==null?void 0:ee.saveViewState()),(W=z.current)==null||W.setModel(F),h&&((X=z.current)==null||X.restoreViewState(Qu.get(o))))},[o],A),_n(()=>{var F;(F=z.current)==null||F.updateOptions(f)},[f],A),_n(()=>{!z.current||r===void 0||(z.current.getOption(L.current.editor.EditorOption.readOnly)?z.current.setValue(r):r!==z.current.getValue()&&(B.current=!0,z.current.executeEdits("",[{range:z.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),z.current.pushUndoStop(),B.current=!1))},[r],A),_n(()=>{var K,ee;let F=(K=z.current)==null?void 0:K.getModel();F&&s&&((ee=L.current)==null||ee.editor.setModelLanguage(F,s))},[s],A),_n(()=>{var F;c!==void 0&&((F=z.current)==null||F.revealLine(c))},[c],A),_n(()=>{var F;(F=L.current)==null||F.editor.setTheme(a)},[a],A);let q=E.useCallback(()=>{var F;if(!(!M.current||!L.current)&&!U.current){H.current(L.current);let K=o||n,ee=Oi(L.current,r||e||"",t||s||"",K||"");z.current=(F=L.current)==null?void 0:F.editor.create(M.current,{model:ee,automaticLayout:!0,...f},p),h&&z.current.restoreViewState(Qu.get(K)),L.current.editor.setTheme(a),c!==void 0&&z.current.revealLine(c),I(!0),U.current=!0}},[e,t,n,r,s,o,f,p,h,a,c]);E.useEffect(()=>{A&&P.current(z.current,L.current)},[A]),E.useEffect(()=>{!T&&!A&&q()},[T,A,q]),V.current=r,E.useEffect(()=>{var F,K;A&&N&&((F=D.current)==null||F.dispose(),D.current=(K=z.current)==null?void 0:K.onDidChangeModelContent(ee=>{B.current||N(z.current.getValue(),ee)}))},[A,N]),E.useEffect(()=>{if(A){let F=L.current.editor.onDidChangeMarkers(K=>{var W;let ee=(W=z.current.getModel())==null?void 0:W.uri;if(ee&&K.find(X=>X.path===ee.path)){let X=L.current.editor.getModelMarkers({resource:ee});S==null||S(X)}});return()=>{F==null||F.dispose()}}return()=>{}},[A,S]);function Y(){var F,K;(F=D.current)==null||F.dispose(),g?h&&Qu.set(o,z.current.saveViewState()):(K=z.current.getModel())==null||K.dispose(),z.current.dispose()}return ue.createElement(pP,{width:y,height:b,isEditorReady:A,loading:d,_ref:M,className:w,wrapperProps:v})}var cG=lG,uG=E.memo(cG),Cl=uG;const Fw=Symbol.for("yaml.alias"),jb=Symbol.for("yaml.document"),Xs=Symbol.for("yaml.map"),yP=Symbol.for("yaml.pair"),Hr=Symbol.for("yaml.scalar"),ca=Symbol.for("yaml.seq"),Wn=Symbol.for("yaml.node.type"),Ho=e=>!!e&&typeof e=="object"&&e[Wn]===Fw,uc=e=>!!e&&typeof e=="object"&&e[Wn]===jb,dc=e=>!!e&&typeof e=="object"&&e[Wn]===Xs,vt=e=>!!e&&typeof e=="object"&&e[Wn]===yP,et=e=>!!e&&typeof e=="object"&&e[Wn]===Hr,fc=e=>!!e&&typeof e=="object"&&e[Wn]===ca;function yt(e){if(e&&typeof e=="object")switch(e[Wn]){case Xs:case ca:return!0}return!1}function xt(e){if(e&&typeof e=="object")switch(e[Wn]){case Fw:case Xs:case Hr:case ca:return!0}return!1}const xP=e=>(et(e)||yt(e))&&!!e.anchor,No=Symbol("break visit"),dG=Symbol("skip children"),_l=Symbol("remove node");function ua(e,t){const n=fG(t);uc(e)?Pi(null,e.contents,n,Object.freeze([e]))===_l&&(e.contents=null):Pi(null,e,n,Object.freeze([]))}ua.BREAK=No;ua.SKIP=dG;ua.REMOVE=_l;function Pi(e,t,n,r){const s=hG(e,t,n,r);if(xt(s)||vt(s))return pG(e,r,s),Pi(e,s,n,r);if(typeof s!="symbol"){if(yt(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const a=Pi(o,t.items[o],n,r);if(typeof a=="number")o=a-1;else{if(a===No)return No;a===_l&&(t.items.splice(o,1),o-=1)}}}else if(vt(t)){r=Object.freeze(r.concat(t));const o=Pi("key",t.key,n,r);if(o===No)return No;o===_l&&(t.key=null);const a=Pi("value",t.value,n,r);if(a===No)return No;a===_l&&(t.value=null)}}return s}function fG(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 hG(e,t,n,r){var s,o,a,c,d;if(typeof n=="function")return n(e,t,r);if(dc(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(fc(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,r);if(vt(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,r);if(et(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,r);if(Ho(t))return(d=n.Alias)==null?void 0:d.call(n,e,t,r)}function pG(e,t,n){const r=t[t.length-1];if(yt(r))r.items[e]=n;else if(vt(r))e==="key"?r.key=n:r.value=n;else if(uc(r))r.contents=n;else{const s=Ho(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const mG={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gG=e=>e.replace(/[!,[\]{}]/g,t=>mG[t]);class rn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},rn.defaultYaml,t),this.tags=Object.assign({},rn.defaultTags,n)}clone(){const t=new rn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new rn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:rn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},rn.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:rn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},rn.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[o,a]=r;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const a=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,a),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const o=this.tags[r];if(o)try{return o+decodeURIComponent(s)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+gG(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&xt(t.contents)){const o={};ua(t.contents,(a,c)=>{xt(c)&&c.tag&&(o[c.tag]=!0)}),s=Object.keys(o)}else s=[];for(const[o,a]of r)o==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(c=>c.startsWith(a)))&&n.push(`%TAG ${o} ${a}`);return n.join(`
|
|
697
|
+
`)}}rn.defaultYaml={explicit:!1,version:"1.2"};rn.defaultTags={"!!":"tag:yaml.org,2002:"};function vP(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 bP(e){const t=new Set;return ua(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function wP(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function yG(e,t){const n=[],r=new Map;let s=null;return{onAnchor:o=>{n.push(o),s??(s=bP(e));const a=wP(t,s);return s.add(a),a},setAnchors:()=>{for(const o of n){const a=r.get(o);if(typeof a=="object"&&a.anchor&&(et(a.node)||yt(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 Li(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,o=r.length;s<o;++s){const a=r[s],c=Li(e,r,String(s),a);c===void 0?delete r[s]:c!==a&&(r[s]=c)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const o=r.get(s),a=Li(e,r,s,o);a===void 0?r.delete(s):a!==o&&r.set(s,a)}else if(r instanceof Set)for(const s of Array.from(r)){const o=Li(e,r,s,s);o===void 0?r.delete(s):o!==s&&(r.delete(s),r.add(o))}else for(const[s,o]of Object.entries(r)){const a=Li(e,r,s,o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}return e.call(t,n,r)}function Hn(e,t,n){if(Array.isArray(e))return e.map((r,s)=>Hn(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!xP(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Bw{constructor(t){Object.defineProperty(this,Wn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:o}={}){if(!uc(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=Hn(this,"",a);if(typeof s=="function")for(const{count:d,res:f}of a.anchors.values())s(f,d);return typeof o=="function"?Li(o,{"":c},"",c):c}}class qw 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=[],ua(t,{Node:(o,a)=>{(Ho(a)||xP(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let s;for(const o of r){if(o===this)break;o.anchor===this.source&&(s=o)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:o}=n,a=this.resolve(s,n);if(!a){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let c=r.get(a);if(c||(Hn(a,null,n),c=r.get(a)),(c==null?void 0:c.res)===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(o>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=yd(s,a,r)),c.count*c.aliasCount>o)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return c.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(vP(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${s} `}return s}}function yd(e,t,n){if(Ho(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(yt(t)){let r=0;for(const s of t.items){const o=yd(e,s,n);o>r&&(r=o)}return r}else if(vt(t)){const r=yd(e,t.key,n),s=yd(e,t.value,n);return Math.max(r,s)}return 1}const kP=e=>!e||typeof e!="function"&&typeof e!="object";class Le extends Bw{constructor(t){super(Hr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Hn(this.value,t,n)}toString(){return String(this.value)}}Le.BLOCK_FOLDED="BLOCK_FOLDED";Le.BLOCK_LITERAL="BLOCK_LITERAL";Le.PLAIN="PLAIN";Le.QUOTE_DOUBLE="QUOTE_DOUBLE";Le.QUOTE_SINGLE="QUOTE_SINGLE";const xG="tag:yaml.org,2002:";function vG(e,t,n){if(t){const r=n.filter(o=>o.tag===t),s=r.find(o=>!o.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function Ul(e,t,n){var h,g,y;if(uc(e)&&(e=e.contents),xt(e))return e;if(vt(e)){const b=(g=(h=n.schema[Xs]).createNode)==null?void 0:g.call(h,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:o,schema:a,sourceObjects:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=s(e)),new qw(d.anchor);d={anchor:null,node:null},c.set(e,d)}t!=null&&t.startsWith("!!")&&(t=xG+t.slice(2));let f=vG(e,t,a.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new Le(e);return d&&(d.node=b),b}f=e instanceof Map?a[Xs]:Symbol.iterator in Object(e)?a[ca]:a[Xs]}o&&(o(f),delete n.onTagObj);const p=f!=null&&f.createNode?f.createNode(n.schema,e,n):typeof((y=f==null?void 0:f.nodeClass)==null?void 0:y.from)=="function"?f.nodeClass.from(n.schema,e,n):new Le(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function zd(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const o=t[s];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const a=[];a[o]=r,r=a}else r=new Map([[o,r]])}return Ul(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const hl=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let NP=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=>xt(r)||vt(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(hl(t))this.add(n);else{const[r,...s]=t,o=this.get(r,!0);if(yt(o))o.addIn(s,n);else if(o===void 0&&this.schema)this.set(r,zd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(yt(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,o=this.get(r,!0);return s.length===0?!n&&et(o)?o.value:o:yt(o)?o.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!vt(n))return!1;const r=n.value;return r==null||t&&et(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return yt(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const o=this.get(r,!0);if(yt(o))o.setIn(s,n);else if(o===void 0&&this.schema)this.set(r,zd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};const bG=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function as(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Eo=(e,t,n)=>e.endsWith(`
|
|
698
|
+
`)?as(n,t):n.includes(`
|
|
699
|
+
`)?`
|
|
700
|
+
`+as(n,t):(e.endsWith(" ")?"":" ")+n,SP="flow",Ab="block",xd="quoted";function Ef(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:o=20,onFold:a,onOverflow:c}={}){if(!s||s<0)return e;s<o&&(o=0);const d=Math.max(1+o,1+s-t.length);if(e.length<=d)return e;const f=[],p={};let h=s-t.length;typeof r=="number"&&(r>s-Math.max(2,o)?f.push(0):h=s-r);let g,y,b=!1,w=-1,v=-1,k=-1;n===Ab&&(w=pC(e,w,t.length),w!==-1&&(h=w+d));for(let N;N=e[w+=1];){if(n===xd&&N==="\\"){switch(v=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(N===`
|
|
701
|
+
`)n===Ab&&(w=pC(e,w,t.length)),h=w+t.length+d,g=void 0;else{if(N===" "&&y&&y!==" "&&y!==`
|
|
702
|
+
`&&y!==" "){const S=e[w+1];S&&S!==" "&&S!==`
|
|
703
|
+
`&&S!==" "&&(g=w)}if(w>=h)if(g)f.push(g),h=g+d,g=void 0;else if(n===xd){for(;y===" "||y===" ";)y=N,N=e[w+=1],b=!0;const S=w>k+1?w-2:v-1;if(p[S])return e;f.push(S),p[S]=!0,h=S+d,g=void 0}else b=!0}y=N}if(b&&c&&c(),f.length===0)return e;a&&a();let _=e.slice(0,f[0]);for(let N=0;N<f.length;++N){const S=f[N],A=f[N+1]||e.length;S===0?_=`
|
|
704
|
+
${t}${e.slice(0,A)}`:(n===xd&&p[S]&&(_+=`${e[S]}\\`),_+=`
|
|
705
|
+
${t}${e.slice(S+1,A)}`)}return _}function pC(e,t,n){let r=t,s=t+1,o=e[s];for(;o===" "||o===" ";)if(t<s+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
706
|
+
`);r=t,s=t+1,o=e[s]}return r}const jf=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Af=e=>/^(%|---|\.\.\.)/m.test(e);function wG(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let o=0,a=0;o<s;++o)if(e[o]===`
|
|
707
|
+
`){if(o-a>r)return!0;if(a=o+1,s-a<=r)return!1}return!0}function El(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Af(e)?" ":"");let a="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(a+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{a+=n.slice(c,d);const p=n.substr(d+2,4);switch(p){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:p.substr(0,2)==="00"?a+="\\x"+p.substr(2):a+=n.substr(d,6)}d+=5,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<s)d+=1;else{for(a+=n.slice(c,d)+`
|
|
708
|
+
|
|
709
|
+
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)a+=`
|
|
710
|
+
`,d+=2;a+=o,n[d+2]===" "&&(a+="\\"),d+=1,c=d+1}break;default:d+=1}return a=c?a+n.slice(c):n,r?a:Ef(a,o,xd,jf(t,!1))}function Tb(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
711
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return El(e,t);const n=t.indent||(Af(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
712
|
+
${n}`)+"'";return t.implicitKey?r:Ef(r,n,SP,jf(t,!1))}function Di(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=El;else{const s=e.includes('"'),o=e.includes("'");s&&!o?r=Tb:o&&!s?r=El:r=n?Tb:El}return r(e,t)}let Ib;try{Ib=new RegExp(`(^|(?<!
|
|
713
|
+
))
|
|
714
|
+
+(?!
|
|
715
|
+
|$)`,"g")}catch{Ib=/\n+(?!\n|$)/g}function vd({comment:e,type:t,value:n},r,s,o){const{blockQuote:a,commentString:c,lineWidth:d}=r.options;if(!a||/\n[\t ]+$/.test(n))return Di(n,r);const f=r.indent||(r.forceBlockIndent||Af(n)?" ":""),p=a==="literal"?!0:a==="folded"||t===Le.BLOCK_FOLDED?!1:t===Le.BLOCK_LITERAL?!0:!wG(n,d,f.length);if(!n)return p?`|
|
|
716
|
+
`:`>
|
|
717
|
+
`;let h,g;for(g=n.length;g>0;--g){const A=n[g-1];if(A!==`
|
|
718
|
+
`&&A!==" "&&A!==" ")break}let y=n.substring(g);const b=y.indexOf(`
|
|
719
|
+
`);b===-1?h="-":n===y||b!==y.length-1?(h="+",o&&o()):h="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
|
|
720
|
+
`&&(y=y.slice(0,-1)),y=y.replace(Ib,`$&${f}`));let w=!1,v,k=-1;for(v=0;v<n.length;++v){const A=n[v];if(A===" ")w=!0;else if(A===`
|
|
721
|
+
`)k=v;else break}let _=n.substring(0,k<v?k+1:v);_&&(n=n.substring(_.length),_=_.replace(/\n+/g,`$&${f}`));let S=(w?f?"2":"1":"")+h;if(e&&(S+=" "+c(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!p){const A=n.replace(/\n+/g,`
|
|
722
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let I=!1;const T=jf(r,!0);a!=="folded"&&t!==Le.BLOCK_FOLDED&&(T.onOverflow=()=>{I=!0});const O=Ef(`${_}${A}${y}`,f,Ab,T);if(!I)return`>${S}
|
|
723
|
+
${f}${O}`}return n=n.replace(/\n+/g,`$&${f}`),`|${S}
|
|
724
|
+
${f}${_}${n}${y}`}function kG(e,t,n,r){const{type:s,value:o}=e,{actualString:a,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&o.includes(`
|
|
725
|
+
`)||p&&/[[\]{},]/.test(o))return Di(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||p||!o.includes(`
|
|
726
|
+
`)?Di(o,t):vd(e,t,n,r);if(!c&&!p&&s!==Le.PLAIN&&o.includes(`
|
|
727
|
+
`))return vd(e,t,n,r);if(Af(o)){if(d==="")return t.forceBlockIndent=!0,vd(e,t,n,r);if(c&&d===f)return Di(o,t)}const h=o.replace(/\n+/g,`$&
|
|
728
|
+
${d}`);if(a){const g=w=>{var v;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((v=w.test)==null?void 0:v.test(h))},{compat:y,tags:b}=t.doc.schema;if(b.some(g)||y!=null&&y.some(g))return Di(o,t)}return c?h:Ef(h,d,SP,jf(t,!1))}function zw(e,t,n,r){const{implicitKey:s,inFlow:o}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Le.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=Le.QUOTE_DOUBLE);const d=p=>{switch(p){case Le.BLOCK_FOLDED:case Le.BLOCK_LITERAL:return s||o?Di(a.value,t):vd(a,t,n,r);case Le.QUOTE_DOUBLE:return El(a.value,t);case Le.QUOTE_SINGLE:return Tb(a.value,t);case Le.PLAIN:return kG(a,t,n,r);default:return null}};let f=d(c);if(f===null){const{defaultKeyType:p,defaultStringType:h}=t.options,g=s&&p||h;if(f=d(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function CP(e,t){const n=Object.assign({blockQuote:!0,commentString:bG,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 NG(e,t){var s;if(t.tag){const o=e.filter(a=>a.tag===t.tag);if(o.length>0)return o.find(a=>a.format===t.format)??o[0]}let n,r;if(et(t)){r=t.value;let o=e.filter(a=>{var c;return(c=a.identify)==null?void 0:c.call(a,r)});if(o.length>1){const a=o.filter(c=>c.test);a.length>0&&(o=a)}n=o.find(a=>a.format===t.format)??o.find(a=>!a.format)}else r=t,n=e.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!n){const o=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return n}function SG(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],o=(et(e)||yt(e))&&e.anchor;o&&vP(o)&&(n.add(o),s.push(`&${o}`));const a=e.tag??(t.default?null:t.tag);return a&&s.push(r.directives.tagString(a)),s.join(" ")}function na(e,t,n,r){var d;if(vt(e))return e.toString(t,n,r);if(Ho(e)){if(t.doc.directives)return e.toString(t);if((d=t.resolvedAliases)!=null&&d.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const o=xt(e)?e:t.doc.createNode(e,{onTagObj:f=>s=f});s??(s=NG(t.doc.schema.tags,o));const a=SG(o,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const c=typeof s.stringify=="function"?s.stringify(o,t,n,r):et(o)?zw(o,t,n,r):o.toString(t,n,r);return a?et(o)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
|
|
729
|
+
${t.indent}${c}`:c}function CG({key:e,value:t},n,r,s){const{allNullValues:o,doc:a,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:h}}=n;let g=xt(e)&&e.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(yt(e)||!xt(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let y=!h&&(!e||g&&t==null&&!n.inFlow||yt(e)||(et(e)?e.type===Le.BLOCK_FOLDED||e.type===Le.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(h||!o),indent:c+d});let b=!1,w=!1,v=na(e,n,()=>b=!0,()=>w=!0);if(!y&&!n.inFlow&&v.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(n.inFlow){if(o||t==null)return b&&r&&r(),v===""?"?":y?`? ${v}`:v}else if(o&&!h||t==null&&y)return v=`? ${v}`,g&&!b?v+=Eo(v,n.indent,f(g)):w&&s&&s(),v;b&&(g=null),y?(g&&(v+=Eo(v,n.indent,f(g))),v=`? ${v}
|
|
730
|
+
${c}:`):(v=`${v}:`,g&&(v+=Eo(v,n.indent,f(g))));let k,_,N;xt(t)?(k=!!t.spaceBefore,_=t.commentBefore,N=t.comment):(k=!1,_=null,N=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!y&&!g&&et(t)&&(n.indentAtStart=v.length+1),w=!1,!p&&d.length>=2&&!n.inFlow&&!y&&fc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let S=!1;const A=na(t,n,()=>S=!0,()=>w=!0);let I=" ";if(g||k||_){if(I=k?`
|
|
731
|
+
`:"",_){const T=f(_);I+=`
|
|
732
|
+
${as(T,n.indent)}`}A===""&&!n.inFlow?I===`
|
|
733
|
+
`&&N&&(I=`
|
|
734
|
+
|
|
735
|
+
`):I+=`
|
|
736
|
+
${n.indent}`}else if(!y&&yt(t)){const T=A[0],O=A.indexOf(`
|
|
737
|
+
`),L=O!==-1,z=n.inFlow??t.flow??t.items.length===0;if(L||!z){let M=!1;if(L&&(T==="&"||T==="!")){let P=A.indexOf(" ");T==="&"&&P!==-1&&P<O&&A[P+1]==="!"&&(P=A.indexOf(" ",P+1)),(P===-1||O<P)&&(M=!0)}M||(I=`
|
|
738
|
+
${n.indent}`)}}else(A===""||A[0]===`
|
|
739
|
+
`)&&(I="");return v+=I+A,n.inFlow?S&&r&&r():N&&!S?v+=Eo(v,n.indent,f(N)):w&&s&&s(),v}function _P(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ju="<<",cs={identify:e=>e===Ju||typeof e=="symbol"&&e.description===Ju,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Le(Symbol(Ju)),{addToJSMap:EP}),stringify:()=>Ju},_G=(e,t)=>(cs.identify(t)||et(t)&&(!t.type||t.type===Le.PLAIN)&&cs.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===cs.tag&&n.default));function EP(e,t,n){if(n=e&&Ho(n)?n.resolve(e.doc):n,fc(n))for(const r of n.items)Cm(e,t,r);else if(Array.isArray(n))for(const r of n)Cm(e,t,r);else Cm(e,t,n)}function Cm(e,t,n){const r=e&&Ho(n)?n.resolve(e.doc):n;if(!dc(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[o,a]of s)t instanceof Map?t.has(o)||t.set(o,a):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function jP(e,t,{key:n,value:r}){if(xt(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(_G(e,n))EP(e,t,r);else{const s=Hn(n,"",e);if(t instanceof Map)t.set(s,Hn(r,s,e));else if(t instanceof Set)t.add(s);else{const o=EG(n,s,e),a=Hn(r,o,e);o in t?Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[o]=a}}return t}function EG(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(xt(e)&&(n!=null&&n.doc)){const r=CP(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(s);o.length>40&&(o=o.substring(0,36)+'..."'),_P(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function Vw(e,t,n){const r=Ul(e,void 0,n),s=Ul(t,void 0,n);return new on(r,s)}class on{constructor(t,n=null){Object.defineProperty(this,Wn,{value:yP}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return xt(n)&&(n=n.clone(t)),xt(r)&&(r=r.clone(t)),new on(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return jP(n,r,this)}toString(t,n,r){return t!=null&&t.doc?CG(this,t,n,r):JSON.stringify(this)}}function AP(e,t,n){return(t.inFlow??e.flow?AG:jG)(e,t,n)}function jG({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:o,onChompKeep:a,onComment:c}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:o,type:null});let h=!1;const g=[];for(let b=0;b<t.length;++b){const w=t[b];let v=null;if(xt(w))!h&&w.spaceBefore&&g.push(""),Vd(n,g,w.commentBefore,h),w.comment&&(v=w.comment);else if(vt(w)){const _=xt(w.key)?w.key:null;_&&(!h&&_.spaceBefore&&g.push(""),Vd(n,g,_.commentBefore,h))}h=!1;let k=na(w,p,()=>v=null,()=>h=!0);v&&(k+=Eo(k,o,f(v))),h&&v&&(h=!1),g.push(r+k)}let y;if(g.length===0)y=s.start+s.end;else{y=g[0];for(let b=1;b<g.length;++b){const w=g[b];y+=w?`
|
|
740
|
+
${d}${w}`:`
|
|
741
|
+
`}}return e?(y+=`
|
|
742
|
+
`+as(f(e),d),c&&c()):h&&a&&a(),y}function AG({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:o,flowCollectionPadding:a,options:{commentString:c}}=t;r+=o;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const h=[];for(let b=0;b<e.length;++b){const w=e[b];let v=null;if(xt(w))w.spaceBefore&&h.push(""),Vd(t,h,w.commentBefore,!1),w.comment&&(v=w.comment);else if(vt(w)){const _=xt(w.key)?w.key:null;_&&(_.spaceBefore&&h.push(""),Vd(t,h,_.commentBefore,!1),_.comment&&(f=!0));const N=xt(w.value)?w.value:null;N?(N.comment&&(v=N.comment),N.commentBefore&&(f=!0)):w.value==null&&(_!=null&&_.comment)&&(v=_.comment)}v&&(f=!0);let k=na(w,d,()=>v=null);b<e.length-1&&(k+=","),v&&(k+=Eo(k,r,c(v))),!f&&(h.length>p||k.includes(`
|
|
743
|
+
`))&&(f=!0),h.push(k),p=h.length}const{start:g,end:y}=n;if(h.length===0)return g+y;if(!f){const b=h.reduce((w,v)=>w+v.length+2,2);f=t.options.lineWidth>0&&b>t.options.lineWidth}if(f){let b=g;for(const w of h)b+=w?`
|
|
744
|
+
${o}${s}${w}`:`
|
|
745
|
+
`;return`${b}
|
|
746
|
+
${s}${y}`}else return`${g}${a}${h.join(" ")}${a}${y}`}function Vd({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const o=as(t(r),e);n.push(o.trimStart())}}function jo(e,t){const n=et(t)?t.value:t;for(const r of e)if(vt(r)&&(r.key===t||r.key===n||et(r.key)&&r.key.value===n))return r}class Vn extends NP{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Xs,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:o}=r,a=new this(t),c=(d,f)=>{if(typeof o=="function")f=o.call(n,d,f);else if(Array.isArray(o)&&!o.includes(d))return;(f!==void 0||s)&&a.items.push(Vw(d,f,r))};if(n instanceof Map)for(const[d,f]of n)c(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))c(d,n[d]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;vt(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new on(t,t==null?void 0:t.value):r=new on(t.key,t.value);const s=jo(this.items,r.key),o=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);et(s.value)&&kP(r.value)?s.value.value=r.value:s.value=r.value}else if(o){const c=this.items.findIndex(d=>o(r,d)<0);c===-1?this.items.push(r):this.items.splice(c,0,r)}else this.items.push(r)}delete(t){const n=jo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=jo(this.items,t),s=r==null?void 0:r.value;return(!n&&et(s)?s.value:s)??void 0}has(t){return!!jo(this.items,t)}set(t,n){this.add(new on(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const o of this.items)jP(n,s,o);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!vt(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),AP(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const da={collection:"map",default:!0,nodeClass:Vn,tag:"tag:yaml.org,2002:map",resolve(e,t){return dc(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Vn.from(e,t,n)};class qo extends NP{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ca,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Zu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Zu(t);if(typeof r!="number")return;const s=this.items[r];return!n&&et(s)?s.value:s}has(t){const n=Zu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Zu(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];et(s)&&kP(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let s=0;for(const o of this.items)r.push(Hn(o,String(s++),n));return r}toString(t,n,r){return t?AP(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof s=="function"){const d=n instanceof Set?c:String(a++);c=s.call(n,d,c)}o.items.push(Ul(c,void 0,r))}}return o}}function Zu(e){let t=et(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const fa={collection:"seq",default:!0,nodeClass:qo,tag:"tag:yaml.org,2002:seq",resolve(e,t){return fc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>qo.from(e,t,n)},Tf={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),zw(e,t,n,r)}},If={identify:e=>e==null,createNode:()=>new Le(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Le(null),stringify:({source:e},t)=>typeof e=="string"&&If.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 Le(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 vr({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let a=o.indexOf(".");a<0&&(a=o.length,o+=".");let c=t-(o.length-a-1);for(;c-- >0;)o+="0"}return o}const TP={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:vr},IP={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():vr(e)}},MP={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 Le(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:vr},Mf=e=>typeof e=="bigint"||Number.isInteger(e),Uw=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function RP(e,t,n){const{value:r}=e;return Mf(r)&&r>=0?n+r.toString(t):vr(e)}const OP={identify:e=>Mf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Uw(e,2,8,n),stringify:e=>RP(e,8,"0o")},PP={identify:Mf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Uw(e,0,10,n),stringify:vr},LP={identify:e=>Mf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Uw(e,2,16,n),stringify:e=>RP(e,16,"0x")},TG=[da,fa,Tf,If,Hw,OP,PP,LP,TP,IP,MP];function mC(e){return typeof e=="bigint"||Number.isInteger(e)}const ed=({value:e})=>JSON.stringify(e),IG=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ed},{identify:e=>e==null,createNode:()=>new Le(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ed},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ed},{identify:mC,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})=>mC(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:ed}],MG={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},RG=[da,fa].concat(IG,MG),Ww={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,o){if(!n)return"";const a=n;let c;if(typeof btoa=="function"){let d="";for(let f=0;f<a.length;++f)d+=String.fromCharCode(a[f]);c=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Le.BLOCK_LITERAL),t!==Le.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/d),p=new Array(f);for(let h=0,g=0;h<f;++h,g+=d)p[h]=c.substr(g,d);c=p.join(t===Le.BLOCK_LITERAL?`
|
|
747
|
+
`:" ")}return zw({comment:e,type:t,value:c},r,s,o)}};function DP(e,t){if(fc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!vt(r)){if(dc(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new on(new Le(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
748
|
+
${s.key.commentBefore}`:r.commentBefore),r.comment){const o=s.value??s.key;o.comment=o.comment?`${r.comment}
|
|
749
|
+
${o.comment}`:r.comment}r=s}e.items[n]=vt(r)?r:new on(r)}}else t("Expected a sequence for this tag");return e}function $P(e,t,n){const{replacer:r}=n,s=new qo(e);s.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(o++),a));let c,d;if(Array.isArray(a))if(a.length===2)c=a[0],d=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const f=Object.keys(a);if(f.length===1)c=f[0],d=a[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=a;s.items.push(Vw(c,d,n))}return s}const Kw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:DP,createNode:$P};class Hi extends qo{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=Hi.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let o,a;if(vt(s)?(o=Hn(s.key,"",n),a=Hn(s.value,o,n)):o=Hn(s,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,a)}return r}static from(t,n,r){const s=$P(t,n,r),o=new this;return o.items=s.items,o}}Hi.tag="tag:yaml.org,2002:omap";const Gw={collection:"seq",identify:e=>e instanceof Map,nodeClass:Hi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=DP(e,t),r=[];for(const{key:s}of n.items)et(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Hi,n)},createNode:(e,t,n)=>Hi.from(e,t,n)};function FP({value:e,source:t},n){return t&&(e?BP:qP).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const BP={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 Le(!0),stringify:FP},qP={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 Le(!1),stringify:FP},OG={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:vr},PG={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():vr(e)}},LG={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 Le(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:vr},hc=e=>typeof e=="bigint"||Number.isInteger(e);function Rf(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return s==="-"?BigInt(-1)*a:a}const o=parseInt(e,n);return s==="-"?-1*o:o}function Yw(e,t,n){const{value:r}=e;if(hc(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return vr(e)}const DG={identify:hc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Rf(e,2,2,n),stringify:e=>Yw(e,2,"0b")},$G={identify:hc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Rf(e,1,8,n),stringify:e=>Yw(e,8,"0")},FG={identify:hc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Rf(e,0,10,n),stringify:vr},BG={identify:hc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Rf(e,2,16,n),stringify:e=>Yw(e,16,"0x")};class Ui extends Vn{constructor(t){super(t),this.tag=Ui.tag}add(t){let n;vt(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new on(t.key,null):n=new on(t,null),jo(this.items,n.key)||this.items.push(n)}get(t,n){const r=jo(this.items,t);return!n&&vt(r)?et(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=jo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new on(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof s=="function"&&(a=s.call(n,a,a)),o.items.push(Vw(a,null,r));return o}}Ui.tag="tag:yaml.org,2002:set";const Xw={collection:"map",identify:e=>e instanceof Set,nodeClass:Ui,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Ui.from(e,t,n),resolve(e,t){if(dc(e)){if(e.hasAllNullValues(!0))return Object.assign(new Ui,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Qw(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=a=>t?BigInt(a):Number(a),o=r.replace(/_/g,"").split(":").reduce((a,c)=>a*s(60)+s(c),s(0));return n==="-"?s(-1)*o:o}function zP(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return vr(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),o=[t%s];return t<60?o.unshift(0):(t=(t-o[0])/s,o.unshift(t%s),t>=60&&(t=(t-o[0])/s,o.unshift(t))),r+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const VP={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})=>Qw(e,n),stringify:zP},HP={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=>Qw(e,!1),stringify:zP},Of={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(Of.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,o,a,c]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,s,o||0,a||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let h=Qw(p,!1);Math.abs(h)<30&&(h*=60),f-=6e4*h}return new Date(f)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},gC=[da,fa,Tf,If,BP,qP,DG,$G,FG,BG,OG,PG,LG,Ww,cs,Gw,Kw,Xw,VP,HP,Of],yC=new Map([["core",TG],["failsafe",[da,fa,Tf]],["json",RG],["yaml11",gC],["yaml-1.1",gC]]),xC={binary:Ww,bool:Hw,float:MP,floatExp:IP,floatNaN:TP,floatTime:HP,int:PP,intHex:LP,intOct:OP,intTime:VP,map:da,merge:cs,null:If,omap:Gw,pairs:Kw,seq:fa,set:Xw,timestamp:Of},qG={"tag:yaml.org,2002:binary":Ww,"tag:yaml.org,2002:merge":cs,"tag:yaml.org,2002:omap":Gw,"tag:yaml.org,2002:pairs":Kw,"tag:yaml.org,2002:set":Xw,"tag:yaml.org,2002:timestamp":Of};function _m(e,t,n){const r=yC.get(t);if(r&&!e)return n&&!r.includes(cs)?r.concat(cs):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const o=Array.from(yC.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)s=s.concat(o);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(cs)),s.reduce((o,a)=>{const c=typeof a=="string"?xC[a]:a;if(!c){const d=JSON.stringify(a),f=Object.keys(xC).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return o.includes(c)||o.push(c),o},[])}const zG=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Jw{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:o,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(t)?_m(t,"compat"):t?_m(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=s?qG:{},this.tags=_m(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Xs,{value:da}),Object.defineProperty(this,Hr,{value:Tf}),Object.defineProperty(this,ca,{value:fa}),this.sortMapEntries=typeof a=="function"?a:a===!0?zG:null}clone(){const t=Object.create(Jw.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function VG(e,t){var d;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const f=e.directives.toString(e);f?(n.push(f),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=CP(e,t),{commentString:o}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=o(e.commentBefore);n.unshift(as(f,""))}let a=!1,c=null;if(e.contents){if(xt(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const h=o(e.contents.commentBefore);n.push(as(h,""))}s.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>a=!0;let p=na(e.contents,s,()=>c=null,f);c&&(p+=Eo(p,"",o(c))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(na(e.contents,s));if((d=e.directives)!=null&&d.docEnd)if(e.comment){const f=o(e.comment);f.includes(`
|
|
750
|
+
`)?(n.push("..."),n.push(as(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(as(o(f),"")))}return n.join(`
|
|
751
|
+
`)+`
|
|
752
|
+
`}class pc{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wn,{value:jb});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:a}=o;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new rn({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(pc.prototype,{[Wn]:{value:jb}});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=xt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ji(this.contents)&&this.contents.add(t)}addIn(t,n){ji(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=bP(this);t.anchor=!n||r.has(n)?wP(n||"a",r):n}return new qw(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const v=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,k=n.filter(v).map(String);k.length>0&&(n=n.concat(k)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:o,anchorPrefix:a,flow:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:h,setAnchors:g,sourceObjects:y}=yG(this,a||"a"),b={aliasDuplicateObjects:o??!0,keepUndefined:d??!1,onAnchor:h,onTagObj:f,replacer:s,schema:this.schema,sourceObjects:y},w=Ul(t,p,b);return c&&yt(w)&&(w.flow=!0),g(),w}createPair(t,n,r={}){const s=this.createNode(t,null,r),o=this.createNode(n,null,r);return new on(s,o)}delete(t){return ji(this.contents)?this.contents.delete(t):!1}deleteIn(t){return hl(t)?this.contents==null?!1:(this.contents=null,!0):ji(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return yt(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return hl(t)?!n&&et(this.contents)?this.contents.value:this.contents:yt(this.contents)?this.contents.getIn(t,n):void 0}has(t){return yt(this.contents)?this.contents.has(t):!1}hasIn(t){return hl(t)?this.contents!==void 0:yt(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=zd(this.schema,[t],n):ji(this.contents)&&this.contents.set(t,n)}setIn(t,n){hl(t)?this.contents=n:this.contents==null?this.contents=zd(this.schema,Array.from(t),n):ji(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 rn({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 rn({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Jw(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:o,reviver:a}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},d=Hn(this.contents,n??"",c);if(typeof o=="function")for(const{count:f,res:p}of c.anchors.values())o(p,f);return typeof a=="function"?Li(a,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return VG(this,t)}}function ji(e){if(yt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class UP extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class pl extends UP{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class HG extends UP{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const vC=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let o=s-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const c=Math.min(o-39,a.length-79);a="…"+a.substring(c),o-=c-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
753
|
+
`),a=c+a}if(/[^ ]/.test(a)){let c=1;const d=n.linePos[1];(d==null?void 0:d.line)===r&&d.col>s&&(c=Math.max(1,Math.min(d.col-s,80-o)));const f=" ".repeat(o)+"^".repeat(c);n.message+=`:
|
|
754
|
+
|
|
755
|
+
${a}
|
|
756
|
+
${f}
|
|
757
|
+
`}};function ra(e,{flow:t,indicator:n,next:r,offset:s,onError:o,parentIndent:a,startOnNewline:c}){let d=!1,f=c,p=c,h="",g="",y=!1,b=!1,w=null,v=null,k=null,_=null,N=null,S=null,A=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),w&&(f&&O.type!=="comment"&&O.type!=="newline"&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),O.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&O.source.includes(" ")&&(w=O),p=!0;break;case"comment":{p||o(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=O.source.substring(1)||" ";h?h+=g+L:h=L,g="",f=!1;break}case"newline":f?h?h+=O.source:(!S||n!=="seq-item-ind")&&(d=!0):g+=O.source,f=!0,y=!0,(v||k)&&(_=O),p=!0;break;case"anchor":v&&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),v=O,A??(A=O.offset),f=!1,p=!1,b=!0;break;case"tag":{k&&o(O,"MULTIPLE_TAGS","A node can have at most one tag"),k=O,A??(A=O.offset),f=!1,p=!1,b=!0;break}case n:(v||k)&&o(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),S&&o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),S=O,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){N&&o(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),N=O,f=!1,p=!1;break}default:o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),f=!1,p=!1}const I=e[e.length-1],T=I?I.offset+I.source.length:s;return 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"),w&&(f&&w.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:S,spaceBefore:d,comment:h,hasNewline:y,anchor:v,tag:k,newlineAfterProp:_,end:T,start:A??T}}function Wl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
758
|
+
`))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(Wl(t.key)||Wl(t.value))return!0}return!1;default:return!0}}function Mb(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Wl(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function WP(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(o,a)=>o===a||et(o)&&et(a)&&o.value===a.value;return t.some(o=>s(o.key,n))}const bC="All mapping items must start at the same column";function UG({composeNode:e,composeEmptyNode:t},n,r,s,o){var p;const a=(o==null?void 0:o.nodeClass)??Vn,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const h of r.items){const{start:g,key:y,sep:b,value:w}=h,v=ra(g,{indicator:"explicit-key-ind",next:y??(b==null?void 0:b[0]),offset:d,onError:s,parentIndent:r.indent,startOnNewline:!0}),k=!v.found;if(k){if(y&&(y.type==="block-seq"?s(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&s(d,"BAD_INDENT",bC)),!v.anchor&&!v.tag&&!b){f=v.end,v.comment&&(c.comment?c.comment+=`
|
|
759
|
+
`+v.comment:c.comment=v.comment);continue}(v.newlineAfterProp||Wl(y))&&s(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=v.found)==null?void 0:p.indent)!==r.indent&&s(d,"BAD_INDENT",bC);n.atKey=!0;const _=v.end,N=y?e(n,y,v,s):t(n,_,g,null,v,s);n.schema.compat&&Mb(r.indent,y,s),n.atKey=!1,WP(n,c.items,N)&&s(_,"DUPLICATE_KEY","Map keys must be unique");const S=ra(b??[],{indicator:"map-value-ind",next:w,offset:N.range[2],onError:s,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=S.end,S.found){k&&((w==null?void 0:w.type)==="block-map"&&!S.hasNewline&&s(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.start<S.found.offset-1024&&s(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=w?e(n,w,S,s):t(n,d,b,null,S,s);n.schema.compat&&Mb(r.indent,w,s),d=A.range[2];const I=new on(N,A);n.options.keepSourceTokens&&(I.srcToken=h),c.items.push(I)}else{k&&s(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(N.comment?N.comment+=`
|
|
760
|
+
`+S.comment:N.comment=S.comment);const A=new on(N);n.options.keepSourceTokens&&(A.srcToken=h),c.items.push(A)}}return f&&f<d&&s(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,d,f??d],c}function WG({composeNode:e,composeEmptyNode:t},n,r,s,o){const a=(o==null?void 0:o.nodeClass)??qo,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:h}of r.items){const g=ra(p,{indicator:"seq-item-ind",next:h,offset:d,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)(h==null?void 0:h.type)==="block-seq"?s(g.end,"BAD_INDENT","All sequence items must start at the same column"):s(d,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(c.comment=g.comment);continue}const y=h?e(n,h,g,s):t(n,g.end,p,null,g,s);n.schema.compat&&Mb(r.indent,h,s),d=y.range[2],c.items.push(y)}return c.range=[r.offset,d,f??d],c}function mc(e,t,n,r){let s="";if(e){let o=!1,a="";for(const c of e){const{source:d,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 p=d.substring(1)||" ";s?s+=a+p:s=p,a="";break}case"newline":s&&(a+=d),o=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:s,offset:t}}const Em="Block collections are not allowed within flow collections",jm=e=>e&&(e.type==="block-map"||e.type==="block-seq");function KG({composeNode:e,composeEmptyNode:t},n,r,s,o){var v;const a=r.start.source==="{",c=a?"flow map":"flow sequence",d=(o==null?void 0:o.nodeClass)??(a?Vn:qo),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let h=r.offset+r.start.source.length;for(let k=0;k<r.items.length;++k){const _=r.items[k],{start:N,key:S,sep:A,value:I}=_,T=ra(N,{flow:c,indicator:"explicit-key-ind",next:S??(A==null?void 0:A[0]),offset:h,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!A&&!I){k===0&&T.comma?s(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):k<r.items.length-1&&s(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),T.comment&&(f.comment?f.comment+=`
|
|
761
|
+
`+T.comment:f.comment=T.comment),h=T.end;continue}!a&&n.options.strict&&Wl(S)&&s(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(k===0)T.comma&&s(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(T.comma||s(T.start,"MISSING_CHAR",`Missing , between ${c} items`),T.comment){let O="";e:for(const L of N)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];vt(L)&&(L=L.value??L.key),L.comment?L.comment+=`
|
|
762
|
+
`+O:L.comment=O,T.comment=T.comment.substring(O.length+1)}}if(!a&&!A&&!T.found){const O=I?e(n,I,T,s):t(n,T.end,A,null,T,s);f.items.push(O),h=O.range[2],jm(I)&&s(O.range,"BLOCK_IN_FLOW",Em)}else{n.atKey=!0;const O=T.end,L=S?e(n,S,T,s):t(n,O,N,null,T,s);jm(S)&&s(L.range,"BLOCK_IN_FLOW",Em),n.atKey=!1;const z=ra(A??[],{flow:c,indicator:"map-value-ind",next:I,offset:L.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(z.found){if(!a&&!T.found&&n.options.strict){if(A)for(const H of A){if(H===z.found)break;if(H.type==="newline"){s(H,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<z.found.offset-1024&&s(z.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else I&&("source"in I&&((v=I.source)==null?void 0:v[0])===":"?s(I,"MISSING_CHAR",`Missing space after : in ${c}`):s(z.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const M=I?e(n,I,z,s):z.found?t(n,z.end,A,null,z,s):null;M?jm(I)&&s(M.range,"BLOCK_IN_FLOW",Em):z.comment&&(L.comment?L.comment+=`
|
|
763
|
+
`+z.comment:L.comment=z.comment);const P=new on(L,M);if(n.options.keepSourceTokens&&(P.srcToken=_),a){const H=f;WP(n,H.items,L)&&s(O,"DUPLICATE_KEY","Map keys must be unique"),H.items.push(P)}else{const H=new Vn(n.schema);H.flow=!0,H.items.push(P);const D=(M??L).range;H.range=[L.range[0],D[1],D[2]],f.items.push(H)}h=M?M.range[2]:z.end}}const g=a?"}":"]",[y,...b]=r.end;let w=h;if((y==null?void 0:y.source)===g)w=y.offset+y.source.length;else{const k=c[0].toUpperCase()+c.substring(1),_=p?`${k} must end with a ${g}`:`${k} in block collection must be sufficiently indented and end with a ${g}`;s(h,p?"MISSING_CHAR":"BAD_INDENT",_),y&&y.source.length!==1&&b.unshift(y)}if(b.length>0){const k=mc(b,w,n.options.strict,s);k.comment&&(f.comment?f.comment+=`
|
|
764
|
+
`+k.comment:f.comment=k.comment),f.range=[r.offset,w,k.offset]}else f.range=[r.offset,w,w];return f}function Am(e,t,n,r,s,o){const a=n.type==="block-map"?UG(e,t,n,r,o):n.type==="block-seq"?WG(e,t,n,r,o):KG(e,t,n,r,o),c=a.constructor;return s==="!"||s===c.tagName?(a.tag=c.tagName,a):(s&&(a.tag=s),a)}function GG(e,t,n,r,s){var g;const o=r.tag,a=o?t.directives.tagName(o.source,y=>s(o,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:b}=r,w=y&&o?y.offset>o.offset?y:o:y??o;w&&(!b||b.offset<w.offset)&&s(w,"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===qo.tagName&&c==="seq")return Am(e,t,n,s,a);let d=t.schema.tags.find(y=>y.tag===a&&y.collection===c);if(!d){const y=t.schema.knownTags[a];if((y==null?void 0:y.collection)===c)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?s(o,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):s(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Am(e,t,n,s,a)}const f=Am(e,t,n,s,a,d),p=((g=d.resolve)==null?void 0:g.call(d,f,y=>s(o,"TAG_RESOLVE_FAILED",y),t.options))??f,h=xt(p)?p:new Le(p);return h.range=f.range,h.tag=a,d!=null&&d.format&&(h.format=d.format),h}function YG(e,t,n){const r=t.offset,s=XG(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const o=s.mode===">"?Le.BLOCK_FOLDED:Le.BLOCK_LITERAL,a=t.source?QG(t.source):[];let c=a.length;for(let w=a.length-1;w>=0;--w){const v=a[w][1];if(v===""||v==="\r")c=w;else break}if(c===0){const w=s.chomp==="+"&&a.length>0?`
|
|
765
|
+
`.repeat(Math.max(1,a.length-1)):"";let v=r+s.length;return t.source&&(v+=t.source.length),{value:w,type:o,comment:s.comment,range:[r,v,v]}}let d=t.indent+s.indent,f=t.offset+s.length,p=0;for(let w=0;w<c;++w){const[v,k]=a[w];if(k===""||k==="\r")s.indent===0&&v.length>d&&(d=v.length);else{v.length<d&&n(f+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(d=v.length),p=w,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=v.length+k.length+1}for(let w=a.length-1;w>=c;--w)a[w][0].length>d&&(c=w+1);let h="",g="",y=!1;for(let w=0;w<p;++w)h+=a[w][0].slice(d)+`
|
|
766
|
+
`;for(let w=p;w<c;++w){let[v,k]=a[w];f+=v.length+k.length+1;const _=k[k.length-1]==="\r";if(_&&(k=k.slice(0,-1)),k&&v.length<d){const S=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-(_?2:1),"BAD_INDENT",S),v=""}o===Le.BLOCK_LITERAL?(h+=g+v.slice(d)+k,g=`
|
|
767
|
+
`):v.length>d||k[0]===" "?(g===" "?g=`
|
|
768
|
+
`:!y&&g===`
|
|
769
|
+
`&&(g=`
|
|
770
|
+
|
|
771
|
+
`),h+=g+v.slice(d)+k,g=`
|
|
772
|
+
`,y=!0):k===""?g===`
|
|
773
|
+
`?h+=`
|
|
774
|
+
`:g=`
|
|
775
|
+
`:(h+=g+k,g=" ",y=!1)}switch(s.chomp){case"-":break;case"+":for(let w=c;w<a.length;++w)h+=`
|
|
776
|
+
`+a[w][0].slice(d);h[h.length-1]!==`
|
|
777
|
+
`&&(h+=`
|
|
778
|
+
`);break;default:h+=`
|
|
779
|
+
`}const b=r+s.length+t.source.length;return{value:h,type:o,comment:s.comment,range:[r,b,b]}}function XG({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],o=s[0];let a=0,c="",d=-1;for(let g=1;g<s.length;++g){const y=s[g];if(!c&&(y==="-"||y==="+"))c=y;else{const b=Number(y);!a&&b?a=b:d===-1&&(d=e+g)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let f=!1,p="",h=s.length;for(let g=1;g<t.length;++g){const y=t[g];switch(y.type){case"space":f=!0;case"newline":h+=y.source.length;break;case"comment":n&&!f&&r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=y.source.length,p=y.source.substring(1);break;case"error":r(y,"UNEXPECTED_TOKEN",y.message),h+=y.source.length;break;default:{const b=`Unexpected token in block scalar header: ${y.type}`;r(y,"UNEXPECTED_TOKEN",b);const w=y.source;w&&typeof w=="string"&&(h+=w.length)}}}return{mode:o,indent:a,chomp:c,comment:p,length:h}}function QG(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 JG(e,t,n){const{offset:r,type:s,source:o,end:a}=e;let c,d;const f=(g,y,b)=>n(r+g,y,b);switch(s){case"scalar":c=Le.PLAIN,d=ZG(o,f);break;case"single-quoted-scalar":c=Le.QUOTE_SINGLE,d=eY(o,f);break;case"double-quoted-scalar":c=Le.QUOTE_DOUBLE,d=tY(o,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const p=r+o.length,h=mc(a,p,t,n);return{value:d,type:c,comment:h.comment,range:[r,p,h.offset]}}function ZG(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}`),KP(e)}function eY(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),KP(e.slice(1,-1)).replace(/''/g,"'")}function KP(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
780
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
781
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],o=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?o===`
|
|
782
|
+
`?s+=o:o=`
|
|
783
|
+
`:(s+=o+r[1],o=" "),a=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),s+o+((r==null?void 0:r[1])??"")}function tY(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
|
|
784
|
+
`))if(s===`
|
|
785
|
+
`){const{fold:o,offset:a}=nY(e,r);n+=o,r=a}else if(s==="\\"){let o=e[++r];const a=rY[o];if(a)n+=a;else if(o===`
|
|
786
|
+
`)for(o=e[r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="\r"&&e[r+1]===`
|
|
787
|
+
`)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+=sY(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(s===" "||s===" "){const o=r;let a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
|
|
788
|
+
`&&!(a==="\r"&&e[r+2]===`
|
|
789
|
+
`)&&(n+=r>o?e.slice(o,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function nY(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
790
|
+
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
791
|
+
`);)r===`
|
|
792
|
+
`&&(n+=`
|
|
793
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const rY={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
794
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function sY(e,t,n,r){const s=e.substr(t,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(a)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(a)}function GP(e,t,n,r){const{value:s,type:o,comment:a,range:c}=t.type==="block-scalar"?YG(e,t,r):JG(t,e.options.strict,r),d=n?e.directives.tagName(n.source,h=>r(n,"TAG_RESOLVE_FAILED",h)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[Hr]:d?f=oY(e.schema,s,d,n,r):t.type==="scalar"?f=iY(e,s,t,r):f=e.schema[Hr];let p;try{const h=f.resolve(s,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);p=et(h)?h:new Le(h)}catch(h){const g=h instanceof Error?h.message:String(h);r(n??t,"TAG_RESOLVE_FAILED",g),p=new Le(s)}return p.range=c,p.source=s,o&&(p.type=o),d&&(p.tag=d),f.format&&(p.format=f.format),a&&(p.comment=a),p}function oY(e,t,n,r,s){var c;if(n==="!")return e[Hr];const o=[];for(const d of e.tags)if(!d.collection&&d.tag===n)if(d.default&&d.test)o.push(d);else return d;for(const d of o)if((c=d.test)!=null&&c.test(t))return d;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Hr])}function iY({atKey:e,directives:t,schema:n},r,s,o){const a=n.tags.find(c=>{var d;return(c.default===!0||e&&c.default==="key")&&((d=c.test)==null?void 0:d.test(r))})||n[Hr];if(n.compat){const c=n.compat.find(d=>{var f;return d.default&&((f=d.test)==null?void 0:f.test(r))})??n[Hr];if(a.tag!==c.tag){const d=t.tagString(a.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;o(s,"TAG_RESOLVE_FAILED",p,!0)}}return a}function aY(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const lY={composeNode:YP,composeEmptyNode:Zw};function YP(e,t,n,r){const s=e.atKey,{spaceBefore:o,comment:a,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=cY(e,t,r),(c||d)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=GP(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=GG(lY,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const h=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",h),f=Zw(e,t.offset,void 0,null,n,r),p=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!et(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(f.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?f.comment=a:f.commentBefore=a),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function Zw(e,t,n,r,{spaceBefore:s,comment:o,anchor:a,tag:c,end:d},f){const p={type:"scalar",offset:aY(t,n,r),indent:-1,source:""},h=GP(e,p,c,f);return a&&(h.anchor=a.source.substring(1),h.anchor===""&&f(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(h.spaceBefore=!0),o&&(h.comment=o,h.range[2]=d),h}function cY({options:e},{offset:t,source:n,end:r},s){const o=new qw(n.substring(1));o.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,c=mc(r,a,e.strict,s);return o.range=[t,a,c.offset],c.comment&&(o.comment=c.comment),o}function uY(e,t,{offset:n,start:r,value:s,end:o},a){const c=Object.assign({_directives:t},e),d=new pc(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=ra(r,{indicator:"doc-start",next:s??(o==null?void 0:o[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!p.hasNewline&&a(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=s?YP(f,s,p,a):Zw(f,p.end,r,null,p,a);const h=d.contents.range[2],g=mc(o,h,!1,a);return g.comment&&(d.comment=g.comment),d.range=[n,h,g.offset],d}function ll(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 wC(e){var s;let t="",n=!1,r=!1;for(let o=0;o<e.length;++o){const a=e[o];switch(a[0]){case"#":t+=(t===""?"":r?`
|
|
795
|
+
|
|
796
|
+
`:`
|
|
797
|
+
`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[o+1])==null?void 0:s[0])!=="#"&&(o+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class dY{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,o)=>{const a=ll(n);o?this.warnings.push(new HG(a,r,s)):this.errors.push(new pl(a,r,s))},this.directives=new rn({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=wC(this.prelude);if(r){const o=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
798
|
+
${r}`:r;else if(s||t.directives.docStart||!o)t.commentBefore=r;else if(yt(o)&&!o.flow&&o.items.length>0){let a=o.items[0];vt(a)&&(a=a.key);const c=a.commentBefore;a.commentBefore=c?`${r}
|
|
799
|
+
${c}`:r}else{const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
800
|
+
${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:wC(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const o=ll(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=uY(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 pl(ll(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 pl(ll(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=mc(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}
|
|
801
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new pl(ll(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new pc(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const XP="\uFEFF",QP="",JP="",Rb="";function fY(e){switch(e){case XP:return"byte-order-mark";case QP:return"doc-mode";case JP:return"flow-error-end";case Rb:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
802
|
+
`:case`\r
|
|
803
|
+
`: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 sr(e){switch(e){case void 0:case" ":case`
|
|
804
|
+
`:case"\r":case" ":return!0;default:return!1}}const kC=new Set("0123456789ABCDEFabcdef"),hY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),td=new Set(",[]{}"),pY=new Set(` ,[]{}
|
|
805
|
+
\r `),Tm=e=>!e||pY.has(e);class mY{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===`
|
|
806
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
807
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===`
|
|
808
|
+
`||!s&&!this.atEnd)return t+r+1}return n===`
|
|
809
|
+
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&sr(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(`
|
|
810
|
+
`,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]===XP&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const o=t[r-1];if(o===" "||o===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const o=t[n-1];if(o===" "||o===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield QP,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==="...")&&sr(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&&!sr(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===":")&&sr(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(Tm),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&sr(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield JP,yield*this.parseLineStart();let o=0;for(;s[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),s[o]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Tm),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||sr(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
|
|
811
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){const o=this.continueScalar(s+1);if(o===-1)break;s=r.indexOf(`
|
|
812
|
+
`,o)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>sr(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`
|
|
813
|
+
`:t=o,n=0;break;case"\r":{const a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
814
|
+
`)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(`
|
|
815
|
+
`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
816
|
+
`;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let o=t-1,a=this.buffer[o];a==="\r"&&(a=this.buffer[--o]);const c=o;for(;a===" ";)a=this.buffer[--o];if(a===`
|
|
817
|
+
`&&o>=this.pos&&o+1+n>c)t=o;else break}while(!0);return yield Rb,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const o=this.buffer[r+1];if(sr(o)||t&&td.has(o))break;n=r}else if(sr(s)){let o=this.buffer[r+1];if(s==="\r"&&(o===`
|
|
818
|
+
`?(r+=1,s=`
|
|
819
|
+
`,o=this.buffer[r+1]):n=r),o==="#"||t&&td.has(o))break;if(s===`
|
|
820
|
+
`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&td.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Rb,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(Tm))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(sr(n)||t&&td.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(;!sr(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(hY.has(n))n=this.buffer[++t];else if(n==="%"&&kC.has(this.buffer[t+1])&&kC.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===`
|
|
821
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
822
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class gY{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const o=n+r>>1;this.lineStarts[o]<t?n=o+1:r=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function Ws(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function NC(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 ZP(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 nd(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 Ai(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 SC(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ws(t.start,"explicit-key-ind")&&!Ws(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,ZP(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 yY{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 mY,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=fY(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"&&SC(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&NC(s.start)===-1&&(n.indent===0||s.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{NC(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=nd(this.peek(2)),r=Ai(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
823
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
824
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,o=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(o&&n.sep&&!n.value){const c=[];for(let d=0;d<n.sep.length;++d){const f=n.sep[d];switch(f.type){case"newline":c.push(d);break;case"space":break;case"comment":f.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(a=n.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":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(Ws(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(ZP(n.key)&&!Ws(n.sep,"newline")){const c=Ai(n.start),d=n.key,f=n.sep;f.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:d,sep:f}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ws(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=Ai(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]}):Ws(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&&!Ws(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:a});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ws(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=nd(r),o=Ai(s);SC(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(`
|
|
825
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
826
|
+
`,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=nd(t),r=Ai(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=nd(t),r=Ai(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 xY(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new gY||null,prettyErrors:t}}function vY(e,t={}){const{lineCounter:n,prettyErrors:r}=xY(t),s=new yY(n==null?void 0:n.addNewLine),o=new dY(t);let a=null;for(const c of o.compose(s.parse(e),!0,e.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new pl(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(vC(e,n)),a.warnings.forEach(vC(e,n))),a}function e4(e,t,n){let r;const s=vY(e,n);if(!s)return null;if(s.warnings.forEach(o=>_P(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function Hd(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return uc(e)&&!r?e.toString(n):new pc(e,r,n).toString(n)}function bY({value:e,onChange:t}){const[n,r]=E.useState(""),[s,o]=E.useState(null),[a,c]=E.useState(!0);E.useEffect(()=>{try{const f=Hd(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 d=f=>{if(f){r(f);try{const p=e4(f);if(!p.id)throw new Error("Step ID is required");if(!p.action&&!p.workflow)throw new Error("Either action or workflow is required");o(null),c(!0),t(p)}catch(p){o(p instanceof Error?p.message:"Invalid YAML"),c(!1)}}};return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"flex items-center gap-2",children:a?u.jsxs("span",{className:"flex items-center gap-1 text-xs text-success",children:[u.jsx(Js,{className:"w-3 h-3"}),"Valid YAML"]}):u.jsxs("span",{className:"flex items-center gap-1 text-xs text-error",children:[u.jsx(zo,{className:"w-3 h-3"}),s]})}),u.jsxs("span",{className:"text-xs text-gray-500",children:[n.split(`
|
|
827
|
+
`).length," lines"]})]}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(Cl,{height:"400px",language:"yaml",value:n,onChange:d,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})}),u.jsx("div",{className:"text-xs text-gray-500",children:u.jsx("p",{children:"Edit the step configuration directly in YAML format. Changes are applied automatically when valid."})})]})}function wY({value:e,title:t}){const[n,r]=E.useState("");return E.useEffect(()=>{try{const s=Hd(e,{indent:2,lineWidth:0});r(s)}catch{r("# Failed to serialize value")}},[e]),u.jsxs("div",{className:"space-y-2",children:[t&&u.jsx("h4",{className:"text-sm font-medium text-gray-300",children:t}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(Cl,{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 kY({inputs:e,onChange:t,availableVariables:n}){const[r,s]=E.useState(""),o=Object.entries(e),a=(h,g)=>{t({...e,[h]:g})},c=h=>{const g={...e};delete g[h],t(g)},d=()=>{r&&!e.hasOwnProperty(r)&&(t({...e,[r]:""}),s(""))},f=(h,g)=>{if(g&&g!==h&&!e.hasOwnProperty(g)){const y={};for(const[b,w]of Object.entries(e))b===h?y[g]=w:y[b]=w;t(y)}},p=(h,g)=>{const y=String(e[h]||"");a(h,y+`{{ ${g} }}`)};return u.jsxs("div",{className:"space-y-4",children:[o.length===0?u.jsx("div",{className:"text-center py-8",children:u.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No inputs defined"})}):u.jsx("div",{className:"space-y-3",children:o.map(([h,g])=>u.jsx(NY,{inputKey:h,value:g,onChange:y=>a(h,y),onRemove:()=>c(h),onRename:y=>f(h,y),availableVariables:n,onInsertVariable:y=>p(h,y)},h))}),u.jsxs("div",{className:"flex gap-2 pt-2 border-t border-node-border",children:[u.jsx("input",{type:"text",value:r,onChange:h=>s(h.target.value),placeholder:"New input key...",className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",onKeyDown:h=>{h.key==="Enter"&&d()}}),u.jsx(Ve,{variant:"secondary",size:"sm",onClick:d,disabled:!r||e.hasOwnProperty(r),icon:u.jsx(df,{className:"w-4 h-4"}),children:"Add"})]}),n.length>0&&u.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(sc,{className:"w-4 h-4 text-primary"}),u.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Available Variables"})]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(h=>u.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded",children:h},h))}),u.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Click on an input field, then use the variable button to insert"})]})]})}function NY({inputKey:e,value:t,onChange:n,onRemove:r,onRename:s,availableVariables:o,onInsertVariable:a}){const[c,d]=E.useState(!1),[f,p]=E.useState(e),[h,g]=E.useState(!1),y=typeof t,b=y==="object"&&t!==null,w=Array.isArray(t),v=()=>{f!==e&&s(f),d(!1)},k=()=>w||b?u.jsx("textarea",{value:JSON.stringify(t,null,2),onChange:_=>{try{n(JSON.parse(_.target.value))}catch{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}):y==="boolean"?u.jsxs("select",{value:String(t),onChange:_=>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:[u.jsx("option",{value:"true",children:"true"}),u.jsx("option",{value:"false",children:"false"})]}):y==="number"?u.jsx("input",{type:"number",value:String(t),onChange:_=>n(parseFloat(_.target.value)||0),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary"}):u.jsx(SY,{value:String(t),onChange:_=>n(_),variables:o,placeholder:"Value or {{ variable }}"});return u.jsxs("div",{className:"p-3 bg-node-bg/50 rounded-lg border border-node-border space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[c?u.jsx("input",{type:"text",value:f,onChange:_=>p(_.target.value),onBlur:v,onKeyDown:_=>{_.key==="Enter"&&v(),_.key==="Escape"&&(p(e),d(!1))},className:"flex-1 px-2 py-1 bg-node-bg border border-primary rounded text-white text-sm font-mono focus:outline-none",autoFocus:!0}):u.jsx("button",{onClick:()=>d(!0),className:"flex-1 text-left px-2 py-1 text-sm font-mono text-primary hover:bg-white/5 rounded",children:e}),u.jsx("span",{className:"text-xs text-gray-500",children:y}),u.jsx(Ve,{variant:"ghost",size:"sm",onClick:r,className:"!p-1 text-gray-400 hover:text-error",children:u.jsx(oa,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"flex gap-2",children:[k(),o.length>0&&!w&&!b&&u.jsxs("div",{className:"relative",children:[u.jsx(Ve,{variant:"ghost",size:"sm",onClick:()=>g(!h),className:"!p-2",children:u.jsx(sc,{className:"w-4 h-4"})}),h&&u.jsxs("div",{className:"absolute right-0 top-full mt-1 z-10 p-2 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[150px]",children:[u.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Insert variable"}),u.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:o.map(_=>u.jsx("button",{onClick:()=>{a(_),g(!1)},className:"w-full text-left px-2 py-1 text-xs font-mono text-primary hover:bg-white/10 rounded",children:_},_))})]})]})]})]})}function SY({value:e,onChange:t,variables:n,placeholder:r}){const[s,o]=E.useState(!1),[a,c]=E.useState(0),[d,f]=E.useState(0),p=E.useRef(null),g=(()=>{const N=e.substring(0,a),S=N.lastIndexOf("{{");if(S===-1)return null;const A=N.substring(S);return A.includes("}}")?null:{text:A.substring(2).trim(),start:S,end:a}})(),y=g?n.filter(N=>N.toLowerCase().includes(g.text.toLowerCase())):[],b=s&&g&&y.length>0,w=N=>{t(N.target.value),c(N.target.selectionStart||0),o(!0),f(0)},v=N=>{const S=N.target;c(S.selectionStart||0)},k=N=>{if(b)switch(N.key){case"ArrowDown":N.preventDefault(),f(S=>S<y.length-1?S+1:0);break;case"ArrowUp":N.preventDefault(),f(S=>S>0?S-1:y.length-1);break;case"Enter":case"Tab":N.preventDefault(),_(y[d]);break;case"Escape":o(!1);break}},_=N=>{if(!g)return;const S=e.substring(0,g.start),A=e.substring(g.end),I=`${S}{{ ${N} }}${A}`;t(I),o(!1),setTimeout(()=>{if(p.current){const T=g.start+N.length+6;p.current.setSelectionRange(T,T),p.current.focus()}},0)};return E.useEffect(()=>{const N=()=>o(!1);return document.addEventListener("click",N),()=>document.removeEventListener("click",N)},[]),u.jsxs("div",{className:"relative flex-1",children:[u.jsx("input",{ref:p,type:"text",value:e,onChange:w,onSelect:v,onKeyDown:k,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&&u.jsxs("div",{className:"absolute left-0 top-full mt-1 z-20 p-1 bg-panel-bg border border-node-border rounded-lg shadow-lg min-w-[200px] max-h-[200px] overflow-y-auto",onClick:N=>N.stopPropagation(),children:[u.jsxs("div",{className:"text-xs text-gray-500 px-2 py-1 mb-1",children:['Variables matching "',(g==null?void 0:g.text)||"",'"']}),y.map((N,S)=>u.jsxs("button",{onClick:()=>_(N),className:`w-full text-left px-2 py-1.5 text-xs font-mono rounded flex items-center gap-2 ${S===d?"bg-primary/20 text-primary":"text-gray-300 hover:bg-white/5"}`,children:[u.jsx(sc,{className:"w-3 h-3"}),N]},N)),u.jsx("div",{className:"text-xs text-gray-600 px-2 pt-1 border-t border-node-border mt-1",children:"↑↓ to navigate, Enter to select"})]})]})}function CC(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 CY(e,t){const n=e.find(r=>r.field===t);return n==null?void 0:n.message}function _Y({open:e,onOpenChange:t,step:n,onSave:r,availableVariables:s}){const[o,a]=E.useState(null),[c,d]=E.useState("properties"),[f,p]=E.useState([]),[h,g]=E.useState(!1);if(E.useEffect(()=>{n&&(a({...n}),d("properties"),p([]),g(!1))},[n]),E.useMemo(()=>o?CC(o):{valid:!0,errors:[]},[o]),!o)return null;const y=()=>{if(!o)return;const v=CC(o);if(p(v.errors),g(!0),v.valid)r(o),t(!1);else{const k=v.errors[0];k&&(k.field==="id"||k.field==="action"||k.field==="workflow"||k.field==="timeout"?d("properties"):k.field==="outputVariable"?d("output"):k.field.startsWith("errorHandling")?d("errors"):k.field.startsWith("conditions")&&d("conditions"))}},b=v=>{a(k=>k?{...k,...v}:null)},w=v=>{if(h)return CY(f,v)};return u.jsxs(hs,{open:e,onOpenChange:t,title:`Edit Step: ${o.name||o.id}`,description:o.action||o.workflow||"Configure step settings",size:"xl",children:[u.jsxs(lP,{value:c,onValueChange:d,children:[u.jsxs($w,{children:[u.jsxs(Tr,{value:"properties",children:[u.jsx(Ji,{className:"w-4 h-4 mr-1.5"}),"Properties"]}),u.jsxs(Tr,{value:"inputs",children:[u.jsx(p9,{className:"w-4 h-4 mr-1.5"}),"Inputs"]}),u.jsxs(Tr,{value:"output",children:[u.jsx(m9,{className:"w-4 h-4 mr-1.5"}),"Output"]}),u.jsxs(Tr,{value:"errors",children:[u.jsx(rc,{className:"w-4 h-4 mr-1.5"}),"Errors"]}),u.jsxs(Tr,{value:"conditions",children:[u.jsx(cR,{className:"w-4 h-4 mr-1.5"}),"Conditions"]}),u.jsxs(Tr,{value:"yaml",children:[u.jsx(mw,{className:"w-4 h-4 mr-1.5"}),"YAML"]})]}),u.jsxs("div",{className:"p-4",children:[u.jsx(Ir,{value:"properties",children:u.jsx(EY,{step:o,onChange:b,getError:w})}),u.jsx(Ir,{value:"inputs",children:u.jsx(kY,{inputs:o.inputs,onChange:v=>b({inputs:v}),availableVariables:s})}),u.jsx(Ir,{value:"output",children:u.jsx(jY,{step:o,onChange:b})}),u.jsx(Ir,{value:"errors",children:u.jsx(AY,{step:o,onChange:b})}),u.jsx(Ir,{value:"conditions",children:u.jsx(TY,{step:o,onChange:b,availableVariables:s})}),u.jsx(Ir,{value:"yaml",children:u.jsx(bY,{value:o,onChange:v=>a(v)})})]})]}),u.jsxs(Bo,{children:[h&&f.length>0&&u.jsxs("div",{className:"flex-1 flex items-center gap-2 text-error text-sm",children:[u.jsx(zo,{className:"w-4 h-4 flex-shrink-0"}),u.jsxs("span",{children:[f.length," validation error",f.length>1?"s":""]})]}),u.jsx(Ve,{variant:"secondary",onClick:()=>t(!1),children:"Cancel"}),u.jsx(Ve,{onClick:y,children:"Save Changes"})]})]})}function EY({step:e,onChange:t,getError:n}){const r=n("id"),s=n("action"),o=n("workflow"),a=n("timeout");return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Step ID ",u.jsx("span",{className:"text-error",children:"*"})]}),u.jsx("input",{type:"text",value:e.id,onChange:c=>t({id:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${r?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"unique-step-id"}),r?u.jsx("p",{className:"mt-1 text-xs text-error",children:r}):u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Unique identifier for this step"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name"}),u.jsx("input",{type:"text",value:e.name||"",onChange:c=>t({name:c.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:["Action ",!e.workflow&&u.jsx("span",{className:"text-error",children:"*"})]}),u.jsx("input",{type:"text",value:e.action||"",onChange:c=>t({action:c.target.value||void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${s?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"service.method (e.g., slack.chat.postMessage)"}),s?u.jsx("p",{className:"mt-1 text-xs text-error",children:s}):u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Format: service.method or service.namespace.method"})]}),e.workflow&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Sub-workflow Path"}),u.jsx("input",{type:"text",value:e.workflow,onChange:c=>t({workflow:c.target.value}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm font-mono focus:outline-none ${o?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"./path/to/workflow.md"}),o&&u.jsx("p",{className:"mt-1 text-xs text-error",children:o})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Timeout (seconds)"}),u.jsx("input",{type:"number",value:e.timeout||"",onChange:c=>t({timeout:c.target.value?parseInt(c.target.value,10):void 0}),className:`w-full px-3 py-2 bg-node-bg border rounded-lg text-white text-sm focus:outline-none ${a?"border-error focus:border-error":"border-node-border focus:border-primary"}`,placeholder:"30",min:"1"}),a&&u.jsx("p",{className:"mt-1 text-xs text-error",children:a})]})]})}function jY({step:e,onChange:t}){return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Output Variable"}),u.jsx("input",{type:"text",value:e.outputVariable||"",onChange:n=>t({outputVariable:n.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"result_variable"}),u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Store the step output in this variable for use in subsequent steps"})]}),u.jsxs("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:[u.jsx("h4",{className:"text-sm font-medium text-gray-300 mb-2",children:"Usage Example"}),u.jsx("code",{className:"text-xs text-primary font-mono",children:"{{ "+(e.outputVariable||"variable_name")+" }}"}),u.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use this syntax in subsequent steps to reference the output"})]})]})}function AY({step:e,onChange:t}){const n=e.errorHandling||{action:"stop"},r=s=>{t({errorHandling:{...n,...s}})};return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Error Action"}),u.jsxs("select",{value:n.action,onChange:s=>r({action:s.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",children:[u.jsx("option",{value:"stop",children:"Stop workflow on error"}),u.jsx("option",{value:"continue",children:"Continue to next step"}),u.jsx("option",{value:"retry",children:"Retry with backoff"})]})]}),n.action==="retry"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Max Retries"}),u.jsx("input",{type:"number",value:n.maxRetries||3,onChange:s=>r({maxRetries:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"1",max:"10"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Retry Delay (ms)"}),u.jsx("input",{type:"number",value:n.retryDelay||1e3,onChange:s=>r({retryDelay:parseInt(s.target.value,10)}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",min:"100",step:"100"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Fallback Step (optional)"}),u.jsx("input",{type:"text",value:n.fallbackStep||"",onChange:s=>r({fallbackStep:s.target.value||void 0}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"fallback-step-id"}),u.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Jump to this step if the error action fails"})]})]})}function TY({step:e,onChange:t,availableVariables:n}){const r=e.conditions||[],s=()=>{t({conditions:[...r,""]})},o=(c,d)=>{const f=[...r];f[c]=d,t({conditions:f})},a=c=>{const d=r.filter((f,p)=>p!==c);t({conditions:d.length>0?d:void 0})};return u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-gray-400",children:"This step will only execute if all conditions evaluate to true."}),r.length===0?u.jsxs("div",{className:"text-center py-8",children:[u.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No conditions defined"}),u.jsx(Ve,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}):u.jsxs("div",{className:"space-y-3",children:[r.map((c,d)=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{type:"text",value:c,onChange:f=>o(d,f.target.value),className:"flex-1 px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"{{ variable }} === 'value'"}),u.jsx(Ve,{variant:"ghost",size:"sm",onClick:()=>a(d),children:"×"})]},d)),u.jsx(Ve,{variant:"secondary",size:"sm",onClick:s,children:"Add Condition"})]}),n.length>0&&u.jsxs("div",{className:"mt-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[u.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:"Available Variables"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(c=>u.jsx("code",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded cursor-pointer hover:bg-primary/20",onClick:()=>{navigator.clipboard.writeText(`{{ ${c} }}`)},children:c},c))})]})]})}var Ob=["Enter"," "],IY=["ArrowDown","PageUp","Home"],t4=["ArrowUp","PageDown","End"],MY=[...IY,...t4],RY={ltr:[...Ob,"ArrowRight"],rtl:[...Ob,"ArrowLeft"]},OY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},gc="Menu",[Kl,PY,LY]=qO(gc),[Uo,n4]=no(gc,[LY,yf,Sf]),Pf=yf(),r4=Sf(),[DY,Wo]=Uo(gc),[$Y,yc]=Uo(gc),s4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=Pf(t),[d,f]=E.useState(null),p=E.useRef(!1),h=zr(o),g=Lw(s);return E.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),u.jsx(tO,{...c,children:u.jsx(DY,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:f,children:u.jsx($Y,{scope:t,onClose:E.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:g,modal:a,children:r})})})};s4.displayName=gc;var FY="MenuAnchor",e1=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Pf(n);return u.jsx(nO,{...s,...r,ref:t})});e1.displayName=FY;var t1="MenuPortal",[BY,o4]=Uo(t1,{forceMount:void 0}),i4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Wo(t1,t);return u.jsx(BY,{scope:t,forceMount:n,children:u.jsx(yr,{present:n||o.open,children:u.jsx(xf,{asChild:!0,container:s,children:r})})})};i4.displayName=t1;var Un="MenuContent",[qY,n1]=Uo(Un),a4=E.forwardRef((e,t)=>{const n=o4(Un,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Wo(Un,e.__scopeMenu),a=yc(Un,e.__scopeMenu);return u.jsx(Kl.Provider,{scope:e.__scopeMenu,children:u.jsx(yr,{present:r||o.open,children:u.jsx(Kl.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(zY,{...s,ref:t}):u.jsx(VY,{...s,ref:t})})})})}),zY=E.forwardRef((e,t)=>{const n=Wo(Un,e.__scopeMenu),r=E.useRef(null),s=It(t,r);return E.useEffect(()=>{const o=r.current;if(o)return CO(o)},[]),u.jsx(r1,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),VY=E.forwardRef((e,t)=>{const n=Wo(Un,e.__scopeMenu);return u.jsx(r1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),HY=Bl("MenuContent.ScrollLock"),r1=E.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:g,onDismiss:y,disableOutsideScroll:b,...w}=e,v=Wo(Un,n),k=yc(Un,n),_=Pf(n),N=r4(n),S=PY(n),[A,I]=E.useState(null),T=E.useRef(null),O=It(t,T,v.onContentChange),L=E.useRef(0),z=E.useRef(""),M=E.useRef(0),P=E.useRef(null),H=E.useRef("right"),D=E.useRef(0),V=b?Mw:E.Fragment,$=b?{as:HY,allowPinchZoom:!0}:void 0,U=q=>{var ne,te;const Y=z.current+q,F=S().filter(ie=>!ie.disabled),K=document.activeElement,ee=(ne=F.find(ie=>ie.ref.current===K))==null?void 0:ne.textValue,W=F.map(ie=>ie.textValue),X=nX(W,Y,ee),Z=(te=F.find(ie=>ie.textValue===X))==null?void 0:te.ref.current;(function ie(he){z.current=he,window.clearTimeout(L.current),he!==""&&(L.current=window.setTimeout(()=>ie(""),1e3))})(Y),Z&&setTimeout(()=>Z.focus())};E.useEffect(()=>()=>window.clearTimeout(L.current),[]),gO();const B=E.useCallback(q=>{var F,K;return H.current===((F=P.current)==null?void 0:F.side)&&sX(q,(K=P.current)==null?void 0:K.area)},[]);return u.jsx(qY,{scope:n,searchRef:z,onItemEnter:E.useCallback(q=>{B(q)&&q.preventDefault()},[B]),onItemLeave:E.useCallback(q=>{var Y;B(q)||((Y=T.current)==null||Y.focus(),I(null))},[B]),onTriggerLeave:E.useCallback(q=>{B(q)&&q.preventDefault()},[B]),pointerGraceTimerRef:M,onPointerGraceIntentChange:E.useCallback(q=>{P.current=q},[]),children:u.jsx(V,{...$,children:u.jsx(Iw,{asChild:!0,trapped:s,onMountAutoFocus:Me(o,q=>{var Y;q.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(ff,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:g,onDismiss:y,children:u.jsx(KO,{asChild:!0,...N,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:I,onEntryFocus:Me(d,q=>{k.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(rO,{role:"menu","aria-orientation":"vertical","data-state":N4(v.open),"data-radix-menu-content":"",dir:k.dir,..._,...w,ref:O,style:{outline:"none",...w.style},onKeyDown:Me(w.onKeyDown,q=>{const F=q.target.closest("[data-radix-menu-content]")===q.currentTarget,K=q.ctrlKey||q.altKey||q.metaKey,ee=q.key.length===1;F&&(q.key==="Tab"&&q.preventDefault(),!K&&ee&&U(q.key));const W=T.current;if(q.target!==W||!MY.includes(q.key))return;q.preventDefault();const Z=S().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);t4.includes(q.key)&&Z.reverse(),eX(Z)}),onBlur:Me(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(L.current),z.current="")}),onPointerMove:Me(e.onPointerMove,Gl(q=>{const Y=q.target,F=D.current!==q.clientX;if(q.currentTarget.contains(Y)&&F){const K=q.clientX>D.current?"right":"left";H.current=K,D.current=q.clientX}}))})})})})})})});a4.displayName=Un;var UY="MenuGroup",s1=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(tt.div,{role:"group",...r,ref:t})});s1.displayName=UY;var WY="MenuLabel",l4=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(tt.div,{...r,ref:t})});l4.displayName=WY;var Ud="MenuItem",_C="menu.itemSelect",Lf=E.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=E.useRef(null),a=yc(Ud,e.__scopeMenu),c=n1(Ud,e.__scopeMenu),d=It(t,o),f=E.useRef(!1),p=()=>{const h=o.current;if(!n&&h){const g=new CustomEvent(_C,{bubbles:!0,cancelable:!0});h.addEventListener(_C,y=>r==null?void 0:r(y),{once:!0}),IR(h,g),g.defaultPrevented?f.current=!1:a.onClose()}};return u.jsx(c4,{...s,ref:d,disabled:n,onClick:Me(e.onClick,p),onPointerDown:h=>{var g;(g=e.onPointerDown)==null||g.call(e,h),f.current=!0},onPointerUp:Me(e.onPointerUp,h=>{var g;f.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:Me(e.onKeyDown,h=>{const g=c.searchRef.current!=="";n||g&&h.key===" "||Ob.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Lf.displayName=Ud;var c4=E.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=n1(Ud,n),c=r4(n),d=E.useRef(null),f=It(t,d),[p,h]=E.useState(!1),[g,y]=E.useState("");return E.useEffect(()=>{const b=d.current;b&&y((b.textContent??"").trim())},[o.children]),u.jsx(Kl.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:u.jsx(GO,{asChild:!0,...c,focusable:!r,children:u.jsx(tt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Me(e.onPointerMove,Gl(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Me(e.onPointerLeave,Gl(b=>a.onItemLeave(b))),onFocus:Me(e.onFocus,()=>h(!0)),onBlur:Me(e.onBlur,()=>h(!1))})})})}),KY="MenuCheckboxItem",u4=E.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return u.jsx(m4,{scope:e.__scopeMenu,checked:n,children:u.jsx(Lf,{role:"menuitemcheckbox","aria-checked":Wd(n)?"mixed":n,...s,ref:t,"data-state":i1(n),onSelect:Me(s.onSelect,()=>r==null?void 0:r(Wd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});u4.displayName=KY;var d4="MenuRadioGroup",[GY,YY]=Uo(d4,{value:void 0,onValueChange:()=>{}}),f4=E.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=zr(r);return u.jsx(GY,{scope:e.__scopeMenu,value:n,onValueChange:o,children:u.jsx(s1,{...s,ref:t})})});f4.displayName=d4;var h4="MenuRadioItem",p4=E.forwardRef((e,t)=>{const{value:n,...r}=e,s=YY(h4,e.__scopeMenu),o=n===s.value;return u.jsx(m4,{scope:e.__scopeMenu,checked:o,children:u.jsx(Lf,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":i1(o),onSelect:Me(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});p4.displayName=h4;var o1="MenuItemIndicator",[m4,XY]=Uo(o1,{checked:!1}),g4=E.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=XY(o1,n);return u.jsx(yr,{present:r||Wd(o.checked)||o.checked===!0,children:u.jsx(tt.span,{...s,ref:t,"data-state":i1(o.checked)})})});g4.displayName=o1;var QY="MenuSeparator",y4=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(tt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});y4.displayName=QY;var JY="MenuArrow",x4=E.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Pf(n);return u.jsx(sO,{...s,...r,ref:t})});x4.displayName=JY;var ZY="MenuSub",[yre,v4]=Uo(ZY),ml="MenuSubTrigger",b4=E.forwardRef((e,t)=>{const n=Wo(ml,e.__scopeMenu),r=yc(ml,e.__scopeMenu),s=v4(ml,e.__scopeMenu),o=n1(ml,e.__scopeMenu),a=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},p=E.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return E.useEffect(()=>p,[p]),E.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),d(null)}},[c,d]),u.jsx(e1,{asChild:!0,...f,children:u.jsx(c4,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":N4(n.open),...e,ref:vw(t,s.onTriggerChange),onClick:h=>{var g;(g=e.onClick)==null||g.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,Gl(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Me(e.onPointerLeave,Gl(h=>{var y,b;p();const g=(y=n.content)==null?void 0:y.getBoundingClientRect();if(g){const w=(b=n.content)==null?void 0:b.dataset.side,v=w==="right",k=v?-5:5,_=g[v?"left":"right"],N=g[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+k,y:h.clientY},{x:_,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:_,y:g.bottom}],side:w}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,h=>{var y;const g=o.searchRef.current!=="";e.disabled||g&&h.key===" "||RY[r.dir].includes(h.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),h.preventDefault())})})})});b4.displayName=ml;var w4="MenuSubContent",k4=E.forwardRef((e,t)=>{const n=o4(Un,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Wo(Un,e.__scopeMenu),a=yc(Un,e.__scopeMenu),c=v4(w4,e.__scopeMenu),d=E.useRef(null),f=It(t,d);return u.jsx(Kl.Provider,{scope:e.__scopeMenu,children:u.jsx(yr,{present:r||o.open,children:u.jsx(Kl.Slot,{scope:e.__scopeMenu,children:u.jsx(r1,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:f,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var h;a.isUsingKeyboardRef.current&&((h=d.current)==null||h.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Me(e.onFocusOutside,p=>{p.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Me(e.onKeyDown,p=>{var y;const h=p.currentTarget.contains(p.target),g=OY[a.dir].includes(p.key);h&&g&&(o.onOpenChange(!1),(y=c.trigger)==null||y.focus(),p.preventDefault())})})})})})});k4.displayName=w4;function N4(e){return e?"open":"closed"}function Wd(e){return e==="indeterminate"}function i1(e){return Wd(e)?"indeterminate":e?"checked":"unchecked"}function eX(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function tX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function nX(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=tX(e,Math.max(o,0));s.length===1&&(a=a.filter(f=>f!==n));const d=a.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function rX(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,g=d.y;p>r!=g>r&&n<(h-f)*(r-p)/(g-p)+f&&(s=!s)}return s}function sX(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return rX(n,t)}function Gl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var oX=s4,iX=e1,aX=i4,lX=a4,cX=s1,uX=l4,dX=Lf,fX=u4,hX=f4,pX=p4,mX=g4,gX=y4,yX=x4,xX=b4,vX=k4,a1="ContextMenu",[bX]=no(a1,[n4]),ln=n4(),[wX,S4]=bX(a1),C4=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:o=!0}=e,[a,c]=E.useState(!1),d=ln(t),f=zr(r),p=E.useCallback(h=>{c(h),f(h)},[f]);return u.jsx(wX,{scope:t,open:a,onOpenChange:p,modal:o,children:u.jsx(oX,{...d,dir:s,open:a,onOpenChange:p,modal:o,children:n})})};C4.displayName=a1;var _4="ContextMenuTrigger",E4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,o=S4(_4,n),a=ln(n),c=E.useRef({x:0,y:0}),d=E.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),f=E.useRef(0),p=E.useCallback(()=>window.clearTimeout(f.current),[]),h=g=>{c.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return E.useEffect(()=>p,[p]),E.useEffect(()=>void(r&&p()),[r,p]),u.jsxs(u.Fragment,{children:[u.jsx(iX,{...a,virtualRef:d}),u.jsx(tt.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Me(e.onContextMenu,g=>{p(),h(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Me(e.onPointerDown,rd(g=>{p(),f.current=window.setTimeout(()=>h(g),700)})),onPointerMove:r?e.onPointerMove:Me(e.onPointerMove,rd(p)),onPointerCancel:r?e.onPointerCancel:Me(e.onPointerCancel,rd(p)),onPointerUp:r?e.onPointerUp:Me(e.onPointerUp,rd(p))})]})});E4.displayName=_4;var kX="ContextMenuPortal",j4=e=>{const{__scopeContextMenu:t,...n}=e,r=ln(t);return u.jsx(aX,{...r,...n})};j4.displayName=kX;var A4="ContextMenuContent",T4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=S4(A4,n),o=ln(n),a=E.useRef(!1);return u.jsx(lX,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var d;(d=e.onCloseAutoFocus)==null||d.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var d;(d=e.onInteractOutside)==null||d.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});T4.displayName=A4;var NX="ContextMenuGroup",SX=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(cX,{...s,...r,ref:t})});SX.displayName=NX;var CX="ContextMenuLabel",I4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(uX,{...s,...r,ref:t})});I4.displayName=CX;var _X="ContextMenuItem",M4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(dX,{...s,...r,ref:t})});M4.displayName=_X;var EX="ContextMenuCheckboxItem",R4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(fX,{...s,...r,ref:t})});R4.displayName=EX;var jX="ContextMenuRadioGroup",AX=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(hX,{...s,...r,ref:t})});AX.displayName=jX;var TX="ContextMenuRadioItem",O4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(pX,{...s,...r,ref:t})});O4.displayName=TX;var IX="ContextMenuItemIndicator",P4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(mX,{...s,...r,ref:t})});P4.displayName=IX;var MX="ContextMenuSeparator",L4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(gX,{...s,...r,ref:t})});L4.displayName=MX;var RX="ContextMenuArrow",OX=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(yX,{...s,...r,ref:t})});OX.displayName=RX;var PX="ContextMenuSubTrigger",D4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(xX,{...s,...r,ref:t})});D4.displayName=PX;var LX="ContextMenuSubContent",$4=E.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ln(n);return u.jsx(vX,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$4.displayName=LX;function rd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var DX=C4,$X=E4,FX=j4,F4=T4,B4=I4,q4=M4,z4=R4,V4=O4,H4=P4,U4=L4,W4=D4,K4=$4;const BX=DX,qX=$X,zX=E.forwardRef(({className:e,inset:t,children:n,...r},s)=>u.jsxs(W4,{ref:s,className:Ye("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-white/10 data-[state=open]:bg-white/10",t&&"pl-8",e),...r,children:[n,u.jsx("span",{className:"ml-auto text-xs",children:"▶"})]}));zX.displayName=W4.displayName;const VX=E.forwardRef(({className:e,...t},n)=>u.jsx(K4,{ref:n,className:Ye("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}));VX.displayName=K4.displayName;const G4=E.forwardRef(({className:e,...t},n)=>u.jsx(FX,{children:u.jsx(F4,{ref:n,className:Ye("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})}));G4.displayName=F4.displayName;const Ii=E.forwardRef(({className:e,inset:t,destructive:n,...r},s)=>u.jsx(q4,{ref:s,className:Ye("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}));Ii.displayName=q4.displayName;const HX=E.forwardRef(({className:e,children:t,checked:n,...r},s)=>u.jsxs(z4,{ref:s,className:Ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(H4,{children:u.jsx("span",{className:"text-primary",children:"✓"})})}),t]}));HX.displayName=z4.displayName;const UX=E.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(V4,{ref:r,className:Ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-white/10 focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(H4,{children:u.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));UX.displayName=V4.displayName;const WX=E.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(B4,{ref:r,className:Ye("px-2 py-1.5 text-xs font-semibold text-gray-400",t&&"pl-8",e),...n}));WX.displayName=B4.displayName;const Pb=E.forwardRef(({className:e,...t},n)=>u.jsx(U4,{ref:n,className:Ye("-mx-1 my-1 h-px bg-node-border",e),...t}));Pb.displayName=U4.displayName;const gl=({className:e,...t})=>u.jsx("span",{className:Ye("ml-auto text-xs tracking-widest text-gray-500",e),...t});gl.displayName="ContextMenuShortcut";function l1(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 Im,EC;function KX(){if(EC)return Im;EC=1;function e(){this.__data__=[],this.size=0}return Im=e,Im}var Mm,jC;function ha(){if(jC)return Mm;jC=1;function e(t,n){return t===n||t!==t&&n!==n}return Mm=e,Mm}var Rm,AC;function Df(){if(AC)return Rm;AC=1;var e=ha();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return Rm=t,Rm}var Om,TC;function GX(){if(TC)return Om;TC=1;var e=Df(),t=Array.prototype,n=t.splice;function r(s){var o=this.__data__,a=e(o,s);if(a<0)return!1;var c=o.length-1;return a==c?o.pop():n.call(o,a,1),--this.size,!0}return Om=r,Om}var Pm,IC;function YX(){if(IC)return Pm;IC=1;var e=Df();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return Pm=t,Pm}var Lm,MC;function XX(){if(MC)return Lm;MC=1;var e=Df();function t(n){return e(this.__data__,n)>-1}return Lm=t,Lm}var Dm,RC;function QX(){if(RC)return Dm;RC=1;var e=Df();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return Dm=t,Dm}var $m,OC;function $f(){if(OC)return $m;OC=1;var e=KX(),t=GX(),n=YX(),r=XX(),s=QX();function o(a){var c=-1,d=a==null?0:a.length;for(this.clear();++c<d;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,$m=o,$m}var Fm,PC;function JX(){if(PC)return Fm;PC=1;var e=$f();function t(){this.__data__=new e,this.size=0}return Fm=t,Fm}var Bm,LC;function ZX(){if(LC)return Bm;LC=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Bm=e,Bm}var qm,DC;function eQ(){if(DC)return qm;DC=1;function e(t){return this.__data__.get(t)}return qm=e,qm}var zm,$C;function tQ(){if($C)return zm;$C=1;function e(t){return this.__data__.has(t)}return zm=e,zm}var Vm,FC;function Y4(){if(FC)return Vm;FC=1;var e=typeof Mu=="object"&&Mu&&Mu.Object===Object&Μreturn Vm=e,Vm}var Hm,BC;function br(){if(BC)return Hm;BC=1;var e=Y4(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Hm=n,Hm}var Um,qC;function pa(){if(qC)return Um;qC=1;var e=br(),t=e.Symbol;return Um=t,Um}var Wm,zC;function nQ(){if(zC)return Wm;zC=1;var e=pa(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(a){var c=n.call(a,s),d=a[s];try{a[s]=void 0;var f=!0}catch{}var p=r.call(a);return f&&(c?a[s]=d:delete a[s]),p}return Wm=o,Wm}var Km,VC;function rQ(){if(VC)return Km;VC=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Km=n,Km}var Gm,HC;function Ko(){if(HC)return Gm;HC=1;var e=pa(),t=nQ(),n=rQ(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(c){return c==null?c===void 0?s:r:o&&o in Object(c)?t(c):n(c)}return Gm=a,Gm}var Ym,UC;function Kn(){if(UC)return Ym;UC=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Ym=e,Ym}var Xm,WC;function xc(){if(WC)return Xm;WC=1;var e=Ko(),t=Kn(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(c){if(!t(c))return!1;var d=e(c);return d==r||d==s||d==n||d==o}return Xm=a,Xm}var Qm,KC;function sQ(){if(KC)return Qm;KC=1;var e=br(),t=e["__core-js_shared__"];return Qm=t,Qm}var Jm,GC;function oQ(){if(GC)return Jm;GC=1;var e=sQ(),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 Jm=n,Jm}var Zm,YC;function X4(){if(YC)return Zm;YC=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 Zm=n,Zm}var eg,XC;function iQ(){if(XC)return eg;XC=1;var e=xc(),t=oQ(),n=Kn(),r=X4(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,d=a.toString,f=c.hasOwnProperty,p=RegExp("^"+d.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(g){if(!n(g)||t(g))return!1;var y=e(g)?p:o;return y.test(r(g))}return eg=h,eg}var tg,QC;function aQ(){if(QC)return tg;QC=1;function e(t,n){return t==null?void 0:t[n]}return tg=e,tg}var ng,JC;function Go(){if(JC)return ng;JC=1;var e=iQ(),t=aQ();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return ng=n,ng}var rg,ZC;function c1(){if(ZC)return rg;ZC=1;var e=Go(),t=br(),n=e(t,"Map");return rg=n,rg}var sg,e_;function Ff(){if(e_)return sg;e_=1;var e=Go(),t=e(Object,"create");return sg=t,sg}var og,t_;function lQ(){if(t_)return og;t_=1;var e=Ff();function t(){this.__data__=e?e(null):{},this.size=0}return og=t,og}var ig,n_;function cQ(){if(n_)return ig;n_=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return ig=e,ig}var ag,r_;function uQ(){if(r_)return ag;r_=1;var e=Ff(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(e){var c=a[o];return c===t?void 0:c}return r.call(a,o)?a[o]:void 0}return ag=s,ag}var lg,s_;function dQ(){if(s_)return lg;s_=1;var e=Ff(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return lg=r,lg}var cg,o_;function fQ(){if(o_)return cg;o_=1;var e=Ff(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return cg=n,cg}var ug,i_;function hQ(){if(i_)return ug;i_=1;var e=lQ(),t=cQ(),n=uQ(),r=dQ(),s=fQ();function o(a){var c=-1,d=a==null?0:a.length;for(this.clear();++c<d;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,ug=o,ug}var dg,a_;function pQ(){if(a_)return dg;a_=1;var e=hQ(),t=$f(),n=c1();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return dg=r,dg}var fg,l_;function mQ(){if(l_)return fg;l_=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return fg=e,fg}var hg,c_;function Bf(){if(c_)return hg;c_=1;var e=mQ();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return hg=t,hg}var pg,u_;function gQ(){if(u_)return pg;u_=1;var e=Bf();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return pg=t,pg}var mg,d_;function yQ(){if(d_)return mg;d_=1;var e=Bf();function t(n){return e(this,n).get(n)}return mg=t,mg}var gg,f_;function xQ(){if(f_)return gg;f_=1;var e=Bf();function t(n){return e(this,n).has(n)}return gg=t,gg}var yg,h_;function vQ(){if(h_)return yg;h_=1;var e=Bf();function t(n,r){var s=e(this,n),o=s.size;return s.set(n,r),this.size+=s.size==o?0:1,this}return yg=t,yg}var xg,p_;function u1(){if(p_)return xg;p_=1;var e=pQ(),t=gQ(),n=yQ(),r=xQ(),s=vQ();function o(a){var c=-1,d=a==null?0:a.length;for(this.clear();++c<d;){var f=a[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,xg=o,xg}var vg,m_;function bQ(){if(m_)return vg;m_=1;var e=$f(),t=c1(),n=u1(),r=200;function s(o,a){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([o,a]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(o,a),this.size=c.size,this}return vg=s,vg}var bg,g_;function qf(){if(g_)return bg;g_=1;var e=$f(),t=JX(),n=ZX(),r=eQ(),s=tQ(),o=bQ();function a(c){var d=this.__data__=new e(c);this.size=d.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,bg=a,bg}var wg,y_;function d1(){if(y_)return wg;y_=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s&&n(t[r],r,t)!==!1;);return t}return wg=e,wg}var kg,x_;function Q4(){if(x_)return kg;x_=1;var e=Go(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return kg=t,kg}var Ng,v_;function zf(){if(v_)return Ng;v_=1;var e=Q4();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return Ng=t,Ng}var Sg,b_;function Vf(){if(b_)return Sg;b_=1;var e=zf(),t=ha(),n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c){var d=o[a];(!(r.call(o,a)&&t(d,c))||c===void 0&&!(a in o))&&e(o,a,c)}return Sg=s,Sg}var Cg,w_;function vc(){if(w_)return Cg;w_=1;var e=Vf(),t=zf();function n(r,s,o,a){var c=!o;o||(o={});for(var d=-1,f=s.length;++d<f;){var p=s[d],h=a?a(o[p],r[p],p,o,r):void 0;h===void 0&&(h=r[p]),c?t(o,p,h):e(o,p,h)}return o}return Cg=n,Cg}var _g,k_;function wQ(){if(k_)return _g;k_=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return _g=e,_g}var Eg,N_;function Gr(){if(N_)return Eg;N_=1;function e(t){return t!=null&&typeof t=="object"}return Eg=e,Eg}var jg,S_;function kQ(){if(S_)return jg;S_=1;var e=Ko(),t=Gr(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return jg=r,jg}var Ag,C_;function bc(){if(C_)return Ag;C_=1;var e=kQ(),t=Gr(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!s.call(a,"callee")};return Ag=o,Ag}var Tg,__;function Ct(){if(__)return Tg;__=1;var e=Array.isArray;return Tg=e,Tg}var yl={exports:{}},Ig,E_;function NQ(){if(E_)return Ig;E_=1;function e(){return!1}return Ig=e,Ig}yl.exports;var j_;function ma(){return j_||(j_=1,(function(e,t){var n=br(),r=NQ(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,c=a?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(yl,yl.exports)),yl.exports}var Mg,A_;function Hf(){if(A_)return Mg;A_=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var o=typeof r;return s=s??e,!!s&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return Mg=n,Mg}var Rg,T_;function f1(){if(T_)return Rg;T_=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Rg=t,Rg}var Og,I_;function SQ(){if(I_)return Og;I_=1;var e=Ko(),t=f1(),n=Gr(),r="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",p="[object Number]",h="[object Object]",g="[object RegExp]",y="[object Set]",b="[object String]",w="[object WeakMap]",v="[object ArrayBuffer]",k="[object DataView]",_="[object Float32Array]",N="[object Float64Array]",S="[object Int8Array]",A="[object Int16Array]",I="[object Int32Array]",T="[object Uint8Array]",O="[object Uint8ClampedArray]",L="[object Uint16Array]",z="[object Uint32Array]",M={};M[_]=M[N]=M[S]=M[A]=M[I]=M[T]=M[O]=M[L]=M[z]=!0,M[r]=M[s]=M[v]=M[o]=M[k]=M[a]=M[c]=M[d]=M[f]=M[p]=M[h]=M[g]=M[y]=M[b]=M[w]=!1;function P(H){return n(H)&&t(H.length)&&!!M[e(H)]}return Og=P,Og}var Pg,M_;function Uf(){if(M_)return Pg;M_=1;function e(t){return function(n){return t(n)}}return Pg=e,Pg}var xl={exports:{}};xl.exports;var R_;function h1(){return R_||(R_=1,(function(e,t){var n=Y4(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o&&n.process,c=(function(){try{var d=s&&s.require&&s.require("util").types;return d||a&&a.binding&&a.binding("util")}catch{}})();e.exports=c})(xl,xl.exports)),xl.exports}var Lg,O_;function wc(){if(O_)return Lg;O_=1;var e=SQ(),t=Uf(),n=h1(),r=n&&n.isTypedArray,s=r?t(r):e;return Lg=s,Lg}var Dg,P_;function J4(){if(P_)return Dg;P_=1;var e=wQ(),t=bc(),n=Ct(),r=ma(),s=Hf(),o=wc(),a=Object.prototype,c=a.hasOwnProperty;function d(f,p){var h=n(f),g=!h&&t(f),y=!h&&!g&&r(f),b=!h&&!g&&!y&&o(f),w=h||g||y||b,v=w?e(f.length,String):[],k=v.length;for(var _ in f)(p||c.call(f,_))&&!(w&&(_=="length"||y&&(_=="offset"||_=="parent")||b&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||s(_,k)))&&v.push(_);return v}return Dg=d,Dg}var $g,L_;function Wf(){if(L_)return $g;L_=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return $g=t,$g}var Fg,D_;function Z4(){if(D_)return Fg;D_=1;function e(t,n){return function(r){return t(n(r))}}return Fg=e,Fg}var Bg,$_;function CQ(){if($_)return Bg;$_=1;var e=Z4(),t=e(Object.keys,Object);return Bg=t,Bg}var qg,F_;function p1(){if(F_)return qg;F_=1;var e=Wf(),t=CQ(),n=Object.prototype,r=n.hasOwnProperty;function s(o){if(!e(o))return t(o);var a=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&a.push(c);return a}return qg=s,qg}var zg,B_;function gs(){if(B_)return zg;B_=1;var e=xc(),t=f1();function n(r){return r!=null&&t(r.length)&&!e(r)}return zg=n,zg}var Vg,q_;function ro(){if(q_)return Vg;q_=1;var e=J4(),t=p1(),n=gs();function r(s){return n(s)?e(s):t(s)}return Vg=r,Vg}var Hg,z_;function _Q(){if(z_)return Hg;z_=1;var e=vc(),t=ro();function n(r,s){return r&&e(s,t(s),r)}return Hg=n,Hg}var Ug,V_;function EQ(){if(V_)return Ug;V_=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return Ug=e,Ug}var Wg,H_;function jQ(){if(H_)return Wg;H_=1;var e=Kn(),t=Wf(),n=EQ(),r=Object.prototype,s=r.hasOwnProperty;function o(a){if(!e(a))return n(a);var c=t(a),d=[];for(var f in a)f=="constructor"&&(c||!s.call(a,f))||d.push(f);return d}return Wg=o,Wg}var Kg,U_;function Yo(){if(U_)return Kg;U_=1;var e=J4(),t=jQ(),n=gs();function r(s){return n(s)?e(s,!0):t(s)}return Kg=r,Kg}var Gg,W_;function AQ(){if(W_)return Gg;W_=1;var e=vc(),t=Yo();function n(r,s){return r&&e(s,t(s),r)}return Gg=n,Gg}var vl={exports:{}};vl.exports;var K_;function e3(){return K_||(K_=1,(function(e,t){var n=br(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,a=o?n.Buffer:void 0,c=a?a.allocUnsafe:void 0;function d(f,p){if(p)return f.slice();var h=f.length,g=c?c(h):new f.constructor(h);return f.copy(g),g}e.exports=d})(vl,vl.exports)),vl.exports}var Yg,G_;function t3(){if(G_)return Yg;G_=1;function e(t,n){var r=-1,s=t.length;for(n||(n=Array(s));++r<s;)n[r]=t[r];return n}return Yg=e,Yg}var Xg,Y_;function n3(){if(Y_)return Xg;Y_=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=0,a=[];++r<s;){var c=t[r];n(c,r,t)&&(a[o++]=c)}return a}return Xg=e,Xg}var Qg,X_;function r3(){if(X_)return Qg;X_=1;function e(){return[]}return Qg=e,Qg}var Jg,Q_;function m1(){if(Q_)return Jg;Q_=1;var e=n3(),t=r3(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(a){return a==null?[]:(a=Object(a),e(s(a),function(c){return r.call(a,c)}))}:t;return Jg=o,Jg}var Zg,J_;function TQ(){if(J_)return Zg;J_=1;var e=vc(),t=m1();function n(r,s){return e(r,t(r),s)}return Zg=n,Zg}var ey,Z_;function g1(){if(Z_)return ey;Z_=1;function e(t,n){for(var r=-1,s=n.length,o=t.length;++r<s;)t[o+r]=n[r];return t}return ey=e,ey}var ty,eE;function Kf(){if(eE)return ty;eE=1;var e=Z4(),t=e(Object.getPrototypeOf,Object);return ty=t,ty}var ny,tE;function s3(){if(tE)return ny;tE=1;var e=g1(),t=Kf(),n=m1(),r=r3(),s=Object.getOwnPropertySymbols,o=s?function(a){for(var c=[];a;)e(c,n(a)),a=t(a);return c}:r;return ny=o,ny}var ry,nE;function IQ(){if(nE)return ry;nE=1;var e=vc(),t=s3();function n(r,s){return e(r,t(r),s)}return ry=n,ry}var sy,rE;function o3(){if(rE)return sy;rE=1;var e=g1(),t=Ct();function n(r,s,o){var a=s(r);return t(r)?a:e(a,o(r))}return sy=n,sy}var oy,sE;function i3(){if(sE)return oy;sE=1;var e=o3(),t=m1(),n=ro();function r(s){return e(s,n,t)}return oy=r,oy}var iy,oE;function MQ(){if(oE)return iy;oE=1;var e=o3(),t=s3(),n=Yo();function r(s){return e(s,n,t)}return iy=r,iy}var ay,iE;function RQ(){if(iE)return ay;iE=1;var e=Go(),t=br(),n=e(t,"DataView");return ay=n,ay}var ly,aE;function OQ(){if(aE)return ly;aE=1;var e=Go(),t=br(),n=e(t,"Promise");return ly=n,ly}var cy,lE;function a3(){if(lE)return cy;lE=1;var e=Go(),t=br(),n=e(t,"Set");return cy=n,cy}var uy,cE;function PQ(){if(cE)return uy;cE=1;var e=Go(),t=br(),n=e(t,"WeakMap");return uy=n,uy}var dy,uE;function ga(){if(uE)return dy;uE=1;var e=RQ(),t=c1(),n=OQ(),r=a3(),s=PQ(),o=Ko(),a=X4(),c="[object Map]",d="[object Object]",f="[object Promise]",p="[object Set]",h="[object WeakMap]",g="[object DataView]",y=a(e),b=a(t),w=a(n),v=a(r),k=a(s),_=o;return(e&&_(new e(new ArrayBuffer(1)))!=g||t&&_(new t)!=c||n&&_(n.resolve())!=f||r&&_(new r)!=p||s&&_(new s)!=h)&&(_=function(N){var S=o(N),A=S==d?N.constructor:void 0,I=A?a(A):"";if(I)switch(I){case y:return g;case b:return c;case w:return f;case v:return p;case k:return h}return S}),dy=_,dy}var fy,dE;function LQ(){if(dE)return fy;dE=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var s=r.length,o=new r.constructor(s);return s&&typeof r[0]=="string"&&t.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return fy=n,fy}var hy,fE;function l3(){if(fE)return hy;fE=1;var e=br(),t=e.Uint8Array;return hy=t,hy}var py,hE;function y1(){if(hE)return py;hE=1;var e=l3();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return py=t,py}var my,pE;function DQ(){if(pE)return my;pE=1;var e=y1();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}return my=t,my}var gy,mE;function $Q(){if(mE)return gy;mE=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return gy=t,gy}var yy,gE;function FQ(){if(gE)return yy;gE=1;var e=pa(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(s){return n?Object(n.call(s)):{}}return yy=r,yy}var xy,yE;function c3(){if(yE)return xy;yE=1;var e=y1();function t(n,r){var s=r?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}return xy=t,xy}var vy,xE;function BQ(){if(xE)return vy;xE=1;var e=y1(),t=DQ(),n=$Q(),r=FQ(),s=c3(),o="[object Boolean]",a="[object Date]",c="[object Map]",d="[object Number]",f="[object RegExp]",p="[object Set]",h="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",v="[object Float64Array]",k="[object Int8Array]",_="[object Int16Array]",N="[object Int32Array]",S="[object Uint8Array]",A="[object Uint8ClampedArray]",I="[object Uint16Array]",T="[object Uint32Array]";function O(L,z,M){var P=L.constructor;switch(z){case y:return e(L);case o:case a:return new P(+L);case b:return t(L,M);case w:case v:case k:case _:case N:case S:case A:case I:case T:return s(L,M);case c:return new P;case d:case h:return new P(L);case f:return n(L);case p:return new P;case g:return r(L)}}return vy=O,vy}var by,vE;function u3(){if(vE)return by;vE=1;var e=Kn(),t=Object.create,n=(function(){function r(){}return function(s){if(!e(s))return{};if(t)return t(s);r.prototype=s;var o=new r;return r.prototype=void 0,o}})();return by=n,by}var wy,bE;function d3(){if(bE)return wy;bE=1;var e=u3(),t=Kf(),n=Wf();function r(s){return typeof s.constructor=="function"&&!n(s)?e(t(s)):{}}return wy=r,wy}var ky,wE;function qQ(){if(wE)return ky;wE=1;var e=ga(),t=Gr(),n="[object Map]";function r(s){return t(s)&&e(s)==n}return ky=r,ky}var Ny,kE;function zQ(){if(kE)return Ny;kE=1;var e=qQ(),t=Uf(),n=h1(),r=n&&n.isMap,s=r?t(r):e;return Ny=s,Ny}var Sy,NE;function VQ(){if(NE)return Sy;NE=1;var e=ga(),t=Gr(),n="[object Set]";function r(s){return t(s)&&e(s)==n}return Sy=r,Sy}var Cy,SE;function HQ(){if(SE)return Cy;SE=1;var e=VQ(),t=Uf(),n=h1(),r=n&&n.isSet,s=r?t(r):e;return Cy=s,Cy}var _y,CE;function f3(){if(CE)return _y;CE=1;var e=qf(),t=d1(),n=Vf(),r=_Q(),s=AQ(),o=e3(),a=t3(),c=TQ(),d=IQ(),f=i3(),p=MQ(),h=ga(),g=LQ(),y=BQ(),b=d3(),w=Ct(),v=ma(),k=zQ(),_=Kn(),N=HQ(),S=ro(),A=Yo(),I=1,T=2,O=4,L="[object Arguments]",z="[object Array]",M="[object Boolean]",P="[object Date]",H="[object Error]",D="[object Function]",V="[object GeneratorFunction]",$="[object Map]",U="[object Number]",B="[object Object]",q="[object RegExp]",Y="[object Set]",F="[object String]",K="[object Symbol]",ee="[object WeakMap]",W="[object ArrayBuffer]",X="[object DataView]",Z="[object Float32Array]",ne="[object Float64Array]",te="[object Int8Array]",ie="[object Int16Array]",he="[object Int32Array]",xe="[object Uint8Array]",ve="[object Uint8ClampedArray]",ye="[object Uint16Array]",_e="[object Uint32Array]",we={};we[L]=we[z]=we[W]=we[X]=we[M]=we[P]=we[Z]=we[ne]=we[te]=we[ie]=we[he]=we[$]=we[U]=we[B]=we[q]=we[Y]=we[F]=we[K]=we[xe]=we[ve]=we[ye]=we[_e]=!0,we[H]=we[D]=we[ee]=!1;function Te(Ne,Je,Fe,_t,bt,He){var qe,Xt=Je&I,Mt=Je&T,Rt=Je&O;if(Fe&&(qe=bt?Fe(Ne,_t,bt,He):Fe(Ne)),qe!==void 0)return qe;if(!_(Ne))return Ne;var ot=w(Ne);if(ot){if(qe=g(Ne),!Xt)return a(Ne,qe)}else{var Et=h(Ne),Qt=Et==D||Et==V;if(v(Ne))return o(Ne,Xt);if(Et==B||Et==L||Qt&&!bt){if(qe=Mt||Qt?{}:b(Ne),!Xt)return Mt?d(Ne,s(qe,Ne)):c(Ne,r(qe,Ne))}else{if(!we[Et])return bt?Ne:{};qe=y(Ne,Et,Xt)}}He||(He=new e);var $e=He.get(Ne);if($e)return $e;He.set(Ne,qe),N(Ne)?Ne.forEach(function(Ht){qe.add(Te(Ht,Je,Fe,Ht,Ne,He))}):k(Ne)&&Ne.forEach(function(Ht,Jt){qe.set(Jt,Te(Ht,Je,Fe,Jt,Ne,He))});var cn=Rt?Mt?p:f:Mt?A:S,Vt=ot?void 0:cn(Ne);return t(Vt||Ne,function(Ht,Jt){Vt&&(Jt=Ht,Ht=Ne[Jt]),n(qe,Jt,Te(Ht,Je,Fe,Jt,Ne,He))}),qe}return _y=Te,_y}var Ey,_E;function UQ(){if(_E)return Ey;_E=1;var e=f3(),t=4;function n(r){return e(r,t)}return Ey=n,Ey}var jy,EE;function x1(){if(EE)return jy;EE=1;function e(t){return function(){return t}}return jy=e,jy}var Ay,jE;function WQ(){if(jE)return Ay;jE=1;function e(t){return function(n,r,s){for(var o=-1,a=Object(n),c=s(n),d=c.length;d--;){var f=c[t?d:++o];if(r(a[f],f,a)===!1)break}return n}}return Ay=e,Ay}var Ty,AE;function v1(){if(AE)return Ty;AE=1;var e=WQ(),t=e();return Ty=t,Ty}var Iy,TE;function b1(){if(TE)return Iy;TE=1;var e=v1(),t=ro();function n(r,s){return r&&e(r,s,t)}return Iy=n,Iy}var My,IE;function KQ(){if(IE)return My;IE=1;var e=gs();function t(n,r){return function(s,o){if(s==null)return s;if(!e(s))return n(s,o);for(var a=s.length,c=r?a:-1,d=Object(s);(r?c--:++c<a)&&o(d[c],c,d)!==!1;);return s}}return My=t,My}var Ry,ME;function Gf(){if(ME)return Ry;ME=1;var e=b1(),t=KQ(),n=t(e);return Ry=n,Ry}var Oy,RE;function Xo(){if(RE)return Oy;RE=1;function e(t){return t}return Oy=e,Oy}var Py,OE;function h3(){if(OE)return Py;OE=1;var e=Xo();function t(n){return typeof n=="function"?n:e}return Py=t,Py}var Ly,PE;function p3(){if(PE)return Ly;PE=1;var e=d1(),t=Gf(),n=h3(),r=Ct();function s(o,a){var c=r(o)?e:t;return c(o,n(a))}return Ly=s,Ly}var Dy,LE;function m3(){return LE||(LE=1,Dy=p3()),Dy}var $y,DE;function GQ(){if(DE)return $y;DE=1;var e=Gf();function t(n,r){var s=[];return e(n,function(o,a,c){r(o,a,c)&&s.push(o)}),s}return $y=t,$y}var Fy,$E;function YQ(){if($E)return Fy;$E=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Fy=t,Fy}var By,FE;function XQ(){if(FE)return By;FE=1;function e(t){return this.__data__.has(t)}return By=e,By}var qy,BE;function g3(){if(BE)return qy;BE=1;var e=u1(),t=YQ(),n=XQ();function r(s){var o=-1,a=s==null?0:s.length;for(this.__data__=new e;++o<a;)this.add(s[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,qy=r,qy}var zy,qE;function QQ(){if(qE)return zy;qE=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return zy=e,zy}var Vy,zE;function y3(){if(zE)return Vy;zE=1;function e(t,n){return t.has(n)}return Vy=e,Vy}var Hy,VE;function x3(){if(VE)return Hy;VE=1;var e=g3(),t=QQ(),n=y3(),r=1,s=2;function o(a,c,d,f,p,h){var g=d&r,y=a.length,b=c.length;if(y!=b&&!(g&&b>y))return!1;var w=h.get(a),v=h.get(c);if(w&&v)return w==c&&v==a;var k=-1,_=!0,N=d&s?new e:void 0;for(h.set(a,c),h.set(c,a);++k<y;){var S=a[k],A=c[k];if(f)var I=g?f(A,S,k,c,a,h):f(S,A,k,a,c,h);if(I!==void 0){if(I)continue;_=!1;break}if(N){if(!t(c,function(T,O){if(!n(N,O)&&(S===T||p(S,T,d,f,h)))return N.push(O)})){_=!1;break}}else if(!(S===A||p(S,A,d,f,h))){_=!1;break}}return h.delete(a),h.delete(c),_}return Hy=o,Hy}var Uy,HE;function JQ(){if(HE)return Uy;HE=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,o){r[++n]=[o,s]}),r}return Uy=e,Uy}var Wy,UE;function w1(){if(UE)return Wy;UE=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return Wy=e,Wy}var Ky,WE;function ZQ(){if(WE)return Ky;WE=1;var e=pa(),t=l3(),n=ha(),r=x3(),s=JQ(),o=w1(),a=1,c=2,d="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Map]",g="[object Number]",y="[object RegExp]",b="[object Set]",w="[object String]",v="[object Symbol]",k="[object ArrayBuffer]",_="[object DataView]",N=e?e.prototype:void 0,S=N?N.valueOf:void 0;function A(I,T,O,L,z,M,P){switch(O){case _:if(I.byteLength!=T.byteLength||I.byteOffset!=T.byteOffset)return!1;I=I.buffer,T=T.buffer;case k:return!(I.byteLength!=T.byteLength||!M(new t(I),new t(T)));case d:case f:case g:return n(+I,+T);case p:return I.name==T.name&&I.message==T.message;case y:case w:return I==T+"";case h:var H=s;case b:var D=L&a;if(H||(H=o),I.size!=T.size&&!D)return!1;var V=P.get(I);if(V)return V==T;L|=c,P.set(I,T);var $=r(H(I),H(T),L,z,M,P);return P.delete(I),$;case v:if(S)return S.call(I)==S.call(T)}return!1}return Ky=A,Ky}var Gy,KE;function eJ(){if(KE)return Gy;KE=1;var e=i3(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,a,c,d,f,p){var h=c&t,g=e(o),y=g.length,b=e(a),w=b.length;if(y!=w&&!h)return!1;for(var v=y;v--;){var k=g[v];if(!(h?k in a:r.call(a,k)))return!1}var _=p.get(o),N=p.get(a);if(_&&N)return _==a&&N==o;var S=!0;p.set(o,a),p.set(a,o);for(var A=h;++v<y;){k=g[v];var I=o[k],T=a[k];if(d)var O=h?d(T,I,k,a,o,p):d(I,T,k,o,a,p);if(!(O===void 0?I===T||f(I,T,c,d,p):O)){S=!1;break}A||(A=k=="constructor")}if(S&&!A){var L=o.constructor,z=a.constructor;L!=z&&"constructor"in o&&"constructor"in a&&!(typeof L=="function"&&L instanceof L&&typeof z=="function"&&z instanceof z)&&(S=!1)}return p.delete(o),p.delete(a),S}return Gy=s,Gy}var Yy,GE;function tJ(){if(GE)return Yy;GE=1;var e=qf(),t=x3(),n=ZQ(),r=eJ(),s=ga(),o=Ct(),a=ma(),c=wc(),d=1,f="[object Arguments]",p="[object Array]",h="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function b(w,v,k,_,N,S){var A=o(w),I=o(v),T=A?p:s(w),O=I?p:s(v);T=T==f?h:T,O=O==f?h:O;var L=T==h,z=O==h,M=T==O;if(M&&a(w)){if(!a(v))return!1;A=!0,L=!1}if(M&&!L)return S||(S=new e),A||c(w)?t(w,v,k,_,N,S):n(w,v,T,k,_,N,S);if(!(k&d)){var P=L&&y.call(w,"__wrapped__"),H=z&&y.call(v,"__wrapped__");if(P||H){var D=P?w.value():w,V=H?v.value():v;return S||(S=new e),N(D,V,k,_,S)}}return M?(S||(S=new e),r(w,v,k,_,N,S)):!1}return Yy=b,Yy}var Xy,YE;function v3(){if(YE)return Xy;YE=1;var e=tJ(),t=Gr();function n(r,s,o,a,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,o,a,n,c)}return Xy=n,Xy}var Qy,XE;function nJ(){if(XE)return Qy;XE=1;var e=qf(),t=v3(),n=1,r=2;function s(o,a,c,d){var f=c.length,p=f,h=!d;if(o==null)return!p;for(o=Object(o);f--;){var g=c[f];if(h&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++f<p;){g=c[f];var y=g[0],b=o[y],w=g[1];if(h&&g[2]){if(b===void 0&&!(y in o))return!1}else{var v=new e;if(d)var k=d(b,w,y,o,a,v);if(!(k===void 0?t(w,b,n|r,d,v):k))return!1}}return!0}return Qy=s,Qy}var Jy,QE;function b3(){if(QE)return Jy;QE=1;var e=Kn();function t(n){return n===n&&!e(n)}return Jy=t,Jy}var Zy,JE;function rJ(){if(JE)return Zy;JE=1;var e=b3(),t=ro();function n(r){for(var s=t(r),o=s.length;o--;){var a=s[o],c=r[a];s[o]=[a,c,e(c)]}return s}return Zy=n,Zy}var ex,ZE;function w3(){if(ZE)return ex;ZE=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return ex=e,ex}var tx,ej;function sJ(){if(ej)return tx;ej=1;var e=nJ(),t=rJ(),n=w3();function r(s){var o=t(s);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(a){return a===s||e(a,s,o)}}return tx=r,tx}var nx,tj;function ya(){if(tj)return nx;tj=1;var e=Ko(),t=Gr(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return nx=r,nx}var rx,nj;function k1(){if(nj)return rx;nj=1;var e=Ct(),t=ya(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(o,a){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||a!=null&&o in Object(a)}return rx=s,rx}var sx,rj;function oJ(){if(rj)return sx;rj=1;var e=u1(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var o=function(){var a=arguments,c=s?s.apply(this,a):a[0],d=o.cache;if(d.has(c))return d.get(c);var f=r.apply(this,a);return o.cache=d.set(c,f)||d,f};return o.cache=new(n.Cache||e),o}return n.Cache=e,sx=n,sx}var ox,sj;function iJ(){if(sj)return ox;sj=1;var e=oJ(),t=500;function n(r){var s=e(r,function(a){return o.size===t&&o.clear(),a}),o=s.cache;return s}return ox=n,ox}var ix,oj;function aJ(){if(oj)return ix;oj=1;var e=iJ(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(t,function(a,c,d,f){o.push(d?f.replace(n,"$1"):c||a)}),o});return ix=r,ix}var ax,ij;function Yf(){if(ij)return ax;ij=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=Array(s);++r<s;)o[r]=n(t[r],r,t);return o}return ax=e,ax}var lx,aj;function lJ(){if(aj)return lx;aj=1;var e=pa(),t=Yf(),n=Ct(),r=ya(),s=e?e.prototype:void 0,o=s?s.toString:void 0;function a(c){if(typeof c=="string")return c;if(n(c))return t(c,a)+"";if(r(c))return o?o.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return lx=a,lx}var cx,lj;function k3(){if(lj)return cx;lj=1;var e=lJ();function t(n){return n==null?"":e(n)}return cx=t,cx}var ux,cj;function Xf(){if(cj)return ux;cj=1;var e=Ct(),t=k1(),n=aJ(),r=k3();function s(o,a){return e(o)?o:t(o,a)?[o]:n(r(o))}return ux=s,ux}var dx,uj;function kc(){if(uj)return dx;uj=1;var e=ya();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return dx=t,dx}var fx,dj;function Qf(){if(dj)return fx;dj=1;var e=Xf(),t=kc();function n(r,s){s=e(s,r);for(var o=0,a=s.length;r!=null&&o<a;)r=r[t(s[o++])];return o&&o==a?r:void 0}return fx=n,fx}var hx,fj;function cJ(){if(fj)return hx;fj=1;var e=Qf();function t(n,r,s){var o=n==null?void 0:e(n,r);return o===void 0?s:o}return hx=t,hx}var px,hj;function uJ(){if(hj)return px;hj=1;function e(t,n){return t!=null&&n in Object(t)}return px=e,px}var mx,pj;function N3(){if(pj)return mx;pj=1;var e=Xf(),t=bc(),n=Ct(),r=Hf(),s=f1(),o=kc();function a(c,d,f){d=e(d,c);for(var p=-1,h=d.length,g=!1;++p<h;){var y=o(d[p]);if(!(g=c!=null&&f(c,y)))break;c=c[y]}return g||++p!=h?g:(h=c==null?0:c.length,!!h&&s(h)&&r(y,h)&&(n(c)||t(c)))}return mx=a,mx}var gx,mj;function S3(){if(mj)return gx;mj=1;var e=uJ(),t=N3();function n(r,s){return r!=null&&t(r,s,e)}return gx=n,gx}var yx,gj;function dJ(){if(gj)return yx;gj=1;var e=v3(),t=cJ(),n=S3(),r=k1(),s=b3(),o=w3(),a=kc(),c=1,d=2;function f(p,h){return r(p)&&s(h)?o(a(p),h):function(g){var y=t(g,p);return y===void 0&&y===h?n(g,p):e(h,y,c|d)}}return yx=f,yx}var xx,yj;function C3(){if(yj)return xx;yj=1;function e(t){return function(n){return n==null?void 0:n[t]}}return xx=e,xx}var vx,xj;function fJ(){if(xj)return vx;xj=1;var e=Qf();function t(n){return function(r){return e(r,n)}}return vx=t,vx}var bx,vj;function hJ(){if(vj)return bx;vj=1;var e=C3(),t=fJ(),n=k1(),r=kc();function s(o){return n(o)?e(r(o)):t(o)}return bx=s,bx}var wx,bj;function ys(){if(bj)return wx;bj=1;var e=sJ(),t=dJ(),n=Xo(),r=Ct(),s=hJ();function o(a){return typeof a=="function"?a:a==null?n:typeof a=="object"?r(a)?t(a[0],a[1]):e(a):s(a)}return wx=o,wx}var kx,wj;function _3(){if(wj)return kx;wj=1;var e=n3(),t=GQ(),n=ys(),r=Ct();function s(o,a){var c=r(o)?e:t;return c(o,n(a,3))}return kx=s,kx}var Nx,kj;function pJ(){if(kj)return Nx;kj=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,s){return r!=null&&t.call(r,s)}return Nx=n,Nx}var Sx,Nj;function E3(){if(Nj)return Sx;Nj=1;var e=pJ(),t=N3();function n(r,s){return r!=null&&t(r,s,e)}return Sx=n,Sx}var Cx,Sj;function mJ(){if(Sj)return Cx;Sj=1;var e=p1(),t=ga(),n=bc(),r=Ct(),s=gs(),o=ma(),a=Wf(),c=wc(),d="[object Map]",f="[object Set]",p=Object.prototype,h=p.hasOwnProperty;function g(y){if(y==null)return!0;if(s(y)&&(r(y)||typeof y=="string"||typeof y.splice=="function"||o(y)||c(y)||n(y)))return!y.length;var b=t(y);if(b==d||b==f)return!y.size;if(a(y))return!e(y).length;for(var w in y)if(h.call(y,w))return!1;return!0}return Cx=g,Cx}var _x,Cj;function j3(){if(Cj)return _x;Cj=1;function e(t){return t===void 0}return _x=e,_x}var Ex,_j;function A3(){if(_j)return Ex;_j=1;var e=Gf(),t=gs();function n(r,s){var o=-1,a=t(r)?Array(r.length):[];return e(r,function(c,d,f){a[++o]=s(c,d,f)}),a}return Ex=n,Ex}var jx,Ej;function T3(){if(Ej)return jx;Ej=1;var e=Yf(),t=ys(),n=A3(),r=Ct();function s(o,a){var c=r(o)?e:n;return c(o,t(a,3))}return jx=s,jx}var Ax,jj;function gJ(){if(jj)return Ax;jj=1;function e(t,n,r,s){var o=-1,a=t==null?0:t.length;for(s&&a&&(r=t[++o]);++o<a;)r=n(r,t[o],o,t);return r}return Ax=e,Ax}var Tx,Aj;function yJ(){if(Aj)return Tx;Aj=1;function e(t,n,r,s,o){return o(t,function(a,c,d){r=s?(s=!1,a):n(r,a,c,d)}),r}return Tx=e,Tx}var Ix,Tj;function I3(){if(Tj)return Ix;Tj=1;var e=gJ(),t=Gf(),n=ys(),r=yJ(),s=Ct();function o(a,c,d){var f=s(a)?e:r,p=arguments.length<3;return f(a,n(c,4),d,p,t)}return Ix=o,Ix}var Mx,Ij;function xJ(){if(Ij)return Mx;Ij=1;var e=Ko(),t=Ct(),n=Gr(),r="[object String]";function s(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Mx=s,Mx}var Rx,Mj;function vJ(){if(Mj)return Rx;Mj=1;var e=C3(),t=e("length");return Rx=t,Rx}var Ox,Rj;function bJ(){if(Rj)return Ox;Rj=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="\\u200d",c=RegExp("["+a+e+s+o+"]");function d(f){return c.test(f)}return Ox=d,Ox}var Px,Oj;function wJ(){if(Oj)return Px;Oj=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",a="["+e+"]",c="["+s+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",p="[^"+e+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",b=f+"?",w="["+o+"]?",v="(?:"+y+"(?:"+[p,h,g].join("|")+")"+w+b+")*",k=w+b+v,_="(?:"+[p+c+"?",c,h,g,a].join("|")+")",N=RegExp(d+"(?="+d+")|"+_+k,"g");function S(A){for(var I=N.lastIndex=0;N.test(A);)++I;return I}return Px=S,Px}var Lx,Pj;function kJ(){if(Pj)return Lx;Pj=1;var e=vJ(),t=bJ(),n=wJ();function r(s){return t(s)?n(s):e(s)}return Lx=r,Lx}var Dx,Lj;function NJ(){if(Lj)return Dx;Lj=1;var e=p1(),t=ga(),n=gs(),r=xJ(),s=kJ(),o="[object Map]",a="[object Set]";function c(d){if(d==null)return 0;if(n(d))return r(d)?s(d):d.length;var f=t(d);return f==o||f==a?d.size:e(d).length}return Dx=c,Dx}var $x,Dj;function SJ(){if(Dj)return $x;Dj=1;var e=d1(),t=u3(),n=b1(),r=ys(),s=Kf(),o=Ct(),a=ma(),c=xc(),d=Kn(),f=wc();function p(h,g,y){var b=o(h),w=b||a(h)||f(h);if(g=r(g,4),y==null){var v=h&&h.constructor;w?y=b?new v:[]:d(h)?y=c(v)?t(s(h)):{}:y={}}return(w?e:n)(h,function(k,_,N){return g(y,k,_,N)}),y}return $x=p,$x}var Fx,$j;function CJ(){if($j)return Fx;$j=1;var e=pa(),t=bc(),n=Ct(),r=e?e.isConcatSpreadable:void 0;function s(o){return n(o)||t(o)||!!(r&&o&&o[r])}return Fx=s,Fx}var Bx,Fj;function N1(){if(Fj)return Bx;Fj=1;var e=g1(),t=CJ();function n(r,s,o,a,c){var d=-1,f=r.length;for(o||(o=t),c||(c=[]);++d<f;){var p=r[d];s>0&&o(p)?s>1?n(p,s-1,o,a,c):e(c,p):a||(c[c.length]=p)}return c}return Bx=n,Bx}var qx,Bj;function _J(){if(Bj)return qx;Bj=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 qx=e,qx}var zx,qj;function M3(){if(qj)return zx;qj=1;var e=_J(),t=Math.max;function n(r,s,o){return s=t(s===void 0?r.length-1:s,0),function(){for(var a=arguments,c=-1,d=t(a.length-s,0),f=Array(d);++c<d;)f[c]=a[s+c];c=-1;for(var p=Array(s+1);++c<s;)p[c]=a[c];return p[s]=o(f),e(r,this,p)}}return zx=n,zx}var Vx,zj;function EJ(){if(zj)return Vx;zj=1;var e=x1(),t=Q4(),n=Xo(),r=t?function(s,o){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return Vx=r,Vx}var Hx,Vj;function jJ(){if(Vj)return Hx;Vj=1;var e=800,t=16,n=Date.now;function r(s){var o=0,a=0;return function(){var c=n(),d=t-(c-a);if(a=c,d>0){if(++o>=e)return arguments[0]}else o=0;return s.apply(void 0,arguments)}}return Hx=r,Hx}var Ux,Hj;function R3(){if(Hj)return Ux;Hj=1;var e=EJ(),t=jJ(),n=t(e);return Ux=n,Ux}var Wx,Uj;function Jf(){if(Uj)return Wx;Uj=1;var e=Xo(),t=M3(),n=R3();function r(s,o){return n(t(s,o,e),s+"")}return Wx=r,Wx}var Kx,Wj;function O3(){if(Wj)return Kx;Wj=1;function e(t,n,r,s){for(var o=t.length,a=r+(s?1:-1);s?a--:++a<o;)if(n(t[a],a,t))return a;return-1}return Kx=e,Kx}var Gx,Kj;function AJ(){if(Kj)return Gx;Kj=1;function e(t){return t!==t}return Gx=e,Gx}var Yx,Gj;function TJ(){if(Gj)return Yx;Gj=1;function e(t,n,r){for(var s=r-1,o=t.length;++s<o;)if(t[s]===n)return s;return-1}return Yx=e,Yx}var Xx,Yj;function IJ(){if(Yj)return Xx;Yj=1;var e=O3(),t=AJ(),n=TJ();function r(s,o,a){return o===o?n(s,o,a):e(s,t,a)}return Xx=r,Xx}var Qx,Xj;function MJ(){if(Xj)return Qx;Xj=1;var e=IJ();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return Qx=t,Qx}var Jx,Qj;function RJ(){if(Qj)return Jx;Qj=1;function e(t,n,r){for(var s=-1,o=t==null?0:t.length;++s<o;)if(r(n,t[s]))return!0;return!1}return Jx=e,Jx}var Zx,Jj;function OJ(){if(Jj)return Zx;Jj=1;function e(){}return Zx=e,Zx}var e0,Zj;function PJ(){if(Zj)return e0;Zj=1;var e=a3(),t=OJ(),n=w1(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return e0=s,e0}var t0,eA;function LJ(){if(eA)return t0;eA=1;var e=g3(),t=MJ(),n=RJ(),r=y3(),s=PJ(),o=w1(),a=200;function c(d,f,p){var h=-1,g=t,y=d.length,b=!0,w=[],v=w;if(p)b=!1,g=n;else if(y>=a){var k=f?null:s(d);if(k)return o(k);b=!1,g=r,v=new e}else v=f?[]:w;e:for(;++h<y;){var _=d[h],N=f?f(_):_;if(_=p||_!==0?_:0,b&&N===N){for(var S=v.length;S--;)if(v[S]===N)continue e;f&&v.push(N),w.push(_)}else g(v,N,p)||(v!==w&&v.push(N),w.push(_))}return w}return t0=c,t0}var n0,tA;function P3(){if(tA)return n0;tA=1;var e=gs(),t=Gr();function n(r){return t(r)&&e(r)}return n0=n,n0}var r0,nA;function DJ(){if(nA)return r0;nA=1;var e=N1(),t=Jf(),n=LJ(),r=P3(),s=t(function(o){return n(e(o,1,r,!0))});return r0=s,r0}var s0,rA;function $J(){if(rA)return s0;rA=1;var e=Yf();function t(n,r){return e(r,function(s){return n[s]})}return s0=t,s0}var o0,sA;function L3(){if(sA)return o0;sA=1;var e=$J(),t=ro();function n(r){return r==null?[]:e(r,t(r))}return o0=n,o0}var i0,oA;function Gn(){if(oA)return i0;oA=1;var e;if(typeof l1=="function")try{e={clone:UQ(),constant:x1(),each:m3(),filter:_3(),has:E3(),isArray:Ct(),isEmpty:mJ(),isFunction:xc(),isUndefined:j3(),keys:ro(),map:T3(),reduce:I3(),size:NJ(),transform:SJ(),union:DJ(),values:L3()}}catch{}return e||(e=window._),i0=e,i0}var a0,iA;function S1(){if(iA)return a0;iA=1;var e=Gn();a0=s;var t="\0",n="\0",r="";function s(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(p){return this._label=p,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return e.keys(this._nodes)},s.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(h){return e.isEmpty(p._in[h])})},s.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(h){return e.isEmpty(p._out[h])})},s.prototype.setNodes=function(p,h){var g=arguments,y=this;return e.each(p,function(b){g.length>1?y.setNode(b,h):y.setNode(b)}),this},s.prototype.setNode=function(p,h){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=h),this):(this._nodes[p]=arguments.length>1?h:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=n,this._children[p]={},this._children[n][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},s.prototype.node=function(p){return this._nodes[p]},s.prototype.hasNode=function(p){return e.has(this._nodes,p)},s.prototype.removeNode=function(p){var h=this;if(e.has(this._nodes,p)){var g=function(y){h.removeEdge(h._edgeObjs[y])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(y){h.setParent(y)}),delete this._children[p]),e.each(e.keys(this._in[p]),g),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),g),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},s.prototype.setParent=function(p,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(h))h=n;else{h+="";for(var g=h;!e.isUndefined(g);g=this.parent(g))if(g===p)throw new Error("Setting "+h+" as parent of "+p+" would create a cycle");this.setNode(h)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=h,this._children[h][p]=!0,this},s.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},s.prototype.parent=function(p){if(this._isCompound){var h=this._parent[p];if(h!==n)return h}},s.prototype.children=function(p){if(e.isUndefined(p)&&(p=n),this._isCompound){var h=this._children[p];if(h)return e.keys(h)}else{if(p===n)return this.nodes();if(this.hasNode(p))return[]}},s.prototype.predecessors=function(p){var h=this._preds[p];if(h)return e.keys(h)},s.prototype.successors=function(p){var h=this._sucs[p];if(h)return e.keys(h)},s.prototype.neighbors=function(p){var h=this.predecessors(p);if(h)return e.union(h,this.successors(p))},s.prototype.isLeaf=function(p){var h;return this.isDirected()?h=this.successors(p):h=this.neighbors(p),h.length===0},s.prototype.filterNodes=function(p){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var g=this;e.each(this._nodes,function(w,v){p(v)&&h.setNode(v,w)}),e.each(this._edgeObjs,function(w){h.hasNode(w.v)&&h.hasNode(w.w)&&h.setEdge(w,g.edge(w))});var y={};function b(w){var v=g.parent(w);return v===void 0||h.hasNode(v)?(y[w]=v,v):v in y?y[v]:b(v)}return this._isCompound&&e.each(h.nodes(),function(w){h.setParent(w,b(w))}),h},s.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return e.values(this._edgeObjs)},s.prototype.setPath=function(p,h){var g=this,y=arguments;return e.reduce(p,function(b,w){return y.length>1?g.setEdge(b,w,h):g.setEdge(b,w),w}),this},s.prototype.setEdge=function(){var p,h,g,y,b=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(p=w.v,h=w.w,g=w.name,arguments.length===2&&(y=arguments[1],b=!0)):(p=w,h=arguments[1],g=arguments[3],arguments.length>2&&(y=arguments[2],b=!0)),p=""+p,h=""+h,e.isUndefined(g)||(g=""+g);var v=c(this._isDirected,p,h,g);if(e.has(this._edgeLabels,v))return b&&(this._edgeLabels[v]=y),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(h),this._edgeLabels[v]=b?y:this._defaultEdgeLabelFn(p,h,g);var k=d(this._isDirected,p,h,g);return p=k.v,h=k.w,Object.freeze(k),this._edgeObjs[v]=k,o(this._preds[h],p),o(this._sucs[p],h),this._in[h][v]=k,this._out[p][v]=k,this._edgeCount++,this},s.prototype.edge=function(p,h,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,p,h,g);return this._edgeLabels[y]},s.prototype.hasEdge=function(p,h,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,p,h,g);return e.has(this._edgeLabels,y)},s.prototype.removeEdge=function(p,h,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):c(this._isDirected,p,h,g),b=this._edgeObjs[y];return b&&(p=b.v,h=b.w,delete this._edgeLabels[y],delete this._edgeObjs[y],a(this._preds[h],p),a(this._sucs[p],h),delete this._in[h][y],delete this._out[p][y],this._edgeCount--),this},s.prototype.inEdges=function(p,h){var g=this._in[p];if(g){var y=e.values(g);return h?e.filter(y,function(b){return b.v===h}):y}},s.prototype.outEdges=function(p,h){var g=this._out[p];if(g){var y=e.values(g);return h?e.filter(y,function(b){return b.w===h}):y}},s.prototype.nodeEdges=function(p,h){var g=this.inEdges(p,h);if(g)return g.concat(this.outEdges(p,h))};function o(p,h){p[h]?p[h]++:p[h]=1}function a(p,h){--p[h]||delete p[h]}function c(p,h,g,y){var b=""+h,w=""+g;if(!p&&b>w){var v=b;b=w,w=v}return b+r+w+r+(e.isUndefined(y)?t:y)}function d(p,h,g,y){var b=""+h,w=""+g;if(!p&&b>w){var v=b;b=w,w=v}var k={v:b,w};return y&&(k.name=y),k}function f(p,h){return c(p,h.v,h.w,h.name)}return a0}var l0,aA;function FJ(){return aA||(aA=1,l0="2.1.8"),l0}var c0,lA;function BJ(){return lA||(lA=1,c0={Graph:S1(),version:FJ()}),c0}var u0,cA;function qJ(){if(cA)return u0;cA=1;var e=Gn(),t=S1();u0={write:n,read:o};function n(a){var c={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return e.isUndefined(a.graph())||(c.value=e.clone(a.graph())),c}function r(a){return e.map(a.nodes(),function(c){var d=a.node(c),f=a.parent(c),p={v:c};return e.isUndefined(d)||(p.value=d),e.isUndefined(f)||(p.parent=f),p})}function s(a){return e.map(a.edges(),function(c){var d=a.edge(c),f={v:c.v,w:c.w};return e.isUndefined(c.name)||(f.name=c.name),e.isUndefined(d)||(f.value=d),f})}function o(a){var c=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(d){c.setNode(d.v,d.value),d.parent&&c.setParent(d.v,d.parent)}),e.each(a.edges,function(d){c.setEdge({v:d.v,w:d.w,name:d.name},d.value)}),c}return u0}var d0,uA;function zJ(){if(uA)return d0;uA=1;var e=Gn();d0=t;function t(n){var r={},s=[],o;function a(c){e.has(r,c)||(r[c]=!0,o.push(c),e.each(n.successors(c),a),e.each(n.predecessors(c),a))}return e.each(n.nodes(),function(c){o=[],a(c),o.length&&s.push(o)}),s}return d0}var f0,dA;function D3(){if(dA)return f0;dA=1;var e=Gn();f0=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(n){return n.key})},t.prototype.has=function(n){return e.has(this._keyIndices,n)},t.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!e.has(s,n)){var o=this._arr,a=o.length;return s[n]=a,o.push({key:n,priority:r}),this._decrease(a),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},t.prototype._heapify=function(n){var r=this._arr,s=2*n,o=s+1,a=n;s<r.length&&(a=r[s].priority<r[a].priority?s:a,o<r.length&&(a=r[o].priority<r[a].priority?o:a),a!==n&&(this._swap(n,a),this._heapify(a)))},t.prototype._decrease=function(n){for(var r=this._arr,s=r[n].priority,o;n!==0&&(o=n>>1,!(r[o].priority<s));)this._swap(n,o),n=o},t.prototype._swap=function(n,r){var s=this._arr,o=this._keyIndices,a=s[n],c=s[r];s[n]=c,s[r]=a,o[c.key]=n,o[a.key]=r},f0}var h0,fA;function $3(){if(fA)return h0;fA=1;var e=Gn(),t=D3();h0=r;var n=e.constant(1);function r(o,a,c,d){return s(o,String(a),c||n,d||function(f){return o.outEdges(f)})}function s(o,a,c,d){var f={},p=new t,h,g,y=function(b){var w=b.v!==h?b.v:b.w,v=f[w],k=c(b),_=g.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+k);_<v.distance&&(v.distance=_,v.predecessor=h,p.decrease(w,_))};for(o.nodes().forEach(function(b){var w=b===a?0:Number.POSITIVE_INFINITY;f[b]={distance:w},p.add(b,w)});p.size()>0&&(h=p.removeMin(),g=f[h],g.distance!==Number.POSITIVE_INFINITY);)d(h).forEach(y);return f}return h0}var p0,hA;function VJ(){if(hA)return p0;hA=1;var e=$3(),t=Gn();p0=n;function n(r,s,o){return t.transform(r.nodes(),function(a,c){a[c]=e(r,c,s,o)},{})}return p0}var m0,pA;function F3(){if(pA)return m0;pA=1;var e=Gn();m0=t;function t(n){var r=0,s=[],o={},a=[];function c(d){var f=o[d]={onStack:!0,lowlink:r,index:r++};if(s.push(d),n.successors(d).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 p=[],h;do h=s.pop(),o[h].onStack=!1,p.push(h);while(d!==h);a.push(p)}}return n.nodes().forEach(function(d){e.has(o,d)||c(d)}),a}return m0}var g0,mA;function HJ(){if(mA)return g0;mA=1;var e=Gn(),t=F3();g0=n;function n(r){return e.filter(t(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return g0}var y0,gA;function UJ(){if(gA)return y0;gA=1;var e=Gn();y0=n;var t=e.constant(1);function n(s,o,a){return r(s,o||t,a||function(c){return s.outEdges(c)})}function r(s,o,a){var c={},d=s.nodes();return d.forEach(function(f){c[f]={},c[f][f]={distance:0},d.forEach(function(p){f!==p&&(c[f][p]={distance:Number.POSITIVE_INFINITY})}),a(f).forEach(function(p){var h=p.v===f?p.w:p.v,g=o(p);c[f][h]={distance:g,predecessor:f}})}),d.forEach(function(f){var p=c[f];d.forEach(function(h){var g=c[h];d.forEach(function(y){var b=g[f],w=p[y],v=g[y],k=b.distance+w.distance;k<v.distance&&(v.distance=k,v.predecessor=w.predecessor)})})}),c}return y0}var x0,yA;function B3(){if(yA)return x0;yA=1;var e=Gn();x0=t,t.CycleException=n;function t(r){var s={},o={},a=[];function c(d){if(e.has(o,d))throw new n;e.has(s,d)||(o[d]=!0,s[d]=!0,e.each(r.predecessors(d),c),delete o[d],a.push(d))}if(e.each(r.sinks(),c),e.size(s)!==r.nodeCount())throw new n;return a}function n(){}return n.prototype=new Error,x0}var v0,xA;function WJ(){if(xA)return v0;xA=1;var e=B3();v0=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return v0}var b0,vA;function q3(){if(vA)return b0;vA=1;var e=Gn();b0=t;function t(r,s,o){e.isArray(s)||(s=[s]);var a=(r.isDirected()?r.successors:r.neighbors).bind(r),c=[],d={};return e.each(s,function(f){if(!r.hasNode(f))throw new Error("Graph does not have node: "+f);n(r,f,o==="post",d,a,c)}),c}function n(r,s,o,a,c,d){e.has(a,s)||(a[s]=!0,o||d.push(s),e.each(c(s),function(f){n(r,f,o,a,c,d)}),o&&d.push(s))}return b0}var w0,bA;function KJ(){if(bA)return w0;bA=1;var e=q3();w0=t;function t(n,r){return e(n,r,"post")}return w0}var k0,wA;function GJ(){if(wA)return k0;wA=1;var e=q3();k0=t;function t(n,r){return e(n,r,"pre")}return k0}var N0,kA;function YJ(){if(kA)return N0;kA=1;var e=Gn(),t=S1(),n=D3();N0=r;function r(s,o){var a=new t,c={},d=new n,f;function p(g){var y=g.v===f?g.w:g.v,b=d.priority(y);if(b!==void 0){var w=o(g);w<b&&(c[y]=f,d.decrease(y,w))}}if(s.nodeCount()===0)return a;e.each(s.nodes(),function(g){d.add(g,Number.POSITIVE_INFINITY),a.setNode(g)}),d.decrease(s.nodes()[0],0);for(var h=!1;d.size()>0;){if(f=d.removeMin(),e.has(c,f))a.setEdge(f,c[f]);else{if(h)throw new Error("Input graph is not connected: "+s);h=!0}s.nodeEdges(f).forEach(p)}return a}return N0}var S0,NA;function XJ(){return NA||(NA=1,S0={components:zJ(),dijkstra:$3(),dijkstraAll:VJ(),findCycles:HJ(),floydWarshall:UJ(),isAcyclic:WJ(),postorder:KJ(),preorder:GJ(),prim:YJ(),tarjan:F3(),topsort:B3()}),S0}var C0,SA;function QJ(){if(SA)return C0;SA=1;var e=BJ();return C0={Graph:e.Graph,json:qJ(),alg:XJ(),version:e.version},C0}var _0,CA;function pr(){if(CA)return _0;CA=1;var e;if(typeof l1=="function")try{e=QJ()}catch{}return e||(e=window.graphlib),_0=e,_0}var E0,_A;function JJ(){if(_A)return E0;_A=1;var e=f3(),t=1,n=4;function r(s){return e(s,t|n)}return E0=r,E0}var j0,EA;function Zf(){if(EA)return j0;EA=1;var e=ha(),t=gs(),n=Hf(),r=Kn();function s(o,a,c){if(!r(c))return!1;var d=typeof a;return(d=="number"?t(c)&&n(a,c.length):d=="string"&&a in c)?e(c[a],o):!1}return j0=s,j0}var A0,jA;function ZJ(){if(jA)return A0;jA=1;var e=Jf(),t=ha(),n=Zf(),r=Yo(),s=Object.prototype,o=s.hasOwnProperty,a=e(function(c,d){c=Object(c);var f=-1,p=d.length,h=p>2?d[2]:void 0;for(h&&n(d[0],d[1],h)&&(p=1);++f<p;)for(var g=d[f],y=r(g),b=-1,w=y.length;++b<w;){var v=y[b],k=c[v];(k===void 0||t(k,s[v])&&!o.call(c,v))&&(c[v]=g[v])}return c});return A0=a,A0}var T0,AA;function eZ(){if(AA)return T0;AA=1;var e=ys(),t=gs(),n=ro();function r(s){return function(o,a,c){var d=Object(o);if(!t(o)){var f=e(a,3);o=n(o),a=function(h){return f(d[h],h,d)}}var p=s(o,a,c);return p>-1?d[f?o[p]:p]:void 0}}return T0=r,T0}var I0,TA;function tZ(){if(TA)return I0;TA=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return I0=t,I0}var M0,IA;function nZ(){if(IA)return M0;IA=1;var e=tZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return M0=n,M0}var R0,MA;function rZ(){if(MA)return R0;MA=1;var e=nZ(),t=Kn(),n=ya(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var p=typeof f.valueOf=="function"?f.valueOf():f;f=t(p)?p+"":p}if(typeof f!="string")return f===0?f:+f;f=e(f);var h=o.test(f);return h||a.test(f)?c(f.slice(2),h?2:8):s.test(f)?r:+f}return R0=d,R0}var O0,RA;function z3(){if(RA)return O0;RA=1;var e=rZ(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var o=s<0?-1:1;return o*n}return s===s?s:0}return O0=r,O0}var P0,OA;function sZ(){if(OA)return P0;OA=1;var e=z3();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return P0=t,P0}var L0,PA;function oZ(){if(PA)return L0;PA=1;var e=O3(),t=ys(),n=sZ(),r=Math.max;function s(o,a,c){var d=o==null?0:o.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(o,t(a,3),f)}return L0=s,L0}var D0,LA;function iZ(){if(LA)return D0;LA=1;var e=eZ(),t=oZ(),n=e(t);return D0=n,D0}var $0,DA;function V3(){if(DA)return $0;DA=1;var e=N1();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return $0=t,$0}var F0,$A;function aZ(){if($A)return F0;$A=1;var e=v1(),t=h3(),n=Yo();function r(s,o){return s==null?s:e(s,t(o),n)}return F0=r,F0}var B0,FA;function lZ(){if(FA)return B0;FA=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return B0=e,B0}var q0,BA;function cZ(){if(BA)return q0;BA=1;var e=zf(),t=b1(),n=ys();function r(s,o){var a={};return o=n(o,3),t(s,function(c,d,f){e(a,d,o(c,d,f))}),a}return q0=r,q0}var z0,qA;function C1(){if(qA)return z0;qA=1;var e=ya();function t(n,r,s){for(var o=-1,a=n.length;++o<a;){var c=n[o],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):s(d,f)))var f=d,p=c}return p}return z0=t,z0}var V0,zA;function uZ(){if(zA)return V0;zA=1;function e(t,n){return t>n}return V0=e,V0}var H0,VA;function dZ(){if(VA)return H0;VA=1;var e=C1(),t=uZ(),n=Xo();function r(s){return s&&s.length?e(s,n,t):void 0}return H0=r,H0}var U0,HA;function H3(){if(HA)return U0;HA=1;var e=zf(),t=ha();function n(r,s,o){(o!==void 0&&!t(r[s],o)||o===void 0&&!(s in r))&&e(r,s,o)}return U0=n,U0}var W0,UA;function fZ(){if(UA)return W0;UA=1;var e=Ko(),t=Kf(),n=Gr(),r="[object Object]",s=Function.prototype,o=Object.prototype,a=s.toString,c=o.hasOwnProperty,d=a.call(Object);function f(p){if(!n(p)||e(p)!=r)return!1;var h=t(p);if(h===null)return!0;var g=c.call(h,"constructor")&&h.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==d}return W0=f,W0}var K0,WA;function U3(){if(WA)return K0;WA=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return K0=e,K0}var G0,KA;function hZ(){if(KA)return G0;KA=1;var e=vc(),t=Yo();function n(r){return e(r,t(r))}return G0=n,G0}var Y0,GA;function pZ(){if(GA)return Y0;GA=1;var e=H3(),t=e3(),n=c3(),r=t3(),s=d3(),o=bc(),a=Ct(),c=P3(),d=ma(),f=xc(),p=Kn(),h=fZ(),g=wc(),y=U3(),b=hZ();function w(v,k,_,N,S,A,I){var T=y(v,_),O=y(k,_),L=I.get(O);if(L){e(v,_,L);return}var z=A?A(T,O,_+"",v,k,I):void 0,M=z===void 0;if(M){var P=a(O),H=!P&&d(O),D=!P&&!H&&g(O);z=O,P||H||D?a(T)?z=T:c(T)?z=r(T):H?(M=!1,z=t(O,!0)):D?(M=!1,z=n(O,!0)):z=[]:h(O)||o(O)?(z=T,o(T)?z=b(T):(!p(T)||f(T))&&(z=s(O))):M=!1}M&&(I.set(O,z),S(z,O,N,A,I),I.delete(O)),e(v,_,z)}return Y0=w,Y0}var X0,YA;function mZ(){if(YA)return X0;YA=1;var e=qf(),t=H3(),n=v1(),r=pZ(),s=Kn(),o=Yo(),a=U3();function c(d,f,p,h,g){d!==f&&n(f,function(y,b){if(g||(g=new e),s(y))r(d,f,b,p,c,h,g);else{var w=h?h(a(d,b),y,b+"",d,f,g):void 0;w===void 0&&(w=y),t(d,b,w)}},o)}return X0=c,X0}var Q0,XA;function gZ(){if(XA)return Q0;XA=1;var e=Jf(),t=Zf();function n(r){return e(function(s,o){var a=-1,c=o.length,d=c>1?o[c-1]:void 0,f=c>2?o[2]:void 0;for(d=r.length>3&&typeof d=="function"?(c--,d):void 0,f&&t(o[0],o[1],f)&&(d=c<3?void 0:d,c=1),s=Object(s);++a<c;){var p=o[a];p&&r(s,p,a,d)}return s})}return Q0=n,Q0}var J0,QA;function yZ(){if(QA)return J0;QA=1;var e=mZ(),t=gZ(),n=t(function(r,s,o){e(r,s,o)});return J0=n,J0}var Z0,JA;function W3(){if(JA)return Z0;JA=1;function e(t,n){return t<n}return Z0=e,Z0}var ev,ZA;function xZ(){if(ZA)return ev;ZA=1;var e=C1(),t=W3(),n=Xo();function r(s){return s&&s.length?e(s,n,t):void 0}return ev=r,ev}var tv,eT;function vZ(){if(eT)return tv;eT=1;var e=C1(),t=ys(),n=W3();function r(s,o){return s&&s.length?e(s,t(o,2),n):void 0}return tv=r,tv}var nv,tT;function bZ(){if(tT)return nv;tT=1;var e=br(),t=function(){return e.Date.now()};return nv=t,nv}var rv,nT;function wZ(){if(nT)return rv;nT=1;var e=Vf(),t=Xf(),n=Hf(),r=Kn(),s=kc();function o(a,c,d,f){if(!r(a))return a;c=t(c,a);for(var p=-1,h=c.length,g=h-1,y=a;y!=null&&++p<h;){var b=s(c[p]),w=d;if(b==="__proto__"||b==="constructor"||b==="prototype")return a;if(p!=g){var v=y[b];w=f?f(v,b,y):void 0,w===void 0&&(w=r(v)?v:n(c[p+1])?[]:{})}e(y,b,w),y=y[b]}return a}return rv=o,rv}var sv,rT;function kZ(){if(rT)return sv;rT=1;var e=Qf(),t=wZ(),n=Xf();function r(s,o,a){for(var c=-1,d=o.length,f={};++c<d;){var p=o[c],h=e(s,p);a(h,p)&&t(f,n(p,s),h)}return f}return sv=r,sv}var ov,sT;function NZ(){if(sT)return ov;sT=1;var e=kZ(),t=S3();function n(r,s){return e(r,s,function(o,a){return t(r,a)})}return ov=n,ov}var iv,oT;function SZ(){if(oT)return iv;oT=1;var e=V3(),t=M3(),n=R3();function r(s){return n(t(s,void 0,e),s+"")}return iv=r,iv}var av,iT;function CZ(){if(iT)return av;iT=1;var e=NZ(),t=SZ(),n=t(function(r,s){return r==null?{}:e(r,s)});return av=n,av}var lv,aT;function _Z(){if(aT)return lv;aT=1;var e=Math.ceil,t=Math.max;function n(r,s,o,a){for(var c=-1,d=t(e((s-r)/(o||1)),0),f=Array(d);d--;)f[a?d:++c]=r,r+=o;return f}return lv=n,lv}var cv,lT;function EZ(){if(lT)return cv;lT=1;var e=_Z(),t=Zf(),n=z3();function r(s){return function(o,a,c){return c&&typeof c!="number"&&t(o,a,c)&&(a=c=void 0),o=n(o),a===void 0?(a=o,o=0):a=n(a),c=c===void 0?o<a?1:-1:n(c),e(o,a,c,s)}}return cv=r,cv}var uv,cT;function jZ(){if(cT)return uv;cT=1;var e=EZ(),t=e();return uv=t,uv}var dv,uT;function AZ(){if(uT)return dv;uT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return dv=e,dv}var fv,dT;function TZ(){if(dT)return fv;dT=1;var e=ya();function t(n,r){if(n!==r){var s=n!==void 0,o=n===null,a=n===n,c=e(n),d=r!==void 0,f=r===null,p=r===r,h=e(r);if(!f&&!h&&!c&&n>r||c&&d&&p&&!f&&!h||o&&d&&p||!s&&p||!a)return 1;if(!o&&!c&&!h&&n<r||h&&s&&a&&!o&&!c||f&&s&&a||!d&&a||!p)return-1}return 0}return fv=t,fv}var hv,fT;function IZ(){if(fT)return hv;fT=1;var e=TZ();function t(n,r,s){for(var o=-1,a=n.criteria,c=r.criteria,d=a.length,f=s.length;++o<d;){var p=e(a[o],c[o]);if(p){if(o>=f)return p;var h=s[o];return p*(h=="desc"?-1:1)}}return n.index-r.index}return hv=t,hv}var pv,hT;function MZ(){if(hT)return pv;hT=1;var e=Yf(),t=Qf(),n=ys(),r=A3(),s=AZ(),o=Uf(),a=IZ(),c=Xo(),d=Ct();function f(p,h,g){h.length?h=e(h,function(w){return d(w)?function(v){return t(v,w.length===1?w[0]:w)}:w}):h=[c];var y=-1;h=e(h,o(n));var b=r(p,function(w,v,k){var _=e(h,function(N){return N(w)});return{criteria:_,index:++y,value:w}});return s(b,function(w,v){return a(w,v,g)})}return pv=f,pv}var mv,pT;function RZ(){if(pT)return mv;pT=1;var e=N1(),t=MZ(),n=Jf(),r=Zf(),s=n(function(o,a){if(o==null)return[];var c=a.length;return c>1&&r(o,a[0],a[1])?a=[]:c>2&&r(a[0],a[1],a[2])&&(a=[a[0]]),t(o,e(a,1),[])});return mv=s,mv}var gv,mT;function OZ(){if(mT)return gv;mT=1;var e=k3(),t=0;function n(r){var s=++t;return e(r)+s}return gv=n,gv}var yv,gT;function PZ(){if(gT)return yv;gT=1;function e(t,n,r){for(var s=-1,o=t.length,a=n.length,c={};++s<o;){var d=s<a?n[s]:void 0;r(c,t[s],d)}return c}return yv=e,yv}var xv,yT;function LZ(){if(yT)return xv;yT=1;var e=Vf(),t=PZ();function n(r,s){return t(r||[],s||[],e)}return xv=n,xv}var vv,xT;function ut(){if(xT)return vv;xT=1;var e;if(typeof l1=="function")try{e={cloneDeep:JJ(),constant:x1(),defaults:ZJ(),each:m3(),filter:_3(),find:iZ(),flatten:V3(),forEach:p3(),forIn:aZ(),has:E3(),isUndefined:j3(),last:lZ(),map:T3(),mapValues:cZ(),max:dZ(),merge:yZ(),min:xZ(),minBy:vZ(),now:bZ(),pick:CZ(),range:jZ(),reduce:I3(),sortBy:RZ(),uniqueId:OZ(),values:L3(),zipObject:LZ()}}catch{}return e||(e=window._),vv=e,vv}var bv,vT;function DZ(){if(vT)return bv;vT=1,bv=e;function e(){var r={};r._next=r._prev=r,this._sentinel=r}e.prototype.dequeue=function(){var r=this._sentinel,s=r._prev;if(s!==r)return t(s),s},e.prototype.enqueue=function(r){var s=this._sentinel;r._prev&&r._next&&t(r),r._next=s._next,s._next._prev=r,s._next=r,r._prev=s},e.prototype.toString=function(){for(var r=[],s=this._sentinel,o=s._prev;o!==s;)r.push(JSON.stringify(o,n)),o=o._prev;return"["+r.join(", ")+"]"};function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,s){if(r!=="_next"&&r!=="_prev")return s}return bv}var wv,bT;function $Z(){if(bT)return wv;bT=1;var e=ut(),t=pr().Graph,n=DZ();wv=s;var r=e.constant(1);function s(f,p){if(f.nodeCount()<=1)return[];var h=c(f,p||r),g=o(h.graph,h.buckets,h.zeroIdx);return e.flatten(e.map(g,function(y){return f.outEdges(y.v,y.w)}),!0)}function o(f,p,h){for(var g=[],y=p[p.length-1],b=p[0],w;f.nodeCount();){for(;w=b.dequeue();)a(f,p,h,w);for(;w=y.dequeue();)a(f,p,h,w);if(f.nodeCount()){for(var v=p.length-2;v>0;--v)if(w=p[v].dequeue(),w){g=g.concat(a(f,p,h,w,!0));break}}}return g}function a(f,p,h,g,y){var b=y?[]:void 0;return e.forEach(f.inEdges(g.v),function(w){var v=f.edge(w),k=f.node(w.v);y&&b.push({v:w.v,w:w.w}),k.out-=v,d(p,h,k)}),e.forEach(f.outEdges(g.v),function(w){var v=f.edge(w),k=w.w,_=f.node(k);_.in-=v,d(p,h,_)}),f.removeNode(g.v),b}function c(f,p){var h=new t,g=0,y=0;e.forEach(f.nodes(),function(v){h.setNode(v,{v,in:0,out:0})}),e.forEach(f.edges(),function(v){var k=h.edge(v.v,v.w)||0,_=p(v),N=k+_;h.setEdge(v.v,v.w,N),y=Math.max(y,h.node(v.v).out+=_),g=Math.max(g,h.node(v.w).in+=_)});var b=e.range(y+g+3).map(function(){return new n}),w=g+1;return e.forEach(h.nodes(),function(v){d(b,w,h.node(v))}),{graph:h,buckets:b,zeroIdx:w}}function d(f,p,h){h.out?h.in?f[h.out-h.in+p].enqueue(h):f[f.length-1].enqueue(h):f[0].enqueue(h)}return wv}var kv,wT;function FZ(){if(wT)return kv;wT=1;var e=ut(),t=$Z();kv={run:n,undo:s};function n(o){var a=o.graph().acyclicer==="greedy"?t(o,c(o)):r(o);e.forEach(a,function(d){var f=o.edge(d);o.removeEdge(d),f.forwardName=d.name,f.reversed=!0,o.setEdge(d.w,d.v,f,e.uniqueId("rev"))});function c(d){return function(f){return d.edge(f).weight}}}function r(o){var a=[],c={},d={};function f(p){e.has(d,p)||(d[p]=!0,c[p]=!0,e.forEach(o.outEdges(p),function(h){e.has(c,h.w)?a.push(h):f(h.w)}),delete c[p])}return e.forEach(o.nodes(),f),a}function s(o){e.forEach(o.edges(),function(a){var c=o.edge(a);if(c.reversed){o.removeEdge(a);var d=c.forwardName;delete c.reversed,delete c.forwardName,o.setEdge(a.w,a.v,c,d)}})}return kv}var Nv,kT;function vn(){if(kT)return Nv;kT=1;var e=ut(),t=pr().Graph;Nv={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:o,predecessorWeights:a,intersectRect:c,buildLayerMatrix:d,normalizeRanks:f,removeEmptyRanks:p,addBorderNode:h,maxRank:g,partition:y,time:b,notime:w};function n(v,k,_,N){var S;do S=e.uniqueId(N);while(v.hasNode(S));return _.dummy=k,v.setNode(S,_),S}function r(v){var k=new t().setGraph(v.graph());return e.forEach(v.nodes(),function(_){k.setNode(_,v.node(_))}),e.forEach(v.edges(),function(_){var N=k.edge(_.v,_.w)||{weight:0,minlen:1},S=v.edge(_);k.setEdge(_.v,_.w,{weight:N.weight+S.weight,minlen:Math.max(N.minlen,S.minlen)})}),k}function s(v){var k=new t({multigraph:v.isMultigraph()}).setGraph(v.graph());return e.forEach(v.nodes(),function(_){v.children(_).length||k.setNode(_,v.node(_))}),e.forEach(v.edges(),function(_){k.setEdge(_,v.edge(_))}),k}function o(v){var k=e.map(v.nodes(),function(_){var N={};return e.forEach(v.outEdges(_),function(S){N[S.w]=(N[S.w]||0)+v.edge(S).weight}),N});return e.zipObject(v.nodes(),k)}function a(v){var k=e.map(v.nodes(),function(_){var N={};return e.forEach(v.inEdges(_),function(S){N[S.v]=(N[S.v]||0)+v.edge(S).weight}),N});return e.zipObject(v.nodes(),k)}function c(v,k){var _=v.x,N=v.y,S=k.x-_,A=k.y-N,I=v.width/2,T=v.height/2;if(!S&&!A)throw new Error("Not possible to find intersection inside of the rectangle");var O,L;return Math.abs(A)*I>Math.abs(S)*T?(A<0&&(T=-T),O=T*S/A,L=T):(S<0&&(I=-I),O=I,L=I*A/S),{x:_+O,y:N+L}}function d(v){var k=e.map(e.range(g(v)+1),function(){return[]});return e.forEach(v.nodes(),function(_){var N=v.node(_),S=N.rank;e.isUndefined(S)||(k[S][N.order]=_)}),k}function f(v){var k=e.min(e.map(v.nodes(),function(_){return v.node(_).rank}));e.forEach(v.nodes(),function(_){var N=v.node(_);e.has(N,"rank")&&(N.rank-=k)})}function p(v){var k=e.min(e.map(v.nodes(),function(A){return v.node(A).rank})),_=[];e.forEach(v.nodes(),function(A){var I=v.node(A).rank-k;_[I]||(_[I]=[]),_[I].push(A)});var N=0,S=v.graph().nodeRankFactor;e.forEach(_,function(A,I){e.isUndefined(A)&&I%S!==0?--N:N&&e.forEach(A,function(T){v.node(T).rank+=N})})}function h(v,k,_,N){var S={width:0,height:0};return arguments.length>=4&&(S.rank=_,S.order=N),n(v,"border",S,k)}function g(v){return e.max(e.map(v.nodes(),function(k){var _=v.node(k).rank;if(!e.isUndefined(_))return _}))}function y(v,k){var _={lhs:[],rhs:[]};return e.forEach(v,function(N){k(N)?_.lhs.push(N):_.rhs.push(N)}),_}function b(v,k){var _=e.now();try{return k()}finally{console.log(v+" time: "+(e.now()-_)+"ms")}}function w(v,k){return k()}return Nv}var Sv,NT;function BZ(){if(NT)return Sv;NT=1;var e=ut(),t=vn();Sv={run:n,undo:s};function n(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(a){r(o,a)})}function r(o,a){var c=a.v,d=o.node(c).rank,f=a.w,p=o.node(f).rank,h=a.name,g=o.edge(a),y=g.labelRank;if(p!==d+1){o.removeEdge(a);var b,w,v;for(v=0,++d;d<p;++v,++d)g.points=[],w={width:0,height:0,edgeLabel:g,edgeObj:a,rank:d},b=t.addDummyNode(o,"edge",w,"_d"),d===y&&(w.width=g.width,w.height=g.height,w.dummy="edge-label",w.labelpos=g.labelpos),o.setEdge(c,b,{weight:g.weight},h),v===0&&o.graph().dummyChains.push(b),c=b;o.setEdge(c,f,{weight:g.weight},h)}}function s(o){e.forEach(o.graph().dummyChains,function(a){var c=o.node(a),d=c.edgeLabel,f;for(o.setEdge(c.edgeObj,d);c.dummy;)f=o.successors(a)[0],o.removeNode(a),d.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(d.x=c.x,d.y=c.y,d.width=c.width,d.height=c.height),a=f,c=o.node(a)})}return Sv}var Cv,ST;function Kd(){if(ST)return Cv;ST=1;var e=ut();Cv={longestPath:t,slack:n};function t(r){var s={};function o(a){var c=r.node(a);if(e.has(s,a))return c.rank;s[a]=!0;var d=e.min(e.map(r.outEdges(a),function(f){return o(f.w)-r.edge(f).minlen}));return(d===Number.POSITIVE_INFINITY||d===void 0||d===null)&&(d=0),c.rank=d}e.forEach(r.sources(),o)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return Cv}var _v,CT;function K3(){if(CT)return _v;CT=1;var e=ut(),t=pr().Graph,n=Kd().slack;_v=r;function r(c){var d=new t({directed:!1}),f=c.nodes()[0],p=c.nodeCount();d.setNode(f,{});for(var h,g;s(d,c)<p;)h=o(d,c),g=d.hasNode(h.v)?n(c,h):-n(c,h),a(d,c,g);return d}function s(c,d){function f(p){e.forEach(d.nodeEdges(p),function(h){var g=h.v,y=p===g?h.w:g;!c.hasNode(y)&&!n(d,h)&&(c.setNode(y,{}),c.setEdge(p,y,{}),f(y))})}return e.forEach(c.nodes(),f),c.nodeCount()}function o(c,d){return e.minBy(d.edges(),function(f){if(c.hasNode(f.v)!==c.hasNode(f.w))return n(d,f)})}function a(c,d,f){e.forEach(c.nodes(),function(p){d.node(p).rank+=f})}return _v}var Ev,_T;function qZ(){if(_T)return Ev;_T=1;var e=ut(),t=K3(),n=Kd().slack,r=Kd().longestPath,s=pr().alg.preorder,o=pr().alg.postorder,a=vn().simplify;Ev=c,c.initLowLimValues=h,c.initCutValues=d,c.calcCutValue=p,c.leaveEdge=y,c.enterEdge=b,c.exchangeEdges=w;function c(N){N=a(N),r(N);var S=t(N);h(S),d(S,N);for(var A,I;A=y(S);)I=b(S,N,A),w(S,N,A,I)}function d(N,S){var A=o(N,N.nodes());A=A.slice(0,A.length-1),e.forEach(A,function(I){f(N,S,I)})}function f(N,S,A){var I=N.node(A),T=I.parent;N.edge(A,T).cutvalue=p(N,S,A)}function p(N,S,A){var I=N.node(A),T=I.parent,O=!0,L=S.edge(A,T),z=0;return L||(O=!1,L=S.edge(T,A)),z=L.weight,e.forEach(S.nodeEdges(A),function(M){var P=M.v===A,H=P?M.w:M.v;if(H!==T){var D=P===O,V=S.edge(M).weight;if(z+=D?V:-V,k(N,A,H)){var $=N.edge(A,H).cutvalue;z+=D?-$:$}}}),z}function h(N,S){arguments.length<2&&(S=N.nodes()[0]),g(N,{},1,S)}function g(N,S,A,I,T){var O=A,L=N.node(I);return S[I]=!0,e.forEach(N.neighbors(I),function(z){e.has(S,z)||(A=g(N,S,A,z,I))}),L.low=O,L.lim=A++,T?L.parent=T:delete L.parent,A}function y(N){return e.find(N.edges(),function(S){return N.edge(S).cutvalue<0})}function b(N,S,A){var I=A.v,T=A.w;S.hasEdge(I,T)||(I=A.w,T=A.v);var O=N.node(I),L=N.node(T),z=O,M=!1;O.lim>L.lim&&(z=L,M=!0);var P=e.filter(S.edges(),function(H){return M===_(N,N.node(H.v),z)&&M!==_(N,N.node(H.w),z)});return e.minBy(P,function(H){return n(S,H)})}function w(N,S,A,I){var T=A.v,O=A.w;N.removeEdge(T,O),N.setEdge(I.v,I.w,{}),h(N),d(N,S),v(N,S)}function v(N,S){var A=e.find(N.nodes(),function(T){return!S.node(T).parent}),I=s(N,A);I=I.slice(1),e.forEach(I,function(T){var O=N.node(T).parent,L=S.edge(T,O),z=!1;L||(L=S.edge(O,T),z=!0),S.node(T).rank=S.node(O).rank+(z?L.minlen:-L.minlen)})}function k(N,S,A){return N.hasEdge(S,A)}function _(N,S,A){return A.low<=S.lim&&S.lim<=A.lim}return Ev}var jv,ET;function zZ(){if(ET)return jv;ET=1;var e=Kd(),t=e.longestPath,n=K3(),r=qZ();jv=s;function s(d){switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":a(d);break;case"longest-path":o(d);break;default:c(d)}}var o=t;function a(d){t(d),n(d)}function c(d){r(d)}return jv}var Av,jT;function VZ(){if(jT)return Av;jT=1;var e=ut();Av=t;function t(s){var o=r(s);e.forEach(s.graph().dummyChains,function(a){for(var c=s.node(a),d=c.edgeObj,f=n(s,o,d.v,d.w),p=f.path,h=f.lca,g=0,y=p[g],b=!0;a!==d.w;){if(c=s.node(a),b){for(;(y=p[g])!==h&&s.node(y).maxRank<c.rank;)g++;y===h&&(b=!1)}if(!b){for(;g<p.length-1&&s.node(y=p[g+1]).minRank<=c.rank;)g++;y=p[g]}s.setParent(a,y),a=s.successors(a)[0]}})}function n(s,o,a,c){var d=[],f=[],p=Math.min(o[a].low,o[c].low),h=Math.max(o[a].lim,o[c].lim),g,y;g=a;do g=s.parent(g),d.push(g);while(g&&(o[g].low>p||h>o[g].lim));for(y=g,g=c;(g=s.parent(g))!==y;)f.push(g);return{path:d.concat(f.reverse()),lca:y}}function r(s){var o={},a=0;function c(d){var f=a;e.forEach(s.children(d),c),o[d]={low:f,lim:a++}}return e.forEach(s.children(),c),o}return Av}var Tv,AT;function HZ(){if(AT)return Tv;AT=1;var e=ut(),t=vn();Tv={run:n,cleanup:a};function n(c){var d=t.addDummyNode(c,"root",{},"_root"),f=s(c),p=e.max(e.values(f))-1,h=2*p+1;c.graph().nestingRoot=d,e.forEach(c.edges(),function(y){c.edge(y).minlen*=h});var g=o(c)+1;e.forEach(c.children(),function(y){r(c,d,h,g,p,f,y)}),c.graph().nodeRankFactor=h}function r(c,d,f,p,h,g,y){var b=c.children(y);if(!b.length){y!==d&&c.setEdge(d,y,{weight:0,minlen:f});return}var w=t.addBorderNode(c,"_bt"),v=t.addBorderNode(c,"_bb"),k=c.node(y);c.setParent(w,y),k.borderTop=w,c.setParent(v,y),k.borderBottom=v,e.forEach(b,function(_){r(c,d,f,p,h,g,_);var N=c.node(_),S=N.borderTop?N.borderTop:_,A=N.borderBottom?N.borderBottom:_,I=N.borderTop?p:2*p,T=S!==A?1:h-g[y]+1;c.setEdge(w,S,{weight:I,minlen:T,nestingEdge:!0}),c.setEdge(A,v,{weight:I,minlen:T,nestingEdge:!0})}),c.parent(y)||c.setEdge(d,w,{weight:0,minlen:h+g[y]})}function s(c){var d={};function f(p,h){var g=c.children(p);g&&g.length&&e.forEach(g,function(y){f(y,h+1)}),d[p]=h}return e.forEach(c.children(),function(p){f(p,1)}),d}function o(c){return e.reduce(c.edges(),function(d,f){return d+c.edge(f).weight},0)}function a(c){var d=c.graph();c.removeNode(d.nestingRoot),delete d.nestingRoot,e.forEach(c.edges(),function(f){var p=c.edge(f);p.nestingEdge&&c.removeEdge(f)})}return Tv}var Iv,TT;function UZ(){if(TT)return Iv;TT=1;var e=ut(),t=vn();Iv=n;function n(s){function o(a){var c=s.children(a),d=s.node(a);if(c.length&&e.forEach(c,o),e.has(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(var f=d.minRank,p=d.maxRank+1;f<p;++f)r(s,"borderLeft","_bl",a,d,f),r(s,"borderRight","_br",a,d,f)}}e.forEach(s.children(),o)}function r(s,o,a,c,d,f){var p={width:0,height:0,rank:f,borderType:o},h=d[o][f-1],g=t.addDummyNode(s,"border",p,a);d[o][f]=g,s.setParent(g,c),h&&s.setEdge(h,g,{weight:1})}return Iv}var Mv,IT;function WZ(){if(IT)return Mv;IT=1;var e=ut();Mv={adjust:t,undo:n};function t(f){var p=f.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&r(f)}function n(f){var p=f.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&o(f),(p==="lr"||p==="rl")&&(c(f),r(f))}function r(f){e.forEach(f.nodes(),function(p){s(f.node(p))}),e.forEach(f.edges(),function(p){s(f.edge(p))})}function s(f){var p=f.width;f.width=f.height,f.height=p}function o(f){e.forEach(f.nodes(),function(p){a(f.node(p))}),e.forEach(f.edges(),function(p){var h=f.edge(p);e.forEach(h.points,a),e.has(h,"y")&&a(h)})}function a(f){f.y=-f.y}function c(f){e.forEach(f.nodes(),function(p){d(f.node(p))}),e.forEach(f.edges(),function(p){var h=f.edge(p);e.forEach(h.points,d),e.has(h,"x")&&d(h)})}function d(f){var p=f.x;f.x=f.y,f.y=p}return Mv}var Rv,MT;function KZ(){if(MT)return Rv;MT=1;var e=ut();Rv=t;function t(n){var r={},s=e.filter(n.nodes(),function(f){return!n.children(f).length}),o=e.max(e.map(s,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 p=n.node(f);a[p.rank].push(f),e.forEach(n.successors(f),c)}}var d=e.sortBy(s,function(f){return n.node(f).rank});return e.forEach(d,c),a}return Rv}var Ov,RT;function GZ(){if(RT)return Ov;RT=1;var e=ut();Ov=t;function t(r,s){for(var o=0,a=1;a<s.length;++a)o+=n(r,s[a-1],s[a]);return o}function n(r,s,o){for(var a=e.zipObject(o,e.map(o,function(g,y){return y})),c=e.flatten(e.map(s,function(g){return e.sortBy(e.map(r.outEdges(g),function(y){return{pos:a[y.w],weight:r.edge(y).weight}}),"pos")}),!0),d=1;d<o.length;)d<<=1;var f=2*d-1;d-=1;var p=e.map(new Array(f),function(){return 0}),h=0;return e.forEach(c.forEach(function(g){var y=g.pos+d;p[y]+=g.weight;for(var b=0;y>0;)y%2&&(b+=p[y+1]),y=y-1>>1,p[y]+=g.weight;h+=g.weight*b})),h}return Ov}var Pv,OT;function YZ(){if(OT)return Pv;OT=1;var e=ut();Pv=t;function t(n,r){return e.map(r,function(s){var o=n.inEdges(s);if(o.length){var a=e.reduce(o,function(c,d){var f=n.edge(d),p=n.node(d.v);return{sum:c.sum+f.weight*p.order,weight:c.weight+f.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return Pv}var Lv,PT;function XZ(){if(PT)return Lv;PT=1;var e=ut();Lv=t;function t(s,o){var a={};e.forEach(s,function(d,f){var p=a[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:f};e.isUndefined(d.barycenter)||(p.barycenter=d.barycenter,p.weight=d.weight)}),e.forEach(o.edges(),function(d){var f=a[d.v],p=a[d.w];!e.isUndefined(f)&&!e.isUndefined(p)&&(p.indegree++,f.out.push(a[d.w]))});var c=e.filter(a,function(d){return!d.indegree});return n(c)}function n(s){var o=[];function a(f){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(f.barycenter)||p.barycenter>=f.barycenter)&&r(f,p)}}function c(f){return function(p){p.in.push(f),--p.indegree===0&&s.push(p)}}for(;s.length;){var d=s.pop();o.push(d),e.forEach(d.in.reverse(),a(d)),e.forEach(d.out,c(d))}return e.map(e.filter(o,function(f){return!f.merged}),function(f){return e.pick(f,["vs","i","barycenter","weight"])})}function r(s,o){var a=0,c=0;s.weight&&(a+=s.barycenter*s.weight,c+=s.weight),o.weight&&(a+=o.barycenter*o.weight,c+=o.weight),s.vs=o.vs.concat(s.vs),s.barycenter=a/c,s.weight=c,s.i=Math.min(o.i,s.i),o.merged=!0}return Lv}var Dv,LT;function QZ(){if(LT)return Dv;LT=1;var e=ut(),t=vn();Dv=n;function n(o,a){var c=t.partition(o,function(w){return e.has(w,"barycenter")}),d=c.lhs,f=e.sortBy(c.rhs,function(w){return-w.i}),p=[],h=0,g=0,y=0;d.sort(s(!!a)),y=r(p,f,y),e.forEach(d,function(w){y+=w.vs.length,p.push(w.vs),h+=w.barycenter*w.weight,g+=w.weight,y=r(p,f,y)});var b={vs:e.flatten(p,!0)};return g&&(b.barycenter=h/g,b.weight=g),b}function r(o,a,c){for(var d;a.length&&(d=e.last(a)).i<=c;)a.pop(),o.push(d.vs),c++;return c}function s(o){return function(a,c){return a.barycenter<c.barycenter?-1:a.barycenter>c.barycenter?1:o?c.i-a.i:a.i-c.i}}return Dv}var $v,DT;function JZ(){if(DT)return $v;DT=1;var e=ut(),t=YZ(),n=XZ(),r=QZ();$v=s;function s(c,d,f,p){var h=c.children(d),g=c.node(d),y=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,w={};y&&(h=e.filter(h,function(A){return A!==y&&A!==b}));var v=t(c,h);e.forEach(v,function(A){if(c.children(A.v).length){var I=s(c,A.v,f,p);w[A.v]=I,e.has(I,"barycenter")&&a(A,I)}});var k=n(v,f);o(k,w);var _=r(k,p);if(y&&(_.vs=e.flatten([y,_.vs,b],!0),c.predecessors(y).length)){var N=c.node(c.predecessors(y)[0]),S=c.node(c.predecessors(b)[0]);e.has(_,"barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+N.order+S.order)/(_.weight+2),_.weight+=2}return _}function o(c,d){e.forEach(c,function(f){f.vs=e.flatten(f.vs.map(function(p){return d[p]?d[p].vs:p}),!0)})}function a(c,d){e.isUndefined(c.barycenter)?(c.barycenter=d.barycenter,c.weight=d.weight):(c.barycenter=(c.barycenter*c.weight+d.barycenter*d.weight)/(c.weight+d.weight),c.weight+=d.weight)}return $v}var Fv,$T;function ZZ(){if($T)return Fv;$T=1;var e=ut(),t=pr().Graph;Fv=n;function n(s,o,a){var c=r(s),d=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(f){return s.node(f)});return e.forEach(s.nodes(),function(f){var p=s.node(f),h=s.parent(f);(p.rank===o||p.minRank<=o&&o<=p.maxRank)&&(d.setNode(f),d.setParent(f,h||c),e.forEach(s[a](f),function(g){var y=g.v===f?g.w:g.v,b=d.edge(y,f),w=e.isUndefined(b)?0:b.weight;d.setEdge(y,f,{weight:s.edge(g).weight+w})}),e.has(p,"minRank")&&d.setNode(f,{borderLeft:p.borderLeft[o],borderRight:p.borderRight[o]}))}),d}function r(s){for(var o;s.hasNode(o=e.uniqueId("_root")););return o}return Fv}var Bv,FT;function eee(){if(FT)return Bv;FT=1;var e=ut();Bv=t;function t(n,r,s){var o={},a;e.forEach(s,function(c){for(var d=n.parent(c),f,p;d;){if(f=n.parent(d),f?(p=o[f],o[f]=d):(p=a,a=d),p&&p!==d){r.setEdge(p,d);return}d=f}})}return Bv}var qv,BT;function tee(){if(BT)return qv;BT=1;var e=ut(),t=KZ(),n=GZ(),r=JZ(),s=ZZ(),o=eee(),a=pr().Graph,c=vn();qv=d;function d(g){var y=c.maxRank(g),b=f(g,e.range(1,y+1),"inEdges"),w=f(g,e.range(y-1,-1,-1),"outEdges"),v=t(g);h(g,v);for(var k=Number.POSITIVE_INFINITY,_,N=0,S=0;S<4;++N,++S){p(N%2?b:w,N%4>=2),v=c.buildLayerMatrix(g);var A=n(g,v);A<k&&(S=0,_=e.cloneDeep(v),k=A)}h(g,_)}function f(g,y,b){return e.map(y,function(w){return s(g,w,b)})}function p(g,y){var b=new a;e.forEach(g,function(w){var v=w.graph().root,k=r(w,v,b,y);e.forEach(k.vs,function(_,N){w.node(_).order=N}),o(w,b,k.vs)})}function h(g,y){e.forEach(y,function(b){e.forEach(b,function(w,v){g.node(w).order=v})})}return qv}var zv,qT;function nee(){if(qT)return zv;qT=1;var e=ut(),t=pr().Graph,n=vn();zv={positionX:b,findType1Conflicts:r,findType2Conflicts:s,addConflict:a,hasConflict:c,verticalAlignment:d,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:h,balance:y};function r(k,_){var N={};function S(A,I){var T=0,O=0,L=A.length,z=e.last(I);return e.forEach(I,function(M,P){var H=o(k,M),D=H?k.node(H).order:L;(H||M===z)&&(e.forEach(I.slice(O,P+1),function(V){e.forEach(k.predecessors(V),function($){var U=k.node($),B=U.order;(B<T||D<B)&&!(U.dummy&&k.node(V).dummy)&&a(N,$,V)})}),O=P+1,T=D)}),I}return e.reduce(_,S),N}function s(k,_){var N={};function S(I,T,O,L,z){var M;e.forEach(e.range(T,O),function(P){M=I[P],k.node(M).dummy&&e.forEach(k.predecessors(M),function(H){var D=k.node(H);D.dummy&&(D.order<L||D.order>z)&&a(N,H,M)})})}function A(I,T){var O=-1,L,z=0;return e.forEach(T,function(M,P){if(k.node(M).dummy==="border"){var H=k.predecessors(M);H.length&&(L=k.node(H[0]).order,S(T,z,P,O,L),z=P,O=L)}S(T,z,T.length,L,I.length)}),T}return e.reduce(_,A),N}function o(k,_){if(k.node(_).dummy)return e.find(k.predecessors(_),function(N){return k.node(N).dummy})}function a(k,_,N){if(_>N){var S=_;_=N,N=S}var A=k[_];A||(k[_]=A={}),A[N]=!0}function c(k,_,N){if(_>N){var S=_;_=N,N=S}return e.has(k[_],N)}function d(k,_,N,S){var A={},I={},T={};return e.forEach(_,function(O){e.forEach(O,function(L,z){A[L]=L,I[L]=L,T[L]=z})}),e.forEach(_,function(O){var L=-1;e.forEach(O,function(z){var M=S(z);if(M.length){M=e.sortBy(M,function($){return T[$]});for(var P=(M.length-1)/2,H=Math.floor(P),D=Math.ceil(P);H<=D;++H){var V=M[H];I[z]===z&&L<T[V]&&!c(N,z,V)&&(I[V]=z,I[z]=A[z]=A[V],L=T[V])}}})}),{root:A,align:I}}function f(k,_,N,S,A){var I={},T=p(k,_,N,A),O=A?"borderLeft":"borderRight";function L(P,H){for(var D=T.nodes(),V=D.pop(),$={};V;)$[V]?P(V):($[V]=!0,D.push(V),D=D.concat(H(V))),V=D.pop()}function z(P){I[P]=T.inEdges(P).reduce(function(H,D){return Math.max(H,I[D.v]+T.edge(D))},0)}function M(P){var H=T.outEdges(P).reduce(function(V,$){return Math.min(V,I[$.w]-T.edge($))},Number.POSITIVE_INFINITY),D=k.node(P);H!==Number.POSITIVE_INFINITY&&D.borderType!==O&&(I[P]=Math.max(I[P],H))}return L(z,T.predecessors.bind(T)),L(M,T.successors.bind(T)),e.forEach(S,function(P){I[P]=I[N[P]]}),I}function p(k,_,N,S){var A=new t,I=k.graph(),T=w(I.nodesep,I.edgesep,S);return e.forEach(_,function(O){var L;e.forEach(O,function(z){var M=N[z];if(A.setNode(M),L){var P=N[L],H=A.edge(P,M);A.setEdge(P,M,Math.max(T(k,z,L),H||0))}L=z})}),A}function h(k,_){return e.minBy(e.values(_),function(N){var S=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;return e.forIn(N,function(I,T){var O=v(k,T)/2;S=Math.max(I+O,S),A=Math.min(I-O,A)}),S-A})}function g(k,_){var N=e.values(_),S=e.min(N),A=e.max(N);e.forEach(["u","d"],function(I){e.forEach(["l","r"],function(T){var O=I+T,L=k[O],z;if(L!==_){var M=e.values(L);z=T==="l"?S-e.min(M):A-e.max(M),z&&(k[O]=e.mapValues(L,function(P){return P+z}))}})})}function y(k,_){return e.mapValues(k.ul,function(N,S){if(_)return k[_.toLowerCase()][S];var A=e.sortBy(e.map(k,S));return(A[1]+A[2])/2})}function b(k){var _=n.buildLayerMatrix(k),N=e.merge(r(k,_),s(k,_)),S={},A;e.forEach(["u","d"],function(T){A=T==="u"?_:e.values(_).reverse(),e.forEach(["l","r"],function(O){O==="r"&&(A=e.map(A,function(P){return e.values(P).reverse()}));var L=(T==="u"?k.predecessors:k.successors).bind(k),z=d(k,A,N,L),M=f(k,A,z.root,z.align,O==="r");O==="r"&&(M=e.mapValues(M,function(P){return-P})),S[T+O]=M})});var I=h(k,S);return g(S,I),y(S,k.graph().align)}function w(k,_,N){return function(S,A,I){var T=S.node(A),O=S.node(I),L=0,z;if(L+=T.width/2,e.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":z=-T.width/2;break;case"r":z=T.width/2;break}if(z&&(L+=N?z:-z),z=0,L+=(T.dummy?_:k)/2,L+=(O.dummy?_:k)/2,L+=O.width/2,e.has(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":z=O.width/2;break;case"r":z=-O.width/2;break}return z&&(L+=N?z:-z),z=0,L}}function v(k,_){return k.node(_).width}return zv}var Vv,zT;function ree(){if(zT)return Vv;zT=1;var e=ut(),t=vn(),n=nee().positionX;Vv=r;function r(o){o=t.asNonCompoundGraph(o),s(o),e.forEach(n(o),function(a,c){o.node(c).x=a})}function s(o){var a=t.buildLayerMatrix(o),c=o.graph().ranksep,d=0;e.forEach(a,function(f){var p=e.max(e.map(f,function(h){return o.node(h).height}));e.forEach(f,function(h){o.node(h).y=d+p/2}),d+=p+c})}return Vv}var Hv,VT;function see(){if(VT)return Hv;VT=1;var e=ut(),t=FZ(),n=BZ(),r=zZ(),s=vn().normalizeRanks,o=VZ(),a=vn().removeEmptyRanks,c=HZ(),d=UZ(),f=WZ(),p=tee(),h=ree(),g=vn(),y=pr().Graph;Hv=b;function b(W,X){var Z=X&&X.debugTiming?g.time:g.notime;Z("layout",function(){var ne=Z(" buildLayoutGraph",function(){return L(W)});Z(" runLayout",function(){w(ne,Z)}),Z(" updateInputGraph",function(){v(W,ne)})})}function w(W,X){X(" makeSpaceForEdgeLabels",function(){z(W)}),X(" removeSelfEdges",function(){q(W)}),X(" acyclic",function(){t.run(W)}),X(" nestingGraph.run",function(){c.run(W)}),X(" rank",function(){r(g.asNonCompoundGraph(W))}),X(" injectEdgeLabelProxies",function(){M(W)}),X(" removeEmptyRanks",function(){a(W)}),X(" nestingGraph.cleanup",function(){c.cleanup(W)}),X(" normalizeRanks",function(){s(W)}),X(" assignRankMinMax",function(){P(W)}),X(" removeEdgeLabelProxies",function(){H(W)}),X(" normalize.run",function(){n.run(W)}),X(" parentDummyChains",function(){o(W)}),X(" addBorderSegments",function(){d(W)}),X(" order",function(){p(W)}),X(" insertSelfEdges",function(){Y(W)}),X(" adjustCoordinateSystem",function(){f.adjust(W)}),X(" position",function(){h(W)}),X(" positionSelfEdges",function(){F(W)}),X(" removeBorderNodes",function(){B(W)}),X(" normalize.undo",function(){n.undo(W)}),X(" fixupEdgeLabelCoords",function(){$(W)}),X(" undoCoordinateSystem",function(){f.undo(W)}),X(" translateGraph",function(){D(W)}),X(" assignNodeIntersects",function(){V(W)}),X(" reversePoints",function(){U(W)}),X(" acyclic.undo",function(){t.undo(W)})}function v(W,X){e.forEach(W.nodes(),function(Z){var ne=W.node(Z),te=X.node(Z);ne&&(ne.x=te.x,ne.y=te.y,X.children(Z).length&&(ne.width=te.width,ne.height=te.height))}),e.forEach(W.edges(),function(Z){var ne=W.edge(Z),te=X.edge(Z);ne.points=te.points,e.has(te,"x")&&(ne.x=te.x,ne.y=te.y)}),W.graph().width=X.graph().width,W.graph().height=X.graph().height}var k=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},N=["acyclicer","ranker","rankdir","align"],S=["width","height"],A={width:0,height:0},I=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function L(W){var X=new y({multigraph:!0,compound:!0}),Z=ee(W.graph());return X.setGraph(e.merge({},_,K(Z,k),e.pick(Z,N))),e.forEach(W.nodes(),function(ne){var te=ee(W.node(ne));X.setNode(ne,e.defaults(K(te,S),A)),X.setParent(ne,W.parent(ne))}),e.forEach(W.edges(),function(ne){var te=ee(W.edge(ne));X.setEdge(ne,e.merge({},T,K(te,I),e.pick(te,O)))}),X}function z(W){var X=W.graph();X.ranksep/=2,e.forEach(W.edges(),function(Z){var ne=W.edge(Z);ne.minlen*=2,ne.labelpos.toLowerCase()!=="c"&&(X.rankdir==="TB"||X.rankdir==="BT"?ne.width+=ne.labeloffset:ne.height+=ne.labeloffset)})}function M(W){e.forEach(W.edges(),function(X){var Z=W.edge(X);if(Z.width&&Z.height){var ne=W.node(X.v),te=W.node(X.w),ie={rank:(te.rank-ne.rank)/2+ne.rank,e:X};g.addDummyNode(W,"edge-proxy",ie,"_ep")}})}function P(W){var X=0;e.forEach(W.nodes(),function(Z){var ne=W.node(Z);ne.borderTop&&(ne.minRank=W.node(ne.borderTop).rank,ne.maxRank=W.node(ne.borderBottom).rank,X=e.max(X,ne.maxRank))}),W.graph().maxRank=X}function H(W){e.forEach(W.nodes(),function(X){var Z=W.node(X);Z.dummy==="edge-proxy"&&(W.edge(Z.e).labelRank=Z.rank,W.removeNode(X))})}function D(W){var X=Number.POSITIVE_INFINITY,Z=0,ne=Number.POSITIVE_INFINITY,te=0,ie=W.graph(),he=ie.marginx||0,xe=ie.marginy||0;function ve(ye){var _e=ye.x,we=ye.y,Te=ye.width,Ne=ye.height;X=Math.min(X,_e-Te/2),Z=Math.max(Z,_e+Te/2),ne=Math.min(ne,we-Ne/2),te=Math.max(te,we+Ne/2)}e.forEach(W.nodes(),function(ye){ve(W.node(ye))}),e.forEach(W.edges(),function(ye){var _e=W.edge(ye);e.has(_e,"x")&&ve(_e)}),X-=he,ne-=xe,e.forEach(W.nodes(),function(ye){var _e=W.node(ye);_e.x-=X,_e.y-=ne}),e.forEach(W.edges(),function(ye){var _e=W.edge(ye);e.forEach(_e.points,function(we){we.x-=X,we.y-=ne}),e.has(_e,"x")&&(_e.x-=X),e.has(_e,"y")&&(_e.y-=ne)}),ie.width=Z-X+he,ie.height=te-ne+xe}function V(W){e.forEach(W.edges(),function(X){var Z=W.edge(X),ne=W.node(X.v),te=W.node(X.w),ie,he;Z.points?(ie=Z.points[0],he=Z.points[Z.points.length-1]):(Z.points=[],ie=te,he=ne),Z.points.unshift(g.intersectRect(ne,ie)),Z.points.push(g.intersectRect(te,he))})}function $(W){e.forEach(W.edges(),function(X){var Z=W.edge(X);if(e.has(Z,"x"))switch((Z.labelpos==="l"||Z.labelpos==="r")&&(Z.width-=Z.labeloffset),Z.labelpos){case"l":Z.x-=Z.width/2+Z.labeloffset;break;case"r":Z.x+=Z.width/2+Z.labeloffset;break}})}function U(W){e.forEach(W.edges(),function(X){var Z=W.edge(X);Z.reversed&&Z.points.reverse()})}function B(W){e.forEach(W.nodes(),function(X){if(W.children(X).length){var Z=W.node(X),ne=W.node(Z.borderTop),te=W.node(Z.borderBottom),ie=W.node(e.last(Z.borderLeft)),he=W.node(e.last(Z.borderRight));Z.width=Math.abs(he.x-ie.x),Z.height=Math.abs(te.y-ne.y),Z.x=ie.x+Z.width/2,Z.y=ne.y+Z.height/2}}),e.forEach(W.nodes(),function(X){W.node(X).dummy==="border"&&W.removeNode(X)})}function q(W){e.forEach(W.edges(),function(X){if(X.v===X.w){var Z=W.node(X.v);Z.selfEdges||(Z.selfEdges=[]),Z.selfEdges.push({e:X,label:W.edge(X)}),W.removeEdge(X)}})}function Y(W){var X=g.buildLayerMatrix(W);e.forEach(X,function(Z){var ne=0;e.forEach(Z,function(te,ie){var he=W.node(te);he.order=ie+ne,e.forEach(he.selfEdges,function(xe){g.addDummyNode(W,"selfedge",{width:xe.label.width,height:xe.label.height,rank:he.rank,order:ie+ ++ne,e:xe.e,label:xe.label},"_se")}),delete he.selfEdges})})}function F(W){e.forEach(W.nodes(),function(X){var Z=W.node(X);if(Z.dummy==="selfedge"){var ne=W.node(Z.e.v),te=ne.x+ne.width/2,ie=ne.y,he=Z.x-te,xe=ne.height/2;W.setEdge(Z.e,Z.label),W.removeNode(X),Z.label.points=[{x:te+2*he/3,y:ie-xe},{x:te+5*he/6,y:ie-xe},{x:te+he,y:ie},{x:te+5*he/6,y:ie+xe},{x:te+2*he/3,y:ie+xe}],Z.label.x=Z.x,Z.label.y=Z.y}})}function K(W,X){return e.mapValues(e.pick(W,X),Number)}function ee(W){var X={};return e.forEach(W,function(Z,ne){X[ne.toLowerCase()]=Z}),X}return Hv}var Uv,HT;function oee(){if(HT)return Uv;HT=1;var e=ut(),t=vn(),n=pr().Graph;Uv={debugOrdering:r};function r(s){var o=t.buildLayerMatrix(s),a=new n({compound:!0,multigraph:!0}).setGraph({});return e.forEach(s.nodes(),function(c){a.setNode(c,{label:c}),a.setParent(c,"layer"+s.node(c).rank)}),e.forEach(s.edges(),function(c){a.setEdge(c.v,c.w,{},c.name)}),e.forEach(o,function(c,d){var f="layer"+d;a.setNode(f,{rank:"same"}),e.reduce(c,function(p,h){return a.setEdge(p,h,{style:"invis"}),h})}),a}return Uv}var Wv,UT;function iee(){return UT||(UT=1,Wv="0.8.5"),Wv}var Kv,WT;function aee(){return WT||(WT=1,Kv={graphlib:pr(),layout:see(),debug:oee(),util:{time:vn().time,notime:vn().notime},version:iee()}),Kv}var lee=aee();const KT=Yl(lee),GT={step:{width:240,height:110},trigger:{width:220,height:90},"control-flow":{width:260,height:130},switch:{width:280,height:140},parallel:{width:280,height:140},output:{width:200,height:80}},YT={width:240,height:110};function G3(e,t,n){if(e.length===0)return e;const r=new KT.graphlib.Graph;r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:"TB",nodesep:80,ranksep:100});for(const s of e){const o=GT[s.type??""]??YT;r.setNode(s.id,{width:o.width,height:o.height})}for(const s of t)r.setEdge(s.source,s.target);return KT.layout(r),e.map(s=>{const o=r.node(s.id),a=GT[s.type??""]??YT;return{...s,position:{x:o.x-a.width/2,y:o.y-a.height/2}}})}function _1(){const{nodes:e,edges:t,setNodes:n,setEdges:r,updateNodeData:s,clearCanvas:o}=qr(),a=sa(),c=E.useMemo(()=>e.filter(M=>M.selected),[e]),d=E.useMemo(()=>t.filter(M=>M.selected),[t]),f=E.useCallback(M=>e.find(P=>P.id===M),[e]),p=E.useCallback(M=>t.find(P=>P.id===M),[t]),h=E.useCallback(M=>{n([...e,M])},[e,n]),g=E.useCallback(M=>{n(e.filter(P=>P.id!==M)),r(t.filter(P=>P.source!==M&&P.target!==M))},[e,t,n,r]),y=E.useCallback(()=>{const M=[],P=new Map;for(const D of c){const V=`${D.id}-copy-${Date.now()}`;P.set(D.id,V),M.push({...D,id:V,position:{x:D.position.x+50,y:D.position.y+50},selected:!1,data:{...D.data,id:V}})}n([...e,...M]);const H=[];for(const D of t)P.has(D.source)&&P.has(D.target)&&H.push({...D,id:`${D.id}-copy-${Date.now()}`,source:P.get(D.source),target:P.get(D.target)});H.length>0&&r([...t,...H])},[c,e,t,n,r]),b=E.useCallback(()=>{const M=new Set(c.map(H=>H.id)),P=new Set(d.map(H=>H.id));n(e.filter(H=>!M.has(H.id))),r(t.filter(H=>!P.has(H.id)&&!M.has(H.source)&&!M.has(H.target)))},[c,d,e,t,n,r]),w=E.useCallback(()=>{n(G3(e,t)),setTimeout(()=>{a.fitView({padding:.2})},50)},[e,t,n,a]),v=E.useCallback(()=>{a.fitView({padding:.2})},[a]),k=E.useCallback(M=>{const P=f(M);P&&a.setCenter(P.position.x+100,P.position.y+50,{zoom:1.5,duration:300})},[f,a]),_=E.useCallback((M,P=!1)=>{n(e.map(H=>({...H,selected:P&&H.selected||H.id===M})))},[e,n]),N=E.useCallback(()=>{n(e.map(M=>({...M,selected:!1}))),r(t.map(M=>({...M,selected:!1})))},[e,t,n,r]),{undo:S,redo:A,canUndo:I,canRedo:T,copySelected:O,paste:L,canPaste:z}=qr();return{nodes:e,edges:t,selectedNodes:c,selectedEdges:d,getNode:f,getEdge:p,addNode:h,removeNode:g,updateNodeData:s,setNodes:n,setEdges:r,clearCanvas:o,selectNode:_,clearSelection:N,duplicateSelected:y,deleteSelected:b,autoLayout:w,fitView:v,zoomToNode:k,undo:S,redo:A,canUndo:I,canRedo:T,copySelected:O,paste:L,canPaste:z}}const cee=["step","if","for_each","while","switch","parallel","try","map","filter","reduce","subworkflow"];function uee(){const{nodes:e,setNodes:t,updateNodeData:n}=qr(),{deleteSelected:r,duplicateSelected:s}=_1(),o=sn($=>$.currentWorkflow),a=sn($=>$.selectedWorkflow),c=sn($=>$.saveWorkflow),{screenToFlowPosition:d}=sa(),[f,p]=E.useState(null),[h,g]=E.useState(!1),[y,b]=E.useState(null),[w,v]=E.useState(!1),[k,_]=E.useState(null),N=E.useCallback(($,U)=>{if($.preventDefault(),U.type==="trigger"||U.type==="output")return;const B=o==null?void 0:o.steps.find(q=>q.id===U.data.id);B&&(p(B),g(!0))},[o]),S=E.useCallback(($,U)=>{$.preventDefault(),cee.includes(U.type||"")&&_(U)},[]),A=E.useCallback(()=>{if(!k||!o)return;const $=o.steps.find(U=>U.id===k.data.id);$&&(p($),g(!0)),_(null)},[k,o]),I=E.useCallback(()=>{if(!k||!o)return;const $=o.steps.find(U=>U.id===k.data.id);$&&(b($),v(!0)),_(null)},[k,o]),T=E.useCallback(()=>{if(k){const $=e.map(U=>({...U,selected:U.id===k.id}));t($),setTimeout(()=>s(),0)}_(null)},[k,e,t,s]),O=E.useCallback(()=>{if(k){const $=e.map(U=>({...U,selected:U.id===k.id}));t($),setTimeout(()=>r(),0)}_(null)},[k,e,t,r]),L=E.useCallback(async()=>{if(k&&a){const $=k.data.id;try{n($,{status:"running"});const U=await fetch(`/api/execute/${encodeURIComponent(a)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inputs:{},stepId:$})});if(!U.ok)throw new Error("Execution failed");const B=await U.json();n($,{status:B.status==="started"?"running":"completed"}),_o.success(`Step "${$}" execution started`)}catch(U){const B=U instanceof Error?U.message:"Unknown error";_o.error(`Step execution failed: ${B}`),n($,{status:"failed"})}}_(null)},[k,a,n]),z=E.useCallback($=>{if(o){const U=o.steps.map(B=>B.id===$.id?$:B);c({...o,steps:U}),n($.id,{name:$.name,action:$.action,inputs:$.inputs,outputVariable:$.outputVariable})}g(!1),p(null)},[o,c,n]),M=E.useCallback($=>{$.preventDefault(),$.dataTransfer.dropEffect="copy"},[]),P=E.useCallback($=>{var B,q;$.preventDefault();const U=$.dataTransfer.getData("application/marktoflow-tool");if(U)try{const Y=JSON.parse(U),F=d({x:$.clientX,y:$.clientY}),K=Y.id+"-"+Date.now().toString(36),ee={id:K,type:"step",position:F,data:{id:K,name:Y.name+" Action",action:Y.id+"."+(Y.defaultAction||((B=Y.actions)==null?void 0:B[0])||"action"),status:"pending"}};if(t([...e,ee]),o){const W={id:K,name:Y.name+" Action",action:Y.id+"."+(Y.defaultAction||((q=Y.actions)==null?void 0:q[0])||"action"),inputs:{}};c({...o,steps:[...o.steps,W]})}_o.success(`Added "${Y.name}" step`)}catch{_o.error("Failed to add step from drop")}},[e,t,d,o,c]),H=E.useCallback(()=>{if(!o||!f)return[];const $=[];if(o.inputs)for(const B of Object.keys(o.inputs))$.push(`inputs.${B}`);const U=o.steps.findIndex(B=>B.id===f.id);for(let B=0;B<U;B++){const q=o.steps[B];q.outputVariable&&$.push(q.outputVariable)}return $},[o,f]),D=E.useCallback($=>{p($),g(!0)},[]),V=E.useCallback($=>{b($),v(!0)},[]);return{editingStep:f,isEditorOpen:h,setIsEditorOpen:g,yamlViewStep:y,isYamlViewOpen:w,setIsYamlViewOpen:v,contextMenuNode:k,onNodeDoubleClick:N,onNodeContextMenu:S,onDragOver:M,onDrop:P,handleContextEdit:A,handleContextViewYaml:I,handleContextDuplicate:T,handleContextDelete:O,handleContextExecute:L,handleStepSave:z,getAvailableVariables:H,openEditor:D,openYamlView:V}}const dee=["step","if","for_each","while","switch","parallel","try","map","filter","reduce"];function fee({onEditStep:e,onViewYaml:t}){const{nodes:n,undo:r,redo:s,canUndo:o,canRedo:a,copySelected:c,paste:d,canPaste:f}=qr(),{autoLayout:p,deleteSelected:h,duplicateSelected:g}=_1(),y=sn(v=>v.currentWorkflow),b=E.useCallback(()=>{if(!y)return null;const v=n.find(k=>k.selected&&dee.includes(k.type||""));return v&&y.steps.find(k=>k.id===v.data.id)||null},[y,n]);return{onKeyDown:E.useCallback(v=>{const k=v.metaKey||v.ctrlKey;if(v.key==="Backspace"||v.key==="Delete"){h();return}if(k&&v.key==="d"){v.preventDefault(),g();return}if(k&&v.key==="l"){v.preventDefault(),p();return}if(k&&v.key==="z"&&!v.shiftKey){v.preventDefault(),o()&&r();return}if(k&&v.shiftKey&&v.key==="z"||k&&v.key==="y"){v.preventDefault(),a()&&s();return}if(k&&v.key==="c"){v.preventDefault(),c();return}if(k&&v.key==="v"){v.preventDefault(),f()&&d();return}if(v.key==="e"&&!k&&!v.shiftKey&&!v.altKey){v.preventDefault();const _=b();_&&e(_);return}if(v.key==="y"&&!k&&!v.shiftKey&&!v.altKey){v.preventDefault();const _=b();_&&t(_);return}},[h,g,p,b,r,s,o,a,c,d,f,e,t])}}const hee={step:rU,subworkflow:aU,trigger:cU,output:dU,if:hU,for_each:mU,while:yU,switch:vU,parallel:wU,try:NU,map:hm,filter:hm,reduce:hm,sticky:EU,group:TU};function pee(){const{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s}=qr(),o=oc(),a=E.useRef(null),{editingStep:c,isEditorOpen:d,setIsEditorOpen:f,yamlViewStep:p,isYamlViewOpen:h,setIsYamlViewOpen:g,onNodeDoubleClick:y,onNodeContextMenu:b,onDragOver:w,onDrop:v,handleContextEdit:k,handleContextViewYaml:_,handleContextDuplicate:N,handleContextDelete:S,handleContextExecute:A,handleStepSave:I,getAvailableVariables:T,openEditor:O,openYamlView:L}=uee(),{onKeyDown:z}=fee({onEditStep:O,onViewYaml:L});return u.jsxs(BX,{children:[u.jsx(qX,{asChild:!0,children:u.jsx("div",{ref:a,className:"w-full h-full",onKeyDown:z,onDragOver:w,onDrop:v,tabIndex:0,children:u.jsxs(Hq,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:s,onNodeDoubleClick:y,onNodeContextMenu:b,nodeTypes:hee,fitView:!0,snapToGrid:!0,snapGrid:[16,16],defaultEdgeOptions:{type:"smoothstep",animated:!0,style:{stroke:"#ff6d5a",strokeWidth:2}},proOptions:{hideAttribution:!0},children:[u.jsx(Yq,{variant:ls.Dots,gap:24,size:1,color:"#3d3d5c"}),u.jsx(nz,{}),u.jsx(mz,{nodeColor:M=>{var P;switch((P=M.data)==null?void 0:P.status){case"running":return"#f0ad4e";case"completed":return"#5cb85c";case"failed":return"#d9534f";default:return"#2d2d4a"}},maskColor:"rgba(26, 26, 46, 0.8)"})]})})}),u.jsxs(G4,{children:[u.jsxs(Ii,{onClick:k,children:[u.jsx(B9,{className:"w-4 h-4 mr-2"}),"Edit Step",u.jsx(gl,{children:"E"})]}),u.jsxs(Ii,{onClick:_,children:[u.jsx(mw,{className:"w-4 h-4 mr-2"}),"View YAML",u.jsx(gl,{children:"Y"})]}),u.jsx(Pb,{}),u.jsxs(Ii,{onClick:A,children:[u.jsx(Vo,{className:"w-4 h-4 mr-2"}),"Execute Step"]}),u.jsx(Pb,{}),u.jsxs(Ii,{onClick:N,children:[u.jsx(Lo,{className:"w-4 h-4 mr-2"}),"Duplicate",u.jsxs(gl,{children:[o,"D"]})]}),u.jsxs(Ii,{onClick:S,destructive:!0,children:[u.jsx(oa,{className:"w-4 h-4 mr-2"}),"Delete",u.jsx(gl,{children:"⌫"})]})]}),u.jsx(_Y,{open:d,onOpenChange:f,step:c,onSave:I,availableVariables:T()}),u.jsx(hs,{open:h,onOpenChange:g,title:`YAML: ${(p==null?void 0:p.name)||(p==null?void 0:p.id)}`,size:"lg",children:u.jsx("div",{className:"p-4",children:u.jsx(wY,{value:p})})})]})}const Y3=Mn((e,t)=>({editingStep:null,isEditorOpen:!1,yamlViewStep:null,isYamlViewOpen:!1,isNewStepOpen:!1,newStepPosition:null,copiedNodes:[],undoStack:[],redoStack:[],openEditor:n=>e({editingStep:n,isEditorOpen:!0}),closeEditor:()=>e({editingStep:null,isEditorOpen:!1}),openYamlViewer:n=>e({yamlViewStep:n,isYamlViewOpen:!0}),closeYamlViewer:()=>e({yamlViewStep:null,isYamlViewOpen:!1}),openNewStepWizard:n=>e({isNewStepOpen:!0,newStepPosition:n??null}),closeNewStepWizard:()=>e({isNewStepOpen:!1,newStepPosition:null}),copyNodes:n=>e({copiedNodes:n.map(r=>({...r}))}),clearClipboard:()=>e({copiedNodes:[]}),pushUndo:n=>{const{undoStack:r}=t();e({undoStack:[...r,n],redoStack:[]})},undo:()=>{const{undoStack:n,redoStack:r}=t();if(n.length===0)return null;const s=n[n.length-1];return e({undoStack:n.slice(0,-1),redoStack:[...r,s]}),s},redo:()=>{const{undoStack:n,redoStack:r}=t();if(r.length===0)return null;const s=r[r.length-1];return e({redoStack:r.slice(0,-1),undoStack:[...n,s]}),s},clearHistory:()=>e({undoStack:[],redoStack:[]})})),X3=Mn((e,t)=>({providers:[],activeProviderId:null,isLoading:!1,error:null,loadProviders:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/ai/providers");if(!n.ok)throw new Error("Failed to load providers");const r=await n.json();e({providers:r.providers,activeProviderId:r.activeProvider,isLoading:!1})}catch(n){console.error("Error loading providers:",n),e({error:n instanceof Error?n.message:"Unknown error",isLoading:!1})}},setProvider:async(n,r)=>{e({isLoading:!0,error:null});try{const s=await fetch(`/api/ai/providers/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r||{})});if(!s.ok){const a=await s.json();throw new Error(a.message||"Failed to set provider")}const o=await s.json();return o.success&&o.status?(e({providers:o.status.providers,activeProviderId:o.status.activeProvider,isLoading:!1}),!0):!1}catch(s){return console.error("Error setting provider:",s),e({error:s instanceof Error?s.message:"Unknown error",isLoading:!1}),!1}},refreshStatus:async()=>{await t().loadProviders()}}));function mee({open:e,onOpenChange:t}){var L,z;const{providers:n,activeProviderId:r,isLoading:s,error:o,loadProviders:a,setProvider:c}=X3(),[d,f]=E.useState(null),[p,h]=E.useState(!1),[g,y]=E.useState({apiKey:"",baseUrl:"",model:""}),[b,w]=E.useState(""),[v,k]=E.useState(null);E.useEffect(()=>{e&&a()},[e,a]);const _=async M=>{const P=n.find(H=>H.id===M);P&&(P.authType==="sdk"||P.status==="needs_config"?(f(M),h(!0)):P.status==="ready"&&await c(M)&&t(!1))},N=M=>{f(M),h(!0)},S=async M=>{if(!b.trim()){k(null);return}await c(M,{model:b.trim()}),k(null),w("")},A=async()=>{if(!d)return;await c(d,g)&&(h(!1),y({apiKey:"",baseUrl:"",model:""}),t(!1))},I=async()=>{if(!d)return;const M=n.find(V=>V.id===d);if(!M||!(M.status==="ready"||M.status==="available"||M.authType==="sdk"&&M.status==="needs_config"))return;const H=g.model?{model:g.model}:void 0;await c(d,H)&&(h(!1),y({apiKey:"",baseUrl:"",model:""}),t(!1))},T=M=>{switch(M){case"ready":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"});case"available":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"});case"needs_config":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500"});case"unavailable":return u.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500"});default:return u.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-500"})}},O=M=>{switch(M){case"ready":return"Ready";case"available":return"Available";case"needs_config":return"Needs Configuration";case"unavailable":return"Unavailable";default:return"Unknown"}};if(p){const M=n.find(H=>H.id===d);if(!M)return null;const P=M.authType==="sdk";return u.jsxs(hs,{open:p,onOpenChange:h,title:`Configure ${M.name}`,description:P?"SDK-based provider":"Enter configuration details for this provider",size:"md",children:[u.jsx("div",{className:"p-4 space-y-4",children:P?u.jsx(gee,{provider:M,configData:g,setConfigData:y}):u.jsxs(u.Fragment,{children:[((L=M.configOptions)==null?void 0:L.apiKey)&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"API Key"}),u.jsx("input",{type:"password",value:g.apiKey,onChange:H=>y({...g,apiKey:H.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter API key"})]}),((z=M.configOptions)==null?void 0:z.baseUrl)&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Base URL"}),u.jsx("input",{type:"text",value:g.baseUrl,onChange:H=>y({...g,baseUrl:H.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter base URL"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Model"}),u.jsx("input",{type:"text",value:g.model,onChange:H=>y({...g,model:H.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Enter model name (e.g., gpt-4o, claude-sonnet-4-20250514)"})]})]})}),u.jsxs(Bo,{children:[u.jsx(Ve,{variant:"secondary",onClick:()=>h(!1),children:"Cancel"}),P?u.jsx(Ve,{variant:"primary",onClick:I,disabled:s||M.status!=="ready"&&M.status!=="available"&&M.authType!=="sdk",children:s?u.jsx(Dr,{className:"w-4 h-4 animate-spin"}):M.status==="ready"?"Activate":(M.status==="available","Connect & Activate")}):u.jsx(Ve,{variant:"primary",onClick:A,disabled:s,children:s?u.jsx(Dr,{className:"w-4 h-4 animate-spin"}):"Save & Activate"})]})]})}return u.jsxs(hs,{open:e,onOpenChange:t,title:"AI Provider",description:"Select which AI provider to use for agent prompts",size:"md",children:[u.jsxs("div",{className:"p-4 space-y-2",children:[o&&u.jsxs("div",{className:"flex items-center gap-2 p-3 bg-error/10 border border-error/30 rounded text-error text-sm",children:[u.jsx(zo,{className:"w-4 h-4 flex-shrink-0"}),u.jsx("span",{children:o})]}),s&&n.length===0?u.jsx("div",{className:"flex items-center justify-center py-8",children:u.jsx(Dr,{className:"w-6 h-6 animate-spin text-gray-500"})}):u.jsx("div",{className:"space-y-2",children:n.map(M=>{var H;const P=M.status==="unavailable";return u.jsxs("button",{onClick:()=>_(M.id),disabled:P,className:`
|
|
828
|
+
w-full flex items-center justify-between p-3 rounded border transition-all
|
|
829
|
+
${M.isActive?"bg-primary/10 border-primary text-white":"bg-node-bg border-node-border text-gray-300 hover:bg-white/5"}
|
|
830
|
+
${P?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
831
|
+
`,children:[u.jsxs("div",{className:"flex items-center gap-3",children:[T(M.status),u.jsxs("div",{className:"text-left",children:[u.jsx("div",{className:"font-medium",children:M.name}),M.description&&u.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:M.description})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[M.isActive&&u.jsx(Js,{className:"w-4 h-4 text-primary"}),M.status==="needs_config"&&!((H=M.authType)!=null&&H.startsWith("sdk"))&&u.jsx(Ji,{className:"w-4 h-4 text-yellow-500"}),M.authType==="sdk"&&M.status==="needs_config"&&u.jsx(hR,{className:"w-4 h-4 text-yellow-500"}),M.status==="ready"&&u.jsx("button",{onClick:D=>{D.stopPropagation(),N(M.id)},className:"p-1 rounded hover:bg-white/10 transition-colors",title:"Configure provider",children:u.jsx(Ji,{className:"w-3.5 h-3.5 text-gray-500 hover:text-gray-300"})}),u.jsx("span",{className:"text-xs text-gray-500",children:O(M.status)})]})]},M.id)})})]}),r&&n.find(M=>M.id===r&&M.status==="ready")&&u.jsx("div",{className:"px-4 pb-4",children:u.jsxs("div",{className:"p-3 bg-bg-surface border border-border-default rounded-lg",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("label",{className:"text-xs font-medium text-text-secondary",children:"Custom Model Name"}),v!==r&&u.jsx("button",{onClick:()=>{k(r),w("")},className:"p-1 rounded hover:bg-bg-hover transition-colors",title:"Edit model name",children:u.jsx(R9,{className:"w-3 h-3 text-text-muted"})})]}),v===r?u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{type:"text",value:b,onChange:M=>w(M.target.value),onKeyDown:M=>{M.key==="Enter"&&S(r),M.key==="Escape"&&k(null)},className:"flex-1 px-2 py-1.5 bg-bg-canvas border border-border-default rounded text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent",placeholder:"e.g., gpt-4o, claude-sonnet-4-20250514",autoFocus:!0}),u.jsx(Ve,{variant:"primary",size:"sm",onClick:()=>S(r),children:"Save"}),u.jsx(Ve,{variant:"secondary",size:"sm",onClick:()=>k(null),children:"Cancel"})]}):u.jsx("p",{className:"text-xs text-text-muted",children:"Click the edit icon to set a custom model name for the active provider."})]})}),u.jsx(Bo,{children:u.jsx(Ve,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function gee({provider:e,configData:t,setConfigData:n}){const r=e.status==="ready",s=e.status==="available";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:`flex items-center gap-2 p-3 rounded border ${r?"bg-green-500/10 border-green-500/30":s?"bg-blue-500/10 border-blue-500/30":"bg-yellow-500/10 border-yellow-500/30"}`,children:[u.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500":s?"bg-blue-500":"bg-yellow-500"}`}),u.jsx("span",{className:`text-sm ${r?"text-green-400":s?"text-blue-400":"text-yellow-400"}`,children:r?"Connected and ready":s?"Available - Click Connect below":"Not connected"})]}),e.authInstructions&&u.jsxs("div",{className:"flex items-start gap-2 p-3 bg-white/5 rounded border border-white/10",children:[u.jsx(hR,{className:"w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0"}),u.jsx("p",{className:"text-sm text-gray-300",children:e.authInstructions})]}),e.availableModels&&e.availableModels.length>0&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Model"}),u.jsxs("select",{value:t.model,onChange:o=>n({apiKey:"",baseUrl:"",model:o.target.value}),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary",children:[u.jsx("option",{value:"",children:"Default"}),e.availableModels.map(o=>u.jsx("option",{value:o,children:o},o))]})]})]})}function yee({className:e}){const{nodes:t,setNodes:n,saveCheckpoint:r}=qr(),s=t.filter(d=>d.selected),o=s.length>=2,a=E.useCallback(d=>{if(s.length<2)return;r();const f=new Set(s.map(g=>g.id)),p=xee(s),h=t.map(g=>{var v,k;if(!f.has(g.id))return g;let y={...g.position};const b=((v=g.measured)==null?void 0:v.width)||g.width||200,w=((k=g.measured)==null?void 0:k.height)||g.height||80;switch(d){case"left":y.x=p.minX;break;case"center-h":y.x=p.minX+(p.maxX-p.minX)/2-b/2;break;case"right":y.x=p.maxX-b;break;case"top":y.y=p.minY;break;case"center-v":y.y=p.minY+(p.maxY-p.minY)/2-w/2;break;case"bottom":y.y=p.maxY-w;break}return{...g,position:y}});n(h)},[t,s,n,r]),c=E.useCallback(d=>{if(s.length<3)return;r();const f=new Set(s.map(k=>k.id)),p=[...s].sort((k,_)=>d==="horizontal"?k.position.x-_.position.x:k.position.y-_.position.y),h=p[0],g=p[p.length-1],b=(d==="horizontal"?g.position.x-h.position.x:g.position.y-h.position.y)/(p.length-1),w=new Map;p.forEach((k,_)=>{const N={...k.position};d==="horizontal"?N.x=h.position.x+b*_:N.y=h.position.y+b*_,w.set(k.id,N)});const v=t.map(k=>{if(!f.has(k.id))return k;const _=w.get(k.id);return _?{...k,position:_}:k});n(v)},[t,s,n,r]);return u.jsxs("div",{className:Ye("flex items-center gap-0.5",e),children:[u.jsx(zs,{icon:u.jsx(e9,{className:"w-4 h-4"}),label:"Align Left",onClick:()=>a("left"),disabled:!o}),u.jsx(zs,{icon:u.jsx(Xz,{className:"w-4 h-4"}),label:"Align Center Horizontally",onClick:()=>a("center-h"),disabled:!o}),u.jsx(zs,{icon:u.jsx(Jz,{className:"w-4 h-4"}),label:"Align Right",onClick:()=>a("right"),disabled:!o}),u.jsx("div",{className:"w-px h-5 bg-border-default mx-0.5"}),u.jsx(zs,{icon:u.jsx(Zz,{className:"w-4 h-4"}),label:"Align Top",onClick:()=>a("top"),disabled:!o}),u.jsx(zs,{icon:u.jsx(Yz,{className:"w-4 h-4"}),label:"Align Center Vertically",onClick:()=>a("center-v"),disabled:!o}),u.jsx(zs,{icon:u.jsx(Qz,{className:"w-4 h-4"}),label:"Align Bottom",onClick:()=>a("bottom"),disabled:!o}),u.jsx("div",{className:"w-px h-5 bg-border-default mx-0.5"}),u.jsx(zs,{icon:u.jsx(v9,{className:"w-4 h-4"}),label:"Distribute Horizontally",onClick:()=>c("horizontal"),disabled:s.length<3}),u.jsx(zs,{icon:u.jsx(fR,{className:"w-4 h-4"}),label:"Distribute Vertically",onClick:()=>c("vertical"),disabled:s.length<3})]})}function zs({icon:e,label:t,onClick:n,disabled:r}){return u.jsx("button",{onClick:n,disabled:r,className:"p-1.5 rounded text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:t,children:e})}function xee(e){var o,a;let t=1/0,n=1/0,r=-1/0,s=-1/0;for(const c of e){const d=((o=c.measured)==null?void 0:o.width)||c.width||200,f=((a=c.measured)==null?void 0:a.height)||c.height||80;t=Math.min(t,c.position.x),n=Math.min(n,c.position.y),r=Math.max(r,c.position.x+d),s=Math.max(s,c.position.y+f)}return{minX:t,minY:n,maxX:r,maxY:s}}const vee=E.memo(yee);function bee(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const a=d=>d===null?null:JSON.parse(d,void 0),c=(o=n.getItem(s))!=null?o:null;return c instanceof Promise?c.then(a):a(c)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const Lb=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Lb(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Lb(r)(n)}}}},wee=(e,t)=>(n,r,s)=>{let o={storage:bee(()=>window.localStorage),partialize:v=>v,version:0,merge:(v,k)=>({...k,...v}),...t},a=!1,c=0;const d=new Set,f=new Set;let p=o.storage;if(!p)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...v)},r,s);const h=()=>{const v=o.partialize({...r()});return p.setItem(o.name,{state:v,version:o.version})},g=s.setState;s.setState=(v,k)=>(g(v,k),h());const y=e((...v)=>(n(...v),h()),r,s);s.getInitialState=()=>y;let b;const w=()=>{var v,k;if(!p)return;const _=++c;a=!1,d.forEach(S=>{var A;return S((A=r())!=null?A:y)});const N=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(v=r())!=null?v:y))||void 0;return Lb(p.getItem.bind(p))(o.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==o.version){if(o.migrate){const A=o.migrate(S.state,S.version);return A instanceof Promise?A.then(I=>[!0,I]):[!0,A]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var A;if(_!==c)return;const[I,T]=S;if(b=o.merge(T,(A=r())!=null?A:y),n(b,!0),I)return h()}).then(()=>{_===c&&(N==null||N(b,void 0),b=r(),a=!0,f.forEach(S=>S(b)))}).catch(S=>{_===c&&(N==null||N(void 0,S))})};return s.persist={setOptions:v=>{o={...o,...v},v.storage&&(p=v.storage)},clearStorage:()=>{p==null||p.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>w(),hasHydrated:()=>a,onHydrate:v=>(d.add(v),()=>{d.delete(v)}),onFinishHydration:v=>(f.add(v),()=>{f.delete(v)})},o.skipHydration||w(),b||y},Q3=wee,XT={tablet:768,desktop:1024};function kee(e){return e>=XT.desktop?"desktop":e>=XT.tablet?"tablet":"mobile"}const eh=Mn()(Q3((e,t)=>({sidebarOpen:!0,propertiesPanelOpen:!0,mobileMenuOpen:!1,breakpoint:"desktop",toolbarVisible:!0,toolbarPosition:{x:0,y:0},toggleSidebar:()=>e(n=>({sidebarOpen:!n.sidebarOpen})),setSidebarOpen:n=>e({sidebarOpen:n}),togglePropertiesPanel:()=>e(n=>({propertiesPanelOpen:!n.propertiesPanelOpen})),setPropertiesPanelOpen:n=>e({propertiesPanelOpen:n}),toggleMobileMenu:()=>e(n=>({mobileMenuOpen:!n.mobileMenuOpen})),setMobileMenuOpen:n=>e({mobileMenuOpen:n}),setBreakpoint:n=>{t(),e(n==="mobile"?{breakpoint:n,sidebarOpen:!1,propertiesPanelOpen:!1}:n==="tablet"?{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!1}:{breakpoint:n,sidebarOpen:!0,propertiesPanelOpen:!0})},setToolbarVisible:n=>e({toolbarVisible:n}),setToolbarPosition:n=>e({toolbarPosition:n}),toggleToolbar:()=>e(n=>({toolbarVisible:!n.toolbarVisible})),closeAllPanels:()=>e({sidebarOpen:!1,propertiesPanelOpen:!1,mobileMenuOpen:!1})}),{name:"marktoflow-layout",partialize:e=>({sidebarOpen:e.sidebarOpen,propertiesPanelOpen:e.propertiesPanelOpen,toolbarVisible:e.toolbarVisible,toolbarPosition:e.toolbarPosition})}));function Nee({onAddStep:e,onExecute:t,onSave:n,onValidate:r,isExecuting:s=!1}){const{autoLayout:o,fitView:a,selectedNodes:c,deleteSelected:d,duplicateSelected:f}=_1(),{undo:p,redo:h,undoStack:g,redoStack:y}=Y3(),{zoomIn:b,zoomOut:w}=sa(),v=oc(),{providers:k,activeProviderId:_,loadProviders:N}=X3(),[S,A]=E.useState(!1),{toolbarVisible:I,toolbarPosition:T,setToolbarPosition:O,setToolbarVisible:L}=eh(),z=g.length>0,M=y.length>0,P=c.length>0,H=E.useRef(null),D=E.useRef(!1),V=E.useRef({x:0,y:0}),$=E.useCallback(ee=>{if(!H.current)return;D.current=!0;const W=H.current.getBoundingClientRect();V.current={x:ee.clientX-W.left,y:ee.clientY-W.top},ee.target.setPointerCapture(ee.pointerId)},[]),U=E.useCallback(ee=>{if(!D.current)return;const W=ee.clientX-V.current.x,X=ee.clientY-V.current.y;O({x:W,y:X})},[O]),B=E.useCallback(()=>{D.current=!1},[]);E.useEffect(()=>{N()},[N]);const q=k.find(ee=>ee.id===_);if(!I)return null;const Y=T.x===0&&T.y===0,F=Y?{}:{left:T.x,top:T.y,transform:"none"},K=Y?"absolute top-4 left-1/2 -translate-x-1/2":"fixed";return u.jsxs("div",{ref:H,className:`${K} z-10 flex items-center gap-1 px-2 py-1.5 bg-bg-panel/95 backdrop-blur border border-border-default rounded-lg shadow-lg`,style:F,children:[u.jsx("div",{onPointerDown:$,onPointerMove:U,onPointerUp:B,className:"cursor-grab active:cursor-grabbing p-1 rounded hover:bg-bg-hover text-text-muted",title:"Drag to reposition",children:u.jsx(fR,{className:"w-4 h-4"})}),u.jsx(Vs,{}),u.jsx(or,{icon:u.jsx(df,{className:"w-4 h-4"}),label:"Add Step",onClick:e,shortcut:"N"}),u.jsx(Vs,{}),u.jsx(or,{icon:u.jsx(H9,{className:"w-4 h-4"}),label:"Undo",onClick:()=>p(),disabled:!z,shortcut:`${v}Z`}),u.jsx(or,{icon:u.jsx(P9,{className:"w-4 h-4"}),label:"Redo",onClick:()=>h(),disabled:!M,shortcut:`${v}⇧Z`}),u.jsx(Vs,{}),u.jsx(or,{icon:u.jsx(Lo,{className:"w-4 h-4"}),label:"Duplicate",onClick:f,disabled:!P,shortcut:`${v}D`}),u.jsx(or,{icon:u.jsx(oa,{className:"w-4 h-4"}),label:"Delete",onClick:d,disabled:!P,shortcut:"⌫"}),u.jsx(Vs,{}),u.jsx(vee,{}),u.jsx(Vs,{}),u.jsx(or,{icon:u.jsx(M9,{className:"w-4 h-4"}),label:"Auto Layout",onClick:o,shortcut:`${v}L`}),u.jsx(or,{icon:u.jsx(X9,{className:"w-4 h-4"}),label:"Zoom In",onClick:()=>b(),shortcut:`${v}+`}),u.jsx(or,{icon:u.jsx(Q9,{className:"w-4 h-4"}),label:"Zoom Out",onClick:()=>w(),shortcut:`${v}-`}),u.jsx(or,{icon:u.jsx(S9,{className:"w-4 h-4"}),label:"Fit View",onClick:a,shortcut:`${v}0`}),u.jsx(Vs,{}),u.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 px-2 py-1.5 rounded text-sm text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors",title:"Select AI Provider",children:[u.jsx(Nl,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline text-xs",children:(q==null?void 0:q.name)||"No Provider"}),u.jsx(Lr,{className:"w-3 h-3"})]}),u.jsx(Vs,{}),r&&u.jsx(or,{icon:u.jsx(zt,{className:"w-4 h-4"}),label:"Validate",onClick:r,shortcut:`${v}T`}),t&&u.jsxs("button",{onClick:()=>t(),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${s?"bg-error hover:bg-error/90 text-text-inverse":"bg-accent hover:bg-accent-hover text-text-inverse"}`,title:`${s?"Stop":"Execute"} (${v}⏎)`,children:[s?u.jsx(gR,{className:"w-4 h-4"}):u.jsx(Vo,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:s?"Stop":"Execute"})]}),n&&u.jsx(or,{icon:u.jsx(D9,{className:"w-4 h-4"}),label:"Save",onClick:n,shortcut:`${v}S`}),u.jsx(Vs,{}),u.jsx("button",{onClick:()=>L(!1),className:"p-1.5 rounded hover:bg-bg-hover text-text-muted hover:text-text-secondary transition-colors",title:"Hide toolbar",children:u.jsx(dr,{className:"w-3.5 h-3.5"})}),u.jsx(mee,{open:S,onOpenChange:A})]})}function or({icon:e,label:t,onClick:n,disabled:r,shortcut:s,variant:o="default"}){const a={default:"text-text-secondary hover:text-text-primary hover:bg-bg-hover",primary:"text-accent hover:text-accent-hover hover:bg-accent-muted",destructive:"text-error hover:text-error hover:bg-error-bg"};return u.jsxs("button",{onClick:n,disabled:r,className:`relative group p-2 rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${a[o]}`,title:`${t}${s?` (${s})`:""}`,children:[e,u.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-bg-elevated border border-border-default rounded text-xs text-text-primary whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-tooltip shadow-lg",children:[t,s&&u.jsx("span",{className:"ml-2 text-text-muted",children:s})]})]})}function Vs(){return u.jsx("div",{className:"w-px h-6 bg-border-default mx-1"})}const See={pending:"bg-gray-500",running:"bg-warning animate-pulse",completed:"bg-success",failed:"bg-error",skipped:"bg-gray-400"};function Cee({steps:e,totalDuration:t,className:n}){const{bars:r,maxDuration:s}=E.useMemo(()=>{const o=t||e.reduce((d,f)=>d+(f.duration||0),0)||1;let a=0;return{bars:e.map(d=>{const f=d.duration||0,p=a;return a+=f,{...d,offset:p,duration:f,widthPercent:Math.max(f/o*100,1),offsetPercent:p/o*100}}),maxDuration:o}},[e,t]);return e.length===0?u.jsx("div",{className:"text-center py-4 text-sm text-text-muted",children:"No execution data available"}):u.jsxs("div",{className:Ye("space-y-2",n),children:[u.jsxs("div",{className:"flex items-center justify-between text-xs text-text-muted",children:[u.jsx("span",{children:"Execution Timeline"}),u.jsx("span",{children:Gv(s)})]}),u.jsx("div",{className:"space-y-1.5",children:r.map(o=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-28 text-xs text-text-secondary truncate flex-shrink-0",title:o.stepName,children:o.stepName}),u.jsx("div",{className:"flex-1 h-5 bg-bg-surface rounded overflow-hidden relative",children:u.jsx("div",{className:Ye("absolute top-0 h-full rounded transition-all duration-300",See[o.status]),style:{left:`${o.offsetPercent}%`,width:`${o.widthPercent}%`,minWidth:"4px"},title:`${o.stepName}: ${Gv(o.duration)}`})}),u.jsx("div",{className:"w-16 text-xs text-text-muted text-right flex-shrink-0",children:o.duration>0?Gv(o.duration):"-"})]},o.stepId))})]})}function Gv(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t}m ${n}s`}const _ee=E.memo(Cee);function Eee({status:e}){switch(e){case"running":return u.jsx(Dr,{className:"w-5 h-5 text-primary animate-spin"});case"completed":return u.jsx(zt,{className:"w-5 h-5 text-success"});case"failed":return u.jsx(lt,{className:"w-5 h-5 text-error"});case"cancelled":return u.jsx(kR,{className:"w-5 h-5 text-text-secondary"});default:return u.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-500"})}}function jee({status:e}){switch(e){case"running":return u.jsx(Dr,{className:"w-4 h-4 text-warning animate-spin"});case"completed":return u.jsx(zt,{className:"w-4 h-4 text-success"});case"failed":return u.jsx(lt,{className:"w-4 h-4 text-error"});case"skipped":return u.jsx(bR,{className:"w-4 h-4 text-text-secondary"});default:return u.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-500"})}}function Aee(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 Tee({steps:e,currentStepId:t,debugEnabled:n,breakpoints:r,onToggleBreakpoint:s}){return u.jsx("div",{className:"space-y-2",children:e.map(o=>{const a=r==null?void 0:r.has(o.stepId);return u.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-bg-surface border-border-default"}`,children:[n&&s&&u.jsx("button",{onClick:()=>s(o.stepId),className:`w-4 h-4 rounded-full flex items-center justify-center transition-colors ${a?"bg-error":"bg-transparent border border-gray-500 hover:border-error hover:bg-error/20"}`,title:a?"Remove breakpoint":"Add breakpoint",children:a&&u.jsx(mb,{className:"w-2 h-2 fill-current text-text-primary"})}),u.jsx(jee,{status:o.status}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:o.stepName||o.stepId}),o.error&&u.jsx("div",{className:"text-xs text-error mt-1 truncate",children:typeof o.error=="string"?o.error:o.error.message||JSON.stringify(o.error)})]}),o.duration!==void 0&&u.jsxs("div",{className:"text-xs text-text-secondary",children:[o.duration,"ms"]})]},o.stepId)})})}function Iee({logs:e}){return u.jsx("div",{className:"font-mono text-xs space-y-1",children:e.length===0?u.jsx("div",{className:"text-text-muted",children:"No logs yet..."}):e.map((t,n)=>u.jsx("div",{className:"text-text-primary",children:t},n))})}function Gd({value:e,onCopy:t,copiedKey:n,path:r,depth:s=0}){const[o,a]=E.useState(s<2);if(e===null)return u.jsx("span",{className:"text-text-muted font-mono text-xs",children:"null"});if(e===void 0)return u.jsx("span",{className:"text-text-muted font-mono text-xs",children:"undefined"});if(typeof e=="boolean")return u.jsx("span",{className:`font-mono text-xs ${e?"text-success":"text-error"}`,children:String(e)});if(typeof e=="number")return u.jsx("span",{className:"text-warning font-mono text-xs",children:e});if(typeof e=="string"){const c=e.length>200?e.substring(0,200)+"...":e;return u.jsxs("span",{className:"text-success font-mono text-xs",children:['"',c,'"']})}if(Array.isArray(e))return e.length===0?u.jsx("span",{className:"text-text-secondary font-mono text-xs",children:"[]"}):u.jsxs("div",{className:"space-y-1",children:[u.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-text-secondary hover:text-text-primary transition-colors",children:[o?u.jsx(Lr,{className:"w-3 h-3"}):u.jsx(qt,{className:"w-3 h-3"}),u.jsxs("span",{className:"text-xs font-mono",children:["Array(",e.length,")"]})]}),o&&u.jsxs("div",{className:"ml-4 pl-2 border-l border-border-default space-y-1",children:[e.slice(0,20).map((c,d)=>u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsxs("span",{className:"text-text-muted font-mono text-xs",children:["[",d,"]:"]}),u.jsx(Gd,{value:c,onCopy:t,copiedKey:n,path:`${r}[${d}]`,depth:s+1})]},d)),e.length>20&&u.jsxs("div",{className:"text-text-muted text-xs",children:["... and ",e.length-20," more items"]})]})]});if(typeof e=="object"){const c=Object.entries(e);return c.length===0?u.jsx("span",{className:"text-text-secondary font-mono text-xs",children:"{}"}):u.jsxs("div",{className:"space-y-1",children:[u.jsxs("button",{onClick:()=>a(!o),className:"flex items-center gap-1 text-text-secondary hover:text-text-primary transition-colors",children:[o?u.jsx(Lr,{className:"w-3 h-3"}):u.jsx(qt,{className:"w-3 h-3"}),u.jsxs("span",{className:"text-xs font-mono",children:["Object(",c.length," keys)"]})]}),o&&u.jsxs("div",{className:"ml-4 pl-2 border-l border-border-default space-y-1",children:[c.slice(0,30).map(([d,f])=>u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsxs("span",{className:"text-primary font-mono text-xs",children:[d,":"]}),u.jsx(Gd,{value:f,onCopy:t,copiedKey:n,path:`${r}.${d}`,depth:s+1})]},d)),c.length>30&&u.jsxs("div",{className:"text-text-muted text-xs",children:["... and ",c.length-30," more keys"]})]})]})}return u.jsx("span",{className:"text-text-secondary font-mono text-xs",children:String(e)})}function Mee({steps:e}){const[t,n]=E.useState(new Set),[r,s]=E.useState(new Set),[o,a]=E.useState(null),c=e.filter(h=>h.inputs!==void 0||h.output!==void 0&&h.outputVariable),d=h=>{n(g=>{const y=new Set(g);return y.has(h)?y.delete(h):y.add(h),y})},f=h=>{s(g=>{const y=new Set(g);return y.has(h)?y.delete(h):y.add(h),y})},p=async(h,g)=>{try{const y=typeof g=="string"?g:JSON.stringify(g,null,2);await navigator.clipboard.writeText(y),a(h),setTimeout(()=>a(null),2e3)}catch(y){console.error("Failed to copy:",y)}};return c.length===0?u.jsxs("div",{className:"text-center py-8 text-text-muted text-sm",children:["No data available yet.",u.jsx("br",{}),u.jsx("span",{className:"text-xs",children:"Step inputs and outputs will appear as steps execute."})]}):u.jsx("div",{className:"space-y-2",children:c.map(h=>{const g=t.has(h.stepId),y=h.inputs&&Object.keys(h.inputs).length>0,b=h.output!==void 0&&h.outputVariable;return u.jsxs("div",{className:"border border-border-default rounded-lg overflow-hidden",children:[u.jsxs("button",{onClick:()=>d(h.stepId),className:"w-full flex items-center gap-2 px-3 py-2 bg-bg-surface hover:bg-white/5 transition-colors",children:[g?u.jsx(Lr,{className:"w-4 h-4 text-text-secondary"}):u.jsx(qt,{className:"w-4 h-4 text-text-secondary"}),u.jsx("code",{className:"text-sm text-text-primary font-mono",children:h.stepName||h.stepId}),u.jsxs("span",{className:"text-xs text-text-muted ml-auto",children:[y&&`${Object.keys(h.inputs).length} inputs`,y&&b&&" • ",b&&h.outputVariable]})]}),g&&u.jsxs("div",{className:"bg-bg-panel border-t border-border-default",children:[y&&u.jsxs("div",{className:"border-b border-border-default",children:[u.jsxs("button",{onClick:()=>f(`${h.stepId}-inputs`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${h.stepId}-inputs`)?u.jsx(Lr,{className:"w-3 h-3 text-text-secondary"}):u.jsx(qt,{className:"w-3 h-3 text-text-secondary"}),u.jsxs("span",{className:"text-xs font-medium text-text-secondary",children:["Inputs (",Object.keys(h.inputs).length,")"]})]}),r.has(`${h.stepId}-inputs`)&&u.jsx("div",{className:"px-3 pb-3",children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("div",{className:"flex-1 overflow-x-auto",children:u.jsx(Gd,{value:h.inputs,onCopy:(w,v)=>p(w,v),copiedKey:o,path:"inputs"})}),u.jsx("button",{onClick:()=>p(`${h.stepId}-inputs`,h.inputs),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy inputs",children:o===`${h.stepId}-inputs`?u.jsx(Js,{className:"w-4 h-4 text-success"}):u.jsx(Lo,{className:"w-4 h-4 text-text-secondary"})})]})})]}),b&&u.jsxs("div",{children:[u.jsxs("button",{onClick:()=>f(`${h.stepId}-output`),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-white/5 transition-colors",children:[r.has(`${h.stepId}-output`)?u.jsx(Lr,{className:"w-3 h-3 text-text-secondary"}):u.jsx(qt,{className:"w-3 h-3 text-text-secondary"}),u.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Output"}),u.jsx("code",{className:"text-xs text-primary font-mono ml-auto",children:h.outputVariable})]}),r.has(`${h.stepId}-output`)&&u.jsx("div",{className:"px-3 pb-3",children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("div",{className:"flex-1 overflow-x-auto",children:u.jsx(Gd,{value:h.output,onCopy:(w,v)=>p(w,v),copiedKey:o,path:h.outputVariable||"output"})}),u.jsx("button",{onClick:()=>p(h.outputVariable||"",h.output),className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy output",children:o===h.outputVariable?u.jsx(Js,{className:"w-4 h-4 text-success"}):u.jsx(Lo,{className:"w-4 h-4 text-text-secondary"})})]})})]})]})]},h.stepId)})})}function Ree({debug:e,onClearBreakpoints:t,onAddWatchExpression:n,onRemoveWatchExpression:r}){const[s,o]=E.useState(""),a=()=>{s.trim()&&n&&(n(s.trim()),o(""))};return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("h4",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[u.jsx(mb,{className:"w-3 h-3 text-error"}),"Breakpoints (",e.breakpoints.size,")"]}),e.breakpoints.size>0&&t&&u.jsxs("button",{onClick:t,className:"text-xs text-text-secondary hover:text-text-primary flex items-center gap-1",children:[u.jsx(oa,{className:"w-3 h-3"})," Clear all"]})]}),u.jsx("div",{className:"bg-bg-surface rounded-lg p-3",children:e.breakpoints.size===0?u.jsx("div",{className:"text-xs text-text-muted",children:"No breakpoints set. Click the dot next to a step to add one."}):u.jsx("div",{className:"space-y-1",children:Array.from(e.breakpoints).map(c=>u.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-primary",children:[u.jsx(mb,{className:"w-2 h-2 fill-current text-error"}),u.jsx("span",{className:"font-mono",children:c})]},c))})})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Call Stack"}),u.jsx("div",{className:"bg-bg-surface rounded-lg p-3",children:e.callStack.length===0?u.jsx("div",{className:"text-xs text-text-muted",children:"No active call stack"}):u.jsx("div",{className:"space-y-1",children:e.callStack.map((c,d)=>u.jsxs("div",{className:`flex items-center gap-2 text-xs ${d===0?"text-primary":"text-text-secondary"}`,children:[u.jsx(Dl,{className:"w-3 h-3"}),u.jsx("span",{className:"font-mono",children:c})]},d))})})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Watch Expressions"}),u.jsxs("div",{className:"bg-bg-surface rounded-lg p-3 space-y-2",children:[n&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"text",value:s,onChange:c=>o(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),placeholder:"Add expression...",className:"flex-1 bg-transparent border border-border-default rounded px-2 py-1 text-xs text-text-primary placeholder-gray-500 focus:outline-none focus:border-primary"}),u.jsx("button",{onClick:a,disabled:!s.trim(),className:"p-1 text-text-secondary hover:text-text-primary disabled:opacity-50",children:u.jsx(df,{className:"w-4 h-4"})})]}),e.watchExpressions.length===0?u.jsx("div",{className:"text-xs text-text-muted",children:"No watch expressions. Add an expression to monitor its value."}):u.jsx("div",{className:"space-y-1",children:e.watchExpressions.map(c=>u.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs group",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:"text-primary font-mono truncate",children:c}),u.jsx("span",{className:"text-text-muted",children:"="}),u.jsx("span",{className:"text-text-primary font-mono truncate",children:"(not evaluated)"})]}),r&&u.jsx("button",{onClick:()=>r(c),className:"p-1 text-text-muted hover:text-error opacity-0 group-hover:opacity-100 transition-opacity",children:u.jsx(dr,{className:"w-3 h-3"})})]},c))})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-text-primary",children:"Debug State"}),u.jsxs("div",{className:"bg-bg-surface rounded-lg p-3 text-xs space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-text-secondary",children:"Current Step:"}),u.jsx("span",{className:"text-text-primary font-mono",children:e.currentStepId||"(none)"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-text-secondary",children:"Paused at Breakpoint:"}),u.jsx("span",{className:e.pausedAtBreakpoint?"text-error":"text-text-muted",children:e.pausedAtBreakpoint?"Yes":"No"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-text-secondary",children:"Step Over Pending:"}),u.jsx("span",{className:e.stepOverPending?"text-warning":"text-text-muted",children:e.stepOverPending?"Yes":"No"})]})]})]})]})}function Oee({isExecuting:e,isPaused:t,workflowStatus:n,currentStepId:r,steps:s,logs:o,onPause:a,onResume:c,onStop:d,onStepOver:f,onClose:p,debug:h,onToggleDebugMode:g,onToggleBreakpoint:y,onStepInto:b,onStepOut:w,onClearBreakpoints:v,onAddWatchExpression:k,onRemoveWatchExpression:_}){const[N,S]=E.useState("steps"),A=(h==null?void 0:h.enabled)??!1,I=s.filter(L=>L.status==="completed").length,T=s.filter(L=>L.status==="failed").length,O=s.length>0?I/s.length*100:0;return!e&&n==="pending"?null:u.jsxs("div",{className:"absolute bottom-20 left-4 right-4 z-20 bg-bg-panel border border-border-default rounded-lg shadow-xl max-h-[400px] flex flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-default",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Eee,{status:n}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:Aee(n)}),u.jsxs("div",{className:"text-xs text-text-secondary",children:[I,"/",s.length," steps completed",T>0&&` • ${T} failed`]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[g&&u.jsx(Ve,{variant:A?"primary":"ghost",size:"sm",onClick:g,icon:u.jsx(b2,{className:"w-4 h-4"}),title:A?"Disable debug mode":"Enable debug mode",children:"Debug"}),e&&u.jsxs(u.Fragment,{children:[t?u.jsx(Ve,{variant:"secondary",size:"sm",onClick:c,icon:u.jsx(Vo,{className:"w-4 h-4"}),children:"Resume"}):u.jsx(Ve,{variant:"secondary",size:"sm",onClick:a,icon:u.jsx(gR,{className:"w-4 h-4"}),children:"Pause"}),A&&t&&u.jsxs(u.Fragment,{children:[u.jsx(Ve,{variant:"secondary",size:"sm",onClick:f,icon:u.jsx(Dl,{className:"w-4 h-4"}),title:"Step Over (F10)",children:"Over"}),b&&u.jsx(Ve,{variant:"secondary",size:"sm",onClick:b,icon:u.jsx(n9,{className:"w-4 h-4"}),title:"Step Into (F11)",children:"Into"}),w&&u.jsx(Ve,{variant:"secondary",size:"sm",onClick:w,icon:u.jsx(r9,{className:"w-4 h-4"}),title:"Step Out (Shift+F11)",children:"Out"})]}),!A&&u.jsx(Ve,{variant:"secondary",size:"sm",onClick:f,icon:u.jsx(bR,{className:"w-4 h-4"}),disabled:!t,children:"Step"}),u.jsx(Ve,{variant:"destructive",size:"sm",onClick:d,icon:u.jsx(kR,{className:"w-4 h-4"}),children:"Stop"})]}),!e&&u.jsx(Ve,{variant:"secondary",size:"sm",onClick:p,children:"Close"})]})]}),u.jsx("div",{className:"h-1 bg-bg-surface",children:u.jsx("div",{className:`h-full transition-all duration-300 ${n==="failed"?"bg-error":n==="completed"?"bg-success":"bg-primary"}`,style:{width:`${O}%`}})}),u.jsxs("div",{className:"flex border-b border-border-default",children:[["steps","variables","logs","timeline"].map(L=>u.jsx("button",{onClick:()=>S(L),className:`px-4 py-2 text-sm font-medium transition-colors capitalize ${N===L?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:L},L)),A&&u.jsxs("button",{onClick:()=>S("debug"),className:`px-4 py-2 text-sm font-medium transition-colors flex items-center gap-1 ${N==="debug"?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:[u.jsx(b2,{className:"w-3 h-3"})," Debug"]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N==="steps"&&u.jsx(Tee,{steps:s,currentStepId:r,debugEnabled:A,breakpoints:h==null?void 0:h.breakpoints,onToggleBreakpoint:y}),N==="variables"&&u.jsx(Mee,{steps:s}),N==="logs"&&u.jsx(Iee,{logs:o}),N==="timeline"&&u.jsx(_ee,{steps:s.map(L=>({...L,stepName:L.stepName||L.stepId}))}),N==="debug"&&A&&u.jsx(Ree,{debug:h,onClearBreakpoints:v,onAddWatchExpression:k,onRemoveWatchExpression:_})]})]})}function Pee({open:e,onOpenChange:t,inputs:n,onExecute:r,workflowName:s="Workflow"}){const[o,a]=E.useState(()=>{const y={};return Object.entries(n).forEach(([b,w])=>{y[b]=w.default??""}),y}),[c,d]=E.useState({}),f=E.useCallback(()=>{const y={};return Object.entries(n).forEach(([b,w])=>{var k;const v=o[b];if(w.required&&(v===""||v===null||v===void 0)){y[b]=`${w.description||b} is required`;return}if(v!==""&&v!==null&&v!==void 0)switch(w.type){case"number":isNaN(Number(v))&&(y[b]="Must be a valid number");break;case"boolean":typeof v!="boolean"&&v!=="true"&&v!=="false"&&(y[b]="Must be true or false");break}if((k=w.validation)!=null&&k.pattern&&v)try{new RegExp(w.validation.pattern).test(String(v))||(y[b]=w.validation.message||"Invalid format")}catch{console.warn("Invalid regex pattern:",w.validation.pattern)}}),d(y),Object.keys(y).length===0},[n,o]),p=E.useCallback(()=>{if(!f())return;const y={};Object.entries(o).forEach(([b,w])=>{const v=n[b];if(v&&!(w===""&&!v.required))switch(v.type){case"number":y[b]=Number(w);break;case"boolean":y[b]=w===!0||w==="true";break;default:y[b]=w}}),r(y),t(!1)},[f,o,n,r,t]),h=E.useCallback((y,b)=>{a(w=>({...w,[y]:b})),d(w=>{const v={...w};return delete v[y],v})},[]);if(!e)return null;const g=Object.values(n).some(y=>y.required);return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:()=>t(!1)}),u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:u.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-lg w-full max-h-[80vh] flex flex-col animate-fade-in",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Execute Workflow"}),u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:s})]}),u.jsx("button",{onClick:()=>t(!1),className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close dialog",children:u.jsx(dr,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:Object.keys(n).length===0?u.jsx("div",{className:"text-center py-8 text-text-muted",children:"This workflow has no input parameters"}):Object.entries(n).map(([y,b])=>{var w;return u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-text-primary mb-2",children:[b.description||y,b.required&&u.jsx("span",{className:"text-error ml-1",children:"*"})]}),b.type==="boolean"?u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:o[y]===!0||o[y]==="true",onChange:v=>h(y,v.target.checked),className:"w-4 h-4 rounded border-border-default bg-bg-surface text-accent focus:ring-2 focus:ring-accent/50"}),u.jsx("span",{className:"text-sm text-text-secondary",children:b.description||"Enable this option"})]}):u.jsx("input",{type:b.type==="number"?"number":"text",value:o[y]??"",onChange:v=>h(y,v.target.value),placeholder:b.default!==void 0?String(b.default):"",className:`w-full px-3 py-2 bg-bg-surface border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 transition-colors ${c[y]?"border-error focus:ring-error/50":"border-border-default focus:ring-accent/50"}`}),c[y]&&u.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5 text-xs text-error",children:[u.jsx(zo,{className:"w-3 h-3"}),u.jsx("span",{children:c[y]})]}),!c[y]&&((w=b.validation)==null?void 0:w.message)&&u.jsx("p",{className:"text-xs text-text-muted mt-1.5",children:b.validation.message})]},y)})}),u.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-border-subtle",children:[u.jsx("div",{className:"text-xs text-text-muted",children:g&&u.jsx("span",{children:"* Required field"})}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:()=>t(!1),className:"px-4 py-2 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:"Cancel"}),u.jsxs("button",{onClick:p,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors flex items-center gap-2",children:[u.jsx(Vo,{className:"w-4 h-4"}),"Execute"]})]})]})]})})]})}function Lee({workflowPath:e,onClose:t}){const[n,r]=E.useState(!1),[s,o]=E.useState(null);E.useEffect(()=>{e&&a(e)},[e]);const a=async c=>{r(!0),o(null);try{const d=await fetch(`/api/execute/${encodeURIComponent(c)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dryRun:!0})}),f=await d.json();d.ok?o(f):o({valid:!1,error:f.message||"Validation failed"})}catch(d){o({valid:!1,error:d instanceof Error?d.message:"Unknown error"})}finally{r(!1)}};return e?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:t}),u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:u.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-2xl w-full max-h-[80vh] flex flex-col animate-fade-in",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Workflow Validation"}),u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Dry-run analysis results"})]}),u.jsx("button",{onClick:t,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close validation panel",children:u.jsx(dr,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:n?u.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[u.jsx(Dr,{className:"w-12 h-12 text-accent animate-spin mb-4"}),u.jsx("p",{className:"text-sm text-text-secondary",children:"Validating workflow..."})]}):s?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:`flex items-start gap-3 p-4 rounded-lg border ${s.valid?"bg-success-bg border-success/30":"bg-error-bg border-error/30"}`,children:[s.valid?u.jsx(zt,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):u.jsx(lt,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h3",{className:`text-sm font-medium ${s.valid?"text-success":"text-error"}`,children:s.valid?"Workflow is valid":"Validation failed"}),s.error&&u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:s.error})]})]}),s.workflow&&u.jsxs("div",{className:"space-y-3",children:[u.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"Workflow Details"}),u.jsxs("div",{className:"bg-bg-surface border border-border-default rounded-lg p-4 space-y-2",children:[u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{className:"text-text-secondary",children:"Name:"}),u.jsx("span",{className:"text-text-primary font-medium",children:s.workflow.name})]}),s.workflow.version&&u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{className:"text-text-secondary",children:"Version:"}),u.jsx("span",{className:"text-text-primary",children:s.workflow.version})]}),s.workflow.description&&u.jsxs("div",{className:"text-sm",children:[u.jsx("span",{className:"text-text-secondary",children:"Description:"}),u.jsx("p",{className:"text-text-primary mt-1",children:s.workflow.description})]})]})]}),s.steps&&s.steps.length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary",children:["Steps (",s.steps.length,")"]}),u.jsx("div",{className:"space-y-2",children:s.steps.map((c,d)=>u.jsx("div",{className:"bg-bg-surface border border-border-default rounded-lg p-3",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-accent/10 text-accent text-xs font-medium flex items-center justify-center",children:d+1}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-text-primary",children:c.action}),c.description&&u.jsx("p",{className:"text-xs text-text-secondary mt-1",children:c.description})]})]})},c.id))})]}),s.warnings&&s.warnings.length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[u.jsx(rc,{className:"w-4 h-4 text-warning"}),"Warnings (",s.warnings.length,")"]}),u.jsx("div",{className:"space-y-2",children:s.warnings.map((c,d)=>u.jsx("div",{className:"bg-warning-bg border border-warning/30 rounded-lg p-3",children:u.jsx("p",{className:"text-sm text-text-primary",children:c})},d))})]}),s.inputs&&Object.keys(s.inputs).length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary",children:["Required Inputs (",Object.keys(s.inputs).length,")"]}),u.jsx("div",{className:"bg-bg-surface border border-border-default rounded-lg p-4 space-y-2",children:Object.entries(s.inputs).map(([c,d])=>u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsxs("span",{className:"text-text-secondary",children:[c,d.required&&u.jsx("span",{className:"text-error ml-1",children:"*"})]}),u.jsx("span",{className:"text-text-primary font-mono text-xs",children:d.type||"string"})]},c))})]})]}):null}),u.jsx("div",{className:"flex items-center justify-end p-6 border-t border-border-subtle",children:u.jsx("button",{onClick:t,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors",children:"Close"})})]})})]}):null}function Dee({open:e,onOpenChange:t,onImportComplete:n}){const[r,s]=E.useState(null),[o,a]=E.useState(!1),[c,d]=E.useState([]),[f,p]=E.useState(!1),h=E.useRef(null),g=S=>{var I;const A=(I=S.target.files)==null?void 0:I[0];A&&(s(A),d([]))},y=S=>{S.preventDefault(),S.stopPropagation(),p(!0)},b=S=>{S.preventDefault(),S.stopPropagation(),p(!1)},w=S=>{var I;S.preventDefault(),S.stopPropagation(),p(!1);const A=(I=S.dataTransfer.files)==null?void 0:I[0];A&&(s(A),d([]))},v=async()=>{if(r){a(!0),d([]);try{const S=new FormData;S.append("file",r);const A=await fetch("/api/workflows/import",{method:"POST",body:S});if(!A.ok){const T=await A.json();throw new Error(T.message||"Upload failed")}const I=await A.json();Array.isArray(I.results)?d(I.results):I.success&&d([{success:!0,filename:I.filename||r.name,message:I.message}]),setTimeout(()=>{n&&n()},1500)}catch(S){d([{success:!1,filename:r.name,message:S instanceof Error?S.message:"Unknown error"}])}finally{a(!1)}}},k=()=>{s(null),d([]),t(!1)},_=S=>S?[".md",".yaml",".yml",".zip"].some(I=>S.name.toLowerCase().endsWith(I)):!1,N=S=>S.endsWith(".zip")?u.jsx(t9,{className:"w-5 h-5 text-purple-400"}):u.jsx(Do,{className:"w-5 h-5 text-blue-400"});return u.jsxs(hs,{open:e,onOpenChange:t,title:"Import Workflow",description:"Upload workflow files from your computer",size:"md",children:[u.jsxs("div",{className:"p-4 space-y-4",children:[!r&&c.length===0&&u.jsxs("div",{onClick:()=>{var S;return(S=h.current)==null?void 0:S.click()},onDragOver:y,onDragLeave:b,onDrop:w,className:`
|
|
832
|
+
border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors
|
|
833
|
+
${f?"border-primary bg-primary/10":"border-node-border hover:border-primary/50 hover:bg-white/5"}
|
|
834
|
+
`,children:[u.jsx(NR,{className:"w-12 h-12 mx-auto mb-4 text-gray-500"}),u.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"Drag and drop a file here, or click to browse"}),u.jsx("p",{className:"text-xs text-gray-500",children:"Supported formats: .md, .yaml, .yml, .zip"}),u.jsx("input",{ref:h,type:"file",accept:".md,.yaml,.yml,.zip",onChange:g,className:"hidden"})]}),r&&c.length===0&&u.jsxs("div",{className:"border border-node-border rounded-lg p-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[N(r.name),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-white truncate",children:r.name}),u.jsxs("p",{className:"text-xs text-gray-500",children:[(r.size/1024).toFixed(2)," KB"]})]}),!_(r)&&u.jsx(zo,{className:"w-5 h-5 text-error flex-shrink-0"})]}),!_(r)&&u.jsx("p",{className:"text-xs text-error mt-2",children:"Invalid file type. Please select a .md, .yaml, .yml, or .zip file."})]}),c.length>0&&u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"text-sm font-medium text-white",children:"Import Results:"}),c.map((S,A)=>u.jsxs("div",{className:`
|
|
835
|
+
flex items-start gap-3 p-3 rounded-lg border
|
|
836
|
+
${S.success?"border-success/30 bg-success/10":"border-error/30 bg-error/10"}
|
|
837
|
+
`,children:[S.success?u.jsx(zt,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}):u.jsx(lt,{className:"w-5 h-5 text-error flex-shrink-0 mt-0.5"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-white truncate",children:S.filename}),S.message&&u.jsx("p",{className:"text-xs text-gray-400 mt-1",children:S.message})]})]},A))]})]}),u.jsx(Bo,{children:c.length>0?u.jsx(Ve,{variant:"secondary",onClick:k,children:"Close"}):u.jsxs(u.Fragment,{children:[u.jsx(Ve,{variant:"secondary",onClick:k,disabled:o,children:"Cancel"}),u.jsx(Ve,{variant:"primary",onClick:v,disabled:!r||!_(r)||o,children:o?"Uploading...":"Import"})]})})]})}const $ee=[{id:"blank",name:"Blank Workflow",description:"Start from scratch with an empty workflow",icon:u.jsx(Do,{className:"w-5 h-5"}),category:"General"},{id:"slack-notification",name:"Slack Notification",description:"Send messages to Slack channels",icon:u.jsx(mR,{className:"w-5 h-5"}),category:"Communication"},{id:"github-pr",name:"GitHub Pull Request",description:"Create and manage GitHub pull requests",icon:u.jsx(x9,{className:"w-5 h-5"}),category:"Development"},{id:"http-request",name:"HTTP Request",description:"Make HTTP API calls and process responses",icon:u.jsx(dR,{className:"w-5 h-5"}),category:"Integration"},{id:"scheduled-task",name:"Scheduled Task",description:"Run workflows on a schedule with cron triggers",icon:u.jsx(an,{className:"w-5 h-5"}),category:"Automation"},{id:"rss-monitor",name:"RSS Feed Monitor",description:"Monitor RSS/Atom feeds and react to new articles",icon:u.jsx(yw,{className:"w-5 h-5"}),category:"Automation"}];function Fee({open:e,onOpenChange:t,onCreate:n}){const[r,s]=E.useState(""),[o,a]=E.useState("blank"),[c,d]=E.useState(""),f=E.useCallback(()=>{if(!r.trim()){d("Workflow name is required");return}n(r.trim(),o),s(""),a("blank"),d(""),t(!1)},[r,o,n,t]),p=E.useCallback(()=>{s(""),a("blank"),d(""),t(!1)},[t]);return e?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/60 z-modal-backdrop backdrop-blur-sm",onClick:p}),u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-modal p-4",children:u.jsxs("div",{className:"bg-bg-elevated border border-border-default rounded-xl shadow-xl max-w-2xl w-full max-h-[80vh] flex flex-col animate-fade-in",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Create New Workflow"}),u.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"Choose a template to get started quickly"})]}),u.jsx("button",{onClick:p,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors text-text-secondary","aria-label":"Close dialog",children:u.jsx(dr,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-text-primary mb-2",children:["Workflow Name ",u.jsx("span",{className:"text-error",children:"*"})]}),u.jsx("input",{type:"text",value:r,onChange:h=>{s(h.target.value),d("")},placeholder:"e.g., Daily Standup Reminder",className:`w-full px-3 py-2 bg-bg-surface border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 transition-colors ${c?"border-error focus:ring-error/50":"border-border-default focus:ring-accent/50"}`,autoFocus:!0}),c&&u.jsx("p",{className:"text-xs text-error mt-1.5",children:c})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-text-primary mb-3",children:"Template"}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:$ee.map(h=>u.jsx("button",{onClick:()=>a(h.id),className:`p-4 rounded-lg border-2 text-left transition-all ${o===h.id?"border-accent bg-accent-muted":"border-border-default hover:border-border-strong bg-bg-surface"}`,children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center ${o===h.id?"bg-accent text-text-inverse":"bg-bg-elevated text-text-secondary"}`,children:h.icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("h3",{className:"text-sm font-medium text-text-primary truncate",children:h.name}),o===h.id&&u.jsx("div",{className:"flex-shrink-0 w-2 h-2 rounded-full bg-accent"})]}),u.jsx("p",{className:"text-xs text-text-secondary line-clamp-2",children:h.description})]})]})},h.id))})]})]}),u.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:[u.jsx("button",{onClick:p,className:"px-4 py-2 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:"Cancel"}),u.jsx("button",{onClick:f,className:"px-4 py-2 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors",children:"Create Workflow"})]})]})})]}):null}const wo={general:{theme:"dark"},canvas:{showGrid:!0,snapToGrid:!0,gridSize:20,showMinimap:!0,animateEdges:!0},editor:{autoSaveEnabled:!1,autoSaveIntervalMs:3e4,autoValidateOnChange:!0,confirmBeforeDelete:!0},execution:{confirmBeforeExecute:!0,autoScrollLogs:!0,showExecutionNotifications:!0},ai:{showPromptBar:!0,showAISuggestions:!0},notifications:{executionComplete:!0,executionFailed:!0,workflowSaved:!1,connectionStatus:!0}};function QT(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Db(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 Gs=Mn((e,t)=>({theme:"dark",resolvedTheme:"dark",setTheme:n=>{const r=n==="system"?QT():n;Db(r),e({theme:n,resolvedTheme:r})},toggleTheme:()=>{const{theme:n}=t(),r=n==="dark"?"light":"dark",s=r==="system"?QT():r;Db(s),e({theme:r,resolvedTheme:s})}}));Db("dark");typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{const{theme:e,setTheme:t}=Gs.getState();e==="system"&&t("system")});const mr=Mn((e,t)=>({settings:{...wo},loaded:!1,settingsOpen:!1,openSettings:()=>e({settingsOpen:!0}),closeSettings:()=>e({settingsOpen:!1}),loadSettings:async()=>{try{const n=await fetch("/api/settings");if(n.ok){const r=await n.json();e({settings:r,loaded:!0}),Gs.getState().setTheme(r.general.theme)}}catch{e({loaded:!0})}},updateSetting:(n,r,s)=>{const{settings:o}=t(),a={...o,[n]:{...o[n],[r]:s}};e({settings:a}),n==="general"&&r==="theme"&&Gs.getState().setTheme(s),fetch(`/api/settings/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:s})}).catch(()=>{})},updateCategory:(n,r)=>{const{settings:s}=t(),o={...s,[n]:{...s[n],...r}};e({settings:o}),n==="general"&&"theme"in r&&Gs.getState().setTheme(r.theme),fetch(`/api/settings/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).catch(()=>{})},resetCategory:n=>{const{settings:r}=t(),s={...r,[n]:{...wo[n]}};e({settings:s}),n==="general"&&Gs.getState().setTheme(wo.general.theme),fetch(`/api/settings/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(wo[n])}).catch(()=>{})},resetAll:()=>{e({settings:{...wo}}),Gs.getState().setTheme(wo.general.theme),fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(wo)}).catch(()=>{})}}));function Bee({label:e,description:t,value:n,options:r,onChange:s}){return u.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:e}),t&&u.jsx("div",{className:"text-xs text-text-muted mt-0.5",children:t})]}),u.jsx("select",{value:n,onChange:o=>s(o.target.value),className:"bg-bg-surface border border-border-default rounded-lg px-3 py-1.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent",children:r.map(o=>u.jsx("option",{value:o.value,children:o.label},o.value))})]})}function qee(){const{settings:e,updateSetting:t}=mr();return u.jsx("div",{className:"divide-y divide-border-default",children:u.jsx(Bee,{label:"Theme",description:"Choose the color scheme for the application",value:e.general.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],onChange:n=>t("general","theme",n)})})}function Yt({label:e,description:t,checked:n,onChange:r}){return u.jsxs("label",{className:"flex items-center justify-between gap-4 py-3 cursor-pointer group",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:e}),t&&u.jsx("div",{className:"text-xs text-text-muted mt-0.5",children:t})]}),u.jsx("button",{role:"switch","aria-checked":n,onClick:()=>r(!n),className:`relative inline-flex h-5 w-9 flex-shrink-0 rounded-full transition-colors duration-200 ${n?"bg-accent":"bg-bg-surface"}`,children:u.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transform transition-transform duration-200 mt-0.5 ${n?"translate-x-4 ml-0.5":"translate-x-0.5"}`})})]})}function J3({label:e,description:t,value:n,min:r,max:s,step:o=1,onChange:a}){return u.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium text-text-primary",children:e}),t&&u.jsx("div",{className:"text-xs text-text-muted mt-0.5",children:t})]}),u.jsx("input",{type:"number",value:n,min:r,max:s,step:o,onChange:c=>{const d=Number(c.target.value);isNaN(d)||a(d)},className:"w-24 bg-bg-surface border border-border-default rounded-lg px-3 py-1.5 text-sm text-text-primary text-right focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent"})]})}function zee(){const{settings:e,updateSetting:t}=mr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Yt,{label:"Show Grid",description:"Display grid lines on the canvas background",checked:e.canvas.showGrid,onChange:n=>t("canvas","showGrid",n)}),u.jsx(Yt,{label:"Snap to Grid",description:"Nodes snap to grid positions when dragging",checked:e.canvas.snapToGrid,onChange:n=>t("canvas","snapToGrid",n)}),u.jsx(J3,{label:"Grid Size",description:"Grid spacing in pixels",value:e.canvas.gridSize,min:5,max:100,step:5,onChange:n=>t("canvas","gridSize",n)}),u.jsx(Yt,{label:"Show Minimap",description:"Display minimap navigation in the corner",checked:e.canvas.showMinimap,onChange:n=>t("canvas","showMinimap",n)}),u.jsx(Yt,{label:"Animate Edges",description:"Show animated flow along connection edges",checked:e.canvas.animateEdges,onChange:n=>t("canvas","animateEdges",n)})]})}function Vee(){const{settings:e,updateSetting:t}=mr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Yt,{label:"Auto-Save",description:"Automatically save workflows at a regular interval",checked:e.editor.autoSaveEnabled,onChange:n=>t("editor","autoSaveEnabled",n)}),e.editor.autoSaveEnabled&&u.jsx(J3,{label:"Auto-Save Interval",description:"Interval in seconds between automatic saves",value:e.editor.autoSaveIntervalMs/1e3,min:5,max:300,step:5,onChange:n=>t("editor","autoSaveIntervalMs",n*1e3)}),u.jsx(Yt,{label:"Auto-Validate on Change",description:"Run workflow validation after each edit",checked:e.editor.autoValidateOnChange,onChange:n=>t("editor","autoValidateOnChange",n)}),u.jsx(Yt,{label:"Confirm Before Delete",description:"Show confirmation dialog before deleting steps",checked:e.editor.confirmBeforeDelete,onChange:n=>t("editor","confirmBeforeDelete",n)})]})}function Hee(){const{settings:e,updateSetting:t}=mr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Yt,{label:"Confirm Before Execute",description:"Show confirmation dialog before running workflows",checked:e.execution.confirmBeforeExecute,onChange:n=>t("execution","confirmBeforeExecute",n)}),u.jsx(Yt,{label:"Auto-Scroll Logs",description:"Automatically scroll to the latest log entry during execution",checked:e.execution.autoScrollLogs,onChange:n=>t("execution","autoScrollLogs",n)}),u.jsx(Yt,{label:"Show Execution Notifications",description:"Display toast notifications when execution completes or fails",checked:e.execution.showExecutionNotifications,onChange:n=>t("execution","showExecutionNotifications",n)})]})}function Uee(){const{settings:e,updateSetting:t}=mr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Yt,{label:"Show Prompt Bar",description:"Display the AI prompt input at the bottom of the canvas",checked:e.ai.showPromptBar,onChange:n=>t("ai","showPromptBar",n)}),u.jsx(Yt,{label:"Show AI Suggestions",description:"Display AI-generated suggestions while editing workflows",checked:e.ai.showAISuggestions,onChange:n=>t("ai","showAISuggestions",n)})]})}function Wee(){const{settings:e,updateSetting:t}=mr();return u.jsxs("div",{className:"divide-y divide-border-default",children:[u.jsx(Yt,{label:"Execution Complete",description:"Notify when a workflow execution finishes successfully",checked:e.notifications.executionComplete,onChange:n=>t("notifications","executionComplete",n)}),u.jsx(Yt,{label:"Execution Failed",description:"Notify when a workflow execution fails",checked:e.notifications.executionFailed,onChange:n=>t("notifications","executionFailed",n)}),u.jsx(Yt,{label:"Workflow Saved",description:"Notify when a workflow is saved",checked:e.notifications.workflowSaved,onChange:n=>t("notifications","workflowSaved",n)}),u.jsx(Yt,{label:"Connection Status",description:"Notify when WebSocket connection state changes",checked:e.notifications.connectionStatus,onChange:n=>t("notifications","connectionStatus",n)})]})}const JT=[{key:"general",label:"General",icon:vR,component:qee},{key:"canvas",label:"Canvas",icon:gw,component:zee},{key:"editor",label:"Editor",icon:c9,component:Vee},{key:"execution",label:"Execution",icon:Vo,component:Hee},{key:"ai",label:"AI",icon:Nl,component:Uee},{key:"notifications",label:"Notifications",icon:s9,component:Wee}];function Kee(){const{settingsOpen:e,closeSettings:t,resetCategory:n}=mr(),[r,s]=E.useState("general"),o=JT.find(c=>c.key===r),a=o.component;return u.jsx(hs,{open:e,onOpenChange:c=>{c||t()},title:"Settings",size:"xl",children:u.jsxs("div",{className:"flex min-h-[400px]",children:[u.jsx("nav",{className:"w-48 border-r border-border-default p-2 flex-shrink-0",children:JT.map(({key:c,label:d,icon:f})=>u.jsxs("button",{onClick:()=>s(c),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors ${r===c?"bg-accent-muted text-accent":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"}`,children:[u.jsx(f,{className:"w-4 h-4"}),d]},c))}),u.jsxs("div",{className:"flex-1 p-6",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-base font-semibold text-text-primary",children:o.label}),u.jsxs("button",{onClick:()=>n(r),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs text-text-muted hover:text-text-secondary hover:bg-bg-hover transition-colors",title:"Reset to defaults",children:[u.jsx(yR,{className:"w-3.5 h-3.5"}),"Reset"]})]}),u.jsx(a,{})]})]})})}function Gee(){const[e,t]=E.useState("workflows"),{workflows:n,selectedWorkflow:r,selectWorkflow:s}=sn(),{resetNavigation:o}=Tw(),{sidebarOpen:a,setSidebarOpen:c,breakpoint:d}=eh(),f=E.useCallback(p=>{o(),s(p),d==="mobile"&&c(!1)},[o,s,d,c]);return!a&&d!=="mobile"?u.jsxs("button",{onClick:()=>c(!0),className:"w-12 bg-bg-panel border-r border-border-default flex flex-col items-center py-4 gap-4 hover:bg-bg-hover transition-colors","aria-label":"Expand sidebar",children:[u.jsx(qt,{className:"w-4 h-4 text-text-secondary"}),u.jsx("img",{src:"/marktoflow-logo.png",alt:"Marktoflow",className:"w-6 h-6 rounded-full object-cover"})]}):d==="mobile"?a?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>c(!1)}),u.jsx("div",{className:"fixed inset-y-0 left-0 w-72 bg-bg-panel border-r border-border-default flex flex-col z-50 md:hidden animate-slide-in-left",children:u.jsx(ZT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:!0})})]}):null:u.jsx("div",{className:"w-64 bg-bg-panel border-r border-border-default flex flex-col transition-all duration-300",children:u.jsx(ZT,{activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:f,onClose:()=>c(!1),showClose:d==="tablet"})})}function ZT({activeTab:e,setActiveTab:t,workflows:n,selectedWorkflow:r,onSelectWorkflow:s,onClose:o,showClose:a}){const[c,d]=E.useState(!1),[f,p]=E.useState(!1),[h,g]=E.useState(""),{fetchWorkflows:y}=sn(),b=E.useCallback(async(v,k)=>{try{const _=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v,template:k})});if(!_.ok){const S=await _.json();console.error("Failed to create workflow:",S);return}const N=await _.json();console.log("Created workflow:",N),await y(),N.path&&s(N.path)}catch(_){console.error("Failed to create workflow:",_)}},[y,s]),w=n.filter(v=>{if(!h.trim())return!0;const k=h.toLowerCase();return v.name.toLowerCase().includes(k)||v.path.toLowerCase().includes(k)});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"p-4 border-b border-border-default flex items-center justify-between",children:[u.jsxs("h1",{className:"text-lg font-semibold text-text-primary flex items-center gap-2",children:[u.jsx("img",{src:"/marktoflow-logo.png",alt:"Marktoflow",className:"w-8 h-8 rounded-full object-cover"}),"Marktoflow"]}),a&&u.jsx("button",{onClick:o,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Close sidebar",children:u.jsx(dr,{className:"w-4 h-4 text-text-secondary"})})]}),u.jsxs("div",{className:"flex border-b border-border-default",children:[u.jsx("button",{onClick:()=>t("workflows"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="workflows"?"text-accent border-b-2 border-accent":"text-text-secondary hover:text-text-primary"}`,children:"Workflows"}),u.jsx("button",{onClick:()=>t("tools"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${e==="tools"?"text-accent border-b-2 border-accent":"text-text-secondary hover:text-text-primary"}`,children:"Tools"})]}),u.jsx("div",{className:"p-3 border-b border-border-default",children:u.jsxs("div",{className:"relative",children:[u.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted"}),u.jsx("input",{type:"text",value:h,onChange:v=>g(v.target.value),placeholder:`Search ${e}...`,className:"w-full pl-9 pr-3 py-2 bg-bg-surface border border-border-default rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent/50 focus:border-accent transition-colors"}),h&&u.jsx("button",{onClick:()=>g(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary","aria-label":"Clear search",children:u.jsx(dr,{className:"w-4 h-4"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:e==="workflows"?u.jsx(Yee,{workflows:w,selectedWorkflow:r,onSelect:s,searchQuery:h}):u.jsx(Qee,{})}),e==="workflows"&&u.jsxs("div",{className:"p-3 border-t border-border-default space-y-2",children:[u.jsxs("button",{onClick:()=>p(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-accent hover:bg-accent-hover text-text-inverse rounded-lg text-sm font-medium transition-colors shadow-sm",children:[u.jsx(df,{className:"w-4 h-4"}),"New Workflow"]}),u.jsxs("button",{onClick:()=>d(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-bg-surface border border-border-default hover:bg-bg-hover text-text-primary rounded-lg text-sm font-medium transition-colors",children:[u.jsx(NR,{className:"w-4 h-4"}),"Import"]})]}),u.jsx("div",{className:"p-3 border-t border-border-default",children:u.jsxs("button",{onClick:()=>mr.getState().openSettings(),className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg text-text-secondary hover:bg-bg-hover hover:text-text-primary transition-colors text-sm",title:"Settings (⌘,)",children:[u.jsx(vR,{className:"w-4 h-4"}),"Settings"]})}),u.jsx(Dee,{open:c,onOpenChange:d,onImportComplete:()=>y()}),u.jsx(Fee,{open:f,onOpenChange:p,onCreate:b}),u.jsx(Kee,{})]})}function Yee({workflows:e,selectedWorkflow:t,onSelect:n,searchQuery:r=""}){return e.length===0?u.jsx("div",{className:"text-center py-8 text-text-muted text-sm",children:r?u.jsxs(u.Fragment,{children:[u.jsx(Fl,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),u.jsxs("p",{children:['No workflows match "',r,'"']})]}):u.jsxs(u.Fragment,{children:[u.jsx(Do,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),u.jsx("p",{children:"No workflows found"}),u.jsx("p",{className:"text-xs mt-1 text-text-muted",children:"Create your first workflow to get started"})]})}):u.jsx("div",{className:"space-y-1",children:e.map(s=>u.jsxs("button",{onClick:()=>n(s.path),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors ${t===s.path?"bg-accent-muted text-accent border border-accent/20":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"}`,children:[u.jsx(Do,{className:"w-4 h-4 flex-shrink-0"}),u.jsx("span",{className:"text-sm truncate",children:s.name}),u.jsx(qt,{className:"w-4 h-4 ml-auto flex-shrink-0 opacity-50"})]},s.path))})}const Xee=[{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 Qee(){const[e,t]=E.useState(Xee),[n,r]=E.useState(!0),[s,o]=E.useState("");E.useEffect(()=>{async function f(){try{const p=await fetch("/api/tools");if(p.ok){const h=await p.json();t(h.tools)}}catch(p){console.error("Failed to fetch tools:",p)}finally{r(!1)}}f()},[]);const a=s?e.filter(f=>{var p;return f.name.toLowerCase().includes(s.toLowerCase())||f.category.toLowerCase().includes(s.toLowerCase())||((p=f.description)==null?void 0:p.toLowerCase().includes(s.toLowerCase()))}):e,c=[...new Set(a.map(f=>f.category))],d=(f,p)=>{f.dataTransfer.setData("application/marktoflow-tool",JSON.stringify(p)),f.dataTransfer.effectAllowed="copy"};return n?u.jsx("div",{className:"flex items-center justify-center py-8",children:u.jsx(Dr,{className:"w-5 h-5 text-gray-500 animate-spin"})}):u.jsxs("div",{className:"space-y-4",children:[c.map(f=>u.jsxs("div",{children:[u.jsx("h3",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider px-2 mb-2",children:f}),u.jsx("div",{className:"space-y-1",children:a.filter(p=>p.category===f).map(p=>u.jsxs("div",{draggable:!0,onDragStart:h=>d(h,p),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-gray-300 hover:bg-white/5 cursor-grab active:cursor-grabbing transition-colors group",title:p.description||(p.sdk?"SDK: "+p.sdk:void 0),children:[u.jsx("span",{className:"text-lg",children:p.icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"text-sm block truncate",children:p.name}),p.actionCount!==void 0&&u.jsxs("span",{className:"text-xs text-gray-500",children:[p.actionCount," actions"]})]})]},p.id))})]},f)),a.length===0&&u.jsx("div",{className:"text-center py-8 text-gray-500 text-sm",children:"No tools found"})]})}const eI={enabled:!1,breakpoints:new Set,currentStepId:null,pausedAtBreakpoint:!1,stepOverPending:!1,watchExpressions:[],callStack:[]},Z3=Mn((e,t)=>({runs:[],currentRunId:null,isExecuting:!1,isPaused:!1,isLoadingHistory:!1,debug:eI,startExecution:(n,r,s,o)=>{const a=o||"run-"+Date.now()+"-"+Math.random().toString(36).slice(2,8),c={id:a,workflowId:n,workflowName:r,status:"running",startTime:new Date().toISOString(),steps:[],logs:["Starting workflow execution: "+r],inputs:s};return e({runs:[c,...t().runs].slice(0,50),currentRunId:a,isExecuting:!0,isPaused:!1}),a},updateStepStatus:(n,r,s,o,a,c,d)=>{const{debug:f}=t(),p=f.enabled&&s==="running"&&f.breakpoints.has(r);e({runs:t().runs.map(h=>{if(h.id!==n)return h;const g=h.steps.find(b=>b.stepId===r),y=new Date().toISOString();return g?{...h,steps:h.steps.map(b=>{if(b.stepId!==r)return b;const w=s!=="running"?y:void 0,v=w&&b.startTime?new Date(w).getTime()-new Date(b.startTime).getTime():void 0;return{...b,status:s,endTime:w,duration:v,inputs:d??b.inputs,output:o??b.output,outputVariable:c??b.outputVariable,error:a??b.error}})}:{...h,steps:[...h.steps,{stepId:r,stepName:r,status:s,startTime:y,inputs:d,output:o,outputVariable:c,error:a}]}}),...p?{isPaused:!0,debug:{...t().debug,currentStepId:r,pausedAtBreakpoint:!0,stepOverPending:!1}}:{debug:{...t().debug,currentStepId:s==="running"?r:t().debug.currentStepId}}}),p&&t().addLog(n,`⏸️ Paused at breakpoint: ${r}`)},completeExecution:(n,r,s)=>{const o=new Date().toISOString();e({runs:t().runs.map(a=>{if(a.id!==n)return a;const c=new Date(o).getTime()-new Date(a.startTime).getTime();return{...a,status:r,endTime:o,duration:c,outputs:s,logs:[...a.logs,r==="completed"?"Workflow completed successfully":r==="failed"?"Workflow execution failed":"Workflow execution cancelled"]}}),currentRunId:null,isExecuting:!1,isPaused:!1})},addLog:(n,r)=>{e({runs:t().runs.map(s=>s.id===n?{...s,logs:[...s.logs,"["+new Date().toLocaleTimeString()+"] "+r]}:s)})},pauseExecution:()=>{e({isPaused:!0});const{currentRunId:n,runs:r}=t();n&&r.find(o=>o.id===n)&&t().addLog(n,"Execution paused")},resumeExecution:()=>{e({isPaused:!1});const{currentRunId:n}=t();n&&t().addLog(n,"Execution resumed")},cancelExecution:n=>{t().addLog(n,"Execution cancelled by user"),t().completeExecution(n,"cancelled")},clearHistory:()=>{e({runs:[]})},getRun:n=>t().runs.find(r=>r.id===n),enableDebugMode:()=>{e({debug:{...t().debug,enabled:!0}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode enabled")},disableDebugMode:()=>{e({debug:{...eI,breakpoints:t().debug.breakpoints}});const{currentRunId:n}=t();n&&t().addLog(n,"🐛 Debug mode disabled")},toggleBreakpoint:n=>{const{debug:r}=t(),s=new Set(r.breakpoints);s.has(n)?s.delete(n):s.add(n),e({debug:{...r,breakpoints:s}})},hasBreakpoint:n=>t().debug.breakpoints.has(n),clearAllBreakpoints:()=>{e({debug:{...t().debug,breakpoints:new Set}});const{currentRunId:n}=t();n&&t().addLog(n,"All breakpoints cleared")},stepOver:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"➡️ Step over"))},stepInto:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!0,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬇️ Step into"))},stepOut:()=>{const{debug:n,currentRunId:r,isPaused:s}=t();!s||!n.enabled||(e({isPaused:!1,debug:{...n,stepOverPending:!1,pausedAtBreakpoint:!1}}),r&&t().addLog(r,"⬆️ Step out"))},setCurrentDebugStep:n=>{e({debug:{...t().debug,currentStepId:n}})},addWatchExpression:n=>{const{debug:r}=t();r.watchExpressions.includes(n)||e({debug:{...r,watchExpressions:[...r.watchExpressions,n]}})},removeWatchExpression:n=>{const{debug:r}=t();e({debug:{...r,watchExpressions:r.watchExpressions.filter(s=>s!==n)}})},updateCallStack:n=>{e({debug:{...t().debug,callStack:n}})},loadHistory:async n=>{e({isLoadingHistory:!0});try{const r=n?`/api/executions?workflowId=${encodeURIComponent(n)}&limit=50`:"/api/executions?limit=50",s=await fetch(r);if(!s.ok)throw new Error("Failed to load execution history");const a=(await s.json()).map(f=>{var p;return{id:f.runId,workflowId:f.workflowId,workflowName:((p=f.workflowPath.split("/").pop())==null?void 0:p.replace(".md",""))||f.workflowId,status:f.status,startTime:f.startedAt,endTime:f.completedAt||void 0,duration:f.completedAt?new Date(f.completedAt).getTime()-new Date(f.startedAt).getTime():void 0,steps:[],logs:[],inputs:f.inputs||void 0,outputs:f.outputs||void 0}}),c=new Set(t().runs.map(f=>f.id)),d=a.filter(f=>!c.has(f.id));e({runs:[...t().runs,...d].slice(0,50),isLoadingHistory:!1})}catch(r){console.error("Error loading execution history:",r),e({isLoadingHistory:!1})}},syncRunWithBackend:async n=>{console.log("Syncing run with backend:",n)}}));function $b(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 Jee(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),s=Math.floor(r/1e3),o=Math.floor(s/60),a=Math.floor(o/60),c=Math.floor(a/24);return s<60?"just now":o<60?o+" min ago":a<24?a+" hour"+(a>1?"s":"")+" ago":c<7?c+" day"+(c>1?"s":"")+" ago":n.toLocaleDateString()}const Zee=Mn((e,t)=>({versions:[],isLoading:!1,compareMode:!1,selectedVersions:[null,null],loadVersions:async n=>{e({isLoading:!0});try{const r=await fetch(`/api/versions/${encodeURIComponent(n)}/versions`);if(!r.ok)throw new Error("Failed to load versions");const s=await r.json();e({versions:s.versions,isLoading:!1})}catch{e({isLoading:!1})}},createVersion:async(n,r,s)=>{try{await fetch(`/api/versions/${encodeURIComponent(n)}/versions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r,message:s})}),await t().loadVersions(n)}catch{}},restoreVersion:async(n,r)=>{try{const s=await fetch(`/api/versions/${encodeURIComponent(n)}/versions/${r}/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!s.ok)throw new Error("Failed to restore");const o=await s.json();return await t().loadVersions(n),o.restoredContent}catch{return null}},setCompareMode:n=>e({compareMode:n,selectedVersions:[null,null]}),selectForCompare:n=>{const{selectedVersions:r}=t();r[0]?r[1]?e({selectedVersions:[n,null]}):e({selectedVersions:[r[0],n]}):e({selectedVersions:[n,null]})}}));function ete({workflowPath:e,onRestore:t}){const{versions:n,isLoading:r,compareMode:s,selectedVersions:o,loadVersions:a,restoreVersion:c,setCompareMode:d,selectForCompare:f}=Zee();E.useEffect(()=>{e&&a(e)},[e,a]);const p=async h=>{if(!e)return;const g=await c(e,h);g&&t&&t(g)};return e?u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-default",children:[u.jsxs("h3",{className:"text-sm font-medium text-text-primary flex items-center gap-2",children:[u.jsx(uf,{className:"w-4 h-4"}),"Version History"]}),u.jsxs(Ve,{variant:s?"primary":"secondary",size:"sm",onClick:()=>d(!s),children:[u.jsx(uR,{className:"w-3.5 h-3.5 mr-1"}),"Compare"]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:r?u.jsx("div",{className:"text-center py-8 text-sm text-text-muted",children:"Loading versions..."}):n.length===0?u.jsx("div",{className:"text-center py-8 text-sm text-text-muted",children:"No versions saved yet"}):n.map(h=>u.jsxs("div",{className:Ye("p-3 rounded-lg border transition-colors",s&&o.includes(h.id)?"border-primary bg-primary/10":"border-border-default bg-bg-surface hover:border-border-default/80"),children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsxs("span",{className:"text-sm font-medium text-text-primary flex items-center gap-1.5",children:[u.jsx(V9,{className:"w-3 h-3 text-primary"}),"v",h.version]}),u.jsx("span",{className:"text-xs text-text-muted font-mono",children:h.hash})]}),u.jsx("div",{className:"text-xs text-text-secondary mb-2",children:h.message}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(U9,{className:"w-3 h-3"}),h.author]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(an,{className:"w-3 h-3"}),new Date(h.createdAt).toLocaleString()]})]}),u.jsx("div",{className:"flex gap-1",children:s?u.jsx("button",{onClick:()=>f(h.id),className:"px-2 py-1 text-xs rounded bg-bg-hover text-text-secondary hover:text-text-primary",children:"Select"}):u.jsxs("button",{onClick:()=>p(h.id),className:"px-2 py-1 text-xs rounded bg-bg-hover text-text-secondary hover:text-text-primary flex items-center gap-1",children:[u.jsx(yR,{className:"w-3 h-3"}),"Restore"]})})]}),h.isAutoSave&&u.jsx("span",{className:"mt-1 inline-block text-xs text-text-muted bg-bg-hover px-1.5 py-0.5 rounded",children:"auto"})]},h.id))})]}):u.jsx("div",{className:"p-4 text-sm text-text-muted text-center",children:"Select a workflow to view versions"})}const tte=E.memo(ete);function nte(){const[e,t]=E.useState("properties"),n=qr(f=>f.nodes),r=E.useMemo(()=>n.filter(f=>f.selected),[n]),s=sn(f=>f.currentWorkflow),o=sn(f=>f.selectedWorkflow),{propertiesPanelOpen:a,setPropertiesPanelOpen:c,breakpoint:d}=eh();return d==="mobile"?a?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:()=>c(!1)}),u.jsx("div",{className:"fixed inset-y-0 right-0 w-80 max-w-[85vw] bg-bg-panel border-l border-border-default flex flex-col z-50 animate-slide-in-right",children:u.jsx(tI,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,selectedWorkflow:o,onClose:()=>c(!1),showClose:!0})})]}):null:a?u.jsx("div",{className:"w-80 bg-bg-panel border-l border-border-default flex flex-col transition-all duration-300",children:u.jsx(tI,{activeTab:e,setActiveTab:t,selectedNodes:r,workflow:s,selectedWorkflow:o,onClose:()=>c(!1),showClose:d==="tablet"})}):u.jsxs("button",{onClick:()=>c(!0),className:"w-10 bg-bg-panel border-l border-border-default flex flex-col items-center py-4 gap-4 hover:bg-bg-hover transition-colors","aria-label":"Expand properties panel",children:[u.jsx(lR,{className:"w-4 h-4 text-text-secondary"}),u.jsx(Ji,{className:"w-5 h-5 text-text-secondary"})]})}function tI({activeTab:e,setActiveTab:t,selectedNodes:n,workflow:r,selectedWorkflow:s,onClose:o,showClose:a}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border-default",children:[u.jsx("h2",{className:"text-sm font-medium text-text-primary",children:"Properties"}),a&&u.jsx("button",{onClick:o,className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Close properties panel",children:u.jsx(dr,{className:"w-4 h-4 text-text-secondary"})})]}),u.jsxs("div",{className:"flex border-b border-border-default",children:[u.jsx(sd,{active:e==="properties",onClick:()=>t("properties"),icon:u.jsx(Ji,{className:"w-4 h-4"}),label:"Properties"}),u.jsx(sd,{active:e==="variables",onClick:()=>t("variables"),icon:u.jsx(sc,{className:"w-4 h-4"}),label:"Variables"}),u.jsx(sd,{active:e==="history",onClick:()=>t("history"),icon:u.jsx(uf,{className:"w-4 h-4"}),label:"History"}),u.jsx(sd,{active:e==="versions",onClick:()=>t("versions"),icon:u.jsx(Pd,{className:"w-4 h-4"}),label:"Versions"})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="properties"&&u.jsx(rte,{selectedNodes:n,workflow:r}),e==="variables"&&u.jsx(ste,{workflow:r}),e==="history"&&u.jsx(ote,{}),e==="versions"&&u.jsx(tte,{workflowPath:s})]})]})}function sd({active:e,onClick:t,icon:n,label:r}){return u.jsxs("button",{onClick:t,className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors ${e?"text-accent border-b-2 border-accent -mb-px":"text-text-secondary hover:text-text-primary"}`,children:[n,r]})}function rte({selectedNodes:e,workflow:t}){var n,r,s,o,a,c,d,f,p,h,g,y,b,w,v;if(e.length===0)return u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsx(Ti,{title:"Workflow",children:t?u.jsxs("div",{className:"space-y-3",children:[u.jsx(Hs,{label:"Name",value:((n=t.metadata)==null?void 0:n.name)||"Untitled"}),u.jsx(Hs,{label:"Version",value:((r=t.metadata)==null?void 0:r.version)||"1.0.0"}),u.jsx(Hs,{label:"Author",value:((s=t.metadata)==null?void 0:s.author)||"Unknown"}),u.jsx(Hs,{label:"Steps",value:`${((o=t.steps)==null?void 0:o.length)||0} steps`})]}):u.jsx("div",{className:"text-sm text-text-muted",children:"No workflow loaded"})}),((a=t==null?void 0:t.metadata)==null?void 0:a.description)&&u.jsx(Ti,{title:"Description",children:u.jsx("p",{className:"text-sm text-text-primary",children:t.metadata.description})}),((c=t==null?void 0:t.metadata)==null?void 0:c.tags)&&t.metadata.tags.length>0&&u.jsx(Ti,{title:"Tags",children:u.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.metadata.tags.map(k=>u.jsx("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-full",children:k},k))})})]});if(e.length===1){const k=e[0];return u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsx(Ti,{title:"Step",children:u.jsxs("div",{className:"space-y-3",children:[u.jsx(Hs,{label:"ID",value:((d=k.data)==null?void 0:d.id)||k.id}),u.jsx(Hs,{label:"Name",value:((f=k.data)==null?void 0:f.name)||"(unnamed)"}),u.jsx(Hs,{label:"Action",value:((p=k.data)==null?void 0:p.action)||((h=k.data)==null?void 0:h.workflowPath)||"-"}),u.jsx(Hs,{label:"Status",value:((g=k.data)==null?void 0:g.status)||"pending",badge:!0,badgeColor:((y=k.data)==null?void 0:y.status)==="completed"?"success":((b=k.data)==null?void 0:b.status)==="failed"?"error":((w=k.data)==null?void 0:w.status)==="running"?"warning":"default"})]})}),((v=k.data)==null?void 0:v.error)&&u.jsx(Ti,{title:"Error",children:u.jsx("div",{className:"p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono",children:k.data.error})}),u.jsx(Ti,{title:"Actions",children:u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{className:"flex-1 px-3 py-1.5 bg-bg-surface border border-border-default rounded text-xs text-text-primary hover:border-accent transition-colors",children:"Edit"}),u.jsx("button",{className:"flex-1 px-3 py-1.5 bg-bg-surface border border-border-default rounded text-xs text-text-primary hover:border-accent transition-colors",children:"View YAML"})]})})]})}return u.jsx("div",{className:"p-4",children:u.jsxs("div",{className:"text-sm text-text-secondary",children:[e.length," nodes selected"]})})}function ste({workflow:e}){const t=E.useMemo(()=>{const n=[];return e!=null&&e.inputs&&Object.entries(e.inputs).forEach(([r,s])=>{n.push({name:`inputs.${r}`,value:s.default!==void 0?String(s.default):"(no default)",type:s.type||"string",source:"input"})}),e!=null&&e.steps&&e.steps.forEach(r=>{r.outputVariable&&n.push({name:r.outputVariable,value:`Output from step: ${r.name||r.id}`,type:"any",source:"output"})}),n},[e]);return t.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[u.jsx(sc,{className:"w-12 h-12 text-text-muted mb-3"}),u.jsx("p",{className:"text-sm text-text-secondary mb-1",children:"No variables yet"}),u.jsx("p",{className:"text-xs text-text-muted",children:"Define workflow inputs or add output variables to steps"})]}):u.jsx("div",{className:"p-4 space-y-2",children:t.map(n=>u.jsxs("div",{className:"p-3 bg-bg-surface rounded-lg border border-border-default",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs font-mono text-primary",children:n.name}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-bg-hover text-text-secondary",children:n.source==="input"?"input":"output"}),u.jsx("span",{className:"text-xs text-text-muted",children:n.type})]})]}),u.jsx("div",{className:"text-sm text-text-primary font-mono truncate",title:n.value,children:n.value})]},n.name))})}function ote(){const{runs:e,clearHistory:t}=Z3(),[n,r]=E.useState(null);return n?u.jsx(ite,{run:n,onBack:()=>r(null)}):e.length===0?u.jsxs("div",{className:"p-4 text-center",children:[u.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-bg-surface flex items-center justify-center",children:u.jsx(uf,{className:"w-6 h-6 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary mb-1",children:"No execution history"}),u.jsx("p",{className:"text-xs text-text-muted",children:"Run a workflow to see execution history here"})]}):u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:e.map(s=>u.jsxs("button",{onClick:()=>r(s),className:"w-full p-3 bg-bg-surface rounded-lg border border-border-default cursor-pointer hover:border-accent transition-colors text-left",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs font-medium text-white truncate max-w-[140px]",children:s.workflowName}),u.jsx(e5,{status:s.status})]}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-text-secondary",children:[u.jsx("span",{children:s.duration?$b(s.duration):"-"}),u.jsx("span",{children:Jee(s.startTime)})]}),s.steps.length>0&&u.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[s.steps.slice(0,5).map(o=>u.jsx(lte,{status:o.status},o.stepId)),s.steps.length>5&&u.jsxs("span",{className:"text-xs text-text-muted",children:["+",s.steps.length-5]})]})]},s.id))}),e.length>0&&u.jsx("div",{className:"p-3 border-t border-border-default",children:u.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-xs text-text-secondary hover:text-error transition-colors",children:[u.jsx(oa,{className:"w-3.5 h-3.5"}),"Clear History"]})})]})}function ite({run:e,onBack:t}){const[n,r]=E.useState(!1);return u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"p-3 border-b border-border-default",children:[u.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-text-secondary hover:text-text-primary mb-2",children:[u.jsx(qt,{className:"w-3 h-3 rotate-180"}),"Back to history"]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm font-medium text-white truncate max-w-[180px]",children:e.workflowName}),u.jsx(e5,{status:e.status})]}),u.jsxs("div",{className:"flex items-center justify-between mt-1 text-xs text-text-secondary",children:[u.jsx("span",{children:e.duration?$b(e.duration):"Running..."}),u.jsx("span",{children:new Date(e.startTime).toLocaleString()})]})]}),u.jsxs("div",{className:"flex border-b border-border-default",children:[u.jsxs("button",{onClick:()=>r(!1),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-text-secondary hover:text-text-primary":"text-primary border-b-2 border-primary -mb-px"}`,children:["Steps (",e.steps.length,")"]}),u.jsxs("button",{onClick:()=>r(!0),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors ${n?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:["Logs (",e.logs.length,")"]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?u.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.logs.map((s,o)=>u.jsx("div",{className:"text-text-primary break-words",children:s},o))}):u.jsx("div",{className:"space-y-2",children:e.steps.map(s=>u.jsxs("div",{className:"p-2 bg-bg-surface rounded border border-border-default",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-xs font-medium text-white truncate",children:s.stepName}),u.jsx(ate,{status:s.status})]}),s.duration&&u.jsx("div",{className:"text-xs text-text-muted mt-1",children:$b(s.duration)}),s.error&&u.jsx("div",{className:"mt-2 p-2 bg-error/10 border border-error/20 rounded text-xs text-error",children:s.error})]},s.stepId))})})]})}function e5({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning",icon:Dr},completed:{bg:"bg-success/10",text:"text-success",icon:zt},failed:{bg:"bg-error/10",text:"text-error",icon:lt},cancelled:{bg:"bg-gray-500/10",text:"text-text-secondary",icon:lt},pending:{bg:"bg-gray-500/10",text:"text-text-secondary",icon:an}},{bg:n,text:r,icon:s}=t[e]||t.pending;return u.jsxs("span",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${n} ${r}`,children:[u.jsx(s,{className:`w-3 h-3 ${e==="running"?"animate-spin":""}`}),e]})}function ate({status:e}){const t={running:{bg:"bg-warning/10",text:"text-warning"},completed:{bg:"bg-success/10",text:"text-success"},failed:{bg:"bg-error/10",text:"text-error"},pending:{bg:"bg-gray-500/10",text:"text-text-secondary"}},{bg:n,text:r}=t[e]||t.pending;return u.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n} ${r}`,children:e})}function lte({status:e}){const t={running:"bg-warning",completed:"bg-success",failed:"bg-error",pending:"bg-gray-500"};return u.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]||t.pending} ${e==="running"?"animate-pulse":""}`,title:e})}function Ti({title:e,children:t}){return u.jsxs("div",{children:[u.jsx("h3",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:e}),t]})}function Hs({label:e,value:t,badge:n,badgeColor:r="default"}){const s={default:"bg-gray-500/10 text-text-secondary",success:"bg-success/10 text-success",error:"bg-error/10 text-error",warning:"bg-warning/10 text-warning"};return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-xs text-text-secondary",children:e}),n?u.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s[r]}`,children:t}):u.jsx("span",{className:"text-sm text-text-primary font-mono truncate max-w-[180px]",children:t})]})}function cte(e){if(!e)return[];const t=[],n=/```yaml\s*\n([\s\S]*?)\n```/g;let r,s=0;for(;(r=n.exec(e))!==null;){const o=r[1];try{const a=e4(o);if(a&&a.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(a.type)){const c=a.id||`control-flow-${a.type}-${s++}`,d={...a,id:c,inputs:a.inputs||{}};t.push(d)}}catch(a){console.warn("Failed to parse control flow YAML block:",a)}}return t}function t5(e){const t=[],n=[],o=cte(e.markdown),a=new Set(e.steps.map(b=>b.id)),c=o.filter(b=>!a.has(b.id)),d=[...e.steps,...c],f=(b,w,v,k)=>{let _=v,N=null;return b.forEach((S,A)=>{var P,H,D,V,$;S.id||(S.id=k?`${k}-step-${A}`:`step-${Date.now()}-${A}`);const I=!!S.workflow,T=!!S.type&&["while","for_each","for","switch","parallel","try","if","map","filter","reduce"].includes(S.type);let O="step";I?O="subworkflow":T&&(O=S.type);const L={id:S.id,name:S.name,action:S.action,workflowPath:S.workflow,status:"pending"};let z={...L};if(S.type==="while")z={...L,condition:S.condition||"true",maxIterations:S.maxIterations||100,variables:S.variables};else if(S.type==="for_each"||S.type==="for"){const U=S.items||"[]";z={...L,items:U==="unknown"?"[]":U,itemVariable:(P=S.inputs)==null?void 0:P.itemVariable}}else if(S.type==="switch")z={...L,expression:((H=S.inputs)==null?void 0:H.expression)||S.condition||"",cases:{},hasDefault:!0};else if(S.type==="parallel")z={...L,branches:[],maxConcurrent:0};else if(S.type==="try")z={...L,hasCatch:!0,hasFinally:!1};else if(S.type==="if")z={...L,condition:S.condition||"true",hasElse:!0};else if(S.type==="map"||S.type==="filter"||S.type==="reduce"){const U=S.items||((D=S.inputs)==null?void 0:D.items)||"[]";z={...L,transformType:S.type,items:U==="unknown"?"[]":U,itemVariable:(V=S.inputs)==null?void 0:V.itemVariable,expression:($=S.inputs)==null?void 0:$.expression,condition:S.condition}}else z={...L,condition:S.condition,items:S.items,maxIterations:S.maxIterations,variables:S.variables};const M={id:S.id,type:O,position:{x:w,y:_},data:z};if(t.push(M),N){const U={id:`e-${N}-${S.id}`,source:N,target:S.id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}};S.conditions&&S.conditions.length>0&&(U.label="conditional",U.labelStyle={fill:"#a0a0c0",fontSize:10},U.labelBgStyle={fill:"#232340"}),n.push(U)}if((S.type==="while"||S.type==="for_each"||S.type==="for")&&S.steps&&S.steps.length>0){const U=w+350,B=_+20,{lastNodeId:q,endY:Y}=f(S.steps,U,B,S.id),F=S.type==="while"?"#fb923c":"#f093fb";n.push({id:`e-${S.id}-body-start`,source:S.id,target:S.steps[0].id,sourceHandle:"body",type:"smoothstep",animated:!0,style:{stroke:F,strokeWidth:2},label:S.type==="while"?"do":"each",labelStyle:{fill:F,fontSize:10},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}}),q&&n.push({id:`e-${q}-${S.id}-loop-back`,source:q,target:S.id,targetHandle:"loop-back",type:"smoothstep",animated:!0,style:{stroke:F,strokeWidth:2,strokeDasharray:"5,5"}}),_=Math.max(_+180,Y)}else _+=180;N=S.id}),{lastNodeId:N,endY:_}};let p=0,h=null;if(e.triggers&&e.triggers.length>0){const b=e.triggers[0];h=`trigger-${e.metadata.id}`,t.push({id:h,type:"trigger",position:{x:250,y:p},data:{id:h,name:e.metadata.name,type:b.type||"manual",cron:b.cron,path:b.path,events:b.events,url:b.url,interval:b.interval,active:!0}}),p+=180}const{lastNodeId:g,endY:y}=f(d,250,p);if(h&&d.length>0&&n.push({id:`e-${h}-${d[0].id}`,source:h,target:d[0].id,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}}),d.length>0){const b=`output-${e.metadata.id}`,w=N=>{let S=[];return N.forEach(A=>{S.push(A),A.steps&&(S=S.concat(w(A.steps)))}),S},v=w(d),k=v.filter(N=>N.outputVariable).map(N=>N.outputVariable);t.push({id:b,type:"output",position:{x:250,y},data:{id:b,name:"Workflow Output",variables:k,status:"pending"}}),g&&n.push({id:`e-${g}-${b}`,source:g,target:b,type:"smoothstep",animated:!1,style:{stroke:"#ff6d5a",strokeWidth:2}});const _=ute(v);n.push(..._)}return{nodes:t,edges:n}}function ute(e){const t=[],n=new Map;return e.forEach(r=>{r.outputVariable&&n.set(r.outputVariable,r.id)}),e.forEach(r=>{dte(r.inputs).forEach(o=>{const a=o.split(".")[0],c=n.get(a);if(c&&c!==r.id){const d=`data-${c}-${r.id}-${a}`;t.find(f=>f.id===d)||t.push({id:d,source:c,target:r.id,type:"smoothstep",animated:!0,style:{stroke:"#5bc0de",strokeWidth:1,strokeDasharray:"5,5"},label:a,labelStyle:{fill:"#5bc0de",fontSize:9},labelBgStyle:{fill:"#1a1a2e",fillOpacity:.8}})}})}),t}function dte(e){const t=[];if(!e)return t;function n(r){if(typeof r=="string"){const s=/\{\{\s*([^}]+)\s*\}\}/g;let o;for(;(o=s.exec(r))!==null;){const c=o[1].trim().split(".")[0].replace(/\[.*\]/,"");c!=="inputs"&&!t.includes(c)&&t.push(c)}}else Array.isArray(r)?r.forEach(n):r&&typeof r=="object"&&Object.values(r).forEach(n)}return Object.values(e).forEach(n),t}const E1=Mn((e,t)=>({isProcessing:!1,history:[],lastError:null,pendingChanges:null,sendPrompt:async n=>{e({isProcessing:!0,lastError:null});const r=sn.getState().currentWorkflow;try{const s=await fetch("/api/ai/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n,workflow:r})});if(!s.ok)throw new Error("Failed to process prompt");const o=await s.json(),a={prompt:n,response:o.explanation,timestamp:new Date,success:!0};e({history:[a,...t().history].slice(0,20),pendingChanges:o.workflow,isProcessing:!1}),o.workflow&&t().acceptChanges()}catch(s){const o=s instanceof Error?s.message:"Unknown error";e({history:[{prompt:n,response:o,timestamp:new Date,success:!1},...t().history].slice(0,20),lastError:o,isProcessing:!1}),console.log("AI Prompt (demo mode):",n),console.log("Current workflow:",r)}},acceptChanges:()=>{const n=t().pendingChanges;if(!n)return;sn.getState().saveWorkflow(n);const{nodes:r,edges:s}=t5(n);qr.getState().setNodes(r),qr.getState().setEdges(s),e({pendingChanges:null})},rejectChanges:()=>{e({pendingChanges:null})},clearHistory:()=>{e({history:[]})}}));function fte({onSelectPrompt:e}){const[t,n]=E.useState(!1),[r,s]=E.useState(null),[o,a]=E.useState(null),{history:c,clearHistory:d,sendPrompt:f,isProcessing:p}=E1(),h=async b=>{p||await f(b)},g=async(b,w)=>{try{await navigator.clipboard.writeText(b),a(w),setTimeout(()=>a(null),2e3)}catch(v){console.error("Failed to copy:",v)}},y=b=>{const v=new Date().getTime()-new Date(b).getTime();return v<6e4?"Just now":v<36e5?`${Math.floor(v/6e4)}m ago`:v<864e5?`${Math.floor(v/36e5)}h ago`:new Date(b).toLocaleDateString()};return c.length===0?null:u.jsxs("div",{className:"border-t border-node-border",children:[u.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center justify-between px-4 py-2 bg-panel-bg hover:bg-white/5 transition-colors",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(uf,{className:"w-4 h-4 text-gray-400"}),u.jsx("span",{className:"text-sm text-gray-300",children:"Prompt History"}),u.jsxs("span",{className:"text-xs text-gray-500",children:["(",c.length,")"]})]}),t?u.jsx(Lr,{className:"w-4 h-4 text-gray-400"}):u.jsx(o9,{className:"w-4 h-4 text-gray-400"})]}),t&&u.jsxs("div",{className:"bg-panel-bg",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-node-border",children:[u.jsxs("span",{className:"text-xs text-gray-500",children:[c.filter(b=>b.success).length," successful,"," ",c.filter(b=>!b.success).length," failed"]}),u.jsx(Ve,{variant:"ghost",size:"sm",onClick:d,icon:u.jsx(oa,{className:"w-3 h-3"}),children:"Clear"})]}),u.jsx("div",{className:"max-h-64 overflow-y-auto",children:c.map((b,w)=>{const v=`${w}-${b.timestamp}`,k=r===b;return u.jsxs("div",{className:"border-b border-node-border last:border-b-0",children:[u.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 cursor-pointer transition-colors ${k?"bg-primary/10":"hover:bg-white/5"}`,onClick:()=>s(k?null:b),children:[b.success?u.jsx(zt,{className:"w-4 h-4 text-success flex-shrink-0 mt-0.5"}):u.jsx(lt,{className:"w-4 h-4 text-error flex-shrink-0 mt-0.5"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm text-gray-300 line-clamp-2",children:b.prompt}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx(an,{className:"w-3 h-3 text-gray-500"}),u.jsx("span",{className:"text-xs text-gray-500",children:y(b.timestamp)})]})]}),u.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[u.jsx("button",{onClick:_=>{_.stopPropagation(),g(b.prompt,v)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy prompt",children:o===v?u.jsx(Js,{className:"w-3.5 h-3.5 text-success"}):u.jsx(Lo,{className:"w-3.5 h-3.5 text-gray-400"})}),u.jsx("button",{onClick:_=>{_.stopPropagation(),h(b.prompt)},disabled:p,className:"p-1.5 hover:bg-white/10 rounded transition-colors disabled:opacity-50",title:"Re-run prompt",children:u.jsx(L9,{className:`w-3.5 h-3.5 text-gray-400 ${p?"animate-spin":""}`})}),e&&u.jsx("button",{onClick:_=>{_.stopPropagation(),e(b.prompt)},className:"p-1.5 hover:bg-white/10 rounded transition-colors",title:"Edit prompt",children:u.jsx("span",{className:"text-xs text-gray-400",children:"Edit"})})]})]}),k&&u.jsx("div",{className:"px-4 pb-3 pl-11",children:u.jsxs("div",{className:"bg-node-bg rounded-lg p-3",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase",children:"Response"}),u.jsx("button",{onClick:()=>g(b.response,`${v}-response`),className:"p-1 hover:bg-white/10 rounded transition-colors",children:o===`${v}-response`?u.jsx(Js,{className:"w-3 h-3 text-success"}):u.jsx(Lo,{className:"w-3 h-3 text-gray-400"})})]}),u.jsx("div",{className:`text-xs font-mono ${b.success?"text-gray-300":"text-error"}`,children:b.response||"No response"})]})})]},v)})})]})]})}function hte(){const[e,t]=E.useState(""),n=E.useRef(null),{isProcessing:r,history:s,sendPrompt:o}=E1(),a=oc();E.useEffect(()=>{n.current&&(n.current.style.height="auto",n.current.style.height=`${Math.min(n.current.scrollHeight,200)}px`)},[e]);const c=async()=>{!e.trim()||r||(await o(e),t(""))},d=p=>{p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),c()),p.key==="ArrowUp"&&!e&&s.length>0&&t(s[0].prompt)},f=["Add a Slack notification step","Add error handling with 3 retries","Convert to a sub-workflow","Add a condition to skip if draft"];return u.jsxs("div",{className:"bg-bg-panel",children:[u.jsx(fte,{onSelectPrompt:t}),!e&&!r&&u.jsx("div",{className:"px-4 py-2 border-t border-border-default/50",children:u.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",children:[u.jsx(wR,{className:"w-4 h-4 text-primary flex-shrink-0"}),f.map(p=>u.jsx("button",{onClick:()=>t(p),className:"px-3 py-1 bg-bg-surface border border-border-default rounded-full text-xs text-text-primary hover:border-accent hover:text-accent transition-colors whitespace-nowrap",children:p},p))]})}),u.jsxs("div",{className:"p-4 flex items-end gap-3 border-t border-border-default",children:[u.jsxs("div",{className:"flex-1 relative",children:[u.jsx("textarea",{ref:n,value:e,onChange:p=>t(p.target.value),onKeyDown:d,placeholder:"Describe the changes you want to make to the workflow...",disabled:r,rows:1,className:"w-full px-4 py-3 bg-bg-surface border border-border-default rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/50 resize-none disabled:opacity-50"}),r&&u.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:u.jsx(Dr,{className:"w-5 h-5 text-primary animate-spin"})})]}),u.jsx("button",{onClick:c,disabled:!e.trim()||r,className:"w-10 h-10 rounded-lg bg-primary hover:bg-primary-dark disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-colors",children:u.jsx(xR,{className:"w-5 h-5 text-text-primary"})})]}),u.jsxs("div",{className:"px-4 pb-2 text-xs text-text-muted",children:["Press ",u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:a})," +"," ",u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:"Enter"})," to send",s.length>0&&u.jsxs("span",{className:"ml-4",children:[u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface rounded text-text-secondary",children:"↑"})," for last prompt"]})]})]})}function pte({open:e,onOpenChange:t,originalWorkflow:n,modifiedWorkflow:r,explanation:s,onAccept:o,onReject:a}){const[c,d]=E.useState("explanation"),f=n?Hd(n,{indent:2}):"",p=r?Hd(r,{indent:2}):"",h=()=>{o(),t(!1)},g=()=>{a(),t(!1)};return u.jsxs(hs,{open:e,onOpenChange:t,title:"Review Changes",description:"The AI has suggested the following changes to your workflow",size:"xl",children:[u.jsxs(lP,{value:c,onValueChange:d,children:[u.jsxs($w,{children:[u.jsxs(Tr,{value:"explanation",children:[u.jsx(h9,{className:"w-4 h-4 mr-1.5"}),"Explanation"]}),u.jsxs(Tr,{value:"diff",children:[u.jsx(uR,{className:"w-4 h-4 mr-1.5"}),"Side by Side"]}),u.jsxs(Tr,{value:"modified",children:[u.jsx(mw,{className:"w-4 h-4 mr-1.5"}),"Modified YAML"]})]}),u.jsxs("div",{className:"p-4",children:[u.jsx(Ir,{value:"explanation",children:u.jsxs("div",{className:"prose prose-invert max-w-none",children:[u.jsx("div",{className:"p-4 bg-node-bg rounded-lg border border-node-border",children:u.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:s})}),r&&u.jsxs("div",{className:"mt-4",children:[u.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Changes Summary"}),u.jsx("ul",{className:"space-y-2",children:mte(n,r).map((y,b)=>u.jsxs("li",{className:`flex items-start gap-2 text-sm ${y.type==="added"?"text-success":y.type==="removed"?"text-error":"text-warning"}`,children:[u.jsx("span",{className:"flex-shrink-0",children:y.type==="added"?"+":y.type==="removed"?"-":"~"}),u.jsx("span",{children:y.description})]},b))})]})]})}),u.jsx(Ir,{value:"diff",children:u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Original"}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(Cl,{height:"400px",language:"yaml",value:f,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Modified"}),u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(Cl,{height:"400px",language:"yaml",value:p,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1}})})]})]})}),u.jsx(Ir,{value:"modified",children:u.jsx("div",{className:"border border-node-border rounded-lg overflow-hidden",children:u.jsx(Cl,{height:"500px",language:"yaml",value:p,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, Consolas, monospace",lineNumbers:"on",scrollBeyondLastLine:!1}})})})]})]}),u.jsxs(Bo,{children:[u.jsx(Ve,{variant:"secondary",onClick:g,icon:u.jsx(dr,{className:"w-4 h-4"}),children:"Reject"}),u.jsx(Ve,{onClick:h,icon:u.jsx(Js,{className:"w-4 h-4"}),children:"Accept Changes"})]})]})}function mte(e,t){const n=[];if(!e||!t)return n;const r=new Set(e.steps.map(o=>o.id)),s=new Set(t.steps.map(o=>o.id));for(const o of t.steps)r.has(o.id)||n.push({type:"added",description:`Added step "${o.name||o.id}"`});for(const o of e.steps)s.has(o.id)||n.push({type:"removed",description:`Removed step "${o.name||o.id}"`});for(const o of t.steps)if(r.has(o.id)){const a=e.steps.find(c=>c.id===o.id);if(a&&JSON.stringify(a)!==JSON.stringify(o)){const c=[];a.action!==o.action&&c.push("action"),JSON.stringify(a.inputs)!==JSON.stringify(o.inputs)&&c.push("inputs"),JSON.stringify(a.errorHandling)!==JSON.stringify(o.errorHandling)&&c.push("error handling"),JSON.stringify(a.conditions)!==JSON.stringify(o.conditions)&&c.push("conditions"),c.length>0&&n.push({type:"modified",description:`Modified "${o.name||o.id}": ${c.join(", ")}`})}}return e.metadata.name!==t.metadata.name&&n.push({type:"modified",description:`Renamed workflow to "${t.metadata.name}"`}),n}const os={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"},od={slack:{name:"Slack",icon:"slack",description:"Team messaging, channels, and file sharing",keywords:["chat","message","channel","team","notification"],methods:["chat.postMessage","chat.update","chat.delete","conversations.list","conversations.create","files.upload","users.info"]},github:{name:"GitHub",icon:"github",description:"Source code, pull requests, issues, and repositories",keywords:["git","code","pr","pull request","issue","repository","review"],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",description:"Project management, issue tracking, and agile boards",keywords:["ticket","issue","project","sprint","agile","task","board"],methods:["issues.getIssue","issues.createIssue","issues.editIssue","issues.search","issues.addComment","issues.transition"]},gmail:{name:"Gmail",icon:"gmail",description:"Send, receive, and manage email via Google Gmail",keywords:["email","mail","send","inbox","google","draft"],methods:["messages.list","messages.get","messages.send","drafts.create","labels.list"]},outlook:{name:"Outlook",icon:"outlook",description:"Microsoft email and calendar integration",keywords:["email","mail","calendar","microsoft","office","meeting"],methods:["messages.list","messages.get","messages.send","calendar.events.list","calendar.events.create"]},linear:{name:"Linear",icon:"linear",description:"Modern issue tracking and project management",keywords:["issue","project","task","bug","feature","sprint"],methods:["issues.get","issues.create","issues.update","issues.search","projects.list"]},notion:{name:"Notion",icon:"notion",description:"Workspace for docs, databases, and knowledge management",keywords:["wiki","document","database","page","knowledge","notes"],methods:["pages.get","pages.create","pages.update","databases.query","search"]},discord:{name:"Discord",icon:"discord",description:"Community messaging, bots, and webhooks",keywords:["chat","message","bot","webhook","community","server"],methods:["messages.send","messages.edit","messages.delete","channels.get","webhooks.execute"]},airtable:{name:"Airtable",icon:"airtable",description:"Spreadsheet-database hybrid for structured data",keywords:["database","spreadsheet","table","record","data"],methods:["records.list","records.get","records.create","records.update","records.delete"]},confluence:{name:"Confluence",icon:"confluence",description:"Team documentation and knowledge base",keywords:["wiki","document","page","knowledge","atlassian","docs"],methods:["pages.list","pages.get","pages.create","pages.update","search"]},http:{name:"HTTP",icon:"http",description:"Make HTTP requests to any REST API endpoint",keywords:["api","rest","request","fetch","webhook","url","endpoint"],methods:["request","get","post","put","patch","delete"]},rss:{name:"RSS",icon:"rss",description:"Subscribe to and fetch RSS/Atom feed updates",keywords:["feed","news","subscribe","atom","blog"],methods:["fetch","getItems"]},claude:{name:"Claude",icon:"claude",description:"Anthropic Claude AI for analysis, generation, and chat",keywords:["ai","llm","anthropic","analyze","generate","summarize"],methods:["analyze","generate","summarize","chat"]},opencode:{name:"OpenCode",icon:"opencode",description:"AI coding assistant for code generation and analysis",keywords:["ai","code","programming","assistant","complete"],methods:["chat","complete","analyze"]},ollama:{name:"Ollama",icon:"ollama",description:"Run local LLMs for private AI inference",keywords:["ai","llm","local","private","model","embed"],methods:["generate","chat","embeddings"]},parallel:{name:"Parallel",icon:"parallel",description:"Run multiple AI agents concurrently",keywords:["concurrent","multi-agent","spawn","batch","map"],methods:["spawn","map"]}};function gte({open:e,onOpenChange:t,onCreateStep:n,position:r}){var L,z;const[s,o]=E.useState("select-type"),[a,c]=E.useState(""),[d,f]=E.useState("action"),[p,h]=E.useState(null),[g,y]=E.useState(null),[b,w]=E.useState({id:"",name:""}),v=()=>{o("select-type"),c(""),f("action"),h(null),y(null),w({id:"",name:""})},k=()=>{v(),t(!1)},_=M=>{f(M),o(M==="action"?"select-service":"configure")},N=M=>{h(M),o("select-method")},S=M=>{y(M);const P=od[p];w({id:`${p}-${Date.now()}`,name:`${(P==null?void 0:P.name)||p} - ${M}`}),o("configure")},A=()=>{const M={id:b.id||`step-${Date.now()}`,name:b.name||void 0,inputs:{}};d==="action"&&p&&g&&(M.action=`${p}.${g}`),n(M),k()},I=Object.entries(od).filter(([M,P])=>{var D,V;const H=a.toLowerCase();return P.name.toLowerCase().includes(H)||M.toLowerCase().includes(H)||"description"in P&&((D=P.description)==null?void 0:D.toLowerCase().includes(H))||"keywords"in P&&((V=P.keywords)==null?void 0:V.some($=>$.includes(H)))}),O=(p?((L=od[p])==null?void 0:L.methods)||[]:[]).filter(M=>M.toLowerCase().includes(a.toLowerCase()));return u.jsxs(hs,{open:e,onOpenChange:k,title:"Add New Step",description:yte(s),size:"lg",children:[u.jsxs("div",{className:"p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[u.jsx("button",{onClick:()=>o("select-type"),className:`${s==="select-type"?"text-primary":"text-gray-400 hover:text-white"}`,children:"Type"}),d==="action"&&u.jsxs(u.Fragment,{children:[u.jsx(qt,{className:"w-4 h-4 text-gray-600"}),u.jsx("button",{onClick:()=>p&&o("select-service"),className:`${s==="select-service"?"text-primary":p?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!p,children:"Service"}),u.jsx(qt,{className:"w-4 h-4 text-gray-600"}),u.jsx("button",{onClick:()=>g&&o("select-method"),className:`${s==="select-method"?"text-primary":g?"text-gray-400 hover:text-white":"text-gray-600"}`,disabled:!g,children:"Method"})]}),u.jsx(qt,{className:"w-4 h-4 text-gray-600"}),u.jsx("span",{className:`${s==="configure"?"text-primary":"text-gray-600"}`,children:"Configure"})]}),s==="select-type"&&u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("button",{onClick:()=>_("action"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[u.jsx(Zi,{className:"w-8 h-8 text-primary mb-3"}),u.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Action Step"}),u.jsx("p",{className:"text-sm text-gray-400",children:"Execute an action using a service SDK (Slack, GitHub, etc.)"})]}),u.jsxs("button",{onClick:()=>_("subworkflow"),className:"p-6 bg-node-bg border border-node-border rounded-lg hover:border-info transition-colors text-left",children:[u.jsx($l,{className:"w-8 h-8 text-info mb-3"}),u.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"Sub-workflow"}),u.jsx("p",{className:"text-sm text-gray-400",children:"Reference another workflow file for modular composition"})]})]}),s==="select-service"&&u.jsxs("div",{children:[u.jsxs("div",{className:"relative mb-4",children:[u.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),u.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search services...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),u.jsx("div",{className:"grid grid-cols-3 gap-3 max-h-[400px] overflow-y-auto",children:I.map(([M,P])=>{const H=yb(M),D="description"in P?P.description:void 0;return u.jsxs("button",{onClick:()=>N(M),className:"flex flex-col items-center gap-2 p-4 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors",children:[u.jsx(H,{className:"w-8 h-8 text-primary"}),u.jsx("span",{className:"text-sm text-white",children:P.name}),D&&u.jsx("span",{className:"text-xs text-gray-500 text-center line-clamp-2",children:D})]},M)})})]}),s==="select-method"&&p&&u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 bg-node-bg rounded-lg border border-node-border",children:[(()=>{const M=yb(p);return u.jsx(M,{className:"w-6 h-6 text-primary"})})(),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium text-white",children:(z=od[p])==null?void 0:z.name}),u.jsx("div",{className:"text-xs text-gray-400",children:"Select a method"})]})]}),u.jsxs("div",{className:"relative mb-4",children:[u.jsx(Fl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),u.jsx("input",{type:"text",value:a,onChange:M=>c(M.target.value),placeholder:"Search methods...",className:"w-full pl-10 pr-4 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),u.jsx("div",{className:"space-y-2 max-h-[350px] overflow-y-auto",children:O.map(M=>u.jsxs("button",{onClick:()=>S(M),className:"w-full flex items-center justify-between px-4 py-3 bg-node-bg border border-node-border rounded-lg hover:border-primary transition-colors text-left",children:[u.jsx("span",{className:"text-sm font-mono text-white",children:M}),u.jsx(qt,{className:"w-4 h-4 text-gray-500"})]},M))})]}),s==="configure"&&u.jsxs("div",{className:"space-y-4",children:[d==="action"&&p&&g&&u.jsxs("div",{className:"p-3 bg-node-bg rounded-lg border border-node-border",children:[u.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Action"}),u.jsxs("div",{className:"text-sm font-mono text-primary",children:[p,".",g]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step ID"}),u.jsx("input",{type:"text",value:b.id,onChange:M=>w(P=>({...P,id:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm font-mono focus:outline-none focus:border-primary",placeholder:"unique-step-id"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:"Step Name (optional)"}),u.jsx("input",{type:"text",value:b.name,onChange:M=>w(P=>({...P,name:M.target.value})),className:"w-full px-3 py-2 bg-node-bg border border-node-border rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Human-readable name"})]}),r&&u.jsx("div",{className:"text-xs text-gray-500",children:r.afterStepId?`Will be inserted after "${r.afterStepId}"`:r.beforeStepId?`Will be inserted before "${r.beforeStepId}"`:"Will be added at the end"})]})]}),u.jsxs(Bo,{children:[s!=="select-type"&&u.jsx(Ve,{variant:"ghost",onClick:()=>{s==="select-service"?o("select-type"):s==="select-method"?o("select-service"):s==="configure"&&o(d==="action"?"select-method":"select-type"),c("")},children:"Back"}),u.jsx(Ve,{variant:"secondary",onClick:k,children:"Cancel"}),s==="configure"&&u.jsx(Ve,{onClick:A,disabled:!b.id,children:"Create Step"})]})]})}function yte(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 nI=[{keys:["⌘","S"],description:"Save workflow",category:"General"},{keys:["⌘","Z"],description:"Undo",category:"General"},{keys:["⌘","⇧","Z"],description:"Redo",category:"General"},{keys:["⌘","?"],description:"Show keyboard shortcuts",category:"General"},{keys:["⌘","K"],description:"Open command palette",category:"General"},{keys:["⌘","P"],description:"Quick workflow switcher",category:"General"},{keys:["⌘","⇧","T"],description:"Toggle theme",category:"General"},{keys:["N"],description:"Add new step",category:"Canvas"},{keys:["⌘","L"],description:"Auto-layout canvas",category:"Canvas"},{keys:["⌘","0"],description:"Fit view",category:"Canvas"},{keys:["⌘","+"],description:"Zoom in",category:"Canvas"},{keys:["⌘","-"],description:"Zoom out",category:"Canvas"},{keys:["⌫"],description:"Delete selected",category:"Canvas"},{keys:["⌘","D"],description:"Duplicate selected",category:"Canvas"},{keys:["Double-click"],description:"Edit step",category:"Editing"},{keys:["E"],description:"Edit selected step",category:"Editing"},{keys:["Y"],description:"View YAML",category:"Editing"},{keys:["Escape"],description:"Close modal / deselect",category:"Editing"},{keys:["⌘","←"],description:"Back to parent workflow",category:"Navigation"},{keys:["⌘","↑"],description:"Go to root workflow",category:"Navigation"},{keys:["⌘","↵"],description:"Execute workflow",category:"Execution"},{keys:["F9"],description:"Toggle debug mode",category:"Debugging"},{keys:["F5"],description:"Continue execution",category:"Debugging"},{keys:["F10"],description:"Step over",category:"Debugging"},{keys:["F11"],description:"Step into",category:"Debugging"},{keys:["⇧","F11"],description:"Step out",category:"Debugging"}];function xte({open:e,onOpenChange:t}){const n=[...new Set(nI.map(s=>s.category))],r=oc();return u.jsxs(hs,{open:e,onOpenChange:t,title:"Keyboard Shortcuts",description:"Quick reference for all keyboard shortcuts",size:"md",children:[u.jsx("div",{className:"p-4 space-y-6 max-h-[60vh] overflow-y-auto",children:n.map(s=>u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider mb-3",children:s}),u.jsx("div",{className:"space-y-2",children:nI.filter(o=>o.category===s).map((o,a)=>u.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-node-border last:border-0",children:[u.jsx("span",{className:"text-sm text-gray-300",children:o.description}),u.jsx("div",{className:"flex items-center gap-1",children:o.keys.map((c,d)=>u.jsx("kbd",{className:"px-2 py-1 bg-node-bg border border-node-border rounded text-xs font-mono text-gray-300",children:c==="⌘"?r:c},d))})]},a))})]},s))}),u.jsx(Bo,{children:u.jsx(Ve,{variant:"secondary",onClick:()=>t(!1),children:"Close"})})]})}function vte(){const[e,t]=E.useState(!1);return E.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="/"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),{isOpen:e,setIsOpen:t,openShortcuts:()=>t(!0)}}function bte({onClick:e}){const t=oc();return u.jsxs("button",{onClick:e,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-gray-500 hover:text-gray-300 transition-colors",title:`Keyboard shortcuts (${t}/)`,children:[u.jsx(k9,{className:"w-3.5 h-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"Shortcuts"})]})}function wte({showLabel:e=!1}){const{theme:t}=Gs(),{updateSetting:n}=mr(),r=()=>{n("general","theme",t==="dark"?"light":"dark")};return u.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-white/10 dark:hover:bg-white/10 light:hover:bg-black/5 transition-colors",title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[t==="dark"?u.jsx(j9,{className:"w-4 h-4 text-gray-400"}):u.jsx(z9,{className:"w-4 h-4 text-yellow-500"}),e&&u.jsx("span",{className:"text-xs text-gray-400",children:t==="dark"?"Dark":"Light"})]})}function kte({items:e,onNavigate:t}){return e.length<=1?null:u.jsx("nav",{className:"flex items-center gap-1 px-4 py-2 bg-panel-bg border-b border-node-border",children:e.map((n,r)=>u.jsxs("div",{className:"flex items-center",children:[r>0&&u.jsx(qt,{className:"w-4 h-4 text-gray-600 mx-1"}),u.jsxs("button",{onClick:()=>t(n,r),className:`flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors ${r===e.length-1?"text-white font-medium cursor-default":"text-gray-400 hover:text-white hover:bg-white/5"}`,disabled:r===e.length-1,children:[r===0&&u.jsx(w9,{className:"w-3.5 h-3.5"}),u.jsx("span",{className:"max-w-[150px] truncate",children:n.name})]})]},n.id))})}function ps(e){return Array.isArray?Array.isArray(e):s5(e)==="[object Array]"}function Nte(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ste(e){return e==null?"":Nte(e)}function Or(e){return typeof e=="string"}function n5(e){return typeof e=="number"}function Cte(e){return e===!0||e===!1||_te(e)&&s5(e)=="[object Boolean]"}function r5(e){return typeof e=="object"}function _te(e){return r5(e)&&e!==null}function jn(e){return e!=null}function Yv(e){return!e.trim().length}function s5(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Ete="Incorrect 'index' type",jte=e=>`Invalid value for key ${e}`,Ate=e=>`Pattern length exceeds max of ${e}.`,Tte=e=>`Missing ${e} property in key`,Ite=e=>`Property 'weight' in key '${e}' must be a positive integer`,rI=Object.prototype.hasOwnProperty;class Mte{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let s=o5(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function o5(e){let t=null,n=null,r=null,s=1,o=null;if(Or(e)||ps(e))r=e,t=sI(e),n=Fb(e);else{if(!rI.call(e,"name"))throw new Error(Tte("name"));const a=e.name;if(r=a,rI.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(Ite(a));t=sI(a),n=Fb(a),o=e.getFn}return{path:t,id:n,weight:s,src:r,getFn:o}}function sI(e){return ps(e)?e:e.split(".")}function Fb(e){return ps(e)?e.join("."):e}function Rte(e,t){let n=[],r=!1;const s=(o,a,c)=>{if(jn(o))if(!a[c])n.push(o);else{let d=a[c];const f=o[d];if(!jn(f))return;if(c===a.length-1&&(Or(f)||n5(f)||Cte(f)))n.push(Ste(f));else if(ps(f)){r=!0;for(let p=0,h=f.length;p<h;p+=1)s(f[p],a,c+1)}else a.length&&s(f,a,c+1)}};return s(e,Or(t)?t.split("."):t,0),r?n:n[0]}const Ote={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Pte={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Lte={location:0,threshold:.6,distance:100},Dte={useExtendedSearch:!1,getFn:Rte,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Re={...Pte,...Ote,...Lte,...Dte};const $te=/[^ ]+/g;function Fte(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){const o=s.match($te).length;if(n.has(o))return n.get(o);const a=1/Math.pow(o,.5*e),c=parseFloat(Math.round(a*r)/r);return n.set(o,c),c},clear(){n.clear()}}}class j1{constructor({getFn:t=Re.getFn,fieldNormWeight:n=Re.fieldNormWeight}={}){this.norm=Fte(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Or(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Or(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!jn(t)||Yv(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((s,o)=>{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(jn(a)){if(ps(a)){let c=[];const d=[{nestedArrIndex:-1,value:a}];for(;d.length;){const{nestedArrIndex:f,value:p}=d.pop();if(jn(p))if(Or(p)&&!Yv(p)){let h={v:p,i:f,n:this.norm.get(p)};c.push(h)}else ps(p)&&p.forEach((h,g)=>{d.push({nestedArrIndex:g,value:h})})}r.$[o]=c}else if(Or(a)&&!Yv(a)){let c={v:a,n:this.norm.get(a)};r.$[o]=c}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function i5(e,t,{getFn:n=Re.getFn,fieldNormWeight:r=Re.fieldNormWeight}={}){const s=new j1({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(o5)),s.setSources(t),s.create(),s}function Bte(e,{getFn:t=Re.getFn,fieldNormWeight:n=Re.fieldNormWeight}={}){const{keys:r,records:s}=e,o=new j1({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(s),o}function id(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:s=Re.distance,ignoreLocation:o=Re.ignoreLocation}={}){const a=t/e.length;if(o)return a;const c=Math.abs(r-n);return s?a+c/s:c?1:a}function qte(e=[],t=Re.minMatchCharLength){let n=[],r=-1,s=-1,o=0;for(let a=e.length;o<a;o+=1){let c=e[o];c&&r===-1?r=o:!c&&r!==-1&&(s=o-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}const So=32;function zte(e,t,n,{location:r=Re.location,distance:s=Re.distance,threshold:o=Re.threshold,findAllMatches:a=Re.findAllMatches,minMatchCharLength:c=Re.minMatchCharLength,includeMatches:d=Re.includeMatches,ignoreLocation:f=Re.ignoreLocation}={}){if(t.length>So)throw new Error(Ate(So));const p=t.length,h=e.length,g=Math.max(0,Math.min(r,h));let y=o,b=g;const w=c>1||d,v=w?Array(h):[];let k;for(;(k=e.indexOf(t,b))>-1;){let T=id(t,{currentLocation:k,expectedLocation:g,distance:s,ignoreLocation:f});if(y=Math.min(T,y),b=k+p,w){let O=0;for(;O<p;)v[k+O]=1,O+=1}}b=-1;let _=[],N=1,S=p+h;const A=1<<p-1;for(let T=0;T<p;T+=1){let O=0,L=S;for(;O<L;)id(t,{errors:T,currentLocation:g+L,expectedLocation:g,distance:s,ignoreLocation:f})<=y?O=L:S=L,L=Math.floor((S-O)/2+O);S=L;let z=Math.max(1,g-L+1),M=a?h:Math.min(g+L,h)+p,P=Array(M+2);P[M+1]=(1<<T)-1;for(let D=M;D>=z;D-=1){let V=D-1,$=n[e.charAt(V)];if(w&&(v[V]=+!!$),P[D]=(P[D+1]<<1|1)&$,T&&(P[D]|=(_[D+1]|_[D])<<1|1|_[D+1]),P[D]&A&&(N=id(t,{errors:T,currentLocation:V,expectedLocation:g,distance:s,ignoreLocation:f}),N<=y)){if(y=N,b=V,b<=g)break;z=Math.max(1,2*g-b)}}if(id(t,{errors:T+1,currentLocation:g,expectedLocation:g,distance:s,ignoreLocation:f})>y)break;_=P}const I={isMatch:b>=0,score:Math.max(.001,N)};if(w){const T=qte(v,c);T.length?d&&(I.indices=T):I.isMatch=!1}return I}function Vte(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}const Yd=String.prototype.normalize?(e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(e=>e);class a5{constructor(t,{location:n=Re.location,threshold:r=Re.threshold,distance:s=Re.distance,includeMatches:o=Re.includeMatches,findAllMatches:a=Re.findAllMatches,minMatchCharLength:c=Re.minMatchCharLength,isCaseSensitive:d=Re.isCaseSensitive,ignoreDiacritics:f=Re.ignoreDiacritics,ignoreLocation:p=Re.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:p},t=d?t:t.toLowerCase(),t=f?Yd(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const h=(y,b)=>{this.chunks.push({pattern:y,alphabet:Vte(y),startIndex:b})},g=this.pattern.length;if(g>So){let y=0;const b=g%So,w=g-b;for(;y<w;)h(this.pattern.substr(y,So),y),y+=So;if(b){const v=g-So;h(this.pattern.substr(v),v)}}else h(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(t=n?t:t.toLowerCase(),t=r?Yd(t):t,this.pattern===t){let w={isMatch:!0,score:0};return s&&(w.indices=[[0,t.length-1]]),w}const{location:o,distance:a,threshold:c,findAllMatches:d,minMatchCharLength:f,ignoreLocation:p}=this.options;let h=[],g=0,y=!1;this.chunks.forEach(({pattern:w,alphabet:v,startIndex:k})=>{const{isMatch:_,score:N,indices:S}=zte(t,w,v,{location:o+k,distance:a,threshold:c,findAllMatches:d,minMatchCharLength:f,includeMatches:s,ignoreLocation:p});_&&(y=!0),g+=N,_&&S&&(h=[...h,...S])});let b={isMatch:y,score:y?g/this.chunks.length:1};return y&&s&&(b.indices=h),b}}class so{constructor(t){this.pattern=t}static isMultiMatch(t){return oI(t,this.multiRegex)}static isSingleMatch(t){return oI(t,this.singleRegex)}search(){}}function oI(e,t){const n=e.match(t);return n?n[1]:null}class Hte extends so{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Ute extends so{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Wte extends so{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Kte extends so{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Gte extends so{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class Yte extends so{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class l5 extends so{constructor(t,{location:n=Re.location,threshold:r=Re.threshold,distance:s=Re.distance,includeMatches:o=Re.includeMatches,findAllMatches:a=Re.findAllMatches,minMatchCharLength:c=Re.minMatchCharLength,isCaseSensitive:d=Re.isCaseSensitive,ignoreDiacritics:f=Re.ignoreDiacritics,ignoreLocation:p=Re.ignoreLocation}={}){super(t),this._bitapSearch=new a5(t,{location:n,threshold:r,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:p})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class c5 extends so{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const s=[],o=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+o,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const Bb=[Hte,c5,Wte,Kte,Yte,Gte,Ute,l5],iI=Bb.length,Xte=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Qte="|";function Jte(e,t={}){return e.split(Qte).map(n=>{let r=n.trim().split(Xte).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=r.length;o<a;o+=1){const c=r[o];let d=!1,f=-1;for(;!d&&++f<iI;){const p=Bb[f];let h=p.isMultiMatch(c);h&&(s.push(new p(h,t)),d=!0)}if(!d)for(f=-1;++f<iI;){const p=Bb[f];let h=p.isSingleMatch(c);if(h){s.push(new p(h,t));break}}}return s})}const Zte=new Set([l5.type,c5.type]);class ene{constructor(t,{isCaseSensitive:n=Re.isCaseSensitive,ignoreDiacritics:r=Re.ignoreDiacritics,includeMatches:s=Re.includeMatches,minMatchCharLength:o=Re.minMatchCharLength,ignoreLocation:a=Re.ignoreLocation,findAllMatches:c=Re.findAllMatches,location:d=Re.location,threshold:f=Re.threshold,distance:p=Re.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:o,findAllMatches:c,ignoreLocation:a,location:d,threshold:f,distance:p},t=n?t:t.toLowerCase(),t=r?Yd(t):t,this.pattern=t,this.query=Jte(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:s,ignoreDiacritics:o}=this.options;t=s?t:t.toLowerCase(),t=o?Yd(t):t;let a=0,c=[],d=0;for(let f=0,p=n.length;f<p;f+=1){const h=n[f];c.length=0,a=0;for(let g=0,y=h.length;g<y;g+=1){const b=h[g],{isMatch:w,indices:v,score:k}=b.search(t);if(w){if(a+=1,d+=k,r){const _=b.constructor.type;Zte.has(_)?c=[...c,...v]:c.push(v)}}else{d=0,a=0,c.length=0;break}}if(a){let g={isMatch:!0,score:d/a};return r&&(g.indices=c),g}}return{isMatch:!1,score:1}}}const qb=[];function tne(...e){qb.push(...e)}function zb(e,t){for(let n=0,r=qb.length;n<r;n+=1){let s=qb[n];if(s.condition(e,t))return new s(e,t)}return new a5(e,t)}const Xd={AND:"$and",OR:"$or"},Vb={PATH:"$path",PATTERN:"$val"},Hb=e=>!!(e[Xd.AND]||e[Xd.OR]),nne=e=>!!e[Vb.PATH],rne=e=>!ps(e)&&r5(e)&&!Hb(e),aI=e=>({[Xd.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function u5(e,t,{auto:n=!0}={}){const r=s=>{let o=Object.keys(s);const a=nne(s);if(!a&&o.length>1&&!Hb(s))return r(aI(s));if(rne(s)){const d=a?s[Vb.PATH]:o[0],f=a?s[Vb.PATTERN]:s[d];if(!Or(f))throw new Error(jte(d));const p={keyId:Fb(d),pattern:f};return n&&(p.searcher=zb(f,t)),p}let c={children:[],operator:o[0]};return o.forEach(d=>{const f=s[d];ps(f)&&f.forEach(p=>{c.children.push(r(p))})}),c};return Hb(e)||(e=aI(e)),r(e)}function sne(e,{ignoreFieldNorm:t=Re.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:s,norm:o,score:a})=>{const c=s?s.weight:null;r*=Math.pow(a===0&&c?Number.EPSILON:a,(c||1)*(t?1:o))}),n.score=r})}function one(e,t){const n=e.matches;t.matches=[],jn(n)&&n.forEach(r=>{if(!jn(r.indices)||!r.indices.length)return;const{indices:s,value:o}=r;let a={indices:s,value:o};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),t.matches.push(a)})}function ine(e,t){t.score=e.score}function ane(e,t,{includeMatches:n=Re.includeMatches,includeScore:r=Re.includeScore}={}){const s=[];return n&&s.push(one),r&&s.push(ine),e.map(o=>{const{idx:a}=o,c={item:t[a],refIndex:a};return s.length&&s.forEach(d=>{d(o,c)}),c})}class xa{constructor(t,n={},r){this.options={...Re,...n},this.options.useExtendedSearch,this._keyStore=new Mte(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof j1))throw new Error(Ete);this._myIndex=n||i5(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){jn(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,s=this._docs.length;r<s;r+=1){const o=this._docs[r];t(o,r)&&(this.removeAt(r),r-=1,s-=1,n.push(o))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:s,shouldSort:o,sortFn:a,ignoreFieldNorm:c}=this.options;let d=Or(t)?Or(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return sne(d,{ignoreFieldNorm:c}),o&&d.sort(a),n5(n)&&n>-1&&(d=d.slice(0,n)),ane(d,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(t){const n=zb(t,this.options),{records:r}=this._myIndex,s=[];return r.forEach(({v:o,i:a,n:c})=>{if(!jn(o))return;const{isMatch:d,score:f,indices:p}=n.searchIn(o);d&&s.push({item:o,idx:a,matches:[{score:f,value:o,norm:c,indices:p}]})}),s}_searchLogical(t){const n=u5(t,this.options),r=(c,d,f)=>{if(!c.children){const{keyId:h,searcher:g}=c,y=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(d,h),searcher:g});return y&&y.length?[{idx:f,item:d,matches:y}]:[]}const p=[];for(let h=0,g=c.children.length;h<g;h+=1){const y=c.children[h],b=r(y,d,f);if(b.length)p.push(...b);else if(c.operator===Xd.AND)return[]}return p},s=this._myIndex.records,o={},a=[];return s.forEach(({$:c,i:d})=>{if(jn(c)){let f=r(n,c,d);f.length&&(o[d]||(o[d]={idx:d,item:c,matches:[]},a.push(o[d])),f.forEach(({matches:p})=>{o[d].matches.push(...p)}))}}),a}_searchObjectList(t){const n=zb(t,this.options),{keys:r,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i:c})=>{if(!jn(a))return;let d=[];r.forEach((f,p)=>{d.push(...this._findMatches({key:f,value:a[p],searcher:n}))}),d.length&&o.push({idx:c,item:a,matches:d})}),o}_findMatches({key:t,value:n,searcher:r}){if(!jn(n))return[];let s=[];if(ps(n))n.forEach(({v:o,i:a,n:c})=>{if(!jn(o))return;const{isMatch:d,score:f,indices:p}=r.searchIn(o);d&&s.push({score:f,key:t,value:o,idx:a,norm:c,indices:p})});else{const{v:o,n:a}=n,{isMatch:c,score:d,indices:f}=r.searchIn(o);c&&s.push({score:d,key:t,value:o,norm:a,indices:f})}return s}}xa.version="7.1.0";xa.createIndex=i5;xa.parseIndex=Bte;xa.config=Re;xa.parseQuery=u5;tne(ene);const lI=5;function lne(){try{const e=localStorage.getItem("marktoflow-recent-commands");return e?JSON.parse(e):[]}catch{return[]}}function cI(e){try{localStorage.setItem("marktoflow-recent-commands",JSON.stringify(e))}catch{}}const d5=Mn((e,t)=>({isOpen:!1,mode:"commands",query:"",selectedIndex:0,commands:[],recentCommandIds:lne(),open:(n="commands")=>{e({isOpen:!0,mode:n,query:"",selectedIndex:0})},close:()=>{e({isOpen:!1,query:"",selectedIndex:0})},setQuery:n=>{e({query:n,selectedIndex:0})},setSelectedIndex:n=>{e({selectedIndex:n})},registerCommand:n=>{e(r=>({commands:[...r.commands.filter(o=>o.id!==n.id),n]}))},registerCommands:n=>{e(r=>{const s=new Set(n.map(a=>a.id));return{commands:[...r.commands.filter(a=>!s.has(a.id)),...n]}})},unregisterCommand:n=>{e(r=>({commands:r.commands.filter(s=>s.id!==n)}))},executeSelected:()=>{const{selectedIndex:n,recentCommandIds:r}=t(),o=t().getFilteredCommands()[n];if(o){const a=[o.id,...r.filter(c=>c!==o.id)].slice(0,lI);cI(a),e({isOpen:!1,query:"",selectedIndex:0,recentCommandIds:a}),o.execute()}},executeCommand:n=>{const{commands:r,recentCommandIds:s}=t(),o=r.find(a=>a.id===n);if(o){const a=[o.id,...s.filter(c=>c!==o.id)].slice(0,lI);cI(a),e({isOpen:!1,query:"",selectedIndex:0,recentCommandIds:a}),o.execute()}},moveUp:()=>{const{selectedIndex:n}=t(),r=t().getFilteredCommands();e({selectedIndex:n>0?n-1:r.length-1})},moveDown:()=>{const{selectedIndex:n}=t(),r=t().getFilteredCommands();e({selectedIndex:n<r.length-1?n+1:0})},getFilteredCommands:()=>{const{commands:n,query:r,mode:s,recentCommandIds:o}=t();let a=n;if(s==="workflows"?a=n.filter(d=>d.category==="workflow"):s==="nodes"&&(a=n.filter(d=>d.category==="node")),!r.trim()){const d=new Set(o),f=o.map(h=>a.find(g=>g.id===h)).filter(Boolean),p=a.filter(h=>!d.has(h.id));return[...f,...p]}return new xa(a,{keys:[{name:"label",weight:.5},{name:"description",weight:.2},{name:"keywords",weight:.2},{name:"category",weight:.1}],threshold:.4,includeScore:!0}).search(r).map(d=>d.item)}})),cne={action:Zi,workflow:G9,node:gw,setting:Ji,navigation:A9},une={action:"text-accent",workflow:"text-primary",node:"text-warning",setting:"text-gray-400",navigation:"text-success"};function dne({command:e,isSelected:t,onSelect:n,onExecute:r}){const s=cne[e.category]||Zi,o=une[e.category]||"text-gray-400";return u.jsxs("button",{className:`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors ${t?"bg-primary/10 text-text-primary":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"}`,onClick:r,onMouseEnter:n,role:"option","aria-selected":t,children:[u.jsx(s,{className:`w-4 h-4 flex-shrink-0 ${o}`}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium truncate",children:e.label}),e.description&&u.jsx("div",{className:"text-xs text-text-muted truncate",children:e.description})]}),e.shortcut&&u.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:e.shortcut.split("+").map((a,c)=>u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface border border-border-default rounded text-xs font-mono text-text-muted",children:a.trim()},c))}),u.jsx("span",{className:"text-xs text-text-muted capitalize flex-shrink-0",children:e.category})]})}const fne=E.memo(dne);function hne(){var _;const{isOpen:e,mode:t,query:n,selectedIndex:r,close:s,setQuery:o,setSelectedIndex:a,executeSelected:c,moveUp:d,moveDown:f,getFilteredCommands:p,open:h}=d5(),g=E.useRef(null),y=E.useRef(null),b=e?p():[];E.useEffect(()=>{e&&requestAnimationFrame(()=>{var N;(N=g.current)==null||N.focus()})},[e]),E.useEffect(()=>{if(!y.current)return;const N=y.current.children[r];N&&N.scrollIntoView({block:"nearest"})},[r]);const w=E.useCallback(N=>{switch(N.key){case"ArrowDown":N.preventDefault(),f();break;case"ArrowUp":N.preventDefault(),d();break;case"Enter":N.preventDefault(),c();break;case"Escape":N.preventDefault(),s();break;case"Tab":N.preventDefault(),h(t==="commands"?"workflows":t==="workflows"?"nodes":"commands");break}},[f,d,c,s,t,h]);if(!e)return null;const v={commands:{icon:u9,placeholder:"Type a command...",label:"Commands"},workflows:{icon:Do,placeholder:"Search workflows...",label:"Workflows"},nodes:{icon:gw,placeholder:"Search nodes...",label:"Nodes"}},k=v[t];return k.icon,u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 z-50",onClick:s,"aria-hidden":"true"}),u.jsxs("div",{className:"fixed top-[20%] left-1/2 -translate-x-1/2 w-full max-w-xl z-50 bg-bg-panel border border-border-default rounded-xl shadow-2xl overflow-hidden",role:"dialog","aria-label":"Command palette",onKeyDown:w,children:[u.jsx("div",{className:"flex border-b border-border-default",children:Object.keys(v).map(N=>{const S=v[N].icon;return u.jsxs("button",{onClick:()=>h(N),className:`flex items-center gap-1.5 px-4 py-2 text-xs font-medium transition-colors ${t===N?"text-primary border-b-2 border-primary -mb-px":"text-text-secondary hover:text-text-primary"}`,children:[u.jsx(S,{className:"w-3.5 h-3.5"}),v[N].label]},N)})}),u.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border-default",children:[u.jsx(Fl,{className:"w-5 h-5 text-text-muted flex-shrink-0"}),u.jsx("input",{ref:g,type:"text",value:n,onChange:N=>o(N.target.value),placeholder:k.placeholder,className:"flex-1 bg-transparent text-sm text-text-primary placeholder-text-muted focus:outline-none",autoComplete:"off",spellCheck:!1,role:"combobox","aria-expanded":"true","aria-controls":"command-list","aria-activedescendant":(_=b[r])==null?void 0:_.id}),u.jsx("kbd",{className:"px-1.5 py-0.5 bg-bg-surface border border-border-default rounded text-xs font-mono text-text-muted",children:"Esc"})]}),u.jsx("div",{ref:y,id:"command-list",className:"max-h-[320px] overflow-y-auto py-1",role:"listbox",children:b.length===0?u.jsx("div",{className:"px-4 py-8 text-center text-sm text-text-muted",children:n?"No matching commands found":"No commands available"}):b.map((N,S)=>u.jsx(fne,{command:N,isSelected:S===r,onSelect:()=>a(S),onExecute:()=>{a(S),c()}},N.id))}),u.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-border-default text-xs text-text-muted",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"px-1 py-0.5 bg-bg-surface border border-border-default rounded font-mono",children:"↑↓"}),"Navigate"]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"px-1 py-0.5 bg-bg-surface border border-border-default rounded font-mono",children:"↵"}),"Execute"]}),u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"px-1 py-0.5 bg-bg-surface border border-border-default rounded font-mono",children:"Tab"}),"Switch mode"]})]}),u.jsxs("span",{children:[b.length," results"]})]})]})]})}const pne=Mn()(Q3((e,t)=>({completed:!1,currentStep:0,totalSteps:6,skipped:!1,tourActive:!1,startTour:()=>e({tourActive:!0,currentStep:0,skipped:!1}),nextStep:()=>{const{currentStep:n,totalSteps:r}=t();n<r-1?e({currentStep:n+1}):t().completeTour()},prevStep:()=>{const{currentStep:n}=t();n>0&&e({currentStep:n-1})},skipTour:()=>e({tourActive:!1,skipped:!0,completed:!0}),completeTour:()=>e({tourActive:!1,completed:!0}),resetTour:()=>e({completed:!1,currentStep:0,skipped:!1,tourActive:!1})}),{name:"marktoflow-onboarding"})),mne=[{title:"Welcome to Marktoflow!",description:"A visual workflow designer for building automation pipelines. Let us show you around.",target:"body"},{title:"Sidebar",description:"Browse your workflows and drag tools onto the canvas to build steps.",target:'[data-tour="sidebar"]'},{title:"Canvas",description:"This is where you design your workflow. Connect nodes to define the flow of execution.",target:'[data-tour="canvas"]'},{title:"Toolbar",description:"Use the toolbar to add steps, undo/redo, auto-layout, and execute your workflow.",target:'[data-tour="toolbar"]'},{title:"AI Assistant",description:"Type natural language prompts to generate or modify workflows using AI.",target:'[data-tour="prompt"]'},{title:"You're Ready!",description:"Start building your first workflow or explore the template gallery for inspiration.",target:"body"}];function gne(){const{tourActive:e,currentStep:t,totalSteps:n,nextStep:r,prevStep:s,skipTour:o,completeTour:a}=pne();if(!e)return null;const c=mne[t],d=t===n-1,f=t===0;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 bg-black/40 z-[60]"}),u.jsx("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-[61] w-full max-w-md bg-bg-panel border border-border-default rounded-xl shadow-2xl overflow-hidden",children:u.jsxs("div",{className:"p-5",children:[u.jsxs("div",{className:"flex items-start justify-between mb-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(wR,{className:"w-5 h-5 text-primary"}),u.jsx("h3",{className:"text-base font-medium text-text-primary",children:c.title})]}),u.jsx("button",{onClick:o,className:"p-1 rounded hover:bg-bg-hover text-text-muted",children:u.jsx(dr,{className:"w-4 h-4"})})]}),u.jsx("p",{className:"text-sm text-text-secondary mb-4",children:c.description}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"flex gap-1",children:Array.from({length:n}).map((p,h)=>u.jsx("div",{className:Ye("w-2 h-2 rounded-full transition-colors",h===t?"bg-primary":h<t?"bg-primary/40":"bg-bg-surface")},h))}),u.jsxs("div",{className:"flex items-center gap-2",children:[!f&&u.jsxs("button",{onClick:s,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary rounded hover:bg-bg-hover",children:[u.jsx(lR,{className:"w-4 h-4"})," Back"]}),u.jsxs("button",{onClick:d?a:r,className:"flex items-center gap-1 px-4 py-1.5 text-sm bg-primary text-white rounded hover:bg-primary/90",children:[d?"Get Started":"Next"," ",!d&&u.jsx(qt,{className:"w-4 h-4"})]})]})]})]})})]})}const yne=E.memo(gne);function xne(){return u.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-[100] focus:top-4 focus:left-4 focus:px-4 focus:py-2 focus:bg-primary focus:text-white focus:rounded-lg focus:shadow-lg",children:"Skip to main content"})}function vne({message:e,role:t="status",clearAfter:n=5e3}){const[r,s]=E.useState(e);return E.useEffect(()=>{if(s(e),n>0&&e){const o=setTimeout(()=>s(""),n);return()=>clearTimeout(o)}},[e,n]),u.jsx("div",{"aria-live":t==="alert"?"assertive":"polite","aria-atomic":"true",role:t,className:"sr-only",children:r})}const bne=E.memo(vne),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 bd=Object.create(null);Object.keys(Ur).forEach(e=>{bd[Ur[e]]=e});const Ub={type:"error",data:"parser error"},f5=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",h5=typeof ArrayBuffer=="function",p5=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,A1=({type:e,data:t},n,r)=>f5&&t instanceof Blob?n?r(t):uI(t,r):h5&&(t instanceof ArrayBuffer||p5(t))?n?r(t):uI(new Blob([t]),r):r(Ur[e]+(t||"")),uI=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function dI(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Xv;function wne(e,t){if(f5&&e.data instanceof Blob)return e.data.arrayBuffer().then(dI).then(t);if(h5&&(e.data instanceof ArrayBuffer||p5(e.data)))return t(dI(e.data));A1(e,!1,n=>{Xv||(Xv=new TextEncoder),t(Xv.encode(n))})}const fI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<fI.length;e++)bl[fI.charCodeAt(e)]=e;const kne=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,c,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),p=new Uint8Array(f);for(r=0;r<n;r+=4)o=bl[e.charCodeAt(r)],a=bl[e.charCodeAt(r+1)],c=bl[e.charCodeAt(r+2)],d=bl[e.charCodeAt(r+3)],p[s++]=o<<2|a>>4,p[s++]=(a&15)<<4|c>>2,p[s++]=(c&3)<<6|d&63;return f},Nne=typeof ArrayBuffer=="function",T1=(e,t)=>{if(typeof e!="string")return{type:"message",data:m5(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Sne(e.substring(1),t)}:bd[n]?e.length>1?{type:bd[n],data:e.substring(1)}:{type:bd[n]}:Ub},Sne=(e,t)=>{if(Nne){const n=kne(e);return m5(n,t)}else return{base64:!0,data:e}},m5=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},g5="",Cne=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{A1(o,!1,c=>{r[a]=c,++s===n&&t(r.join(g5))})})},_ne=(e,t)=>{const n=e.split(g5),r=[];for(let s=0;s<n.length;s++){const o=T1(n[s],t);if(r.push(o),o.type==="error")break}return r};function Ene(){return new TransformStream({transform(e,t){wne(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let Qv;function ad(e){return e.reduce((t,n)=>t+n.length,0)}function ld(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function jne(e,t){Qv||(Qv=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(ad(n)<1)break;const d=ld(n,1);o=(d[0]&128)===128,s=d[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(ad(n)<2)break;const d=ld(n,2);s=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),r=3}else if(r===2){if(ad(n)<8)break;const d=ld(n,8),f=new DataView(d.buffer,d.byteOffset,d.length),p=f.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(Ub);break}s=p*Math.pow(2,32)+f.getUint32(4),r=3}else{if(ad(n)<s)break;const d=ld(n,s);c.enqueue(T1(o?d:Qv.decode(d),t)),r=0}if(s===0||s>e){c.enqueue(Ub);break}}}})}const y5=4;function Nt(e){if(e)return Ane(e)}function Ane(e){for(var t in Nt.prototype)e[t]=Nt.prototype[t];return e}Nt.prototype.on=Nt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Nt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Nt.prototype.off=Nt.prototype.removeListener=Nt.prototype.removeAllListeners=Nt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Nt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Nt.prototype.emitReserved=Nt.prototype.emit;Nt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Nt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const th=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),zn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Tne="arraybuffer";function x5(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Ine=zn.setTimeout,Mne=zn.clearTimeout;function nh(e,t){t.useNativeTimers?(e.setTimeoutFn=Ine.bind(zn),e.clearTimeoutFn=Mne.bind(zn)):(e.setTimeoutFn=zn.setTimeout.bind(zn),e.clearTimeoutFn=zn.clearTimeout.bind(zn))}const Rne=1.33;function One(e){return typeof e=="string"?Pne(e):Math.ceil((e.byteLength||e.size)*Rne)}function Pne(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function v5(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Lne(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Dne(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class $ne extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class I1 extends Nt{constructor(t){super(),this.writable=!1,nh(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 $ne(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=T1(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=Lne(t);return n.length?"?"+n:""}}class Fne extends I1{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)};_ne(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,Cne(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]=v5()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let b5=!1;try{b5=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Bne=b5;function qne(){}class zne extends Fne{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Fr extends Nt{constructor(t,n,r){super(),this.createRequest=t,nh(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=x5(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Fr.requestsCount++,Fr.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=qne,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Fr.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()}}Fr.requestsCount=0;Fr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",hI);else if(typeof addEventListener=="function"){const e="onpagehide"in zn?"pagehide":"unload";addEventListener(e,hI,!1)}}function hI(){for(let e in Fr.requests)Fr.requests.hasOwnProperty(e)&&Fr.requests[e].abort()}const Vne=(function(){const e=w5({xdomain:!1});return e&&e.responseType!==null})();class Hne extends zne{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Vne&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Fr(w5,this.uri(),t)}}function w5(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Bne))return new XMLHttpRequest}catch{}if(!t)try{return new zn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const k5=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Une extends I1{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=k5?{}:x5(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;A1(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&th(()=>{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]=v5()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Jv=zn.WebSocket||zn.MozWebSocket;class Wne extends Une{createSocket(t,n,r){return k5?new Jv(t,n,r):n?new Jv(t,n):new Jv(t)}doWrite(t,n){this.ws.send(n)}}class Kne extends I1{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=jne(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=Ene();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:c,value:d})=>{c||(this.onPacket(d),o())}).catch(c=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&th(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Gne={websocket:Wne,webtransport:Kne,polling:Hne},Yne=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Xne=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Wb(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=Yne.exec(e||""),o={},a=14;for(;a--;)o[Xne[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Qne(o,o.path),o.queryKey=Jne(o,o.query),o}function Qne(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 Jne(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const Kb=typeof addEventListener=="function"&&typeof removeEventListener=="function",wd=[];Kb&&addEventListener("offline",()=>{wd.forEach(e=>e())},!1);class Qs extends Nt{constructor(t,n){if(super(),this.binaryType=Tne,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=Wb(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=Wb(n.host).host);nh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Dne(this.opts.query)),Kb&&(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"})},wd.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=y5,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&&Qs.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",Qs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=One(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,th(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Qs.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(),Kb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=wd.indexOf(this._offlineEventListener);r!==-1&&wd.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Qs.protocol=y5;class Zne extends Qs{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;Qs.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Qs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,p(),n.close(),n=null)}const a=h=>{const g=new Error("probe error: "+h);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function c(){a("transport closed")}function d(){a("socket closed")}function f(h){n&&h.name!==n.name&&o()}const p=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",c),this.off("close",d),this.off("upgrading",f)};n.once("open",s),n.once("error",a),n.once("close",c),this.once("close",d),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let ere=class extends Zne{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>Gne[s]).filter(s=>!!s)),super(t,r)}};function tre(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=Wb(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 nre=typeof ArrayBuffer=="function",rre=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,N5=Object.prototype.toString,sre=typeof Blob=="function"||typeof Blob<"u"&&N5.call(Blob)==="[object BlobConstructor]",ore=typeof File=="function"||typeof File<"u"&&N5.call(File)==="[object FileConstructor]";function M1(e){return nre&&(e instanceof ArrayBuffer||rre(e))||sre&&e instanceof Blob||ore&&e instanceof File}function kd(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(kd(e[n]))return!0;return!1}if(M1(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return kd(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&kd(e[n]))return!0;return!1}function ire(e){const t=[],n=e.data,r=e;return r.data=Gb(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Gb(e,t){if(!e)return e;if(M1(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]=Gb(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]=Gb(e[r],t));return n}return e}function are(e,t){return e.data=Yb(e.data,t),delete e.attachments,e}function Yb(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]=Yb(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Yb(e[n],t));return e}const lre=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ze;(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"})(ze||(ze={}));class cre{constructor(t){this.replacer=t}encode(t){return(t.type===ze.EVENT||t.type===ze.ACK)&&kd(t)?this.encodeAsBinary({type:t.type===ze.EVENT?ze.BINARY_EVENT:ze.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ze.BINARY_EVENT||t.type===ze.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=ire(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class R1 extends Nt{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===ze.BINARY_EVENT;r||n.type===ze.BINARY_ACK?(n.type=r?ze.EVENT:ze.ACK,this.reconstructor=new ure(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(M1(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(ze[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ze.BINARY_EVENT||r.type===ze.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(R1.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 ze.CONNECT:return pI(n);case ze.DISCONNECT:return n===void 0;case ze.CONNECT_ERROR:return typeof n=="string"||pI(n);case ze.EVENT:case ze.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&lre.indexOf(n[0])===-1);case ze.ACK:case ze.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ure{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=are(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function pI(e){return Object.prototype.toString.call(e)==="[object Object]"}const dre=Object.freeze(Object.defineProperty({__proto__:null,Decoder:R1,Encoder:cre,get PacketType(){return ze}},Symbol.toStringTag,{value:"Module"}));function ar(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const fre=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class S5 extends Nt{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=[ar(t,"open",this.onopen.bind(this)),ar(t,"packet",this.onpacket.bind(this)),ar(t,"error",this.onerror.bind(this)),ar(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(fre.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:ze.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const p=this.ids++,h=n.pop();this._registerAckCallback(p,h),a.id=p}const c=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,d=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!c||(d?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},s),a=(...c)=>{this.io.clearTimeoutFn(o),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,c)=>a?s(a):r(c);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ze.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 ze.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 ze.EVENT:case ze.BINARY_EVENT:this.onevent(t);break;case ze.ACK:case ze.BINARY_ACK:this.onack(t);break;case ze.DISCONNECT:this.ondisconnect();break;case ze.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:ze.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ze.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 va(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}va.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};va.prototype.reset=function(){this.attempts=0};va.prototype.setMin=function(e){this.ms=e};va.prototype.setMax=function(e){this.max=e};va.prototype.setJitter=function(e){this.jitter=e};class Xb extends Nt{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,nh(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 va({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||dre;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new ere(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=ar(n,"open",function(){r.onopen(),t&&t()}),o=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=ar(n,"error",o);if(this._timeout!==!1){const c=this._timeout,d=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},c);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ar(t,"ping",this.onping.bind(this)),ar(t,"data",this.ondata.bind(this)),ar(t,"error",this.onerror.bind(this)),ar(t,"close",this.onclose.bind(this)),ar(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){th(()=>{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 S5(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const cl={};function Nd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=tre(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=cl[s]&&o in cl[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let d;return c?d=new Xb(r,t):(cl[s]||(cl[s]=new Xb(r,t)),d=cl[s]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Nd,{Manager:Xb,Socket:S5,io:Nd,connect:Nd});function C5(e={}){const{autoConnect:t=!0,onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}=e,c=E.useRef(null),[d,f]=E.useState(!1),p=E.useRef({onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a});E.useEffect(()=>{p.current={onWorkflowUpdated:n,onExecutionStep:r,onExecutionCompleted:s,onAIProcessing:o,onAIResponse:a}},[n,r,s,o,a]);const h=E.useCallback(()=>{var _;if((_=c.current)!=null&&_.connected)return;const k=Nd({reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});k.on("connect",()=>{console.log("WebSocket connected"),f(!0)}),k.on("disconnect",()=>{console.log("WebSocket disconnected"),f(!1)}),k.on("connect_error",N=>{console.error("WebSocket connection error:",N),f(!1)}),k.on(os.WORKFLOW_UPDATED,N=>{var S,A;(A=(S=p.current).onWorkflowUpdated)==null||A.call(S,N)}),k.on(os.EXECUTION_STEP,N=>{var S,A;(A=(S=p.current).onExecutionStep)==null||A.call(S,N)}),k.on(os.EXECUTION_COMPLETED,N=>{var S,A;(A=(S=p.current).onExecutionCompleted)==null||A.call(S,N)}),k.on(os.AI_PROCESSING,({processing:N})=>{var S,A;(A=(S=p.current).onAIProcessing)==null||A.call(S,N)}),k.on(os.AI_RESPONSE,N=>{var S,A;(A=(S=p.current).onAIResponse)==null||A.call(S,N)}),c.current=k},[]),g=E.useCallback(()=>{c.current&&(c.current.disconnect(),c.current=null,f(!1))},[]),y=E.useCallback(k=>{var _;(_=c.current)==null||_.emit(os.WORKFLOW_SUBSCRIBE,k)},[]),b=E.useCallback(k=>{var _;(_=c.current)==null||_.emit(os.WORKFLOW_UNSUBSCRIBE,k)},[]),w=E.useCallback(k=>{var _;(_=c.current)==null||_.emit(os.EXECUTION_SUBSCRIBE,k)},[]),v=E.useCallback(k=>{var _;(_=c.current)==null||_.emit(os.EXECUTION_UNSUBSCRIBE,k)},[]);return E.useEffect(()=>(t&&h(),()=>{g()}),[t,h,g]),{connected:d,socket:c.current,subscribeToWorkflow:y,unsubscribeFromWorkflow:b,subscribeToExecution:w,unsubscribeFromExecution:v,connect:h,disconnect:g}}function hre(){const{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,loadWorkflows:o,selectWorkflow:a,loadWorkflow:c,saveWorkflow:d,createWorkflow:f,deleteWorkflow:p}=sn(),{setNodes:h,setEdges:g}=qr(),{subscribeToWorkflow:y,unsubscribeFromWorkflow:b,connected:w}=C5({onWorkflowUpdated:A=>{A.path===t&&c(A.path),(A.event==="add"||A.event==="remove")&&o()}});E.useEffect(()=>{o()},[o]),E.useEffect(()=>{if(w&&t)return y(t),()=>{b(t)}},[w,t,y,b]),E.useEffect(()=>{if(n){const{nodes:A,edges:I}=t5(n);h(G3(A,I)),g(I)}},[n,h,g]);const v=E.useCallback(A=>{a(A)},[a]),k=E.useCallback(async A=>{A&&await d(A)},[d]),_=E.useCallback(async A=>{await f(A)},[f]),N=E.useCallback(async A=>{await p(A)},[p]),S=E.useCallback(A=>{if(!n)return[];const I=[];if(n.inputs)for(const T of Object.keys(n.inputs))I.push(`inputs.${T}`);for(let T=0;T<A&&T<n.steps.length;T++){const O=n.steps[T];O.outputVariable&&I.push(O.outputVariable)}return I},[n]);return{workflows:e,selectedWorkflow:t,currentWorkflow:n,isLoading:r,error:s,selectWorkflow:v,saveWorkflow:k,createWorkflow:_,deleteWorkflow:N,refreshWorkflows:o,getAvailableVariables:S}}function pre(){var Ie;const{currentWorkflow:e,selectedWorkflow:t,saveWorkflow:n,refreshWorkflows:r}=hre(),{isNewStepOpen:s,newStepPosition:o,openNewStepWizard:a,closeNewStepWizard:c}=Y3(),{pendingChanges:d,acceptChanges:f,rejectChanges:p}=E1(),{isOpen:h,setIsOpen:g,openShortcuts:y}=vte(),{breadcrumbs:b,popToIndex:w,resetNavigation:v}=Tw(),{loadWorkflow:k}=sn(),_=E.useCallback((pe,me)=>{w(me),k(pe.path||"")},[w,k]),{connected:N,subscribeToExecution:S,unsubscribeFromExecution:A}=C5({onWorkflowUpdated:()=>{r()},onExecutionStep:pe=>{Qt(pe.stepId),Mt(me=>me.map(Pe=>Pe.stepId===pe.stepId?{...Pe,status:pe.status,duration:pe.duration,error:pe.error}:Pe)),ot(me=>[...me,`Step "${pe.stepName||pe.stepId}": ${pe.status}${pe.error?` - ${pe.error}`:""}`]),$e.current&&(M($e.current,pe.stepId,pe.status,pe.output,pe.error),H($e.current,`Step "${pe.stepName||pe.stepId}": ${pe.status}`))},onExecutionCompleted:pe=>{qe(pe.status),Qt(null),ot(me=>[...me,pe.status==="completed"?"Workflow completed successfully!":pe.error||"Workflow execution failed"]),$e.current&&(P($e.current,pe.status),pe.error&&H($e.current,`Error: ${pe.error}`)),pe.runId&&A(pe.runId),$e.current=null}}),{isExecuting:I,isPaused:T,currentRunId:O,runs:L,startExecution:z,updateStepStatus:M,completeExecution:P,addLog:H,pauseExecution:D,resumeExecution:V,cancelExecution:$,debug:U,enableDebugMode:B,disableDebugMode:q,toggleBreakpoint:Y,clearAllBreakpoints:F,stepOver:K,stepInto:ee,stepOut:W,addWatchExpression:X,removeWatchExpression:Z}=Z3(),{breakpoint:ne,setBreakpoint:te,sidebarOpen:ie,setSidebarOpen:he,propertiesPanelOpen:xe,setPropertiesPanelOpen:ve,toolbarVisible:ye,setToolbarVisible:_e}=eh(),{open:we,registerCommands:Te}=d5(),{toggleTheme:Ne}=Gs(),{openSettings:Je}=mr();E.useEffect(()=>{mr.getState().loadSettings()},[]);const{workflows:Fe}=sn(),[_t,bt]=E.useState("");E.useEffect(()=>{const pe=[{id:"save",label:"Save Workflow",category:"action",shortcut:`${ne==="mobile"?"Ctrl":"⌘"} + S`,execute:()=>On(),keywords:["save","persist"]},{id:"execute",label:"Execute Workflow",category:"action",shortcut:`${ne==="mobile"?"Ctrl":"⌘"} + Enter`,execute:()=>wt(),keywords:["run","start"]},{id:"validate",label:"Validate Workflow",category:"action",execute:()=>bn(),keywords:["check","lint"]},{id:"add-step",label:"Add New Step",category:"action",shortcut:"N",execute:()=>Rn(),keywords:["create","new"]},{id:"open-settings",label:"Open Settings",category:"setting",shortcut:`${ne==="mobile"?"Ctrl":"⌘"} + ,`,execute:()=>Je(),keywords:["preferences","config"]},{id:"toggle-theme",label:"Toggle Theme",category:"setting",shortcut:`${ne==="mobile"?"Ctrl":"⌘"} + Shift + T`,execute:()=>Ne(),keywords:["dark","light","mode"]},{id:"show-shortcuts",label:"Show Keyboard Shortcuts",category:"setting",shortcut:`${ne==="mobile"?"Ctrl":"⌘"} + /`,execute:()=>g(!0),keywords:["keys","hotkeys"]},{id:"toggle-sidebar",label:"Toggle Sidebar",category:"setting",execute:()=>he(!ie),keywords:["panel","left"]},{id:"toggle-properties",label:"Toggle Properties Panel",category:"setting",execute:()=>ve(!xe),keywords:["panel","right"]},{id:"nav-back",label:"Navigate Back",category:"navigation",execute:()=>Zt(),keywords:["parent","up"]},{id:"nav-root",label:"Navigate to Root",category:"navigation",execute:()=>Qn(),keywords:["home","top"]},{id:"toggle-debug",label:"Toggle Debug Mode",category:"action",shortcut:"F9",execute:()=>U.enabled?q():B(),keywords:["breakpoint","inspect"]},...Fe.map(me=>({id:`workflow-${me.path}`,label:me.name,description:me.path,category:"workflow",execute:()=>{sn.getState().selectWorkflow(me.path)},keywords:[me.name.toLowerCase()]}))];Te(pe)},[Fe,ie,xe,ne,U.enabled]),E.useEffect(()=>{const pe=()=>{const me=kee(window.innerWidth);me!==ne&&te(me)};return pe(),window.addEventListener("resize",pe),()=>window.removeEventListener("resize",pe)},[ne,te]);const[He,qe]=E.useState("pending"),[Xt,Mt]=E.useState([]),[Rt,ot]=E.useState([]),[Et,Qt]=E.useState(null),$e=E.useRef(null),[cn,Vt]=E.useState(!1),[Ht,Jt]=E.useState({}),[xs,Yn]=E.useState(!1),Rn=E.useCallback(()=>{a()},[a]),Xn=E.useCallback(pe=>{if(!e)return;const me={...e,steps:[...e.steps,pe]};n(me),console.log("Created step:",pe)},[e,n]),wt=E.useCallback(async pe=>{var me;if(I){if($e.current)try{(await fetch(`/api/execute/cancel/${$e.current}`,{method:"POST"})).ok&&($($e.current),qe("cancelled"),ot(Ot=>[...Ot,"Execution cancelled by user"]),$e.current=null)}catch(Pe){console.error("Failed to cancel execution:",Pe),ot(Ot=>[...Ot,"Failed to cancel execution"])}return}if(!(!e||!t)){if(!pe&&e.inputs&&Object.keys(e.inputs).length>0){Vt(!0);return}try{qe("running"),Qt(null),ot(["Starting workflow execution..."]),Mt(e.steps.map(Pt=>({stepId:Pt.id,stepName:Pt.name||Pt.id,status:"pending"})));const Pe=await fetch(`/api/execute/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inputs:pe||{},dryRun:!1})});if(!Pe.ok){const Pt=await Pe.json();throw new Error(Pt.message||"Failed to start execution")}const Xe=(await Pe.json()).runId,pt=((me=e.metadata)==null?void 0:me.name)||"Untitled Workflow";z(t,pt,{},Xe),$e.current=Xe,S(Xe),ot(Pt=>[...Pt,`Execution started: ${Xe}`]),_o.success("Workflow execution started")}catch(Pe){const Ot=Pe instanceof Error?Pe.message:"Unknown error";console.error("Failed to execute workflow:",Pe),_o.error(`Execution failed: ${Ot}`),qe("failed"),ot(Xe=>[...Xe,`Error: ${Ot}`]),$e.current&&(P($e.current,"failed"),$e.current=null)}}},[I,e,t,z,$,S,M,H,P]),On=E.useCallback(()=>{e&&(n(e),_o.success("Workflow saved"))},[e,n]),bn=E.useCallback(()=>{t&&Yn(!0)},[t]),Zt=E.useCallback(()=>{if(b.length>1){const pe=b.length-2,me=b[pe];w(pe),k(me.path)}},[b,w,k]),Qn=E.useCallback(()=>{if(b.length>1){const pe=b[0];w(0),k(pe.path)}},[b,w,k]);return E.useEffect(()=>{const pe=me=>{if(me.target instanceof HTMLInputElement||me.target instanceof HTMLTextAreaElement)return;const Pe=me.metaKey||me.ctrlKey;if(Pe&&me.key===","){me.preventDefault(),Je();return}if(Pe&&me.key==="k"){me.preventDefault(),we("commands");return}if(Pe&&me.key==="p"){me.preventDefault(),we("workflows");return}if(Pe&&me.shiftKey&&me.key==="t"){me.preventDefault(),Ne();return}Pe&&me.key==="s"&&(me.preventDefault(),On()),Pe&&me.key==="Enter"&&(me.preventDefault(),wt()),me.key==="n"&&!Pe&&!me.shiftKey&&!me.altKey&&(me.preventDefault(),Rn()),Pe&&me.key==="ArrowLeft"&&(me.preventDefault(),Zt()),Pe&&me.key==="ArrowUp"&&(me.preventDefault(),Qn()),me.key==="F9"&&(me.preventDefault(),U.enabled?q():B()),me.key==="F10"&&U.enabled&&T&&(me.preventDefault(),K()),me.key==="F11"&&!me.shiftKey&&U.enabled&&T&&(me.preventDefault(),ee()),me.key==="F11"&&me.shiftKey&&U.enabled&&T&&(me.preventDefault(),W()),me.key==="F5"&&T&&(me.preventDefault(),V())};return window.addEventListener("keydown",pe),()=>window.removeEventListener("keydown",pe)},[On,wt,Rn,Zt,Qn,U.enabled,T,B,q,K,ee,W,V,we,Ne,Je]),u.jsxs(nR,{children:[u.jsx(Uz,{position:"bottom-right",theme:"dark",toastOptions:{style:{background:"#1e1e3a",border:"1px solid #3d3d5c",color:"#e0e0e0"}}}),u.jsx(xne,{}),u.jsx(bne,{message:_t}),u.jsx(hne,{}),u.jsx(yne,{}),u.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-bg-canvas",id:"main-content",children:[u.jsx(Gee,{}),u.jsxs("div",{className:"flex flex-1 flex-col relative",children:[ne==="mobile"&&u.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-default bg-bg-panel",children:[u.jsx("button",{onClick:()=>he(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Open menu",children:u.jsx(C9,{className:"w-5 h-5 text-text-secondary"})}),u.jsxs("h1",{className:"text-sm font-medium text-text-primary flex items-center gap-1.5",children:[u.jsx("img",{src:"/marktoflow-logo.png",alt:"Marktoflow",className:"w-6 h-6 rounded-full object-cover"}),"Marktoflow"]}),u.jsx("button",{onClick:()=>ve(!0),className:"w-10 h-10 rounded-lg flex items-center justify-center hover:bg-bg-hover transition-colors","aria-label":"Open properties",children:u.jsx(S2,{className:"w-5 h-5 text-text-secondary"})})]}),ne!=="mobile"&&u.jsxs("div",{className:"absolute top-4 right-4 z-10 flex items-center gap-2",children:[u.jsx(wte,{showLabel:!0}),u.jsx(bte,{onClick:y}),u.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs ${N?"bg-success/10 text-success":"bg-error/10 text-error"}`,children:[u.jsx("div",{className:`w-2 h-2 rounded-full ${N?"bg-success":"bg-error"}`}),N?"Connected":"Disconnected"]})]}),u.jsx(Nee,{onAddStep:Rn,onExecute:wt,onSave:On,onValidate:bn,isExecuting:I}),u.jsx(kte,{items:b,onNavigate:_}),u.jsxs("div",{className:"flex-1 relative",children:[u.jsx(pee,{}),!ye&&ne!=="mobile"&&u.jsx("button",{onClick:()=>_e(!0),className:"absolute top-4 left-1/2 -translate-x-1/2 z-10 p-2 bg-bg-panel/90 backdrop-blur border border-border-default rounded-lg shadow-md hover:bg-bg-hover transition-colors text-text-muted hover:text-text-primary",title:"Show toolbar",children:u.jsx(Y9,{className:"w-4 h-4"})}),ne!=="mobile"&&u.jsx("button",{onClick:()=>he(!ie),className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 p-1.5 bg-bg-panel/90 backdrop-blur border border-l-0 border-border-default rounded-r-lg shadow-sm hover:bg-bg-hover transition-colors text-text-muted hover:text-text-primary",title:ie?"Collapse sidebar":"Expand sidebar","aria-label":ie?"Collapse sidebar":"Expand sidebar",children:u.jsx(I9,{className:"w-4 h-4"})}),ne!=="mobile"&&u.jsx("button",{onClick:()=>ve(!xe),className:"absolute right-0 top-1/2 -translate-y-1/2 z-10 p-1.5 bg-bg-panel/90 backdrop-blur border border-r-0 border-border-default rounded-l-lg shadow-sm hover:bg-bg-hover transition-colors text-text-muted hover:text-text-primary",title:xe?"Collapse properties":"Expand properties","aria-label":xe?"Collapse properties":"Expand properties",children:u.jsx(S2,{className:"w-4 h-4"})}),u.jsx(Oee,{isExecuting:I,isPaused:T,workflowStatus:He,currentStepId:Et,steps:Xt,logs:Rt,onPause:()=>D(),onResume:()=>V(),onStop:async()=>{if($e.current){try{await fetch(`/api/execute/cancel/${$e.current}`,{method:"POST"})}catch(pe){console.error("Failed to cancel execution:",pe)}$($e.current),A($e.current),$e.current=null}qe("cancelled"),ot(pe=>[...pe,"Execution stopped by user"])},onStepOver:()=>K(),onClose:()=>{qe("pending"),Mt([]),ot([])},debug:U,onToggleDebugMode:()=>{U.enabled?q():B()},onToggleBreakpoint:pe=>Y(pe),onStepInto:()=>ee(),onStepOut:()=>W(),onClearBreakpoints:()=>F(),onAddWatchExpression:pe=>X(pe),onRemoveWatchExpression:pe=>Z(pe)})]}),u.jsx(hte,{})]}),u.jsx(nte,{}),u.jsx(gte,{open:s,onOpenChange:pe=>{pe||c()},onCreateStep:Xn,position:o||void 0}),d&&u.jsx(pte,{open:!!d,onOpenChange:()=>p(),originalWorkflow:e,modifiedWorkflow:d,explanation:"AI has suggested the following changes to your workflow.",onAccept:f,onReject:p}),(e==null?void 0:e.inputs)&&u.jsx(Pee,{open:cn,onOpenChange:Vt,inputs:e.inputs,onExecute:wt,workflowName:(Ie=e.metadata)==null?void 0:Ie.name}),u.jsx(Lee,{workflowPath:xs?t:null,onClose:()=>Yn(!1)}),u.jsx(xte,{open:h,onOpenChange:g})]})]})}hD.createRoot(document.getElementById("root")).render(u.jsx(ue.StrictMode,{children:u.jsx(pre,{})}));
|
|
838
|
+
//# sourceMappingURL=index-DqVkoerZ.js.map
|