UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 254 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./chunk-legacy-Dz3fjYb5.js","./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./_plugin-vue_export-helper-legacy-DFdC_I5Z.js","./users.store-legacy-azRUgFdP.js","./ParameterInputList-legacy-BQq1pmzT.js","./constants-legacy-2_ytuuS3.js","./settings.store-legacy-I6rZOvfF.js","./assistant.store-legacy-DDWm4tY4.js","./chatPanel.store-legacy-BsMvrm8R.js","./usePinnedData-legacy-BfjAvFWp.js","./nodeIcon-legacy-DR5Etm69.js","./canvas.utils-legacy-DBwbAhDp.js","./canvas.eventBus-legacy-DR7gyyyi.js","./useCanvasOperations-legacy-B8cM-OAy.js","./setupPanel.store-legacy-CxgQYJWF.js","./useDynamicCredentials-legacy-ByFvi9Dz.js","./NodeIcon-legacy-CCBkNBDS.js","./useTelemetryContext-legacy-DXxvic2t.js","./useRunWorkflow-legacy-DKBAJ9Cs.js","./useInjectWorkflowId-legacy-piYT0WDS.js","./collaboration.store-legacy-CFKDVv2B.js","./NodeSettings-legacy-1yPg_OdG.js","./KeyboardShortcutTooltip-legacy-Dj9i12D0.js","./useKeybindings-legacy-i79qEe1h.js","./useNodeCreatorShortcutCoachmark-legacy-4mFrLqnb.js","./useExpressionResolveCtx-legacy-DqYbcufM.js","./chatHubPanel.store-legacy-BByMzy6Y.js"],(function(e,t){var n,o,a,i,r,s,l,u,d,c,h,p,v,f,g,_,m,y,b,w,x,k,E,z,N,C,T,M,I,O,S,$,A,B,j,D,R,L,P,V,q,H,F,W,Y,X,U,G,Z,K,Q,J,ee,te,ne,oe,ae,ie,re,se,le,ue,de,ce,he,pe,ve,fe,ge,_e,me,ye,be,we,xe,ke,Ee,ze,Ne,Ce,Te,Me,Ie,Oe,Se,$e,Ae,Be,je,De,Re,Le,Pe,Ve,qe,He,Fe,We,Ye,Xe,Ue,Ge,Ze,Ke,Qe,Je,et,tt,nt,ot,at,it,rt,st,lt,ut,dt,ct,ht,pt,vt,ft,gt,_t,mt,yt,bt,wt,xt,kt,Et,zt,Nt,Ct,Tt,Mt,It,Ot,St,$t,At,Bt,jt,Dt,Rt,Lt,Pt,Vt,qt,Ht,Ft,Wt,Yt,Xt,Ut,Gt,Zt,Kt,Qt,Jt,en,tn,nn,on,an,rn,sn,ln,un,dn,cn,hn,pn,vn,fn,gn,_n,mn,yn,bn,wn,xn,kn,En,zn,Nn,Cn,Tn,Mn,In,On,Sn,$n,An,Bn,jn,Dn,Rn,Ln,Pn,Vn,qn,Hn,Fn,Wn,Yn,Xn,Un,Gn,Zn,Kn,Qn,Jn,eo,to,no,oo,ao,io,ro,so,lo,uo,co,ho,po,vo,fo,go,_o,mo,yo,bo,wo,xo,ko,Eo,zo,No,Co,To,Mo,Io,Oo,So,$o,Ao,Bo,jo,Do,Ro,Lo,Po,Vo,qo,Ho,Fo,Wo,Yo,Xo,Uo,Go,Zo,Ko,Qo,Jo,ea,ta,na,oa,aa,ia,ra,sa,la,ua,da,ca,ha,pa,va,fa,ga,_a,ma,ya,ba,wa,xa,ka,Ea,za,Na,Ca,Ta,Ma,Ia,Oa,Sa,$a,Aa,Ba,ja,Da,Ra,La,Pa,Va,qa,Ha,Fa,Wa,Ya,Xa,Ua,Ga,Za,Ka,Qa,Ja,ei,ti,ni,oi,ai,ii,ri,si,li,ui,di,ci,hi,pi,vi,fi,gi,_i,mi,yi,bi,wi,xi,ki,Ei,zi,Ni,Ci,Ti,Mi,Ii,Oi,Si,$i,Ai,Bi,ji,Di,Ri,Li,Pi,Vi,qi,Hi,Fi,Wi,Yi,Xi,Ui,Gi,Zi,Ki,Qi,Ji,er,tr,nr,or,ar,ir,rr,sr,lr,ur,dr,cr,hr,pr,vr,fr,gr,_r,mr,yr,br,wr,xr,kr,Er,zr,Nr,Cr,Tr,Mr,Ir,Or,Sr,$r,Ar,Br,jr,Dr,Rr;function Lr(e){const t=Qe(),n=$t(),o=at(),a=et(),i=Se(),r=Ue(),s=tn(),l=Te(),u=Q(),d=g((()=>a.workflowObject)),c=g((()=>ct(i?.value?.scopes).workflow)),h=g((()=>r.preferences.branchReadOnly||t.isReadOnlyView||!c.value.update||(i?.value?.isArchived??!1)||s.shouldBeReadOnly)),p=g((()=>{if(1!==v.value.length)return!1;const e=v.value[0];return!!Nt(e)&&!!zt(e)})),v=g((()=>e.value.map((e=>i?.value?.getNodeById(e))).filter(rt))),f=e=>{const t=o.getNodeType(e.type,e.typeVersion);return!!t&&!pt.includes(t.name)&&(e=>{const t=(i?.value?.allNodes??[]).filter((t=>t.type===e.name));return void 0===e.maxNodes||t.length<e.maxNodes})(t)},_=e=>{const t=d.value.getNode(e.name),n=o.getNodeType(t.type,t.typeVersion);return kt(d.value,t,n)};return g((()=>{const e=v.value,t=e.every((e=>e.type===bt)),o={adjustToNumber:e.length,interpolate:{subject:t?u.baseText("contextMenu.sticky",{adjustToNumber:e.length}):u.baseText("contextMenu.node",{adjustToNumber:e.length})}},a=[{id:"select_all",divided:!0,label:u.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:e.length===(i?.value?.allNodes??[]).length},{id:"deselect_all",label:u.baseText("contextMenu.deselectAll"),disabled:0===e.length}],r=[{id:"extract_sub_workflow",divided:!0,label:u.baseText("contextMenu.extract",{adjustToNumber:e.length}),shortcut:{altKey:!0,keys:["X"]},disabled:h.value}],s=[!t&&n.isAiAssistantOrBuilderEnabled&&l.isFeatureEnabled&&{id:"focus_ai_on_selected",divided:!0,label:u.baseText("contextMenu.focusAiOnSelected",{adjustToNumber:e.length,interpolate:{count:e.length}}),shortcut:{altKey:!0,keys:["I"]},disabled:h.value}].filter(Boolean),d=[{id:"tidy_up",divided:!0,label:u.baseText(e.length<2?"contextMenu.tidyUpWorkflow":"contextMenu.tidyUpSelection"),shortcut:{shiftKey:!0,altKey:!0,keys:["T"]},disabled:h.value}];if(0===e.length)return[{id:"add_node",shortcut:{keys:["N"]},label:u.baseText("contextMenu.addNode"),disabled:h.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:u.baseText("contextMenu.addSticky"),disabled:h.value},...d,...a];{const n=[!t&&{id:"toggle_activation",label:e.every((e=>e.disabled))?u.baseText("contextMenu.activate",o):u.baseText("contextMenu.deactivate",o),shortcut:{keys:["D"]},disabled:h.value},!t&&{id:"toggle_pin",label:e.every((e=>(e=>!!i?.value?.pinData?.[e.name])(e)))?u.baseText("contextMenu.unpin",o):u.baseText("contextMenu.pin",o),shortcut:{keys:["p"]},disabled:h.value||!e.every((e=>jt(e).canPinNode(!0)))},{id:"copy",label:u.baseText("contextMenu.copy",o),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:u.baseText("contextMenu.duplicate",o),shortcut:{metaKey:!0,keys:["D"]},disabled:h.value||!e.every(f)},...d,...r,...s,...a,{id:"delete",divided:!0,label:u.baseText("contextMenu.delete",o),shortcut:{keys:["Del"]},disabled:h.value}].filter(Boolean);if(1===e.length){const o=[];if((e=>"n8n-nodes-base.webhook"===e.type||!!e.webhookId&&!!e.type.toLocaleLowerCase().includes("trigger")&&!!_(e))(e[0])){const t=_t.includes(e[0].type),n=i?.value?.active??!1;t||o.push({divided:!0,id:"copy_test_url",label:u.baseText("contextMenu.copyTestUrl"),shortcut:{shiftKey:!0,altKey:!0,keys:["U"]},disabled:!1}),n&&o.push({divided:t,id:"copy_production_url",label:u.baseText("contextMenu.copyProductionUrl"),shortcut:{altKey:!0,keys:["U"]},disabled:!1})}const a=t?[{id:"open",label:u.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:h.value},{id:"change_color",label:u.baseText("contextMenu.changeColor"),disabled:h.value}]:[{id:"open",label:u.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:u.baseText("contextMenu.test"),disabled:h.value||!_(e[0])},...o,{divided:!!o.length,id:"rename",label:u.baseText("contextMenu.rename"),shortcut:{keys:["Space"]},disabled:h.value},{id:"replace",label:u.baseText("contextMenu.replace"),shortcut:{keys:["R"]},disabled:h.value}];Nt(e[0])&&a.push({id:"open_sub_workflow",label:u.baseText("contextMenu.openSubworkflow"),shortcut:{shiftKey:!0,metaKey:!0,keys:["O"]},disabled:!p.value}),n.unshift(...a)}return n}}))}function Pr(e,t){const{findNode:n,findEdge:o,getSelectedNodes:a,edges:i,nodes:r}=ze(e);function s(e,t){const n=e.y-t.y;return 0===n?e.x-t.x:n}function l(e,t){const n=i.value.some((t=>t.target===e.id)),o=i.value.some((e=>e.target===t.id));return!n&&o?-1:n&&!o?1:s(e.position,t.position)}function u(e,t){return s(d(e),d(t))}function d(e){return{x:e.targetX,y:e.targetY}}function c(e){return e.dimensions&&"number"==typeof e.dimensions.width&&"number"==typeof e.dimensions.height&&e.dimensions.width>0&&e.dimensions.height>0?{width:e.dimensions.width,height:e.dimensions.height}:e.data&&e.data.render?ve(e.data.render.type===Me.Default&&!0===e.data.render.options.configuration,e.data.render.type===Me.Default&&!0===e.data.render.options.configurable,e.data.inputs.filter((e=>"main"===e.type)).length||1,e.data.outputs.filter((e=>"main"===e.type)).length||1,e.data.inputs.filter((e=>"main"!==e.type)).length+e.data.outputs.filter((e=>"main"!==e.type)).length,t.value):{width:Ie[0],height:Ie[1]}}function h(e){const{minX:t,minY:n,maxX:o,maxY:a}=e.reduce(((e,t)=>{const{x:n,y:o,width:a,height:i}=t;return{minX:Math.min(e.minX,n),maxX:Math.max(e.maxX,n+a),minY:Math.min(e.minY,o),maxY:Math.max(e.maxY,o+i)}}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return{x:t,y:n,width:o-t,height:a-n}}function p(e){const{width:t,height:n}=c(e);return{x:e.position.x,y:e.position.y,width:t,height:n}}function v(e){return h(e.nodes().map((t=>function(e){return{x:e.x-e.width/2,y:e.y-e.height/2,width:e.width,height:e.height}}(e.node(t)))))}function f(e,t){return e.x+e.width/2-t.width/2}function g(e){return e.render.type===Me.Default&&e.render.options.configurable&&!e.render.options.configuration}function _({graph:e,root:t,nodeById:n}){return e.predecessors(t.id).map((e=>n[e])).filter((e=>function(e){return e.render.type===Me.Default&&e.render.options.configuration}(e.data))).flatMap((t=>[t.id,..._({graph:e,root:t.data,nodeById:n})]))}return{layout:function(e){const{nodes:t,edges:s}=function(e){return"selection"===e?{nodes:a.value,edges:i.value}:{nodes:r.value,edges:i.value}}(e),d=t.filter((e=>e.data.type!==bt)).map((e=>n(e.id))).filter(rt),m=function(e){return h(e.map(p))}(d),y=function({nodes:e,edges:t}){const a=new xo.default.graphlib.Graph;a.setDefaultEdgeLabel((()=>({})));const i=e.map((e=>n(e.id))).filter(rt).sort(l),r=new Set(e.map((e=>e.id)));return i.forEach((e=>{const{width:t,height:n}=c(e),{x:o,y:i}=e.position;a.setNode(e.id,{width:t,height:n,x:o,y:i})})),t.map((e=>o(e.id))).filter(rt).filter((e=>r.has(e.source)&&r.has(e.target))).sort(u).forEach((e=>a.setEdge(e.source,e.target))),a}({nodes:d,edges:s}),b=d.reduce(((e,t)=>(e[t.id]=t,e)),{}),w=xo.default.graphlib.alg.components(y).map((e=>{const t=function({nodeIds:e,parent:t}){const n=new xo.default.graphlib.Graph;n.setGraph({rankdir:"LR",edgesep:Eo,nodesep:Eo,ranksep:ko}),n.setDefaultEdgeLabel((()=>({})));const o=new Set(e);return t.nodes().filter((e=>o.has(e))).forEach((e=>{n.setNode(e,t.node(e))})),t.edges().filter((e=>o.has(e.v)&&o.has(e.w))).forEach((e=>n.setEdge(e.v,e.w,t.edge(e)))),n}({nodeIds:e,parent:y}),n=t.nodes().map((e=>b[e].data)).filter(g).map((e=>{const n=_({graph:t,nodeById:b,root:e}),o=function({parent:e,nodeIds:t}){const n=new xo.default.graphlib.Graph;n.setGraph({rankdir:"TB",edgesep:No,nodesep:No,ranksep:Co}),n.setDefaultEdgeLabel((()=>({})));const o=new Set(t);return e.nodes().filter((e=>o.has(e))).forEach((t=>{n.setNode(t,e.node(t))})),e.edges().filter((e=>o.has(e.v)&&o.has(e.w))).forEach((e=>n.setEdge(e.w,e.v))),n}({parent:t,nodeIds:n.concat(e.id)});n.forEach((e=>t.removeNode(e)));const a=t.edges().filter((t=>t.v===e.id||t.w===e.id));xo.default.layout(o,{disableOptimalOrderHeuristic:!0});const i=v(o);return t.setNode(e.id,{width:i.width,height:i.height}),a.forEach((e=>t.setEdge(e))),{graph:o,boundingBox:i,aiParentNode:e}}));return xo.default.layout(t,{disableOptimalOrderHeuristic:!0}),{graph:t,aiGraphs:n,boundingBox:v(t)}})),x=function({nodes:e}){const t=new xo.default.graphlib.Graph;return t.setGraph({rankdir:"TB",align:"UL",edgesep:zo,nodesep:zo,ranksep:zo}),t.setDefaultEdgeLabel((()=>({}))),e.forEach((({id:e,box:{x:n,y:o,width:a,height:i}})=>t.setNode(e,{x:n,y:o,width:a,height:i}))),e.forEach(((n,o)=>{e[o+1]&&t.setEdge(n.id,e[o+1].id)})),t}({nodes:w.map((({boundingBox:e},t)=>({box:e,id:t.toString()})))});xo.default.layout(x,{disableOptimalOrderHeuristic:!0});const k=w.flatMap((({graph:e,aiGraphs:t},n)=>{const o=x.node(n.toString()),a=new Set(t.map((({aiParentNode:e})=>e.id))),i=0,r=o.y-o.height/2;return e.nodes().flatMap((n=>{const{x:o,y:s,width:l,height:u}=e.node(n),d={id:n,boundingBox:{x:o+i-l/2,y:s+r-u/2,width:l,height:u}};if(a.has(n)){const e=t.find((({aiParentNode:e})=>e.id===n));if(!e)return[];const o=d.boundingBox,a={x:o.x,y:o.y};return e.graph.nodes().map((t=>{const n=e.graph.node(t);return{id:t,boundingBox:{x:n.x+a.x-n.width/2,y:n.y+a.y-n.height/2,width:n.width,height:n.height}}}))}return d}))})).reduce(((e,t)=>(e[t.id]=t.boundingBox,e)),{});w.flatMap((({aiGraphs:e})=>e)).forEach((({graph:e})=>{const t=e.nodes(),n=h(t.map((e=>k[e])).filter(rt)),o=n.height/2-Ie[0]/2;if(n.y+=o,!Object.entries(k).filter((([t])=>!e.hasNode(t))).some((([,e])=>function(e,t,n=0){const o=t.x-n,a=t.y-n,i=t.width+2*n,r=t.height+2*n;return!(o+i<e.x||o>e.x+e.width||a+r<e.y||a>e.y+e.height)}(n,e,Eo))))for(const a of t)k[a].y+=o}));const E=Object.entries(k).map((([e,t])=>({id:e,boundingBox:t}))),z=h(E.map((e=>e.boundingBox))),N=z.x-m.x,C=z.y-m.y,T=t.filter((e=>e.data.type===bt)).map((e=>n(e.id))).filter(rt).map((e=>{const t=p(e),n=d.filter((t=>function(e,t){const n=t.x+t.width,o=t.y+t.height,a=e.x+e.width,i=e.y+e.height;return t.x>=e.x&&t.y>=e.y&&n<=a&&o<=i}(p(e),p(t))));if(0===n.length)return null;const o=h(E.filter((e=>n.some((t=>t.id===e.id)))).map((({boundingBox:e})=>e)));return{id:e.id,boundingBox:{x:f(o,t),y:o.y+o.height-t.height+To,height:t.height,width:t.width}}})).filter(rt);return{boundingBox:z,nodes:E.concat(T).map((({id:e,boundingBox:t})=>({id:e,x:t.x-N,y:t.y-C})))}}}}function Vr(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new qr(o)}function qr(e){this._=e}function Hr(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",o=e.indexOf(".");if(o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function Fr(e,t){for(var n,o=0,a=e.length;o<a;++o)if((n=e[o]).name===t)return n.value}function Wr(e,t,n){for(var o=0,a=e.length;o<a;++o)if(e[o].name===t){e[o]=Mo,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}function Yr(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Oo.hasOwnProperty(t)?{space:Oo[t],local:e}:e}function Xr(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Io&&t.documentElement.namespaceURI===Io?t.createElement(e):t.createElementNS(n,e)}}function Ur(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gr(e){var t=Yr(e);return(t.local?Ur:Xr)(t)}function Zr(){}function Kr(e){return null==e?Zr:function(){return this.querySelector(e)}}function Qr(e){"function"!=typeof e&&(e=Kr(e));for(var t=this._groups,n=t.length,o=new Array(n),a=0;a<n;++a)for(var i,r,s=t[a],l=s.length,u=o[a]=new Array(l),d=0;d<l;++d)(i=s[d])&&(r=e.call(i,i.__data__,d,s))&&("__data__"in i&&(r.__data__=i.__data__),u[d]=r);return new $l(o,this._parents)}function Jr(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function es(){return[]}function ts(e){return null==e?es:function(){return this.querySelectorAll(e)}}function ns(e){e="function"==typeof e?function(e){return function(){return Jr(e.apply(this,arguments))}}(e):ts(e);for(var t=this._groups,n=t.length,o=[],a=[],i=0;i<n;++i)for(var r,s=t[i],l=s.length,u=0;u<l;++u)(r=s[u])&&(o.push(e.call(r,r.__data__,u,s)),a.push(r));return new $l(o,a)}function os(e){return function(){return this.matches(e)}}function as(e){return function(t){return t.matches(e)}}function is(){return this.firstElementChild}function rs(e){return this.select(null==e?is:function(e){return function(){return So.call(this.children,e)}}("function"==typeof e?e:as(e)))}function ss(){return Array.from(this.children)}function ls(e){return this.selectAll(null==e?ss:function(e){return function(){return $o.call(this.children,e)}}("function"==typeof e?e:as(e)))}function us(e){"function"!=typeof e&&(e=os(e));for(var t=this._groups,n=t.length,o=new Array(n),a=0;a<n;++a)for(var i,r=t[a],s=r.length,l=o[a]=[],u=0;u<s;++u)(i=r[u])&&e.call(i,i.__data__,u,r)&&l.push(i);return new $l(o,this._parents)}function ds(e){return new Array(e.length)}function cs(){return new $l(this._enter||this._groups.map(ds),this._parents)}function hs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ps(e){return function(){return e}}function vs(e,t,n,o,a,i){for(var r,s=0,l=t.length,u=i.length;s<u;++s)(r=t[s])?(r.__data__=i[s],o[s]=r):n[s]=new hs(e,i[s]);for(;s<l;++s)(r=t[s])&&(a[s]=r)}function fs(e,t,n,o,a,i,r){var s,l,u,d=new Map,c=t.length,h=i.length,p=new Array(c);for(s=0;s<c;++s)(l=t[s])&&(p[s]=u=r.call(l,l.__data__,s,t)+"",d.has(u)?a[s]=l:d.set(u,l));for(s=0;s<h;++s)u=r.call(e,i[s],s,i)+"",(l=d.get(u))?(o[s]=l,l.__data__=i[s],d.delete(u)):n[s]=new hs(e,i[s]);for(s=0;s<c;++s)(l=t[s])&&d.get(p[s])===l&&(a[s]=l)}function gs(e){return e.__data__}function _s(e,t){if(!arguments.length)return Array.from(this,gs);var n=t?fs:vs,o=this._parents,a=this._groups;"function"!=typeof e&&(e=ps(e));for(var i=a.length,r=new Array(i),s=new Array(i),l=new Array(i),u=0;u<i;++u){var d=o[u],c=a[u],h=c.length,p=ms(e.call(d,d&&d.__data__,u,o)),v=p.length,f=s[u]=new Array(v),g=r[u]=new Array(v);n(d,c,f,g,l[u]=new Array(h),p,t);for(var _,m,y=0,b=0;y<v;++y)if(_=f[y]){for(y>=b&&(b=y+1);!(m=g[b])&&++b<v;);_._next=m||null}}return(r=new $l(r,o))._enter=s,r._exit=l,r}function ms(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function ys(){return new $l(this._exit||this._groups.map(ds),this._parents)}function bs(e,t,n){var o=this.enter(),a=this,i=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(a=t(a))&&(a=a.selection()),null==n?i.remove():n(i),o&&a?o.merge(a).order():a}function ws(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,a=n.length,i=o.length,r=Math.min(a,i),s=new Array(a),l=0;l<r;++l)for(var u,d=n[l],c=o[l],h=d.length,p=s[l]=new Array(h),v=0;v<h;++v)(u=d[v]||c[v])&&(p[v]=u);for(;l<a;++l)s[l]=n[l];return new $l(s,this._parents)}function xs(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,a=e[t],i=a.length-1,r=a[i];--i>=0;)(o=a[i])&&(r&&4^o.compareDocumentPosition(r)&&r.parentNode.insertBefore(o,r),r=o);return this}function ks(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Es);for(var n=this._groups,o=n.length,a=new Array(o),i=0;i<o;++i){for(var r,s=n[i],l=s.length,u=a[i]=new Array(l),d=0;d<l;++d)(r=s[d])&&(u[d]=r);u.sort(t)}return new $l(a,this._parents).order()}function Es(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function zs(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ns(){return Array.from(this)}function Cs(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],a=0,i=o.length;a<i;++a){var r=o[a];if(r)return r}return null}function Ts(){let e=0;for(const t of this)++e;return e}function Ms(){return!this.node()}function Is(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var a,i=t[n],r=0,s=i.length;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function Os(e){return function(){this.removeAttribute(e)}}function Ss(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $s(e,t){return function(){this.setAttribute(e,t)}}function As(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Bs(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function js(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ds(e,t){var n=Yr(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?Ss:Os:"function"==typeof t?n.local?js:Bs:n.local?As:$s)(n,t))}function Rs(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ls(e){return function(){this.style.removeProperty(e)}}function Ps(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Vs(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function qs(e,t,n){return arguments.length>1?this.each((null==t?Ls:"function"==typeof t?Vs:Ps)(e,t,null==n?"":n)):Hs(this.node(),e)}function Hs(e,t){return e.style.getPropertyValue(t)||Rs(e).getComputedStyle(e,null).getPropertyValue(t)}function Fs(e){return function(){delete this[e]}}function Ws(e,t){return function(){this[e]=t}}function Ys(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Xs(e,t){return arguments.length>1?this.each((null==t?Fs:"function"==typeof t?Ys:Ws)(e,t)):this.node()[e]}function Us(e){return e.trim().split(/^|\s+/)}function Gs(e){return e.classList||new Zs(e)}function Zs(e){this._node=e,this._names=Us(e.getAttribute("class")||"")}function Ks(e,t){for(var n=Gs(e),o=-1,a=t.length;++o<a;)n.add(t[o])}function Qs(e,t){for(var n=Gs(e),o=-1,a=t.length;++o<a;)n.remove(t[o])}function Js(e){return function(){Ks(this,e)}}function el(e){return function(){Qs(this,e)}}function tl(e,t){return function(){(t.apply(this,arguments)?Ks:Qs)(this,e)}}function nl(e,t){var n=Us(e+"");if(arguments.length<2){for(var o=Gs(this.node()),a=-1,i=n.length;++a<i;)if(!o.contains(n[a]))return!1;return!0}return this.each(("function"==typeof t?tl:t?Js:el)(n,t))}function ol(){this.textContent=""}function al(e){return function(){this.textContent=e}}function il(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function rl(e){return arguments.length?this.each(null==e?ol:("function"==typeof e?il:al)(e)):this.node().textContent}function sl(){this.innerHTML=""}function ll(e){return function(){this.innerHTML=e}}function ul(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function dl(e){return arguments.length?this.each(null==e?sl:("function"==typeof e?ul:ll)(e)):this.node().innerHTML}function cl(){this.nextSibling&&this.parentNode.appendChild(this)}function hl(){return this.each(cl)}function pl(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vl(){return this.each(pl)}function fl(e){var t="function"==typeof e?e:Gr(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))}function gl(){return null}function _l(e,t){var n="function"==typeof e?e:Gr(e),o=null==t?gl:"function"==typeof t?t:Kr(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))}function ml(){var e=this.parentNode;e&&e.removeChild(this)}function yl(){return this.each(ml)}function bl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wl(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xl(e){return this.select(e?wl:bl)}function kl(e){return arguments.length?this.property("__data__",e):this.node().__data__}function El(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function zl(e){return function(){var t=this.__on;if(t){for(var n,o=0,a=-1,i=t.length;o<i;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++a]=n:this.removeEventListener(n.type,n.listener,n.options);++a?t.length=a:delete this.__on}}}function Nl(e,t,n){return function(){var o,a=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(a)for(var r=0,s=a.length;r<s;++r)if((o=a[r]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=t);this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},a?a.push(o):this.__on=[o]}}function Cl(e,t,n){var o,a,i=El(e+""),r=i.length;if(!(arguments.length<2)){for(s=t?Nl:zl,o=0;o<r;++o)this.each(s(i[o],t,n));return this}var s=this.node().__on;if(s)for(var l,u=0,d=s.length;u<d;++u)for(o=0,l=s[u];o<r;++o)if((a=i[o]).type===l.type&&a.name===l.name)return l.value}function Tl(e,t,n){var o=Rs(e),a=o.CustomEvent;"function"==typeof a?a=new a(t,n):(a=o.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function Ml(e,t){return function(){return Tl(this,e,t)}}function Il(e,t){return function(){return Tl(this,e,t.apply(this,arguments))}}function Ol(e,t){return this.each(("function"==typeof t?Il:Ml)(e,t))}function*Sl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,a=e[t],i=0,r=a.length;i<r;++i)(o=a[i])&&(yield o)}function $l(e,t){this._groups=e,this._parents=t}function Al(){return new $l([[document.documentElement]],Ao)}function Bl(){return this}function jl(e){return"string"==typeof e?new $l([[document.querySelector(e)]],[document.documentElement]):new $l([[e]],Ao)}function Dl(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}function Rl(e){e.preventDefault(),e.stopImmediatePropagation()}function Ll(e){var t=e.document.documentElement,n=jl(e).on("dragstart.drag",Rl,Bo);"onselectstart"in t?n.on("selectstart.drag",Rl,Bo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Pl(e,t){var n=e.document.documentElement,o=jl(e).on("dragstart.drag",null);t&&(o.on("click.drag",Rl,Bo),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Vl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ql(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Hl(){}function Fl(){return this.rgb().formatHex()}function Wl(){return this.rgb().formatHex8()}function Yl(){return su(this).formatHsl()}function Xl(){return this.rgb().formatRgb()}function Ul(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Vo.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Gl(t):3===n?new Jl(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Zl(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Zl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=qo.exec(e))?new Jl(t[1],t[2],t[3],1):(t=Ho.exec(e))?new Jl(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Fo.exec(e))?Zl(t[1],t[2],t[3],t[4]):(t=Wo.exec(e))?Zl(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Yo.exec(e))?ru(t[1],t[2]/100,t[3]/100,1):(t=Xo.exec(e))?ru(t[1],t[2]/100,t[3]/100,t[4]):Uo.hasOwnProperty(e)?Gl(Uo[e]):"transparent"===e?new Jl(NaN,NaN,NaN,0):null}function Gl(e){return new Jl(e>>16&255,e>>8&255,255&e,1)}function Zl(e,t,n,o){return o<=0&&(e=t=n=NaN),new Jl(e,t,n,o)}function Kl(e){return e instanceof Hl||(e=Ul(e)),e?new Jl((e=e.rgb()).r,e.g,e.b,e.opacity):new Jl}function Ql(e,t,n,o){return 1===arguments.length?Kl(e):new Jl(e,t,n,null==o?1:o)}function Jl(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function eu(){return`#${iu(this.r)}${iu(this.g)}${iu(this.b)}`}function tu(){return`#${iu(this.r)}${iu(this.g)}${iu(this.b)}${iu(255*(isNaN(this.opacity)?1:this.opacity))}`}function nu(){const e=ou(this.opacity);return`${1===e?"rgb(":"rgba("}${au(this.r)}, ${au(this.g)}, ${au(this.b)}${1===e?")":`, ${e})`}`}function ou(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function au(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function iu(e){return((e=au(e))<16?"0":"")+e.toString(16)}function ru(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new uu(e,t,n,o)}function su(e){if(e instanceof uu)return new uu(e.h,e.s,e.l,e.opacity);if(e instanceof Hl||(e=Ul(e)),!e)return new uu;if(e instanceof uu)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,a=Math.min(t,n,o),i=Math.max(t,n,o),r=NaN,s=i-a,l=(i+a)/2;return s?(r=t===i?(n-o)/s+6*(n<o):n===i?(o-t)/s+2:(t-n)/s+4,s/=l<.5?i+a:2-i-a,r*=60):s=l>0&&l<1?0:r,new uu(r,s,l,e.opacity)}function lu(e,t,n,o){return 1===arguments.length?su(e):new uu(e,t,n,null==o?1:o)}function uu(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function du(e){return(e=(e||0)%360)<0?e+360:e}function cu(e){return Math.max(0,Math.min(1,e||0))}function hu(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function pu(e){return 1==(e=+e)?vu:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Go(isNaN(t)?n:t)}}function vu(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Go(isNaN(e)?t:e)}function fu(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gu(e,t){var n,o,a,i=Ko.lastIndex=Qo.lastIndex=0,r=-1,s=[],l=[];for(e+="",t+="";(n=Ko.exec(e))&&(o=Qo.exec(t));)(a=o.index)>i&&(a=t.slice(i,a),s[r]?s[r]+=a:s[++r]=a),(n=n[0])===(o=o[0])?s[r]?s[r]+=o:s[++r]=o:(s[++r]=null,l.push({i:r,x:fu(n,o)})),i=Qo.lastIndex;return i<t.length&&(a=t.slice(i),s[r]?s[r]+=a:s[++r]=a),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}function _u(e,t,n,o,a,i){var r,s,l;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,r=-r),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*Jo,skewX:Math.atan(l)*Jo,scaleX:r,scaleY:s}}function mu(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ea:_u(t.a,t.b,t.c,t.d,t.e,t.f)}function yu(e){return null==e?ea:(ta||(ta=document.createElementNS("http://www.w3.org/2000/svg","g")),ta.setAttribute("transform",e),(e=ta.transform.baseVal.consolidate())?_u((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ea)}function bu(e,t,n,o){function a(e){return e.length?e.pop()+" ":""}return function(i,r){var s=[],l=[];return i=e(i),r=e(r),function(e,o,a,i,r,s){if(e!==a||o!==i){var l=r.push("translate(",null,t,null,n);s.push({i:l-4,x:fu(e,a)},{i:l-2,x:fu(o,i)})}else(a||i)&&r.push("translate("+a+t+i+n)}(i.translateX,i.translateY,r.translateX,r.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(a(n)+"rotate(",null,o)-2,x:fu(e,t)})):t&&n.push(a(n)+"rotate("+t+o)}(i.rotate,r.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(a(n)+"skewX(",null,o)-2,x:fu(e,t)}):t&&n.push(a(n)+"skewX("+t+o)}(i.skewX,r.skewX,s,l),function(e,t,n,o,i,r){if(e!==n||t!==o){var s=i.push(a(i)+"scale(",null,",",null,")");r.push({i:s-4,x:fu(e,n)},{i:s-2,x:fu(t,o)})}else 1===n&&1===o||i.push(a(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,r.scaleX,r.scaleY,s,l),i=r=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}function wu(e){return((e=Math.exp(e))+1/e)/2}function xu(){return ha||(fa(ku),ha=va.now()+pa)}function ku(){ha=0}function Eu(){this._call=this._time=this._next=null}function zu(e,t,n){var o=new Eu;return o.restart(e,t,n),o}function Nu(){ha=(ca=va.now())+pa,ia=ra=0;try{!function(){xu(),++ia;for(var e,t=ua;t;)(e=ha-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ia}()}finally{ia=0,function(){for(var e,t,n=ua,o=1/0;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ua=t);da=e,Tu(o)}(),ha=0}}function Cu(){var e=va.now(),t=e-ca;t>la&&(pa-=t,ca=e)}function Tu(e){ia||(ra&&(ra=clearTimeout(ra)),e-ha>24?(e<1/0&&(ra=setTimeout(Nu,e-va.now()-pa)),sa&&(sa=clearInterval(sa))):(sa||(ca=va.now(),sa=setInterval(Cu,la)),ia=1,fa(Nu)))}function Mu(e,t,n){var o=new Eu;return t=null==t?0:+t,o.restart((n=>{o.stop(),e(n+t)}),t,n),o}function Iu(e,t,n,o,a,i){var r=e.__transition;if(r){if(n in r)return}else e.__transition={};!function(e,t,n){var o,a=e.__transition;function i(e){n.state=ya,n.timer.restart(r,n.delay,n.time),n.delay<=e&&r(e-n.delay)}function r(i){var u,d,c,h;if(n.state!==ya)return l();for(u in a)if((h=a[u]).name===n.name){if(h.state===wa)return Mu(r);h.state===xa?(h.state=Ea,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete a[u]):+u<t&&(h.state=Ea,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete a[u])}if(Mu((function(){n.state===wa&&(n.state=xa,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=ba,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ba){for(n.state=wa,o=new Array(c=n.tween.length),u=0,d=-1;u<c;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=h);o.length=d+1}}function s(t){for(var a=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=ka,1),i=-1,r=o.length;++i<r;)o[i].call(e,a);n.state===ka&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var o in n.state=Ea,n.timer.stop(),delete a[t],a)return;delete e.__transition}a[t]=n,n.timer=zu(i,0,n.time)}(e,n,{name:t,index:o,group:a,on:ga,tween:_a,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ma})}function Ou(e,t){var n=$u(e,t);if(n.state>ma)throw new Error("too late; already scheduled");return n}function Su(e,t){var n=$u(e,t);if(n.state>wa)throw new Error("too late; already running");return n}function $u(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Au(e,t){var n,o,a,i=e.__transition,r=!0;if(i){for(a in t=null==t?null:t+"",i)(n=i[a]).name===t?(o=n.state>ba&&n.state<ka,n.state=Ea,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[a]):r=!1;r&&delete e.__transition}}function Bu(e){return this.each((function(){Au(this,e)}))}function ju(e,t){var n,o;return function(){var a=Su(this,e),i=a.tween;if(i!==n)for(var r=0,s=(o=n=i).length;r<s;++r)if(o[r].name===t){(o=o.slice()).splice(r,1);break}a.tween=o}}function Du(e,t,n){var o,a;if("function"!=typeof n)throw new Error;return function(){var i=Su(this,e),r=i.tween;if(r!==o){a=(o=r).slice();for(var s={name:t,value:n},l=0,u=a.length;l<u;++l)if(a[l].name===t){a[l]=s;break}l===u&&a.push(s)}i.tween=a}}function Ru(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,a=$u(this.node(),n).tween,i=0,r=a.length;i<r;++i)if((o=a[i]).name===e)return o.value;return null}return this.each((null==t?ju:Du)(n,e,t))}function Lu(e,t,n){var o=e._id;return e.each((function(){var e=Su(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return $u(e,o).value[t]}}function Pu(e,t){var n;return("number"==typeof t?fu:t instanceof Ul?Zo:(n=Ul(t))?(t=n,Zo):gu)(e,t)}function Vu(e){return function(){this.removeAttribute(e)}}function qu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hu(e,t,n){var o,a,i=n+"";return function(){var r=this.getAttribute(e);return r===i?null:r===o?a:a=t(o=r,n)}}function Fu(e,t,n){var o,a,i=n+"";return function(){var r=this.getAttributeNS(e.space,e.local);return r===i?null:r===o?a:a=t(o=r,n)}}function Wu(e,t,n){var o,a,i;return function(){var r,s,l=n(this);if(null!=l)return(r=this.getAttribute(e))===(s=l+"")?null:r===o&&s===a?i:(a=s,i=t(o=r,l));this.removeAttribute(e)}}function Yu(e,t,n){var o,a,i;return function(){var r,s,l=n(this);if(null!=l)return(r=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:r===o&&s===a?i:(a=s,i=t(o=r,l));this.removeAttributeNS(e.space,e.local)}}function Xu(e,t){var n=Yr(e),o="transform"===n?oa:Pu;return this.attrTween(e,"function"==typeof t?(n.local?Yu:Wu)(n,o,Lu(this,"attr."+e,t)):null==t?(n.local?qu:Vu)(n):(n.local?Fu:Hu)(n,o,t))}function Uu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Gu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Zu(e,t){var n,o;function a(){var a=t.apply(this,arguments);return a!==o&&(n=(o=a)&&Gu(e,a)),n}return a._value=t,a}function Ku(e,t){var n,o;function a(){var a=t.apply(this,arguments);return a!==o&&(n=(o=a)&&Uu(e,a)),n}return a._value=t,a}function Qu(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=Yr(e);return this.tween(n,(o.local?Zu:Ku)(o,t))}function Ju(e,t){return function(){Ou(this,e).delay=+t.apply(this,arguments)}}function ed(e,t){return t=+t,function(){Ou(this,e).delay=t}}function td(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Ju:ed)(t,e)):$u(this.node(),t).delay}function nd(e,t){return function(){Su(this,e).duration=+t.apply(this,arguments)}}function od(e,t){return t=+t,function(){Su(this,e).duration=t}}function ad(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?nd:od)(t,e)):$u(this.node(),t).duration}function id(e,t){if("function"!=typeof t)throw new Error;return function(){Su(this,e).ease=t}}function rd(e){var t=this._id;return arguments.length?this.each(id(t,e)):$u(this.node(),t).ease}function sd(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Su(this,e).ease=n}}(this._id,e))}function ld(e){"function"!=typeof e&&(e=os(e));for(var t=this._groups,n=t.length,o=new Array(n),a=0;a<n;++a)for(var i,r=t[a],s=r.length,l=o[a]=[],u=0;u<s;++u)(i=r[u])&&e.call(i,i.__data__,u,r)&&l.push(i);return new Cd(o,this._parents,this._name,this._id)}function ud(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,a=n.length,i=Math.min(o,a),r=new Array(o),s=0;s<i;++s)for(var l,u=t[s],d=n[s],c=u.length,h=r[s]=new Array(c),p=0;p<c;++p)(l=u[p]||d[p])&&(h[p]=l);for(;s<o;++s)r[s]=t[s];return new Cd(r,this._parents,this._name,this._id)}function dd(e,t,n){var o,a,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?Ou:Su;return function(){var r=i(this,e),s=r.on;s!==o&&(a=(o=s).copy()).on(t,n),r.on=a}}function cd(e,t){var n=this._id;return arguments.length<2?$u(this.node(),n).on.on(e):this.each(dd(n,e,t))}function hd(){return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}));var e}function pd(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Kr(e));for(var o=this._groups,a=o.length,i=new Array(a),r=0;r<a;++r)for(var s,l,u=o[r],d=u.length,c=i[r]=new Array(d),h=0;h<d;++h)(s=u[h])&&(l=e.call(s,s.__data__,h,u))&&("__data__"in s&&(l.__data__=s.__data__),c[h]=l,Iu(c[h],t,n,h,c,$u(s,n)));return new Cd(i,this._parents,t,n)}function vd(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ts(e));for(var o=this._groups,a=o.length,i=[],r=[],s=0;s<a;++s)for(var l,u=o[s],d=u.length,c=0;c<d;++c)if(l=u[c]){for(var h,p=e.call(l,l.__data__,c,u),v=$u(l,n),f=0,g=p.length;f<g;++f)(h=p[f])&&Iu(h,t,n,f,p,v);i.push(p),r.push(l)}return new Cd(i,r,t,n)}function fd(){return new za(this._groups,this._parents)}function gd(e){return function(){this.style.removeProperty(e)}}function _d(e,t,n){var o="transform"==(e+="")?na:Pu;return null==t?this.styleTween(e,function(e,t){var n,o,a;return function(){var i=Hs(this,e),r=(this.style.removeProperty(e),Hs(this,e));return i===r?null:i===n&&r===o?a:a=t(n=i,o=r)}}(e,o)).on("end.style."+e,gd(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,a,i;return function(){var r=Hs(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Hs(this,e)),r===l?null:r===o&&l===a?i:(a=l,i=t(o=r,s))}}(e,o,Lu(this,"style."+e,t))).each(function(e,t){var n,o,a,i,r="style."+t,s="end."+r;return function(){var l=Su(this,e),u=l.on,d=null==l.value[r]?i||(i=gd(t)):void 0;u===n&&a===d||(o=(n=u).copy()).on(s,a=d),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,a,i=n+"";return function(){var r=Hs(this,e);return r===i?null:r===o?a:a=t(o=r,n)}}(e,o,t),n).on("end.style."+e,null)}function md(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function yd(e,t,n){var o,a;function i(){var i=t.apply(this,arguments);return i!==a&&(o=(a=i)&&md(e,i,n)),o}return i._value=t,i}function bd(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,yd(e,t,null==n?"":n))}function wd(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Lu(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))}function xd(e){return function(t){this.textContent=e.call(this,t)}}function kd(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&xd(o)),t}return o._value=e,o}function Ed(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,kd(e))}function zd(){for(var e=this._name,t=this._id,n=Td(),o=this._groups,a=o.length,i=0;i<a;++i)for(var r,s=o[i],l=s.length,u=0;u<l;++u)if(r=s[u]){var d=$u(r,t);Iu(r,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Cd(o,this._parents,e,n)}function Nd(){var e,t,n=this,o=n._id,a=n.size();return new Promise((function(i,r){var s={value:r},l={value:function(){0==--a&&i()}};n.each((function(){var n=Su(this,o),a=n.on;a!==e&&((t=(e=a).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t})),0===a&&i()}))}function Cd(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Td(){return++Na}function Md(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function Id(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 Od(e){var t,n;e instanceof Cd?(t=e._id,e=e._name):(t=Td(),(n=Ta).time=xu(),e=null==e?null:e+"");for(var o=this._groups,a=o.length,i=0;i<a;++i)for(var r,s=o[i],l=s.length,u=0;u<l;++u)(r=s[u])&&Iu(r,e,t,u,s,n||Id(r,t));return new Cd(o,this._parents,e,t)}function Sd(e,{sourceEvent:t,target:n,transform:o,dispatch:a}){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:o,enumerable:!0,configurable:!0},_:{value:a}})}function $d(e,t,n){this.k=e,this.x=t,this.y=n}function Ad(e){e.stopImmediatePropagation()}function Bd(e){e.preventDefault(),e.stopImmediatePropagation()}function jd(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Dd(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 Rd(){return this.__zoom||Ia}function Ld(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Pd(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vd(e,t,n){var o=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],r=e.invertY(t[1][1])-n[1][1];return e.translate(a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a),r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r))}function qd(e,{connectionType:t=xt.Main}={}){const{targetX:n,targetY:o,sourceX:a,sourceY:i,sourcePosition:r,targetPosition:s}=e,l=i===o;if(!Ha(a,n)||t!==xt.Main){const t=st(e);return{segments:[t],labelPosition:[t[1],t[2]],isConnectorStraight:l}}const u=(a+n)/2,d=i+Pa;return{segments:[Ce({sourceX:a,sourceY:i,targetX:u,targetY:d,sourcePosition:r,targetPosition:Ye.Right,borderRadius:qa,offset:Va}),Ce({sourceX:u,sourceY:d,targetX:n,targetY:o,sourcePosition:Ye.Left,targetPosition:s,borderRadius:qa,offset:Va})],labelPosition:[u,d],isConnectorStraight:l}}function Hd(){return en(Et)}function Fd(e,t){return a(),l("svg",Wa,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M1.6.13c-.18-.17-.47-.18-.62 0L.56.57.14.98c-.2.15-.18.44 0 .62l3.63 3.6c.1.1.1.27 0 .37-.2.2-.53.52-.93.94-.56.57-.12 1.62.22 2.11.05.07.12.1.2.1.05-.01.1-.04.15-.08l5.23-5.22c.1-.1.1-.26-.02-.34-.5-.34-1.55-.78-2.12-.22-.42.4-.75.73-.94.93-.1.1-.27.1-.37 0L1.6.13ZM9.5 3.9c.07-.09.2-.1.3-.04l6.07 3.44c.15.08.18.29.05.4l-1.21 1.22a.26.26 0 0 1-.26.07l-2.18-.64a.26.26 0 0 0-.32.33l.76 2.02c.04.1.01.2-.06.27L7.7 15.92a.26.26 0 0 1-.41-.05L3.83 9.8a.26.26 0 0 1 .04-.3l5.62-5.6Z"},null,-1)])])}function Wd(e,t,n,o,i,r){return a(),l("button",Ua,[$(e.$slots,"default")])}function Yd(e,t){return a(),l("svg",Za,Ka)}function Xd(e,t){return a(),l("svg",Ja,ei)}function Ud(e,t){return a(),l("svg",ni,oi)}function Gd(e,t){return a(),l("svg",ii,ri)}function Zd(e,t){return a(),l("svg",li,ui)}function Kd(e){function t(e,t,n,o=.2,a=2.2){if(e>=1)return t;if(e<=o)return n;{const i=(1-e)/(1-o);return t+Math.pow(i,a)*(n-t)}}return{calculateZoomAdjustedValue:t,calculateEdgeLightness:function(n=d(!1)){return g((()=>{const o=e.value.zoom;let a=t(o,.84,.6),i=t(o,.42,.66);return n.value&&(a=Math.max(0,a-.3),i=Math.min(1,i+.2)),{light:a.toFixed(3),dark:i.toFixed(3)}}))},calculateHandleLightness:function(){return g((()=>{const n=e.value.zoom,o=t(n,.68,.3),a=t(n,.5,.7);return{light:o.toFixed(3),dark:a.toFixed(3)}}))},calculateNodeBorderOpacity:function(){return g((()=>{const n=e.value.zoom,o=t(n,.1,.7),a=t(n,.2,.7);return{light:o.toFixed(3),dark:a.toFixed(3)}}))}}}function Qd(){const e=f(Ot),t=g((()=>e?.data.value??{id:"",name:"",subtitle:"",type:"",typeVersion:1,disabled:!1,inputs:[],outputs:[],connections:{[ut.Input]:{},[ut.Output]:{}},issues:{execution:[],validation:[],visible:!1},pinnedData:{count:0,visible:!1},execution:{running:!1},runData:{iterations:0,outputMap:{},visible:!1},render:{type:Me.Default,options:{}}})),n=g((()=>e?.id.value??"")),o=g((()=>e?.label.value??"")),a=g((()=>t.value.subtitle)),i=g((()=>t.value.name)),r=g((()=>t.value.inputs)),s=g((()=>t.value.outputs)),l=g((()=>t.value.connections)),u=g((()=>t.value.disabled)),d=g((()=>e?.readOnly.value)),c=g((()=>e?.selected.value)),h=g((()=>t.value.pinnedData.count)),p=g((()=>t.value.pinnedData.count>0)),v=g((()=>[...t.value.issues.execution,...t.value.issues.validation])),_=g((()=>t.value.issues.execution??[])),m=g((()=>t.value.issues.validation??[])),y=g((()=>t.value.issues.visible)),b=g((()=>t.value.issues.execution.length>0)),w=g((()=>t.value.issues.validation.length>0)),x=g((()=>t.value.execution.status)),k=g((()=>t.value.execution.waiting)),E=g((()=>t.value.execution.waitingForNext)),z=g((()=>t.value.execution.running)),N=g((()=>t.value.runData.outputMap));return{node:e,id:n,name:i,label:o,subtitle:a,inputs:r,outputs:s,connections:l,isDisabled:u,isReadOnly:d,isSelected:c,pinnedDataCount:h,hasPinnedData:p,runDataIterations:g((()=>t.value.runData.iterations)),runDataOutputMap:N,hasRunData:g((()=>t.value.runData.visible)),issues:v,executionErrors:_,validationErrors:m,hasIssues:y,hasExecutionErrors:b,hasValidationErrors:w,executionStatus:x,executionWaiting:k,executionWaitingForNext:E,executionRunning:z,render:g((()=>t.value.render)),eventBus:g((()=>e?.eventBus.value)),isNotInstalledCommunityNode:g((()=>ht(t.value.type)&&!at().getIsNodeInstalled(t.value.type)))}}function Jd({inputs:e,outputs:t,connections:n}){const o=g((()=>w(e).filter((e=>e.type===xt.Main)))),a=g((()=>w(e).filter((e=>e.type!==xt.Main)))),i=g((()=>a.value.filter((e=>e.required)))),r=g((()=>w(n)[ut.Input][xt.Main]??[])),s=g((()=>w(t).filter((e=>e.type===xt.Main)))),l=g((()=>w(t).filter((e=>e.type!==xt.Main)))),u=g((()=>w(n)[ut.Output][xt.Main]??[]));return{mainInputs:o,nonMainInputs:a,requiredNonMainInputs:i,mainInputConnections:r,mainOutputs:s,nonMainOutputs:l,mainOutputConnections:u,isValidConnection:function(e){const{type:t,mode:n}=Rt(e.sourceHandle),{type:o,mode:a}=Rt(e.targetHandle);return!(n===a)&&t===o}}}function ec(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Gi.hasOwnProperty(t)?{space:Gi[t],local:e}:e}function tc(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ui&&t.documentElement.namespaceURI===Ui?t.createElement(e):t.createElementNS(n,e)}}function nc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function oc(e){var t=ec(e);return(t.local?nc:tc)(t)}function ac(){}function ic(e){return null==e?ac:function(){return this.querySelector(e)}}function rc(e){"function"!=typeof e&&(e=ic(e));for(var t=this._groups,n=t.length,o=new Array(n),a=0;a<n;++a)for(var i,r,s=t[a],l=s.length,u=o[a]=new Array(l),d=0;d<l;++d)(i=s[d])&&(r=e.call(i,i.__data__,d,s))&&("__data__"in i&&(r.__data__=i.__data__),u[d]=r);return new Lh(o,this._parents)}function sc(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function lc(){return[]}function uc(e){var t;e="function"==typeof e?function(e){return function(){return sc(e.apply(this,arguments))}}(e):null==(t=e)?lc:function(){return this.querySelectorAll(t)};for(var n=this._groups,o=n.length,a=[],i=[],r=0;r<o;++r)for(var s,l=n[r],u=l.length,d=0;d<u;++d)(s=l[d])&&(a.push(e.call(s,s.__data__,d,l)),i.push(s));return new Lh(a,i)}function dc(e){return function(t){return t.matches(e)}}function cc(){return this.firstElementChild}function hc(e){return this.select(null==e?cc:function(e){return function(){return Zi.call(this.children,e)}}("function"==typeof e?e:dc(e)))}function pc(){return Array.from(this.children)}function vc(e){return this.selectAll(null==e?pc:function(e){return function(){return Ki.call(this.children,e)}}("function"==typeof e?e:dc(e)))}function fc(e){var t;"function"!=typeof e&&(t=e,e=function(){return this.matches(t)});for(var n=this._groups,o=n.length,a=new Array(o),i=0;i<o;++i)for(var r,s=n[i],l=s.length,u=a[i]=[],d=0;d<l;++d)(r=s[d])&&e.call(r,r.__data__,d,s)&&u.push(r);return new Lh(a,this._parents)}function gc(e){return new Array(e.length)}function _c(){return new Lh(this._enter||this._groups.map(gc),this._parents)}function mc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function yc(e){return function(){return e}}function bc(e,t,n,o,a,i){for(var r,s=0,l=t.length,u=i.length;s<u;++s)(r=t[s])?(r.__data__=i[s],o[s]=r):n[s]=new mc(e,i[s]);for(;s<l;++s)(r=t[s])&&(a[s]=r)}function wc(e,t,n,o,a,i,r){var s,l,u,d=new Map,c=t.length,h=i.length,p=new Array(c);for(s=0;s<c;++s)(l=t[s])&&(p[s]=u=r.call(l,l.__data__,s,t)+"",d.has(u)?a[s]=l:d.set(u,l));for(s=0;s<h;++s)u=r.call(e,i[s],s,i)+"",(l=d.get(u))?(o[s]=l,l.__data__=i[s],d.delete(u)):n[s]=new mc(e,i[s]);for(s=0;s<c;++s)(l=t[s])&&d.get(p[s])===l&&(a[s]=l)}function xc(e){return e.__data__}function kc(e,t){if(!arguments.length)return Array.from(this,xc);var n=t?wc:bc,o=this._parents,a=this._groups;"function"!=typeof e&&(e=yc(e));for(var i=a.length,r=new Array(i),s=new Array(i),l=new Array(i),u=0;u<i;++u){var d=o[u],c=a[u],h=c.length,p=Ec(e.call(d,d&&d.__data__,u,o)),v=p.length,f=s[u]=new Array(v),g=r[u]=new Array(v);n(d,c,f,g,l[u]=new Array(h),p,t);for(var _,m,y=0,b=0;y<v;++y)if(_=f[y]){for(y>=b&&(b=y+1);!(m=g[b])&&++b<v;);_._next=m||null}}return(r=new Lh(r,o))._enter=s,r._exit=l,r}function Ec(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function zc(){return new Lh(this._exit||this._groups.map(gc),this._parents)}function Nc(e,t,n){var o=this.enter(),a=this,i=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(a=t(a))&&(a=a.selection()),null==n?i.remove():n(i),o&&a?o.merge(a).order():a}function Cc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,a=n.length,i=o.length,r=Math.min(a,i),s=new Array(a),l=0;l<r;++l)for(var u,d=n[l],c=o[l],h=d.length,p=s[l]=new Array(h),v=0;v<h;++v)(u=d[v]||c[v])&&(p[v]=u);for(;l<a;++l)s[l]=n[l];return new Lh(s,this._parents)}function Tc(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,a=e[t],i=a.length-1,r=a[i];--i>=0;)(o=a[i])&&(r&&4^o.compareDocumentPosition(r)&&r.parentNode.insertBefore(o,r),r=o);return this}function Mc(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Ic);for(var n=this._groups,o=n.length,a=new Array(o),i=0;i<o;++i){for(var r,s=n[i],l=s.length,u=a[i]=new Array(l),d=0;d<l;++d)(r=s[d])&&(u[d]=r);u.sort(t)}return new Lh(a,this._parents).order()}function Ic(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Oc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Sc(){return Array.from(this)}function $c(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],a=0,i=o.length;a<i;++a){var r=o[a];if(r)return r}return null}function Ac(){let e=0;for(const t of this)++e;return e}function Bc(){return!this.node()}function jc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var a,i=t[n],r=0,s=i.length;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function Dc(e){return function(){this.removeAttribute(e)}}function Rc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lc(e,t){return function(){this.setAttribute(e,t)}}function Pc(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Vc(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function qc(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Hc(e,t){var n=ec(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?Rc:Dc:"function"==typeof t?n.local?qc:Vc:n.local?Pc:Lc)(n,t))}function Fc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Wc(e){return function(){this.style.removeProperty(e)}}function Yc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Xc(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Uc(e,t,n){return arguments.length>1?this.each((null==t?Wc:"function"==typeof t?Xc:Yc)(e,t,null==n?"":n)):Gc(this.node(),e)}function Gc(e,t){return e.style.getPropertyValue(t)||Fc(e).getComputedStyle(e,null).getPropertyValue(t)}function Zc(e){return function(){delete this[e]}}function Kc(e,t){return function(){this[e]=t}}function Qc(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Jc(e,t){return arguments.length>1?this.each((null==t?Zc:"function"==typeof t?Qc:Kc)(e,t)):this.node()[e]}function eh(e){return e.trim().split(/^|\s+/)}function th(e){return e.classList||new nh(e)}function nh(e){this._node=e,this._names=eh(e.getAttribute("class")||"")}function oh(e,t){for(var n=th(e),o=-1,a=t.length;++o<a;)n.add(t[o])}function ah(e,t){for(var n=th(e),o=-1,a=t.length;++o<a;)n.remove(t[o])}function ih(e){return function(){oh(this,e)}}function rh(e){return function(){ah(this,e)}}function sh(e,t){return function(){(t.apply(this,arguments)?oh:ah)(this,e)}}function lh(e,t){var n=eh(e+"");if(arguments.length<2){for(var o=th(this.node()),a=-1,i=n.length;++a<i;)if(!o.contains(n[a]))return!1;return!0}return this.each(("function"==typeof t?sh:t?ih:rh)(n,t))}function uh(){this.textContent=""}function dh(e){return function(){this.textContent=e}}function ch(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function hh(e){return arguments.length?this.each(null==e?uh:("function"==typeof e?ch:dh)(e)):this.node().textContent}function ph(){this.innerHTML=""}function vh(e){return function(){this.innerHTML=e}}function fh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function gh(e){return arguments.length?this.each(null==e?ph:("function"==typeof e?fh:vh)(e)):this.node().innerHTML}function _h(){this.nextSibling&&this.parentNode.appendChild(this)}function mh(){return this.each(_h)}function yh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bh(){return this.each(yh)}function wh(e){var t="function"==typeof e?e:oc(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))}function xh(){return null}function kh(e,t){var n="function"==typeof e?e:oc(e),o=null==t?xh:"function"==typeof t?t:ic(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))}function Eh(){var e=this.parentNode;e&&e.removeChild(this)}function zh(){return this.each(Eh)}function Nh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ch(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Th(e){return this.select(e?Ch:Nh)}function Mh(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ih(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function Oh(e){return function(){var t=this.__on;if(t){for(var n,o=0,a=-1,i=t.length;o<i;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++a]=n:this.removeEventListener(n.type,n.listener,n.options);++a?t.length=a:delete this.__on}}}function Sh(e,t,n){return function(){var o,a=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(a)for(var r=0,s=a.length;r<s;++r)if((o=a[r]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=t);this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},a?a.push(o):this.__on=[o]}}function $h(e,t,n){var o,a,i=Ih(e+""),r=i.length;if(!(arguments.length<2)){for(s=t?Sh:Oh,o=0;o<r;++o)this.each(s(i[o],t,n));return this}var s=this.node().__on;if(s)for(var l,u=0,d=s.length;u<d;++u)for(o=0,l=s[u];o<r;++o)if((a=i[o]).type===l.type&&a.name===l.name)return l.value}function Ah(e,t,n){var o=Fc(e),a=o.CustomEvent;"function"==typeof a?a=new a(t,n):(a=o.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function Bh(e,t){return function(){return Ah(this,e,t)}}function jh(e,t){return function(){return Ah(this,e,t.apply(this,arguments))}}function Dh(e,t){return this.each(("function"==typeof t?jh:Bh)(e,t))}function*Rh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,a=e[t],i=0,r=a.length;i<r;++i)(o=a[i])&&(yield o)}function Lh(e,t){this._groups=e,this._parents=t}function Ph(){return this}function Vh(e){return"string"==typeof e?new Lh([[document.querySelector(e)]],[document.documentElement]):new Lh([[e]],Qi)}function qh(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}function Hh(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new Fh(o)}function Fh(e){this._=e}function Wh(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",o=e.indexOf(".");if(o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function Yh(e,t){for(var n,o=0,a=e.length;o<a;++o)if((n=e[o]).name===t)return n.value}function Xh(e,t,n){for(var o=0,a=e.length;o<a;++o)if(e[o].name===t){e[o]=Ji,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}function Uh(e){e.stopImmediatePropagation()}function Gh(e){e.preventDefault(),e.stopImmediatePropagation()}function Zh(e,{sourceEvent:t,subject:n,target:o,identifier:a,active:i,x:r,y:s,dx:l,dy:u,dispatch:d}){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:o,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}function Kh(e){return!e.ctrlKey&&!e.button}function Qh(){return this.parentNode}function Jh(e,t){return null==t?{x:e.x,y:e.y}:t}function ep(){return navigator.maxTouchPoints||"ontouchstart"in this}function tp(){var e,t,n,o,a=Kh,i=Qh,r=Jh,s=ep,l={},u=Hh("start","drag","end"),d=0,c=0;function h(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",_,er).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(r,s){if(!o&&a.call(this,r,s)){var l=y(this,i.call(this,r,s),r,s,"mouse");l&&(Vh(r.view).on("mousemove.drag",v,tr).on("mouseup.drag",f,tr),function(e){var t=e.document.documentElement,n=Vh(e).on("dragstart.drag",Gh,tr);"onselectstart"in t?n.on("selectstart.drag",Gh,tr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}(r.view),Uh(r),n=!1,e=r.clientX,t=r.clientY,l("start",r))}}function v(o){if(Gh(o),!n){var a=o.clientX-e,i=o.clientY-t;n=a*a+i*i>c}l.mouse("drag",o)}function f(e){Vh(e.view).on("mousemove.drag mouseup.drag",null),function(e,t){var n=e.document.documentElement,o=Vh(e).on("dragstart.drag",null);t&&(o.on("click.drag",Gh,tr),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(e.view,n),Gh(e),l.mouse("end",e)}function g(e,t){if(a.call(this,e,t)){var n,o,r=e.changedTouches,s=i.call(this,e,t),l=r.length;for(n=0;n<l;++n)(o=y(this,s,e,t,r[n].identifier,r[n]))&&(Uh(e),o("start",e,r[n]))}}function _(e){var t,n,o=e.changedTouches,a=o.length;for(t=0;t<a;++t)(n=l[o[t].identifier])&&(Gh(e),n("drag",e,o[t]))}function m(e){var t,n,a=e.changedTouches,i=a.length;for(o&&clearTimeout(o),o=setTimeout((function(){o=null}),500),t=0;t<i;++t)(n=l[a[t].identifier])&&(Uh(e),n("end",e,a[t]))}function y(e,t,n,o,a,i){var s,c,p,v=u.copy(),f=qh(i||n,t);if(null!=(p=r.call(e,new Zh("beforestart",{sourceEvent:n,target:h,identifier:a,active:d,x:f[0],y:f[1],dx:0,dy:0,dispatch:v}),o)))return s=p.x-f[0]||0,c=p.y-f[1]||0,function n(i,r,u){var g,_=f;switch(i){case"start":l[a]=n,g=d++;break;case"end":delete l[a],--d;case"drag":f=qh(u||r,t),g=d}v.call(i,e,new Zh(i,{sourceEvent:r,subject:p,target:h,identifier:a,active:g,x:f[0]+s,y:f[1]+c,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:v}),o)}}return h.filter=function(e){return arguments.length?(a="function"==typeof e?e:nr(!!e),h):a},h.container=function(e){return arguments.length?(i="function"==typeof e?e:nr(e),h):i},h.subject=function(e){return arguments.length?(r="function"==typeof e?e:nr(e),h):r},h.touchable=function(e){return arguments.length?(s="function"==typeof e?e:nr(!!e),h):s},h.on=function(){var e=u.on.apply(u,arguments);return e===u?h:e},h.clickDistance=function(e){return arguments.length?(c=(e=+e)*e,h):Math.sqrt(c)},h}function np(){const e=f(yt);return{label:g((()=>e?.label.value??"")),isConnected:g((()=>e?.isConnected.value??!1)),isConnecting:g((()=>e?.isConnecting.value??!1)),isReadOnly:g((()=>e?.isReadOnly.value)),isRequired:g((()=>e?.isRequired.value)),maxConnections:g((()=>e?.maxConnections.value)),type:g((()=>e?.type.value??xt.Main)),mode:g((()=>e?.mode.value??ut.Input)),index:g((()=>e?.index.value??0)),runData:g((()=>e?.runData.value))}}return e({o:Lr,t:function({nodes:e,connections:t,workflowObject:n}){const o=Q(),a=et(),i=g((()=>a.workflowId?Xe(Je(a.workflowId)):void 0)),r=we(),s=at(),l=We(),{dirtinessByName:u}=Qt(),c=g((()=>e.value.reduce(((e,t)=>{switch(t.type){case`${Me.StickyNote}`:e[t.id]=function(e){return{type:Me.StickyNote,options:{width:e.parameters.width,height:e.parameters.height,color:e.parameters.color,content:e.parameters.content}}}(t);break;case`${Me.AddNodes}`:e[t.id]={type:Me.AddNodes,options:{}};break;case`${Me.ChoicePrompt}`:e[t.id]={type:Me.ChoicePrompt,options:{}};break;default:e[t.id]=function(e){const t=h.value[e.id],o=Dt(A.value[e.id]??t??e.type,e);return{type:Me.Default,options:{trigger:p.value[e.id],configuration:s.isConfigNode(n.value,e,e.type),configurable:s.isConfigurableNode(n.value,e,e.type,e.typeVersion),inputs:{labelSize:m.value[e.id]},outputs:{labelSize:y.value[e.id]},tooltip:x.value[e.id],dirtiness:u.value[e.name],icon:o,placeholder:e.placeholder}}}(t)}return e}),{})??{})),h=g((()=>e.value.reduce(((e,t)=>(e[t.id]=s.getNodeType(t.type,t.typeVersion)??s.communityNodeType(t.type)?.nodeDescription??null,e)),{}))),p=g((()=>e.value.reduce(((e,t)=>(e[t.id]=s.isTriggerNode(t.type),e)),{}))),v=g((()=>e.value.reduce(((e,t)=>{try{const o=h.value[t.id];if(!o)return e;const a=l.getNodeSubtitle(t,o,n.value)??"";if(a.includes("__CUSTOM_API_CALL__"))return e;e[t.id]=a}catch(o){}return e}),{}))),f=g((()=>e.value.reduce(((e,t)=>{const o=h.value[t.id],a=n.value.getNode(t.name);return e[t.id]=a&&o?qt(Tt(n.value,a,o),o.inputNames??[]):[],e}),{})));function _(e){const t=e.reduce(((e,t)=>(t.type===xt.Main&&e.push(function(e=""){return e.length<=2?0:e.length<=6?1:2}(t.label??"")),e)),[0]);return["small","medium","large"][Math.max(...t)]}const m=g((()=>e.value.reduce(((e,t)=>(e[t.id]=_(f.value[t.id]),e)),{}))),y=g((()=>e.value.reduce(((e,t)=>(e[t.id]=_(b.value[t.id]),e)),{}))),b=g((()=>e.value.reduce(((e,t)=>{const o=h.value[t.id],a=n.value.getNode(t.name);return e[t.id]=a&&o?qt(It(n.value,a,o),o.outputNames??[]):[],e}),{}))),w=g((()=>e.value.reduce(((e,t)=>(e[t.id]=i.value?.getNodePinData(t.name),e)),{}))),x=g((()=>{if(!a.isWorkflowRunning)return{};const t=e.value.filter((e=>p.value[e.id]&&!e.disabled)).length,n=a.getWorkflowExecution?.triggerNode;return void 0===n&&1!==t?{}:e.value.reduce(((e,t)=>{const a=h.value[t.id];if(a&&p.value[t.id]){if(t.disabled||void 0!==n&&n!==t.name||!["new","unknown","waiting"].includes(z.value[t.id])||w.value[t.id])return e;if("string"==typeof a.eventTriggerDescription){const n=o.shortNodeType(a.name),{eventTriggerDescription:i}=a;e[t.id]=o.nodeText(a.name).eventTriggerDescription(n,i??"")}else e[t.id]=o.baseText("node.waitingForYouToCreateAnEventIn",{interpolate:{nodeType:a?Ze(a):""}})}return e}),{})})),k=g((()=>e.value.reduce(((e,t)=>(e[t.id]=r.executingNode.isNodeExecuting(t.name),e)),{}))),E=g((()=>e.value.reduce(((e,t)=>(e[t.id]=t.name===r.executingNode.lastAddedExecutingNode&&0===r.executingNode.executingNode.length&&a.isWorkflowRunning,e)),{}))),z=g((()=>e.value.reduce(((e,t)=>{const n=a.getWorkflowRunData?.[t.name]??[];let o=n.at(-1)?.executionStatus;return n.length>1&&"canceled"===o&&(o=n.at(-2)?.executionStatus),e[t.id]=o??"new",e}),{}))),N=g((()=>e.value.reduce(((e,t)=>(e[t.id]=a.getWorkflowResultDataByNodeName(t.name),e)),{}))),C=g((()=>new Map(e.value.map((e=>[e.name,e]))))),T=d({});U((()=>a.workflowExecutionResultDataLastUpdate),(()=>{T.value=Object.keys(N.value).reduce(((e,t)=>{e[t]={};const n={iterations:0,total:0};for(const o of N.value[t]??[]){const a=o.data??{};for(const i of Object.keys(a)){const r=a[i]??{};e[t][i]=e[t][i]??{};for(const a of Object.keys(r)){const s=r[parseInt(a,10)]??[];e[t][i][a]=e[t][i][a]??{...n,...i!==xt.Main?{byTarget:{}}:{}};let l=s.length;if(i!==xt.Main&&s.length>0){const e=s[0];e?.json&&"object"==typeof e.json&&"response"in e.json&&Array.isArray(e.json.response)&&(l=e.json.response.length)}if("canceled"!==o.executionStatus&&(e[t][i][a].iterations+=1),e[t][i][a].total+=l,i!==xt.Main){const n=o.source?.[0]?.previousNode;if(n){const r=C.value.get(n);if(r){const n=r.id,s=e[t][i][a];s.byTarget&&(s.byTarget[n]||(s.byTarget[n]={total:0,iterations:0}),"canceled"!==o.executionStatus&&(s.byTarget[n].iterations+=1),s.byTarget[n].total+=l)}}}}}}return e}),{})}),{throttle:500,immediate:!0});const M=g((()=>e.value.reduce(((e,t)=>{const n=[],o=a.getWorkflowRunData?.[t.name];return o&&o.forEach((e=>{if(e?.error){const{message:t,description:o}=e.error,a=`${t}${o?` (${o})`:""}`;n.push(qe(a))}})),e[t.id]=n,e}),{}))),I=g((()=>e.value.reduce(((e,t)=>{const n=[];return void 0!==t?.issues&&n.push(...l.nodeIssuesToString(t.issues,t)),e[t.id]=n,e}),{}))),O=g((()=>e.value.reduce(((e,t)=>{const n=M.value[t.id]?.length>0,o=I.value[t.id]?.length>0;if(["crashed","error"].includes(z.value[t.id]))e[t.id]=!0;else if(w.value[t.id])e[t.id]=!1;else if(o)e[t.id]=!0;else if(n)e[t.id]=!0;else{const n=a.getWorkflowRunData?.[t.name]??[];e[t.id]=Boolean(n.at(-1)?.error)}return e}),{}))),S=g((()=>e.value.reduce(((e,t)=>{const n=a.getWorkflowExecution,i=n?.data?.resultData?.lastNodeExecuted;if(n&&i&&"waitTill"in n&&t.name===n.data?.resultData?.lastNodeExecuted&&n?.waitTill&&!n?.finished){if(t&&"n8n-nodes-base.wait"===t.type&&["webhook","form"].includes(t.parameters.resume))return e[t.id]="webhook"===t.parameters.resume?o.baseText("node.theNodeIsWaitingWebhookCall"):o.baseText("node.theNodeIsWaitingFormCall"),e;if("sendAndWait"===t?.parameters.operation)return e[t.id]=o.baseText("node.theNodeIsWaitingUserInput"),e;if("n8n-nodes-base.form"===t?.type)return e[t.id]=o.baseText("node.theNodeIsWaitingFormCall"),e;const a=new Date(n.waitTill);if(a.getTime()===St.getTime())return e[t.id]=o.baseText("node.theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall"),e;e[t.id]=o.baseText("node.nodeIsWaitingTill",{interpolate:{date:a.toLocaleDateString(),time:a.toLocaleTimeString()}})}return e}),{}))),$=g((()=>{const t=e.value.reduce(((e,t)=>{if("n8n-nodes-base.stickyNote"===t.type){const n=t.position[0],o=t.position[1],a=t.parameters.width,i=t.parameters.height;e.push({id:t.id,x:n,y:o,width:a,height:i,area:a*i,zIndex:-100})}return e}),[]).sort(((e,t)=>t.area-e.area));t.forEach(((e,t)=>{e.zIndex=-100+t}));for(let e=0;e<t.length;e++){const n=t[e];for(let o=e+1;o<t.length;o++){const e=t[o];Ht(n,e)&&(n.area<e.area&&n.zIndex<=e.zIndex?n.zIndex=e.zIndex+1:e.area<n.area&&e.zIndex<=n.zIndex&&(e.zIndex=n.zIndex+1))}}return t.reduce(((e,t)=>(e[t.id]={style:{zIndex:t.zIndex}},e)),{})})),A=g((()=>e.value.reduce(((e,t)=>{if(["n8n-nodes-base.simulate","n8n-nodes-base.simulateTrigger"].includes(t.type)){const o=t.parameters?.icon,a=n.value.expression.getSimpleParameterValue(t,o,"internal",{});a&&"string"==typeof a&&(e[t.id]=s.getNodeType(a))}return e}),{}))),B=g((()=>{const n=t.value,o=mt(n);return[...e.value.map((e=>{const t=n[e.name]??{},a=o[e.name]??{},i={id:e.id,name:e.name,subtitle:v.value[e.id]??"",type:e.type,typeVersion:e.typeVersion,disabled:e.disabled,inputs:f.value[e.id]??[],outputs:b.value[e.id]??[],connections:{[ut.Input]:a,[ut.Output]:t},issues:{execution:M.value[e.id],validation:I.value[e.id],visible:O.value[e.id]},pinnedData:{count:w.value[e.id]?.length??0,visible:!!w.value[e.id]},execution:{status:z.value[e.id],waiting:S.value[e.id],waitingForNext:E.value[e.id],running:k.value[e.id]},runData:{outputMap:T.value[e.id],iterations:(r=N.value[e.id],r?r.filter((e=>"canceled"!==e.executionStatus)):null)?.length??0,visible:!!N.value[e.id]},render:c.value[e.id]??{type:"default",options:{}}};var r;return{id:e.id,label:e.name,type:"canvas-node",position:{x:e.position[0],y:e.position[1]},data:i,...$.value[e.id],draggable:e.draggable}}))]})),j=g((()=>Pt(t.value??[],e.value??[]).map((e=>{const t=function(e){const t=C.value.get(e.data?.source.node??"");if(!t)return"";if(w.value[t.id]){const e=w.value[t.id]?.length??0;return e>0?o.baseText("ndv.output.items",{adjustToNumber:e,interpolate:{count:String(e)}}):""}if(N.value[t.id]){const{type:n,index:a}=Rt(e.sourceHandle),i=T.value[t.id]?.[n]?.[a],r=n===xt.Main,s=N.value[e.target];if(!r&&i?.byTarget){const t=e.target,n=i.byTarget[t];return n&&n.total>0&&s?o.baseText(n.iterations>1?"ndv.output.itemsTotal":"ndv.output.items",{adjustToNumber:n.total,interpolate:{count:String(n.total)}}):""}const l=i?.total??0,u=(i?.iterations??1)>1;return l>0&&(r||s)?o.baseText(u?"ndv.output.itemsTotal":"ndv.output.items",{adjustToNumber:l,interpolate:{count:String(l)}}):""}return""}(e),n=function(e){const{type:t,index:n}=Rt(e.sourceHandle),o=T.value[e.source]?.[t]?.[n]?.total??0,a=N.value[e.source]??[];let i,r=a[a.length-1];if("canceled"===r?.executionStatus&&a.length>1&&(r=a[a.length-2]),k.value[e.source]&&0===o)i="running";else if(w.value[e.source]&&N.value[e.source])i="pinned";else if(O.value[e.source])i="error";else if(o>0&&"canceled"!==r?.executionStatus){const n=t===xt.Main,o=N.value[e.target];(n||o)&&(i="success")}const s=[...f.value[e.source],...f.value[e.target]].filter((e=>e.type===t)).reduce(((e,t)=>void 0===t.maxConnections?e:Math.min(e??1/0,t.maxConnections)),void 0);return{...e.data,...s?{maxConnections:s}:{},status:i}}(e);return{...e,data:n,type:"canvas-edge",label:t,markerEnd:Be.ArrowClosed}}))));return{additionalNodePropertiesById:$,nodeExecutionRunDataOutputMapById:T,nodeExecutionWaitingForNextById:E,nodeHasIssuesById:O,connections:j,nodes:B}}}),{setters:[function(e){n=e.o,o=e.t},function(e){a=e.$,i=e.A,r=e.Bt,s=e.C,l=e.E,u=e.F,d=e.Ft,c=e.H,h=e.I,p=e.N,v=e.O,f=e.R,g=e.S,_=e.Sn,m=e.T,y=e.U,b=e.W,w=e.Wt,x=e.X,k=e.Z,E=e._,z=e._n,N=e._t,C=e.bt,T=e.c,M=e.dt,I=e.ft,O=e.gt,S=e.h,$=e.it,A=e.j,B=e.lt,j=e.n,D=e.p,R=e.q,L=e.rt,P=e.st,V=e.tt,q=e.v,H=e.vn,F=e.w,W=e.y,Y=e.yn,X=e.yt},function(e){U=e.Q,G=e.Y,Z=e.Z,K=e.a,Q=e.at,J=e.r},function(e){ee=e.Di,te=e.F,ne=e.Mi,oe=e.Mt,ae=e.O,ie=e.Pt,re=e.Qi,se=e.Xi,le=e.Zi,ue=e.ct,de=e.lt,ce=e.tt,he=e.xt},function(e){pe=e.t},function(e){ve=e.$t,fe=e.An,ge=e.As,_e=e.Br,me=e.Cn,ye=e.Dn,be=e.En,we=e.Et,xe=e.Fn,ke=e.Fr,Ee=e.Mn,ze=e.On,Ne=e.Sn,Ce=e.Tn,Te=e.Un,Me=e.Vr,Ie=e.Xt,Oe=e._n,Se=e.aa,$e=e.an,Ae=e.bn,Be=e.dn,je=e.fn,De=e.gn,Re=e.gr,Le=e.hn,Pe=e.it,Ve=e.jn,qe=e.js,He=e.jt,Fe=e.kn,We=e.lr,Ye=e.mn,Xe=e.oa,Ue=e.oi,Ge=e.pn,Ze=e.qi,Ke=e.qt,Qe=e.r,Je=e.ra,et=e.s,tt=e.t,nt=e.un,ot=e.vn,at=e.w,it=e.wn,rt=e.xa,st=e.xn,lt=e.yn,ut=e.zr},function(e){dt=e.M},function(e){e.$n,ct=e.Bo,e.Ct,ht=e.Ia,e.N,pt=e.Nn,vt=e.Oo,ft=e.Pt,gt=e.Qo,e.So,e.St,e.To,_t=e.Vn,mt=e.Yi,yt=e._c,bt=e.ar,wt=e.bc,xt=e.eo,e.er,kt=e.fa,e.fr,Et=e.gc,e.in,zt=e.la,Nt=e.ma,Ct=e.mt,Tt=e.na,Mt=e.pa,It=e.ra,Ot=e.vc,St=e.wo},function(e){$t=e.t},function(e){At=e.t},function(e){Bt=e.t},function(e){jt=e.t},function(e){Dt=e.t},function(e){Rt=e.c,Lt=e.n,Pt=e.o,Vt=e.r,qt=e.s,Ht=e.t},function(e){Ft=e.n},function(e){Wt=e.n,Yt=e.r,Xt=e.t},function(e){Ut=e.t},function(e){Gt=e.t},function(e){Zt=e.t},function(e){Kt=e.t},function(e){Qt=e.r,Jt=e.t},function(e){en=e.n},function(e){tn=e.t},function(e){nn=e.t},function(e){on=e.t},function(e){an=e.t},function(e){rn=e.t},function(e){sn=e.t},function(e){ln=e.t}],execute:function(){(un=document.createElement("style")).textContent='path[data-v-c74a9681]{stroke:var(--canvas--read-only-line--color)}._contextMenu_ia9tx_125{position:fixed}._activator_ia9tx_129{pointer-events:none;opacity:0}._edge_qsnhv_125{opacity:0;transition-property:stroke,opacity;transition-duration:.3s;transition-timing-function:ease}._edge_qsnhv_125._visible_qsnhv_131{opacity:1}._iconButton_yqho8_125{padding-left:0;padding-right:0}._iconButton_yqho8_125 svg{width:16px;height:16px}._tooltipContainer_yuv67_125{position:relative}._content_yuv67_129{white-space:nowrap}._canvasEdgeToolbar_1asvk_125{justify-content:center;align-items:center;gap:var(--spacing--2xs);pointer-events:all;padding:var(--spacing--2xs);transform:scale(var(--canvas-zoom-compensation-factor,1));display:flex}.canvas-edge-toolbar-button{--button--color--text:var(--lightningcss-light,var(--color--neutral-700))var(--lightningcss-dark,var(--color--neutral-250));--button--color--text--hover:var(--lightningcss-light,var(--color--neutral-850))var(--lightningcss-dark,var(--color--neutral-150));--button--color--background:var(--lightningcss-light,var(--color--neutral-200))var(--lightningcss-dark,var(--color--neutral-850));--button--color--background--hover:var(--lightningcss-light,var(--color--neutral-250))var(--lightningcss-dark,var(--color--neutral-800));border-width:0}._edge_1yu3o_125{stroke-linecap:square;transition:fill .3s;stroke:var(--canvas-edge--color,var(--lightningcss-light,oklch(var(--canvas-edge--color--lightness--light) 0 0))var(--lightningcss-dark,oklch(var(--canvas-edge--color--lightness--dark) 0 0)))!important;stroke-width:calc(2 * var(--canvas-zoom-compensation-factor,1))!important}._edgeLabelWrapper_1yu3o_133{transform:translateY(calc(var(--spacing--xs) * -1));--label-translate-y:0;position:absolute}._edgeLabelWrapper_1yu3o_133._straight_1yu3o_139{--label-translate-y:-100%}._edgeLabel_1yu3o_133{transform:scale(var(--canvas-zoom-compensation-factor,1)) translate(0, var(--label-translate-y));color:var(--canvas--label--color);font-size:var(--font-size--xs);background-color:var(--canvas--label--color--background)}._status_v9j1u_125{align-items:center;gap:var(--spacing--5xs);font-weight:var(--font-weight--bold);display:flex}._runData_v9j1u_132{color:var(--color--success)}._waiting_v9j1u_136,._pinnedData_v9j1u_140{color:var(--color--secondary)}._running_v9j1u_144{color:hsl(var(--color--primary--h), var(--color--primary--s), var(--color--primary--l))}._running_v9j1u_144._absoluteSpinner_v9j1u_147{width:100%;height:100%;color:hsla(var(--color--primary--h), var(--color--primary--s), var(--color--primary--l), .7);padding:var(--canvas-node--status-icons--margin);justify-content:center;align-items:center;font-size:3.75em;display:flex;position:absolute;top:0;left:0}._running_v9j1u_144._spinnerScrim_v9j1u_160{z-index:10;border-radius:var(--radius--lg);background-color:rgba(255,255,255,.82)}._issues_v9j1u_166{color:var(--color--danger);cursor:default}._count_v9j1u_171{font-size:var(--font-size--sm)}._warning_v9j1u_175{color:var(--color--warning)}._disabled_v9j1u_179{color:var(--color--foreground--shade-2)}._popover_6do86_125{margin-bottom:calc(-1 * var(--spacing--2xs));margin-left:calc(-1 * var(--spacing--5xs))}._content_6do86_130{gap:var(--spacing--2xs);flex-direction:row;width:fit-content;display:flex}._color_6do86_137{border-style:solid;border-width:1px;border-color:var(--color--foreground--shade-2);background:var(--sticky--color--background);border-radius:50%;width:20px;height:20px}._color_6do86_137:hover{cursor:pointer}._color_6do86_137._selected_6do86_149{box-shadow:0 0 0 1px var(--sticky--color--background)}._color_6do86_137._sticky-color-1_6do86_152{--sticky--color--background:var(--sticky--color--background--variant-1)}._color_6do86_137._sticky-color-2_6do86_155{--sticky--color--background:var(--sticky--color--background--variant-2)}._color_6do86_137._sticky-color-3_6do86_158{--sticky--color--background:var(--sticky--color--background--variant-3)}._color_6do86_137._sticky-color-4_6do86_161{--sticky--color--background:var(--sticky--color--background--variant-4)}._color_6do86_137._sticky-color-5_6do86_164{--sticky--color--background:var(--sticky--color--background--variant-5)}._color_6do86_137._sticky-color-6_6do86_167{--sticky--color--background:var(--sticky--color--background--variant-6)}._color_6do86_137._sticky-color-7_6do86_170{--sticky--color--background:var(--sticky--color--background--variant-7)}._option_6do86_174{padding:var(--spacing--3xs);color:var(--color--text--tint-1);display:inline-block}._option_6do86_174 svg{width:var(--font-size--sm)!important}._option_6do86_174:hover{color:var(--color--primary)}._customColorButton_6do86_186{background:conic-gradient(red,#ff0,#0f0,#0ff,#00f,#f0f,red);position:relative}._customColorButton_6do86_186:hover{cursor:pointer}._plusIcon_6do86_194{color:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3));position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._hiddenColorInput_6do86_203{opacity:0;pointer-events:none;width:0;height:0;position:absolute}._canvasNodeToolbar_bw5fp_125{padding-bottom:var(--spacing--xs);cursor:default;pointer-events:none;justify-content:center;width:100%;display:flex}._canvasNodeToolbar_bw5fp_125._isExperimentalNdvActive_bw5fp_133{padding-bottom:var(--spacing--3xs);zoom:var(--canvas-zoom-compensation-factor,1);margin-bottom:var(--spacing--2xs);justify-content:space-between;align-items:center}._canvasNodeToolbarItems_bw5fp_142{background-color:var(--canvas--color--background);border-radius:var(--radius);pointer-events:auto;justify-content:center;align-items:center;display:flex}._canvasNodeToolbarItems_bw5fp_142 .button{--button--color--text:var(--color--text--tint-1)}._forceVisible_bw5fp_154{opacity:1!important}._statusIcons_bw5fp_158:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:var(--spacing--3xs)}._statusIcons_bw5fp_158:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:var(--spacing--3xs)}._statusIcons_bw5fp_158:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:var(--spacing--3xs)}._statusIcons_bw5fp_158:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:var(--spacing--3xs)}._settingsIcons_xulzx_125{top:var(--canvas-node--status-icons--margin);right:var(--canvas-node--status-icons--margin);flex-direction:row;gap:1px;display:flex;position:absolute}._tooltipHeader_xulzx_134{gap:2px;display:flex}._tooltipTitle_xulzx_139{font-weight:600;font-size:inherit;line-height:inherit}._icon_xulzx_145{width:var(--spacing--md);height:var(--spacing--md);place-items:center;display:grid}._actions_1x1ab_125{color:var(--color--text);align-items:center;display:flex}._actions_1x1ab_125>button{color:var(--color--text--tint-1)}._component_8xduy_125{--canvas-node--border-color:var(--color--text--tint-2);--embedded-ndv--max-height--expanded:min(calc(var(--canvas-node--height) * 2), var(--input--max-height--focus), 300px);justify-content:stretch;overflow:hidden;border-radius:var(--radius)!important;border-width:1px!important;align-items:flex-start!important}._component_8xduy_125._expanded_8xduy_138{user-select:text;cursor:auto;height:auto;max-height:var(--embedded-ndv--max-height--expanded);min-height:var(--spacing--3xl)}.selected ._component_8xduy_125._expanded_8xduy_138{max-height:var(--input--max-height--focus)}._component_8xduy_125._collapsed_8xduy_148{height:var(--spacing--2xl);overflow:hidden}:root .vue-flow__node:has(._component_8xduy_125){z-index:10}.selected :root .vue-flow__node:has(._component_8xduy_125){z-index:11}._collapsedContent_8xduy_160,._settingsView_8xduy_161{z-index:1000;width:100%;height:auto;max-height:calc(var(--embedded-ndv--max-height--expanded) - var(--border-width) * 2);min-height:var(--spacing--2xl)}.selected ._collapsedContent_8xduy_160,.selected ._settingsView_8xduy_161{max-height:calc(var(--input--max-height--focus) - var(--border-width) * 2)}._collapsedContent_8xduy_160{align-items:center;gap:var(--spacing--4xs);height:100%;padding:var(--spacing--2xs) var(--spacing--4xs) var(--spacing--2xs) var(--spacing--2xs);background-color:#fff;background-color:var(--color--background--light-3);cursor:pointer;display:flex}._disabled_8xduy_183 ._collapsedContent_8xduy_160{background-color:var(--color--foreground--tint-1)}._collapsedContent_8xduy_160>*{zoom:var(--canvas-zoom-compensation-factor,1);flex-grow:0;flex-shrink:0}._collapsedNodeName_8xduy_193{gap:var(--spacing--5xs);flex-direction:column;flex-grow:1;width:0;display:flex}._collapsedNodeName_8xduy_193>*{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}._settingsView_8xduy_161>*{zoom:var(--canvas-zoom-compensation-factor,1)}._tooltipAnchor_hvf3v_125{pointer-events:none;justify-content:center;width:100%;display:flex;position:absolute;top:0;left:0}._content_hvf3v_135{white-space:nowrap;max-width:none}._disabledStrikeThrough_l3m1g_125{border:1px solid var(--color--foreground--shade-1);top:calc(var(--canvas-node--height) / 2 - 1px);pointer-events:none;width:calc(100% + 12px);position:absolute;left:-4px}._success_l3m1g_134{border-color:var(--color--success--tint-1)}._warning_l3m1g_138{border-color:var(--color--warning--tint-1)}._node_9txz0_125{--canvas-node--border-width:1.5px;--trigger-node--radius:36px;--canvas-node--status-icons--margin:var(--spacing--3xs);--node--icon--color:var(--color--foreground--shade-1);height:var(--canvas-node--height);width:var(--canvas-node--width);background:var(--canvas-node--color--background,var(--node--color--background));border:var(--canvas-node--border-width) solid var(--canvas-node--border-color,var(--lightningcss-light,oklch(from var(--color--neutral-black) l c h/var(--canvas-node--border--opacity-light,.1)))var(--lightningcss-dark,oklch(from var(--color--neutral-white) l c h/var(--canvas-node--border--opacity-dark,.15))));border-radius:var(--radius--lg);background-clip:padding-box;justify-content:center;align-items:center;display:flex;position:relative}._node_9txz0_125._trigger_9txz0_141,._node_9txz0_125._trigger_9txz0_141._running_9txz0_144:after,._node_9txz0_125._trigger_9txz0_141._waiting_9txz0_144:after{border-radius:var(--trigger-node--radius) var(--radius--lg) var(--radius--lg) var(--trigger-node--radius)}._node_9txz0_125._configuration_9txz0_152,._node_9txz0_125._configuration_9txz0_152._running_9txz0_144:after,._node_9txz0_125._configuration_9txz0_152._waiting_9txz0_144:after{border-radius:calc(var(--canvas-node--height) / 2)}._node_9txz0_125._configuration_9txz0_152 ._statusIcons_9txz0_158{right:unset}._node_9txz0_125._configurable_9txz0_161 ._icon_9txz0_161{margin-left:calc(40px - (var(--node--icon--size)) / 2 - var(--canvas-node--border-width))}._node_9txz0_125._configurable_9txz0_161 ._description_9txz0_164{top:unset;margin-top:0;margin-left:var(--spacing--sm);margin-right:var(--spacing--sm);width:auto;min-width:unset;text-overflow:ellipsis;flex-grow:1;flex-shrink:1;position:relative;overflow:hidden}._node_9txz0_125._configurable_9txz0_161 ._label_9txz0_177,._node_9txz0_125._configurable_9txz0_161 ._subtitle_9txz0_180{text-align:left}._node_9txz0_125._configurable_9txz0_161._configuration_9txz0_152 ._icon_9txz0_161{margin-left:calc((var(--canvas-node--height) - var(--node--icon--size) - 4px) / 2)}._node_9txz0_125._configurable_9txz0_161._configuration_9txz0_152 ._statusIcons_9txz0_158{margin-right:var(--spacing--2xs);position:static}._node_9txz0_125._configurable_9txz0_161._configuration_9txz0_152 ._description_9txz0_164{margin-right:var(--spacing--xs)}._node_9txz0_125._selected_9txz0_199{box-shadow:0 0 0 calc(6px * var(--canvas-zoom-compensation-factor,1)) var(--canvas--color--selected-transparent)}._node_9txz0_125._success_9txz0_203{--canvas-node--border-width:2px;--canvas-node--border-color:var(--color-canvas-node-success-border-color,var(--color--success))}._node_9txz0_125._warning_9txz0_210{--canvas-node--border-width:2px;--canvas-node--border-color:var(--color--warning)}._node_9txz0_125._error_9txz0_214{--canvas-node--border-color:var(--canvas-node--border-color--error,var(--color--danger))}._node_9txz0_125._pinned_9txz0_217{--canvas-node--border-width:2px;--canvas-node--border-color:var(--color-canvas-node-pinned-border-color,var(--node--border-color--pinned))}._node_9txz0_125._disabled_9txz0_224{--canvas-node--border-color:var(--color-canvas-node-disabled-border-color,var(--color--foreground))}._node_9txz0_125._running_9txz0_144{--canvas-node--border-color:var(--color-canvas-node-running-border-color,var(--node--border-color--running));border-color:transparent}._node_9txz0_125._waiting_9txz0_144{--canvas-node--border-color:transparent}._node_9txz0_125._placeholder_9txz0_240{background:var(--color--foreground--tint-2);border:2px dashed var(--color--foreground--shade-2);cursor:pointer}._node_9txz0_125._placeholder_9txz0_240:hover ._icon_9txz0_161{color:var(--color--primary)}._running_9txz0_144:after,._waiting_9txz0_144:after{content:"";z-index:-1;background:conic-gradient(from var(--node--gradient-angle), #ff6d5a, #ff6d5a 20%, rgba(255,109,90,.2) 35%, rgba(255,109,90,.2) 65%, #ff6d5a 90%, #ff6d5a);border-radius:10px;position:absolute;top:-3px;bottom:-3px;left:-3px;right:-3px}._running_9txz0_144:after{animation:1.5s linear infinite _border-rotate_9txz0_1}._waiting_9txz0_144:after{animation:4.5s linear infinite _border-rotate_9txz0_1}@property --node--gradient-angle{syntax:"<angle>";inherits:false;initial-value:0deg}@keyframes _border-rotate_9txz0_1{0%{--node--gradient-angle:0deg}to{--node--gradient-angle:360deg}}._description_9txz0_164{width:100%;min-width:calc(var(--canvas-node--width) * 2);margin-top:var(--spacing--2xs);gap:var(--spacing--4xs);pointer-events:none;flex-direction:column;display:flex;position:absolute;top:100%}._label_9txz0_177,._disabledLabel_9txz0_295{font-size:var(--font-size--md);text-align:center;text-overflow:ellipsis;-webkit-line-clamp:2;overflow-wrap:anywhere;font-weight:var(--font-weight--medium);line-height:var(--line-height--sm);-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}._subtitle_9txz0_180{text-align:center;width:100%;color:var(--color--text--tint-1);font-size:var(--font-size--xs);white-space:nowrap;text-overflow:ellipsis;line-height:var(--line-height--sm);font-weight:var(--font-weight--regular);overflow:hidden}._statusIcons_9txz0_158{bottom:var(--canvas-node--status-icons--margin);right:var(--canvas-node--status-icons--margin);position:absolute}._icon_9txz0_161{flex-grow:0;flex-shrink:0}._sticky_1k3w0_125{position:relative}._sticky_1k3w0_125._selected_1k3w0_132{box-shadow:0 0 0 4px var(--canvas--color--selected)}._addNodes_1ik7n_125{flex-direction:column;justify-content:center;align-items:center;width:100px;height:100px;display:flex}._addNodes_1ik7n_125:hover ._button_1ik7n_133 svg path{fill:var(--color--primary)}._button_1ik7n_133{background:var(--color--foreground--tint-2);border:2px dashed var(--color--foreground--shade-2);cursor:pointer;border-radius:8px;min-width:100px;min-height:100px;padding:0}._label_1ik7n_147{width:max-content;font-weight:var(--font-weight--medium);font-size:var(--font-size--md);line-height:var(--line-height--xl);color:var(--color--text--shade-1);margin-top:var(--spacing--2xs);flex-direction:column;display:flex}._choicePrompt_5k7m7_125{justify-content:center;align-items:flex-start;gap:var(--spacing--lg);flex-direction:row;display:flex}._option_5k7m7_133{flex-direction:column;align-items:center;width:100px;display:flex}._button_5k7m7_140{background:var(--color--foreground--tint-2);border:2px dashed var(--color--foreground--shade-2);border-radius:var(--radius--lg);cursor:pointer;min-width:100px;min-height:100px;padding:0}._selectedButtonHighlight_5k7m7_150{border-radius:var(--radius--lg)}._selectedButtonHighlight_5k7m7_150._highlighted_5k7m7_153{box-shadow:0 0 0 7px var(--canvas--color--selected)}._label_5k7m7_157{width:max-content;font-weight:var(--font-weight--medium);font-size:var(--font-size--md);line-height:var(--line-height--xl);color:var(--color--text--shade-1);margin-top:var(--spacing--2xs);text-align:center;flex-direction:column;display:flex}._orDivider_5k7m7_169{height:100px;margin-bottom:calc(var(--line-height--xl) * 1em + var(--spacing--2xs));justify-content:center;align-items:center;display:flex}._orText_5k7m7_177{font-size:var(--font-size--md);color:var(--color--text);font-weight:var(--font-weight--regular);padding:0 var(--spacing--xs)}._wrapper_1jh0f_125{z-index:2;margin:-4px;padding:4px;position:relative}._wrapper_1jh0f_125._output_1jh0f_131{cursor:crosshair}._dot_1jh0f_135{width:var(--handle--indicator--width);height:var(--handle--indicator--height);background:var(--lightningcss-light,var(--color--neutral-white))var(--lightningcss-dark,var(--color--neutral-850));border:1px solid var(--lightningcss-light,oklch(var(--handle--border--lightness--light,.68) 0 0))var(--lightningcss-dark,oklch(var(--handle--border--lightness--dark,.5) 0 0));border-radius:50%;transition:transform .2s,background .2s,border-width .1s}._wrapper_1jh0f_125._output_1jh0f_131:hover ._dot_1jh0f_135{border:1.5px solid var(--lightningcss-light,var(--color--neutral-300))var(--lightningcss-dark,var(--color--neutral-300));background:var(--lightningcss-light,var(--color--neutral-100))var(--lightningcss-dark,var(--color--neutral-700));transform:scale(1.5)}._handle_1rqcc_125{flex-direction:column;justify-content:center;align-items:center;display:flex}._label_1rqcc_132{top:50%;left:calc(var(--spacing--xs) * -1);transform:translate(0, -50%) scale(var(--canvas-zoom-compensation-factor,1)) translate(-100%, 0);transform-origin:0;font-size:var(--font-size--2xs);color:var(--color--foreground--shade-2);background:var(--canvas--label--color--background);z-index:1;text-align:center;white-space:nowrap;position:absolute}._required_1rqcc_147 ._label_1rqcc_132:after{content:"*";color:var(--color--danger)}._container_276y9_125{position:relative}._container_276y9_125._bottom_276y9_128:before{content:"";pointer-events:auto;width:200%;height:120%;transform:translate(-50%, -50%) scale(var(--canvas-zoom-compensation-factor,1));position:absolute;top:50%;left:50%}._wrapper_276y9_140{transform:scale(var(--canvas-zoom-compensation-factor,1));position:relative}._wrapper_276y9_140._right_276y9_145{transform-origin:0}._wrapper_276y9_140._bottom_276y9_128{transform-origin:top}._wrapper_276y9_140 ._line_276y9_151{stroke:var(--lightningcss-light,oklch(var(--canvas-handle-plus-line--color--lightness--light) 0 0))var(--lightningcss-dark,oklch(var(--canvas-handle-plus-line--color--lightness--dark) 0 0))}._wrapper_276y9_140._success_276y9_154 ._line_276y9_151{stroke:var(--color--success)}._wrapper_276y9_140 ._plus_276y9_157{color:var(--lightningcss-light,var(--color--neutral-700))var(--lightningcss-dark,var(--color--neutral-250))}._wrapper_276y9_140 ._plus_276y9_157:hover{cursor:pointer;color:var(--lightningcss-light,var(--color--neutral-850))var(--lightningcss-dark,var(--color--neutral-150))}._wrapper_276y9_140 ._plus_276y9_157:hover path{fill:var(--lightningcss-light,var(--color--neutral-250))var(--lightningcss-dark,var(--color--neutral-800))}._wrapper_276y9_140 ._plus_276y9_157:hover rect{stroke:var(--lightningcss-light,var(--color--neutral-250))var(--lightningcss-dark,var(--color--neutral-800));fill:var(--lightningcss-light,var(--color--neutral-250))var(--lightningcss-dark,var(--color--neutral-800))}._handle_4le4q_125{flex-direction:row;justify-content:center;align-items:center;display:flex}._handle_4le4q_125._connected_4le4q_131 ._label_4le4q_131{max-width:96px}._label_4le4q_131{background:var(--canvas--label--color--background);z-index:1;max-width:calc(100% - var(--spacing--md) - 24px);white-space:nowrap;text-overflow:ellipsis;position:absolute;overflow:hidden}._required_4le4q_145 ._label_4le4q_131:after{content:"*";color:var(--color--danger)}._outputLabel_4le4q_150{top:50%;left:var(--spacing--md);transform:translate(0, -50%) scale(var(--canvas-zoom-compensation-factor,1));transform-origin:0;font-size:var(--font-size--2xs);color:var(--canvas--label--color)}._runDataLabel_4le4q_160{top:50%;left:calc(50% * var(--canvas-zoom-compensation-factor,1));transform:translate(-50%, -50%) scale(var(--canvas-zoom-compensation-factor,1)) translate(0, -100%);font-size:var(--font-size--xs);color:var(--color--text);position:absolute}.canvas-node-handle-main-output-enter-active,.canvas-node-handle-main-output-leave-active{transform-origin:0;transition-property:transform,opacity;transition-duration:.2s;transition-timing-function:ease}.canvas-node-handle-main-output-enter-from,.canvas-node-handle-main-output-leave-to{opacity:0;transform:scale(0)}._wrapper_149eq_125{margin:-4px;padding:4px;position:relative}._diamond_149eq_131{width:var(--handle--indicator--width);height:var(--handle--indicator--height);background:var(--lightningcss-light,var(--color--neutral-white))var(--lightningcss-dark,var(--color--neutral-850));border:1px solid var(--lightningcss-light,oklch(var(--handle--border--lightness--light,.68) 0 0))var(--lightningcss-dark,oklch(var(--handle--border--lightness--dark,.5) 0 0));transition:transform .2s,background .2s,border-width .1s;transform:rotate(45deg)scale(.8)}._wrapper_149eq_125:hover ._diamond_149eq_131{border:1.5px solid var(--lightningcss-light,var(--color--neutral-300))var(--lightningcss-dark,var(--color--neutral-300));background:var(--lightningcss-light,var(--color--neutral-100))var(--lightningcss-dark,var(--color--neutral-700));transform:rotate(45deg)scale(1.2)}._handle_1i9b3_125{flex-direction:column;justify-content:center;align-items:center;display:flex}._label_1i9b3_132{top:var(--spacing--lg);transform:translate(-50%, 0) scale(var(--canvas-zoom-compensation-factor,1));font-size:var(--font-size--2xs);color:var(--canvas--label--color);background:var(--canvas--label--color--background);z-index:1;text-align:center;white-space:nowrap;position:absolute;left:50%}._required_1i9b3_146 ._label_1i9b3_132:after{content:"*";color:var(--color--danger)}.canvas-node-handle-non-main-input-enter-active,.canvas-node-handle-non-main-input-leave-active{transform-origin:50% 0;transition-property:transform,opacity;transition-duration:.2s;transition-timing-function:ease}.canvas-node-handle-non-main-input-enter-from,.canvas-node-handle-non-main-input-leave-to{opacity:0;transform:scale(0)}._handle_1utsl_125{flex-direction:row;justify-content:center;align-items:center;display:flex}._label_1utsl_132{top:calc(-1 * var(--spacing--lg));transform:translate(-50%, 0) scale(var(--canvas-zoom-compensation-factor,1));font-size:var(--font-size--2xs);color:var(--canvas--label--color);background:var(--canvas--label--color--background);z-index:0;white-space:nowrap;position:absolute;left:50%}._required_1utsl_145 ._label_1utsl_132:after{content:"*";color:var(--color--danger)}.vue-flow__handle._handle_pg5br_125{--handle--indicator--width:calc(16px * var(--canvas-zoom-compensation-factor,1));--handle--indicator--height:calc(16px * var(--canvas-zoom-compensation-factor,1));width:var(--handle--indicator--width);height:var(--handle--indicator--height);z-index:1;background:0 0;border:0;border-radius:0;justify-content:center;align-items:center;display:inline-flex}.vue-flow__handle._handle_pg5br_125._inputs_pg5br_140._main_pg5br_140{cursor:default}._renderType_pg5br_144._top_pg5br_144{margin-bottom:calc(-1 * var(--handle--indicator--height));transform:translateY(-50%)}._renderType_pg5br_144._right_pg5br_148{margin-left:calc(-1 * var(--handle--indicator--width));transform:translate(50%)}._renderType_pg5br_144._left_pg5br_152{margin-right:calc(-1 * var(--handle--indicator--width));transform:translate(-50%)}._renderType_pg5br_144._bottom_pg5br_156{margin-top:calc(-1 * var(--handle--indicator--height));transform:translateY(50%)}._container_ugqlg_125{z-index:-1;pointer-events:none;align-items:center;height:100%;display:flex;position:absolute;top:0;right:100%}._container_ugqlg_125>div{align-items:center;display:flex;position:relative}._container_ugqlg_125 button{margin-right:var(--spacing--sm);opacity:0;translate:-12px;transform:scale(var(--canvas-zoom-compensation-factor,1));transform-origin:100%;transition:translate .1s ease-in,opacity .1s ease-in}._container_ugqlg_125 button[disabled]{opacity:0}._container_ugqlg_125._interactive_ugqlg_155._hovered_ugqlg_155 button{opacity:1;pointer-events:all;translate:0}._container_ugqlg_125._isExperimentalNdvActive_ugqlg_160{height:var(--spacing--2xl)}._bolt_ugqlg_164{color:var(--color--primary);padding:var(--spacing--sm);opacity:1;transition:translate .1s ease-in,opacity .1s ease-in;position:absolute;right:0;translate:0}._container_ugqlg_125._interactive_ugqlg_155._hovered_ugqlg_155 ._bolt_ugqlg_164{opacity:0;translate:-12px}._canvasNode_35bs3_125 ._canvasNodeToolbarItems_35bs3_125{opacity:0;transition:opacity .1s ease-in}._canvasNode_35bs3_125:focus-within ._canvasNodeToolbarItems_35bs3_125,._canvasNode_35bs3_125._showToolbar_35bs3_129 ._canvasNodeToolbarItems_35bs3_125{opacity:1}._canvasNode_35bs3_125:hover:not(:has(>._trigger_35bs3_129:hover)) ._canvasNodeToolbarItems_35bs3_125{opacity:1}._canvasNodeToolbar_35bs3_125{z-index:1;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}._canvas_wikel_125{opacity:0;width:100%;height:100%;transition:opacity .3s}._canvas_wikel_125._ready_wikel_131{opacity:1}._canvas_wikel_125._isExperimentalNdvActive_wikel_134{--canvas-zoom-compensation-factor:.5}.minimap-enter-active[data-v-036e831c],.minimap-leave-active[data-v-036e831c]{transition:opacity .3s}.minimap-enter-from[data-v-036e831c],.minimap-leave-to[data-v-036e831c]{opacity:0}.spotlightActive[data-v-036e831c] .vue-flow__edges{opacity:.2;transition:opacity .5s}.spotlightActive[data-v-036e831c] .vue-flow__node{opacity:.4;transition:opacity .5s}.spotlightActive[data-v-036e831c] .vue-flow__node:has(.highlighted){opacity:1}\n/*$vite$:1*/',document.head.appendChild(un);try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(U=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[U]="2273f938-4953-4b8f-90c0-3089c8ce0817",t._sentryDebugIdIdentifier="sentry-dbid-2273f938-4953-4b8f-90c0-3089c8ce0817")}catch(t){}var t,U;dn=["id","x","y","width","height","patternTransform"],cn=["d","stroke-width"],hn=pe(p({__name:"CanvasBackgroundStripedPattern",props:{id:{},x:{},y:{},zoom:{}},setup(e){const t=e,n=g((()=>20*t.zoom||1)),o=g((()=>n.value/2));return(t,i)=>(a(),l("pattern",{id:e.id,patternUnits:"userSpaceOnUse",x:e.x%n.value,y:e.y%n.value,width:n.value,height:n.value,patternTransform:`rotate(135) translate(-${o.value},-${o.value})`},[s("path",{d:`M0 ${n.value/2} H${n.value}`,"stroke-width":n.value/2},null,8,cn)],8,dn))}}),[["__scopeId","data-v-c74a9681"]]),vn=function({dimensions:e,size:t,color:n}){return h("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},fn=function({radius:e,color:t}){return h("circle",{cx:e,cy:e,r:e,fill:t})},(pn=(e=>(e.Lines="lines",e.Dots="dots",e))(pn||{})).Lines,pn.Dots,gn={[pn.Dots]:"#81818a",[pn.Lines]:"#eee"},_n=["id","x","y","width","height","patternTransform"],mn={key:2,height:"100",width:"100"},yn=["fill"],bn=["x","y","fill"],wn=p({name:"Background",compatConfig:{MODE:3},props:{id:{},variant:{default:()=>pn.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=ze(),o=g((()=>{const t=n.value.zoom,[o,a]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],i=[o*t||1,a*t||1],r=e.size*t,[s,l]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset];return{scaledGap:i,offset:[s*t||1+i[0]/2,l*t||1+i[1]/2],size:r}})),i=r((()=>`pattern-${t}${e.id?`-${e.id}`:""}`)),u=r((()=>e.color||e.patternColor||gn[e.variant||pn.Dots]));return(e,t)=>(a(),l("svg",{class:"vue-flow__background vue-flow__container",style:Y({height:`${e.height>100?100:e.height}%`,width:`${e.width>100?100:e.width}%`})},[$(e.$slots,"pattern-container",{id:i.value},(()=>[s("pattern",{id:i.value,x:w(n).x%o.value.scaledGap[0],y:w(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[$(e.$slots,"pattern",{},(()=>[e.variant===w(pn).Lines?(a(),F(w(vn),{key:0,size:e.lineWidth,color:u.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):e.variant===w(pn).Dots?(a(),F(w(fn),{key:1,color:u.value,radius:o.value.size/2},null,8,["color","radius"])):m("",!0),e.bgColor?(a(),l("svg",mn,[s("rect",{width:"100%",height:"100%",fill:e.bgColor},null,8,yn)])):m("",!0)]))],8,_n)])),s("rect",{x:e.x,y:e.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,bn),$(e.$slots,"default",{id:i.value})],4))}}),xn=p({__name:"CanvasBackground",props:{striped:{type:Boolean},viewport:{}},setup:e=>(t,n)=>(a(),F(w(wn),{"data-test-id":"canvas-background","pattern-color":"var(--canvas--dot--color)",gap:w(16)},v({_:2},[e.striped?{name:"pattern-container",fn:X((t=>[A(hn,{id:t.id,"data-test-id":"canvas-background-striped-pattern",x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom},null,8,["id","x","y","zoom"])])),key:"0"}:void 0]),1032,["gap"]))}),e("s",kn=xn),En=d([0,0]),zn=d(),Nn=()=>{const e=Qe(),t=g((()=>void 0!==zn.value)),n=g((()=>{if(!zn.value)return[];const e=zn.value;return"canvas"===e.source?e.nodeIds:[e.nodeId]})),o=()=>{zn.value=void 0,En.value=[0,0]},a=Lr(n);return O((()=>e.nodeViewOffsetPosition),o),{isOpen:t,position:En,target:zn,actions:g((()=>t.value?a.value:[])),targetNodeIds:n,open:(e,n)=>{e.stopPropagation(),t.value&&n.source===zn.value?.source&&n.nodeId===zn.value?.nodeId?o():(e.preventDefault(),zn.value=n,En.value=$e(e))},close:o}},Cn=p({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const n=Nn(),{position:o,isOpen:i,actions:r,target:l}=n,u=d(),c=t,{APP_Z_INDEXES:h}=xe();function p(e){c("action",e,n.targetNodeIds.value)}function v(e){e||n.close()}return O(i,(()=>{i?u.value?.open():u.value?.close()}),{flush:"post"}),(e,t)=>w(i)?(a(),F(W,{key:0,to:"body"},[s("div",{class:z(e.$style.contextMenu),style:Y({left:`${w(o)[0]}px`,top:`${w(o)[1]}px`,zIndex:w(h).CONTEXT_MENU})},[A(w(oe),{ref_key:"dropdown",ref:u,items:w(r),placement:"bottom-start","data-test-id":"context-menu","hide-arrow":"node-button"!==w(l)?.source,teleported:!1,onSelect:p,onVisibleChange:v},{activator:X((()=>[s("div",{class:z(e.$style.activator)},null,2)])),_:1},8,["items","hide-arrow"])],6)])):m("",!0)}}),Tn=pe(Cn,[["__cssModules",{$style:{contextMenu:"_contextMenu_ia9tx_125",activator:"_activator_ia9tx_129"}}]]),Mn=o(((e,t)=>{var n="\0";function o(e,t){e[t]?e[t]++:e[t]=1}function a(e,t){--e[t]||delete e[t]}function i(e,t,n,o){var a=""+t,i=""+n;if(!e&&a>i){var r=a;a=i,i=r}return a+""+i+""+(void 0===o?"\0":o)}function r(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[n]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter((t=>0===Object.keys(e._in[t]).length))}sinks(){var e=this;return this.nodes().filter((t=>0===Object.keys(e._out[t]).length))}setNodes(e,t){var n=arguments,o=this;return e.forEach((function(e){n.length>1?o.setNode(e,t):o.setNode(e)})),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=n,this._children[e]={},this._children[n][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach((function(e){t.setParent(e)})),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===t)t=n;else{for(var o=t+="";void 0!==o;o=this.parent(o))if(o===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==n)return t}}children(e=n){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if(e===n)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const o=new Set(t);for(var n of this.successors(e))o.add(n);return Array.from(o.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach((function([n,o]){e(n)&&t.setNode(n,o)})),Object.values(this._edgeObjs).forEach((function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var o={};function a(e){var i=n.parent(e);return void 0===i||t.hasNode(i)?(o[e]=i,i):i in o?o[i]:a(i)}return this._isCompound&&t.nodes().forEach((e=>t.setParent(e,a(e)))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,o=arguments;return e.reduce((function(e,a){return o.length>1?n.setEdge(e,a,t):n.setEdge(e,a),a})),this}setEdge(){var e,t,n,a,r=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(a=arguments[1],r=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(a=arguments[2],r=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var l=i(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return r&&(this._edgeLabels[l]=a),this;if(void 0!==n&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=r?a:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,o){var a=""+t,i=""+n;if(!e&&a>i){var r=a;a=i,i=r}var s={v:a,w:i};return o&&(s.name=o),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[l]=u,o(this._preds[t],e),o(this._sucs[e],t),this._in[t][l]=u,this._out[e][l]=u,this._edgeCount++,this}edge(e,t,n){var o=1===arguments.length?r(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return this._edgeLabels[o]}edgeAsObj(){const e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var o=1===arguments.length?r(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,o)}removeEdge(e,t,n){var o=1===arguments.length?r(this._isDirected,arguments[0]):i(this._isDirected,e,t,n),s=this._edgeObjs[o];return s&&(e=s.v,t=s.w,delete this._edgeLabels[o],delete this._edgeObjs[o],a(this._preds[t],e),a(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var o=Object.values(n);return t?o.filter((e=>e.v===t)):o}}outEdges(e,t){var n=this._out[e];if(n){var o=Object.values(n);return t?o.filter((e=>e.w===t)):o}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}}})),In=o(((e,t)=>{t.exports="2.2.4"})),On=o(((e,t)=>{t.exports={Graph:Mn(),version:In()}})),Sn=o(((e,t)=>{var n=Mn();function o(e){return e.nodes().map((function(t){var n=e.node(t),o=e.parent(t),a={v:t};return void 0!==n&&(a.value=n),void 0!==o&&(a.parent=o),a}))}function a(e){return e.edges().map((function(t){var n=e.edge(t),o={v:t.v,w:t.w};return void 0!==t.name&&(o.name=t.name),void 0!==n&&(o.value=n),o}))}t.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return void 0!==e.graph()&&(t.value=structuredClone(e.graph())),t},read:function(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach((function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),e.edges.forEach((function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}})),$n=o(((e,t)=>{t.exports=function(e){var t,n={},o=[];function a(o){Object.hasOwn(n,o)||(n[o]=!0,t.push(o),e.successors(o).forEach(a),e.predecessors(o).forEach(a))}return e.nodes().forEach((function(e){t=[],a(e),t.length&&o.push(t)})),o}})),An=o(((e,t)=>{t.exports=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map((function(e){return e.key}))}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(e,t){var n=this._keyIndices;if(e=String(e),!Object.hasOwn(n,e)){var o=this._arr,a=o.length;return n[e]=a,o.push({key:e,priority:t}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,o=n+1,a=e;n<t.length&&(a=t[n].priority<t[a].priority?n:a,o<t.length&&(a=t[o].priority<t[a].priority?o:a),a!==e&&(this._swap(e,a),this._heapify(a)))}_decrease(e){for(var t,n=this._arr,o=n[e].priority;0!==e&&!(n[t=e>>1].priority<o);)this._swap(e,t),e=t}_swap(e,t){var n=this._arr,o=this._keyIndices,a=n[e],i=n[t];n[e]=i,n[t]=a,o[i.key]=e,o[a.key]=t}}})),Bn=o(((e,t)=>{var n=An();t.exports=function(e,t,a,i){return function(e,t,o,a){var i,r,s={},l=new n,u=function(e){var t=e.v!==i?e.v:e.w,n=s[t],a=o(e),u=r.distance+a;if(a<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+a);u<n.distance&&(n.distance=u,n.predecessor=i,l.decrease(t,u))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)}));l.size()>0&&(i=l.removeMin(),(r=s[i]).distance!==Number.POSITIVE_INFINITY);)a(i).forEach(u);return s}(e,String(t),a||o,i||function(t){return e.outEdges(t)})};var o=()=>1})),jn=o(((e,t)=>{var n=Bn();t.exports=function(e,t,o){return e.nodes().reduce((function(a,i){return a[i]=n(e,i,t,o),a}),{})}})),Dn=o(((e,t)=>{t.exports=function(e){var t=0,n=[],o={},a=[];function i(r){var s=o[r]={onStack:!0,lowlink:t,index:t++};if(n.push(r),e.successors(r).forEach((function(e){Object.hasOwn(o,e)?o[e].onStack&&(s.lowlink=Math.min(s.lowlink,o[e].index)):(i(e),s.lowlink=Math.min(s.lowlink,o[e].lowlink))})),s.lowlink===s.index){var l,u=[];do{l=n.pop(),o[l].onStack=!1,u.push(l)}while(r!==l);a.push(u)}}return e.nodes().forEach((function(e){Object.hasOwn(o,e)||i(e)})),a}})),Rn=o(((e,t)=>{var n=Dn();t.exports=function(e){return n(e).filter((function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}})),Ln=o(((e,t)=>{t.exports=function(e,t,o){return function(e,t,n){var o={},a=e.nodes();return a.forEach((function(e){o[e]={},o[e][e]={distance:0},a.forEach((function(t){e!==t&&(o[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var a=n.v===e?n.w:n.v,i=t(n);o[e][a]={distance:i,predecessor:e}}))})),a.forEach((function(e){var t=o[e];a.forEach((function(n){var i=o[n];a.forEach((function(n){var o=i[e],a=t[n],r=i[n],s=o.distance+a.distance;s<r.distance&&(r.distance=s,r.predecessor=a.predecessor)}))}))})),o}(e,t||n,o||function(t){return e.outEdges(t)})};var n=()=>1})),Pn=o(((e,t)=>{function n(e){var t={},n={},a=[];if(e.sinks().forEach((function i(r){if(Object.hasOwn(n,r))throw new o;Object.hasOwn(t,r)||(n[r]=!0,t[r]=!0,e.predecessors(r).forEach(i),delete n[r],a.push(r))})),Object.keys(t).length!==e.nodeCount())throw new o;return a}var o=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=o})),Vn=o(((e,n)=>{var o=Pn();n.exports=function(e){try{o(e)}catch(t){if(t instanceof o.CycleException)return!1;throw t}return!0}})),qn=o(((e,t)=>{function n(e,t,n,o){for(var i=[[e,!1]];i.length>0;){var r=i.pop();r[1]?o.push(r[0]):Object.hasOwn(n,r[0])||(n[r[0]]=!0,i.push([r[0],!0]),a(t(r[0]),(e=>i.push([e,!1]))))}}function o(e,t,n,o){for(var i=[e];i.length>0;){var r=i.pop();Object.hasOwn(n,r)||(n[r]=!0,o.push(r),a(t(r),(e=>i.push(e))))}}function a(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}t.exports=function(e,t,a){Array.isArray(t)||(t=[t]);var i=e.isDirected()?t=>e.successors(t):t=>e.neighbors(t),r="post"===a?n:o,s=[],l={};return t.forEach((t=>{if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);r(t,i,l,s)})),s}})),Hn=o(((e,t)=>{var n=qn();t.exports=function(e,t){return n(e,t,"post")}})),Fn=o(((e,t)=>{var n=qn();t.exports=function(e,t){return n(e,t,"pre")}})),Wn=o(((e,t)=>{var n=Mn(),o=An();t.exports=function(e,t){var a,i=new n,r={},s=new o;function l(e){var n=e.v===a?e.w:e.v,o=s.priority(n);if(void 0!==o){var i=t(e);i<o&&(r[n]=a,s.decrease(n,i))}}if(0===e.nodeCount())return i;e.nodes().forEach((function(e){s.add(e,Number.POSITIVE_INFINITY),i.setNode(e)})),s.decrease(e.nodes()[0],0);for(var u=!1;s.size()>0;){if(a=s.removeMin(),Object.hasOwn(r,a))i.setEdge(a,r[a]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(a).forEach(l)}return i}})),Yn=o(((e,t)=>{t.exports={components:$n(),dijkstra:Bn(),dijkstraAll:jn(),findCycles:Rn(),floydWarshall:Ln(),isAcyclic:Vn(),postorder:Hn(),preorder:Fn(),prim:Wn(),tarjan:Dn(),topsort:Pn()}})),Xn=o(((e,t)=>{var n=On();t.exports={Graph:n.Graph,json:Sn(),alg:Yn(),version:n.version}})),Un=o(((e,t)=>{function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function o(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return n(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,o)),n=n._prev;return"["+e.join(", ")+"]"}}})),Gn=o(((e,t)=>{var n=Xn().Graph,o=Un();t.exports=function(e,t){if(e.nodeCount()<=1)return[];let s=function(e,t){let a=new n,i=0,s=0;e.nodes().forEach((e=>{a.setNode(e,{v:e,in:0,out:0})})),e.edges().forEach((e=>{let n=a.edge(e.v,e.w)||0,o=t(e),r=n+o;a.setEdge(e.v,e.w,r),s=Math.max(s,a.node(e.v).out+=o),i=Math.max(i,a.node(e.w).in+=o)}));let l=function(e){const t=[];for(let n=0;n<e;n++)t.push(n);return t}(s+i+3).map((()=>new o)),u=i+1;return a.nodes().forEach((e=>{r(l,u,a.node(e))})),{graph:a,buckets:l,zeroIdx:u}}(e,t||a);return function(e,t,n){let o,a=[],r=t[t.length-1],s=t[0];for(;e.nodeCount();){for(;o=s.dequeue();)i(e,t,n,o);for(;o=r.dequeue();)i(e,t,n,o);if(e.nodeCount())for(let r=t.length-2;r>0;--r)if(o=t[r].dequeue(),o){a=a.concat(i(e,t,n,o,!0));break}}return a}(s.graph,s.buckets,s.zeroIdx).flatMap((t=>e.outEdges(t.v,t.w)))};var a=()=>1;function i(e,t,n,o,a){let i=a?[]:void 0;return e.inEdges(o.v).forEach((o=>{let s=e.edge(o),l=e.node(o.v);a&&i.push({v:o.v,w:o.w}),l.out-=s,r(t,n,l)})),e.outEdges(o.v).forEach((o=>{let a=e.edge(o),i=o.w,s=e.node(i);s.in-=a,r(t,n,s)})),e.removeNode(o.v),i}function r(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}})),Zn=o(((e,t)=>{var n=Xn().Graph;function o(e,t,n,o){let a;do{a=l(o)}while(e.hasNode(a));return n.dummy=t,e.setNode(a,n),a}t.exports={addBorderNode:function(e,t,n,a){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=a),o(e,"border",i,t)},addDummyNode:o,applyWithChunking:i,asNonCompoundGraph:function(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach((n=>{e.children(n).length||t.setNode(n,e.node(n))})),e.edges().forEach((n=>{t.setEdge(n,e.edge(n))})),t},buildLayerMatrix:function(e){let t=u(r(e)+1).map((()=>[]));return e.nodes().forEach((n=>{let o=e.node(n),a=o.rank;void 0!==a&&(t[a][o.order]=n)})),t},intersectRect:function(e,t){let n,o,a=e.x,i=e.y,r=t.x-a,s=t.y-i,l=e.width/2,u=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(r)*u?(s<0&&(u=-u),n=u*r/s,o=u):(r<0&&(l=-l),n=l,o=l*s/r),{x:a+n,y:i+o}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce(((e,[t,o])=>(e[t]=n(o,t),e)),{})},maxRank:r,normalizeRanks:function(e){let t=e.nodes().map((t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n})),n=i(Math.min,t);e.nodes().forEach((t=>{let o=e.node(t);Object.hasOwn(o,"rank")&&(o.rank-=n)}))},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach((e=>{t(e)?n.lhs.push(e):n.rhs.push(e)})),n},pick:function(e,t){const n={};for(const o of t)void 0!==e[o]&&(n[o]=e[o]);return n},predecessorWeights:function(e){let t=e.nodes().map((t=>{let n={};return e.inEdges(t).forEach((t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return d(e.nodes(),t)},range:u,removeEmptyRanks:function(e){let t=e.nodes().map((t=>e.node(t).rank)),n=i(Math.min,t),o=[];e.nodes().forEach((t=>{let a=e.node(t).rank-n;o[a]||(o[a]=[]),o[a].push(t)}));let a=0,r=e.graph().nodeRankFactor;Array.from(o).forEach(((t,n)=>{void 0===t&&n%r!=0?--a:void 0!==t&&a&&t.forEach((t=>e.node(t).rank+=a))}))},simplify:function(e){let t=(new n).setGraph(e.graph());return e.nodes().forEach((n=>t.setNode(n,e.node(n)))),e.edges().forEach((n=>{let o=t.edge(n.v,n.w)||{weight:0,minlen:1},a=e.edge(n);t.setEdge(n.v,n.w,{weight:o.weight+a.weight,minlen:Math.max(o.minlen,a.minlen)})})),t},successorWeights:function(e){let t=e.nodes().map((t=>{let n={};return e.outEdges(t).forEach((t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return d(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:l,zipObject:d};var a=65535;function i(e,t){if(t.length>a){const n=function(e,t=a){const n=[];for(let o=0;o<e.length;o+=t){const a=e.slice(o,o+t);n.push(a)}return n}(t);return e.apply(null,n.map((t=>e.apply(null,t))))}return e.apply(null,t)}function r(e){const t=e.nodes().map((t=>{let n=e.node(t).rank;return void 0===n?Number.MIN_VALUE:n}));return i(Math.max,t)}var s=0;function l(e){var t=++s;return toString(e)+t}function u(e,t,n=1){null==t&&(t=e,e=0);let o=e=>e<t;n<0&&(o=e=>t<e);const a=[];for(let i=e;o(i);i+=n)a.push(i);return a}function d(e,t){return e.reduce(((e,n,o)=>(e[n]=t[o],e)),{})}})),Kn=o(((e,t)=>{var n=Gn(),o=Zn().uniqueId;t.exports={run:function(e){("greedy"===e.graph().acyclicer?n(e,function(e){return t=>e.edge(t).weight}(e)):function(e){let t=[],n={},o={};function a(i){Object.hasOwn(o,i)||(o[i]=!0,n[i]=!0,e.outEdges(i).forEach((e=>{Object.hasOwn(n,e.w)?t.push(e):a(e.w)})),delete n[i])}return e.nodes().forEach(a),t}(e)).forEach((t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,o("rev"))}))},undo:function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let o=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,o)}}))}}})),Qn=o(((e,t)=>{var n=Zn();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach((t=>function(e,t){let o,a,i,r=t.v,s=e.node(r).rank,l=t.w,u=e.node(l).rank,d=t.name,c=e.edge(t),h=c.labelRank;if(u!==s+1){for(e.removeEdge(t),i=0,++s;s<u;++i,++s)c.points=[],a={width:0,height:0,edgeLabel:c,edgeObj:t,rank:s},o=n.addDummyNode(e,"edge",a,"_d"),s===h&&(a.width=c.width,a.height=c.height,a.dummy="edge-label",a.labelpos=c.labelpos),e.setEdge(r,o,{weight:c.weight},d),0===i&&e.graph().dummyChains.push(o),r=o;e.setEdge(r,l,{weight:c.weight},d)}}(e,t)))},undo:function(e){e.graph().dummyChains.forEach((t=>{let n,o=e.node(t),a=o.edgeLabel;for(e.setEdge(o.edgeObj,a);o.dummy;)n=e.successors(t)[0],e.removeNode(t),a.points.push({x:o.x,y:o.y}),"edge-label"===o.dummy&&(a.x=o.x,a.y=o.y,a.width=o.width,a.height=o.height),t=n,o=e.node(t)}))}}})),Jn=o(((e,t)=>{var{applyWithChunking:n}=Zn();t.exports={longestPath:function(e){var t={};e.sources().forEach((function o(a){var i=e.node(a);if(Object.hasOwn(t,a))return i.rank;t[a]=!0;let r=e.outEdges(a).map((t=>null==t?Number.POSITIVE_INFINITY:o(t.w)-e.edge(t).minlen));var s=n(Math.min,r);return s===Number.POSITIVE_INFINITY&&(s=0),i.rank=s}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}})),eo=o(((e,t)=>{var n=Xn().Graph,o=Jn().slack;function a(e,t){return e.nodes().forEach((function n(a){t.nodeEdges(a).forEach((i=>{var r=i.v,s=a===r?i.w:r;e.hasNode(s)||o(t,i)||(e.setNode(s,{}),e.setEdge(a,s,{}),n(s))}))})),e.nodeCount()}function i(e,t){return t.edges().reduce(((n,a)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(a.v)!==e.hasNode(a.w)&&(i=o(t,a)),i<n[0]?[i,a]:n}),[Number.POSITIVE_INFINITY,null])[1]}function r(e,t,n){e.nodes().forEach((e=>t.node(e).rank+=n))}t.exports=function(e){var t,s,l=new n({directed:!1}),u=e.nodes()[0],d=e.nodeCount();for(l.setNode(u,{});a(l,e)<d;)t=i(l,e),s=l.hasNode(t.v)?o(e,t):-o(e,t),r(l,e,s);return l}})),to=o(((e,t)=>{var n=eo(),o=Jn().slack,a=Jn().longestPath,i=Xn().alg.preorder,r=Xn().alg.postorder,s=Zn().simplify;function l(e){e=s(e),a(e);var t,o=n(e);for(c(o),u(o,e);t=p(o);)f(o,e,t,v(o,e,t))}function u(e,t){var n=r(e,e.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(e,t,n){var o=e.node(n).parent;e.edge(n,o).cutvalue=d(e,t,n)}(e,t,n)))}function d(e,t,n){var o=e.node(n).parent,a=!0,i=t.edge(n,o),r=0;return i||(a=!1,i=t.edge(o,n)),r=i.weight,t.nodeEdges(n).forEach((i=>{var s,l,u=i.v===n,d=u?i.w:i.v;if(d!==o){var c=u===a,h=t.edge(i).weight;if(r+=c?h:-h,s=n,l=d,e.hasEdge(s,l)){var p=e.edge(n,d).cutvalue;r+=c?-p:p}}})),r}function c(e,t){arguments.length<2&&(t=e.nodes()[0]),h(e,{},1,t)}function h(e,t,n,o,a){var i=n,r=e.node(o);return t[o]=!0,e.neighbors(o).forEach((a=>{Object.hasOwn(t,a)||(n=h(e,t,n,a,o))})),r.low=i,r.lim=n++,a?r.parent=a:delete r.parent,n}function p(e){return e.edges().find((t=>e.edge(t).cutvalue<0))}function v(e,t,n){var a=n.v,i=n.w;t.hasEdge(a,i)||(a=n.w,i=n.v);var r=e.node(a),s=e.node(i),l=r,u=!1;return r.lim>s.lim&&(l=s,u=!0),t.edges().filter((t=>u===g(0,e.node(t.v),l)&&u!==g(0,e.node(t.w),l))).reduce(((e,n)=>o(t,n)<o(t,e)?n:e))}function f(e,t,n,o){var a=n.v,r=n.w;e.removeEdge(a,r),e.setEdge(o.v,o.w,{}),c(e),u(e,t),function(e,t){var n=i(e,e.nodes().find((e=>!t.node(e).parent)));(n=n.slice(1)).forEach((n=>{var o=e.node(n).parent,a=t.edge(n,o),i=!1;a||(a=t.edge(o,n),i=!0),t.node(n).rank=t.node(o).rank+(i?a.minlen:-a.minlen)}))}(e,t)}function g(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=l,l.initLowLimValues=c,l.initCutValues=u,l.calcCutValue=d,l.leaveEdge=p,l.enterEdge=v,l.exchangeEdges=f})),no=o(((e,t)=>{var n=Jn().longestPath,o=eo(),a=to();t.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:r(e);break;case"tight-tree":!function(e){n(e),o(e)}(e);break;case"longest-path":i(e)}};var i=n;function r(e){a(e)}})),oo=o(((e,t)=>{t.exports=function(e){let t=function(e){let t={},n=0;function o(a){let i=n;e.children(a).forEach(o),t[a]={low:i,lim:n++}}return e.children().forEach(o),t}(e);e.graph().dummyChains.forEach((n=>{let o=e.node(n),a=o.edgeObj,i=function(e,t,n,o){let a,i,r=[],s=[],l=Math.min(t[n].low,t[o].low),u=Math.max(t[n].lim,t[o].lim);a=n;do{a=e.parent(a),r.push(a)}while(a&&(t[a].low>l||u>t[a].lim));for(i=a,a=o;(a=e.parent(a))!==i;)s.push(a);return{path:r.concat(s.reverse()),lca:i}}(e,t,a.v,a.w),r=i.path,s=i.lca,l=0,u=r[l],d=!0;for(;n!==a.w;){if(o=e.node(n),d){for(;(u=r[l])!==s&&e.node(u).maxRank<o.rank;)l++;u===s&&(d=!1)}if(!d){for(;l<r.length-1&&e.node(u=r[l+1]).minRank<=o.rank;)l++;u=r[l]}e.setParent(n,u),n=e.successors(n)[0]}}))}})),ao=o(((e,t)=>{var n=Zn();function o(e,t,a,i,r,s,l){let u=e.children(l);if(!u.length)return void(l!==t&&e.setEdge(t,l,{weight:0,minlen:a}));let d=n.addBorderNode(e,"_bt"),c=n.addBorderNode(e,"_bb"),h=e.node(l);e.setParent(d,l),h.borderTop=d,e.setParent(c,l),h.borderBottom=c,u.forEach((n=>{o(e,t,a,i,r,s,n);let u=e.node(n),h=u.borderTop?u.borderTop:n,p=u.borderBottom?u.borderBottom:n,v=u.borderTop?i:2*i,f=h!==p?1:r-s[l]+1;e.setEdge(d,h,{weight:v,minlen:f,nestingEdge:!0}),e.setEdge(p,c,{weight:v,minlen:f,nestingEdge:!0})})),e.parent(l)||e.setEdge(t,d,{weight:0,minlen:r+s[l]})}t.exports={run:function(e){let t=n.addDummyNode(e,"root",{},"_root"),a=function(e){var t={};function n(o,a){var i=e.children(o);i&&i.length&&i.forEach((e=>n(e,a+1))),t[o]=a}return e.children().forEach((e=>n(e,1))),t}(e),i=Object.values(a),r=n.applyWithChunking(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach((t=>e.edge(t).minlen*=s));let l=function(e){return e.edges().reduce(((t,n)=>t+e.edge(n).weight),0)}(e)+1;e.children().forEach((n=>o(e,t,s,l,r,a,n))),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach((t=>{e.edge(t).nestingEdge&&e.removeEdge(t)}))}}})),io=o(((e,t)=>{var n=Zn();function o(e,t,o,a,i,r){let s={width:0,height:0,rank:r,borderType:t},l=i[t][r-1],u=n.addDummyNode(e,"border",s,o);i[t][r]=u,e.setParent(u,a),l&&e.setEdge(l,u,{weight:1})}t.exports=function(e){e.children().forEach((function t(n){let a=e.children(n),i=e.node(n);if(a.length&&a.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,a=i.maxRank+1;t<a;++t)o(e,"borderLeft","_bl",n,i,t),o(e,"borderRight","_br",n,i,t)}}))}})),ro=o(((e,t)=>{function n(e){e.nodes().forEach((t=>o(e.node(t)))),e.edges().forEach((t=>o(e.edge(t))))}function o(e){let t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||n(e)},undo:function(e){let t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){e.nodes().forEach((t=>a(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.points.forEach(a),Object.hasOwn(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){e.nodes().forEach((t=>i(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);n.points.forEach(i),Object.hasOwn(n,"x")&&i(n)}))}(e),n(e))}}})),so=o(((e,t)=>{var n=Zn();t.exports=function(e){let t={},o=e.nodes().filter((t=>!e.children(t).length)),a=o.map((t=>e.node(t).rank)),i=n.applyWithChunking(Math.max,a),r=n.range(i+1).map((()=>[]));return o.sort(((t,n)=>e.node(t).rank-e.node(n).rank)).forEach((function n(o){t[o]||(t[o]=!0,r[e.node(o).rank].push(o),e.successors(o).forEach(n))})),r}})),lo=o(((e,t)=>{var n=Zn().zipObject;function o(e,t,o){let a=n(o,o.map(((e,t)=>t))),i=t.flatMap((t=>e.outEdges(t).map((t=>({pos:a[t.w],weight:e.edge(t).weight}))).sort(((e,t)=>e.pos-t.pos)))),r=1;for(;r<o.length;)r<<=1;let s=2*r-1;r-=1;let l=new Array(s).fill(0),u=0;return i.forEach((e=>{let t=e.pos+r;l[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=l[t+1]),t=t-1>>1,l[t]+=e.weight;u+=e.weight*n})),u}t.exports=function(e,t){let n=0;for(let a=1;a<t.length;++a)n+=o(e,t[a-1],t[a]);return n}})),uo=o(((e,t)=>{t.exports=function(e,t=[]){return t.map((t=>{let n=e.inEdges(t);if(n.length){let o=n.reduce(((t,n)=>{let o=e.edge(n),a=e.node(n.v);return{sum:t.sum+o.weight*a.order,weight:t.weight+o.weight}}),{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}return{v:t}}))}})),co=o(((e,t)=>{var n=Zn();t.exports=function(e,t){let o={};return e.forEach(((e,t)=>{let n=o[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(n.barycenter=e.barycenter,n.weight=e.weight)})),t.edges().forEach((e=>{let t=o[e.v],n=o[e.w];void 0!==t&&void 0!==n&&(n.indegree++,t.out.push(o[e.w]))})),function(e){let t=[];function o(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,o=0;e.weight&&(n+=e.barycenter*e.weight,o+=e.weight),t.weight&&(n+=t.barycenter*t.weight,o+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/o,e.weight=o,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function a(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(o(n)),n.out.forEach(a(n))}return t.filter((e=>!e.merged)).map((e=>n.pick(e,["vs","i","barycenter","weight"])))}(Object.values(o).filter((e=>!e.indegree)))}})),ho=o(((e,t)=>{var n=Zn();function o(e,t,n){let o;for(;t.length&&(o=t[t.length-1]).i<=n;)t.pop(),e.push(o.vs),n++;return n}t.exports=function(e,t){let a=n.partition(e,(e=>Object.hasOwn(e,"barycenter"))),i=a.lhs,r=a.rhs.sort(((e,t)=>t.i-e.i)),s=[],l=0,u=0,d=0;var c;i.sort((c=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:c?t.i-e.i:e.i-t.i)),d=o(s,r,d),i.forEach((e=>{d+=e.vs.length,s.push(e.vs),l+=e.barycenter*e.weight,u+=e.weight,d=o(s,r,d)}));let h={vs:s.flat(!0)};return u&&(h.barycenter=l/u,h.weight=u),h}})),po=o(((e,t)=>{var n=uo(),o=co(),a=ho();t.exports=function e(t,i,r,s){let l=t.children(i),u=t.node(i),d=u?u.borderLeft:void 0,c=u?u.borderRight:void 0,h={};d&&(l=l.filter((e=>e!==d&&e!==c)));let p=n(t,l);p.forEach((n=>{if(t.children(n.v).length){let o=e(t,n.v,r,s);h[n.v]=o,Object.hasOwn(o,"barycenter")&&function(e,t){void 0!==e.barycenter?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}(n,o)}}));let v=o(p,r);!function(e,t){e.forEach((e=>{e.vs=e.vs.flatMap((e=>t[e]?t[e].vs:e))}))}(v,h);let f=a(v,s);if(d&&(f.vs=[d,f.vs,c].flat(!0),t.predecessors(d).length)){let e=t.node(t.predecessors(d)[0]),n=t.node(t.predecessors(c)[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+e.order+n.order)/(f.weight+2),f.weight+=2}return f}})),vo=o(((e,t)=>{var n=Xn().Graph,o=Zn();t.exports=function(e,t,a){let i=function(e){for(var t;e.hasNode(t=o.uniqueId("_root")););return t}(e),r=new n({compound:!0}).setGraph({root:i}).setDefaultNodeLabel((t=>e.node(t)));return e.nodes().forEach((n=>{let o=e.node(n),s=e.parent(n);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(r.setNode(n),r.setParent(n,s||i),e[a](n).forEach((t=>{let o=t.v===n?t.w:t.v,a=r.edge(o,n),i=void 0!==a?a.weight:0;r.setEdge(o,n,{weight:e.edge(t).weight+i})})),Object.hasOwn(o,"minRank")&&r.setNode(n,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))})),r}})),fo=o(((e,t)=>{t.exports=function(e,t,n){let o,a={};n.forEach((n=>{let i,r,s=e.parent(n);for(;s;){if(i=e.parent(s),i?(r=a[i],a[i]=s):(r=o,o=s),r&&r!==s)return void t.setEdge(r,s);s=i}}))}})),go=o(((e,t)=>{var n=so(),o=lo(),a=po(),i=vo(),r=fo(),s=Xn().Graph,l=Zn();function u(e,t,n){return t.map((function(t){return i(e,t,n)}))}function d(e,t){let n=new s;e.forEach((function(e){let o=e.graph().root,i=a(e,o,n,t);i.vs.forEach(((t,n)=>e.node(t).order=n)),r(e,n,i.vs)}))}function c(e,t){Object.values(t).forEach((t=>t.forEach(((t,n)=>e.node(t).order=n))))}t.exports=function e(t,a){if(a&&"function"==typeof a.customOrder)return void a.customOrder(t,e);let i=l.maxRank(t),r=u(t,l.range(1,i+1),"inEdges"),s=u(t,l.range(i-1,-1,-1),"outEdges"),h=n(t);if(c(t,h),a&&a.disableOptimalOrderHeuristic)return;let p,v=Number.POSITIVE_INFINITY;for(let n=0,u=0;u<4;++n,++u){d(n%2?r:s,n%4>=2),h=l.buildLayerMatrix(t);let e=o(t,h);e<v&&(u=0,p=Object.assign({},h),v=e)}c(t,p)}})),_o=o(((e,t)=>{var n=Xn().Graph,o=Zn();function a(e,t){let n={};return t.length&&t.reduce((function(t,o){let a=0,i=0,s=t.length,l=o[o.length-1];return o.forEach(((t,u)=>{let d=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find((t=>e.node(t).dummy))}(e,t),c=d?e.node(d).order:s;(d||t===l)&&(o.slice(i,u+1).forEach((t=>{e.predecessors(t).forEach((o=>{let i=e.node(o),s=i.order;!(s<a||c<s)||i.dummy&&e.node(t).dummy||r(n,o,t)}))})),i=u+1,a=c)})),o})),n}function i(e,t){let n={};function a(t,a,i,s,l){let u;o.range(a,i).forEach((o=>{u=t[o],e.node(u).dummy&&e.predecessors(u).forEach((t=>{let o=e.node(t);o.dummy&&(o.order<s||o.order>l)&&r(n,t,u)}))}))}return t.length&&t.reduce((function(t,n){let o,i=-1,r=0;return n.forEach(((s,l)=>{if("border"===e.node(s).dummy){let t=e.predecessors(s);t.length&&(o=e.node(t[0]).order,a(n,r,l,i,o),r=l,i=o)}a(n,r,n.length,o,t.length)})),n})),n}function r(e,t,n){if(t>n){let e=t;t=n,n=e}let o=e[t];o||(e[t]=o={}),o[n]=!0}function s(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function l(e,t,n,o){let a={},i={},r={};return t.forEach((e=>{e.forEach(((e,t)=>{a[e]=e,i[e]=e,r[e]=t}))})),t.forEach((e=>{let t=-1;e.forEach((e=>{let l=o(e);if(l.length){l=l.sort(((e,t)=>r[e]-r[t]));let o=(l.length-1)/2;for(let u=Math.floor(o),d=Math.ceil(o);u<=d;++u){let o=l[u];i[e]===e&&t<r[o]&&!s(n,e,o)&&(i[o]=e,i[e]=a[e]=a[o],t=r[o])}}}))})),{root:a,align:i}}function u(e,t,o,a,i){let r={},s=function(e,t,o,a){let i=new n,r=e.graph(),s=function(e,t,n){return(o,a,i)=>{let r,s=o.node(a),l=o.node(i),u=0;if(u+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":r=-s.width/2;break;case"r":r=s.width/2}if(r&&(u+=n?r:-r),r=0,u+=(s.dummy?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":r=l.width/2;break;case"r":r=-l.width/2}return r&&(u+=n?r:-r),r=0,u}}(r.nodesep,r.edgesep,a);return t.forEach((t=>{let n;t.forEach((t=>{let a=o[t];if(i.setNode(a),n){var r=o[n],l=i.edge(r,a);i.setEdge(r,a,Math.max(s(e,t,n),l||0))}n=t}))})),i}(e,t,o,i),l=i?"borderLeft":"borderRight";function u(e,t){let n=s.nodes(),o=n.pop(),a={};for(;o;)a[o]?e(o):(a[o]=!0,n.push(o),n=n.concat(t(o))),o=n.pop()}return u((function(e){r[e]=s.inEdges(e).reduce(((e,t)=>Math.max(e,r[t.v]+s.edge(t))),0)}),s.predecessors.bind(s)),u((function(t){let n=s.outEdges(t).reduce(((e,t)=>Math.min(e,r[t.w]-s.edge(t))),Number.POSITIVE_INFINITY),o=e.node(t);n!==Number.POSITIVE_INFINITY&&o.borderType!==l&&(r[t]=Math.max(r[t],n))}),s.successors.bind(s)),Object.keys(a).forEach((e=>r[e]=r[o[e]])),r}function d(e,t){return Object.values(t).reduce(((t,n)=>{let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([t,n])=>{let i=function(e,t){return e.node(t).width}(e,t)/2;o=Math.max(n+i,o),a=Math.min(n-i,a)}));const i=o-a;return i<t[0]&&(t=[i,n]),t}),[Number.POSITIVE_INFINITY,null])[1]}function c(e,t){let n=Object.values(t),a=o.applyWithChunking(Math.min,n),i=o.applyWithChunking(Math.max,n);["u","d"].forEach((n=>{["l","r"].forEach((r=>{let s=n+r,l=e[s];if(l===t)return;let u=Object.values(l),d=a-o.applyWithChunking(Math.min,u);"l"!==r&&(d=i-o.applyWithChunking(Math.max,u)),d&&(e[s]=o.mapValues(l,(e=>e+d)))}))}))}function h(e,t){return o.mapValues(e.ul,((n,o)=>{if(t)return e[t.toLowerCase()][o];{let t=Object.values(e).map((e=>e[o])).sort(((e,t)=>e-t));return(t[1]+t[2])/2}}))}t.exports={positionX:function(e){let t,n=o.buildLayerMatrix(e),r=Object.assign(a(e,n),i(e,n)),s={};return["u","d"].forEach((a=>{t="u"===a?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(t=t.map((e=>Object.values(e).reverse())));let i=("u"===a?e.predecessors:e.successors).bind(e),d=l(0,t,r,i),c=u(e,t,d.root,d.align,"r"===n);"r"===n&&(c=o.mapValues(c,(e=>-e))),s[a+n]=c}))})),c(s,d(e,s)),h(s,e.graph().align)},findType1Conflicts:a,findType2Conflicts:i,addConflict:r,hasConflict:s,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:c,findSmallestWidthAlignment:d,balance:h}})),mo=o(((e,t)=>{var n=Zn(),o=_o().positionX;t.exports=function(e){(function(e){let t=n.buildLayerMatrix(e),o=e.graph().ranksep,a=0;t.forEach((t=>{const n=t.reduce(((t,n)=>{const o=e.node(n).height;return t>o?t:o}),0);t.forEach((t=>e.node(t).y=a+n/2)),a+=n+o}))})(e=n.asNonCompoundGraph(e)),Object.entries(o(e)).forEach((([t,n])=>e.node(t).x=n))}})),yo=o(((e,t)=>{var n=Kn(),o=Qn(),a=no(),i=Zn().normalizeRanks,r=oo(),s=Zn().removeEmptyRanks,l=ao(),u=io(),d=ro(),c=go(),h=mo(),p=Zn(),v=Xn().Graph;t.exports=function(e,t){let z=t&&t.debugTiming?p.time:p.notime;z("layout",(()=>{let N=z("  buildLayoutGraph",(()=>function(e){let t=new v({multigraph:!0,compound:!0}),n=E(e.graph());return t.setGraph(Object.assign({},g,k(n,f),p.pick(n,_))),e.nodes().forEach((n=>{const o=k(E(e.node(n)),m);Object.keys(y).forEach((e=>{void 0===o[e]&&(o[e]=y[e])})),t.setNode(n,o),t.setParent(n,e.parent(n))})),e.edges().forEach((n=>{let o=E(e.edge(n));t.setEdge(n,Object.assign({},w,k(o,b),p.pick(o,x)))})),t}(e)));z("  runLayout",(()=>function(e,t,v){t("    makeSpaceForEdgeLabels",(()=>function(e){let t=e.graph();t.ranksep/=2,e.edges().forEach((n=>{let o=e.edge(n);o.minlen*=2,"c"!==o.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?o.width+=o.labeloffset:o.height+=o.labeloffset)}))}(e))),t("    removeSelfEdges",(()=>function(e){e.edges().forEach((t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e))),t("    acyclic",(()=>n.run(e))),t("    nestingGraph.run",(()=>l.run(e))),t("    rank",(()=>a(p.asNonCompoundGraph(e)))),t("    injectEdgeLabelProxies",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v),o={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,"edge-proxy",o,"_ep")}}))}(e))),t("    removeEmptyRanks",(()=>s(e))),t("    nestingGraph.cleanup",(()=>l.cleanup(e))),t("    normalizeRanks",(()=>i(e))),t("    assignRankMinMax",(()=>function(e){let t=0;e.nodes().forEach((n=>{let o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=Math.max(t,o.maxRank))})),e.graph().maxRank=t}(e))),t("    removeEdgeLabelProxies",(()=>function(e){e.nodes().forEach((t=>{let n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e))),t("    normalize.run",(()=>o.run(e))),t("    parentDummyChains",(()=>r(e))),t("    addBorderSegments",(()=>u(e))),t("    order",(()=>c(e,v))),t("    insertSelfEdges",(()=>function(e){p.buildLayerMatrix(e).forEach((t=>{var n=0;t.forEach(((t,o)=>{var a=e.node(t);a.order=o+n,(a.selfEdges||[]).forEach((t=>{p.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:a.rank,order:o+ ++n,e:t.e,label:t.label},"_se")})),delete a.selfEdges}))}))}(e))),t("    adjustCoordinateSystem",(()=>d.adjust(e))),t("    position",(()=>h(e))),t("    positionSelfEdges",(()=>function(e){e.nodes().forEach((t=>{var n=e.node(t);if("selfedge"===n.dummy){var o=e.node(n.e.v),a=o.x+o.width/2,i=o.y,r=n.x-a,s=o.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:a+2*r/3,y:i-s},{x:a+5*r/6,y:i-s},{x:a+r,y:i},{x:a+5*r/6,y:i+s},{x:a+2*r/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}}))}(e))),t("    removeBorderNodes",(()=>function(e){e.nodes().forEach((t=>{if(e.children(t).length){let n=e.node(t),o=e.node(n.borderTop),a=e.node(n.borderBottom),i=e.node(n.borderLeft[n.borderLeft.length-1]),r=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(r.x-i.x),n.height=Math.abs(a.y-o.y),n.x=i.x+n.width/2,n.y=o.y+n.height/2}})),e.nodes().forEach((t=>{"border"===e.node(t).dummy&&e.removeNode(t)}))}(e))),t("    normalize.undo",(()=>o.undo(e))),t("    fixupEdgeLabelCoords",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e))),t("    undoCoordinateSystem",(()=>d.undo(e))),t("    translateGraph",(()=>function(e){let t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,a=0,i=e.graph(),r=i.marginx||0,s=i.marginy||0;function l(e){let i=e.x,r=e.y,s=e.width,l=e.height;t=Math.min(t,i-s/2),n=Math.max(n,i+s/2),o=Math.min(o,r-l/2),a=Math.max(a,r+l/2)}e.nodes().forEach((t=>l(e.node(t)))),e.edges().forEach((t=>{let n=e.edge(t);Object.hasOwn(n,"x")&&l(n)})),t-=r,o-=s,e.nodes().forEach((n=>{let a=e.node(n);a.x-=t,a.y-=o})),e.edges().forEach((n=>{let a=e.edge(n);a.points.forEach((e=>{e.x-=t,e.y-=o})),Object.hasOwn(a,"x")&&(a.x-=t),Object.hasOwn(a,"y")&&(a.y-=o)})),i.width=n-t+r,i.height=a-o+s}(e))),t("    assignNodeIntersects",(()=>function(e){e.edges().forEach((t=>{let n,o,a=e.edge(t),i=e.node(t.v),r=e.node(t.w);a.points?(n=a.points[0],o=a.points[a.points.length-1]):(a.points=[],n=r,o=i),a.points.unshift(p.intersectRect(i,n)),a.points.push(p.intersectRect(r,o))}))}(e))),t("    reversePoints",(()=>function(e){e.edges().forEach((t=>{let n=e.edge(t);n.reversed&&n.points.reverse()}))}(e))),t("    acyclic.undo",(()=>n.undo(e)))}(N,z,t))),z("  updateInputGraph",(()=>function(e,t){e.nodes().forEach((n=>{let o=e.node(n),a=t.node(n);o&&(o.x=a.x,o.y=a.y,o.rank=a.rank,t.children(n).length&&(o.width=a.width,o.height=a.height))})),e.edges().forEach((n=>{let o=e.edge(n),a=t.edge(n);o.points=a.points,Object.hasOwn(a,"x")&&(o.x=a.x,o.y=a.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,N)))}))};var f=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],m=["width","height"],y={width:0,height:0},b=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},x=["labelpos"];function k(e,t){return p.mapValues(p.pick(e,t),Number)}function E(e){var t={};return e&&Object.entries(e).forEach((([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n})),t}})),bo=o(((e,t)=>{var n=Zn(),o=Xn().Graph;t.exports={debugOrdering:function(e){let t=n.buildLayerMatrix(e),a=new o({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach((t=>{a.setNode(t,{label:t}),a.setParent(t,"layer"+e.node(t).rank)})),e.edges().forEach((e=>a.setEdge(e.v,e.w,{},e.name))),t.forEach(((e,t)=>{let n="layer"+t;a.setNode(n,{rank:"same"}),e.reduce(((e,t)=>(a.setEdge(e,t,{style:"invis"}),t)))})),a}}})),wo=o(((e,t)=>{t.exports="1.1.4"})),xo=n(o(((e,t)=>{t.exports={graphlib:Xn(),layout:yo(),debug:bo(),util:{time:Zn().time,notime:Zn().notime},version:wo()}}))(),1),ko=128,Eo=96,zo=128,No=48,Co=128,To=64,Mo={value:()=>{}},qr.prototype=Vr.prototype={constructor:qr,on:function(e,t){var n,o=this._,a=Hr(e+"",o),i=-1,r=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<r;)if(n=(e=a[i]).type)o[n]=Wr(o[n],e.name,t);else if(null==t)for(n in o)o[n]=Wr(o[n],e.name,null);return this}for(;++i<r;)if((n=(e=a[i]).type)&&(n=Fr(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new qr(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,a=new Array(n),i=0;i<n;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(o=this._[e]).length;i<n;++i)o[i].value.apply(t,a)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],a=0,i=o.length;a<i;++a)o[a].value.apply(t,n)}},Oo={svg:"http://www.w3.org/2000/svg",xhtml:Io="http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},So=Array.prototype.find,$o=Array.prototype.filter,hs.prototype={constructor:hs,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)}},Zs.prototype={add:function(e){this._names.indexOf(e)<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}},Ao=[null],$l.prototype=Al.prototype={constructor:$l,select:Qr,selectAll:ns,selectChild:rs,selectChildren:ls,filter:us,data:_s,enter:cs,exit:ys,join:bs,merge:ws,selection:Bl,order:xs,sort:ks,call:zs,nodes:Ns,node:Cs,size:Ts,empty:Ms,each:Is,attr:Ds,style:qs,property:Xs,classed:nl,text:rl,html:dl,raise:hl,lower:vl,append:fl,insert:_l,remove:yl,clone:xl,datum:kl,on:Cl,dispatch:Ol,[Symbol.iterator]:Sl},Bo={capture:!0,passive:!1},Do=1/(jo=.7),Ro="\\s*([+-]?\\d+)\\s*",Lo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Po="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vo=/^#([0-9a-f]{3,8})$/,qo=new RegExp(`^rgb\\(${Ro},${Ro},${Ro}\\)$`),Ho=new RegExp(`^rgb\\(${Po},${Po},${Po}\\)$`),Fo=new RegExp(`^rgba\\(${Ro},${Ro},${Ro},${Lo}\\)$`),Wo=new RegExp(`^rgba\\(${Po},${Po},${Po},${Lo}\\)$`),Yo=new RegExp(`^hsl\\(${Lo},${Po},${Po}\\)$`),Xo=new RegExp(`^hsla\\(${Lo},${Po},${Po},${Lo}\\)$`),Uo={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},Vl(Hl,Ul,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fl,formatHex:Fl,formatHex8:Wl,formatHsl:Yl,formatRgb:Xl,toString:Xl}),Vl(Jl,Ql,ql(Hl,{brighter(e){return e=null==e?Do:Math.pow(Do,e),new Jl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?jo:Math.pow(jo,e),new Jl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jl(au(this.r),au(this.g),au(this.b),ou(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:eu,formatHex:eu,formatHex8:tu,formatRgb:nu,toString:nu})),Vl(uu,lu,ql(Hl,{brighter(e){return e=null==e?Do:Math.pow(Do,e),new uu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?jo:Math.pow(jo,e),new uu(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,a=2*n-o;return new Jl(hu(e>=240?e-240:e+120,a,o),hu(e,a,o),hu(e<120?e+240:e-120,a,o),this.opacity)},clamp(){return new uu(du(this.h),cu(this.s),cu(this.l),ou(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=ou(this.opacity);return`${1===e?"hsl(":"hsla("}${du(this.h)}, ${100*cu(this.s)}%, ${100*cu(this.l)}%${1===e?")":`, ${e})`}`}})),Go=e=>()=>e,Zo=function e(t){var n=pu(t);function o(e,t){var o=n((e=Ql(e)).r,(t=Ql(t)).r),a=n(e.g,t.g),i=n(e.b,t.b),r=vu(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=a(t),e.b=i(t),e.opacity=r(t),e+""}}return o.gamma=e,o}(1),Ko=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qo=new RegExp(Ko.source,"g"),Jo=180/Math.PI,ea={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},na=bu(mu,"px, ","px)","deg)"),oa=bu(yu,", ",")",")"),aa=function e(t,n,o){function a(e,a){var i,r,s=e[0],l=e[1],u=e[2],d=a[0],c=a[1],h=a[2],p=d-s,v=c-l,f=p*p+v*v;if(f<1e-12)r=Math.log(h/u)/t,i=function(e){return[s+e*p,l+e*v,u*Math.exp(t*e*r)]};else{var g=Math.sqrt(f),_=(h*h-u*u+o*f)/(2*u*n*g),m=(h*h-u*u-o*f)/(2*h*n*g),y=Math.log(Math.sqrt(_*_+1)-_);r=(Math.log(Math.sqrt(m*m+1)-m)-y)/t,i=function(e){var o,a=e*r,i=wu(y),d=u/(n*g)*(i*(o=t*a+y,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(y));return[s+d*p,l+d*v,u*i/wu(t*a+y)]}}return i.duration=1e3*r*t/Math.SQRT2,i}return a.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},a}(Math.SQRT2,2,4),ia=0,ra=0,sa=0,la=1e3,ca=0,ha=0,pa=0,va="object"==typeof performance&&performance.now?performance:Date,fa="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)},Eu.prototype=zu.prototype={constructor:Eu,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?xu():+n)+(null==t?0:+t),this._next||da===this||(da?da._next=this:ua=this,da=this),this._call=e,this._time=n,Tu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tu())}},ga=Vr("start","end","cancel","interrupt"),_a=[],ma=0,ya=1,ba=2,wa=3,xa=4,ka=5,Ea=6,za=Al.prototype.constructor,Na=0,Ca=Al.prototype,Cd.prototype={constructor:Cd,select:pd,selectAll:vd,selectChild:Ca.selectChild,selectChildren:Ca.selectChildren,filter:ld,merge:ud,selection:fd,transition:zd,call:Ca.call,nodes:Ca.nodes,node:Ca.node,size:Ca.size,empty:Ca.empty,each:Ca.each,on:cd,attr:Xu,attrTween:Qu,style:_d,styleTween:bd,text:wd,textTween:Ed,remove:hd,tween:Ru,delay:td,duration:ad,ease:rd,easeVarying:sd,end:Nd,[Symbol.iterator]:Ca[Symbol.iterator]},Ta={time:null,delay:0,duration:250,ease:Md},Al.prototype.interrupt=Bu,Al.prototype.transition=Od,Ma=e=>()=>e,$d.prototype={constructor:$d,scale:function(e){return 1===e?this:new $d(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new $d(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+")"}},Ia=new $d(1,0,0),$d.prototype,Oa=Symbol("MiniMapSlots"),Sa=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],$a=p({name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:t}){const n=e,o=f(Oa),i=B(),s=r((()=>i.style??{}));function u(e){t("click",e)}function d(e){t("dblclick",e)}function c(e){t("mouseenter",e)}function h(e){t("mousemove",e)}function p(e){t("mouseleave",e)}return(e,t)=>e.hidden||0===e.dimensions.width||0===e.dimensions.height?m("",!0):(a(),l(E,{key:0},[w(o)[`node-${n.type}`]?(a(),F(P(w(o)[`node-${n.type}`]),H(y({key:0},{...n,...e.$attrs})),null,16)):(a(),l("rect",y({key:1,id:e.id},e.$attrs,{class:["vue-flow__minimap-node",{selected:e.selected,dragging:e.dragging}],x:e.position.x,y:e.position.y,rx:e.borderRadius,ry:e.borderRadius,width:e.dimensions.width,height:e.dimensions.height,fill:e.color||s.value.background||s.value.backgroundColor,stroke:e.strokeColor,"stroke-width":e.strokeWidth,"shape-rendering":e.shapeRendering,onClick:u,onDblclick:d,onMouseenter:c,onMousemove:h,onMouseleave:p}),null,16,Sa))],64))}}),Aa=["width","height","viewBox","aria-labelledby"],Ba=["id"],ja=["d","fill","stroke","stroke-width"],Da=p({name:"MiniMap",compatConfig:{MODE:3},props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:t}){const n=I(),o=B(),{id:i,edges:u,viewport:c,translateExtent:h,dimensions:p,emits:v,d3Selection:f,d3Zoom:y,getNodesInitialized:b}=ze(),x=d();V(Oa,n);const k=r((()=>{var t;return e.width??(null==(t=o.style)?void 0:t.width)??200})),C=r((()=>{var t;return e.height??(null==(t=o.style)?void 0:t.height)??150})),T="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision",M=g((()=>"string"==typeof e.nodeColor?()=>e.nodeColor:e.nodeColor)),O=g((()=>"string"==typeof e.nodeStrokeColor?()=>e.nodeStrokeColor:e.nodeStrokeColor)),S=g((()=>"string"==typeof e.nodeClassName?()=>e.nodeClassName:"function"==typeof e.nodeClassName?e.nodeClassName:()=>"")),$=g((()=>it(b.value.filter((e=>!e.hidden))))),A=g((()=>({x:-c.value.x/c.value.zoom,y:-c.value.y/c.value.zoom,width:p.value.width/c.value.zoom,height:p.value.height/c.value.zoom}))),j=g((()=>b.value&&b.value.length?Ne($.value,A.value):A.value)),D=g((()=>{const e=j.value.width/k.value,t=j.value.height/C.value;return Math.max(e,t)})),R=g((()=>{const t=D.value*k.value,n=D.value*C.value,o=e.offsetScale*D.value;return{offset:o,x:j.value.x-(t-j.value.width)/2-o,y:j.value.y-(n-j.value.height)/2-o,width:t+2*o,height:n+2*o}})),P=g((()=>R.value.x&&R.value.y?`\n    M${R.value.x-R.value.offset},${R.value.y-R.value.offset}\n    h${R.value.width+2*R.value.offset}\n    v${R.value.height+2*R.value.offset}\n    h${-R.value.width-2*R.value.offset}z\n    M${A.value.x+e.maskBorderRadius},${A.value.y}\n    h${A.value.width-2*e.maskBorderRadius}\n    a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}\n    v${A.value.height-2*e.maskBorderRadius}\n    a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}\n    h${-(A.value.width-2*e.maskBorderRadius)}\n    a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}\n    v${-(A.value.height-2*e.maskBorderRadius)}\n    a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`:""));function q(e){const[n,o]=Dl(e);t("click",{event:e,position:{x:n,y:o}})}return N((t=>{if(x.value){const n=jl(x.value),o=t=>{if("wheel"!==t.sourceEvent.type||!f.value||!y.value)return;const n=t.sourceEvent.ctrlKey&&be()?10:1,o=-t.sourceEvent.deltaY*(1===t.sourceEvent.deltaMode?.05:t.sourceEvent.deltaMode?1:.002)*e.zoomStep,a=c.value.zoom*2**(o*n);y.value.scaleTo(f.value,a)},a=t=>{if("mousemove"!==t.sourceEvent.type||!f.value||!y.value)return;const n=D.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),o={x:c.value.x-t.sourceEvent.movementX*n,y:c.value.y-t.sourceEvent.movementY*n},a=[[0,0],[p.value.width,p.value.height]],i=Ia.translate(o.x,o.y).scale(c.value.zoom),r=y.value.constrain()(i,a,h.value);y.value.transform(f.value,r)},i=function(){var e,t,n,o=jd,a=Dd,i=Vd,r=Ld,s=Pd,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,c=aa,h=Vr("start","zoom","end"),p=500,v=0,f=10;function g(e){e.property("__zoom",Rd).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",z).filter(s).on("touchstart.zoom",N).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new $d(t,e.x,e.y)}function m(e,t,n){var o=t[0]-n[0]*e.k,a=t[1]-n[1]*e.k;return o===e.x&&a===e.y?e:new $d(e.k,o,a)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,o){e.on("start.zoom",(function(){w(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(o).end()})).tween("zoom",(function(){var e=this,i=arguments,r=w(e,i).event(o),s=a.apply(e,i),l=null==n?y(s):"function"==typeof n?n.apply(e,i):n,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,h="function"==typeof t?t.apply(e,i):t,p=c(d.invert(l).concat(u/d.k),h.invert(l).concat(u/h.k));return function(e){if(1===e)e=h;else{var t=p(e),n=u/t[2];e=new $d(n,l[0]-t[0]*n,l[1]-t[1]*n)}r.zoom(null,e)}}))}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=a.apply(e,t),this.taps=0}function k(e,...t){if(o.apply(this,arguments)){var n=w(this,t).event(e),a=this.__zoom,s=Math.max(l[0],Math.min(l[1],a.k*Math.pow(2,r.apply(this,arguments)))),d=Dl(e);if(n.wheel)n.mouse[0][0]===d[0]&&n.mouse[0][1]===d[1]||(n.mouse[1]=a.invert(n.mouse[0]=d)),clearTimeout(n.wheel);else{if(a.k===s)return;n.mouse=[d,a.invert(d)],Au(this),n.start()}Bd(e),n.wheel=setTimeout(c,150),n.zoom("mouse",i(m(_(a,s),n.mouse[0],n.mouse[1]),n.extent,u))}function c(){n.wheel=null,n.end()}}function E(e,...t){if(!n&&o.apply(this,arguments)){var a=e.currentTarget,r=w(this,t,!0).event(e),s=jl(e.view).on("mousemove.zoom",h,!0).on("mouseup.zoom",p,!0),l=Dl(e,a),d=e.clientX,c=e.clientY;Ll(e.view),Ad(e),r.mouse=[l,this.__zoom.invert(l)],Au(this),r.start()}function h(e){if(Bd(e),!r.moved){var t=e.clientX-d,n=e.clientY-c;r.moved=t*t+n*n>v}r.event(e).zoom("mouse",i(m(r.that.__zoom,r.mouse[0]=Dl(e,a),r.mouse[1]),r.extent,u))}function p(e){s.on("mousemove.zoom mouseup.zoom",null),Pl(e.view,r.moved),Bd(e),r.event(e).end()}}function z(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,r=Dl(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(r),l=n.k*(e.shiftKey?.5:2),c=i(m(_(n,l),r,s),a.apply(this,t),u);Bd(e),d>0?jl(this).transition().duration(d).call(b,c,r,e):jl(this).call(g.transform,c,r,e)}}function N(n,...a){if(o.apply(this,arguments)){var i,r,s,l,u=n.touches,d=u.length,c=w(this,a,n.changedTouches.length===d).event(n);for(Ad(n),r=0;r<d;++r)l=[l=Dl(s=u[r],this),this.__zoom.invert(l),s.identifier],c.touch0?c.touch1||c.touch0[2]===l[2]||(c.touch1=l,c.taps=0):(c.touch0=l,i=!0,c.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(c.taps<2&&(t=l[0],e=setTimeout((function(){e=null}),p)),Au(this),c.start())}}function C(e,...t){if(this.__zooming){var n,o,a,r,s=w(this,t).event(e),l=e.changedTouches,d=l.length;for(Bd(e),n=0;n<d;++n)a=Dl(o=l[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=a:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=a);if(o=s.that.__zoom,s.touch1){var c=s.touch0[0],h=s.touch0[1],p=s.touch1[0],v=s.touch1[1],f=(f=p[0]-c[0])*f+(f=p[1]-c[1])*f,g=(g=v[0]-h[0])*g+(g=v[1]-h[1])*g;o=_(o,Math.sqrt(f/g)),a=[(c[0]+p[0])/2,(c[1]+p[1])/2],r=[(h[0]+v[0])/2,(h[1]+v[1])/2]}else{if(!s.touch0)return;a=s.touch0[0],r=s.touch0[1]}s.zoom("touch",i(m(o,a,r),s.extent,u))}}function T(e,...o){if(this.__zooming){var a,i,r=w(this,o).event(e),s=e.changedTouches,l=s.length;for(Ad(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),p),a=0;a<l;++a)i=s[a],r.touch0&&r.touch0[2]===i.identifier?delete r.touch0:r.touch1&&r.touch1[2]===i.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps&&(i=Dl(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<f)){var u=jl(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return g.transform=function(e,t,n,o){var a=e.selection?e.selection():e;a.property("__zoom",Rd),e!==a?b(e,t,n,o):a.interrupt().each((function(){w(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},g.scaleBy=function(e,t,n,o){g.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n,o)},g.scaleTo=function(e,t,n,o){g.transform(e,(function(){var e=a.apply(this,arguments),o=this.__zoom,r=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(r),l="function"==typeof t?t.apply(this,arguments):t;return i(m(_(o,l),r,s),e,u)}),n,o)},g.translateBy=function(e,t,n,o){g.transform(e,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),a.apply(this,arguments),u)}),null,o)},g.translateTo=function(e,t,n,o,r){g.transform(e,(function(){var e=a.apply(this,arguments),r=this.__zoom,s=null==o?y(e):"function"==typeof o?o.apply(this,arguments):o;return i(Ia.translate(s[0],s[1]).scale(r.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,u)}),o,r)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=jl(this.that).datum();h.call(e,this.that,new Sd(e,{sourceEvent:this.sourceEvent,target:g,type:e,transform:this.that.__zoom,dispatch:h}),t)}},g.wheelDelta=function(e){return arguments.length?(r="function"==typeof e?e:Ma(+e),g):r},g.filter=function(e){return arguments.length?(o="function"==typeof e?e:Ma(!!e),g):o},g.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Ma(!!e),g):s},g.extent=function(e){return arguments.length?(a="function"==typeof e?e:Ma([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),g):a},g.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],g):[l[0],l[1]]},g.translateExtent=function(e){return arguments.length?(u[0][0]=+e[0][0],u[1][0]=+e[1][0],u[0][1]=+e[0][1],u[1][1]=+e[1][1],g):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},g.constrain=function(e){return arguments.length?(i=e,g):i},g.duration=function(e){return arguments.length?(d=+e,g):d},g.interpolate=function(e){return arguments.length?(c=e,g):c},g.on=function(){var e=h.on.apply(h,arguments);return e===h?g:e},g.clickDistance=function(e){return arguments.length?(v=(e=+e)*e,g):Math.sqrt(v)},g.tapDistance=function(e){return arguments.length?(f=+e,g):f},g}().wheelDelta((t=>Fe(t)*(e.zoomStep/10))).on("zoom",e.pannable?a:()=>{}).on("zoom.wheel",e.zoomable?o:()=>{});n.call(i),t((()=>{n.on("zoom",null)}))}}),{flush:"post"}),(e,n)=>(a(),F(w(Le),{position:e.position,class:z(["vue-flow__minimap",{pannable:e.pannable,zoomable:e.zoomable}])},{default:X((()=>[(a(),l("svg",{ref_key:"el",ref:x,width:k.value,height:C.value,viewBox:[R.value.x,R.value.y,R.value.width,R.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${w(i)}`,onClick:q},[e.ariaLabel?(a(),l("title",{key:0,id:`vue-flow__minimap-${w(i)}`},_(e.ariaLabel),9,Ba)):m("",!0),(a(!0),l(E,null,L(w(b),(n=>(a(),F($a,{id:n.id,key:n.id,f:"",position:n.computedPosition,dimensions:n.dimensions,selected:n.selected,dragging:n.dragging,style:Y(n.style),class:z(S.value(n)),color:M.value(n),"border-radius":e.nodeBorderRadius,"stroke-color":O.value(n),"stroke-width":e.nodeStrokeWidth,"shape-rendering":w(T),type:n.type,hidden:n.hidden,onClick:e=>function(e,n){const o={event:e,node:n,connectedEdges:me([n],u.value)};v.miniMapNodeClick(o),t("nodeClick",o)}(e,n),onDblclick:e=>function(e,n){const o={event:e,node:n,connectedEdges:me([n],u.value)};v.miniMapNodeDoubleClick(o),t("nodeDblclick",o)}(e,n),onMouseenter:e=>function(e,n){const o={event:e,node:n,connectedEdges:me([n],u.value)};v.miniMapNodeMouseEnter(o),t("nodeMouseenter",o)}(e,n),onMousemove:e=>function(e,n){const o={event:e,node:n,connectedEdges:me([n],u.value)};v.miniMapNodeMouseMove(o),t("nodeMousemove",o)}(e,n),onMouseleave:e=>function(e,n){const o={event:e,node:n,connectedEdges:me([n],u.value)};v.miniMapNodeMouseLeave(o),t("nodeMouseleave",o)}(e,n)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"])))),128)),s("path",{class:"vue-flow__minimap-mask",d:P.value,fill:e.maskColor,stroke:e.maskStrokeColor,"stroke-width":e.maskStrokeWidth,"fill-rule":"evenodd"},null,8,ja)],8,Aa))])),_:1},8,["position","class"]))}}),Ra=["id"],La=p({__name:"CanvasArrowHeadMarker",props:{id:{}},setup:e=>(t,n)=>(a(),l("svg",null,[s("defs",null,[s("marker",{id:e.id,viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:"12.5",markerHeight:"12.5",markerUnits:"strokeWidth",orient:"auto-start-reverse"},[...n[0]||(n[0]=[s("polyline",{"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4","stroke-width":"2",stroke:"context-stroke",fill:"context-stroke"},null,-1)])],8,Ra)])]))}),Pa=130,Va=40,qa=16,Ha=(e,t)=>e-20>t,Fa=pe(p({__name:"CanvasConnectionLine",props:{sourceX:{},sourceY:{},sourcePosition:{},targetX:{},targetY:{},targetPosition:{},sourceNode:{},sourceHandle:{},targetNode:{},targetHandle:{},markerStart:{},markerEnd:{},connectionStatus:{}},setup(e){const t=e,n=T(),{connectingHandle:o}=Hd(),i=g((()=>Rt(o.value?.handleId).type)),r=g((()=>({[n.edge]:!0,[n.visible]:h.value}))),s=g((()=>({...i.value===xt.Main?{}:{strokeDasharray:"5,6"},strokeWidth:2,stroke:"var(--color--foreground--shade-2)"}))),u=g((()=>qd(t,{connectionType:i.value}))),c=g((()=>u.value.segments)),h=d(!1);return x((()=>{setTimeout((()=>{h.value=!0}),300)})),(t,n)=>(a(!0),l(E,null,L(c.value,(t=>(a(),F(w(ot),{key:t[0],class:z(r.value),style:Y(s.value),path:t[0],"marker-end":e.markerEnd},null,8,["class","style","path","marker-end"])))),128))}}),[["__cssModules",{$style:{edge:"_edge_qsnhv_125",visible:"_visible_qsnhv_131"}}]]),Wa={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Ya=pe({},[["render",Fd]]),Xa=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},Ua={type:"button",class:"vue-flow__controls-button"},Ga=Xa({name:"ControlButton",compatConfig:{MODE:3}},[["render",Wd]]),Za={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Ka=[s("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)],Qa={render:Yd},Ja={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ei=[s("path",{d:"M0 0h32v4.2H0z"},null,-1)],ti={render:Xd},ni={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},oi=[s("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 0 0 27.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.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)],ai={render:Ud},ii={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ri=[s("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 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-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"},null,-1)],si={render:Gd},li={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ui=[s("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 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)],di={render:Zd},ci=p({name:"Controls",compatConfig:{MODE:3},props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Ge.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:s,zoomIn:u,zoomOut:d,fitView:c,viewport:h,minZoom:p,maxZoom:v}=ze(),f=r((()=>n.value||o.value||i.value)),g=r((()=>h.value.zoom<=p.value)),_=r((()=>h.value.zoom>=v.value));function y(){u(),t("zoomIn")}function b(){d(),t("zoomOut")}function x(){c(e.fitViewParams),t("fitView")}function k(){s(!f.value),t("interactionChange",!f.value)}return(e,t)=>(a(),F(w(Le),{class:"vue-flow__controls",position:e.position},{default:X((()=>[$(e.$slots,"top"),e.showZoom?(a(),l(E,{key:0},[$(e.$slots,"control-zoom-in",{},(()=>[A(Ga,{class:"vue-flow__controls-zoomin",disabled:_.value,onClick:y},{default:X((()=>[$(e.$slots,"icon-zoom-in",{},(()=>[(a(),F(P(w(Qa))))]))])),_:3},8,["disabled"])])),$(e.$slots,"control-zoom-out",{},(()=>[A(Ga,{class:"vue-flow__controls-zoomout",disabled:g.value,onClick:b},{default:X((()=>[$(e.$slots,"icon-zoom-out",{},(()=>[(a(),F(P(w(ti))))]))])),_:3},8,["disabled"])]))],64)):m("",!0),e.showFitView?$(e.$slots,"control-fit-view",{key:1},(()=>[A(Ga,{class:"vue-flow__controls-fitview",onClick:x},{default:X((()=>[$(e.$slots,"icon-fit-view",{},(()=>[(a(),F(P(w(ai))))]))])),_:3})])):m("",!0),e.showInteractive?$(e.$slots,"control-interactive",{key:2},(()=>[e.showInteractive?(a(),F(Ga,{key:0,class:"vue-flow__controls-interactive",onClick:k},{default:X((()=>[f.value?$(e.$slots,"icon-unlock",{key:0},(()=>[(a(),F(P(w(di))))])):m("",!0),f.value?m("",!0):$(e.$slots,"icon-lock",{key:1},(()=>[(a(),F(P(w(si))))]))])),_:3})):m("",!0)])):m("",!0),$(e.$slots,"default")])),_:3},8,["position"]))}}),hi=p({__name:"CanvasControlButtons",props:{zoom:{default:1},readOnly:{type:Boolean,default:!1}},emits:["reset-zoom","zoom-in","zoom-out","zoom-to-fit","tidy-up","toggle-zoom-mode"],setup(e,{emit:t}){const n=e,o=t,i=Q(),r=Wt(),s=g((()=>r.isActive(n.zoom))),l=g((()=>r.isZoomedViewEnabled)),u=g((()=>!l.value&&1!==n.zoom));function d(){o("reset-zoom")}function c(){o("zoom-in")}function h(){o("zoom-out")}function p(){o("zoom-to-fit")}function v(){o("tidy-up")}return(t,n)=>(a(),F(w(ci),{"show-zoom":!1,"show-fit-view":!1},{default:X((()=>[A(on,{label:w(i).baseText("nodeView.zoomToFit"),shortcut:{keys:["1"]}},{default:X((()=>[A(w(ne),{variant:"subtle",size:"large",icon:"maximize","aria-label":w(i).baseText("nodeView.zoomToFit"),"data-test-id":"zoom-to-fit",onClick:p},null,8,["aria-label"])])),_:1},8,["label"]),A(on,{label:w(i).baseText("nodeView.zoomIn"),shortcut:{keys:["+"]}},{default:X((()=>[A(w(ne),{variant:"subtle",size:"large",icon:"zoom-in","aria-label":w(i).baseText("nodeView.zoomIn"),"data-test-id":"zoom-in-button",onClick:c},null,8,["aria-label"])])),_:1},8,["label"]),A(on,{label:w(i).baseText("nodeView.zoomOut"),shortcut:{keys:["-"]}},{default:X((()=>[A(w(ne),{variant:"subtle",size:"large",icon:"zoom-out","aria-label":w(i).baseText("nodeView.zoomOut"),"data-test-id":"zoom-out-button",onClick:h},null,8,["aria-label"])])),_:1},8,["label"]),l.value?(a(),F(on,{key:0,label:w(i).baseText(s.value?"nodeView.leaveZoomMode":"nodeView.enterZoomMode"),shortcut:{keys:["Z"]}},{default:X((()=>[A(w(ne),{variant:"subtle",iconOnly:"",size:"large",class:z(t.$style.iconButton),icon:s.value?"undo-2":"crosshair","aria-label":w(i).baseText(s.value?"nodeView.leaveZoomMode":"nodeView.enterZoomMode"),onClick:n[0]||(n[0]=e=>o("toggle-zoom-mode"))},null,8,["class","icon","aria-label"])])),_:1},8,["label"])):m("",!0),u.value?(a(),F(on,{key:1,label:w(i).baseText("nodeView.resetZoom"),shortcut:{keys:["0"]}},{default:X((()=>[A(w(ne),{variant:"subtle",size:"large",icon:"undo-2","aria-label":w(i).baseText("nodeView.resetZoom"),"data-test-id":"reset-zoom-button",onClick:d},null,8,["aria-label"])])),_:1},8,["label"])):m("",!0),e.readOnly?m("",!0):(a(),F(on,{key:2,label:w(i).baseText("nodeView.tidyUp"),shortcut:{shiftKey:!0,altKey:!0,keys:["T"]}},{default:X((()=>[A(w(le),{variant:"subtle",iconOnly:"",size:"large","aria-label":w(i).baseText("nodeView.tidyUp"),"data-test-id":"tidy-up-button",class:z(t.$style.iconButton),onClick:v},{default:X((()=>[A(Ya)])),_:1},8,["aria-label","class"])])),_:1},8,["label"])),s.value?(a(),F(w(ee),{key:3,placement:"top",content:w(i).baseText("nodeView.expandAllNodes")},{default:X((()=>[A(w(ne),{variant:"subtle",size:"large",icon:"maximize-2","aria-label":w(i).baseText("nodeView.expandAllNodes"),onClick:w(r).expandAllNodes},null,8,["aria-label","onClick"])])),_:1},8,["content"])):m("",!0),s.value?(a(),F(w(ee),{key:4,placement:"top",content:w(i).baseText("nodeView.collapseAllNodes")},{default:X((()=>[A(w(ne),{variant:"subtle",size:"large",icon:"minimize-2","aria-label":w(i).baseText("nodeView.collapseAllNodes"),onClick:w(r).collapseAllNodes},null,8,["aria-label","onClick"])])),_:1},8,["content"])):m("",!0)])),_:1}))}}),pi=pe(hi,[["__cssModules",{$style:{iconButton:"_iconButton_yqho8_125"}}]]),vi=pe(p({__name:"CanvasEdgeTooltip",props:{content:{}},setup(e){const t=T();return(n,o)=>(a(),l("div",{class:z(w(t).tooltipContainer)},[A(w(ee),{content:e.content,placement:"top",teleported:!1,offset:8,"content-class":w(t).content},{default:X((()=>[$(n.$slots,"default")])),_:3},8,["content","content-class"])],2))}}),[["__cssModules",{$style:{tooltipContainer:"_tooltipContainer_yuv67_125",content:"_content_yuv67_129"}}]]),fi=p({__name:"CanvasEdgeToolbar",props:{type:{},targetNode:{},sourceNode:{}},emits:["add","delete"],setup(e,{emit:t}){const n=t,o=e,i=T(),r=Q(),s=g((()=>({[i.canvasEdgeToolbar]:!0}))),u=g((()=>{const e=o.type===xt.Main,t=o.type===xt.AiTool&&("@n8n/n8n-nodes-langchain.agent"===o.targetNode.data.type||"@n8n/n8n-nodes-langchain.agentTool"===o.targetNode.data.type)&&!Mt(o.sourceNode.data.type);return e||t}));function d(){n("add")}function c(){n("delete")}return(t,n)=>(a(),l("div",{class:z(s.value),"data-test-id":"canvas-edge-toolbar"},[u.value?(a(),F(vi,{key:0,content:e.type===w(xt).AiTool?w(r).baseText("node.add-human-review-step"):w(r).baseText("node.add")},{default:X((()=>[A(w(ne),{variant:"subtle",class:"canvas-edge-toolbar-button","data-test-id":"add-connection-button",size:"small","icon-size":"medium",icon:"plus","aria-label":w(r).baseText("node.addNode"),onClick:d},null,8,["aria-label"])])),_:1},8,["content"])):m("",!0),A(vi,{content:w(r).baseText("node.delete")},{default:X((()=>[A(w(ne),{variant:"subtle","data-test-id":"delete-connection-button",class:"canvas-edge-toolbar-button",size:"small","icon-size":"medium",icon:"trash-2","aria-label":w(r).baseText("node.deleteConnection"),onClick:c},null,8,["aria-label"])])),_:1},8,["content"])],2))}}),gi=pe(fi,[["__cssModules",{$style:{canvasEdgeToolbar:"_canvasEdgeToolbar_1asvk_125"}}]]),_i=["data-source-node-name","data-target-node-name"],mi=["data-source-node-name","data-target-node-name","data-edge-status"],yi=p({__name:"CanvasEdge",props:{id:{},sourceNode:{},targetNode:{},source:{},target:{},type:{},label:{type:[String,Object,Function]},style:{},selected:{type:Boolean},sourcePosition:{},targetPosition:{},sourceHandleId:{},targetHandleId:{},animated:{type:Boolean},updatable:{type:Boolean},markerStart:{},markerEnd:{},curvature:{},interactionWidth:{},data:{},events:{},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{},sourceX:{},sourceY:{},targetX:{},targetY:{},readOnly:{type:Boolean},hovered:{type:Boolean},bringToFront:{type:Boolean}},emits:["add","delete","update:label:hovered"],setup(e,{emit:t}){const n=t,o=e,i=r(o,"data"),c=T(),{viewport:h}=Hd(),{calculateEdgeLightness:p}=Kd(h),v=g((()=>ke(o.data.source.type)?o.data.source.type:xt.Main)),f=d(o.hovered),m=d(null);O((()=>o.hovered),(e=>{e?(m.value&&clearTimeout(m.value),f.value=!0):m.value=setTimeout((()=>{f.value=!1}),600)}),{immediate:!0});const b=g((()=>f.value&&!o.readOnly)),x=g((()=>i.value.source.type===xt.Main)),k=g((()=>o.data.status)),N=g((()=>({...o.style,...x.value?{}:{strokeDasharray:"5,6"}}))),C=g((()=>({[c.edge]:!0,hovered:f.value,"bring-to-front":o.bringToFront}))),M=g((()=>({transform:`translate(-50%, -50%) translate(${j.value[0]}px, ${j.value[1]}px)`,...f.value&&o.bringToFront?{zIndex:1}:{}}))),I=g((()=>({[c.edgeLabelWrapper]:!0,"vue-flow__edge-label":!0,selected:o.selected,[c.straight]:S.value.isConnectorStraight}))),S=g((()=>qd(o,{connectionType:v.value}))),B=g((()=>S.value.segments)),j=g((()=>S.value.labelPosition)),D=g((()=>({source:o.source,target:o.target,sourceHandle:o.sourceHandleId,targetHandle:o.targetHandleId}))),R=g((()=>"success"===k.value?"var(--color--success)":"pinned"===k.value?"var(--color--secondary)":void 0)),P=g((()=>"success"===k.value||"pinned"===k.value)),V=p(g((()=>!P.value&&f.value))),q=g((()=>{const e={"--canvas-edge--color--lightness--light":V.value.light,"--canvas-edge--color--lightness--dark":V.value.dark};return R.value&&(e["--canvas-edge--color"]=R.value),e}));function W(){n("add",D.value)}function U(){n("delete",D.value)}function G(){n("update:label:hovered",!0)}function Z(){n("update:label:hovered",!1)}return(t,n)=>(a(),l(E,null,[s("g",y({"data-test-id":"edge","data-source-node-name":i.value.source?.node,"data-target-node-name":i.value.target?.node,style:q.value},t.$attrs),[$(t.$slots,"highlight",H(u({segments:B.value}))),(a(!0),l(E,null,L(B.value,((t,n)=>(a(),F(w(ot),{id:`${e.id}-${n}`,key:t[0],class:z(C.value),style:Y(N.value),path:t[0],"marker-end":x.value?e.markerEnd:void 0,"interaction-width":40},null,8,["id","class","style","path","marker-end"])))),128))],16,_i),A(w(Oe),null,{default:X((()=>[s("div",{"data-test-id":"edge-label","data-source-node-name":i.value.source?.node,"data-target-node-name":i.value.target?.node,"data-edge-status":k.value,style:Y(M.value),class:z(I.value),onMouseenter:G,onMouseleave:Z},[b.value?(a(),F(gi,{key:0,type:v.value,"target-node":e.targetNode,"source-node":e.sourceNode,onAdd:W,onDelete:U},null,8,["type","target-node","source-node"])):(a(),l("div",{key:1,class:z(w(c).edgeLabel)},_(e.label),3))],46,mi)])),_:1})],64))}}),e("a",bi=pe(yi,[["__cssModules",{$style:{edge:"_edge_1yu3o_125",edgeLabelWrapper:"_edgeLabelWrapper_1yu3o_133",straight:"_straight_1yu3o_139",edgeLabel:"_edgeLabel_1yu3o_133"}}]])),wi={key:4},xi={key:6},ki=p({__name:"CanvasNodeStatusIcons",props:{size:{default:"large"},spinnerScrim:{type:Boolean,default:!1},spinnerLayout:{default:"absolute"}},setup(e){const t=We(),n=Q(),o=T(),{hasPinnedData:r,executionErrors:u,validationErrors:d,hasExecutionErrors:c,hasValidationErrors:h,executionStatus:p,hasRunData:v,runDataIterations:f,isDisabled:y,render:b,isNotInstalledCommunityNode:x}=Qd(),k=ue(),E=g((()=>!1)),N=g((()=>k.name===gt.DEMO)),C=g((()=>b.value.type===Me.Default?b.value.options.dirtiness:void 0)),M=g((()=>[o.status,e.spinnerScrim?o.spinnerScrim:"","absolute"===e.spinnerLayout?o.absoluteSpinner:""])),I=g((()=>{const e=u.value.reduce(((e,t)=>(e[t]=(e[t]||0)+1,e)),{});return Object.entries(e).map((([e,t])=>t>1?`${e} (x${t})`:e))}));return(u,g)=>w(x)&&!N.value?(a(),l("div",{key:0,class:z([...M.value,w(o).issues]),"data-test-id":"node-not-installed"},[A(w(ee),{"show-after":500,placement:"bottom"},{content:X((()=>[i(_(w(n).baseText("node.install-to-use")),1)])),default:X((()=>[A(w(re),{icon:"hard-drive-download",size:e.size},null,8,["size"])])),_:1})],2)):w(y)?(a(),l("div",{key:1,class:z([...M.value,w(o).disabled])},[A(w(re),{icon:"power",size:e.size},null,8,["size"])],2)):w(c)&&!E.value?(a(),l("div",{key:2,class:z([...M.value,w(o).issues]),"data-test-id":"node-issues"},[A(w(ee),{"show-after":500,placement:"bottom"},{content:X((()=>[A(dt,{title:`${w(n).baseText("node.issues")}:`,items:I.value},null,8,["title","items"])])),default:X((()=>[A(w(re),{icon:"node-execution-error",size:e.size},null,8,["size"])])),_:1})],2)):w(h)&&!E.value?(a(),l("div",{key:3,class:z([...M.value,w(o).issues]),"data-test-id":"node-issues"},[A(w(ee),{"show-after":500,placement:"bottom"},{content:X((()=>[A(dt,{title:`${w(n).baseText("node.issues")}:`,items:w(d)},null,8,["title","items"])])),default:X((()=>[A(w(re),{icon:"node-validation-error",size:e.size},null,8,["size"])])),_:1})],2)):"unknown"===w(p)?(a(),l("div",wi)):w(r)&&!w(t).isProductionExecutionPreview.value?(a(),l("div",{key:5,"data-test-id":"canvas-node-status-pinned",class:z([...M.value,w(o).pinnedData])},[A(w(re),{icon:"node-pin",size:e.size},null,8,["size"])],2)):void 0!==C.value?(a(),l("div",xi,[A(w(ee),{"show-after":500,placement:"bottom"},{content:X((()=>[i(_(w(n).baseText(C.value===w(_e).PARAMETERS_UPDATED?"node.dirty":"node.subjectToChange")),1)])),default:X((()=>[s("div",{"data-test-id":"canvas-node-status-warning",class:z([...M.value,w(o).warning])},[A(w(re),{icon:"node-dirty",size:e.size},null,8,["size"]),w(f)>1?(a(),l("span",{key:0,class:z(w(o).count)},_(w(f)),3)):m("",!0)],2)])),_:1})])):w(v)&&"success"===w(p)?(a(),l("div",{key:7,"data-test-id":"canvas-node-status-success",class:z([...M.value,w(o).runData])},[A(w(re),{icon:"node-success",size:e.size},null,8,["size"]),w(f)>1?(a(),l("span",{key:0,class:z(w(o).count)},_(w(f)),3)):m("",!0)],2)):m("",!0)}}),Ei=pe(ki,[["__cssModules",{$style:{status:"_status_v9j1u_125",runData:"_runData_v9j1u_132",waiting:"_waiting_v9j1u_136",pinnedData:"_pinnedData_v9j1u_140",running:"_running_v9j1u_144",absoluteSpinner:"_absoluteSpinner_v9j1u_147",spinnerScrim:"_spinnerScrim_v9j1u_160",issues:"_issues_v9j1u_166",count:"_count_v9j1u_171",warning:"_warning_v9j1u_175",disabled:"_disabled_v9j1u_179"}}]]),zi=["title"],Ni=["onClick"],Ci=["title"],Ti=p({__name:"CanvasNodeStickyColorSelector",props:{visible:{type:Boolean},visibleModifiers:{}},emits:c(["update"],["update:visible"]),setup(e,{emit:t}){const n=t,o=Q(),{render:i,eventBus:r}=Qd(),u=g((()=>i.value.options)),c=d(null),h=g((()=>Array.from({length:7}).map(((e,t)=>t+1)))),p=M(e,"visible"),v=d(null);function f(){p.value=!1}function _(){p.value=!0}function m(){v.value?.click()}const y=G((e=>{const t=e.target;n("update",t.value.toUpperCase())}),16);function b(){f()}function k(){c.value&&(clearTimeout(c.value),c.value=null)}function N(){c.value=setTimeout((()=>{f()}),1e3)}return x((()=>{r.value?.on("update:sticky:color",_)})),R((()=>{r.value?.off("update:sticky:color",_)})),(e,t)=>(a(),l("div",null,[A(w(te),{open:p.value,"onUpdate:open":t[0]||(t[0]=e=>p.value=e),side:"top",width:"auto","content-class":e.$style.popover,"enable-scrolling":!1,onBeforeEnter:k,onAfterLeave:N},{trigger:X((()=>[s("div",{class:z(e.$style.option),"data-test-id":"change-sticky-color",title:w(o).baseText("node.changeColor")},[A(w(re),{size:"small",icon:"palette"})],10,zi)])),content:X((()=>[s("div",{class:z(e.$style.content)},[(a(!0),l(E,null,L(h.value,(t=>(a(),l("div",{key:t,"data-test-id":"color",class:z([e.$style.color,e.$style[`sticky-color-${t}`],u.value.color===t?e.$style.selected:""]),onClick:e=>(n("update",t),void f())},null,10,Ni)))),128)),s("div",{"data-test-id":"custom-color",class:z([e.$style.color,e.$style.customColorButton,"string"==typeof u.value.color?e.$style.selected:""]),style:Y("string"==typeof u.value.color?{backgroundColor:u.value.color}:{}),title:w(o).baseText("node.customColor"),onClick:S(m,["stop"])},[A(w(re),{icon:"plus",size:"xsmall",class:z(e.$style.plusIcon)},null,8,["class"])],14,Ci)],2)])),_:1},8,["open","content-class"]),s("input",{ref_key:"colorInputRef",ref:v,type:"color",class:z(e.$style.hiddenColorInput),"data-test-id":"native-color-input",onInput:t[1]||(t[1]=(...e)=>w(y)&&w(y)(...e)),onChange:b},null,34)]))}}),Mi=pe(Ti,[["__cssModules",{$style:{popover:"_popover_6do86_125",content:"_content_6do86_130",color:"_color_6do86_137",selected:"_selected_6do86_149","sticky-color-1":"_sticky-color-1_6do86_152","sticky-color-2":"_sticky-color-2_6do86_155","sticky-color-3":"_sticky-color-3_6do86_158","sticky-color-4":"_sticky-color-4_6do86_161","sticky-color-5":"_sticky-color-5_6do86_164","sticky-color-6":"_sticky-color-6_6do86_167","sticky-color-7":"_sticky-color-7_6do86_170",option:"_option_6do86_174",customColorButton:"_customColorButton_6do86_186",plusIcon:"_plusIcon_6do86_194",hiddenColorInput:"_hiddenColorInput_6do86_203"}}]]),Ii=p({__name:"CanvasNodeToolbar",props:{readOnly:{type:Boolean},showStatusIcons:{type:Boolean},itemsClass:{}},emits:["delete","toggle","run","update","open:contextmenu","focus","add:ai"],setup(e,{emit:t}){const n=t,o=e,i=T(),r=Q(),{isExecuting:u,isExperimentalNdvActive:c}=Hd(),{isDisabled:h,render:p,name:v}=Qd(),f=Se(),_=at(),y=Wt(),b=Te(),x=g((()=>v.value?f?.value?.getNodeByName(v.value):null)),k=g((()=>!!x.value&&_.isToolNode(x.value.type))),E=g((()=>h.value?r.baseText("node.enable"):r.baseText("node.disable"))),N=d(!1),C=d(!1),M=g((()=>({[i.canvasNodeToolbar]:!0,[i.readOnly]:o.readOnly,[i.forceVisible]:C.value||N.value,[i.isExperimentalNdvActive]:c.value}))),I=g((()=>!o.readOnly&&p.value.type===Me.Default&&"configuration"in p.value.options&&(!p.value.options.configuration||k.value))),O=g((()=>!o.readOnly&&p.value.type===Me.Default)),$=g((()=>!o.readOnly)),B=g((()=>y.isZoomedViewEnabled)),j=g((()=>!o.readOnly&&b.isFeatureEnabled)),D=g((()=>!o.readOnly&&p.value.type===Me.StickyNote));function R(){n("run")}function L(){n("toggle")}function P(){n("delete")}function V(e){n("update",{color:e})}function q(e){n("open:contextmenu",e)}function H(){C.value=!0}function W(){C.value=!1}function Y(){x.value&&n("focus",x.value.id)}function U(){x.value&&n("add:ai",x.value.id)}return(t,n)=>(a(),l("div",{"data-test-id":"canvas-node-toolbar",class:z(M.value),onMouseenter:H,onMouseleave:W,onMousedown:n[1]||(n[1]=S((()=>{}),["stop"])),onClick:n[2]||(n[2]=S((()=>{}),["stop"]))},[s("div",{class:z([w(i).canvasNodeToolbarItems,e.itemsClass])},[I.value?(a(),F(w(ee),{key:0,placement:"top",disabled:!w(h),content:w(r).baseText("ndv.execute.deactivated")},{default:X((()=>[A(w(ne),{variant:"ghost","data-test-id":"execute-node-button",size:"small",icon:"node-play",disabled:w(u)||w(h),title:w(r).baseText("node.testStep"),onClick:S(R,["stop"])},null,8,["disabled","title"])])),_:1},8,["disabled","content"])):m("",!0),O.value?(a(),F(w(ne),{key:1,variant:"ghost","data-test-id":"disable-node-button",size:"small",icon:"node-power",title:E.value,onClick:S(L,["stop"])},null,8,["title"])):m("",!0),$.value?(a(),F(w(ne),{key:2,variant:"ghost","data-test-id":"delete-node-button",size:"small",icon:"node-trash",title:w(r).baseText("node.delete"),onClick:S(P,["stop"])},null,8,["title"])):m("",!0),B.value?(a(),F(w(ne),{key:3,variant:"ghost",size:"small",icon:"crosshair","aria-label":w(r).baseText("node.focusNode"),onClick:S(Y,["stop"])},null,8,["aria-label"])):m("",!0),D.value?(a(),F(Mi,{key:4,visible:N.value,"onUpdate:visible":n[0]||(n[0]=e=>N.value=e),onUpdate:V},null,8,["visible"])):m("",!0),j.value?(a(),F(w(ee),{key:5,placement:"top",content:w(r).baseText("node.addToAi")},{default:X((()=>[A(w(ne),{"data-test-id":"add-to-ai-button",variant:"ghost",size:"small",text:"",icon:"sparkles","aria-label":w(r).baseText("node.addToAi"),onClick:S(U,["stop"])},null,8,["aria-label"])])),_:1},8,["content"])):m("",!0),A(w(ne),{variant:"ghost","data-test-id":"overflow-node-button",size:"small",icon:"node-ellipsis","aria-label":w(r).baseText("node.moreActions"),onClick:S(q,["stop"])},null,8,["aria-label"])],2),e.showStatusIcons?(a(),F(Ei,{key:0,class:z(w(i).statusIcons),"spinner-layout":"static"},null,8,["class"])):m("",!0)],34))}}),Oi=pe(Ii,[["__cssModules",{$style:{canvasNodeToolbar:"_canvasNodeToolbar_bw5fp_125",isExperimentalNdvActive:"_isExperimentalNdvActive_bw5fp_133",canvasNodeToolbarItems:"_canvasNodeToolbarItems_bw5fp_142",forceVisible:"_forceVisible_bw5fp_154",statusIcons:"_statusIcons_bw5fp_158"}}]]),Si="small",$i=p({__name:"CanvasNodeSettingsIcons",setup(e){const{name:t}=Qd(),n=Q(),o=et(),i=Pe(),{isEnabled:r}=Gt(),u=g((()=>o.workflowObject.getNode(t.value))),d=g((()=>{const e=u.value?.credentials;return!!e&&Object.values(e).some((e=>!!e?.id&&!0===i.getCredentialById(e.id)?.isResolvable))})),c=g((()=>{const e=u.value?.parameters?.contextEstablishmentHooks;if("object"!=typeof e||null===e||!("hooks"in e))return!1;const t=e.hooks;return Array.isArray(t)&&t.length>0})),h=g((()=>d.value||c.value));return(e,t)=>(a(),l("div",{class:z(e.$style.settingsIcons)},[u.value?.alwaysOutputData?(a(),F(w(ee),{key:0},{content:X((()=>[s("div",{class:z(e.$style.tooltipHeader)},[A(w(re),{icon:"always-output-data",size:Si}),s("strong",{class:z(e.$style.tooltipTitle)},_(w(n).baseText("nodeSettings.alwaysOutputData.displayName")),3)],2),s("div",null,_(w(n).baseText("node.settings.alwaysOutputData")),1)])),default:X((()=>[s("div",{"data-test-id":"canvas-node-status-always-output-data",class:z(e.$style.icon)},[A(w(re),{icon:"always-output-data",size:Si})],2)])),_:1})):m("",!0),u.value?.executeOnce?(a(),F(w(ee),{key:1},{content:X((()=>[s("div",{class:z(e.$style.tooltipHeader)},[A(w(re),{icon:"execute-once",size:Si}),s("strong",{class:z(e.$style.tooltipTitle)},_(w(n).baseText("nodeSettings.executeOnce.displayName")),3)],2),s("div",null,_(w(n).baseText("node.settings.executeOnce")),1)])),default:X((()=>[s("div",{"data-test-id":"canvas-node-status-execute-once",class:z(e.$style.icon)},[A(w(re),{icon:"execute-once",size:Si})],2)])),_:1})):m("",!0),u.value?.retryOnFail?(a(),F(w(ee),{key:2},{content:X((()=>[s("div",{class:z(e.$style.tooltipHeader)},[A(w(re),{icon:"retry-on-fail",size:Si}),s("strong",{class:z(e.$style.tooltipTitle)},_(w(n).baseText("nodeSettings.retryOnFail.displayName")),3)],2),s("div",null,_(w(n).baseText("node.settings.retriesOnFailure")),1)])),default:X((()=>[s("div",{"data-test-id":"canvas-node-status-retry-on-fail",class:z(e.$style.icon)},[A(w(re),{icon:"retry-on-fail",size:Si})],2)])),_:1})):m("",!0),"continueRegularOutput"===u.value?.onError||"continueErrorOutput"===u.value?.onError?(a(),F(w(ee),{key:3},{content:X((()=>[s("div",{class:z(e.$style.tooltipHeader)},[A(w(re),{icon:"continue-on-error",size:Si}),s("strong",{class:z(e.$style.tooltipTitle)},_(w(n).baseText("node.settings.continuesOnError.title")),3)],2),s("div",null,_(w(n).baseText("node.settings.continuesOnError")),1)])),default:X((()=>[s("div",{"data-test-id":"canvas-node-status-continue-on-error",class:z(e.$style.icon)},[A(w(re),{icon:"continue-on-error",size:Si})],2)])),_:1})):m("",!0),w(r)&&h.value?(a(),F(w(ee),{key:4},{content:X((()=>[s("div",{class:z(e.$style.tooltipHeader)},[A(w(re),{icon:"key-round",size:Si}),s("strong",{class:z(e.$style.tooltipTitle)},_(w(n).baseText("nodeSettings.dynamicCredentials.displayName")),3)],2),s("div",null,_(w(n).baseText(c.value?"node.settings.contextEstablishmentHooks":"node.settings.dynamicCredentials")),1)])),default:X((()=>[s("div",{"data-test-id":"canvas-node-status-dynamic-credentials",class:z(e.$style.icon)},[A(w(re),{icon:"key-round",size:Si})],2)])),_:1})):m("",!0)],2))}}),Ai=pe($i,[["__cssModules",{$style:{settingsIcons:"_settingsIcons_xulzx_125",tooltipHeader:"_tooltipHeader_xulzx_134",tooltipTitle:"_tooltipTitle_xulzx_139",icon:"_icon_xulzx_145"}}]]),Bi=p({__name:"ExperimentalCanvasNodeSettings",props:{nodeId:{},isReadOnly:{type:Boolean},subTitle:{},isEmbeddedInCanvas:{type:Boolean}},emits:["dblclickHeader"],setup(e,{emit:t}){const n=t,o=et(),i=Se(),r=Qe(),{renameNode:s}=Xt(),l=We(),u=Re(),d=g((()=>i?.value?.getNodeById(e.nodeId))),c=g((()=>l.getForeignCredentialsIfSharingEnabled(d.value?.credentials))),h=g((()=>r.isActionActive.workflowRunning)),p=g((()=>o.executionWaitingForWebhook)),v=g((()=>h.value||p.value));function f(e){"name"===e.name&&e.oldValue&&s(e.oldValue,e.value)}function _(e){e.ctrlKey||e.currentTarget instanceof HTMLElement&&e.currentTarget.scrollHeight<=e.currentTarget.offsetHeight||Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.stopImmediatePropagation()}return(t,o)=>(a(),F(nn,{dragging:!1,"active-node":d.value,"push-ref":w(u).pushRef,"foreign-credentials":c.value,"read-only":e.isReadOnly,"block-u-i":v.value,executable:!e.isReadOnly,"is-embedded-in-canvas":e.isEmbeddedInCanvas,"sub-title":e.subTitle,"extra-tabs-class-name":"nodrag","extra-parameter-wrapper-class-name":"nodrag","is-ndv-v2":"","hide-execute":"","hide-docs":!1,"hide-sub-connections":"",onValueChanged:f,onCaptureWheelBody:_,onDblclickHeader:o[0]||(o[0]=e=>n("dblclickHeader",e))},{actions:X((()=>[$(t.$slots,"actions")])),_:3},8,["active-node","push-ref","foreign-credentials","read-only","block-u-i","executable","is-embedded-in-canvas","sub-title"]))}}),e("i",ji=Bi),Di=p({__name:"ExperimentalEmbeddedNdvActions",props:{isExpanded:{type:Boolean}},emits:["openNdv","toggleExpand"],setup(e,{emit:t}){const n=t;return(t,o)=>(a(),l("div",{class:z(t.$style.actions)},[A(w(ne),{variant:"ghost",icon:"expand",size:"xsmall","icon-size":"small","aria-label":"Open...",onClick:o[0]||(o[0]=S((e=>n("openNdv")),["stop"]))}),A(w(ne),{variant:"ghost",icon:e.isExpanded?"chevron-down":"chevron-up",size:"xsmall","icon-size":"medium","aria-label":"Toggle expand",onClick:o[1]||(o[1]=S((e=>n("toggleExpand")),["stop"]))},null,8,["icon"])],2))}}),Ri=pe(Di,[["__cssModules",{$style:{actions:"_actions_1x1ab_125"}}]]),Li=p({__name:"ExperimentalEmbeddedNodeDetails",props:{nodeId:{},isReadOnly:{type:Boolean}},setup(e){const t=Q(),n=Re(),o=Wt(),r=g((()=>!o.collapsedNodes[e.nodeId])),u=at(),c=Se();Kt({view_shown:"zoomed_view"});const h=g((()=>c?.value?.getNodeById(e.nodeId)??null)),p=g((()=>h.value?u.getNodeType(h.value.type,h.value.typeVersion):null)),v=ze(),{isPaneMoving:f}=Hd(),m=g((()=>v.isNodeIntersecting({id:e.nodeId},{x:-v.viewport.value.x/v.viewport.value.zoom,y:-v.viewport.value.y/v.viewport.value.zoom,width:v.dimensions.value.width/v.viewport.value.zoom,height:v.dimensions.value.height/v.viewport.value.zoom}))),y=d(m.value),b=g((()=>h.value&&p.value?function(e,t,n,o){if(e.disabled)return`(${o.baseText("node.disabled")})`;const a=t.displayName??"";if(!n)return a;const i=e.parameters.operation,r=i&&t.properties.find((e=>"operation"===e.name))?.options?.find((e=>"value"in e&&e.value===i))?.name;return r?`${a}: ${r}`:a}(h.value,p.value,!r.value,t):void 0)),x=g((()=>.8*v.dimensions.value.height)),k=sn(h);function N(){o.setNodeExpanded(e.nodeId)}function C(){h.value&&n.setActiveNodeName(h.value.name,"canvas_zoomed_view")}return V(wt,k),Z(m,(e=>{y.value=y.value||e})),(t,n)=>(a(),l("div",{class:z([t.$style.component,r.value?t.$style.expanded:t.$style.collapsed,h.value?.disabled?t.$style.disabled:""]),style:Y({"--input--max-height--focus":x.value/w(o).maxCanvasZoom+"px",pointerEvents:w(f)?"none":"auto"})},[h.value&&y.value?r.value?(a(),F(ji,{key:1,tabindex:"-1","node-id":e.nodeId,class:z(t.$style.settingsView),"is-read-only":e.isReadOnly,"sub-title":b.value,"input-node-name":w(k)?.inputNode?.name,"is-embedded-in-canvas":"",onDblclickHeader:C},{actions:X((()=>[A(Ri,{"is-expanded":r.value,onOpenNdv:C,onToggleExpand:N},null,8,["is-expanded"])])),_:1},8,["node-id","class","is-read-only","sub-title","input-node-name"])):(a(),l("div",{key:2,role:"button",class:z(t.$style.collapsedContent),onClick:N},[A(Zt,{"node-type":p.value,size:18},null,8,["node-type"]),s("div",{class:z(t.$style.collapsedNodeName)},[A(w(se),{bold:""},{default:X((()=>[i(_(h.value.name),1)])),_:1}),A(w(se),{bold:"",size:"small",color:"text-light"},{default:X((()=>[i(_(b.value),1)])),_:1})],2),A(Ri,{"is-expanded":r.value,onOpenNdv:C,onToggleExpand:N},null,8,["is-expanded"])],2)):(a(),l(E,{key:0},[],64))],6))}}),Pi=pe(Li,[["__cssModules",{$style:{component:"_component_8xduy_125",expanded:"_expanded_8xduy_138",collapsed:"_collapsed_8xduy_148",collapsedContent:"_collapsedContent_8xduy_160",settingsView:"_settingsView_8xduy_161",disabled:"_disabled_8xduy_183",collapsedNodeName:"_collapsedNodeName_8xduy_193"}}]]),Vi=p({__name:"CanvasNodeTooltip",props:{visible:{type:Boolean}},setup(e){const{render:t}=Qd(),n=g((()=>t.value.options));return(t,o)=>(a(),l("div",{class:z(t.$style.tooltipAnchor)},[A(w(ee),{placement:"top","show-after":500,visible:e.visible,teleported:!1,"content-class":t.$style.content,"avoid-collisions":!1},{content:X((()=>[i(_(n.value.tooltip),1)])),default:X((()=>[s("span",{class:z(t.$style.tooltipTrigger)},null,2)])),_:1},8,["visible","content-class"])],2))}}),qi=pe(Vi,[["__cssModules",{$style:{tooltipAnchor:"_tooltipAnchor_hvf3v_125",content:"_content_hvf3v_135"}}]]),Hi=p({__name:"CanvasNodeDisabledStrikeThrough",setup(e){const t=T(),{hasRunData:n,render:o}=Qd(),i=g((()=>({[t.disabledStrikeThrough]:!0,[t.success]:n.value,[t.warning]:o.value.type===Me.Default&&void 0!==o.value.options.dirtiness})));return(e,t)=>(a(),l("div",{class:z(i.value)},null,2))}}),Fi=pe(Hi,[["__cssModules",{$style:{disabledStrikeThrough:"_disabledStrikeThrough_l3m1g_125",success:"_success_l3m1g_134",warning:"_warning_l3m1g_138"}}]]),Wi=["data-test-id"],Yi=p({__name:"CanvasNodeDefault",emits:["open:contextmenu","activate","replace:node"],setup(e,{emit:t}){const n=T(),o=Q(),i=t,{initialized:r,viewport:u,isExperimentalNdvActive:c}=Hd(),{calculateNodeBorderOpacity:h}=Kd(u),p=ue(),{id:v,label:f,subtitle:y,inputs:b,outputs:x,connections:k,isDisabled:E,isReadOnly:N,isSelected:C,hasPinnedData:M,executionStatus:I,executionWaiting:$,executionWaitingForNext:B,executionRunning:j,hasRunData:D,hasExecutionErrors:R,render:L,isNotInstalledCommunityNode:P}=Qd(),{mainOutputs:V,mainOutputConnections:q,mainInputs:H,mainInputConnections:W,nonMainInputs:X}=Jd({inputs:b,outputs:x,connections:k}),U=We(),G=g((()=>L.value.options)),Z=g((()=>p.name===gt.DEMO)),K=g((()=>({[n.node]:!0,[n.selected]:C.value,[n.disabled]:E.value||P.value&&!Z.value,[n.success]:D.value&&"success"===I.value,[n.error]:R.value,[n.pinned]:M.value,[n.waiting]:$.value||"waiting"===I.value,[n.running]:j.value||B.value,[n.configurable]:G.value.configurable,[n.configuration]:G.value.configuration,[n.trigger]:G.value.trigger,[n.warning]:void 0!==G.value.dirtiness,[n.placeholder]:G.value.placeholder,waiting:$.value||"waiting"===I.value,running:j.value||B.value}))),J=g((()=>G.value.configuration?30:40)),ee=g((()=>ve(G.value.configuration??!1,G.value.configurable??!1,H.value.length,V.value.length,X.value.length,c.value))),te=h(),ne=g((()=>({"--canvas-node--width":`${ee.value.width}px`,"--canvas-node--height":`${ee.value.height}px`,"--node--icon--size":`${J.value}px`,"--canvas-node--border--opacity-light":te.value.light,"--canvas-node--border--opacity-dark":te.value.dark}))),oe=g((()=>{let e="default";return G.value.configurable?e="configurable":G.value.configuration?e="configuration":G.value.trigger&&(e="trigger"),`canvas-${e}-node`})),ae=g((()=>{const e=1===H.value.length&&W.value.length<=1,t=1===V.value.length&&q.value.length<=1;return E.value&&e&&t})),ie=g((()=>G.value.placeholder?{type:"icon",name:"plus"}:G.value.icon)),re=d(!1);function se(e){i("open:contextmenu",e)}function le(e){G.value.placeholder?i("replace:node",v.value):i("activate",v.value,e)}return O(r,(()=>{r.value&&(re.value=!0)})),O(u,(()=>{re.value=!1,setTimeout((()=>{re.value=!0}),0)})),(e,t)=>w(c)?(a(),F(Pi,{key:0,"node-id":w(v),class:z(K.value),style:Y(ne.value),"is-read-only":w(N),"is-configurable":G.value.configurable??!1},null,8,["node-id","class","style","is-read-only","is-configurable"])):(a(),l("div",{key:1,class:z(K.value),style:Y(ne.value),"data-test-id":oe.value,onContextmenu:se,onDblclick:S(le,["stop"])},[G.value.tooltip?(a(),F(qi,{key:0,visible:re.value},null,8,["visible"])):m("",!0),A(Zt,{"icon-source":ie.value,size:J.value,shrink:!1,disabled:w(E),class:z(w(n).icon)},null,8,["icon-source","size","disabled","class"]),G.value.configuration||w(E)||w(M)&&!w(U).isProductionExecutionPreview.value?m("",!0):(a(),F(Ai,{key:1})),ae.value?(a(),F(Fi,{key:2})):m("",!0),s("div",{class:z(w(n).description)},[w(f)?(a(),l("div",{key:0,class:z(w(n).label)},_(w(f)),3)):m("",!0),w(E)?(a(),l("div",{key:1,class:z(w(n).disabledLabel)}," ("+_(w(o).baseText("node.disabled"))+") ",3)):m("",!0),w(y)&&!w(P)?(a(),l("div",{key:2,class:z(w(n).subtitle)},_(w(y)),3)):m("",!0)],2),w(E)?m("",!0):(a(),F(Ei,{key:3,class:z(w(n).statusIcons)},null,8,["class"]))],46,Wi))}}),Xi=pe(Yi,[["__cssModules",{$style:{node:"_node_9txz0_125",trigger:"_trigger_9txz0_141",running:"_running_9txz0_144",waiting:"_waiting_9txz0_144",configuration:"_configuration_9txz0_152",statusIcons:"_statusIcons_9txz0_158",configurable:"_configurable_9txz0_161",icon:"_icon_9txz0_161",description:"_description_9txz0_164",label:"_label_9txz0_177",subtitle:"_subtitle_9txz0_180",selected:"_selected_9txz0_199",success:"_success_9txz0_203",warning:"_warning_9txz0_210",error:"_error_9txz0_214",pinned:"_pinned_9txz0_217",disabled:"_disabled_9txz0_224",placeholder:"_placeholder_9txz0_240","border-rotate":"_border-rotate_9txz0_1",disabledLabel:"_disabledLabel_9txz0_295"}}]]),Gi={svg:"http://www.w3.org/2000/svg",xhtml:Ui="http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Zi=Array.prototype.find,Ki=Array.prototype.filter,mc.prototype={constructor:mc,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)}},nh.prototype={add:function(e){this._names.indexOf(e)<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}},Qi=[null],Lh.prototype={constructor:Lh,select:rc,selectAll:uc,selectChild:hc,selectChildren:vc,filter:fc,data:kc,enter:_c,exit:zc,join:Nc,merge:Cc,selection:Ph,order:Tc,sort:Mc,call:Oc,nodes:Sc,node:$c,size:Ac,empty:Bc,each:jc,attr:Hc,style:Uc,property:Jc,classed:lh,text:hh,html:gh,raise:mh,lower:bh,append:wh,insert:kh,remove:zh,clone:Th,datum:Mh,on:$h,dispatch:Dh,[Symbol.iterator]:Rh},Ji={value:()=>{}},Fh.prototype=Hh.prototype={constructor:Fh,on:function(e,t){var n,o=this._,a=Wh(e+"",o),i=-1,r=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<r;)if(n=(e=a[i]).type)o[n]=Xh(o[n],e.name,t);else if(null==t)for(n in o)o[n]=Xh(o[n],e.name,null);return this}for(;++i<r;)if((n=(e=a[i]).type)&&(n=Yh(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fh(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,a=new Array(n),i=0;i<n;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(o=this._[e]).length;i<n;++i)o[i].value.apply(t,a)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],a=0,i=o.length;a<i;++a)o[a].value.apply(t,n)}},er={passive:!1},tr={capture:!0,passive:!1},nr=e=>()=>e,Zh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e},ar={[(or=(e=>(e.Line="line",e.Handle="handle",e))(or||{})).Line]:"right",[or.Handle]:"bottom-right"},ir={[or.Line]:"borderColor",[or.Handle]:"backgroundColor"},rr=p({name:"ResizeControl",compatConfig:{MODE:3},props:{nodeId:{},color:{},minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:{},variant:{default:"handle"},shouldResize:{},keepAspectRatio:{type:[Boolean,Number],default:!1},autoScale:{type:Boolean,default:!0},handleClassName:{},handleStyle:{},lineClassName:{},lineStyle:{},isVisible:{type:Boolean}},emits:["resizeStart","resize","resizeEnd"],setup(e,{emit:t}){const n=e,o={width:0,height:0,x:0,y:0},i={...o,pointerX:0,pointerY:0,aspectRatio:1},{findNode:s,emits:u,viewport:c,noDragClassName:h}=ze(),p=ye(),v=d();let f=i,_=o;const m=r((()=>n.position??ar[n.variant])),y=g((()=>m.value.split("-"))),b=r((()=>n.color?{[ir[n.variant]]:n.color}:{}));return N((e=>{if(!v.value||!n.nodeId)return;const o=Vh(v.value),a=m.value.includes("right")||m.value.includes("left"),i=m.value.includes("bottom")||m.value.includes("top"),r=m.value.includes("left"),l=m.value.includes("top"),d=tp().on("start",(e=>{const o=s(n.nodeId),{xSnapped:a,ySnapped:i}=p(e);_={width:(null==o?void 0:o.dimensions.width)??0,height:(null==o?void 0:o.dimensions.height)??0,x:(null==o?void 0:o.position.x)??0,y:(null==o?void 0:o.position.y)??0},f={..._,pointerX:a,pointerY:i,aspectRatio:_.width/_.height},t("resizeStart",{event:e,params:_})})).on("drag",(e=>{var o;const{xSnapped:d,ySnapped:c}=p(e),h=s(n.nodeId);if(h){const s=[],{pointerX:p,pointerY:v,width:g,height:m,x:y,y:b,aspectRatio:w}=f,{x:x,y:k,width:E,height:z}=_,N=Math.floor(a?d-p:0),C=Math.floor(i?c-v:0);let T=Ae(g+(r?-N:N),n.minWidth,n.maxWidth),M=Ae(m+(l?-C:C),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const e=T/M;let t=w;"number"==typeof n.keepAspectRatio&&e!==n.keepAspectRatio&&(t=n.keepAspectRatio);const o=a&&i;T=e<=t&&o||i&&!a?M*t:T,M=e>t&&o||a&&!i?T/t:M,T>=n.maxWidth?(T=n.maxWidth,M=n.maxWidth/t):T<=n.minWidth&&(T=n.minWidth,M=n.minWidth/t),M>=n.maxHeight?(M=n.maxHeight,T=n.maxHeight*t):M<=n.minHeight&&(M=n.minHeight,T=n.minHeight*t)}const I=T!==E,O=M!==z;if(r||l){const e=r?y-(T-g):y,t=l?b-(M-m):b,n=e!==x&&I,o=t!==k&&O;if(n||o){const a={id:h.id,type:"position",from:h.position,position:{x:n?e:x,y:o?t:k}};s.push(a),_.x=a.position.x,_.y=a.position.y}}if(n.nodeId&&(I||O)){const e={id:n.nodeId,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:T,height:M}};s.push(e),_.width=T,_.height=M}if(0===s.length)return;const S=function({width:e,prevWidth:t,height:n,prevHeight:o,invertX:a,invertY:i}){const r=e-t,s=n-o,l=[r>0?1:r<0?-1:0,s>0?1:s<0?-1:0];return r&&a&&(l[0]=-1*l[0]),s&&i&&(l[1]=-1*l[1]),l}({width:_.width,prevWidth:E,height:_.height,prevHeight:z,invertX:r,invertY:l}),$={..._,direction:S};if(!1===(null==(o=n.shouldResize)?void 0:o.call(n,e,$)))return;t("resize",{event:e,params:$}),u.nodesChange(s)}})).on("end",(e=>{if(n.nodeId){const o={id:n.nodeId,type:"dimensions",resizing:!1};t("resizeEnd",{event:e,params:_}),u.nodesChange([o])}}));o.call(d),e((()=>{o.on(".drag",null)}))})),(e,t)=>(a(),l("div",{ref_key:"resizeControlRef",ref:v,class:z(["vue-flow__resize-control",[...y.value,e.variant,w(h)]]),style:Y({...b.value,scale:e.variant===w(or).Handle?`${Math.max(1/w(c).zoom,1)}`:void 0})},[$(e.$slots,"default")],6))}}),sr=p({name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1,props:{nodeId:{},color:{},handleClassName:{},handleStyle:{},lineClassName:{},lineStyle:{},isVisible:{type:Boolean,default:!0},minWidth:{},minHeight:{},maxWidth:{},maxHeight:{},shouldResize:{},keepAspectRatio:{type:[Boolean,Number]},autoScale:{type:Boolean,default:!0}},emits:["resizeStart","resize","resizeEnd"],setup(e,{emit:t}){const n=e,{findNode:o,emits:i}=ze(),s=["top-left","top-right","bottom-left","bottom-right"],u=["top","right","bottom","left"],d=f(je,null),c=r((()=>"string"==typeof n.nodeId?n.nodeId:d)),h=g((()=>o(c.value)));return O([()=>n.minWidth,()=>n.minHeight,()=>n.maxWidth,()=>n.maxHeight,()=>{var e;return!!(null==(e=h.value)?void 0:e.dimensions.width)&&!!h.value.dimensions.height}],(([e,t,n,o,a])=>{const r=h.value;if(r&&a){const a={id:r.id,type:"dimensions",updateStyle:!0,dimensions:{width:r.dimensions.width,height:r.dimensions.height}};e&&r.dimensions.width<e&&(a.dimensions.width=e),t&&r.dimensions.height<t&&(a.dimensions.height=t),n&&r.dimensions.width>n&&(a.dimensions.width=n),o&&r.dimensions.height>o&&(a.dimensions.height=o),a.dimensions.width===r.dimensions.width&&a.dimensions.height===r.dimensions.height||i.nodesChange([a])}}),{flush:"post",immediate:!0}),(e,n)=>e.isVisible?(a(),l(E,{key:0},[(a(),l(E,null,L(u,(o=>A(rr,{key:o,class:z(e.lineClassName),style:Y(e.lineStyle),"node-id":c.value,position:o,variant:w(or).Line,color:e.color,"min-width":e.minWidth,"min-height":e.minHeight,"max-width":e.maxWidth,"max-height":e.maxHeight,"should-resize":e.shouldResize,"keep-aspect-ratio":e.keepAspectRatio,"auto-scale":e.autoScale,onResizeStart:n[0]||(n[0]=e=>t("resizeStart",e)),onResize:n[1]||(n[1]=e=>t("resize",e)),onResizeEnd:n[2]||(n[2]=e=>t("resizeEnd",e))},null,8,["class","style","node-id","position","variant","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio","auto-scale"]))),64)),(a(),l(E,null,L(s,(o=>A(rr,{key:o,class:z(e.handleClassName),style:Y(e.handleStyle),"node-id":c.value,position:o,color:e.color,"min-width":e.minWidth,"min-height":e.minHeight,"max-width":e.maxWidth,"max-height":e.maxHeight,"should-resize":e.shouldResize,"keep-aspect-ratio":e.keepAspectRatio,"auto-scale":e.autoScale,onResizeStart:n[3]||(n[3]=e=>t("resizeStart",e)),onResize:n[4]||(n[4]=e=>t("resize",e)),onResizeEnd:n[5]||(n[5]=e=>t("resizeEnd",e))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio","auto-scale"]))),64))],64)):m("",!0)}}),lr=p({inheritAttrs:!1,__name:"CanvasNodeStickyNote",emits:["update","move","activate","deactivate","open:contextmenu"],setup(e,{emit:t}){const n=t,o=T(),{id:i,isSelected:r,isReadOnly:s,render:u,eventBus:c}=Qd(),h=g((()=>u.value.options)),p=g((()=>({[o.sticky]:!0,[o.selected]:r.value,"sticky--active":f.value})));function v(e){n("move",{x:e.params.x,y:e.params.y}),n("update",{...e.params.width?{width:e.params.width}:{},...e.params.height?{height:e.params.height}:{}})}const f=d(!1);function _(e){n("update",{content:e})}function m(e){f.value!==e&&(f.value=e,n(e?"activate":"deactivate",i.value))}function b(){m(!0)}function k(e){n("open:contextmenu",e)}return x((()=>{c.value?.on("update:node:activated",b)})),R((()=>{c.value?.off("update:node:activated",b)})),(e,t)=>(a(),l(E,null,[A(w(sr),{"min-height":80,"min-width":150,height:h.value.height,width:h.value.width,"is-visible":!w(s),onResize:v},null,8,["height","width","is-visible"]),A(w(ae),y(e.$attrs,{id:w(i),class:p.value,"data-test-id":"sticky",height:h.value.height,width:h.value.width,"model-value":h.value.content,"background-color":h.value.color,"edit-mode":f.value,"read-only":w(s),onEdit:m,onDblclick:S(b,["stop"]),"onUpdate:modelValue":_,onContextmenu:k}),null,16,["id","class","height","width","model-value","background-color","edit-mode","read-only"])],64))}}),ur=pe(lr,[["__cssModules",{$style:{sticky:"_sticky_1k3w0_125",selected:"_selected_1k3w0_132"}}]]),dr=pe(p({__name:"CanvasNodeAddNodes",setup(e){const t=Ft(),n=Q(),o=$t(),r=Ke(),u=de(),c=d(!1),h=g((()=>Ve()&&o.isTemplatesEnabled));function p(){c.value=!0}function v(){c.value=!1}function f(){t.openNodeCreatorForTriggerNodes(Ct.TRIGGER_PLACEHOLDER_BUTTON)}async function y(){Ee(fe.emptyWorkflowLink),r.hasCustomTemplatesHost?await u.push({name:gt.TEMPLATES}):window.open(r.websiteTemplateRepositoryURL,"_blank")}return x((()=>{He.on("runWorkflowButton:mouseenter",p),He.on("runWorkflowButton:mouseleave",v)})),R((()=>{He.off("runWorkflowButton:mouseenter",p),He.off("runWorkflowButton:mouseleave",v)})),(e,t)=>(a(),l("div",{ref:"container",class:z(e.$style.addNodes),"data-test-id":"canvas-add-button"},[A(w(ee),{placement:"top",visible:c.value,"show-after":700},{content:X((()=>[i(_(w(n).baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)])),default:X((()=>[s("button",{class:z(e.$style.button),"data-test-id":"canvas-plus-button",onClick:S(f,["stop"])},[A(w(re),{icon:"plus",color:"foreground-xdark",size:40})],2)])),_:1},8,["visible"]),s("p",{class:z(e.$style.label)},[i(_(w(n).baseText("nodeView.canvasAddButton.addFirstStep"))+" ",1),h.value?(a(),F(w(ce),{key:0,underline:!0,size:"small","data-test-id":"canvas-template-link",onClick:y},{default:X((()=>[i(_(w(n).baseText("nodeView.templateLink")),1)])),_:1})):m("",!0)],2)],2))}}),[["__cssModules",{$style:{addNodes:"_addNodes_1ik7n_125",button:"_button_1ik7n_133",label:"_label_1ik7n_147"}}]]),cr=pe(p({__name:"CanvasNodeChoicePrompt",setup(e){const t=Ft(),n=Bt(),o=Q(),r=$t(),u=Ke(),d=de(),c=At(),h=g((()=>n.isOpen&&n.isBuilderModeActive)),p=g((()=>Ve()&&r.isTemplatesEnabled)),v=()=>{t.isCreateNodeActive?t.isCreateNodeActive=!1:t.openNodeCreatorForTriggerNodes(Ct.TRIGGER_PLACEHOLDER_BUTTON)};async function f(){c.trackUserOpenedAssistant({source:"build_with_ai",task:"placeholder",has_existing_session:!c.isSessionEnded}),await n.toggle({mode:"builder"})}async function y(){Ee(fe.emptyWorkflowLink),u.hasCustomTemplatesHost?await d.push({name:gt.TEMPLATES}):window.open(u.websiteTemplateRepositoryURL,"_blank")}return(e,n)=>(a(),l("div",{class:z(e.$style.choicePrompt),"data-test-id":"canvas-choice-prompt",onClick:n[0]||(n[0]=S((()=>{}),["stop"])),onMousedown:n[1]||(n[1]=S((()=>{}),["stop"]))},[s("div",{class:z(e.$style.option)},[s("div",{class:z([e.$style.selectedButtonHighlight,{[e.$style.highlighted]:w(t).isCreateNodeActive}])},[s("button",{class:z(e.$style.button),"data-test-id":"canvas-add-first-step-button",onMousedown:S(v,["stop","prevent"])},[A(w(re),{icon:"plus",color:"foreground-xdark",size:40})],34)],2),s("p",{class:z(e.$style.label)},[i(_(w(o).baseText("nodeView.canvasAddButton.addFirstStep"))+" ",1),p.value?(a(),F(w(ce),{key:0,underline:!0,size:"small","data-test-id":"canvas-template-link",onClick:y},{default:X((()=>[i(_(w(o).baseText("nodeView.templateLink")),1)])),_:1})):m("",!0)],2)],2),s("div",{class:z(e.$style.orDivider)},[s("span",{class:z(e.$style.orText)},_(w(o).baseText("generic.or")),3)],2),s("div",{class:z(e.$style.option)},[s("div",{class:z([e.$style.selectedButtonHighlight,{[e.$style.highlighted]:h.value}])},[s("button",{class:z([e.$style.button]),"data-test-id":"canvas-build-with-ai-button",onMousedown:S(f,["stop","prevent"])},[A(w(re),{icon:"wand-sparkles",color:"foreground-xdark",size:40})],34)],2),s("p",{class:z(e.$style.label)},_(w(o).baseText("aiAssistant.builder.canvasPrompt.buildWithAI")),3)],2)],34))}}),[["__cssModules",{$style:{choicePrompt:"_choicePrompt_5k7m7_125",option:"_option_5k7m7_133",button:"_button_5k7m7_140",selectedButtonHighlight:"_selectedButtonHighlight_5k7m7_150",highlighted:"_highlighted_5k7m7_153",label:"_label_5k7m7_157",orDivider:"_orDivider_5k7m7_169",orText:"_orText_5k7m7_177"}}]]),hr=p({__name:"CanvasNodeRenderer",setup(e){const t=f(Ot),n=()=>{const e=t?.data.value.render.type??Me.Default;let n;switch(e){case Me.StickyNote:n=ur;break;case Me.AddNodes:n=dr;break;case Me.ChoicePrompt:n=cr;break;default:n=Xi}return h(n,{"data-canvas-node-render-type":e})};return(e,t)=>(a(),F(n))}}),pr=hr,vr=pe(p({__name:"CanvasHandleDot",props:{handleClasses:{default:void 0}},setup(e){const t=e,n=g((()=>"source"===t.handleClasses));return(t,o)=>(a(),l("div",{class:z([t.$style.wrapper,{[t.$style.output]:n.value}])},[s("div",{class:z([t.$style.dot,e.handleClasses])},null,2)],2))}}),[["__cssModules",{$style:{wrapper:"_wrapper_1jh0f_125",output:"_output_1jh0f_131",dot:"_dot_1jh0f_135"}}]]),fr=p({__name:"CanvasHandleMainInput",setup(e){const t=T(),{label:n,isRequired:o}=np(),{viewport:i}=Hd(),{calculateHandleLightness:r}=Kd(i),u=g((()=>({"canvas-node-handle-main-input":!0,[t.handle]:!0,[t.required]:o.value}))),d=r(),c=g((()=>({"--handle--border--lightness--light":d.value.light,"--handle--border--lightness--dark":d.value.dark})));return(e,o)=>(a(),l("div",{class:z(u.value)},[s("div",{class:z([w(t).label])},_(w(n)),3),A(vr,{"handle-classes":"target",style:Y(c.value)},null,8,["style"])],2))}}),gr=pe(fr,[["__cssModules",{$style:{handle:"_handle_1rqcc_125",label:"_label_1rqcc_132",required:"_required_1rqcc_147"}}]]),_r=["viewBox"],mr=["x1","y1","x2","y2"],yr=["transform"],br=pe(p({__name:"CanvasHandlePlus",props:{position:{default:"right"},handleClasses:{default:void 0},plusSize:{default:24},lineSize:{default:46},type:{default:"default"}},emits:["click:plus"],setup(e,{emit:t}){const n=e,{viewport:o}=Hd(),{calculateEdgeLightness:i}=Kd(o),r=i(),u=t,d=T(),c=g((()=>["canvas-handle-plus",d.container,d[n.position],n.handleClasses])),h=g((()=>{switch(n.position){case"bottom":case"top":return{width:n.plusSize,height:n.lineSize+n.plusSize};default:return{width:n.lineSize+n.plusSize,height:n.plusSize}}})),p=g((()=>({width:`${h.value.width}px`,height:`${h.value.height}px`,"--canvas-handle-plus-line--color--lightness--light":r.value.light,"--canvas-handle-plus-line--color--lightness--dark":r.value.dark}))),v=g((()=>{switch(n.position){case"top":return[[h.value.width/2,h.value.height-n.lineSize+1],[h.value.width/2,h.value.height]];case"bottom":return[[h.value.width/2,0],[h.value.width/2,n.lineSize+1]];case"left":return[[h.value.width-n.lineSize-1,h.value.height/2],[h.value.width,h.value.height/2]];default:return[[0,h.value.height/2],[n.lineSize+1,h.value.height/2]]}})),f=g((()=>{switch(n.position){case"bottom":return[0,h.value.height-n.plusSize];case"top":case"left":return[0,0];default:return[h.value.width-n.plusSize,0]}}));function _(e){u("click:plus",e)}return(t,n)=>(a(),l("div",{class:z(c.value),"data-test-id":"canvas-handle-plus-wrapper"},[(a(),l("svg",{class:z([t.$style.wrapper,t.$style[e.position],t.$style[e.type]]),style:Y(p.value),viewBox:`0 0 ${h.value.width} ${h.value.height}`},[s("line",{class:z([e.handleClasses,t.$style.line]),x1:v.value[0][0],y1:v.value[0][1],x2:v.value[1][0],y2:v.value[1][1],"stroke-width":"2"},null,10,mr),s("g",{"data-test-id":"canvas-handle-plus",class:z([t.$style.plus,e.handleClasses,"clickable"]),transform:`translate(${f.value[0]}, ${f.value[1]})`,onClick:S(_,["stop"])},[s("rect",{class:z([e.handleClasses,"clickable"]),x:"2",y:"2",width:"20",height:"20",stroke:"light-dark(var(--color--neutral-200), var(--color--neutral-850))","stroke-width":"2",rx:"4",fill:"light-dark(var(--color--neutral-200), var(--color--neutral-850))"},null,2),n[0]||(n[0]=s("path",{stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",d:"M8 12h8m-4-4v8",class:"source clickable"},null,-1))],10,yr)],14,_r))],2))}}),[["__cssModules",{$style:{container:"_container_276y9_125",bottom:"_bottom_276y9_128",wrapper:"_wrapper_276y9_140",right:"_right_276y9_145",line:"_line_276y9_151",success:"_success_276y9_154",plus:"_plus_276y9_157"}}]]),wr="source",xr=p({__name:"CanvasHandleMainOutput",emits:["add"],setup(e,{emit:t}){const n=t,o=T(),i=Q(),{render:r}=Qd(),{label:s,isConnected:u,isConnecting:c,isReadOnly:h,isRequired:p,runData:v}=np(),{viewport:f}=Hd(),{calculateHandleLightness:y}=Kd(f),b=g((()=>({"canvas-node-handle-main-output":!0,[o.handle]:!0,[o.connected]:u.value,[o.required]:p.value}))),x=d(!1),k=g((()=>r.value.options)),E=g((()=>v.value?.total??0)),N=g((()=>!u.value&&v.value&&v.value.total>0?i.baseText("ndv.output.items",{adjustToNumber:v.value.total,interpolate:{count:String(v.value.total)}}):"")),M=g((()=>!c.value||x.value)),I=g((()=>E.value>0?"success":"default")),O=g((()=>({small:46,medium:66,large:80}[(E.value>0?"large":k.value.outputs?.labelSize)??"small"]))),S=g((()=>({[o.label]:!0,[o.outputLabel]:!0}))),$=g((()=>({[o.label]:!0,[o.runDataLabel]:!0}))),B=y(),R=g((()=>({"--handle--border--lightness--light":B.value.light,"--handle--border--lightness--dark":B.value.dark})));function L(){x.value=!0}function P(){x.value=!1}function V(){n("add")}return(e,t)=>(a(),l("div",{class:z(b.value)},[w(s)?(a(),l("div",{key:0,class:z(S.value)},_(w(s)),3)):m("",!0),w(v)?(a(),l("div",{key:1,class:z($.value)},_(N.value),3)):m("",!0),A(vr,{"handle-classes":wr,style:Y(R.value)},null,8,["style"]),A(j,{name:"canvas-node-handle-main-output"},{default:X((()=>[w(u)||w(h)?m("",!0):C((a(),F(br,{key:0,"data-plus-type":I.value,"line-size":O.value,"handle-classes":wr,type:I.value,onMouseenter:L,onMouseleave:P,"onClick:plus":V},null,8,["data-plus-type","line-size","type"])),[[D,M.value]])])),_:1})],2))}}),kr=pe(xr,[["__cssModules",{$style:{handle:"_handle_4le4q_125",connected:"_connected_4le4q_131",label:"_label_4le4q_131",required:"_required_4le4q_145",outputLabel:"_outputLabel_4le4q_150",runDataLabel:"_runDataLabel_4le4q_160"}}]]),Er=pe(p({__name:"CanvasHandleDiamond",props:{handleClasses:{default:void 0}},setup:e=>(t,n)=>(a(),l("div",{class:z(t.$style.wrapper)},[s("div",{class:z([t.$style.diamond,e.handleClasses])},null,2)],2))}),[["__cssModules",{$style:{wrapper:"_wrapper_149eq_125",diamond:"_diamond_149eq_131"}}]]),zr="target",Nr=p({__name:"CanvasHandleNonMainInput",emits:["add"],setup(e,{emit:t}){const n=t,o=T(),{label:i,isConnected:r,isConnecting:u,isRequired:c,maxConnections:h}=np(),{viewport:p}=Hd(),{calculateHandleLightness:v}=Kd(p),f=g((()=>({"canvas-node-handle-non-main-input":!0,[o.handle]:!0,[o.required]:c.value}))),y=g((()=>!r.value||!h.value||h.value>1)),b=d(!1),x=g((()=>!u.value||b.value||!h.value||h.value>1)),k=v(),E=g((()=>({"--handle--border--lightness--light":k.value.light,"--handle--border--lightness--dark":k.value.dark})));function N(){b.value=!0}function M(){b.value=!1}function I(){n("add")}return(e,t)=>(a(),l("div",{class:z(f.value)},[s("div",{class:z([w(o).label])},_(w(i)),3),A(Er,{"handle-classes":zr,style:Y(E.value)},null,8,["style"]),A(j,{name:"canvas-node-handle-non-main-input"},{default:X((()=>[y.value?C((a(),F(br,{key:0,"handle-classes":zr,type:"secondary",position:"bottom",onMouseenter:N,onMouseleave:M,"onClick:plus":I},null,512)),[[D,x.value]]):m("",!0)])),_:1})],2))}}),Cr=pe(Nr,[["__cssModules",{$style:{handle:"_handle_1i9b3_125",label:"_label_1i9b3_132",required:"_required_1i9b3_146"}}]]),Tr=p({__name:"CanvasHandleNonMainOutput",setup(e){const t=T(),{label:n,isRequired:o}=np(),{viewport:i}=Hd(),{calculateHandleLightness:r}=Kd(i),u=g((()=>({"canvas-node-handle-non-main-output":!0,[t.handle]:!0,[t.required]:o.value}))),d=r(),c=g((()=>({"--handle--border--lightness--light":d.value.light,"--handle--border--lightness--dark":d.value.dark})));return(e,o)=>(a(),l("div",{class:z(u.value)},[s("div",{class:z(w(t).label)},_(w(n)),3),A(Er,{"handle-classes":"source",style:Y(c.value)},null,8,["style"])],2))}}),Mr=pe(Tr,[["__cssModules",{$style:{handle:"_handle_1utsl_125",label:"_label_1utsl_132",required:"_required_1utsl_145"}}]]),Ir=p({inheritAttrs:!1,__name:"CanvasHandleRenderer",props:{handleId:{},connectionsCount:{},isConnecting:{type:Boolean},position:{},offset:{},node:{},type:{},index:{},required:{type:Boolean},maxConnections:{},label:{},mode:{},isReadOnly:{type:Boolean},isValidConnection:{type:Function}},emits:["add"],setup(e,{emit:t}){const n=e,o=t,i=T(),s=g((()=>n.mode===ut.Input?"target":"source")),l=g((()=>[i.handle,i[n.type],i[n.mode]])),u=g((()=>n.maxConnections&&n.connectionsCount>=n.maxConnections)),d=g((()=>!u.value&&(n.mode===ut.Output||n.type!==xt.Main))),c=g((()=>!u.value&&(n.mode===ut.Input||n.type!==xt.Main))),p=g((()=>n.connectionsCount>0)),{runDataOutputMap:v}=Qd(),f=g((()=>n.mode===ut.Output?v.value?.[n.type]?.[n.index]:void 0)),_=g((()=>[i.renderType,i[n.position]])),m=()=>{let e;return e=n.mode===ut.Output?n.type===xt.Main?kr:Mr:n.type===xt.Main?gr:Cr,e?h(e):null};function b(){o("add",n.handleId)}const x=r(n,"label"),k=r(n,"isConnecting"),E=r(n,"isReadOnly"),N=r(n,"mode"),C=r(n,"type"),M=r(n,"index"),I=r(n,"required"),O=r(n,"maxConnections");return V(yt,{label:x,mode:N,type:C,index:M,runData:f,isRequired:I,isConnected:p,isConnecting:k,isReadOnly:E,maxConnections:O}),(t,n)=>(a(),F(w(lt),y(t.$attrs,{id:e.handleId,class:l.value,type:s.value,position:e.position,style:e.offset,"connectable-start":d.value,"connectable-end":c.value,"is-valid-connection":e.isValidConnection}),{default:X((()=>[A(m,{class:z(_.value),"is-connected":p.value,"max-connections":O.value,style:Y(e.offset),label:x.value,onAdd:b},null,8,["class","is-connected","max-connections","style","label"])])),_:1},16,["id","class","type","position","style","connectable-start","connectable-end","is-valid-connection"]))}}),Or=pe(Ir,[["__cssModules",{$style:{handle:"_handle_pg5br_125",inputs:"_inputs_pg5br_140",main:"_main_pg5br_140",renderType:"_renderType_pg5br_144",top:"_top_pg5br_144",right:"_right_pg5br_148",left:"_left_pg5br_152",bottom:"_bottom_pg5br_156"}}]]),Sr=p({__name:"CanvasNodeTrigger",props:{name:{},type:{},hovered:{type:Boolean},disabled:{type:Boolean},readOnly:{type:Boolean},class:{},isExperimentalNdvActive:{type:Boolean}},setup(e){const t=T(),n=g((()=>({[e.class??""]:!0,[t.container]:!0,[t.interactive]:!e.disabled&&!e.readOnly,[t.hovered]:!!e.hovered,[t.isExperimentalNdvActive]:e.isExperimentalNdvActive}))),o=de(),i=Q(),r=et(),u=Yt(),d=ln(),{runEntireWorkflow:c}=Jt({router:o}),{startChat:h}=Xt(),p=g((()=>r.allNodes.find((e=>e.type===ft)))),v=g((()=>d.isFloatingChatEnabled&&!0===p.value?.parameters?.availableInChat)),f=g((()=>d.isOpen)),_=g((()=>v.value?f.value:u.isOpen)),y=g((()=>r.isWorkflowRunning)),b=g((()=>`execute-workflow-button-${e.name}`));function x(){v.value?d.open():h("node")}function k(){v.value?d.close():u.toggleOpen(!1)}async function N(){r.setSelectedTriggerNodeName(e.name),await c("node",e.name)}return(t,o)=>(a(),l("div",{class:z(n.value),onClick:o[0]||(o[0]=S((()=>{}),["stop","prevent"])),onMousedown:o[1]||(o[1]=S((()=>{}),["stop","prevent"]))},[s("div",null,[s("div",{class:z(t.$style.bolt)},[A(w(re),{icon:"bolt-filled",size:"large"})],2),e.readOnly?m("",!0):(a(),l(E,{key:0},[e.type===w("@n8n/n8n-nodes-langchain.chatTrigger")?(a(),l(E,{key:0},[_.value?(a(),F(w(le),{key:0,variant:"subtle",icon:"message-circle",size:"large",disabled:y.value,"data-test-id":b.value,label:w(i).baseText("chat.hide"),onClickCapture:k},null,8,["disabled","data-test-id","label"])):(a(),F(on,{key:1,label:w(i).baseText("chat.open"),shortcut:{keys:["c"]}},{default:X((()=>[A(w(le),{variant:"solid",icon:"message-circle",size:"large",disabled:y.value,"data-test-id":b.value,label:w(i).baseText("chat.open"),onClickCapture:x},null,8,["disabled","data-test-id","label"])])),_:1},8,["label"]))],64)):(a(),F(w(le),{key:1,variant:"solid",icon:"flask-conical",size:"large",disabled:y.value,"data-test-id":b.value,label:w(i).baseText("nodeView.runButtonText.executeWorkflow"),onClickCapture:N},null,8,["disabled","data-test-id","label"]))],64))])],34))}}),$r=pe(Sr,[["__cssModules",{$style:{container:"_container_ugqlg_125",interactive:"_interactive_ugqlg_155",hovered:"_hovered_ugqlg_155",isExperimentalNdvActive:"_isExperimentalNdvActive_ugqlg_160",bolt:"_bolt_ugqlg_164"}}]]),Ar=n(vt(),1),Br=["data-test-id","data-node-name","data-node-type"],jr=p({__name:"CanvasNode",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{},readOnly:{type:Boolean},eventBus:{},hovered:{type:Boolean},nearbyHovered:{type:Boolean},highlighted:{type:Boolean}},emits:["add","delete","run","select","toggle","activate","deactivate","open:contextmenu","update","update:inputs","update:outputs","move","focus","replace:node","add:ai"],setup(e,{emit:t}){const n=I(),o=t,i=T(),s=e,u=Nn(),{connectingHandle:c,isExperimentalNdvActive:h}=Hd(),p=d([]),v=g((()=>s.data.inputs)),f=g((()=>s.data.outputs)),_=g((()=>s.data.connections)),{mainInputs:b,nonMainInputs:k,requiredNonMainInputs:N,mainOutputs:C,nonMainOutputs:M,isValidConnection:S}=Jd({inputs:v,outputs:f,connections:_}),B=g((()=>s.data.disabled)),j=g((()=>({[i.canvasNode]:!0,[i.showToolbar]:be.value,hovered:s.hovered,highlighted:s.highlighted,selected:s.selected,waiting:s.data.execution.waiting||"waiting"===s.data.execution.status,running:s.data.execution.running||s.data.execution.waitingForNext,...Object.fromEntries([...p.value].map((e=>[e,!0])))}))),D=g((()=>s.data.render.type)),P=g((()=>[Me.StickyNote,Me.AddNodes,Me.ChoicePrompt].includes(D.value)?void 0:"canvas-node")),q=d(he());function H(e){e.ids.includes(s.id)&&q.value&&q.value.emit(e.action,e.payload)}const W=g((()=>Vt(k.value,N.value.length))),Y=g((()=>[...b.value.map(G),...W.value.map(Z)].filter((e=>!!e)))),X=g((()=>[...C.value.map(K),...M.value.map(Q)].filter((e=>!!e)))),U=({mode:e,position:t,offsetAxis:n})=>(o,a,i)=>{if(!o)return;const r=Lt({mode:e,type:o.type,index:o.index}),l=e===ut.Input?"target":"source",u=_.value[e][o.type]?.[o.index]?.length??0,d=c.value?.nodeId===s.id&&c.value?.handleType===l&&c.value?.handleId===r,p=t===Ye.Bottom?40+3*a*16+"px":h.value&&1===i.length?24*(1+a)+"px":100/(i.length+1)*(a+1)+"%";return{...o,handleId:r,connectionsCount:u,isConnecting:d,position:t,offset:{[n]:p}}},G=U({mode:ut.Input,position:Ye.Left,offsetAxis:"top"}),Z=U({mode:ut.Input,position:Ye.Bottom,offsetAxis:"left"}),K=U({mode:ut.Output,position:Ye.Right,offsetAxis:"top"}),Q=U({mode:ut.Output,position:Ye.Top,offsetAxis:"left"});function J(e){o("add",s.id,e)}function ee(){o("delete",s.id)}function te(){o("run",s.id)}function ne(){o("toggle",s.id)}function oe(e,t){o("activate",e,t)}function ae(){o("deactivate",s.id)}function ie(e){o("open:contextmenu",s.id,e,"node-button")}function re(e){o("open:contextmenu",s.id,e,"node-right-click")}function se(e){o("update",s.id,e)}function le(e){o("move",s.id,e)}function ue(e){o("focus",e)}function de(e){o("replace:node",e)}function ce(e){o("add:ai",e)}function pe({className:e,add:t=!0}){p.value=t?[...new Set([...p.value,e])]:p.value.filter((t=>t!==e))}const ve=r(s,"id"),fe=r(s,"data"),ge=r(s,"label"),_e=r(s,"selected"),me=r(s,"readOnly");V(Ot,{id:ve,data:fe,label:ge,selected:_e,readOnly:me,eventBus:q});const ye=g((()=>![Me.AddNodes,Me.ChoicePrompt].includes(D.value))),be=g((()=>{const e=u.target.value;return u.isOpen&&"node-button"===e?.source&&e.nodeId===ve.value}));return O((()=>s.selected),(e=>{o("select",s.id,e)})),O(v,((e,t)=>{(0,Ar.default)(e,t)||o("update:inputs",s.id)})),O(f,((e,t)=>{(0,Ar.default)(e,t)||o("update:outputs",s.id)})),x((()=>{s.eventBus?.on("nodes:action",H),q.value?.on("update:node:class",pe)})),R((()=>{s.eventBus?.off("nodes:action",H),q.value?.off("update:node:class",pe)})),(t,o)=>(a(),l("div",{class:z(j.value),"data-test-id":P.value,"data-node-name":fe.value.name,"data-node-type":fe.value.type},[(a(!0),l(E,null,L(X.value,(e=>(a(),F(Or,y({key:`${e.handleId}(${e.index+1}/${X.value.length})`,ref_for:!0},e,{mode:w(ut).Output,"is-read-only":me.value,"is-valid-connection":w(S),"data-node-name":fe.value.name,"data-test-id":"canvas-node-output-handle","data-index":e.index,"data-connection-type":e.type,onAdd:J}),null,16,["mode","is-read-only","is-valid-connection","data-node-name","data-index","data-connection-type"])))),128)),(a(!0),l(E,null,L(Y.value,(e=>(a(),F(Or,y({key:`${e.handleId}(${e.index+1}/${Y.value.length})`,ref_for:!0},e,{mode:w(ut).Input,"is-read-only":me.value,"is-valid-connection":w(S),"data-test-id":"canvas-node-input-handle","data-index":e.index,"data-connection-type":e.type,"data-node-name":fe.value.name,onAdd:J}),null,16,["mode","is-read-only","is-valid-connection","data-index","data-connection-type","data-node-name"])))),128)),n.toolbar?$(t.$slots,"toolbar",{key:0,inputs:w(b),outputs:w(C),data:fe.value}):ye.value?(a(),F(Oi,{key:1,"data-test-id":"canvas-node-toolbar","read-only":me.value,class:z(t.$style.canvasNodeToolbar),"show-status-icons":w(h),"items-class":t.$style.canvasNodeToolbarItems,onDelete:ee,onToggle:ne,onRun:te,onUpdate:se,"onOpen:contextmenu":ie,onFocus:ue,"onAdd:ai":ce},null,8,["read-only","class","show-status-icons","items-class"])):m("",!0),A(pr,{onActivate:oe,onDeactivate:ae,onMove:le,onUpdate:se,"onOpen:contextmenu":re,onDelete:ee,"onReplace:node":de}),s.data.render.type===w(Me).Default&&s.data.render.options.trigger?(a(),F($r,{key:2,name:fe.value.name,type:fe.value.type,hovered:e.nearbyHovered,disabled:B.value,"read-only":me.value,class:z(t.$style.trigger),"is-experimental-ndv-active":w(h)},null,8,["name","type","hovered","disabled","read-only","class","is-experimental-ndv-active"])):m("",!0)],10,Br))}}),e("r",Dr=pe(jr,[["__cssModules",{$style:{canvasNode:"_canvasNode_35bs3_125",canvasNodeToolbarItems:"_canvasNodeToolbarItems_35bs3_125",trigger:"_trigger_35bs3_129",showToolbar:"_showToolbar_35bs3_129",canvasNodeToolbar:"_canvasNodeToolbar_35bs3_125"}}]])),Rr=p({__name:"Canvas",props:{id:{default:"canvas"},nodes:{default:()=>[]},connections:{default:()=>[]},controlsPosition:{default:Ge.BottomLeft},eventBus:{default:()=>he()},readOnly:{type:Boolean,default:!1},executing:{type:Boolean,default:!1},keyBindings:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},suppressInteraction:{type:Boolean,default:!1},hideControls:{type:Boolean,default:!1},initialViewport:{}},emits:["update:modelValue","update:node:position","update:nodes:position","update:node:activated","update:node:deactivated","update:node:enabled","update:node:selected","update:node:name","update:node:parameters","update:node:inputs","update:node:outputs","update:logs-open","update:logs:input-open","update:logs:output-open","update:has-range-selection","click:node","click:node:add","run:node","copy:production:url","copy:test:url","delete:node","replace:node","create:node","create:sticky","delete:nodes","update:nodes:enabled","copy:nodes","duplicate:nodes","update:nodes:pin","cut:nodes","delete:connection","create:connection:start","create:connection","create:connection:end","create:connection:cancelled","click:connection:add","click:pane","run:workflow","create:workflow","drag-and-drop","tidy-up","toggle:focus-panel","viewport:change","selection:end","open:sub-workflow","start-chat","extract-workflow"],setup(e,{expose:t,emit:n}){const o=T(),i=n,s=e,{isMobileDevice:l,controlKeyCode:c}=ie(),h=tt(),p=Wt(),f=Te(),_=Bt(),E=Ut(),N=g((()=>p.isActive(re.value.zoom))),M=ze(s.id),{getSelectedNodes:I,addSelectedNodes:S,removeSelectedNodes:B,viewportRef:R,fitView:L,fitBounds:P,zoomIn:W,zoomOut:Y,zoomTo:U,setInteractive:Z,elementsSelectable:Q,project:ee,nodes:te,onPaneReady:ne,onNodesInitialized:oe,findNode:ae,viewport:re,dimensions:se,nodesSelectionActive:le,userSelectionRect:ue,setViewport:de,setCenter:ce,onEdgeMouseLeave:he,onEdgeMouseEnter:pe,onEdgeMouseMove:ve,onNodeMouseEnter:fe,onNodeMouseLeave:_e}=M,{getIncomingNodes:me,getOutgoingNodes:ye,getSiblingNodes:be,getDownstreamNodes:we,getUpstreamNodes:xe}=function({getIncomers:e,getOutgoers:t}){function n(e){return e.sort(((e,t)=>e.position.y-t.position.y))}return{sortNodesByVerticalPosition:n,getIncomingNodes:function(t){return n(e(t))},getOutgoingNodes:function(e){return n(t(e))},getSiblingNodes:function(o){return n([...e(o).flatMap((e=>t(e.id))),...t(o).flatMap((t=>e(t.id)))].filter(((e,t,n)=>n.findIndex((t=>t.id===e.id))===t)))},getDownstreamNodes:function e(n,o=[]){if(o.includes(n))return[];o.push(n);const a=t(n);return[...a,...a.flatMap((t=>e(t.id,o)))].filter(((e,t,n)=>n.findIndex((t=>t.id===e.id))===t))},getUpstreamNodes:function t(n,o=[]){if(o.includes(n))return[];o.push(n);const a=e(n);return[...a,...a.flatMap((e=>t(e.id,o)))].filter(((e,t,n)=>n.findIndex((t=>t.id===e.id))===t))}}}(M),{layout:ke}=Pr(s.id,N),Ee=d(!1),Ne=g((()=>({[o.canvas]:!0,[o.ready]:!s.loading&&Ee.value,[o.isExperimentalNdvActive]:N.value,spotlightActive:E.isHighlightActive}))),Ce=d(!!l||[" ",c]),Ie=d(!!l||[1]),Oe=d(!l||"Shift"),Se=d(!1);function Ae(){Oe.value=!0,Ie.value=[1],Se.value=!1}J(Ce.value,(function(){Oe.value=null,Ie.value=[0,1],Se.value=!0}),{dedupe:!0}),K(Ce.value,Ae),function(e,t,{dedupe:n=!0,threshold:o=300,disabled:a=!1}){const i=d(null);J(e,(()=>{w(a)||(i.value=Date.now())}),{dedupe:n}),K(e,(()=>{!w(a)&&i.value&&Date.now()-i.value<o&&t()}))}(" ",(()=>{Xe.value&&i("update:node:name",Xe.value.id)}),{disabled:r(s,"readOnly")});const je=g((()=>!s.keyBindings));function Re(e){const t=me(e)[0];t&&ht({ids:[t.id]})}function Le(e){const t=ye(e)[0];t&&ht({ids:[t.id]})}function Pe(e){const t=be(e),n=t[t.findIndex((t=>t.id===e))+1]??t[0];n&&ht({ids:[n.id]})}function Ve(e){const t=be(e),n=t[t.findIndex((t=>t.id===e))-1]??t[t.length-1];n&&ht({ids:[n.id]})}function qe(e){ht({ids:[...we(e).map((e=>e.id)),e]})}function He(e){ht({ids:[...xe(e).map((e=>e.id)),e]})}function Fe(){p.toggleZoomMode({canvasViewport:re.value,canvasDimensions:se.value,selectedNodes:I.value,setViewport:de,fitView:L,zoomTo:U,setCenter:ce})}an(g((()=>{const e={ctrl_shift_o:Rt((e=>i("open:sub-workflow",e))),ctrl_c:{disabled:()=>ge(R.value),run:Dt((e=>i("copy:nodes",e)))},enter:Rt((e=>lt(e))),ctrl_a:()=>S(te.value),"shift_+|+|=|shift_Equal|Equal":async()=>await Ht(),"shift+_|-|_|shift_Minus|Minus":async()=>await Ft(),0:async()=>await Yt(),1:async()=>await qt(),ArrowUp:Rt(Ve),ArrowDown:Rt(Pe),ArrowLeft:Rt(Re),ArrowRight:Rt(Le),shift_ArrowLeft:Rt(He),shift_ArrowRight:Rt(qe),l:()=>i("update:logs-open"),i:()=>i("update:logs:input-open"),o:()=>i("update:logs:output-open"),z:Fe};return s.readOnly?e:{...e,ctrl_x:Dt((e=>i("cut:nodes",e))),"delete|backspace":Dt((e=>i("delete:nodes",e))),ctrl_d:Dt((e=>i("duplicate:nodes",e))),d:Dt((e=>i("update:nodes:enabled",e))),p:Dt((e=>i("update:nodes:pin",e,"keyboard-shortcut"))),f2:Rt((e=>i("update:node:name",e))),n:()=>i("create:node","node_shortcut"),tab:{disabled:()=>h.isCalloutDismissed(rn),run:()=>{s.eventBus.emit("deprecated:tab-shortcut")}},shift_s:()=>i("create:sticky"),shift_f:()=>i("toggle:focus-panel"),ctrl_alt_n:()=>i("create:workflow"),ctrl_enter:()=>i("run:workflow"),ctrl_s:()=>{},shift_alt_t:async()=>await on({source:"keyboard-shortcut"}),alt_x:Dt((e=>i("extract-workflow",e))),c:()=>i("start-chat"),r:Rt((e=>i("replace:node",e))),shift_alt_u:Rt((e=>i("copy:test:url",e))),alt_u:Rt((e=>i("copy:production:url",e))),alt_i:Dt((e=>{return t=e,void(f.isFeatureEnabled&&(f.confirmNodes(t,"context_menu"),_.open({mode:"builder"})));var t}))}})),{disabled:je});const We=g((()=>I.value.length>0)),Ye=g((()=>I.value.map((e=>e.id)))),Xe=d(),Ue=function(e,t,n){const o=d(),a=G((a=>{const i=t.viewportRef.value?.getBoundingClientRect();if(!i)return;const r=t.project({x:a.clientX-i.x,y:a.clientY-i.y});o.value=e.value.flatMap((e=>{if(e.data?.disabled)return[];const o=t.nodeLookup.value.get(e.id);if(!o)return[];const a=it([o]),i=n(a);if(i.x>r.x||r.x>i.x+i.width||i.y>r.y||r.y>i.y+i.height)return[];const s=a.x+a.width/2-r.x,l=a.y+a.height/2-r.y;return[{id:e.id,squareDistance:s**2+l**2}]})).toSorted(((e,t)=>e.squareDistance-t.squareDistance))[0]?.id}),200,!0,!0);return x((()=>{t.vueFlowRef.value?.addEventListener("mousemove",a)})),k((()=>{t.vueFlowRef.value?.removeEventListener("mousemove",a)})),{id:o}}(g((()=>s.nodes.filter((e=>e.data?.render.type===Me.Default&&e.data.render.options.trigger)))),M,(e=>({x:e.x-2*e.width,y:e.y-e.height,width:4*e.width,height:3*e.height})));function Ze(e,t){i("click:node:add",e,t)}function Ke(e){i("update:nodes:position",e)}function Qe(e,t){i("update:node:position",e,t)}function Je(e){Ke(e.nodes.map((({id:e,position:t})=>({id:e,position:t}))))}function ot({event:e,node:t}){_.isOpen&&f.isFeatureEnabled&&f.setUnconfirmedFromCanvasSelection([t.id]),i("click:node",t.id,Pt(e)),e.ctrlKey||e.metaKey||I.value.length<2||ht({ids:[t.id]})}function at(e){Ke(e.nodes.map((({id:e,position:t})=>({id:e,position:t}))))}function st(e){1===I.value.length&&(le.value=!1),i("selection:end",Pt(e))}function lt(e,t){s.eventBus.emit("nodes:action",{ids:[e],action:"update:node:activated"}),i("update:node:activated",e,t)}function ut(e){i("update:node:deactivated",e)}function dt(){B(I.value)}function ct(){i("update:node:selected",Xe.value?.id)}function ht({ids:e,panIntoView:t}){if(dt(),S(e.map(ae).filter(rt)),t){const t=e.map(ae).filter(rt);if(0===t.length)return;de(nt(re.value,se.value,t,100),{duration:200,interpolate:"linear"})}}function pt(e){i("update:node:enabled",e)}function vt(e){i("delete:node",e)}function ft(e,t){i("update:node:parameters",e,t)}function gt(e){i("update:node:inputs",e),b((()=>M.updateNodeInternals([e])))}function _t(e){i("update:node:outputs",e),b((()=>M.updateNodeInternals([e])))}function mt(e){const t=M.nodeLookup.value.get(e);t&&(S([t]),p.focusNode(t,{canvasViewport:re.value,canvasDimensions:se.value,setCenter:ce}))}function yt(e){i("replace:node",e)}function bt(e){f.confirmNodes([e],"context_menu"),_.open({mode:"builder"})}O(I,(e=>{Xe.value&&e.find((e=>e.id===Xe.value?.id))||(Xe.value=e[e.length-1])})),O(Ye,(e=>{_.isOpen&&f.isFeatureEnabled&&f.setUnconfirmedFromCanvasSelection(e)})),O((()=>_.isOpen),(e=>{e&&Ye.value.length>0&&f.isFeatureEnabled&&f.setUnconfirmedFromCanvasSelection(Ye.value)}));const wt=d(!1),kt=d(),zt=d();function Nt(e){i("create:connection:start",e),kt.value=e,wt.value=!1}function Ct(e){i("create:connection",e),zt.value=e,wt.value=!0}function Tt(e){zt.value?i("create:connection:end",zt.value,e):kt.value&&i("create:connection:cancelled",kt.value,Pt(e),e),zt.value=void 0,kt.value=void 0}function Mt(e){i("delete:connection",e)}function It(e){i("click:connection:add",e)}const Ot=d("custom-arrow-head"),St=d({}),$t=d({});pe((({edge:e})=>{$t.value={[e.id]:!0},St.value={[e.id]:!0}})),ve(G((({edge:e,event:t})=>{e.data.source.type===xt.AiTool&&(!e.data.maxConnections||e.data.maxConnections>1)&&(Pt(t).y-e.targetY<64?$t.value={[e.id]:!1}:$t.value={[e.id]:!0})}),100)),he((({edge:e})=>{$t.value={[e.id]:!1},St.value={[e.id]:!1}}));const At=d({});function jt(e){i("run:node",e)}function Dt(e){return()=>{We.value&&e(Ye.value)}}function Rt(e){return()=>{Xe.value&&e(Xe.value.id)}}fe((({node:e})=>{At.value={[e.id]:!0}})),_e((({node:e})=>{At.value={[e.id]:!1}}));const Lt=d(!1);function Pt(e){const t=R.value?.getBoundingClientRect()??{left:0,top:0},[n,o]=e?$e(e):[0,0];return ee({x:n-t.left,y:o-t.top})}function Vt(e){i("click:pane",Pt(e))}async function qt(){await L({maxZoom:1,padding:.2})}async function Ht(){await W()}async function Ft(){await Y()}async function Yt(){await async function(e){await U(e)}(1)}function Xt({event:e}){(Se.value||e instanceof WheelEvent)&&(Lt.value=!0)}function Gt(){Lt.value=!1}function Zt(){i("viewport:change",re.value,se.value)}!function(e,t,n){const o=d();O(e,((e,t,n)=>{if(!e)return;const a=new ResizeObserver((e=>{const t=e[0];t&&(o.value=t.contentRect)}));o.value={x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight},a.observe(e),n((()=>a.disconnect()))}),{immediate:!0}),O(o,(async(e,o)=>{e&&o&&await n({x:t.value.x+(e.width-o.width)/2,y:t.value.y+(e.height-o.height)/2,zoom:t.value.zoom})}))}(R,re,de);const Kt=g((()=>s.nodes.reduce(((e,t)=>(e[t.id]=t.data,e)),{}))),Qt=Nn();function Jt(e,t){Qt.open(e,{source:"canvas",nodeIds:Ye.value,...t})}function en({event:e}){Jt(e)}function tn(e,t,n){"node-button"===n?Qt.open(t,{source:n,nodeId:e}):Ye.value.length>1&&Ye.value.includes(e)?Jt(t,{nodeId:e}):(ht({ids:[e]}),Qt.open(t,{source:n,nodeId:e}))}async function nn(e,t){switch(e){case"add_node":return i("create:node","context_menu");case"add_sticky":return i("create:sticky");case"copy":return i("copy:nodes",t);case"delete":return i("delete:nodes",t);case"select_all":return S(te.value);case"deselect_all":return dt();case"duplicate":return i("duplicate:nodes",t);case"toggle_pin":return i("update:nodes:pin",t,"context-menu");case"execute":return i("run:node",t[0]);case"copy_production_url":return i("copy:production:url",t[0]);case"copy_test_url":return i("copy:test:url",t[0]);case"toggle_activation":return i("update:nodes:enabled",t);case"open":return lt(t[0]);case"rename":return i("update:node:name",t[0]);case"replace":return i("replace:node",t[0]);case"change_color":return s.eventBus.emit("nodes:action",{ids:t,action:"update:sticky:color"});case"tidy_up":return await on({source:"context-menu"});case"extract_sub_workflow":return i("extract-workflow",t);case"open_sub_workflow":return i("open:sub-workflow",t[0]);case"focus_ai_on_selected":return f.confirmNodes(t,"context_menu"),void _.open({mode:"builder"})}}async function on(e){e.nodeIdsFilter&&e.nodeIdsFilter.length>0&&(dt(),S(e.nodeIdsFilter.map(ae).filter(rt)));const t=I.value.length>1,n=t?"selection":"all";i("tidy-up",{result:ke(n),target:n,source:e.source},{trackEvents:e.trackEvents,trackHistory:e.trackHistory,trackBulk:e.trackBulk}),await b(),t?await async function(e){await P(it(e),{padding:2})}(I.value):await qt()}function sn(e){e.preventDefault()}function ln(e){i("drag-and-drop",Pt(e),e)}const un=d(null),dn=d(!1);function cn(e){return`minimap-node-${e.data?.render.type.replace(/\./g,"-")??"default"}`}function hn(){un.value&&(clearTimeout(un.value),un.value=null),dn.value=!0}function pn(){un.value=setTimeout((()=>{dn.value=!1}),1e3)}function vn(){hn()}function fn(){pn()}function gn(){Ae()}O(Lt,(e=>{e?hn():pn()}));const _n=d(!1);let mn=!1,yn=null;function bn(){_n.value?qt():mn=!0}function wn(e){_n.value=!1,yn=e}return x((()=>{s.eventBus.on("fitView",qt),s.eventBus.on("fitView:onNodesInit",bn),s.eventBus.on("setConnections:onNodesInit",wn),s.eventBus.on("nodes:select",ht),s.eventBus.on("nodes:selectAll",(()=>S(te.value))),s.eventBus.on("tidyUp",on),window.addEventListener("blur",gn)})),k((()=>{s.eventBus.off("fitView",qt),s.eventBus.off("fitView:onNodesInit",bn),s.eventBus.off("setConnections:onNodesInit",wn),s.eventBus.off("nodes:select",ht),s.eventBus.off("tidyUp",on),window.removeEventListener("blur",gn)})),ne((async()=>{s.initialViewport?await de(s.initialViewport):await qt(),Ee.value=!0})),oe((()=>{if(_n.value=!0,yn){const e=yn;yn=null,et().setConnections(e)}mn&&(mn=!1,qt())})),O([()=>s.readOnly,()=>s.suppressInteraction],(([e,t])=>{Z(!e&&!t),Q.value=!t}),{immediate:!0}),O([le,ue],(([e,t])=>i("update:has-range-selection",e||(t?.width??0)>0||(t?.height??0)>0))),O([M.nodes,()=>p.nodeNameToBeFocused],(([e,t])=>{const n=t&&e.find((e=>e.data.name===t));n&&setTimeout((()=>{p.focusNode(n,{canvasViewport:re.value,canvasDimensions:se.value,setCenter:ce})}))})),V(Et,{connectingHandle:kt,isExecuting:r(s,"executing"),initialized:_n,viewport:re,isExperimentalNdvActive:N,isPaneMoving:Lt}),t({executeContextMenuAction:nn}),(t,n)=>(a(),F(w(De),{id:e.id,nodes:e.nodes,edges:e.connections,class:z(Ne.value),"apply-changes":!1,"connection-line-options":{markerEnd:w(Be).ArrowClosed},"connection-radius":60,"pan-on-drag":Ie.value,"pan-on-scroll":"","snap-to-grid":"","snap-grid":[w(16),w(16)],"min-zoom":0,"max-zoom":w(p).isZoomedViewEnabled?w(p).maxCanvasZoom:4,"selection-key-code":Oe.value,"zoom-activation-key-code":Ce.value,"pan-activation-key-code":Ce.value,"disable-keyboard-a11y":!0,"delete-key-code":null,"data-test-id":"canvas",onConnectStart:Nt,onConnect:Ct,onConnectEnd:Tt,onPaneClick:Vt,onPaneContextMenu:Jt,onMove:Xt,onMoveEnd:Gt,onNodeDragStop:Je,onNodeClick:ot,onSelectionDragStop:at,onSelectionEnd:st,onSelectionContextMenu:en,onDragover:sn,onDrop:ln,onViewportChange:Zt},{"node-canvas-node":X((n=>[$(t.$slots,"node",H(u({nodeProps:n})),(()=>[A(Dr,y(n,{data:Kt.value[n.id],"read-only":e.readOnly,"event-bus":e.eventBus,hovered:At.value[n.id],"nearby-hovered":n.id===w(Ue).id.value,highlighted:w(E).highlightedNodeIds.has(n.id),onDelete:vt,onRun:jt,onSelect:ct,onToggle:pt,onActivate:lt,onDeactivate:ut,"onOpen:contextmenu":tn,onUpdate:ft,"onUpdate:inputs":gt,"onUpdate:outputs":_t,onMove:Qe,onAdd:Ze,onFocus:mt,"onReplace:node":yt,"onAdd:ai":bt}),v({_:2},[t.$slots.nodeToolbar?{name:"toolbar",fn:X((e=>[$(t.$slots,"nodeToolbar",H(u(e)),void 0,!0)])),key:"0"}:void 0]),1040,["data","read-only","event-bus","hovered","nearby-hovered","highlighted"])]),!0)])),"edge-canvas-edge":X((n=>[$(t.$slots,"edge",H(u({edgeProps:n,arrowHeadMarkerId:Ot.value})),(()=>[A(bi,y(n,{"marker-end":`url(#${Ot.value})`,"read-only":e.readOnly,hovered:St.value[n.id],"bring-to-front":$t.value[n.id],onAdd:It,onDelete:Mt,"onUpdate:label:hovered":e=>function(e,t){$t.value={[e]:!0},St.value[e]=t}(n.id,e)}),null,16,["marker-end","read-only","hovered","bring-to-front","onUpdate:label:hovered"])]),!0)])),"connection-line":X((e=>[A(Fa,H(u(e)),null,16)])),default:X((()=>[A(La,{id:Ot.value},null,8,["id"]),$(t.$slots,"canvas-background",H(u({viewport:w(re)})),(()=>[A(kn,{viewport:w(re),striped:e.readOnly},null,8,["viewport","striped"])]),!0),A(j,{name:"minimap"},{default:X((()=>[C(A(w(Da),{"data-test-id":"canvas-minimap","aria-label":"n8n Minimap",height:120,width:200,position:w(Ge).BottomLeft,pannable:"",zoomable:"","node-class-name":cn,"node-border-radius":16,onMouseenter:vn,onMouseleave:fn},null,8,["position"]),[[D,dn.value]])])),_:1}),e.hideControls?m("",!0):(a(),F(pi,{key:0,"data-test-id":"canvas-controls",class:z(w(o).canvasControls),position:e.controlsPosition,"show-interactive":!1,zoom:w(re).zoom,"read-only":e.readOnly,"is-experimental-ndv-active":N.value,onZoomToFit:qt,onZoomIn:Ht,onZoomOut:Ft,onResetZoom:Yt,onTidyUp:n[0]||(n[0]=e=>on({source:"canvas-button"})),onToggleZoomMode:Fe},null,8,["class","position","zoom","read-only","is-experimental-ndv-active"])),(a(),F(q,null,{default:X((()=>[A(Tn,{onAction:nn})])),_:1}))])),_:3},8,["id","nodes","edges","class","connection-line-options","pan-on-drag","snap-grid","max-zoom","selection-key-code","zoom-activation-key-code","pan-activation-key-code"]))}}),e("n",pe(Rr,[["__cssModules",{$style:{canvas:"_canvas_wikel_125",ready:"_ready_wikel_131",isExperimentalNdvActive:"_isExperimentalNdvActive_wikel_134"}}],["__scopeId","data-v-036e831c"]]))}}}));
//# sourceMappingURL=useCanvasMapping-legacy-ESpJuxNZ.js.map